skip to content

Security Features

The supply-chain layer of the platform: Dependabot alerts and update PRs, secret scanning with push protection, CodeQL code scanning gating the diff, advisories, SBOMs and build attestations. Interviewers use it to test whether security is part of your pipeline or a report someone reads later.

part ofGitHuboverview, primer and where to startread it →
on this pageshow

questions

21

In GitHub, what is a Dependabot alert and where does its data come from?

level: juniorimportance: must knowfreq 60%

answer

  1. It reports, it does not fix
  2. Two inputs are being compared
  3. Your resolved packages, their advisory list
  4. GHSA entries and the dependency graph
  5. Transitive dependencies count too

basics

~20 s

A Dependabot alert is GitHub telling you that a package your repository depends on has a known vulnerability. It comes from matching the repository's dependency graph, built from committed manifests and lockfiles, against the GitHub Advisory Database.

solid answer

~40 s

GitHub builds a **dependency graph** for a repository by parsing the manifests and lockfiles you commit (`package-lock.json`, `pom.xml`, `go.sum`, and so on). It compares every resolved package and version against the **GitHub Advisory Database**, whose entries carry `GHSA-` identifiers and often a CVE too. When a version you depend on falls inside an advisory's vulnerable range, GitHub raises a **Dependabot alert** on the Security tab, with a severity, the affected manifest, and the first patched version. Alerts cover **transitive** dependencies as well as direct ones, because the graph is built from resolved versions, not just your top-level declarations. An alert is only a notification: opening a fix pull request is a separate feature (Dependabot security updates) that you enable on top of alerts.

code

json · 21 lines
json
GET /repos/OWNER/REPO/dependabot/alerts

[
  {
    "number": 12,
    "state": "open",
    "dependency": {
      "package": { "ecosystem": "maven", "name": "org.example:widget" },
      "manifest_path": "pom.xml",
      "scope": "runtime"
    },
    "security_advisory": {
      "ghsa_id": "GHSA-xxxx-xxxx-xxxx",
      "severity": "high"
    },
    "security_vulnerability": {
      "vulnerable_version_range": "< 2.4.1",
      "first_patched_version": { "identifier": "2.4.1" }
    }
  }
]

go deeper

for a junior

Be able to say in one sentence that GitHub compares your resolved dependencies against a database of published advisories and flags matches on the Security tab. Know that an alert is a notification, not a code change.

for a middle

Explain the two inputs — the dependency graph from manifests and lockfiles, and the GitHub Advisory Database with its GHSA identifiers — and why transitive dependencies show up.

for a senior

Show triage judgment: reachability, runtime versus development scope, whether a patched version exists, and what you do when no fix has been released yet. Interviewers want to hear you prioritise rather than chase every alert.

for a principal

Own the inventory and routing question: alerts are only useful if every repository has a graph, every alert has an owner, and severity maps to an agreed response time. Be ready to argue what you would measure instead of open-alert count.

