Best practices for maintaining dependencies

Guidance and recommendations for maintaining the dependencies you use, including GitHub's security products that can help.

Best practices for maintaining dependencies

Staying up to date on dependencies is crucial to maintaining a secure software environment. Here are some recommendations:

Adopt security-focused dependency management tools

Perform regular vulnerability scans and audits

Automate security patch management

Enforce policies on the use of dependencies

Integrate security testing in CI/CD

Use lock files and dependency pinning

Monitor security advisories

Version control and change management

Training and awareness

Response plan for vulnerabilities

By following these practices, you can significantly reduce the risk posed by outdated and vulnerable dependencies and maintain a more secure environment.

How GitHub can help

GitHub provides security features to help you maintain dependencies:

Dependency graph: Tracks your project dependencies and identifies vulnerabilities. See Dependency graph.

Dependency review: Catches insecure dependencies in pull requests before they're merged. In addition, the dependency review action can fail checks and, when required by branch protection rules, prevent pull requests that introduce vulnerabilities from being merged. See Dependency review.

Dependabot: Automatically scans for vulnerabilities, creates alerts, and opens pull requests to update vulnerable or outdated dependencies. You can group multiple updates into single pull requests to streamline reviews. See Dependabot alerts.

GitHub Advisory Database: Provides security advisories that power Dependabot's vulnerability detection. See GitHub Advisory database.

Private vulnerability reporting: Enables maintainers to receive, discuss, and fix vulnerability reports in private before public disclosure.
Security overview: Shows your organization's security posture with dashboards for at-risk repositories, alert trends, and feature enablement status. See Security overview.

For end-to-end supply chain guidance, see Securing your end-to-end supply chain.