Home / GitHub Advanced Security (GH-500) / Mock exam
GitHub Advanced Security (GH-500) Exam-style mock test

GitHub Advanced Security (GH-500) Practice Exams|Practice test

Full explanations Exam format Pass line 70%
33 USD One-time · lifetime access
Enroll →

Sample questions

Example1 · GitHub Advanced Security Fundamentals and Setup
A B2B SaaS company runs its multi-tenant billing platform in a private repository on GitHub Enterprise Cloud. The security lead wants to detect hardcoded API keys committed to the repo, flag SQL injection patterns in the code, and surface vulnerable open-source dependencies. Which combination of GitHub Advanced Security features directly addresses all three of these needs?
✓Secret scanning for the API keys, code scanning for the SQL injection patterns, and Dependabot alerts (dependency review) for the vulnerable dependencies
Correct. Secret scanning finds committed credentials, code scanning (CodeQL) detects injection and other code-level vulnerabilities, and Dependabot alerts surface known-vulnerable dependencies.
・Branch protection rules for the API keys, required status checks for the SQL injection patterns, and the dependency graph export for the vulnerable dependencies
Incorrect. Branch protection, required status checks, and dependency graph export are governance and visibility controls, not the detection capabilities for secrets, code flaws, or vulnerable dependencies.
・Push protection for the API keys, security advisories for the SQL injection patterns, and automated token revocation for the vulnerable dependencies
Incorrect. Push protection blocks secrets at push time rather than detecting committed ones, security advisories document issues rather than detect code flaws, and token revocation is a partner response, not dependency detection.
・Repository rulesets for the API keys, environment protection rules for the SQL injection patterns, and the audit log for the vulnerable dependencies
Incorrect. Rulesets, environment protection rules, and the audit log govern access and record events; none of them detect secrets, injection patterns, or vulnerable dependencies.
Explanation
GitHub Advanced Security maps each need to a specific feature: secret scanning for credentials, code scanning for code-level vulnerabilities, and Dependabot for vulnerable dependencies.
Example2 · Code Scanning and CodeQL
A B2B SaaS company is onboarding its flagship billing repository to code scanning. The security team wants the fastest path to enabled scanning without maintaining a workflow file, and they expect GitHub to automatically detect the languages and query suites. Which approach should they choose?
✓Enable CodeQL default setup from the repository's Code security settings, which auto-detects languages and runs scans without a committed workflow
Correct. Default setup enables CodeQL directly from repository settings, automatically detecting supported languages and selecting query suites with no workflow file to maintain.
・Commit a custom codeql-analysis.yml workflow and manually list each compiled and interpreted language in the build matrix
Incorrect. This describes advanced setup, which requires authoring and maintaining a workflow file and is not the fastest no-maintenance option.
・Install a third-party scanning Action from the Marketplace and schedule it to run nightly against the main branch
Incorrect. A third-party Marketplace Action is not CodeQL default setup and would not satisfy the requirement to use GitHub's native auto-detection.
・Add a pre-commit hook that invokes the CodeQL CLI locally so results are produced before any code reaches GitHub
Incorrect. Local pre-commit CLI runs do not enable repository-level code scanning or upload results through default setup.
Explanation
CodeQL default setup is the quickest way to enable code scanning: it auto-detects languages and runs query suites without a committed workflow, unlike advanced setup which relies on a maintained YAML file.
Example3 · Secret Scanning and Push Protection
At a B2B SaaS company, a platform engineer needs to turn on secret scanning for a single private repository that holds the billing service. GitHub Advanced Security is already enabled for the organization. Where should the engineer go to enable secret scanning for just that repository?
✓The repository's Settings page, under the Code security and analysis section, where secret scanning can be toggled on for that repository
Correct. Secret scanning is enabled per repository from Settings under Code security and analysis once GitHub Advanced Security is active for the organization.
・The repository's Actions page, by adding a workflow file that runs the secret scanning engine on every push to the default branch
Incorrect. Secret scanning is a built-in platform feature controlled by settings, not a GitHub Actions workflow that you author and run manually.
・The organization's Billing and plans page, by assigning an additional Advanced Security seat specifically to the billing service repository
Incorrect. Advanced Security seats are consumed by active committers, not assigned to individual repositories, and seats are not where scanning is toggled.
・The repository's Branches page, by marking the default branch as protected so the scanning engine is permitted to inspect commits
Incorrect. Branch protection controls merging and review requirements and does not enable or gate the secret scanning engine.
Explanation
Secret scanning is enabled per repository through Settings > Code security and analysis, provided GitHub Advanced Security is available to the organization.
Example4 · Dependency Review and Dependabot (Supply Chain)
A healthcare services firm's platform team just imported a legacy patient-scheduling repository into their enterprise organization. They want GitHub to automatically detect known vulnerabilities in the repository's third-party dependencies and notify them. In the repository settings, which feature must be enabled to generate these notifications?
✓Dependabot alerts, which cross-reference the repository's dependency graph against the GitHub Advisory Database
Correct. Dependabot alerts rely on the dependency graph and match detected dependencies against the GitHub Advisory Database to notify maintainers of known vulnerabilities.
・Secret scanning alerts, which inspect committed files for exposed credentials and API tokens in the codebase
Incorrect. Secret scanning finds exposed credentials in the codebase, not vulnerabilities in third-party dependencies tracked by the advisory database.
・Code scanning with CodeQL, which performs static analysis of the application's own first-party source code
Incorrect. Code scanning with CodeQL analyzes the repository's own source code for flaws and does not generate alerts for vulnerable third-party packages.
・Push protection, which blocks commits that introduce newly disclosed vulnerable packages into the branch
Incorrect. Push protection is a secret scanning capability that blocks committed secrets; it is not the mechanism that produces dependency vulnerability alerts.
Explanation
Dependabot alerts use the dependency graph to identify packages and compare them against the GitHub Advisory Database, surfacing known vulnerabilities to maintainers.
Example5 · Security Administration, Policies, and Reporting
A healthcare services firm wants every new repository created under its GitHub Enterprise organization to automatically enable secret scanning and push protection without administrators touching each repo. Which organization-level setting enforces this for repositories going forward?
✓Enable "Automatically enable for new repositories" under the organization's GitHub Advanced Security secret scanning settings
Correct. The organization code security and analysis settings include an "Automatically enable for new repositories" toggle for secret scanning and push protection, applying the feature to repos created afterward without per-repo configuration.
・Create a required status check in a repository ruleset that blocks merges until secret scanning has run on the branch
Incorrect. A required status check gates merges on an existing check but does not turn on secret scanning or push protection for newly created repositories.
・Add each repository to a custom repository property and filter dependency review alerts by that property value
Incorrect. Custom properties and dependency review filtering help organize and triage repos but do not enable secret scanning on new repositories.
・Configure a self-hosted runner group restricted to the security team so scanning jobs only run on approved hardware
Incorrect. Runner groups control where Actions jobs execute and are unrelated to automatically enabling secret scanning for new repositories.
Explanation
Organization-wide enablement for new repositories is handled by the "Automatically enable for new repositories" option in the code security and analysis settings, not by rulesets, properties, or runner groups.
Example6 · GitHub Advanced Security Fundamentals and Setup
A healthcare services firm is evaluating GitHub Advanced Security (GHAS) to protect its patient-portal repositories hosted on GitHub Enterprise Cloud. The security lead wants to understand which capabilities are included under the GHAS license so the team can plan its rollout. Which set of features is delivered by GitHub Advanced Security?
✓Code scanning, secret scanning, and dependency review, which analyze code, credentials, and dependency changes for vulnerabilities
Correct. Code scanning, secret scanning, and dependency review are the core GHAS features that inspect source code, detect exposed secrets, and surface risky dependency changes in pull requests.
・Branch protection rules, required reviewers, and merge queues, which enforce workflow governance on protected branches
Incorrect. Branch protection, required reviewers, and merge queues are standard repository governance controls available without a GHAS license.
・SAML single sign-on, SCIM provisioning, and IP allow lists, which manage organization authentication and access
Incorrect. SAML SSO, SCIM, and IP allow lists are enterprise authentication and access features, not part of the GHAS security feature set.
・Audit log streaming, repository rulesets, and environment protection rules, which govern compliance and deployment controls
Incorrect. Audit log streaming, rulesets, and environment protection are governance and compliance features that ship outside the GHAS license.
Explanation
GitHub Advanced Security bundles code scanning, secret scanning, and dependency review as its defining security capabilities for analyzing code, credentials, and dependencies.
Example7 · GitHub Advanced Security Fundamentals and Setup
NordicThread, an online apparel retailer, is planning its GitHub Advanced Security rollout and needs to document which capability detects hardcoded credentials that developers accidentally commit to the checkout-service repository. Which GitHub Advanced Security feature is designed specifically for this purpose?
✓Secret scanning, which inspects commits and repository contents for known token formats and credential patterns
Correct. Secret scanning examines commit history and file contents against partner and custom patterns to detect exposed credentials such as API keys and tokens.
・Code scanning, which runs static analysis queries to find exploitable code-level vulnerabilities and bugs
Incorrect. Code scanning analyzes source code for vulnerabilities and quality issues but does not specialize in finding committed secrets.
・Dependency review, which surfaces vulnerable packages introduced in a pull request before merge
Incorrect. Dependency review focuses on the risk of changed dependencies in a pull request, not on hardcoded credentials in the code.
・Security advisories, which let maintainers privately coordinate fixes for reported repository vulnerabilities
Incorrect. Security advisories are for privately discussing and publishing vulnerability information, not for detecting committed secrets.
Explanation
Secret scanning is the GitHub Advanced Security feature dedicated to finding exposed credentials in commits and repository contents.
Example8 · GitHub Advanced Security Fundamentals and Setup
An administrator at UrbanNest Home Goods wants to turn on GitHub Advanced Security for the private inventory-api repository on GitHub Enterprise Cloud. Where should the administrator go to enable these features for that single repository?
✓The repository's Settings page under the Code security and analysis section
Correct. Repository-level GitHub Advanced Security features are enabled from that repository's Settings under Code security and analysis.
・The organization's Member privileges page under the base permissions controls
Incorrect. Member privileges control base repository access across the organization, not GitHub Advanced Security feature toggles.
・The repository's Actions page under the general workflow permissions
Incorrect. The Actions page configures workflow run and token permissions, not GitHub Advanced Security enablement.
・The enterprise account's Policies page under the Advanced Security billing tab
Incorrect. Enterprise policies govern organization-wide rules and billing, but a single repository is enabled from its own settings.
Explanation
Individual repositories enable GitHub Advanced Security from the Code security and analysis section of their Settings.
Example9 · GitHub Advanced Security Fundamentals and Setup
The platform team at BrightCart, a grocery delivery company, is budgeting for GitHub Advanced Security on GitHub Enterprise Cloud. They need to understand what consumes a license. On what basis are GitHub Advanced Security licenses consumed?
✓Each unique active committer who has pushed to a repository where GitHub Advanced Security is enabled
Correct. A GitHub Advanced Security license is consumed per unique active committer to any repository where the feature is enabled, counted across the enterprise.
・Each private repository in the organization regardless of how many developers contribute to it
Incorrect. Licensing is based on committers, not on the number of private repositories that have the feature enabled.
・Each pull request that triggers a code scanning analysis within an enabled repository
Incorrect. Code scanning analyses do not individually consume licenses; the committer count drives licensing.
・Each organization member account that has been granted write access to any repository
Incorrect. Simply holding write access does not consume a license; active committing to an enabled repository does.
Explanation
GitHub Advanced Security is licensed by unique active committers to enabled repositories, deduplicated across the enterprise.
Example10 · GitHub Advanced Security Fundamentals and Setup
A security architect at a regional retail bank is preparing a slide that lists which capabilities are unlocked by enabling GitHub Advanced Security on the bank's GitHub Enterprise Cloud organization. Which set of features is correctly attributed to GitHub Advanced Security?
✓Code scanning, secret scanning, and dependency review across the bank's private repositories
Correct. Code scanning, secret scanning, and dependency review are the core features delivered through GitHub Advanced Security on private repositories.
・Branch protection rules, required status checks, and signed commit enforcement on release branches
Incorrect. Branch protection, required status checks, and commit signing are standard repository governance controls available without GitHub Advanced Security.
・Single sign-on, SCIM user provisioning, and IP allow-listing for the finance engineering teams
Incorrect. SSO, SCIM, and IP allow-listing are enterprise authentication and access features, not part of the Advanced Security feature set.
・Audit log streaming, organization-wide webhooks, and repository transfer approvals for compliance
Incorrect. Audit log streaming, webhooks, and transfer approvals are platform administration capabilities that exist independently of Advanced Security.
Explanation
GitHub Advanced Security bundles code scanning, secret scanning, and dependency review; the other options describe separate access, governance, or administration features.
Example11 · GitHub Advanced Security Fundamentals and Setup
A fintech company running GitHub Enterprise Cloud is budgeting for GitHub Advanced Security. Their finance team asks how the committer-based license consumption actually works so they can forecast cost accurately. How are Advanced Security licenses consumed in this model?
✓One license is consumed for each active committer to any repository that has GitHub Advanced Security enabled, counted uniquely per enterprise
Correct. Advanced Security billing is committer-based, consuming one license per unique active committer to any GHAS-enabled repository across the enterprise.
・One license is consumed for every repository that has GitHub Advanced Security enabled, regardless of how many developers contribute to it
Incorrect. Licensing is tied to active committers rather than to the number of repositories that have the feature enabled.
・One license is consumed for each code scanning alert that remains open longer than the organization's configured remediation window
Incorrect. Open alert counts affect remediation metrics, not license consumption, which is measured by active committers.
・One license is consumed for every pull request that triggers a secret scanning or code scanning workflow run during the billing period
Incorrect. Workflow or pull request runs are unrelated to seat consumption; licenses are counted by unique committers.
Explanation
GHAS uses a committer-based licensing model where each unique active committer to a GHAS-enabled repository consumes one license, deduplicated across the enterprise.
Example12 · GitHub Advanced Security Fundamentals and Setup
A manufacturing distributor runs its order-management system in a private repository on GitHub Enterprise Cloud. The security team wants to detect hardcoded API keys, find vulnerable coding patterns in their Java source, and surface known vulnerabilities in their third-party dependencies. Which set of GitHub Advanced Security features directly addresses all three of these needs?
✓Secret scanning for the hardcoded API keys, code scanning with CodeQL for the vulnerable coding patterns, and Dependabot alerts for the vulnerable dependencies
Correct. Secret scanning detects hardcoded credentials, code scanning with CodeQL analyzes source for vulnerable patterns, and Dependabot alerts flag vulnerable dependencies.
・Branch protection rules for the hardcoded API keys, required reviews for the vulnerable coding patterns, and the dependency graph for the vulnerable dependencies
Incorrect. Branch protection and required reviews are governance controls that do not scan for secrets or analyze code for vulnerabilities, and the dependency graph alone only inventories dependencies without alerting.
・Push protection for the hardcoded API keys, repository rulesets for the vulnerable coding patterns, and security advisories for the vulnerable dependencies
Incorrect. Push protection blocks secrets only at push time rather than scanning history, rulesets govern merges rather than analyze code, and advisories document issues rather than scan dependencies.
・Audit log streaming for the hardcoded API keys, workflow permissions for the vulnerable coding patterns, and Dependabot version updates for the vulnerable dependencies
Incorrect. Audit log streaming records events, workflow permissions scope tokens, and Dependabot version updates raise upgrade PRs rather than performing the three detection functions described.
Explanation
The three GHAS detection pillars map cleanly to the three stated needs: secret scanning for credentials, code scanning (CodeQL) for code vulnerabilities, and Dependabot alerts for dependency vulnerabilities.
Example13 · GitHub Advanced Security Fundamentals and Setup
The platform team at a manufacturing distributor administers a GitHub Enterprise Cloud organization and wants every current and future private repository to automatically have GitHub Advanced Security features turned on without an administrator visiting each repository. Where should they configure this behavior?
・In each repository's Actions settings, by adding a reusable workflow that enables the features on push
Incorrect. A reusable workflow runs during CI and cannot toggle the organization-level code security and analysis settings that govern GHAS enablement.
✓In the organization's code security and analysis settings, by enabling the features and the option to automatically enable them for new repositories
Correct. The organization's code security and analysis settings let an owner enable GHAS features and automatically enable them for newly created repositories.
・In the enterprise billing portal, by purchasing one GHAS seat per repository that needs the features
Incorrect. GHAS is licensed per active committer, not per repository, and the billing portal does not provide a per-repository auto-enable switch.
・In each team's membership settings, by granting the team the security manager role across the organization
Incorrect. The security manager role grants visibility and management permissions but does not by itself auto-enable GHAS features on new repositories.
Explanation
Organization-level code security and analysis settings include an auto-enable option so new repositories inherit GHAS features without per-repository action.
Example14 · GitHub Advanced Security Fundamentals and Setup
A telecom operator is onboarding its 5G core network repositories to GitHub Advanced Security and wants to confirm which capabilities the GHAS license unlocks. Which set of features is enabled specifically by a GitHub Advanced Security license?
✓Code scanning, secret scanning for partner patterns and push protection, and dependency review on private repositories
Correct. Code scanning, secret scanning (including partner and custom patterns with push protection), and dependency review on private repositories are the core capabilities a GHAS license unlocks.
・Branch protection rules, required reviewers, and merge queue enforcement across all private repositories
Incorrect. Branch protection, required reviewers, and merge queues are standard repository settings available without a GHAS license.
・Audit log streaming, SAML single sign-on, and IP allow lists scoped to the enterprise account
Incorrect. Audit log streaming, SAML SSO, and IP allow lists are enterprise and organization security features, not part of the GHAS feature set.
・GitHub Actions runner groups, environment deployment gates, and reusable workflow sharing controls
Incorrect. Runner groups, deployment gates, and reusable workflows are GitHub Actions governance features unrelated to the GHAS license.
Explanation
GitHub Advanced Security specifically provides code scanning, secret scanning with push protection, and dependency review for private repositories; the other options describe platform or Actions features available separately.
Example15 · GitHub Advanced Security Fundamentals and Setup
The platform team at a telecom operator is budgeting GHAS seats before enabling the feature across its billing-platform organization. How does GitHub determine how many GHAS licenses are consumed?
✓By the number of unique active committers to repositories that have at least one GHAS feature enabled
Correct. A GHAS license is consumed per unique active committer to any repository where a GHAS feature is enabled, deduplicated across the enterprise.
・By the total number of private repositories that have code scanning or secret scanning turned on
Incorrect. Licensing is based on committers, not on the count of repositories that have features enabled.
・By the number of organization members who have write or admin access to any repository
Incorrect. Members with access who do not commit to GHAS-enabled repositories do not consume a license.
・By the number of workflow runs that execute code scanning or secret scanning each billing cycle
Incorrect. Consumption is tied to active committers, not to the volume of scanning workflow runs.
Explanation
GHAS billing counts unique active committers to GHAS-enabled repositories, so the committer who touches those billing-platform repos is the unit that consumes a seat.
▶ Try 10 free questions (graded)
Measure your readiness with a full mock exam
All questions · full explanations · lifetime access
Enroll(33 USD)