Microsoft certification · Exam GH-500

GH-500 Mock Exam

GitHub Advanced Security Exam

Free GH-500 questions on Configure and Use Dependency Management, each with the answer and an explanation.

20 questions · 30 minutes · free, no sign-up

Configure and Use Dependency Management questions

1–10 of 10 free
Question 1 Choose 1
Which key is required in the update settings of the Dependabot configuration file?
Show answerHide answer

Correct answer: D package-ecosystem

Explanation

Explanation:
The Dependabot configuration file (dependabot.yml) is used to automate dependency updates. Its structure is defined by specific, required keys that tell Dependabot what to update and how. Among the options, one key is fundamental and must be present in every updates entry for Dependabot to function, as it specifies the source of the dependencies.

Correct Option:

D. package-ecosystem:
This is the required key that identifies the package manager (e.g., npm, bundler, github-actions) Dependabot should monitor for a given directory. Without specifying the package-ecosystem, Dependabot cannot know which dependencies to check for updates.

Incorrect Options:

A. rebase-strategy:
This is an optional key that controls whether Dependabot should automatically rebase pull requests. It is not required for the basic configuration.

B. commit-message:
This is an optional key for customizing the commit message Dependabot uses. The configuration file has defaults and does not require this.

C. assignees:
This is an optional key used to specify GitHub users who should be assigned to the pull requests Dependabot creates. It is not a mandatory setting.

Reference:
GitHub documentation, "Configuration options for the dependabot.yml file," explicitly lists package-ecosystem as a required key under the updates section, while the other options are listed under "configuration-options" as optional.
Question 2 Choose 1
When does Dependabot alert you of a vulnerability in your software development process?
Show answerHide answer

Correct answer: B As soon as a vulnerable dependency is detected

Explanation

Explanation:
Dependabot's primary security function is to automatically scan your repository's dependency manifest files (like package.json or Gemfile.lock) for known vulnerabilities listed in advisory databases. Its alerting mechanism is designed for immediate notification to enable swift remediation, not to wait for a specific development event like a pull request.

Correct Option:

B. As soon as a vulnerable dependency is detected.
Dependabot continuously monitors your dependencies against security advisories (e.g., GitHub Security Advisories, NVD). When a new vulnerability is published and matches a dependency in your repository, Dependabot generates an alert immediately in the repository's "Security" tab and can notify configured maintainers.

Incorrect Options:

A. When a pull request adding a vulnerable dependency is opened:
While Dependabot may block such pull requests if configured, the security alert is generated by the presence of the vulnerable dependency in the codebase, not by the act of proposing it.

C. As soon as a pull request is opened by a contributor:
This is unrelated to Dependabot's vulnerability alerting. Dependabot alerts are triggered by dependency scans, not by general pull request activity.

D. When Dependabot opens a pull request to update a vulnerable dependency:
This describes a remediation action, not the initial alert. Dependabot first creates an alert (option B), and then, if configured for auto-fixes, it may subsequently open a pull request to resolve it.

Reference:
GitHub documentation, "About Dependabot alerts," states: "Dependabot alerts are triggered whenever a new security advisory is published for a dependency you use... You can see all of the alerts for dependencies in your repository in your repository's Security tab."
Question 3 Choose 2
Assuming that notification and alert recipients are not customized, what does GitHub do when it identifies a vulnerable dependency in a repository where Dependabot alerts are enabled? (Each answer presents part of the solution. Choose two.)
Show answerHide answer

Correct answer: A, B It generates a Dependabot alert and displays it on the Security tab for the repository.It notifies the repository administrators about the new alert.

Explanation

Explanation:
When Dependabot is enabled for a repository, its default, automated behavior upon detecting a vulnerable dependency involves two key actions. It creates a visible record of the issue within the repository's security interface and proactively notifies the individuals responsible for maintaining the repository, ensuring they are aware of the security risk.

Correct Options:

A. It generates a Dependabot alert and displays it on the Security tab for the repository.
This is the core function. The alert, containing details like the vulnerability severity, affected dependency, and patched versions, is created and listed in the repository's Security > Dependabot alerts tab for review and management.

B. It notifies the repository administrators about the new alert.
By default, GitHub sends email notifications to repository administrators and users with write permissions when a new Dependabot alert is detected. This ensures the team is proactively informed without requiring them to manually check the Security tab.

Incorrect Options:

