Docs/Rules/Pipeline (R01-R45)

Pipeline Rules (R01-R45)

45 rules for GitLab CI and GitHub Actions YAML files. Deducts from the Security Score.

SEC — Secret Management (R01-R07)

IDSevPtsDescriptionFix
R01CRIT3No secret scanning stageAdd gitleaks scanning stage
R02HIGH2Secret scanning allows failureSet allow_failure: false on secret scanning job
R03CRIT5Hardcoded secret or credential in pipelineMove to CI/CD variables with masked + protected flags
R04MED2No pre-commit hook for secretsAdd pre-commit hook with gitleaks
R05HIGH2No Vault or external secret manager integrationIntegrate HashiCorp Vault for secret management
R06MED1Secrets not masked in CI/CD variablesEnable masked + protected flags on CI/CD variables
R07LOW1No secret rotation policy mentionedImplement secret rotation with Vault dynamic secrets

SAS — Static Analysis / SAST (R08-R14)

IDSevPtsDescriptionFix
R08CRIT3No SAST scanning stageAdd Semgrep SAST scanning stage
R09HIGH2SAST scanning allows failureSet allow_failure: false on SAST job
R10MED2No custom SAST rules or configurationAdd custom Semgrep rules for your tech stack
R11MED2No SAST output in machine-readable formatAdd --sarif or --json flag to SAST command
R12HIGH2No linting stageAdd linting stage with appropriate linter
R13MED2No quality gate or threshold for SASTAdd quality gate: fail on critical/high severity
R14LOW2No IaC scanning for Terraform/CloudFormationAdd Checkov or tfsec for IaC scanning

SCA — Supply Chain Security (R15-R23)

IDSevPtsDescriptionFix
R15CRIT3No dependency vulnerability scanningAdd dependency scanning with Trivy or Snyk
R16HIGH2Dependency scanning allows failureSet allow_failure: false on dependency scanning
R17HIGH2No container image scanningAdd Trivy container image scanning stage
R18MED2No SBOM generationAdd SBOM generation with Syft in CycloneDX format
R19MED2No image signing or verificationSign images with Cosign and verify in deployment
R20HIGH2Using npm install instead of npm ciReplace npm install with npm ci
R21MED2No private registry for container imagesUse private registry (Harbor, ECR, GCR)
R22MED2No license compliance scanningAdd license scanning with FOSSA or license-finder
R23HIGH3No lockfile integrity checkUse npm ci / yarn --frozen-lockfile / pip --require-hashes

DST — Dynamic Testing / DAST (R24-R27)

IDSevPtsDescriptionFix
R24HIGH3No DAST scanning stageAdd OWASP ZAP baseline scan in staging
R25MED2DAST not running against staging environmentTarget DAST at staging/preview environment URL
R26MED3No API security testingAdd API security testing with ZAP API scan
R27LOW2No fuzz testingAdd fuzz testing for critical input parsers

DEP — Deployment Security (R28-R36)

IDSevPtsDescriptionFix
R28CRIT3No manual approval for production deploymentAdd when: manual gate before production deploy
R29HIGH2No rollback strategy definedAdd rollback job or use ArgoCD for auto rollback
R30HIGH2No smoke tests after deploymentAdd post-deploy smoke test: curl health endpoint
R31MED2No GitOps deployment approachAdopt ArgoCD or Flux for declarative GitOps
R32HIGH2Deployment uses kubectl with hardcoded credentialsUse service accounts or OIDC for kubectl auth
R33MED2No environment separation in pipelineDefine separate environment stages: dev, staging, prod
R34MED2No deployment notificationsAdd Slack/Teams notification on deploy status
R35MED2No progressive delivery strategyUse canary or blue-green with Argo Rollouts
R36HIGH3Deploying unscanned imagesAdd image scanning stage before deployment

GOV — Governance & Compliance (R37-R45)

IDSevPtsDescriptionFix
R37HIGH3No security results aggregation platformIntegrate DefectDojo for centralized vuln management
R38MED2No test coverage reportingAdd coverage reporting with codecov
R39MED2No merge request / PR pipeline triggerAdd merge_request / pull_request trigger
R40MED2No pipeline timeout configuredAdd global timeout: 60 minutes
R41MED2No artifact archiving for audit trailArchive scan reports as pipeline artifacts
R42HIGH2Security scans not in dedicated stageCreate dedicated security stage in pipeline
R43LOW2No compliance as code frameworkAdd OPA/Conftest policy checks in pipeline
R44MED2No branch protection enforcement in pipelineRestrict deployment to protected branches only
R45MED3No unit/integration test stageAdd test stage with appropriate test framework
Total: 45 rules across 6 categories. Maximum deduction: 100 points (Security Score).