|
| 1 | +# Dependency Management Policy |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +CloudNativePG (CNPG) is committed to maintaining a secure and stable software |
| 6 | +supply chain. As an operator managing critical database workloads, the |
| 7 | +integrity of our dependencies, ranging from Go modules to container base |
| 8 | +images, is paramount. |
| 9 | + |
| 10 | +**This document outlines our policies for selecting, monitoring, and updating |
| 11 | +third-party dependencies.** |
| 12 | + |
| 13 | +## Selection Criteria |
| 14 | + |
| 15 | +Before introducing a new dependency to the project, maintainers must evaluate |
| 16 | +it against the following criteria: |
| 17 | + |
| 18 | +- **Necessity:** Does the dependency provide essential functionality that |
| 19 | + cannot be reasonably implemented within the project? |
| 20 | +- **Security Posture:** Preference is given to projects with high OpenSSF |
| 21 | + Scorecard ratings and a clear security policy. |
| 22 | +- **Maintenance:** The dependency must be actively maintained with a history of |
| 23 | + timely security patches. |
| 24 | +- **Licensing:** All dependencies must comply with the Apache License 2.0 or a |
| 25 | + compatible permissive license (e.g. MIT, BSD-3-Clause). |
| 26 | + |
| 27 | +## Automated Monitoring and Scanning |
| 28 | + |
| 29 | +We employ a "defense in depth" approach to monitoring our dependency tree |
| 30 | +through automated tooling: |
| 31 | + |
| 32 | +- **Update Automation:** GitHub's built-in |
| 33 | + [Dependabot](https://github.com/dependabot) alerts notify us of known |
| 34 | + vulnerabilities in our dependencies. We use |
| 35 | + [Renovate](https://github.com/renovatebot/renovate) for granular version |
| 36 | + management, automated grouping of updates, and maintenance of GitHub Actions. |
| 37 | +- **Vulnerability Scanning:** Every Pull Request and push to the main branch |
| 38 | + triggers automated scans using [Snyk](https://snyk.io/) and |
| 39 | + [govulncheck](https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck) to identify |
| 40 | + known vulnerabilities (CVEs). |
| 41 | +- **Static Analysis:** We rely on [CodeQL](https://codeql.github.com/) and |
| 42 | + [golangci-lint](https://github.com/golangci/golangci-lint) (which includes the |
| 43 | + [gosec](https://github.com/securego/gosec) security linter) to identify security |
| 44 | + risks introduced by the way dependencies are utilized in our code. |
| 45 | +- **Container Hardening:** We run |
| 46 | + [Dockle](https://github.com/goodwithtech/dockle) to lint our container images |
| 47 | + against security best practices, ensuring that our images are lean, do not run |
| 48 | + as `root`, and do not contain sensitive information in their history. |
| 49 | + |
| 50 | +## Supply Chain Integrity |
| 51 | + |
| 52 | +To ensure that the code we build is the code we intended to use, we implement |
| 53 | +the following: |
| 54 | + |
| 55 | +- **Checksum Verification:** We use [`go.sum`](./go.sum) to ensure the |
| 56 | + integrity of Go modules. |
| 57 | +- **Artifact Signing:** All container images are cryptographically signed using |
| 58 | + [Cosign](https://github.com/sigstore/cosign). |
| 59 | +- **SLSA Provenance:** We generate SLSA-formatted provenance attestations for |
| 60 | + all releases. These are delivered as OCI attestations integrated into our |
| 61 | + build process via BuildKit (`buildType: https://mobyproject.org/buildkit@v1`). |
| 62 | +- **Software Bill of Materials (SBOM):** We provide a comprehensive SBOM for |
| 63 | + every image, allowing users to verify the entire bill of materials for any |
| 64 | + given version. |
| 65 | + |
| 66 | +## Remediation Cadence |
| 67 | + |
| 68 | +Security updates are treated as high-priority tasks. The project aims for the |
| 69 | +following remediation timeframes: |
| 70 | + |
| 71 | +- **Critical and High Vulnerabilities:** Once a fix is available in the |
| 72 | + upstream dependency, we aim to merge the update and initiate a release |
| 73 | + process within one week. |
| 74 | +- **Medium and Low Vulnerabilities:** These updates are typically batched and |
| 75 | + addressed as part of our regular maintenance and release cycles once upstream |
| 76 | + fixes are provided. |
| 77 | + |
| 78 | +## Contact |
| 79 | + |
| 80 | +For security-related concerns regarding our dependencies, please refer to our |
| 81 | +[`SECURITY.md` file](./SECURITY.md). |
0 commit comments