Automating Vulnerability Analysis with Dependabot
This lesson explains Dependabot alerts, security updates and version updates.
Learning outcomes
After completing this lesson, you will be able to:
- Describe the dependency graph and advisory database.
- Distinguish the three Dependabot features.
- Write a dependabot.yml file.
- Manage alert and pull request volume.
The foundation: dependency graph and advisories
Dependabot depends on two things. The dependency graph lists a repository's dependencies, parsed from manifests and lock files such as package-lock.json. The GitHub Advisory Database lists known vulnerabilities, with affected version ranges. Lock files give a more accurate graph, since they include transitive dependencies. A dependency submission API allows a build to report dependencies that static parsing cannot find.
What Dependabot relies on
Three separate features
The name Dependabot covers three features, and it is important to distinguish them.
Dependabot alerts
Dependabot alerts tell you that a repository uses a vulnerable dependency. An alert is raised when a new advisory matches, or when a change adds a vulnerable package. It appears on the Security tab, with severity, affected versions and a patched version. Alerts are available on all GitHub plans, and they need the dependency graph.
Dependabot security updates
Dependabot security updates act on an alert by opening a pull request that raises the package to the minimum patched version. Tests then run in the normal way, so that a team can merge with confidence.
Dependabot version updates
Dependabot version updates keep dependencies current even without a vulnerability, on a schedule, so that an urgent upgrade is less likely to be a big jump. They are set in a configuration file.
# .github/dependabot.yml
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 5
groups:
development:
dependency-type: development
update-types: [minor, patch]
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
- package-ecosystem: docker
directory: /
schedule:
interval: weeklyThe github-actions ecosystem keeps actions current, including SHA-pinned ones. groups combines updates into a single pull request, which reduces noise.
The following diagram shows the configuration and the two kinds of update.

Alerts, security updates or version updates?
Managing the volume
Without management, Dependabot can produce a stream of pull requests and alerts that nobody reads. Several features help.
- Dependabot auto-triage rules dismiss or snooze alerts that match conditions, such as low severity development dependencies.
- EPSS scores estimate how likely a vulnerability is to be exploited, which improves prioritization beyond severity.
- Grouped updates reduce the number of pull requests.
- Auto-merge with good test coverage can merge minor and patch updates automatically.
- Dependency review stops new vulnerable packages from arriving through a pull request.
Enabling Dependabot across an organization is done with security configurations. For Azure Repos, Dependabot is not the mechanism: dependency scanning from GitHub Advanced Security for Azure DevOps fills that role.
Keeping Dependabot manageable
Handling an alert
-
Assess
Read the advisory, and decide whether the vulnerable function is reachable.
-
Fix
Merge a Dependabot pull request, or update the dependency by hand.
-
Handle a blocked fix
If no patch exists, consider a workaround, or replacing the package.
-
Dismiss with a reason
Record that a finding is tolerable, or inaccurate, if that is the case.
Handling a Dependabot alert
Automating fixes
A repository receives alerts for vulnerable npm packages, but developers do not get time to create upgrades. The team wants proposed fixes automatically, and it also wants a weekly routine of minor updates in a single pull request. What should you configure?
Enable Dependabot security updates for proposed fixes, and add a .github/dependabot.yml with a weekly schedule and a group for minor and patch updates, for version updates. Alerts alone would notify without fixing. Code scanning finds flaws in your own code, and would not update dependencies.
Which Dependabot feature needs a configuration file?
Show answer
Version updates, through .github/dependabot.yml. Alerts and security updates are repository settings.
Exam Tips
Remember for the exam
- Dependabot alerts need the dependency graph, and are on all plans.
- Security updates open pull requests that fix alerts.
- Version updates use a schedule in .github/dependabot.yml.
- Use groups to reduce pull request volume.
- Azure Repos uses GitHub Advanced Security dependency scanning, not Dependabot.