Software developers already possess a substantial portion of what makes an effective security practitioner. You understand how applications are built, how data flows through systems, how APIs communicate, and how to read and write code. The gap between development and security is not a canyon — it is a shift in perspective. You move from asking “does this work?” to “how can this be abused?” and “what happens when it fails?”
This guide is written from a software engineering perspective. It maps your existing skills to security domains, identifies what to learn next, outlines career paths that value development experience, provides a hands-on lab you can run locally, and includes a 90-day transition roadmap with a downloadable toolkit.
The Developer Skills That Already Transfer
The table below maps common software development capabilities to their direct security applications. For each skill, the “What You Already Know” column describes the developer competence; the “Security Application” column explains how security teams use it; the “Practical Example” column gives a concrete scenario.
| Developer Skill | What You Already Know | Security Application | Practical Example |
|---|---|---|---|
| Programming & scripting | Python, JavaScript/TypeScript, Go, Java, Bash, PowerShell | Writing detection rules, automating security tasks, building security tools, analyzing malware, scripting incident response | Write a Python script that parses CloudTrail logs for suspicious IAM changes; create a GitHub Action that fails builds on high-severity SAST findings |
| Application architecture | Microservices, monoliths, event-driven systems, message queues, caching layers | Threat modeling, identifying trust boundaries, attack surface analysis, data flow diagramming | Draw a threat model for your current application showing trust boundaries between the API gateway, services, and databases |
| APIs & authentication | REST, GraphQL, gRPC, JWT, OAuth 2.0/OIDC, API keys, session cookies | Authentication bypass testing, authorization flaws (IDOR, BOLA), token validation, API security testing | Test your own API for broken object-level authorization by manipulating resource IDs in requests |
| Databases & SQL | SQL, ORMs, migrations, indexing, transactions, connection pooling | SQL injection testing, data exposure analysis, audit logging, sensitive data discovery | Review your ORM usage for raw query concatenation; build a script that scans database schemas for unencrypted PII columns |
| Git & version control | Branching, merging, rebasing, code review, commit signing, Git hooks | Supply chain security, secret detection in history, commit signing verification, provenance | Configure pre-commit hooks with Gitleaks; enable required signed commits and branch protection rules |
| Debugging & troubleshooting | Stack traces, logging, profiling, core dumps, distributed tracing | Incident investigation, root cause analysis, forensic artifact collection, log analysis | Use distributed tracing to reconstruct an attack timeline across microservices during a tabletop exercise |
| Linux & command line | File permissions, processes, systemd, ssh, grep/awk/sed, package managers | Host hardening, log analysis, container security, privilege escalation paths, forensic acquisition | Audit SSH configuration against CIS benchmarks; write a Bash script that checks for world-writable files in /etc |
| Networking fundamentals | TCP/IP, DNS, HTTP/HTTPS, TLS, load balancers, firewalls, VPCs | Network segmentation, traffic analysis, TLS configuration review, certificate management, zero trust | Test your application’s TLS configuration with testssl.sh; verify security group rules allow only necessary ports |
| Testing & automation | Unit tests, integration tests, contract tests, property-based testing, fuzzing | Security regression testing, fuzzing inputs, chaos engineering for resilience, automated vulnerability scanning | Add a fuzzing target for your API input validation; integrate OWASP ZAP into CI for authenticated DAST scans |
| CI/CD pipelines | GitHub Actions, GitLab CI, Jenkins, build stages, artifacts, caching, environments | Pipeline security (SAST/DAST/SCA), artifact signing, SLSA provenance, deployment gates, policy as code | Build a pipeline that runs Trivy on container images, Checkov on Terraform, and Gitleaks on every push |
| Cloud & containers | AWS/Azure/GCP services, Docker, Kubernetes, serverless, IaC (Terraform/CloudFormation) | Cloud security posture management, container runtime security, serverless function permissions, IaC scanning | Scan your Terraform with tfsec before apply; implement Pod Security Standards and NetworkPolicies in Kubernetes |
| Code reviews & collaboration | PR reviews, design docs, RFCs, pair programming, documentation | Secure code review checklists, threat model reviews, security champion programs, developer education | Create a secure code review checklist covering input validation, authz, crypto usage, and logging |
Key insight: You are not starting from zero. You are adding a security lens to skills you already use daily. The transition is about learning what to look for and how to validate — not learning entirely new toolchains from scratch.
What Changes When You Move into Security?
The fundamental shift is in mindset. As a developer, your primary goal is delivering functional features. In security, your goal is understanding how those features can fail, be abused, or expose the organization to risk. This does not mean abandoning development thinking — it means extending it.
From “Does it work?” to “How does it fail?”
| Developer Mindset | Security Mindset | Example |
|---|---|---|
| Happy path first | Edge cases and failure modes first | A file upload feature: developer tests valid PDFs; security tests 5GB executables, polyglot files, path traversal in filenames |
| Trust internal components | Verify trust boundaries | A service-to-service call: developer assumes the caller is authenticated; security validates mTLS, checks JWT claims, enforces least-privilege scopes |
| Optimize for velocity | Optimize for resilience | A database query: developer adds an index for speed; security ensures the query uses parameterized statements and the DB user has read-only access |
| Handle errors gracefully | Fail securely | An authentication error: developer returns a generic message; security ensures the error does not leak whether a username exists (preventing enumeration) |
| Assume valid input | Assume hostile input | An API endpoint: developer validates required fields; security validates length, type, encoding, character sets, and business logic constraints |
Core Security Concepts for Developers
Threat modeling — A structured approach to identifying what you are building, what can go wrong, and what you will do about it. The STRIDE model (Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, Elevation of Privilege) gives you a vocabulary. Start by diagramming your application’s data flows, marking trust boundaries, and asking “what if this component is compromised?” for each boundary crossing.
Attack surface — The sum of all points where an unauthorized user can try to enter or extract data. Every API endpoint, open port, third-party integration, and exposed database increases surface area. Reducing attack surface means: fewer public endpoints, stricter network policies, minimal container base images, and least-privilege IAM.
Trust boundaries — Lines in your architecture where trust assumptions change. Cross a boundary (e.g., from frontend to API, from API to database, from your cloud to a third-party SaaS), and you must validate, authorize, and encrypt. Never trust data simply because it came from “inside.”
Least privilege — Every component (service, user, process, container) should have only the permissions it needs to function. In practice: database users with SELECT-only on specific tables; CI/CD runners with scoped tokens; Lambda functions with resource-specific IAM policies; Kubernetes service accounts with RBAC limited to their namespace.
Secure defaults — Systems should be secure without requiring explicit configuration. Examples: frameworks that auto-escape output by default (preventing XSS); ORMs that parameterize queries by default (preventing SQLi); TLS 1.2+ enforced by default; cookies with Secure, HttpOnly, SameSite=Strict by default.
Defense in depth — No single control is sufficient. Layer controls so that if one fails, others still protect. Example: a web application uses input validation (layer 1), output encoding (layer 2), a WAF (layer 3), CSP headers (layer 4), and secure cookies (layer 5). An attacker must bypass all layers.
Vulnerability identification and risk prioritization — Not all findings are equal. Learn to assess: exploitability (can this be triggered remotely without auth?), impact (what data or access is gained?), context (is this in a public-facing API or an internal admin tool?), and compensating controls (is there a WAF, rate limiting, or monitoring?). A critical CVE in an unused dependency is lower risk than a medium-severity IDOR in your payment API.
Security impact vs. functional bugs — A functional bug breaks a feature for users. A security bug breaks the trust model of the system. A login page that crashes on special characters is a functional bug. A login page that reveals whether an email is registered via timing differences is a security bug (user enumeration). Both need fixing; the security bug enables further attacks.
Which Security Career Paths Fit Developers?
Not all security roles require the same background. The table below compares paths that naturally align with software development experience.
| Role | Typical Responsibilities | Relevant Dev Skills | Additional Security Knowledge Needed | Example Tools | Natural Transition? |
|---|---|---|---|---|---|
| Application Security Engineer | Secure code review, threat modeling, SAST/DAST/IAST tooling, developer training, vulnerability triage | Code review, architecture understanding, multiple languages, CI/CD, testing frameworks | OWASP Top 10/ASVS, vulnerability classes, secure coding patterns, risk assessment | Semgrep, CodeQL, SonarQube, Burp Suite, OWASP ZAP, Checkmarx | Yes — closest to daily dev work |
| Product Security Engineer | Security features in product (auth, encryption, audit logs), security architecture reviews, customer security inquiries, compliance evidence | Feature development, API design, customer-facing communication, documentation | Product threat modeling, regulatory requirements (SOC 2, GDPR), secure SDLC, supply chain | Auth0/Okta integration, cryptography libraries, SBOM tools (Syft), policy as code (OPA) | Yes — builds security into products |
| DevSecOps Engineer | CI/CD security gates, pipeline hardening, secret scanning, dependency scanning, container scanning, policy as code | GitHub Actions/GitLab CI/Jenkins, Docker, Kubernetes, Terraform, scripting, artifact management | Security tool integration, false positive tuning, SLSA/SSDF, runtime security, admission controllers | Trivy, Grype, Gitleaks, Checkov, tfsec, Cosign, Kyverno, OPA Gatekeeper | Yes — extends existing pipeline skills |
| Security Engineer (Platform/Infra) | Cloud security posture, IAM, network security, logging/monitoring, incident response, hardening | Cloud services, IaC, Linux, networking, automation, monitoring/observability | Cloud threat models, detection engineering, compliance frameworks, forensic readiness | AWS Security Hub, GuardDuty, Falco, Wazuh, Terraform, CloudTrail | Yes — strong infra/cloud overlap |
| Cloud Security Engineer | CSPM, CIEM, data protection, serverless security, container security, multi-cloud governance | Cloud provider services, IaC, containers, serverless, automation | Shared responsibility model, cloud-specific threats, identity-centric perimeter, compliance | Wiz, Orca, Prisma Cloud, Defender for Cloud, ScoutSuite, Prowler | Yes — if you have cloud experience |
| Penetration Tester | Web app testing, API testing, mobile testing, network testing, reporting, retesting | HTTP/REST, authentication flows, input validation, debugging, scripting | Methodology (PTES, OSSTMM), exploitation techniques, post-exploitation, reporting standards, legal/ethical | Burp Suite, OWASP ZAP, Nmap, Metasploit, ffuf, SQLMap, custom scripts | Partial — requires offensive mindset shift |
| Security Automation Engineer | Building security tools, SOAR playbooks, detection rules, alert enrichment, API integrations | Software engineering, APIs, scripting, CI/CD, testing, observability | Detection logic (Sigma, YARA), ATT&CK framework, SIEM internals, incident response workflows | Splunk/Sentinel/Elastic, SOAR (Cortex XSOAR, Tines), Sigma, Python/Go | Yes — pure engineering role |
| Security-Focused Software Engineer | Building security features (auth, secrets mgmt, audit logging, policy engine), internal security platforms | Full software lifecycle, system design, performance, reliability, testing | Security requirements engineering, cryptography basics, compliance as code, threat modeling | Languages/frameworks of the org, cryptography libraries, policy engines (OPA/Cedar) | Yes — stays in development track |
Choosing your path: If you enjoy code review and working with developers → AppSec. If you like building pipelines and automation → DevSecOps. If you prefer cloud architecture and infrastructure → Cloud Security. If you want to build security products → Product Security or Security-Focused SWE. If you like breaking things and have a methodical mindset → Penetration Testing (consider OSCP). If you love writing tools and automating detection → Security Automation.
What Should Developers Learn Next?
You do not need to master everything. Prioritize based on your target role. The matrix below uses a priority scale: P0 = learn first (foundational), P1 = learn early (core), P2 = learn as needed for your path.
Foundation (P0–P1)
| Topic | Priority | Why It Matters | Recommended Resources |
|---|---|---|---|
| TCP/IP, DNS, HTTP/HTTPS, TLS | P0 | All networked applications rely on these; you cannot secure what you don’t understand | “Computer Networking: A Top-Down Approach” (Kurose/Ross); MDN HTTP Guide; SSL Labs Best Practices |
| Linux fundamentals (permissions, processes, logging, ssh, systemd) | P0 | Most servers and containers run Linux; host and container security require this | Linux Journey; CIS Linux Benchmarks; OverTheWire Bandit |
| Authentication & authorization (OAuth 2.0, OIDC, SAML, JWT, RBAC, ABAC) | P0 | Identity is the new perimeter; most breaches involve auth failures | OAuth 2.0 Spec; OIDC Spec; JWT.io |
| Encryption basics (symmetric/asymmetric, hashing, KDFs, digital signatures, certificates, key management) | P0 | Protecting data at rest and in transit; implementing auth correctly | Crypto 101; NIST SP 800-57; Age encryption |
| OWASP Top 10 (2021/2024) | P0 | The baseline vocabulary for web application security | OWASP Top 10; PortSwigger Web Security Academy |
Application Security (P1–P2)
| Topic | Priority | Why It Matters | Recommended Resources |
|---|---|---|---|
| SQL injection | P1 | Still prevalent; high impact; preventable with parameterized queries | PortSwigger SQLi; OWASP SQLi Prevention |
| Cross-site scripting (XSS) | P1 | Most common web vuln; requires output encoding + CSP | PortSwigger XSS; OWASP XSS Prevention |
| CSRF | P1 | State-changing actions without user consent | PortSwigger CSRF; SameSite cookies mitigation |
| SSRF | P1 | Server-side request forgery; cloud metadata exposure | PortSwigger SSRF; AWS IMDSv2 |
| Broken access control / IDOR / BOLA | P1 | #1 in OWASP Top 10 2021; authorization failures | PortSwigger Access Control; OWASP Authorization Cheatsheet |
| Secure session management | P1 | Session fixation, hijacking, replay | OWASP Session Management |
| API security (REST, GraphQL, gRPC) | P1 | APIs are the primary attack surface for modern apps | OWASP API Security Top 10; GraphQL Security |
| Input validation & output encoding | P1 | Foundation for preventing injection attacks | OWASP Input Validation; OWASP Output Encoding |
Infrastructure & DevSecOps (P1–P2)
| Topic | Priority | Why It Matters | Recommended Resources |
|---|---|---|---|
| Docker security (base images, multi-stage, non-root, distroless, scanning) | P1 | Containers are the default deployment unit | Docker Security Best Practices; Distroless images; Trivy/Grype |
| Kubernetes security fundamentals (RBAC, NetworkPolicies, Pod Security Standards, admission control) | P1–P2 | Orchestration layer requires its own controls | Kubernetes Security Docs; Kyverno; kube-bench |
| CI/CD pipeline security (SAST, DAST, SCA, secret scanning, artifact signing, SLSA) | P1 | Pipelines are the path to production | GitHub Actions Security; SLSA Framework; Sigstore/Cosign |
| Dependency & secret scanning (SCA, SBOM, Gitleaks, TruffleHog) | P1 | Supply chain attacks target dependencies and secrets | OWASP Dependency Check; Syft; Gitleaks |
| IAM & cloud security (least privilege, conditions, policy analysis, CSPM) | P1–P2 | Cloud breaches often start with excessive permissions | AWS IAM Best Practices; Cloud Custodian; Prowler |
| Infrastructure as Code security (Terraform, CloudFormation, Pulumi scanning) | P2 | Misconfigurations in IaC become production vulnerabilities | Checkov; tfsec; cfn-nag |
Learning strategy: Complete the P0 foundation topics first — they are prerequisites for everything else. Then choose one vertical (AppSec, DevSecOps, or Cloud Security) and go deep on its P1 topics before branching out. Do not try to learn penetration testing, cloud security, and DevSecOps simultaneously. Depth in one area beats shallow knowledge across three.
A Practical Developer-to-Security Lab
This lab demonstrates the developer-to-security workflow: identify an insecure pattern → understand impact → reproduce locally → fix → test → add to CI. It uses a minimal Node.js/Express application with an intentionally vulnerable SQL injection. You can adapt the pattern to any language.
Prerequisites
- Node.js 18+ and npm
- Docker (for container scanning step)
- Git
- A GitHub account (for GitHub Actions step)
Project Structure
devsec-lab/
├── app/
│ ├── package.json
│ ├── server.js # Vulnerable version
│ ├── server-fixed.js # Fixed version
│ ├── database.js # SQLite setup
│ ├── test/
│ │ ├── vuln.test.js # Tests for vulnerable version
│ │ └── fixed.test.js # Regression tests for fixed version
│ └── Dockerfile
├── .github/
│ └── workflows/
│ └── security.yml # CI/CD security pipeline
├── .gitleaks.toml # Secret scanning config
└── README.md
Step 1: Identify the Insecure Pattern
Vulnerable code (app/server.js):
// server.js - INTENTIONALLY VULNERABLE - DO NOT USE IN PRODUCTION
const express = require('express');
const sqlite3 = require('sqlite3').verbose();
const app = express();
app.use(express.json());
const db = require('./database');
app.get('/api/users/:id', (req, res) => {
const userId = req.params.id;
// VULNERABLE: String concatenation allows SQL injection
const query = `SELECT id, username, email, role FROM users WHERE id = ${userId}`;
db.get(query, (err, row) => {
if (err) return res.status(500).json({ error: err.message });
if (!row) return res.status(404).json({ error: 'User not found' });
res.json(row);
});
});
app.listen(3000, () => console.log('Server running on port 3000'));
Why this is vulnerable: The userId parameter is directly concatenated into the SQL string. An attacker requesting /api/users/1 OR 1=1 receives all users. An attacker requesting /api/users/1; DROP TABLE users-- destroys data.
Step 2: Understand the Security Impact
| Impact | Description |
|---|---|
| Confidentiality | Extract all database records (users, passwords, PII, secrets) |
| Integrity | Modify, insert, or delete data; bypass authentication; escalate privileges |
| Availability | Drop tables, shut down database, consume resources with heavy queries |
| Remote exploitability | No authentication required; exploitable via single HTTP request |
| CVSS 3.1 estimate | 9.8 Critical (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) |
Step 3: Reproduce Locally with Harmless Test Data
Database setup (app/database.js):
// database.js
const sqlite3 = require('sqlite3').verbose();
const path = require('path');
const db = new sqlite3.Database(':memory:');
db.serialize(() => {
db.run(`CREATE TABLE users (
id INTEGER PRIMARY KEY,
username TEXT,
email TEXT,
role TEXT
)`);
// Harmless test data only
const stmt = db.prepare('INSERT INTO users VALUES (?, ?, ?, ?)');
stmt.run(1, 'alice', 'alice@example.com', 'admin');
stmt.run(2, 'bob', 'bob@example.com', 'user');
stmt.run(3, 'charlie', 'charlie@example.com', 'user');
stmt.finalize();
});
module.exports = db;
Run the vulnerable server:
cd devsec-lab/app
npm init -y
npm install express sqlite3
node server.js
Test the injection (in another terminal):
# Normal request
curl http://localhost:3000/api/users/1
# {"id":1,"username":"alice","email":"alice@example.com","role":"admin"}
# SQL injection - returns all users
curl "http://localhost:3000/api/users/1%20OR%201%3D1"
# Returns alice, bob, charlie
# Union injection - extracts schema info (SQLite)
curl "http://localhost:3000/api/users/1%20UNION%20SELECT%20sql,name,type,1%20FROM%20sqlite_master--"
Observation: The injection works. The application returns data it should not. Stop the server (Ctrl+C).
Step 4: Fix the Vulnerable Implementation
Fixed code (app/server-fixed.js):
// server-fixed.js - SECURE VERSION
const express = require('express');
const sqlite3 = require('sqlite3').verbose();
const app = express();
app.use(express.json());
const db = require('./database');
app.get('/api/users/:id', (req, res) => {
const userId = req.params.id;
// SECURE: Parameterized query (placeholder)
const query = 'SELECT id, username, email, role FROM users WHERE id = ?';
db.get(query, [userId], (err, row) => {
if (err) return res.status(500).json({ error: 'Internal server error' });
if (!row) return res.status(404).json({ error: 'User not found' });
res.json(row);
});
});
app.listen(3000, () => console.log('Fixed server running on port 3000'));
Key changes:
- Parameterized query with
?placeholder — the database driver handles escaping - Generic error message — no stack traces leaked to clients
- Input validation could be added (e.g.,
if (!/^\d+$/.test(userId)) return res.status(400)...)
Step 5: Write Regression Tests
Vulnerable version test (app/test/vuln.test.js) — documents the flaw:
// vuln.test.js - Documents the vulnerability (run against vulnerable server)
const request = require('supertest');
const app = require('../server'); // Requires exporting app from server.js
describe('Vulnerable endpoint - SQL injection', () => {
test('Normal request returns single user', async () => {
const res = await request(app).get('/api/users/1');
expect(res.status).toBe(200);
expect(res.body.username).toBe('alice');
});
test('SQL injection returns all users - DEMONSTRATES VULNERABILITY', async () => {
const res = await request(app).get('/api/users/1 OR 1=1');
// This PASSES on vulnerable code - showing the flaw exists
expect(res.status).toBe(200);
expect(Array.isArray(res.body)).toBe(true);
expect(res.body.length).toBeGreaterThan(1);
});
});
Fixed version regression test (app/test/fixed.test.js) — ensures fix works:
// fixed.test.js - Regression tests for fixed implementation
const request = require('supertest');
const app = require('../server-fixed'); // Requires exporting app from server-fixed.js
describe('Fixed endpoint - SQL injection prevented', () => {
test('Normal request returns single user', async () => {
const res = await request(app).get('/api/users/1');
expect(res.status).toBe(200);
expect(res.body.username).toBe('alice');
});
test('SQL injection attempt returns 404 or empty result', async () => {
const res = await request(app).get('/api/users/1 OR 1=1');
// Fixed code treats "1 OR 1=1" as a literal ID string → no match → 404
expect(res.status).toBe(404);
});
test('Union injection attempt returns 404', async () => {
const res = await request(app).get("/api/users/1 UNION SELECT sql,name,type,1 FROM sqlite_master--");
expect(res.status).toBe(404);
});
test('Non-numeric ID returns 400 with validation', async () => {
// Add validation middleware in production
const res = await request(app).get('/api/users/abc');
expect([400, 404]).toContain(res.status);
});
});
Run tests:
npm install --save-dev supertest jest
# For vulnerable version (expects 1 test to pass showing vuln)
npx jest test/vuln.test.js
# For fixed version (all tests should pass)
npx jest test/fixed.test.js
Step 6: Add Security Scanning to CI/CD
GitHub Actions workflow (.github/workflows/security.yml):
name: Security Pipeline
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
sast:
name: SAST (Semgrep)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: returntocorp/semgrep-action@v1
with:
config: >-
p/ci
p/secrets
p/nodejs
p/owasp-top-ten
sca:
name: Dependency Scanning (npm audit + Trivy)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: cd app && npm ci
- name: npm audit
run: cd app && npm audit --audit-level=high
- name: Trivy FS scan
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: './app'
severity: 'CRITICAL,HIGH'
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload Trivy results
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
secret-scan:
name: Secret Scanning (Gitleaks)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
container-scan:
name: Container Scan (Trivy)
runs-on: ubuntu-latest
needs: [sast, sca, secret-scan]
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: docker build -t devsec-lab:test ./app
- name: Trivy image scan
uses: aquasecurity/trivy-action@master
with:
image-ref: 'devsec-lab:test'
severity: 'CRITICAL,HIGH'
exit-code: '1'
Secret scanning config (.gitleaks.toml):
title = "Gitleaks config for devsec-lab"
[allowlist]
description = "Allowlisted patterns for this demo"
paths = [
"app/test/vuln.test.js", # Contains intentional SQLi payloads for testing
]
Dockerfile (app/Dockerfile):
# Multi-stage build for smaller attack surface
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
FROM node:20-alpine
WORKDIR /app
# Non-root user
RUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001
COPY --from=builder --chown=nodejs:nodejs /app/node_modules ./node_modules
COPY --chown=nodejs:nodejs server-fixed.js database.js ./
USER nodejs
EXPOSE 3000
CMD ["node", "server-fixed.js"]
Commands to run the full lab:
# 1. Clone and set up
git clone <your-fork> devsec-lab
cd devsec-lab
# 2. Run vulnerable version and test injection
cd app && node server.js &
curl "http://localhost:3000/api/users/1 OR 1=1"
kill %1
# 3. Run fixed version and verify
node server-fixed.js &
curl "http://localhost:3000/api/users/1 OR 1=1" # Should return 404
kill %1
# 4. Run regression tests
npm install --save-dev supertest jest
npx jest test/fixed.test.js
# 5. Build and scan container
docker build -t devsec-lab:test ./app
trivy image --severity CRITICAL,HIGH devsec-lab:test
# 6. Push to GitHub and observe Actions pipeline
git add . && git commit -m "Add secure implementation and security pipeline"
git push origin main
Expected observations:
- Semgrep flags the string concatenation in
server.js(if scanned before fix) - npm audit may flag vulnerable dependencies (intentional for learning)
- Trivy FS scan finds no OS vulnerabilities in the fixed Dockerfile (distroless/alpine base)
- Gitleaks finds no secrets (config allows test payloads)
- Container scan passes with non-root user and minimal base image
Note: The commands and scan outputs above are illustrative examples of what this lab demonstrates. Actual tool versions and outputs will vary. Run the lab yourself to generate real evidence for your portfolio.
Build a Security Portfolio Using Existing Developer Projects
You already have code. The portfolio step is reframing it with a security lens. For each project, apply this documentation template:
Project Documentation Template
## Project: [Name]
**Problem**: What security issue were you addressing?
**Threat**: What attack vector or risk motivated this work?
**Approach**: What did you build, configure, or change?
**Tools**: Which technologies did you use and why?
**Validation**: How did you prove the fix/control works?
**Result**: What changed? (Metrics, test results, scan outputs)
**Lessons Learned**: What surprised you? What would you do differently?
Six Portfolio Projects from Existing Developer Work
| Project Idea | Developer Starting Point | Security Reframing | Evidence to Include |
|---|---|---|---|
| Secure authentication implementation | Built login/register with JWT | Document: password hashing (bcrypt/argon2), JWT claims validation, refresh token rotation, rate limiting, secure cookie attributes, MFA integration | Code snippets, threat model for auth flow, test cases for brute force/token replay |
| API authorization testing | Built REST/GraphQL API | Document: RBAC/ABAC implementation, IDOR test cases, BOLA test automation, scope validation, integration tests for each role | Test matrix (role × endpoint × expected status), OWASP ZAP authenticated scan results |
| Dependency vulnerability scanning | package.json / go.mod / requirements.txt / Cargo.toml |
Document: SCA integration in CI, allowlist policy for false positives, SBOM generation, automated Dependabot/Renovate PRs | Trivy/Grype/Snyk scan results before/after, SBOM (CycloneDX/SPDX), Dependabot PR links |
| Docker image hardening | Dockerfile for your service |
Document: multi-stage build, distroless/scratch base, non-root user, read-only filesystem, dropped capabilities, Hadolint/Trivy/Grype results | docker history output, Trivy scan comparison (before/after), Hadolint score |
| GitHub Actions security pipeline | Existing CI/CD workflow | Document: SAST (Semgrep/CodeQL), SCA, secret scanning, container scanning, artifact signing (Cosign), policy gates, SLSA level achieved | Workflow YAML, pipeline run screenshots, SARIF uploads to GitHub Security tab, Cosign verification |
| Threat model for existing application | Architecture diagram of your system | Document: STRIDE analysis per trust boundary, data flow diagram, risk rating per threat, mitigation status, residual risk acceptance | Draw.io/Mermaid diagrams, threat register (spreadsheet), mitigations mapped to code/config |
Portfolio quality rules:
- Every claim must have evidence (code, scan output, test result, diagram).
- Distinguish your work from library defaults (e.g., “framework auto-escapes output” vs. “I added CSP headers”).
- Show the before and after — the vulnerable state and the fix.
- Include failures — a scanner that produced false positives you triaged is more honest than a clean scan you cannot explain.
- Never upload real credentials, internal hostnames, customer data, or proprietary code. Sanitize everything.
A 90-Day Transition Roadmap
This roadmap assumes 10–15 hours/week alongside work or study. Adjust pacing as needed.
Days 1–30: Security Foundations & Application Security Basics
| Week | Learning Objectives | Practical Activities | Portfolio Evidence |
|---|---|---|---|
| 1 | TCP/IP, DNS, HTTP, TLS fundamentals; Linux CLI & permissions | Complete OverTheWire Bandit levels 0–15; set up a Linux VM; practice ss, netstat, tcpdump, openssl commands |
Bandit completion notes; VM screenshot with hardening checklist |
| 2 | Authentication/authorization (OAuth 2.0, OIDC, JWT, RBAC); Encryption basics | Implement a minimal OAuth 2.0 + PKCE flow in your language; encrypt/decrypt with age/GPG; verify JWT signatures | Code repo with auth flow; encrypted file demo |
| 3 | OWASP Top 10 2021/2024; SQLi, XSS, CSRF, SSRF, Access Control | Complete PortSwigger Web Security Academy: SQLi (all labs), XSS (reflected/stored/DOM), Access Control (IDOR/BOLA) | PortSwigger account with lab badges; write-up of 3 favorite labs |
| 4 | Secure coding patterns: input validation, output encoding, parameterized queries, secure defaults | Refactor one of your existing projects: add parameterized queries, CSP headers, secure cookies, rate limiting | Before/after PR with security improvements; Trivy/Semgrep scan results |
Completion criteria: Can explain TLS handshake, JWT validation, and SQLi prevention to a peer. Portfolio has 2+ documented fixes.
Days 31–60: Practical Labs & Security Tooling
| Week | Learning Objectives | Practical Activities | Portfolio Evidence |
|---|---|---|---|
| 5 | SAST/DAST/SCA tools; CI/CD security integration | Add Semgrep, Trivy, Gitleaks to a GitHub Actions pipeline for your project; tune false positives | Workflow YAML; SARIF results in GitHub Security tab; false positive suppression docs |
| 6 | Docker & Kubernetes security fundamentals | Harden your Dockerfile (multi-stage, distroless, non-root); deploy to Kind; apply Pod Security Standards, NetworkPolicy | Hardened Dockerfile; Trivy image scan (0 HIGH/CRITICAL); K8s manifests with policies |
| 7 | Cloud security basics (IAM, CSPM, logging) | Complete AWS Skill Builder “Security Fundamentals”; run Prowler/ScoutSuite on a personal account (with billing alerts); enable CloudTrail + GuardDuty | Prowler report; CloudTrail/GuardDuty findings investigated |
| 8 | Threat modeling & secure code review | Create a STRIDE threat model for your project; conduct a secure code review using a checklist (OWASP ASVS L1) | Threat model diagram + register; code review checklist with findings |
Completion criteria: Pipeline runs security scans on every push. Container passes Trivy. Threat model documented. Can triage SAST findings.
Days 61–90: Portfolio Projects, Documentation & Job Preparation
| Week | Learning Objectives | Practical Activities | Portfolio Evidence |
|---|---|---|---|
| 9 | Build 2–3 portfolio projects from the template | Complete: (1) Secure auth implementation, (2) API authorization test suite, (3) Threat model for a real app | 3 project repos with README, evidence, lessons learned |
| 10 | Resume, LinkedIn, GitHub profile rewrite | Apply “before/after” framing to dev experience; highlight security-relevant projects; add portfolio links | Updated resume (PDF), LinkedIn profile, GitHub profile README |
| 11 | Interview preparation | Practice: threat modeling walkthrough, secure code review exercise, incident response scenario, “explain this vuln” for OWASP Top 10 | Recorded mock interviews; written answers to 15 common questions |
| 12 | Apply & iterate | Target 10–15 applications; track in spreadsheet; request feedback on rejections; refine materials | Application tracker; feedback log; revised materials |
Completion criteria: 3 polished portfolio projects. Resume/LinkedIn/GitHub tell a coherent security story. 10+ applications submitted. Interview ready.
Quick-Reference Decision Guide: Which Path for You?
| If you enjoy… | Consider this path | Start with… |
|---|---|---|
| Reading code, finding bugs, teaching developers | Application Security Engineer | OWASP Top 10, Semgrep, CodeQL, secure code review checklist |
| Building pipelines, automation, “shift left” | DevSecOps Engineer | GitHub Actions security, Trivy, Checkov, SLSA, policy as code |
| Cloud architecture, IaC, identity, compliance | Cloud Security Engineer | AWS/Azure/GCP security services, Prowler, Terraform scanning, CSPM |
| Breaking apps methodically, reporting, retesting | Penetration Tester | PortSwigger Academy, Burp Suite, OSCP prep, methodology (PTES) |
| Writing tools, detection rules, SOAR playbooks | Security Automation Engineer | Sigma rules, Python/Go, SIEM APIs, ATT&CK, Tines/Cortex XSOAR |
| Building security features (auth, secrets, policy) | Product Security / Security-Focused SWE | Cryptography basics, OPA/Cedar, secure SDLC, supply chain (SBOM/SLSA) |
Common Mistakes Developers Make
| Mistake | Why It Hurts | Fix |
|---|---|---|
| Learning too many tools without understanding fundamentals | Tools change; principles don’t. You cannot tune a scanner you don’t understand. | Master the vulnerability class first (e.g., learn SQLi deeply), then learn the tool that finds it. |
| Confusing ordinary debugging with security testing | Debugging finds why code fails; security testing finds how code can be abused. | Practice attacker mindset: “If I control this input, what can I make the system do?” |
| Ignoring networking and operating systems | Applications run on networks and OSes. You cannot secure the app without understanding the layers below. | Complete Bandit + a networking fundamentals course before advanced topics. |
| Collecting certifications without practical projects | Certs show knowledge; projects show ability. Hiring managers ask “show me your work.” | For every cert topic, build a lab or write-up. Pair study with practice. |
| Trying to learn penetration testing, cloud security, and DevSecOps simultaneously | Breadth without depth signals unfocused learning. | Pick one vertical. Go deep for 60 days. Then expand. |
| Publishing vulnerable demonstrations without explaining fixes | A vulnerable app on GitHub without context looks like negligence. | Always pair “vulnerable version” with “fixed version + tests + explanation.” |
| Claiming professional security experience based only on labs | Labs are learning; production is accountability. Misrepresenting this destroys credibility. | Say: “Built a lab simulating X” not “Experience with X in production.” |
How to Position Your Development Experience
You are not “switching careers.” You are extending your engineering practice into security. Frame it that way.
Resume: Before vs. After
Before (generic developer):
Senior Software Engineer — Built microservices in Go and React. Designed REST APIs. Wrote unit tests. Used Docker and Kubernetes. CI/CD with GitHub Actions.
After (developer with security lens):
Senior Software Engineer — Built and secured microservices in Go/React. Implemented OAuth 2.0/OIDC with PKCE, JWT validation, and refresh token rotation. Added parameterized queries eliminating SQLi risk. Designed RBAC authorization layer preventing IDOR/BOLA. Hardened CI/CD with Semgrep SAST, Trivy SCA/container scanning, Gitleaks secret detection, and Cosign artifact signing. Authored threat models (STRIDE) for payment and user management services. Docker/Kubernetes, GitHub Actions.
LinkedIn Headline
Before: Senior Software Engineer | Go, React, Kubernetes
After: Software Engineer → Application Security | Secure SDLC, Threat Modeling, DevSecOps, Go/TypeScript | Open to AppSec/DevSecOps Roles
LinkedIn Summary (2–3 paragraphs)
I’m a software engineer with X years building production systems in [languages/frameworks]. Over the past year, I’ve extended my practice into application security and DevSecOps: integrating SAST/SCA/secret scanning into CI/CD, threat modeling critical services, hardening container images, and implementing secure authentication/authorization patterns.
Recent security work: [link to portfolio project 1], [link to portfolio project 2], [link to portfolio project 3]. I’m targeting Application Security Engineer or DevSecOps Engineer roles where I can bridge development and security teams.
Always learning. Currently: [current focus, e.g., “deepening cloud security knowledge with Prowler and AWS Security Hub”].
GitHub Profile README
Pin 3–4 security-relevant repos. Each repo has a README with the project template (Problem → Threat → Approach → Tools → Validation → Result → Lessons). Your profile README summarizes:
Security Portfolio
Project Category Key Evidence Secure Auth Service AppSec OAuth 2.0 + PKCE, bcrypt, JWT rotation, rate limiting, tests DevSecOps Pipeline DevSecOps Semgrep, Trivy, Gitleaks, Cosign, SLSA L2, SARIF uploads Threat Model: Payment API Threat Modeling STRIDE, 12 threats identified, 9 mitigated, 3 accepted
Interview Answers: Developer-to-Security Translation
| Question | Weak Answer | Strong Developer-to-Security Answer |
|---|---|---|
| “How do you prevent SQL injection?” | “Use parameterized queries.” | “I use parameterized queries everywhere (e.g., db.query('SELECT ... WHERE id = ?', [userId])). In code review, I flag any string concatenation in SQL. I also add input validation as defense in depth and run Semgrep rules in CI to catch regressions.” |
| “Explain XSS and how to prevent it.” | “Sanitize input.” | “XSS occurs when untrusted data reaches the browser without encoding. I prevent it by: (1) output encoding at the template layer (React auto-escapes, Go html/template), (2) CSP headers (script-src 'self'), (3) HttpOnly/Secure/SameSite cookies, (4) avoiding dangerouslySetInnerHTML/innerHTML.” |
| “How would you secure a CI/CD pipeline?” | “Add scanning steps.” | “I harden the pipeline itself: (1) pin action versions by SHA, (2) least-privilege GITHUB_TOKEN with permissions block, (3) required reviewers on protected branches, (4) signed commits, (5) SAST (Semgrep), SCA (Trivy), secret scan (Gitleaks) on every PR, (6) container scan on merge, (7) Cosign artifact signing, (8) SLSA provenance generation.” |
| “Walk me through threat modeling a new feature.” | “Draw a diagram and find threats.” | “I use STRIDE on a data flow diagram: (1) diagram the feature with trust boundaries, (2) enumerate threats per boundary (Spoofing, Tampering, Repudiation, Info Disclosure, DoS, Elevation), (3) rate each (likelihood × impact), (4) define mitigations (code, config, process), (5) track residual risk. Example: for a file upload feature, I identified 8 threats, mitigated 6 (type validation, size limits, AV scan, random names, separate storage bucket, CSP), accepted 2 with monitoring.” |
Conclusion
Software engineering is not a detour on the path to security — it is a foundation. The systems you have built, the bugs you have fixed, the pipelines you have automated, and the incidents you have debugged are all security experience wearing a different label. The transition is not “starting over.” It is learning to apply your existing depth to a new question: not just “does it work?” but “how does it fail, and what does that failure cost?”
Start with the foundations (networking, Linux, auth, crypto, OWASP Top 10). Pick one vertical and go deep. Build labs that produce evidence, not just certificates. Document your work with the template: Problem → Threat → Approach → Tools → Validation → Result → Lessons Learned. Update your resume, LinkedIn, and GitHub to reflect the security lens you now bring to every system you touch.
The downloadable toolkit below gives you structured templates to track skills, learning, roadmap, portfolio projects, and career path comparisons. Use it. Adapt it. The next step is yours.
Download Resources
This article includes a downloadable ZIP with six practical templates:
- Developer Security Skills Mapping — Map your dev skills to security applications
- Application Security Learning Checklist — Prioritized topic tracker with resources
- 90-Day Transition Roadmap — Weekly plan with objectives and evidence targets
- Security Portfolio Project Template — Reusable documentation structure
- Security Career Path Comparison — CSV for evaluating role fit
- README — Usage guide
Download the ZIP from the resources section below or directly at /downloads/developer-to-security-toolkit/developer-to-security-toolkit.zip.
Official References
- OWASP Top 10: https://owasp.org/www-project-top-ten/
- OWASP Web Security Testing Guide: https://owasp.org/www-project-web-security-testing-guide/
- OWASP Application Security Verification Standard (ASVS): https://owasp.org/www-project-application-security-verification-standard/
- OWASP Cheat Sheet Series: https://cheatsheetseries.owasp.org/
- NIST NICE Workforce Framework: https://www.nist.gov/itl/applied-cybersecurity/nice/nice-framework-resource-center
- NIST Secure Software Development Framework (SSDF) SP 800-218: https://csrc.nist.gov/pubs/sp/800/218/final
- GitHub Advanced Security Documentation: https://docs.github.com/en/code-security
- GitHub Actions Security Hardening: https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions
- PortSwigger Web Security Academy: https://portswigger.net/web-security
- MITRE ATT&CK Framework: https://attack.mitre.org/
- NIST SP 800-53 (Security Controls): https://csrc.nist.gov/pubs/sp/800/53/r5/final
- CIS Benchmarks: https://www.cisecurity.org/cis-benchmarks
- SLSA Supply Chain Levels: https://slsa.dev/
- Sigstore/Cosign: https://docs.sigstore.dev/