Free GH-500 Exam Braindumps
GitHub Advanced Security Questions 25–32 (page: 5)

Updated On: 9-Apr-2026

­ [Use Code Scanning with CodeQL]

When using the advanced CodeQL code scanning setup, what is the name of the workflow file?

  1. codeql-config.yml
  2. codeql-scan.yml
  3. codeql-workflow.yml
  4. codeql-analysis.yml

Answer(s): D

Explanation:

Comprehensive and Detailed Explanation;
In the advanced setup for CodeQL code scanning, GitHub generates a workflow file named codeql- analysis.yml. This file is located in the .github/workflows directory of your repository. It defines the configuration for the CodeQL analysis, including the languages to analyze, the events that trigger the analysis, and the steps to perform during the workflow.


Reference:

GitHub Docs ­ Customizing your advanced setup for code scanning



­ [Configure and Use Secret Scanning]

Which of the following statements best describes secret scanning push protection?

  1. Commits that contain secrets are blocked before code is added to the repository.
  2. Secret scanning alerts must be closed before a branch can be merged into the repository.
  3. Buttons for sensitive actions in the GitHub UI are disabled.
  4. Users need to reply to a 2FA challenge before any push events.

Answer(s): A

Explanation:

Comprehensive and Detailed Explanation;
Secret scanning push protection is a proactive feature that scans for secrets in your code during the push process. If a secret is detected, the push is blocked, preventing the secret from being added to the repository. This helps prevent accidental exposure of sensitive information.

GitHub Docs


Reference:

GitHub Docs ­ About push protection



­ [Configure and Use Dependency Management]

In a private repository, what minimum requirements does GitHub need to generate a dependency graph? (Each answer presents part of the solution. Choose two.)

  1. Read-only access to all the repository's files
  2. Dependency graph enabled at the organization level for all new private repositories
  3. Write access to the dependency manifest and lock files for an enterprise
  4. Read-only access to the dependency manifest and lock files for a repository

Answer(s): B,D

Explanation:

Comprehensive and Detailed Explanation;
To generate a dependency graph for a private repository, GitHub requires:

Dependency graph enabled: The repository must have the dependency graph feature enabled. This can be configured at the organization level to apply to all new private repositories.

Access to manifest and lock files: GitHub needs read-only access to the repository's dependency manifest and lock files (e.g., package.json, requirements.txt) to identify and map dependencies.


Reference:

GitHub Docs ­ About the dependency graph



­ [Use Code Scanning with CodeQL]

What does a CodeQL database of your repository contain?

  1. A build for Go projects to set up the project
  2. A build of the code and extracted data
  3. Build commands for C/C++, C#, and Java
  4. A representation of all of the source code
    GitHub
    Agentic AI for AppSec Teams

Answer(s): B

Explanation:

Comprehensive and Detailed Explanation;
A CodeQL database contains a representation of your codebase, including the build of the code and extracted data. This database is used to run CodeQL queries to analyze your code for potential vulnerabilities and errors.

GitHub Docs


Reference:

GitHub Docs ­ Preparing your code for CodeQL analysis



­ [Use Code Scanning with CodeQL]

When using CodeQL, how does extraction for compiled languages work?

  1. By generating one language at a time
  2. By resolving dependencies to give an accurate representation of the codebase
  3. By monitoring the normal build process
  4. By running directly on the source code

Answer(s): C

Explanation:

For compiled languages, CodeQL performs extraction by monitoring the normal build process. This means it watches your usual build commands (like make, javac, or dotnet build) and extracts the relevant data from the actual build steps being executed. CodeQL uses this information to construct a semantic database of the application.

This approach ensures that CodeQL captures a precise, real-world representation of the code and its behavior as it is compiled, including platform-specific configurations or conditional logic used during build.


Reference:

GitHub Docs ­ CodeQL for compiled languages



­ [Configure and Use Secret Scanning]

Which of the following features helps to prioritize secret scanning alerts that present an immediate risk?

  1. Non-provider patterns
  2. Push protection
  3. Custom pattern dry runs
  4. Secret validation

Answer(s): D

Explanation:

Secret validation checks whether a secret found in your repository is still valid and active with the issuing provider (e.g., AWS, GitHub, Stripe). If a secret is confirmed to be active, the alert is marked as verified, which means it's considered a high-priority issue because it presents an immediate security risk.

This helps teams respond faster to valid, exploitable secrets rather than wasting time on expired or fake tokens.


Reference:

GitHub Docs ­ Secret validation in secret scanning



­ [Configure and Use Secret Scanning]

What is a prerequisite to define a custom pattern for a repository?

  1. Change the repository visibility to Internal
  2. Close other secret scanning alerts
  3. Specify additional match criteria
  4. Enable secret scanning

Answer(s): D

Explanation:

You must enable secret scanning before defining custom patterns. Secret scanning provides the foundational capability for detecting exposed credentials, and custom patterns build upon that by allowing organizations to specify their own regex-based patterns for secrets unique to their environment.

Without enabling secret scanning, GitHub will not process or apply custom patterns.


Reference:

GitHub Docs ­ Custom patterns in secret scanning



­ [Use Code Scanning with CodeQL]

Where can you use CodeQL analysis for code scanning? (Each answer presents part of the solution.
Choose two.)

  1. In a third-party Git repository
  2. In a workflow
  3. In an external continuous integration (CI) system
  4. In the Files changed tab of the pull request

Answer(s): B,C

Explanation:

In a workflow: GitHub Actions workflows are the most common place for CodeQL code scanning. The codeql-analysis.yml defines how the analysis runs and when it triggers.

In an external CI system: GitHub allows you to run CodeQL analysis outside of GitHub Actions. Once complete, the results can be uploaded using the upload-sarif action to make alerts visible in the repository.

You cannot run or trigger analysis from third-party repositories directly, and the Files changed tab in pull requests only shows diff -- not analysis results.


Reference:

GitHub Docs ­ Using CodeQL with CI and workflows



Viewing page 5 of 11
Viewing questions 33 - 40 out of 127 questions


Post your Comments and Discuss Microsoft GH-500 exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!