|
| 1 | +# Security Triage Policy |
| 2 | + |
| 3 | +This document defines how security findings (CodeQL, secret scanning, Dependabot, OWASP Dependency-Check, SpotBugs, PMD, etc.) are triaged and remediated for this repository. |
| 4 | + |
| 5 | +## 1. Sources of Findings |
| 6 | +| Source | Type | Location | |
| 7 | +|-------|------|----------| |
| 8 | +| CodeQL | Static code scanning | GitHub Security tab (Code scanning alerts) | |
| 9 | +| Secret Scanning & Push Protection | Credential leaks | GitHub Security tab (Secret scanning alerts) | |
| 10 | +| Dependabot Alerts | Vulnerable dependencies | GitHub Security tab (Dependabot alerts) | |
| 11 | +| OWASP Dependency-Check | Dependency CVEs (aggregate report) | CI logs / reports | |
| 12 | +| SpotBugs / PMD | Quality & potential security issues | CI verify stage | |
| 13 | + |
| 14 | +## 2. Severity Mapping |
| 15 | +Severity is based on CVSS (for dependency CVEs) or CodeQL categorization. Adjustments may be made for exploit maturity and exposure. |
| 16 | + |
| 17 | +| Severity | Examples | Action Window | |
| 18 | +|----------|----------|---------------| |
| 19 | +| Critical | Remote code execution, credential compromise, secret leak (active) | Fix/rotate within 24h | |
| 20 | +| High | Deserialization bugs, SQL injection, high CVSS dependency CVE | Fix within 3 business days | |
| 21 | +| Medium | Path traversal, SSRF, medium CVSS dependency CVE | Fix within current sprint (≤ 2 weeks) | |
| 22 | +| Low | Minor info leak, low CVSS dependency CVE | Backlog / next maintenance window | |
| 23 | +| Informational | Style / false positives / non-exploitable | Mark as `wont-fix` or ignore | |
| 24 | + |
| 25 | +## 3. Triage Workflow |
| 26 | +1. Alert surfaces (scan, PR annotation, or dashboard). |
| 27 | +2. Assign an owner automatically via `CODEOWNERS` or manually (`@equinor/security-team`). |
| 28 | +3. Validate: confirm reproducibility, assess exploitability in our context (e.g., library not used at runtime path?). |
| 29 | +4. Classify severity (table above) & document rationale in issue or alert comment. |
| 30 | +5. Decide disposition: |
| 31 | + - Remediate (create PR) |
| 32 | + - Mitigate (configuration change / rotation) |
| 33 | + - Accept risk (document reason) -> Mark `wont-fix` (CodeQL) or dismiss (Dependabot) with justification. |
| 34 | +6. Track SLA: use labels `security` + `severity/<level>` on issues/PRs. |
| 35 | +7. Verify fix: ensure updated scan passes & no regression. |
| 36 | + |
| 37 | +## 4. Secret Incidents |
| 38 | +If a secret is found: |
| 39 | +- Immediately revoke/rotate the credential. |
| 40 | +- Purge from history if high sensitivity (use GitHub guidance / BFG Repo-Cleaner). |
| 41 | +- Document rotation in internal runbook; NEVER store secrets in repo afterwards. |
| 42 | + |
| 43 | +## 5. False Positives & Suppression |
| 44 | +- CodeQL: Prefer updating code or adding precise guards. If not feasible, add a `# codeql[<query-id>]: disable <reason>` comment only where needed. |
| 45 | +- Dependabot: Dismiss with `not used at runtime` or `transitive - awaiting upstream` reason. |
| 46 | +- OWASP Dependency-Check: Use suppression XML file if persistent FP (store as `dependency-check-suppression.xml`). |
| 47 | + |
| 48 | +## 6. PR Requirements |
| 49 | +- All PRs must have successful: build, tests, CodeQL scan, and (if dependency changes) dependency review. |
| 50 | +- Security-sensitive changes (crypto, auth, input parsing) require at least 2 reviewers including one from security team. |
| 51 | + |
| 52 | +## 7. Tooling Enhancements (Future) |
| 53 | +- Add SARIF gating step to fail CI if Critical/High new issues appear. |
| 54 | +- Automate issue creation for CodeQL alerts via webhook/app. |
| 55 | +- Integrate metrics export to dashboard (MTTR, open-by-severity, secrets blocked). |
| 56 | + |
| 57 | +## 8. Metrics & Reporting |
| 58 | +Track monthly: |
| 59 | +- Open alerts by severity (snapshot) |
| 60 | +- New vs resolved counts |
| 61 | +- MTTR for Critical/High |
| 62 | +- Number of secrets blocked by Push Protection |
| 63 | +- Dependency update PR merge rate |
| 64 | + |
| 65 | +## 9. Contacts |
| 66 | +- Security questions: `@equinor/security-team` |
| 67 | +- Maintainers: see `CODEOWNERS` |
| 68 | + |
| 69 | +## 10. Review |
| 70 | +Review this policy quarterly or after major process/tooling changes. |
| 71 | + |
| 72 | +--- |
| 73 | +_Last updated: 2025-10-29_ |
0 commit comments