## What an alert is A Dependabot alert is a repository-scoped notification that some package version your project resolves to is covered by a published security advisory. It is a *finding*, not a change: nothing in your repository is modified when an alert appears. Alerts live under the repository's Security tab and are also exposed through the REST API and webhooks, so they can be pulled into a ticketing system. ## Where the data comes from Two inputs combine. The first is the **dependency graph**. GitHub parses the dependency files you have committed for the ecosystems it supports and produces the list of packages the project actually resolves to. Lockfiles matter here: with a lockfile, the graph knows the exact resolved versions, including transitive ones. Without a lockfile, GitHub can only work from the ranges in the manifest, which makes the graph less precise. For some ecosystems the graph can also be enriched from build output that you submit yourself through the dependency submission API. The second is the **GitHub Advisory Database**, a curated set of advisories for open-source packages. Each entry has a `GHSA-` identifier, often a CVE alias, a severity, one or more affected ecosystems and package names, a vulnerable version range, and the first patched version. Advisories come from published CVE feeds, from maintainers who publish a repository security advisory, and from GitHub's own curation. When a package/version pair from the graph lands inside an advisory's vulnerable range, an alert is created. ## Direct versus transitive This is the part juniors most often miss. Most alerts in a mature repository are on **transitive** dependencies — packages you never wrote down, pulled in by something you did. That is exactly why the graph is built from resolved versions. It also explains why a fix sometimes cannot be a one-line manifest edit: you may need the intermediate package to release a version that requires the patched one, or you may need to pin an override in the ecosystem's own mechanism. ## What an alert does not do An alert does not open a pull request, does not fail a build, and does not prove you are exploitable. Vulnerability ranges are coarse: an advisory in a code path you never call is still reported. Severity is advisory-level, not application-level; a high-severity issue in a build-time-only dependency is usually less urgent than a medium one in a request-handling path. Interviewers like candidates who say this out loud rather than treating every alert as an incident. ## Enabling and access Dependency graph and Dependabot alerts are switched on per repository, and organisations can turn them on across many repositories at once through a security configuration. Alerts are visible to users with the right repository permission — typically write access and above — rather than to every reader of a private repository. Notification routing (email, web, ignore) is a per-user and per-organisation setting, which is why one team drowns in alert mail and another never sees any. ## Reading an alert A useful triage read of a single alert answers four questions: which package and version, which advisory (`GHSA-` id) and severity, whether the dependency is a runtime or development-scoped one, and whether a patched version exists at all. If no patched version exists yet, the alert is a monitoring item, not a task. If one does, the fix is a version bump — which is the job of Dependabot security updates, the sibling feature that turns alerts into pull requests. ## Common follow-through Teams that handle alerts well do three things: they enable the dependency graph everywhere so they have inventory, they route alerts to whoever owns the repository rather than to a central mailbox, and they agree an explicit response time by severity. Teams that handle them badly leave hundreds of open alerts and stop looking at the tab entirely, which is worse than not having the feature — it converts a signal into background noise.

  • Why do most alerts land on packages that are not in your manifest at all?
    Because the dependency graph is built from resolved versions, including transitive ones. A single direct dependency can pull in dozens of packages, and any of them can be covered by an advisory. That is also why the fix is sometimes to upgrade the intermediate package rather than the vulnerable one directly.
  • Does a Dependabot alert mean your application is exploitable?
    No. It means a version you resolve to falls inside an advisory's vulnerable range. Whether the vulnerable code path is reachable from your application, and whether the dependency is runtime or build-time only, are questions the alert cannot answer. Severity is advisory-level context, not an application risk score.
  • What happens to alerts if the repository has no lockfile?
    GitHub can still build a graph from the manifest, but it only knows the declared ranges rather than the exact resolved versions, so coverage of transitive dependencies is weaker and matches are less precise. Committing a lockfile for applications materially improves what the dependency graph and therefore the alerts can see.

saying these in an interview costs you the question

  • Thinks an alert automatically opens a fix pull request
  • Assumes only direct dependencies produce alerts
  • Treats every high-severity alert as an active incident
  • Believes the advisory data is scanned from your source code
  • Says alerts appear without the dependency graph enabled

context

open as a page

In GitHub, what is secret scanning and what does push protection add to it?

level: juniorimportance: must knowfreq 60%

basics

~20 s

GitHub secret scanning matches known credential formats across a repository's commits and raises alerts after the fact. Push protection applies the same detection at push time and rejects the push, so the credential never reaches the repository at all.

open as a page

What is the difference between CodeQL default setup and advanced setup on a GitHub repository?

level: middleimportance: must knowfreq 58%

basics

~20 s

Default setup is a GitHub-managed configuration enabled from repository settings with no workflow file: GitHub picks languages, queries and triggers. Advanced setup commits a workflow you own that calls the CodeQL action, so you control build, queries, packs and paths.

open as a page

In GitHub, how do Dependabot security updates differ from version updates?

level: middleimportance: must knowfreq 65%

basics

~20 s

Security updates are driven by Dependabot alerts and open a pull request that bumps a vulnerable package to the lowest patched version. Version updates keep dependencies current on a schedule you declare in .github/dependabot.yml, whether or not anything is vulnerable.

open as a page

GitHub push protection blocked your push — what are your options and what does each cost?

level: middleimportance: must knowfreq 55%

basics

~20 s

Either remove the secret from every commit in the push and push again, or follow the unblock URL and bypass with a reason. Bypassing lets the credential land, creates an alert, and is recorded — so the credential must then be treated as leaked.

open as a page

Where does GitHub's dependency graph get its data, and which dependencies does it miss?

level: middleimportance: must knowfreq 47%

basics

~20 s

GitHub builds the dependency graph by parsing supported manifest and lock files on the default branch. It misses vendored source, dependencies resolved only during the build, and anything undeclared — gaps you close by pushing a resolved graph through the dependency submission API.

open as a page

A GitHub secret scanning alert flags a live cloud key — what is your response order?

level: seniorimportance: must knowfreq 65%

basics

~20 s

Revoke and reissue the credential first, then check the provider's logs for misuse, then close the GitHub alert with the revoked resolution, and only then clean history. Rewriting commits does not un-leak anything already fetched.

open as a page

What does actions/attest-build-provenance produce, and what does gh attestation verify prove?

level: seniorimportance: must knowfreq 39%

basics

~20 s

The action produces a signed provenance statement binding an artifact's digest to the repository, workflow, ref and commit that built it. gh attestation verify checks the signature and that the digest matches an attestation from the repository or owner you name — nothing about the artifact's contents.

