# Free GH-500 practice questions

> 10 free GH-500 practice questions with the correct answer and an explanation.

Page: https://devopscodelab.com/exams/github-gh-500/free-practice-questions/
Practice exams: https://devopscodelab.com/exams/github-gh-500/

### Question 1 of 10

A maintainer of a public open source repository on GitHub.com asks which security features they can use without buying any GitHub security product. Which answer is correct?

- A. Code scanning is free for public repositories, but secret scanning only works after the owner joins the secret scanning partner program
- B. Secret scanning with push protection, CodeQL code scanning and Dependabot alerts are all available at no cost for public repositories
- C. Only Dependabot alerts are free, because secret scanning and code scanning require GitHub Secret Protection and GitHub Code Security licenses
- D. Secret scanning is free for public repositories, but CodeQL analysis requires an enterprise account with a Code Security license

**Answer:** B

**Explanation:** GitHub provides secret scanning, push protection, code scanning with CodeQL, dependency review and Dependabot features for public repositories at no charge. The licensing requirements apply to private and internal repositories owned by organizations. The partner program is for token issuers that want to receive leaked credentials, not something a repository owner joins, and CodeQL on public repositories does not need an enterprise license.

### Question 2 of 10

A developer reports that the repository's Security tab shows code scanning alerts, but the same developer cannot see any secret scanning alerts even though the security team says several exist. The developer has the Write role. What is the MOST likely reason?

- A. Secret scanning alerts are hidden until a validity check has confirmed that the detected secret is still active
- B. Writers see only alerts for their own commits; the full list is for admins, security managers and granted users
- C. Secret scanning alerts appear only in the organization-level security overview and never in the repository Security tab
- D. Secret scanning alerts are shown only after the commit author acknowledges the email notification about the alert

**Answer:** B

**Explanation:** Because exposed credentials are sensitive, writers and maintainers can directly view secret scanning alerts only for their own commits, while the full alert list is limited to repository admins, organization owners, security managers and users or teams granted access. Validity checks add status information but do not gate visibility. Alerts do appear in the repository Security tab, and visibility does not depend on acknowledging an email.

### Question 3 of 10

A developer is blocked by push protection for a test credential that is intentionally fake and stored in a test fixture. The repository does not use delegated bypass. What should the developer do to complete the push in the documented way?

- A. Push the commit to a fork first and open a pull request, because push protection does not evaluate pull requests from forks
- B. Follow the URL in the push error, choose the reason that the secret is used in tests, and push again within the allowed window
- C. Ask a repository admin to disable secret scanning temporarily, push the commit, and then turn secret scanning back on
- D. Amend the commit to rename the file with a .test extension so that push protection ignores files used by test frameworks

**Answer:** B

**Explanation:** When delegated bypass is not configured, a contributor can bypass a block by visiting the link in the error message, selecting a reason such as used in tests, and pushing again. File extensions do not exempt content from push protection. Disabling secret scanning is a heavy-handed change that removes protection for everyone, and a fork-based route does not avoid the scan of the content being pushed.

### Question 4 of 10

A developer accidentally pushed an AWS access key to a private repository, and a secret scanning alert was created. What should be done FIRST?

- A. Rewrite the Git history to remove the key, then dismiss the alert as false positive
- B. Create a custom pattern for AWS keys so that future pushes of the key are blocked
- C. Make the repository internal so fewer users can see it, then wait for the next scan
- D. Revoke or rotate the key with the provider, then resolve the alert as revoked

**Answer:** D

**Explanation:** The priority is invalidating the credential, because anyone who saw or cloned the repository may have it; then resolve the alert as revoked. Rewriting history does not invalidate a copied key, and calling it a false positive is inaccurate. Changing visibility does not remove the exposure, and AWS keys are already covered by provider patterns.

### Question 5 of 10

A Gradle project resolves many dependencies only at build time, so the dependency graph is missing most of them and Dependabot alerts are incomplete. Which approach fixes this with the LEAST custom code?

- A. Configure a Dependabot version update for Gradle with a daily schedule so missing dependencies are discovered
- B. Enable automatic dependency submission so an Actions run resolves and submits the full dependency tree
- C. Add each transitive dependency manually to the manifest so the dependency graph can parse it statically
- D. Commit a generated SBOM in SPDX format to the repository root so the dependency graph imports it on push

**Answer:** B

**Explanation:** Automatic dependency submission runs a build step on Actions to resolve the full dependency tree and submit it through the dependency submission API, filling in build-time dependencies. Committing an SBOM file is not how the graph is populated. Adding all transitive dependencies by hand is error prone, and version updates do not add missing data to the graph.

