By default, which roles can enable Dependabot alerts?
-
A
-
B
-
C
-
D
repository administrators
Reveal answer details
Close answer details
Correct answerD
ExplanationRepository administrators, organization owners, and users with write or maintain access can enable Dependabot alerts by enabling the dependency graph and Dependabot alerts in their repository's settings. Enabling Dependabot is an action that can be performed at the repository, organization, or enterprise level. Repository Administrators: These users have access to repository settings, allowing them to enable or disable Dependabot alerts for that specific repository. https://docs.github.com/en/code-security/dependabot/dependabot-alerts/configuring-dependabot-alerts
What filter or sort settings can be used to prioritize the secret scanning alerts that present the most risk?
-
A
Sort to display the oldest first.
-
B
Filter to display active secrets.
-
C
Select only the custom patterns.
-
D
Sort to display the newest first.
Reveal answer details
Close answer details
Correct answerB
ExplanationThe best way to prioritize secret scanning alerts is to filter by active secrets --- these are secrets GitHub has confirmed are still valid and could be exploited. This allows security teams to focus on high-risk exposures that require immediate attention.
What kind of repository permissions do you need to request a Common Vulnerabilities and Exposures (CVE) identification number for a security advisory?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerD
ExplanationAnyone with admin permissions to a security advisory can request a CVE identification number.
What does a CodeQL database of your repository contain?
-
A
a build of the code and extracted data
-
B
a build for Go projects to set up the project
-
C
a representation of all of the source code
-
D
build commands for C/C++, C#, and Java
Reveal answer details
Close answer details
Correct answerA
ExplanationCodeQL databases contain queryable data extracted from a codebase, for a single language at a particular point in time. The database contains a full, hierarchical representation of the code, including a representation of the abstract syntax tree, the data flow graph, and the control flow graph. Each language has its own unique database schema that defines the relations used to create a database. The schema provides an interface between the initial lexical analysis during the extraction process, and the actual complex analysis using CodeQL. The schema specifies, for instance, that there is a table for every language construct. For each language, the CodeQL libraries define classes to provide a layer of abstraction over the database tables. This provides an object-oriented view of the data which makes it easier to write queries.
What happens when you enable secret scanning on a private repository?
-
A
Repository administrators can view Dependabot alerts.
-
B
Dependency review, secret scanning, and code scanning are enabled.
-
C
Your team is subscribed to security alerts.
-
D
GitHub performs a read-only analysis on the repository.
Reveal answer details
Close answer details
Correct answerA
ExplanationGitHub secret scanning detects and alerts on sensitive data exposure, such as API keys and credentials, in your code repositories. Use it to protect your secrets, ensure secure and compliant development practices, and reduce the risk of data breaches and unauthorized access. GitHub has scanned public repositories for secrets (like API keys and tokens) for several years. Secret scanning protects our partners and our customers from unauthorized use of the services protected by those secrets. Just this month, 8% of active GitHub repositories committed a secret that was caught by secret scanning. At GitHub Satellite, we announced secret scanning for private repositories, part of GitHub Advanced Security. We're bringing the same lightning-fast scanning engine and broad set of 24 partners (including all the major cloud providers and many common SaaS providers) to your private repository, so you can catch secrets as soon as they're checked in. Repository admins will be notified about any commit that contains a secret, and can quickly view all detected secrets in the repo's Security tab.
Question 6
Multiple choice
Which of the following dependencies could trigger a Dependabot alert? Each answer presents a complete solution. (Choose two.)
-
A
loose dependencies declared in a manifest
-
B
direct dependencies explicitly declared in a manifest
-
C
direct dependencies at 08:00 UTC
-
D
indirect dependencies explicitly declared in a lockfile
Reveal answer details
Close answer details
Correct answersB, D
Explanation[B] A Dependabot direct dependency is a package or library that your project explicitly lists and requires in its manifest file (like package.json or Gemfile). Dependabot specifically focuses on these direct dependencies, creating automated pull requests to update them to newer, more secure, or stable versions, helping to keep your project's dependencies up-to-date and prevent security vulnerabilities. [D] Direct dependencies may have their own dependencies, which are referred to as transitive dependencies or indirect dependencies. Locked Files and Dependencies A locked file in software development is a file that records the exact versions of all dependencies (both direct and transitive) used in a project at a specific point in time. It acts as a snapshot of the dependency graph, ensuring that the project builds consistently with the same versions across different environments. https://docs.github.com/en/code-security/dependabot/dependabot-alerts/about-dependabot-alerts https://www.arnica.io/blog/direct-vs-transitive-dependencies-navigating-package-management-in-software-composition-analysis-sca
Assuming there is no custom Dependabot behavior configured, where possible, what does Dependabot do after sending an alert about a vulnerable dependency in a repository?
-
A
scans repositories for vulnerable dependencies on a schedule and adds those files to a manifest
-
B
scans any push to all branches and generates an alert for each vulnerable repository
-
C
creates a pull request to upgrade the vulnerable dependency to the minimum possible secure version
-
D
constructs a graph of all the repository's dependencies and public dependents for the default branch
Reveal answer details
Close answer details
Correct answerC
ExplanationIn repositories where Dependabot security updates are enabled, when GitHub detects a vulnerable dependency in the default branch, Dependabot creates a pull request to fix it. The pull request will upgrade the dependency to the minimum possible secure version needed to avoid the vulnerability.
Question 8
Multiple choice
Which alerts do you see in the repository's Security tab? Each answer presents part of the solution. (Choose three.)
-
A
-
B
-
C
-
D
-
E
Reveal answer details
Close answer details
Correct answersA, B, C
ExplanationYou can find security alerts from Dependabot, Secret scanning, and Code scanning under your repository's Security tab.
Which role is required to view organization-level security overview dashboards?
-
A
-
B
Security manager or organization owner
-
C
-
D
Reveal answer details
Close answer details
Correct answerB
ExplanationOnly security managers and organization owners can access Security overview dashboards aggregating code scanning, Dependabot, and secret alerts.
Question 10
Multiple choice
Which of the following steps should you follow to integrate CodeQL into a third-party continuous integration system? Each answer presents part of the solution. (Choose three.)
-
A
-
B
-
C
-
D
-
E
Reveal answer details
Close answer details
Correct answersA, B, E
ExplanationUsing code scanning with your existing CI system You can analyze your code with the CodeQL CLI or another tool in a third-party continuous integration system and upload the results to GitHub. The resulting code scanning alerts are shown alongside any alerts generated within GitHub. [A] Setting up your analysis tool You will first need to download your analysis tool of choice and set it up with your CI system. If you are using the CodeQL CLI, you need to make the full contents of the CodeQL CLI bundle available to every CI server that you want to run CodeQL code scanning analysis on. [B ] Analyzing code To analyze code with the CodeQL CLI or another analysis tool, you will want to check out the code you want to analyze and set up the codebase environment, making sure that any dependencies are available. You may also want to find the build command for the codebase, typically available in your CI system's configuration file. You can then complete the steps to analyze your codebase and produce results, which will differ based on the static analysis tool you are using. [E] Uploading your results to GitHub Once you have analyzed your code, produced SARIF results, and ensured you can authenticate with GitHub, you can upload the results to GitHub.
Question 11
Multiple choice
Which of the following options are code scanning application programming interface (API) endpoints? Each answer presents part of the solution. (Choose two.)
-
A
Delete all open code scanning alerts.
-
B
List all open code scanning alerts for the default branch.
-
C
Modify the severity of an open code scanning alert.
-
D
Get a single code scanning alert.
Reveal answer details
Close answer details
Correct answersC, D
ExplanationREST API endpoints for code scanning Use the REST API to retrieve and update code scanning alerts from a repository. [D] Get a code scanning alert Gets a single code scanning alert. OAuth app tokens and personal access tokens (classic) need the security_events scope to use this endpoint with private or public repositories, or the public_repo scope to use this endpoint with only public repositories. Fine-grained access tokens for "Get a code scanning alert" This endpoint works with the following fine-grained token types: GitHub App user access tokens GitHub App installation access tokens Fine-grained personal access tokens [C] Update a code scanning alert Updates the status of a single code scanning alert. OAuth app tokens and personal access tokens (classic) need the security_events scope to use this endpoint with private or public repositories, or the public_repo scope to use this endpoint with only public repositories.
Question 12
Single choice
As a contributor, you discovered a vulnerability in a repository. Where should you look for the instructions on how to report the vulnerability?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerC
ExplanationThe ability to privately report a vulnerability in a repository is not related to the presence of a SECURITY.md file in that repository's root or docs directory. The SECURITY.md file contains the security policy for the repository. Repository administrators can add and use this file to provide public instructions for how to report a security vulnerability in their repository.
Question 13
Multiple choice
Which of the following is required to block the merge of a pull request containing critical vulnerabilities? Each correct answer presents part of the solution. (Choose two.)
-
A
Configure a CODEOWNERS file in the repository.
-
B
Enable Dependabot for the organization.
-
C
Establish the protection rules in the code security settings.
-
D
Add a repository ruleset.
Reveal answer details
Close answer details
Correct answersC, D
ExplanationSet code scanning merge protection You can use rulesets to set code scanning merge protection for pull requests. 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. Note: Creating a merge protection ruleset for a repository 1. On GitHub, navigate to the main page of the repository. 2. Under your repository name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings. 3. In the left sidebar, under "Code and automation," click Rules, then click Rulesets. 4. Click New ruleset. 5. To create a ruleset targeting branches, click New branch ruleset. 6. Under "Ruleset name," type a name for the ruleset. 7. Optionally, to change the default enforcement status, click Disabled and select an enforcement status. 8. Under "Branch protections", select Require code scanning results. 9. Under "Required tools and alert thresholds", click Add tool and select a code scanning tool with the dropdown. For example, "CodeQL". 10. Next to the name of a code scanning tool: Click Alerts and select one of: None, Errors, Errors and Warnings or All. Click Security alerts and select one of: None, Critical, High or higher, Medium or higher, or All. https://docs.github.com/en/code-security/code-scanning/managing-your-code-scanning-configuration/set-code-scanning-merge-protection
Question 14
Single choice
-
A
a feature to identify all your project's dependencies
-
B
a feature that analyzes the code in a GitHub repository to find security vulnerabilities and coding errors
-
C
a feature to privately discuss, fix, and publish information about security vulnerabilities in your repository
-
D
a feature that scans repositories for known types of secrets, to prevent fraudulent use of secrets that were committed accidentally
Reveal answer details
Close answer details
Correct answerB
ExplanationGitHub's Code scanning is a feature that analyzes the code in a GitHub repository to find security vulnerabilities and coding errors, providing alerts in the repository and offering tools to triage, prioritize, and fix issues. It acts as a Static Application Security Testing (SAST) tool, using engines like CodeQL to detect issues like SQL injection and Cross-Site Scripting (XSS), and can be triggered automatically on events like pushes and pull requests. https://docs.github.com/github/finding-security-vulnerabilities-and-errors-in-your-code
Question 15
Multiple choice
You are a maintainer of a repository and Dependabot notifies you of a vulnerability. Where could the vulnerability have been disclosed? Each answer presents part of the solution. (Choose two.)
-
A
in the National Vulnerability Database
-
B
-
C
in security advisories reported on GitHub
-
D
in manifest and lock files
Reveal answer details
Close answer details
Correct answersC, D
ExplanationC: GitHub may send Dependabot alerts to repositories affected by a vulnerability disclosed by a recently published GitHub security advisory. D: The Dependabot security updates feature is available for repositories where you have enabled the dependency graph and Dependabot alerts. You will see a Dependabot alert for every vulnerable dependency identified in your full dependency graph. However, security updates are triggered only for dependencies that are specified in a manifest or lock file.
Question 16
Single choice
You are configuring a CodeQL workflow for compiled languages. What happens if your workflow uses a language matrix?
-
A
Analysis of other languages in your repository will fail unless you supply explicit build commands.
-
B
Autobuild attempts to build the supported language that has the most source files in the repository.
-
C
You may need to install additional software to use the autobuild process.
-
D
Autobuild attempts to build each of the languages listed in the matrix.
Reveal answer details
Close answer details
Correct answerD
ExplanationIf your workflow uses a language matrix, autobuild attempts to build each of the compiled languages listed in the matrix. Without a matrix autobuild attempts to build the supported compiled language that has the most source files in the repository. With the exception of Go, analysis of other compiled languages in your repository will fail unless you supply explicit build commands. Note: CodeQL build modes The CodeQL action supports three different build modes for compiled languages: none - the CodeQL database is created directly from the codebase without building the codebase (supported for all interpreted languages, and additionally supported for C/C++, C# and Java). autobuild - CodeQL detects the most likely build method and uses this to attempt to build the codebase and create a database for analysis (supported for all compiled languages). manual - you define the build steps to use for the codebase in the workflow (supported for all compiled languages, except Rust). https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/ codeql-code-scanning-for-compiled-languages
Question 17
Single choice
Which of the following options would close a Dependabot alert?
-
A
viewing the dependency graph
-
B
leaving the repository in its current state
-
C
creating a pull request to resolve the vulnerability that will be approved and merged
-
D
viewing the Dependabot alert on the Dependabot alerts tab of your repository
Reveal answer details
Close answer details
Correct answerC
ExplanationTo close a Dependabot alert, the primary method is to address the underlying vulnerability. This usually involves merging a pull request that Dependabot creates to update the vulnerable dependency or manually fixing the issue and pushing the updated code. Once the vulnerability is resolved, the alert will be automatically closed. Alternatively, you can manually close alerts in the "Security" tab of your repository. Here's a more detailed breakdown: 1. Addressing the Vulnerability: Merge Dependabot Pull Requests: If Dependabot has identified a vulnerability and created a pull request to fix it, review and merge the pull request. This will automatically update the dependency and close the alert. Manual Fix: If you prefer to fix the vulnerability yourself, make the necessary code changes to update the dependency. Once the changes are pushed and merged, Dependabot will recognize the fix and close the alert. 2. Manually Closing Alerts (if needed)
Question 18
Single choice
Where can you view code scanning results from CodeQL analysis?
-
A
-
B
-
C
-
D
the repository's code scanning alerts
Reveal answer details
Close answer details
Correct answerD
ExplanationYou can use CodeQL to identify vulnerabilities and errors in your code. The results are shown as code scanning alerts in GitHub. Note: Viewing the alerts for a repository You need write permission to view a summary of all the alerts for a repository on the Security tab. By default, the code scanning alerts page is filtered to show alerts for the default branch of the repository only. 1. On GitHub, navigate to the main page of the repository. 2. Under the repository name, click Security. If you cannot see the "Security" tab, select the dropdown menu, and then click Security. 3. In the left sidebar, click Code scanning. 4. Optionally, use the free text search box or the dropdown menus to filter alerts. For example, you can filter by the tool that was used to identify alerts. 5. Etc.
Question 19
Single choice
A repository's dependency graph includes:
-
A
annotated code scanning alerts from your repository's dependencies.
-
B
dependencies from all your repositories.
-
C
a summary of the dependencies used in your organization's repositories.
-
D
dependencies parsed from a repository's manifest and lock files.
Reveal answer details
Close answer details
Correct answerD
ExplanationThe dependency graph includes all the dependencies of a repository that are detailed in the manifest and lock files, or their equivalent, for supported ecosystems, as well as any dependencies that are submitted using the dependency submission API. This includes: Direct dependencies, that are explicitly defined in a manifest or lock file or have been submitted using the dependency submission API. Indirect dependencies of these direct dependencies, also known as transitive dependencies or sub- dependencies.
Question 20
Single choice
You want to create a baseline for dependency review. Which file type does this feature rely on?
-
A
requirements.txt or package-lock.json
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerA
ExplanationDependency Review compares lockfiles (like package-lock.json) between commits to identify new or changed dependencies.
|