open as a page

In GitHub, what is code scanning, and where do CodeQL results show up on a pull request?

level: juniorimportance: should knowfreq 52%

basics

~20 s

GitHub code scanning stores static-analysis findings as repository alerts. On a pull request, findings on lines the diff touches appear as inline annotations plus a code scanning results check; every alert, new or old, lists under the repository's Security tab.

open as a page

How do you export an SBOM for a GitHub repository, and where does its content come from?

level: juniorimportance: should knowfreq 34%

basics

~20 s

GitHub exports an SBOM from the repository's dependency graph — via the Export SBOM action in the dependency graph view, or the dependency-graph SBOM REST endpoint. The output is SPDX JSON describing the default branch's known packages, not a build.

open as a page

How do you get results from a non-CodeQL scanner into GitHub code scanning?

level: middleimportance: should knowfreq 41%

basics

~10 s

Have the tool emit SARIF 2.1.0 and upload it — the github/codeql-action/upload-sarif action, or the code scanning SARIF API from external CI. The job needs security-events: write, and each tool needs its own category.

open as a page

How do grouped updates in GitHub's dependabot.yml reduce pull request volume?

level: middleimportance: should knowfreq 45%

basics

~20 s

A groups block in GitHub's dependabot.yml collapses many dependency bumps into one branch and one pull request per group per run. You define groups by name with patterns, dependency-type, or update-types, so twenty individual PRs become one reviewable change.

open as a page

How do you make GitHub code scanning block a merge, and what breaks when you do?

level: seniorimportance: should knowfreq 44%

basics

~20 s

Require the code scanning results check in branch protection, or add the code scanning rule to a GitHub ruleset with alert-severity thresholds. Both stall pull requests when the analysis is skipped by path filters, cannot run from a fork, or never reports.

open as a page

What must be true for a Dependabot patch bump to merge on GitHub without a human?

level: seniorimportance: should knowfreq 40%

basics

~20 s

The repository must have auto-merge enabled and the pull request must have auto-merge turned on; then GitHub merges it once every required status check passes and every review requirement is satisfied. Branch protection is what actually decides, not Dependabot.

open as a page

In GitHub's dependabot.yml, how do ignore and allow rules control which bumps you get?

level: seniorimportance: should knowfreq 40%

basics

~20 s

An allow block whitelists what Dependabot will consider at all, by dependency-type such as direct or production. An ignore block subtracts specific packages, version ranges, or bump sizes from what it proposes. Both live inside a single updates entry.

open as a page

When do you need a custom secret scanning pattern in GitHub, and how do you roll one out?

level: seniorimportance: should knowfreq 35%

basics

~20 s

You need one when the credential is issued by you rather than a partner provider, so no built-in pattern matches it. Define it at repository, organisation or enterprise level, dry-run it against real repositories to measure false positives, then publish it and enable push protection for it.

open as a page

In GitHub, what is a repository security advisory, and what does private vulnerability reporting add?

level: seniorimportance: should knowfreq 31%

basics

~20 s

A GitHub repository security advisory is a draft record of a vulnerability in your own project, with a private fork for developing the fix and an optional CVE request. Private vulnerability reporting gives researchers a private channel that opens such a draft instead of a public issue.

open as a page

CodeQL is enabled across your org and produced thousands of alerts nobody triages. How do you make it trustworthy?

level: principalimportance: should knowfreq 38%

basics

~20 s

Separate the historical backlog from new findings: gate only on alerts a pull request introduces, tune the configuration so recurring false positives stop firing, require a dismissal reason plus comment, and measure the false-positive rate per rule rather than the raw alert count.

open as a page

How would you roll out Dependabot across 200 GitHub repositories without drowning teams?

level: principalimportance: should knowfreq 30%

basics

~20 s

Split the rollout in two: turn dependency graph, alerts and security updates on everywhere through an organisation security configuration, and make scheduled version updates an opt-in choice per repository with a named owner, grouping, and a cadence that team can absorb.

open as a page

How would you enable GitHub push protection org-wide without stalling every team?

level: principalimportance: should knowfreq 30%

basics

~20 s

Enable alerting everywhere first through an organisation security configuration, triage the historical backlog by validity, then turn push protection on in waves. Fix fixture and sample false positives before blocking, and use delegated bypass only where the risk justifies the latency.

open as a page

A critical CVE lands in a common library. How do you use GitHub to find every affected repository fast?

level: principalimportance: should knowfreq 46%

basics

~20 s

Query the dependency graph across the organisation rather than repository by repository — organisation dependency insights and scripted SBOM exports answer which repos declare the package and at what version. Answering in minutes depends on preparation: the graph enabled everywhere, lockfiles committed, and build-time dependencies submitted.

open as a page