Mitigation Strategy: Dependency Selection and Vetting
Mitigation Strategy: Choose Reputable Dependencies and Minimize Dependency Count
-
Description:
- Research: Before adding a dependency, research its reputation. Check its GitHub repository (stars, forks, issues, pull requests, last commit date). Look for signs of active maintenance and community engagement.
- Security Advisories: Search for known vulnerabilities in the dependency using resources like Snyk, OSV, and GitHub's security advisories.
- Alternatives: Consider alternative dependencies that might be more secure or better maintained.
- Necessity: Critically evaluate if the dependency is absolutely necessary. Could a small, in-house function achieve the same result?
- Documentation: Document the rationale for choosing a specific dependency, including the security considerations.
-
Threats Mitigated:
- Vulnerabilities in Dependencies (Severity: High to Critical): Reduces the likelihood of introducing known vulnerabilities.
- Malicious Dependencies (Severity: Critical): Reduces the chance of intentionally malicious code being included.
- Outdated Dependencies (Severity: Medium to High): By favoring actively maintained dependencies, reduces the risk of using outdated versions.
- Dependency Bloat (Severity: Medium): Reduces the overall attack surface.
-
Impact:
- Vulnerabilities in Dependencies: Significantly reduces risk (e.g., 70-80% reduction).
- Malicious Dependencies: Significantly reduces risk (e.g., 90% reduction).
- Outdated Dependencies: Moderately reduces risk (e.g., 50% reduction).
- Dependency Bloat: Directly reduces the attack surface.
-
Currently Implemented:
- Basic research is performed before adding new dependencies (documented in pull request comments).
- A list of preferred, commonly used dependencies is maintained.
-
Missing Implementation:
- No systematic search for security advisories is performed before adding a dependency.
- No documentation of the security rationale for choosing a dependency.
Mitigation Strategy: Dependency Updates and Patching
Mitigation Strategy: Regular Dependency Audits and Automated Updates (with Review)
-
Description:
- Automated Scanning: Integrate a dependency scanning tool (e.g., Snyk, Dependabot, Renovate) into the CI/CD pipeline. Configure it to run on every build and pull request.
- Update Tool: Use a tool like Dependabot or Renovate to automatically generate pull requests for dependency updates.
- Changelog Review: Review the changelog and release notes for the updated dependency to understand the changes and potential security fixes.
- Testing: Run the full test suite (unit, integration, end-to-end) after applying any dependency update.
- Emergency Patching: Define a documented procedure for quickly applying critical security patches, even if it means temporarily overriding dependency versions.
-
Threats Mitigated:
- Vulnerabilities in Dependencies (Severity: High to Critical): Ensures timely patching of known vulnerabilities.
- Outdated Dependencies (Severity: Medium to High): Keeps dependencies up-to-date.
-
Impact:
- Vulnerabilities in Dependencies: Significantly reduces risk (e.g., 80-90% reduction).
- Outdated Dependencies: Almost eliminates the risk (e.g., 95% reduction).
-
Currently Implemented:
- Dependabot is enabled and generates pull requests for updates.
- Basic unit tests are run after dependency updates.
-
Missing Implementation:
- Integration and end-to-end tests are not consistently run after dependency updates.
- No documented emergency patching procedure.
- Snyk integration is not present in CI/CD.
Mitigation Strategy: Dependency Integrity and Supply Chain Security
Mitigation Strategy: Verify Dependency Integrity and Use a Private Dependency Proxy
-
Description:
- Checksum Verification: Ensure that the dependency management tool (and
go.sum
in the case of Go) automatically verifies checksums or signatures of downloaded dependencies. - Proxy Setup: Set up a private dependency proxy (e.g., JFrog Artifactory, Sonatype Nexus). Configure the build system to use this proxy instead of public repositories.
- Proxy Configuration: Configure the proxy to:
- Cache dependencies for faster and more reliable builds.
- Allow only approved dependencies (whitelist).
- Scan dependencies for vulnerabilities.
- Regular Audits: Regularly audit the proxy's configuration and logs.
- Checksum Verification: Ensure that the dependency management tool (and
-
Threats Mitigated:
- Supply Chain Attacks (Severity: Critical): Protects against compromised repositories or man-in-the-middle attacks.
- Dependency Confusion/Substitution (Severity: Critical): Prevents attackers from tricking the build system.
- Malicious Dependencies (Severity: Critical): Adds an extra layer of defense.
-
Impact:
- Supply Chain Attacks: Significantly reduces risk (e.g., 90-95% reduction).
- Dependency Confusion/Substitution: Almost eliminates the risk (e.g., 99% reduction).
- Malicious Dependencies: Moderately reduces risk (e.g., 50% reduction).
-
Currently Implemented:
go.sum
is used, ensuring basic checksum verification for Go dependencies.
-
Missing Implementation:
- No private dependency proxy is used.
- No regular audits of dependency sources.
Mitigation Strategy: License Compliance
Mitigation Strategy: Automated License Scanning and Policy Enforcement
-
Description:
- Tool Selection: Choose a license scanning tool (e.g., FOSSA, ScanCode, LicenseFinder).
- Integration: Integrate the tool into the CI/CD pipeline to automatically scan dependencies on every build.
- Policy Definition: Define a clear license compliance policy, specifying allowed and disallowed licenses.
- Configuration: Configure the scanning tool to enforce the defined policy.
- Remediation: Establish a process for addressing license violations (e.g., replacing the dependency).
- Documentation: Document the license compliance policy and the process.
-
Threats Mitigated:
- License Compliance Violations (Severity: Medium to High): Prevents the use of dependencies with incompatible licenses.
-
Impact:
- License Compliance Violations: Significantly reduces risk (e.g., 90-95% reduction).
-
Currently Implemented:
- None.
-
Missing Implementation:
- No automated license scanning.
- No defined license compliance policy.
- No process for handling license violations.