一键导入
devsecops
Expert reference for embedding security into CI/CD pipelines, container supply chains, and developer workflows
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Expert reference for embedding security into CI/CD pipelines, container supply chains, and developer workflows
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Expert reference for application security — OWASP Top 10 mitigations, auth/authz, secrets management, cryptography, input validation, dependency hygiene, and secure-by-default code patterns
Expert reference for token counting, prompt compression, cost estimation, and quality preservation when optimizing prompts for Claude models
Experimentation design and A/B testing standards for product teams
Expert reference for digital accessibility — WCAG conformance, ARIA, and inclusive design patterns
Authoritative reference for agent architecture selection, multi-agent orchestration, tool design, memory systems, and failure mode prevention
Expert reference for evaluating LLM systems, RAG pipelines, and AI features in production
| name | devsecops |
| description | Expert reference for embedding security into CI/CD pipelines, container supply chains, and developer workflows |
| version | 1 |
.env.example. Not in comments. Not in commit history. Pre-commit hooks AND CI scanning run in parallel — one layer is not enough.If adding security scanning to CI → implement in this order: (1) secrets detection, (2) SAST, (3) dependency scanning, (4) container scanning, (5) IaC scanning, (6) DAST. Each layer addresses a different threat class.
If a SAST tool produces >50 findings on first run → triage into: fix now (critical/high), fix within 30 days (medium), suppress with justification (false positive). Never suppress without a written reason. Never close a finding as "won't fix" without security team approval.
If secrets are found in Git history → rotate immediately, then remove from history with git filter-repo. Assume the secret is compromised — treat as an active incident.
If a container image has a critical CVE → block deployment. If the base image is the source, update to a patched version. If no patch exists, evaluate mitigating controls and document the accepted risk with a time-bound remediation plan.
If choosing a secrets manager → AWS Secrets Manager or HashiCorp Vault for application secrets. Never environment variables for sensitive credentials in production (they leak into logs, process lists, and crash dumps).
If dynamic database credentials are possible → use them. Vault database secrets engine issues credentials with a 1-hour TTL. Compromise of app credentials = 1-hour exposure window, not permanent.
Never use --no-verify to bypass pre-commit hooks. If a hook is blocking legitimate work, fix the hook — don't bypass security gates.
Never grant *:* IAM permissions to application roles or CI service accounts. Least privilege is not optional for CI systems that have write access to production infrastructure.
The Shift-Left Security Model
STAGE TOOLS FAILURE MODE
IDE/Pre-commit GitLeaks, TruffleHog, tflint Secrets, obvious misconfigs
PR/Code Review Semgrep, CodeQL, Snyk Code SAST vulnerabilities
Build Trivy, Grype, Syft, Dependabot CVEs, license issues, SBOM
Deploy Checkov, tfsec, OPA/Gatekeeper IaC misconfigs, K8s policy
Runtime Falco, AWS GuardDuty, Sysdig Active threats, anomalies
Each stage catches different threats. Shift-left reduces fix cost — a finding in IDE costs $1 to fix; the same finding in production costs $1,000.
The Container Security Layers
Layer 1: Base image — use distroless or minimal (Alpine); pin with digest
Layer 2: Dependencies — scan with Trivy; update on CVE
Layer 3: Application code — SAST; no credentials baked in
Layer 4: Runtime config — non-root UID; read-only FS; drop ALL capabilities
Layer 5: Registry — private; access controlled; signed with cosign
Layer 6: Admission — OPA Gatekeeper or Kyverno reject policy violations at deploy
SLSA Supply Chain Security Levels
SLSA Level 1: Provenance exists (build script documented)
SLSA Level 2: Provenance is signed and hosted (verifiable)
SLSA Level 3: Build runs in isolated environment (tamper-resistant)
SLSA Level 4: Two-party review + hermetic builds (highest assurance)
Target: SLSA Level 2 minimum for production; Level 3 for critical services
| Term | Precise Meaning |
|---|---|
| SAST | Static Application Security Testing — analyzes source code for vulnerabilities without execution |
| DAST | Dynamic Application Security Testing — tests running application by sending attack payloads |
| SCA | Software Composition Analysis — scans dependencies for known CVEs and license issues |
| SBOM | Software Bill of Materials — inventory of all components in a software artifact |
| CVE | Common Vulnerabilities and Exposures — standardized identifier for known vulnerabilities |
| CVSS | Common Vulnerability Scoring System — 0-10 severity score; ≥7.0 = High, ≥9.0 = Critical |
| cosign | Sigstore tool for signing and verifying container images |
| Admission controller | Kubernetes webhook that intercepts API requests and can reject non-compliant resources |
| Shift-left | Moving security testing earlier in the development lifecycle |
| SLSA | Supply chain Levels for Software Artifacts — framework for build provenance and integrity |
| Secrets rotation | Automatically replacing credentials before they expire or after compromise |
| Zero-standing privilege | No persistent access grants; access is JIT (just-in-time) and expires automatically |
Mistake 1: Only scanning in CI, not pre-commit
Mistake 2: Treating security findings as warnings
Mistake 3: Scanning only application code, not IaC
Mistake 4: Storing secrets in environment variables
DATABASE_PASSWORD=supersecret in .env file or ECS task definition environment blockMistake 5: No runtime security monitoring
BAD CI pipeline (no security gates):
jobs:
build:
steps:
- uses: actions/checkout@v4
- run: npm install
- run: npm test
- run: docker build -t myapp .
- run: docker push myapp:latest
GOOD CI pipeline (security gates at each stage):
jobs:
security-scan:
steps:
- uses: actions/checkout@v4
with: fetch-depth: 0
# Stage 1: Secrets detection
- name: Scan for secrets
uses: gitleaks/gitleaks-action@v2
env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Stage 2: SAST
- name: Run Semgrep
run: semgrep --config=auto --error --severity=ERROR .
# Stage 3: Dependency scanning
- name: Snyk dependency scan
run: snyk test --severity-threshold=high
# Stage 4: IaC scanning
- name: Checkov IaC scan
uses: bridgecrewio/checkov-action@master
with: soft_fail: false
build-and-sign:
needs: security-scan
steps:
- name: Build image
run: docker build -t myapp:${{ github.sha }} .
# Stage 5: Container scanning
- name: Trivy container scan
uses: aquasecurity/trivy-action@master
with:
image-ref: myapp:${{ github.sha }}
exit-code: 1
severity: CRITICAL,HIGH
# Stage 6: Generate SBOM
- name: Generate SBOM
run: syft myapp:${{ github.sha }} -o spdx-json > sbom.json
# Stage 7: Sign image
- name: Sign image with cosign
run: cosign sign --key awskms:///alias/cosign-key myapp:${{ github.sha }}