### Question 6 of 10

A repository receives a separate Dependabot version update pull request for each of 15 ESLint-related packages every week. The team wants one pull request for all of them but still wants separate pull requests for other npm packages. What should they configure in dependabot.yml?

- A. An open-pull-requests-limit of 1 so that Dependabot combines the ESLint updates into one pull request
- B. An ignore entry for all eslint packages so that they are only updated through security updates
- C. A versioning-strategy of lockfile-only so that the ESLint updates are written into a single lock file change
- D. A groups entry under the npm update with patterns matching eslint and eslint-* packages

**Answer:** D

**Explanation:** The groups option lets Dependabot bundle dependencies matching name patterns into a single pull request while other dependencies still get their own. Ignoring the packages would stop routine version updates for them. The pull request limit only caps how many pull requests are open and does not merge updates, and versioning-strategy controls how manifests are updated rather than grouping.

### Question 7 of 10

A security team wants CodeQL to run additional lower-precision security queries beyond the default set on a critical repository, while still excluding code quality queries. Which query suite should they choose?

- A. default
- B. security-and-quality
- C. security-extended
- D. default with local sources

**Answer:** C

**Explanation:** The security-extended suite adds security queries with slightly lower precision or severity on top of the default suite. security-and-quality adds maintainability and reliability queries as well, which the team wants to exclude. The default suite contains only the high-precision set, and adding local sources changes the threat model, not which queries run.

### Question 8 of 10

A maintainer receives a private report of a vulnerability in their open source package. They want to collaborate on a fix privately, obtain a CVE, and notify users when the fix ships. Which GitHub workflow supports this?

- A. Draft a repository security advisory, fix it in a temporary private fork, request a CVE, then publish the advisory
- B. Create a security campaign for the repository, assign the reporter as campaign manager, and publish the campaign
- C. Open a public issue labeled security, fix it on a feature branch, and ask Dependabot to create the CVE automatically
- D. Add the vulnerable versions to dependabot.yml ignore rules and publish a release note describing the problem

**Answer:** A

**Explanation:** Repository security advisories let maintainers discuss and fix a vulnerability privately in a temporary private fork, request a CVE ID from GitHub as a CNA, and publish the advisory, which can then trigger Dependabot alerts for dependents. A public issue discloses the vulnerability early and Dependabot does not issue CVEs. Security campaigns address existing alerts, and dependabot.yml ignore rules do not notify consumers.

### Question 9 of 10

An enterprise wants a layered governance model: block risky file types at push time, block merges with high-severity CodeQL alerts, and require a central dependency review workflow. Which combination of features delivers this with central control?

- A. Push rulesets for file types, plus organization branch rulesets requiring code scanning results and the workflow
- B. Repository branch protection rules for file restrictions, plus custom secret patterns for code scanning and licenses
- C. Security campaigns for file restrictions, plus Dependabot auto-triage rules for code scanning and dependency review
- D. Custom repository roles for file restrictions, plus security configurations that require pull request reviews

**Answer:** A

**Explanation:** Push rulesets can restrict file paths, extensions and sizes, and organization branch rulesets can require code scanning results and specific workflows, all managed centrally. Campaigns and auto-triage rules do not block pushes or merges. Branch protection is per repository and secret patterns do not evaluate code or licenses, and custom roles and security configurations do not enforce these checks.

### Question 10 of 10

A platform team needs to attach a specific code security configuration to 600 repositories selected by a custom property and verify the result in a script. Which approach is MOST suitable?

- A. Use the GraphQL API to edit each repository's .github/dependabot.yml file so the configuration is applied on the next push
- B. Create a branch ruleset targeting the custom property, because rulesets automatically turn on the matching security features
- C. Clone each repository and push a commit adding a codeql.yml workflow, then list workflow runs to confirm enablement
- D. Call the code security configurations REST API to attach it to the repositories, then read back each repository's configuration

**Answer:** D

**Explanation:** Code security configurations have REST API endpoints to create, attach to repositories and read which configuration a repository uses, which suits scripted rollout. Editing dependabot.yml only controls Dependabot version updates. Pushing workflow files is high effort and covers only advanced code scanning, and rulesets enforce branch rules rather than enabling security features.

Ready for a timed run? Take the free 15-question GH-500 mini exam: https://devopscodelab.com/app/exams/github-gh-500/mini/

DevOpsCode Lab is not affiliated with GitHub. GH-500 and related names are trademarks of their owners. We write every question ourselves; these are not real exam questions.
