GitHub Advanced Security GH-500 Exam Dumps & Practice Test
GitHub Advanced Security Questions 16–20 (page: 5)

Updated On: 16-Nov-2026

What step is required to run a SARIF-compatible (Static Analysis Results Interchange Format) tool on GitHub Actions?

  1. The CodeQL action uploads the SARIF file automatically when it completes analysis.
  2. Use the CLI to upload results to GitHub.
  3. Update the workflow to include a final step that uploads the results.
  4. By default, the CodeQL runner automatically uploads results to GitHub on completion.

Answer(s): C

Explanation:

About SARIF file uploads for code scanning
GitHub creates code scanning alerts in a repository using information from Static Analysis Results Interchange Format (SARIF) files. SARIF files can be uploaded to a repository using the API or GitHub Actions.
You can upload the results using GitHub Actions, the code scanning API, or the CodeQL CLI. The best upload method will depend on how you generate the SARIF file, for example, if you use:
* GitHub Actions to run the CodeQL action, there is no further action required. The CodeQL action uploads the SARIF file automatically when it completes analysis.
* -> GitHub Actions to run a SARIF-compatible analysis tool, you could update the workflow to include a final step that uploads the results.
Uploading a code scanning analysis with GitHub Actions
To use GitHub Actions to upload a third-party SARIF file to a repository, you'll need a workflow.
Your workflow will need to use the upload-sarif action, which is part of the github/codeql-action repository. It has input parameters that you can use to configure the upload.
* The CodeQL CLI to run code scanning in your CI system, you can use the CLI to upload results to GitHub


Reference:

https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-t o-github



What YAML syntax do you use to exclude certain files from secret scanning?

  1. paths-ignore:
  2. secret_scanning.yml
  3. branches-ignore:
  4. decrypt_secret.sh

Answer(s): A

Explanation:

Excluding folders and files from secret scanning
You can customize secret scanning to automatically close alerts for secrets found in specific directories or files by configuring a secret_scanning.yml file in your repository.
Under Edit new file, type paths-ignore: followed by the paths you want to exclude from secret scanning. This tells secret scanning to automatically close alerts for everything in the docs directory.


Reference:

https://docs.github.com/en/code-security/secret-scanning/using-advanced-secret-scanning-and-push-protectio n-features/excluding-folders-and-files-from-secret-scanning



HOTSPOT (Drag and Drop is not supported)
You have a GitHub Enterprise Cloud repository named Repo1 that uses GitHub Advanced Security code scanning with CodeQL advanced setup. Repo1 stores JavaScript and Python source code and a workflow named Workflow1. Workflow1 uses matrix.language to analyze each programming language in parallel.
You perform the following actions:
-Define additional query packs for each language by using a custom CodeQL configuration file.
-In Workflow1A, ad security-and-quality and packs: scope/pack1 queries directly to github/codeql-action/init@v4.
You discover that the additional query packs from the custom configuration file no longer run.
You need to ensure that CodeQL runs the security-and-quality query suite and the additional query packs defined in the configuration file for both languages.
How should you configure github/codeql-action/init@v4? To answer, select the appropriate options in the answer area.
Note: Each correct selection is worth one point.
Hot Area:

  1. See Explanation section for answer.

Answer(s): A

Explanation:



Box 1: queries: security-and-quality
To combine workflow queries with configuration-file queries, set the query input to:
To run the security-and-quality suite along with both the workflow packs and the custom configuration-file packs for both matrix languages, modify your github/codeql-action/init@v4 block as follows:
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
queries: security-and-quality config-file: .github/codeql/codeql-config.yml # Path to your custom config file packs: +scope/pack1
Box 2: packs: +scope/pack1
To combine workflow packs with configuration-file packs set the pack input to:
To combine query packs specified in the GitHub Actions workflow with those defined in a custom configuration file, you must prefix the pack name in your workflow with a plus sign (+).Setting packs: +scope/pack1 tells CodeQL to append this pack to any additional packs already defined inside the custom configuration file instead of overriding them.


Reference:

https://docs.github.com/enterprise-server@3.21/code-security/reference/code-scanning/workflow-configuration -options



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

  1. Add the extended suite.
  2. Configure code scanning.
  3. Set up a security policy.
  4. Configure code owners.

Answer(s): 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.


Reference:

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



Secret scanning will scan:

  1. a continuous integration system.
  2. the GitHub repository.
  3. any Git repository.
  4. external services.

Answer(s): B

Explanation:

Secret scanning automatically scans your repository's contents for sensitive data, such as API keys, passwords, tokens, and other secrets. It looks for patterns and heuristics that match known types of secrets.
Secret scanning is available for the following repository types:
Public repositories on GitHub.com
Organization-owned repositories on GitHub Team with GitHub Secret Protection enabled


Reference:

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



Viewing page 5 of 27
Viewing questions 16 - 20 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!