312-97 Cheatsheet
Certified DevSecOps Engineer (ECDE)
Download free PDFSecure development and threat modeling
Security throughout delivery
- **DevSecOps** shares security responsibility across development, security and operations. Automate repeatable checks, give developers actionable feedback and retain evidence of release decisions.
- **Commit-time** checks catch secrets and simple code issues early. **Build-time** checks analyze code, dependencies and artifacts. **Test-time** checks exercise running applications. **Deploy-time and runtime** checks validate configuration and detect operational threats.
- **Secure by design** addresses threats in architecture. **Secure implementation** enforces authentication, authorization, input validation and safe error handling. **Secure defaults** start with minimal exposure and denied access.
- Apply **least privilege**, defense in depth and a small attack surface. Reuse maintained security libraries. Protect communications with authenticated TLS and explicit trust relationships; protect sensitive data at rest.
- Prevent **SQL injection** with parameterized queries and constrained database permissions. Prevent **XSS** with context-aware output encoding and safe rendering APIs; input validation and CSP provide additional layers.
Threats as engineering requirements
- A **threat model** identifies assets, entry points, data flows, trust boundaries and attacker goals. Prioritize threats, select mitigations and turn the remaining risks into tracked engineering work.
- **STRIDE** covers spoofing, tampering, repudiation, information disclosure, denial of service and elevation of privilege. Apply these categories to components and interactions rather than treating the acronym as a severity score.
- Connect **user stories** to **abuse stories**, concrete threat scenarios and security test cases. Update the model when code, dependencies, infrastructure or trust boundaries change.
- **ThreatSpec** derives threat-model information from source annotations. **pytm** represents systems in Python and can generate diagrams. **ThreatPlaybook** connects collaborative modeling with testing; **ThreatModeler** supports architecture-driven modeling and integrations.
- Treat generated **sequence diagrams** and cloud inventories as modeling inputs. Automated discovery shows deployed relationships; engineers still need to identify business impact, missing controls and acceptable residual risk.
Feedback, ownership and measurement
- A **security gate** applies an explicit policy to findings. Choose blocking criteria using severity, exploitability, exposure and business impact; a scanner finding does not automatically stop every pipeline.
- **Change lead time** measures the interval from commit to production. **Deployment frequency**, **change failure rate** and **recovery time** describe delivery performance. Track vulnerability remediation time and recurring defects alongside them.
- A **blameless post-mortem** records impact, timeline, contributing conditions and follow-up actions after an incident. Assign owners and verify corrective controls through regression tests and exercises.
- Use **Jira Query Language (JQL)** to filter issues. Link findings to the affected commit, artifact and deployment, assign an owner and verify the fix before closing the issue.
- **AWS BugBust** is a code-quality bug-fixing challenge concept. Distinguish organized defect-removal competitions from vulnerability disclosure and security bug bounty programs.
Source control and repository safeguards
Git commands and repository services
- **git clone <repository>** creates a local repository copy. **git fetch** downloads remote history; **git pull <remote> <branch>** fetches and integrates changes according to the configured merge or rebase behavior.
- **git add** stages changes, **git commit -m "message"** creates a local commit and **git push** updates remote refs. Review the staged diff before committing sensitive changes.
- Set author identity with **git config --global user.name "Name"** and **git config --global user.email "email"**. Commit identity is metadata; repository authentication is a separate control.
- **GitHub**, **Bitbucket** and **AWS CodeCommit** provide hosted repository workflows. Keep private repositories access-controlled, protect important branches and require reviews and successful checks before merging.
Hooks and build triggers
- A **pre-commit hook** runs before a commit is recorded. Put the executable hook at the configured hooks path, commonly .git/hooks/pre-commit; sample files need the .sample suffix removed and a working interpreter.
- On Unix, **chmod +x <hook>** sets executable permission. A hook returning **0** permits the operation; a **nonzero exit** can reject it. Preserve the exit status when a shell wrapper calls a PowerShell script.
- Local hooks can be bypassed and are not automatically installed for every clone. Enforce critical rules again through **CI checks**, protected branches or supported server-side controls.
- A **post-commit hook** runs after the commit and cannot reject it. A GitHub **webhook** can notify Jenkins at its configured /github-webhook/ endpoint; use HTTPS, a shared secret and the matching Jenkins trigger.
- **git-multimail** generates repository-change emails from server-side events. Keep notifications useful and avoid including secrets in commit messages, diffs or automated reports.
Find and contain exposed secrets
- **Secret scanning** detects credentials and sensitive files in staged changes, repository history and hosted code. **GitGraber**, **GitMiner** and **Gitrob** are repository discovery and exposure-detection tools represented in this workflow.
- Use keyword searches, token patterns and validation carefully: findings may be false positives, and a scanner cannot prove that every secret was found. Scan only repositories and organizations within the authorized scope.
- For an exposed credential, **revoke or rotate it first**, investigate use and remove it from active files and relevant history. Deleting the latest copy does not invalidate a leaked credential or erase existing clones.
- Install Python requirements with **python -m pip install -r requirements.txt** when that is the project's requirements file. Review tool dependencies and installation scripts before granting repository tokens.
CI/CD security testing and artifacts
Code analysis and dependency risk
- **SAST** analyzes source or compiled code without running the deployed application. **SCA** inventories third-party components and evaluates known vulnerabilities and, where supported, license policy. Their findings and coverage differ.
- **Bandit** checks Python security patterns; **Brakeman** analyzes Ruby on Rails; **PHPStan** performs PHP static analysis. **SonarQube**, **Coverity**, **Checkmarx** and **DevSkim** support different static-analysis workflows; **SonarLint** provides editor feedback.
- **GitHub code scanning** can use **CodeQL** analysis on pushes and pull requests. C++ analysis uses the **cpp** language identifier. Select supported languages, provide required build steps and make important checks mandatory for merges.
- **Bundler-Audit** checks resolved Ruby gem versions in Gemfile.lock against advisories. **Retire.js** identifies vulnerable JavaScript libraries. **Snyk**, **Mend/WhiteSource** and **Black Duck** support dependency-risk workflows.
- A lockfile records resolved versions; an **SBOM** records software components in an artifact or project. Rescan released artifacts when advisories change and use scheduled CI jobs, such as supported **Travis CI cron jobs**, to catch newly disclosed dependency risk.
Exercise running applications
- **DAST** tests a running application through its interfaces, usually without source access. **OWASP ZAP**, **Burp Suite**, **InsightAppSec**, **Acunetix**, **w3af** and **Arachni** are web-testing tools associated with this approach.
- **IAST** instruments an application during execution to correlate observed behavior with code and runtime context. Scanner-driven implementations combine active requests with an agent; coverage still depends on exercised paths.
- **OAST**, or out-of-band application security testing, detects interactions with a controlled external service. Correlated DNS or HTTP callbacks can reveal blind vulnerabilities that do not appear in the immediate response.
- **Fuzz testing** supplies unexpected or malformed inputs to discover crashes and unsafe behavior. Test authentication, authorization and business logic as well as parser robustness; use controlled environments for intrusive scans.
- **BDD-Security** expresses executable security expectations using Cucumber features and supporting tools such as ZAP, Nessus, SSLyze and Selenium. **Gauntlt** expresses security tests in readable scenarios; tags select test subsets.
Wire checks into repeatable pipelines
- **Jenkins** runs jobs and pipeline stages; scanner plugins or CLI steps invoke tools and collect reports. Jenkins plugins use packages such as **.hpi**. **Warnings Next Generation** aggregates supported analysis results; it does not replace the scanner.
- **.gitlab-ci.yml** defines GitLab jobs and can include reusable templates. **buildspec.yml** defines AWS CodeBuild phases. **CodePipeline** orchestrates delivery, **CodeBuild** runs builds and checks, and **CodeDeploy** handles supported deployments.
- Repository events can trigger pipelines through **EventBridge** or webhooks. Converting scanner output into **Security Hub** findings requires an explicit integration or adapter, such as Lambda; static analyzers do not all send results automatically.
- Archive reports with a unique **build number or build identifier** and record the commit and artifact digest. Configure both scanner exit codes and report-based thresholds: publishing warnings alone may leave the build successful.
- Use approved trust stores and valid **TLS certificates** for scanner connections. Keep scanner API keys in a credential store, mask logs and isolate untrusted pull-request jobs from privileged release credentials.
- Publish NuGet packages with **nuget push <package> -Source <feed>** or the corresponding nuget.exe command. The feed URL, authentication and permissions determine access; a command's API-key argument alone does not establish feed identity.
Secrets and workload identity
Secrets are controlled resources
- Keep passwords, tokens, certificates and private keys in a **secrets manager**. Retrieve them only when needed; enforce narrow access, rotation, expiration and audit trails across development and deployment.
- Prefer **workload identity** and short-lived credentials where supported. Static access keys in service configuration files create rotation and leakage risks; restrict any unavoidable bootstrap credential.
- A CI credential's **scope** controls which jobs can reference it. Separate development and production access, limit who can edit pipelines and prevent secrets from entering build artifacts, command output or source control.
- Encryption and log masking do not eliminate exposure: a malicious build step may read accessible secrets. Use isolated agents, trusted pipeline definitions and least-privilege credentials for each stage.
Vault and Conjur
- **HashiCorp Vault** authenticates clients, evaluates policies and grants access to secrets engines. **AppRole** authenticates machines with a role identity and a secret credential under configured constraints.
- **vault auth enable approle** enables the AppRole authentication method. The Jenkins integration also needs the Vault address, an authentication configuration and a policy permitting only required secret paths.
- **vault kv put secret/example key=value** writes a KV secret; **vault kv get secret/example** reads it; **vault kv delete secret/example** deletes it. **KV v2** distinguishes version deletion from permanent destruction; deletion alone does not revoke an external credential.
- **Conjur** models secret access through policies, workload hosts, layers and variables. A policy grants access; setting a variable supplies its secret value. Keep policy authoring and secret-value administration appropriately separated.
- In the relevant Conjur CLI syntax, **conjur policy load -b root -f policy.yml** loads policy and **conjur variable set -i <variable-id> -v <value>** sets a value. Avoid exposing real secret values in shell history or process arguments.
Cloud stores and application integrations
- **AWS Secrets Manager** supplies managed secret storage and supported rotation workflows. A Jenkins provider needs an AWS identity, region, network access and appropriate secret-read permissions; encrypted secrets may also require KMS permissions.
- **Azure Key Vault** stores secrets, keys and certificates. A Jenkins integration requires the vault endpoint, a supported identity or credential and permission to read selected secrets; creating a vault does not itself create an application identity.
- **Keywhiz** is a centralized secret-distribution system. Authenticate clients, authorize secret access and audit retrieval; do not assume secrets are untraceable or that an outage has no effect on delivery.
- **Jscrambler** protects client-side JavaScript through code transformation and related protections. Its JSON configuration may contain service credentials: inject them securely. Obfuscation does not make a browser-delivered secret confidential.
Containers, infrastructure and compliance
Images, containers and inspection
- A Docker **image** is a packaged template; a **container** is an instance with runtime state. **docker ps** lists running containers and **docker ps -a** includes stopped ones. **docker inspect <container>** exposes detailed configuration and state.
- **docker commit <container> <image:tag>** captures container filesystem changes as an image; mounted volume data is excluded. Prefer a version-controlled **Dockerfile** for reproducible application images.
- **docker save -o images.tar <image>** archives images and metadata; **docker load -i images.tar** imports them. **docker push** uploads an image to a registry. Container filesystem export serves a different purpose from image save.
- **docker port <container>** shows published port mappings. Inspect **Config.ExposedPorts** and **NetworkSettings.Ports** to distinguish image/container port metadata from host publication; EXPOSE alone does not publish a port.
- **docker exec -it <container> <shell>** runs a command in a running container without an SSH daemon inside it. **docker stop <container>** requests a graceful stop; exiting a shell stops the container only when that shell is its main process.
Harden and scan container workloads
- Use minimal maintained images, run as a **non-root user**, drop unnecessary capabilities and avoid privileged containers. Restrict writable paths, mounts and exposed services; access to the Docker daemon is highly privileged.
- **no-new-privileges** blocks privilege gains through supported exec mechanisms. Inspect **HostConfig.SecurityOpt** to review configured security options; combine it with capabilities, seccomp and appropriate host controls.
- Inspect the **Mounts** entries and their **Propagation** values for bind mounts. Shared propagation can carry mount events across namespaces; choose private propagation unless sharing is required and use read-only mounts when possible.
- **Docker Bench for Security** checks host and container settings against CIS-oriented recommendations. Review findings in context; a benchmark check is different from scanning application packages for known vulnerabilities.
- **Syft** generates an SBOM from images or filesystems; **Grype** matches packages against vulnerability data, for example **grype <image>**. An **all-layers** inventory can expose packages removed from the final filesystem; retained image layers may still contain sensitive data.
- **Prisma Cloud** integrates security checks for images and other cloud workloads with pipelines and runtime controls. Evaluate vulnerabilities, configuration and behavioral alerts separately; anomaly detection depends on context and can produce false positives.
Provisioning and compliance as code
- **Terraform** describes infrastructure in .tf files, often main.tf. **terraform init** initializes the working directory, **plan** previews changes, **apply** provisions resources and **destroy** removes managed infrastructure. Protect state because it may contain sensitive values.
- **Packer** builds machine or container images from templates; **packer build template.pkr.hcl** runs an HCL template. Terraform manages resource lifecycles while Packer builds the images those resources may use.
- **DevSec Hardening Framework** supplies reusable hardening content for automation platforms. Compare a baseline scan with the configured result and retest. **chef-solo -c solo.rb -j solo.json** uses a Chef configuration file and JSON attributes/run list.
- **Chef InSpec** expresses compliance checks in profiles. **inspec init profile <name>** creates a profile scaffold; **inspec exec <profile> -t azure://** uses the Azure target with the required resource pack and authenticated access.
- Use a narrowly scoped **Azure service principal** or supported identity for compliance assessment. Read-only assessment permissions differ from deployment permissions. **CloudMapper** uses AWS inventory and security-audit access for environment assessment; avoid administrative access for collection.
Deployment, runtime defense and operations
Observe deployed workloads
- **kubectl version** checks client/server version information and **kubectl cluster-info** reports cluster endpoints. API reachability does not establish application health; inspect nodes, workloads, events and dependencies.
- **kubectl get pods -n <namespace>** lists namespace-scoped pods. Use **kubectl describe pod** for state and events and **kubectl logs** for container output. A running pod may still be unready or unable to reach another service.
- **AKS** provides managed Kubernetes. Keep Jenkins build permissions separate from deployment identities and use namespace-scoped RBAC where possible. Scan and publish the image before deploying the intended immutable digest.
- **az group create --name <group> --location <region>** creates an Azure resource group. **az container logs --resource-group <group> --name <container-group>** retrieves Azure Container Instances output. ACI container groups and Kubernetes pods are distinct deployment units.
Runtime detection and prevention
- **RASP** uses application runtime context to detect or block attacks. **IAST** primarily reports vulnerabilities during exercised execution; **DAST** tests through external interfaces. Runtime protection supplements secure development and testing.
- A **WAF** filters web requests using rules and supported behavioral controls. **ModSecurity** is a web-server WAF engine; **AWS WAF** protects supported web entry points. Tune policies, exclusions and alerting against realistic traffic.
- **Sqreen**, **Trend Micro Cloud One application security** and **Rapid7 tCell** are runtime-protection tools encountered in integration workflows. Agents need compatible runtimes, protected enrollment tokens and an observable deployment process.
- Alert automation connects a **trigger**, response and notification destination such as Slack. Define actionable severity, route ownership and avoid including credentials or sensitive request contents in notifications.
- **CloudFront** distributes content at the edge; **Lambda@Edge** executes supported logic at edge events. Application and edge agents observe different context. **CSP** limits browser content sources, while safe redirect validation constrains redirect destinations.
Close the operational feedback loop
- **Amazon Inspector** assesses supported workloads for vulnerabilities and exposure findings. **CloudWatch** collects operational telemetry, **AWS Config** records resource configuration and evaluates rules, and **AWS WAF** filters web requests; these roles complement one another.
- **Nessus** and **beSECURE** support vulnerability assessment workflows. **Splunk** aggregates and analyzes events. Correlate application, identity and infrastructure telemetry to investigate brute-force attempts and suspicious changes.
- For authorized service inventory, **nmap -sV** probes service versions and **-sS** requests SYN scanning where supported. Version evidence guides patch assessment; it does not prove that a service is exploitable.
- Keep **Jenkins** and plugins patched, restrict administrator and script-execution permissions, isolate agents and review exposed endpoints. Validate fixes by rescanning and exercising the affected application paths.
- Run continuous checks after deployment and when dependencies or advisories change. Feed confirmed findings into threat models, developer guidance, regression tests and prioritized remediation work.