C. It generates Dependabot alerts by default for all private repositories.
Dependabot alerts are a feature of GitHub Advanced Security (GHAS), which requires a license. For private repositories, GHAS (and thus Dependabot alerts) must be explicitly enabled by an organization owner or repository administrator; they are not enabled by default.

D. It consults with a security service and conducts a thorough vulnerability review.
This describes a manual, expert-driven process. Dependabot's process is fully automated. It consults its aggregated advisory databases (like GitHub Security Advisories and the National Vulnerability Database) and automatically generates the alert based on that data without human "consultation" or a custom "review."

Reference:
GitHub documentation, "About Dependabot alerts," states: "When Dependabot detects a vulnerable dependency in your repository, we generate a Dependabot alert and display it on the Security tab for your repository." It also notes under "Notification settings": "By default, you will receive Dependabot alerts... via email."
Question 4 Choose 1
Which of the following features helps to prioritize secret scanning alerts that present an immediate risk?
Show answerHide answer

Correct answer: D Secret validation

Explanation

Explanation:
Prioritizing secret scanning alerts is crucial for efficient security response. A feature that can actively check if a detected secret is currently valid and active (e.g., by making an authenticated API call to the relevant service provider) helps distinguish between live, high-risk secrets and revoked, expired, or fake ones. This directly identifies alerts presenting an immediate risk.

Correct Option:

D. Secret validation:
This is a feature for supported secret types (like GitHub tokens or Slack webhooks) where GitHub can automatically make a secure, outbound call to the issuing service provider to check if the detected secret is currently valid. A validated, active secret is a confirmed immediate risk and should be prioritized for remediation.

Incorrect Options:

A. Non-provider patterns:
These are custom regex patterns used to detect secrets for services not natively supported by GitHub's secret scanning partners. While they increase detection coverage, they do not inherently help with prioritization, as these custom patterns cannot be automatically validated.

B. Push protection:
This is a preventive feature that blocks commits containing detected secrets from being pushed to the repository. It stops new secrets from being introduced but does not itself prioritize existing alerts in the Security tab.

C. Custom pattern dry runs:
This is a testing feature that allows you to trial custom regex patterns against your repository's history to see what they would detect before enabling them live. It is part of setup and configuration, not alert prioritization.

Reference:
GitHub documentation, "About secret scanning," specifically discusses the "Validation" feature: "For some partners, GitHub can check that the secret found is currently valid on the partner's service... Validating the secret helps you prioritize which alerts to investigate first."
Question 5 Choose 3
Which Dependabot configuration fields are required? (Each answer presents part of the solution. Choose three.)
Show answerHide answer

Correct answer: A, B, D directorypackage-ecosystem schedule.interval

Explanation

Explanation:
The dependabot.yml configuration file must specify essential information for Dependabot to operate. This includes what to update (the package manager), where to look for it (the directory containing the manifest file), and when to check (the frequency). These three pieces of information form the minimal required configuration for each entry under the updates key.

Correct Options:

A. directory:
This is a required field that specifies the location of the package manifest file (e.g., / for the root, /backend for a subdirectory). Dependabot needs to know where to find the dependencies to update.

B. package-ecosystem:
This is a required field that identifies the package manager (e.g., npm, bundler, github-actions) for the update entry. It tells Dependabot which ecosystem's versioning and manifest files to inspect.

D. schedule.interval:
This is a required field that defines how often Dependabot checks for updates (e.g., daily, weekly, monthly). The schedule object must contain an interval to define the update frequency.

Incorrect Options:

C. milestone:
This is an optional field used to associate Dependabot's pull requests with a specific GitHub milestone. It is not required for the basic function of checking and updating dependencies.

E. allow:
This is an optional field used to specify which dependencies are allowed to be updated, typically used to define an allowlist or to permit major version updates. The configuration works without this field, in which case Dependabot uses its default behavior.

Reference:
GitHub documentation, "Configuration options for the dependabot.yml file," lists the required properties for each entry in the updates array as: package-ecosystem, directory, and schedule.interval. All other properties, like milestone and allow, are listed in the optional "configuration-options" section.
Question 6 Choose 1
You have enabled security updates for a repository. When does GitHub mark a Dependabot alert as resolved for that repository?
Show answerHide answer

Correct answer: D When you merge a pull request that contains a security update

Explanation

