Skip to main content

GH-500 Real Exam Questions

GitHub Advanced Security

133 questions available · Page 1 of 14

Updated Exam DumpsVerified AnswersPass Guarantee

Get Complete Exam Dumps
Question 1 Single choice

What role is required to change a repository's code scanning severity threshold that fails a pull request status check?

  1. A

    Maintain

  2. B

    Write

  3. C

    Admin

  4. D

    Triage

Show answer and explanation

Correct answer: B

Explanation

You can override the default behavior in your repository settings, by specifying the level of severities and security severities that will cause a pull request check failure.

Customizing your advanced setup for code scanning
You can customize how your advanced setup scans the code in your project for vulnerabilities and errors.

Who can use this feature?
Users with write access if advanced setup is already enabled

Example:
Defining the alert severities that cause a check failure for a pull request You can use rulesets to prevent pull requests from being merged when one of the following conditions is met:

A required tool found a code scanning alert of a severity that is defined in a ruleset.

A required code scanning tool's analysis is still in progress.

A required code scanning tool is not configured for the repository.

Question 2 Single choice

Which event triggers CodeQL analysis by default?

  1. A

    workflow_dispatch

  2. B

    push and pull_request

  3. C

    repository_dispatch

  4. D

    schedule only

Show answer and explanation

Correct answer: B

Explanation

By default, CodeQL scans on push and pull_request events to identify vulnerabilities introduced in commits or PRs.

Question 3 Single choice

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

  1. A

    codeql-scan.yml

  2. B

    codeql.yml

  3. C

    codeql-workflow.yml

  4. D

    codeql-config.yml

Show answer and explanation

Correct answer: B

Explanation

If you already enabled CodeQL with the default settings, select the menu labeled "...", then select Switch to advanced. Select Disable CodeQL when prompted. Don't worry, we will re-enable it after we've completed the advanced setup process.

After selecting or switching to advanced, you'll be taken to a GitHub Actions workflow file named codeql.yml. You can find it in your Web Goat repository's /.github/workflows directory. This is the file we use to run and configure CodeQL.

Question 4 Single choice

You notice that a CodeQL alert keeps reappearing after dismissal.

What is the likely reason?

  1. A

    The code has changed and reintroduced the vulnerability

  2. B

    The SARIF file is corrupted

  3. C

    The alert history expired

  4. D

    The GitHub token lacks permissions

Show answer and explanation

Correct answer: A

Explanation

Dismissed alerts can resurface if the same vulnerability is reintroduced in later commits.

Question 5 Single choice

What is the minimum role needed in order to view the secret scanning alerts list within the Security tab of a repository?

  1. A

    Read

  2. B

    Write

  3. C

    repository owner

  4. D

    Admin

Show answer and explanation

Correct answer: C

Explanation

Viewing and filtering alerts from secret scanning

Who can use this feature?
Repository owners, organization owners, security managers, and users with the admin role

Note: About the secret scanning alerts page When you enable secret scanning for a repository or push commits to a repository with secret scanning enabled, GitHub scans the contents for secrets that match patterns defined by service providers.

When secret scanning detects a secret, GitHub generates an alert. GitHub displays an alert in the Security tab of the repository.

https://docs.github.com/en/code-security/secret-scanning/managing-alerts-from-secret-
alerts

Question 6 Single choice

When secret scanning detects a set of credentials on a public repository, what does GitHub do?

  1. A

    It sends a notification to repository members.

  2. B

    It displays a public alert in the Security tab of the repository.

  3. C

    It notifies the service provider who issued the secret.

  4. D

    It scans the contents of the commits for additional secrets.

Show answer and explanation

Correct answer: B

Explanation

When a supported secret is leaked, GitHub generates a secret scanning alert. Alerts are reported on the Security tab of repositories on GitHub, where you can view, evaluate, and resolve them.

Question 7 Single choice

What is the best method to ensure all new code is scanned for vulnerabilities?

  1. A

    Add the extended suite.

  2. B

    Configure code scanning.

  3. C

    Set up a security policy.

  4. D

    Configure code owners.

Show answer and explanation

Correct answer: B

Explanation

Configuring automated code scanning integrated into a CI/CD pipeline is the best method to ensure new code is scanned for vulnerabilities because it identifies weaknesses early in the development lifecycle, preventing them from reaching production. This approach provides continuous, hands-off scanning as code is committed or merged, offering immediate feedback to developers and reducing the cost of fixing issues.

https://docs.github.com/en/code-security/code-scanning/introduction-to-code-scanning/about-code-scanning

Question 8 Single choice

Assuming that default security and analysis settings have not been changed at the repository, organization, or enterprise level, which scenario would generate a dependency graph for the repository?

  1. A

    when a public repository has a new dependency added to its manifest file

  2. B

    when a private repository is forked to be used as a dependent

  3. C

    when a private repository has a new dependency added to its manifest file

  4. D

    when a public repository is forked to be used as a dependent

Show answer and explanation

Correct answer: C

Explanation

A dependency graph for a private repository on platforms like GitHub is generated or updated when a new dependency is added to its manifest file and this change is pushed to the repository's default branch, How it Works:
1. Manifest File Update: You add a new dependency to a manifest file (e.g., package.json for npm).

2. Push to Default Branch: You then push the changes to your repository's default branch.

3. Automated Parsing: The platform automatically scans the manifest and lock files in the repository.

4. Graph Generation: It uses this information to construct the dependency graph, which shows direct and transitive dependencies, their versions, and any known vulnerabilities.

https://docs.github.com/code-security/supply-chain-security/understanding-your-software-supply-chain/
about-the-dependency-graph

Question 9 Single choice

Where can you find a deleted line of code that contained a secret value?

  1. A

    Issues

  2. B

    Dependency graph

  3. C

    Commits

  4. D

    Insights

Show answer and explanation

Correct answer: B

Explanation

Deleted lines of code containing secrets in a GitHub repository can still be accessed through the dependency graph and other tools, even after deletion. The dependency graph analyzes package manifest files to identify dependencies, including those in deleted or private repositories. Anyone with access to the dependency graph can potentially view the list of dependencies and their transitive dependencies, potentially exposing leaked secrets if they were previously part of the codebase.

Question 10 Single choice

You are configuring code scanning with CodeQL.

What is one impact of using a language matrix in your workflow?

  1. A

    CodeQL is configured to run analysis sequentially.

  2. B

    CodeQL will only analyze the languages in the matrix.

  3. C

    CodeQL excludes alerts for those dependencies specified in the language matrix.

  4. D

    You can use the languages parameter under the init action.

Show answer and explanation

Correct answer: B

Explanation

If your workflow uses the language matrix, then CodeQL will only analyze the languages in the matrix.

Note:
The default CodeQL analysis workflow file created after configuring advanced setup for code scanning with CodeQL defines a matrix containing a property named language which lists the languages in your repository that will be analyzed. This matrix has been automatically pre-populated with supported languages detected in your repository. Using the language matrix allows CodeQL to run each language analysis in parallel and to customize analysis for each language. In an individual analysis, the name of the language from the matrix is provided to the init action as the argument for the languages input. We recommend that all workflows adopt this configuration.

Incorrect:
[Not A]
Using the language matrix allows CodeQL to run each language analysis in parallel.

https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/
customizing-your-advanced-setup-for-code-scanning