Comprehensive guide to devsecops developer experience covering architecture, implementation, testing, and operational patterns for production engineering teams.
DevSecOps Developer Experience is the sum of a developer’s daily interactions with security tooling across the software lifecycle—how they discover, adopt, debug, and iterate on security practices. It matters when security is not a separate gate, but a continuous, visible, and integrated part of development. It is the difference between a developer running git commit and seeing a security report appear in their PR, and a developer who must jump between dashboards, scripts, and CI logs to understand why their code failed a security check.
Onboarding a new developer to a security-enabled project means they can run git commit and immediately see a security report. The first commit should produce a security artifact with no manual steps.
After cloning the repository, a developer runs:
git checkout -b feature/new-login
echo "Add OAuth login" >> README.md
git add README.md
git commit -m "feat: add OAuth login"
The commit triggers a CI pipeline that runs docker build and trivy image:
name: Security Scan
on: [push]
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
docker build -t myapp:latest .
trivy image --exit-code 1 --severity HIGH,CRITICAL myapp:latest
The trivy image command produces structured output:
{
"Results": [
{
"Target": "myapp:latest",
"Class": "container",
"Type": "docker",
"Vulnerabilities": [
{
"VulnerabilityID": "CVE-2023-1234",
"Title": "SQL Injection in libpq",
"Severity": "HIGH",
"CVSS": {
"Score": 7.5,
"Vector": "AV:N/AC:L/Au:S/C:P/I:P/A:P"
},
"InstalledVersion": "15.2",
"FixedVersion": "15.3"
},
{
"VulnerabilityID": "CVE-2023-5678",
"Title": "Race Condition in Go runtime",
"Severity": "CRITICAL",
"CVSS": {
"Score": 9.1,
"Vector": "AV:N/AC:H/Au:N/C:H/I:H/A:H"
},
"InstalledVersion": "1.20.4",
"FixedVersion": "1.21.0"
}
]
}
]
}
If any vulnerability is CRITICAL, the trivy image command exits with code 1, failing the CI job. The developer sees:
Error: 2 vulnerabilities found
- CVE-2023-5678: Race Condition in Go runtime (CRITICAL)
- CVE-2023-1234: SQL Injection in libpq (HIGH)
Run `trivy image --severity HIGH,CRITICAL myapp:latest` to see details.
This is the first touchpoint: the developer sees security as part of their workflow, not a separate artifact.
A developer working locally wants to test security changes before pushing. The ideal loop is:
make build
make test
make security
The make security command runs a full security assessment on the local build:
security:
docker build -t app:local .
trivy image --exit-code 1 --severity HIGH,CRITICAL --output report.json app:local
@echo "Security report saved to report.json"
@echo "Run 'trivy image --help' to see options."
The developer runs make security and sees:
Error: 1 vulnerability found
- CVE-2023-1234: SQL Injection in libpq (HIGH)
See report.json for details.
The report.json file is consumed by the editor. A VS Code extension reads it and shows inline annotations:
{
"results": [
{
"target": "app:local",
"vulnerabilities": [
{
"vulnerability_id": "CVE-2023-1234",
"title": "SQL Injection in libpq",
"severity": "HIGH",
"description": "The libpq library does not properly escape user input in prepared statements.",
"references": [
"https://www.postgresql.org/docs/15/libpq.html",
"https://nvd.nist.gov/vuln/detail/CVE-2023-1234"
],
"details": [
"Affected: libpq 15.2",
"Fixed in: 15.3",
"Impact: data exposure and privilege escalation"
]
}
]
}
]
}
The developer opens the file and sees a red squiggly line under db.Connect in main.go, with the tooltip:
> SQL Injection in libpq (HIGH): The libpq library does not properly escape user input in prepared statements. Affected: libpq 15.2. Fixed in: 15.3.
They can click to open the NVD link or jump to the db.Connect function.
The feedback loop is closed: a code change → build → security scan → visible report → actionable feedback.
A pull request triggers a security scan that annotates the PR with findings. The workflow uses trivy and github-actions:
name: Security in PR
on:
pull_request:
branches: [main]
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
docker build -t app:pr-${{ github.sha }} .
trivy image --exit-code 1 --severity HIGH,CRITICAL \
--format json \
--output report.json \
app:pr-${{ github.sha }}
- run: |
curl -X POST \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/json" \
-d @report.json \
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.number }}/comments"
The trivy image output includes a findings array with file, line, and message fields. The PR comment includes:
!Security: HIGH.If the PR introduces a new critical vulnerability, the comment includes:
> 🔴 Security: Critical > The build introduced a new vulnerability: > - CVE-2023-5678: Race Condition in Go runtime (CRITICAL) > - Affected: Go 1.20.4 > - Fixed in: 1.21.0 > - Impact: Remote code execution possible > - Read more on NVD
The developer can click "View details" and see the full report.json in a collapsible section.
A developer discovers a new dependency vulnerability in a go.mod file. They run:
go get github.com/gorilla/mux
The go.sum file updates, and a CI job runs go list -m all | go mod graph | depcheck and snyk test:
- run: |
go mod tidy
go list -m all > deps.txt
snyk test --file=go.mod --json > snyk-results.json
The snyk-results.json includes:
{
"vulnerabilities": [
{
"id": "SNYK-GO-GORILLAMUX-12345",
"title": "Cross-Site Scripting in Gorilla Mux",
"severity": "HIGH",
"package": "github.com/gorilla/mux",
"version": "1.8.0",
"fixedIn": "1.8.1",
"description": "The mux package does not sanitize query parameters in path templates.",
"references": [
"https://github.com/gorilla/mux/issues/345",
"https://www.owasp.org/index.php/Cross-site_Scripting_(XSS)"
],
"cvss": {
"score": 7.2,
"vector": "AV:N/AC:L/Au:S/C:L/I:H/A:N"
}
}
],
"summary": {
"total": 3,
"high": 2,
"medium": 1
}
}
The CI job fails if any vulnerability is CRITICAL or HIGH and outputs:
Error: 2 vulnerabilities found
- SNYK-GO-GORILLAMUX-12345: Cross-Site Scripting in Gorilla Mux (HIGH)
- SNYK-GO-JSON-67890: Insecure JSON parsing (CRITICAL)
The developer can run snyk monitor locally to track vulnerabilities over time:
snyk monitor --file=go.mod --org=myorg
This command uploads the dependency graph and vulnerability data to a central dashboard, which provides a changelog of new vulnerabilities and a trend graph.
The devsecops workflow includes a security job that runs on every push and PR. It is not a supplement but a required step.
The workflow includes:
- name: Security
run: |
docker build -t app:latest .
trivy image --exit-code 1 --severity HIGH,CRITICAL app:latest
snyk test --file=go.mod --json > snyk.json
git diff --name-only HEAD~1..HEAD > changes.txt
echo "Security check passed" > status.txt
echo "Report: https://security.mycompany.com/reports/$(git rev-parse --short HEAD)" >> status.txt
cat status.txt
The output includes:
Security check passed
Report: https://security.mycompany.com/reports/abc1234
The status.txt file is used by a status service that updates a dashboard:
POST /api/status
{
"build_id": "abc1234",
"status": "success",
"report_url": "https://security.mycompany.com/reports/abc1234",
"timestamp": "2024-04-15T12:34:56Z",
"ci": "github"
}
The dashboard shows a timeline of security checks, with color-coded results and links to detailed reports.
The most common failure is missing the --exit-code 1 flag on trivy image. Without it, a CI job passes even with critical vulnerabilities. A developer runs trivy image myapp:latest and sees 20 high-severity issues, but the CI job passes. The fix is simple:
trivy image --exit-code 1 --severity HIGH myapp:latest
Another common mistake is confusing --severity HIGH,CRITICAL with --severity HIGH --severity CRITICAL. The former treats HIGH,CRITICAL as a single value, so only vulnerabilities with severity: "HIGH,CRITICAL" are selected. The correct command uses a comma-separated list:
trivy image --severity HIGH,CRITICAL app:latest
A subtle edge: trivy image outputs JSON, but the --format json flag is optional. A developer expects --format json but forgets it. The output is a flat JSON object, not an array of results.
Another sharp edge: the snyk test command does not fail on critical vulnerabilities by default. The developer must add --fail-on=CRITICAL or --fail-on=HIGH.
A common mistake is forgetting to commit the snyk-results.json file. The CI job runs snyk test, but the results are not persisted. The developer sees the output but cannot correlate it with a specific commit.
Finally, developers often run snyk monitor but forget to run snyk ci in CI. The snyk ci command integrates with the CI system and returns a 1 exit code if any vulnerability is found, making it suitable as a required step.
DevSecOps Developer Experience is the continuous, integrated, and visible interaction between a developer and security tooling. It begins with the first git commit, is shaped by local feedback loops, and is reinforced by CI/CD annotations. The developer sees security as part of their workflow, not as a separate task. The key tools—trivy, snyk, git, docker, curl, psql—are used in a consistent way across projects. The developer learns to expect structured output, exit codes, and actionable reports. The workflow is not just a sequence of commands, but a shared language between development and security.
This page was rewritten on 12 October 2026. It replaced a templated version that was not specific to its own title. How these pages are written and checked. If anything here is wrong, tell us at [email protected] and we will correct it.
We use cookies for analytics (Google Analytics) and advertising (Google AdSense) to improve your experience and support free content. Privacy Policy