Explanation:
Dependabot alerts are tied to the presence of a specific vulnerable dependency version in a repository's default branch. The alert's status changes based on actions that remove that vulnerable version from the codebase. Simply creating a fix or dismissing the alert manually does not constitute an automatic, permanent resolution according to GitHub's automated tracking system.

Correct Option:

D. When you merge a pull request that contains a security update.
This is the primary automated resolution. When a pull request (whether from Dependabot or a developer) that updates the vulnerable dependency to a secure version is merged into the default branch, GitHub detects the fix and automatically marks the corresponding Dependabot alert as resolved.

Incorrect Options:

A. When Dependabot creates a pull request to update dependencies:
The alert remains open because the vulnerable code is still present in the default branch. The PR is a proposed fix, not an applied one.

B. When you dismiss the Dependabot alert:
Dismissing an alert manually changes its state to dismissed, not resolved. This is a manual administrative action, often used for false positives or accepted risks, and does not mean the vulnerability is fixed in the code.

C. When the pull request checks are successful:
Successful checks indicate the PR is ready to merge and passes tests, but the vulnerable dependency remains in the default branch until the PR is actually merged. The alert status is unaffected by CI/CD check results.

Reference:
GitHub documentation, "Viewing and updating Dependabot alerts," states: "Dependabot automatically closes Dependabot alerts when you... merge a pull request that contains a security update generated by Dependabot to your default branch." It distinguishes this from manually dismissing alerts.
Question 7 Choose 2
Which of the following tasks can be performed by a security team as a proactive measure to help address secret scanning alerts? (Each answer presents a complete solution. Choose two.)
Show answerHide answer

Correct answer: B, D Configure a webhook to monitor for secret scanning alert events.Document alternatives to storing secrets in the source code.

Explanation

Explanation:
Proactive measures taken by a security team aim to either improve the process of handling alerts or to prevent the secrets from being introduced in the first place. These measures focus on automation, awareness, and establishing better security practices before incidents occur.

Correct Options:

B. Configure a webhook to monitor for secret scanning alert events.
This is a proactive integration and automation measure. By setting up a webhook, the security team can receive real-time alerts in their internal security tools (like Slack channels, SIEMs, or ticketing systems), enabling faster triage and response workflows.

D. Document alternatives to storing secrets in the source code.
This is a proactive preventive and educational measure. By creating and sharing documentation on secure practices—such as using GitHub Secrets, environment variables, or dedicated secret managers—the security team helps developers avoid introducing secrets into the repository, thereby reducing future alerts.

Incorrect Options:

A. Dismiss alerts that are older than 90 days.
This is a reactive cleanup or maintenance task, not a proactive measure. It addresses a backlog but does nothing to improve the process or prevent new secrets. It could even be dangerous if done indiscriminately without verifying if old secrets are still valid.

C. Enable system for cross-domain identity management (SCIM) provisioning for the enterprise.
SCIM is related to user identity and access management (provisioning and deprovisioning accounts). It is a general IT security control but is not a specific, direct action that helps address secret scanning alerts.

Reference:
While the specific pairing is not in a single document, the proactive nature is supported by GitHub's best practices. Documentation for "Setting up notifications for secret scanning alerts" covers webhook integrations. The "About secret scanning" page and security best practices consistently recommend using secret managers as an alternative to hardcoding, which aligns with creating documentation for developers.
Question 8 Choose 1
If default code security settings have not been changed at the repository, organization, or enterprise level, which repositories receive Dependabot alerts?
Show answerHide answer

Correct answer: C None

Explanation

Explanation:
Dependabot alerts are a feature of GitHub Advanced Security (GHAS), which requires an active GHAS license and explicit enablement for private repositories. For public repositories, Dependabot alerts are free. However, the key phrase here is "default code security settings have not been changed." The default setting for all repositories is that Dependabot alerts are disabled unless an administrator proactively enables them.

Correct Option:

C. None:
By default, Dependabot alerts are not automatically enabled for any repositories. For private/internal repos, an organization or enterprise admin must explicitly enable GitHub Advanced Security. For public repos, while the feature is free, it is still opt-in and must be enabled in the repository's security settings by someone with admin access. The default state is "off."

Incorrect Options:

A. Repositories owned by an enterprise account & D. Repositories owned by an organization:
These are scopes where features can be managed, but ownership alone does not enable Dependabot alerts. An administrator must explicitly enable the feature at the enterprise, organization, or repository level. The default setting is disabled.

B. Private repositories:
Dependabot alerts for private repositories are a paid feature (part of GHAS). They are never enabled by default. An organization owner must first purchase GHAS, then explicitly enable it for the organization or specific private repositories.

Reference:
GitHub documentation, "Enabling Dependabot alerts for vulnerable dependencies," states: "Dependabot alerts are disabled by default. Repository administrators and organization owners can enable Dependabot alerts." It further clarifies that for private repositories, the feature is available with GitHub Advanced Security, which must be enabled.
Question 9 Choose 1
Assuming there is no custom Dependabot behavior configured, where possible, what does Dependabot do after sending an alert about a vulnerable dependency in a repository?
Show answerHide answer

Correct answer: A Creates a pull request to upgrade the vulnerable dependency to the minimum possible secure version

Explanation

Explanation:
Dependabot's workflow involves both detection and remediation. After sending an alert about a vulnerable dependency, its next automated action is to attempt to fix the issue. If a secure version of the dependency is available, Dependabot will propose a direct update to resolve the vulnerability, minimizing the effort required from the development team.

Correct Option:

A. Creates a pull request to upgrade the vulnerable dependency to the minimum possible secure version.
This is Dependabot's standard, automated remediation behavior. When configured for security updates, it automatically opens a pull request that updates the vulnerable dependency to the lowest available non-vulnerable version (a security fix). This happens after the alert is generated.

Incorrect Options:

B. Scans repositories for vulnerable dependencies on a schedule and adds those files to a manifest:
Scanning is the initial detection step that triggers the alert, not a subsequent action. Dependabot does not "add files to a manifest"; it reads existing manifest files.

C. Constructs a graph of all the repository's dependencies and public dependents for the default branch:
While dependency graph creation is a related foundational service, it is a continuous background process, not a specific sequential action taken after an alert is sent.

D. Scans any push to all branches and generates an alert for each vulnerable repository:
This describes real-time scanning behavior, not a follow-up action. The phrase "for each vulnerable repository" is also incorrect; alerts are generated per vulnerable dependency within a repository.

Reference:
GitHub documentation, "About Dependabot security updates," explains the sequence: "When Dependabot identifies a vulnerable dependency... Dependabot creates a pull request to update the dependency to the minimum version that resolves the vulnerability."
Question 10 Choose 1
What is a prerequisite to define a custom pattern for a repository?
Show answerHide answer

Correct answer: D Enable secret scanning

Explanation

Explanation:
Custom patterns are a feature of GitHub's secret scanning service that allows you to detect secrets specific to your organization. Like all secret scanning features, the underlying service must be active and running on the repository for you to configure any of its extended capabilities, including custom patterns.

Correct Option:

D. Enable secret scanning:
This is the absolute prerequisite. Secret scanning (for push protection or scanning existing repositories) must be enabled for the repository, either at the repository, organization, or enterprise level. Without the base feature being active, the option to define custom patterns is unavailable.

Incorrect Options:

A. Change the repository visibility to Internal:
Repository visibility does not determine feature availability for secret scanning. Secret scanning is available for public repositories for free and for private/internal repositories with GitHub Advanced Security. Changing visibility is not a prerequisite for configuration.

B. Close other secret scanning alerts:
There is no requirement to resolve existing alerts before defining new custom patterns. These are independent functions; you can configure detection rules while having open alerts.

C. Specify additional match criteria:
This describes part of defining the custom pattern itself (e.g., specifying a confidence level or required prefix). It is a step you take after the prerequisite of enabling secret scanning has been met, not a prerequisite for enabling the feature.

Reference:
GitHub documentation, "Defining custom patterns for secret scanning," begins by stating: "To define custom patterns for a repository, you must be a repository administrator and secret scanning must be enabled for the repository." It lists enabling the feature as the first requirement.

That's the last free question in Configure and Use Dependency Management

You've seen the free 30% (10 of 34 questions). Full access unlocks every question and full-length GH-500 mock exams, a different mock on every attempt.

Unlock full mock exam
Full mock exam

Sit the GH-500 exam before exam day

Full-length mocks with the same number of questions and the same time limit as the real GH-500 exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.

Get full GH-500 mock exam
  • —questions per mock
  • —time limit
  • 75questions in the bank
  • Newmock on every attempt