Medium GH-500 practice questions
Applied — put a concept to work in a realistic situation. 123 medium questions available — no sign-up, always free.
Your security team wants to automatically dismiss Dependabot alerts for a category of vulnerabilities that leadership has formally accepted as low-risk in your environment. Regulators later require proof that each dismissal was intentional, attributable, and reviewable. Which combination of practices BEST satisfies both the operational goal and the auditability requirement?
A security manager at a fintech company is closing out a large backlog of Code Scanning alerts across 40 repositories. Several hundred alerts share the same CWE and originate from a deprecated internal library that is being fully removed next sprint. Leadership requires that any mass dismissal leave a clear, auditable record explaining the business justification, and that the alerts do NOT silently reappear if the deprecated code is temporarily reintroduced during the migration. Which approach best satisfies both the scale and the governance requirements?
A security lead at a large organization wants to launch a security campaign to drive down the most impactful code scanning alerts across dozens of repositories. Leadership has directed the team to focus first on alerts that are both easiest to attribute to a responsible engineer and most likely to be actively dangerous in production. Which approach best aligns campaign scope with these priorities?
A security manager at a large organization launches a security campaign targeting 340 high-severity SQL injection alerts spread across 60 repositories. She wants to hold each development team accountable by giving them a shared context, a due date, and direct visibility into which alerts they own, so progress can be tracked centrally in Security Overview. Which combination of campaign configuration steps best achieves this goal?
You are configuring the default CodeQL workflow for a repository that receives frequent pull requests to the `main` branch. The security team wants alerts raised as early as possible on incoming changes, but they are also concerned about newly disclosed CodeQL query updates surfacing vulnerabilities in code that hasn't changed in weeks. The repository has a limited GitHub Actions minutes budget, so running a full analysis on every push to every feature branch is undesirable. Which combination of triggers in the CodeQL workflow best satisfies these requirements?
A developer at Contoso commits a Python file that both (1) contains an active AWS access key hardcoded in a variable and (2) constructs a SQL query by concatenating unsanitized user input. The security team wants each issue surfaced by the GitHub Advanced Security capability that is purpose-built to detect it. Which pairing correctly maps each issue to the appropriate capability?
A security engineer is triaging CodeQL code scanning alerts in a repository. One alert flags a SQL injection risk, but after review the engineer confirms the flagged input is fully sanitized by an internal wrapper that CodeQL's model does not recognize, so the alert does not represent a real vulnerability. The engineer wants to dismiss the alert in a way that accurately reflects this determination and helps improve future triage reporting. Which dismissal reason should be selected?
A security engineer fixed a CodeQL SQL-injection alert three months ago; the alert moved to 'Fixed' after the default branch was rescanned. This week a developer reverted part of that refactor in a new commit, reintroducing the vulnerable data-flow pattern on the default branch. Assuming CodeQL analysis runs on pushes to the default branch, what happens to the alert tracking, and what is the recommended remediation practice?
A developer receives a CodeQL code scanning alert for a SQL injection vulnerability on the default branch. They create a feature branch, refactor the code to use parameterized queries, and open a pull request. After the PR's CodeQL analysis completes with no findings on the changed code, the developer wants to confirm the original alert will be properly closed. Which statement correctly describes what happens to the alert as it moves through the remediation workflow?
A security engineer at a fintech company is building a remediation runbook. She needs to document the correct end-to-end handling for two different alert types. For a Dependabot alert flagging a vulnerable transitive dependency (with a fix version available), the runbook must specify the primary remediation action that GitHub can automate. For a CodeQL alert flagging a SQL injection in first-party code, the runbook must specify who owns the fix. Which pairing correctly reflects how each remediation workflow operates?
A large platform team shares a monorepo across three feature squads. A CodeQL scan surfaces a high-severity SQL injection alert in a module that all three squads modify. The security manager wants a single accountable owner to drive remediation while still allowing other engineers to comment, share findings, and track the discussion directly on the alert. Which approach best supports this collaboration model using native GitHub code scanning capabilities?
A security team runs a remediation campaign and wants accurate metrics on how many code scanning alerts were genuinely resolved through code changes versus those that were triaged away without a fix. During the campaign, engineers merge PRs that remove the vulnerable code paths, and reviewers also dismiss several alerts they judge to be false positives. When the security lead reviews the code scanning results after the next default-branch scan, how will these two categories of alerts be distinguished in the alert list?
Your security team has enabled push protection and pre-merge CodeQL analysis on a critical microservice repository. A developer opens a pull request from a feature branch, and CodeQL flags a new SQL injection alert in the PR check. The developer argues the alert should not block the merge because 'the code isn't on the default branch yet, so it's not a real exposure.' As the security lead defining the org's shift-left enforcement strategy, which response best reflects correct preventive security practice?
A developer opens a pull request that introduces a SQL injection vulnerability. CodeQL code scanning flags the alert on the PR and displays a suggested code change generated by CodeQL autofix. The developer wants to apply the fix as efficiently and safely as possible. What is the recommended way to handle the autofix suggestion?
A security engineer is reviewing a CodeQL alert flagged as 'SQL query built from user-controlled sources'. The alert view shows a series of connected steps from an HTTP request parameter through several variable assignments and finally into a database execution call. A developer argues the alert is a false positive because the input is validated. Which aspect of the CodeQL alert should the engineer examine to determine whether the reported vulnerability path is actually exploitable?
A security engineer enabled CodeQL default setup on a repository to get scanning running quickly. Later, the team needs to add a custom CodeQL query pack maintained by their organization and adjust which build steps run before analysis. The engineer opens the repository's code scanning configuration but cannot find a way to specify custom queries or build commands. What is the correct action to enable these customizations?
Your organization runs CodeQL analysis on a self-hosted Jenkins pipeline instead of GitHub Actions because your build toolchain is highly customized. After the CodeQL CLI produces a `results.sarif` file, the team needs those results to appear as code scanning alerts in the repository's Security tab on GitHub.com. Which approach correctly delivers the SARIF results into GitHub code scanning?
A DevOps engineer maintains a monorepo containing services written in Go, JavaScript, and Java. They want to enable CodeQL code scanning via GitHub Actions so that each language is analyzed independently and failures in one language's analysis do not block the others. Which approach best achieves this within a single workflow file?
A security engineer wants their CodeQL code scanning workflow to run additional queries beyond the defaults, including lower-severity and lower-precision rules, to surface more potential issues during an internal audit. They are editing the CodeQL Action step in the workflow. Which configuration should they use to accomplish this?
Your security team ingests SARIF files produced by an external SAST tool into GitHub code scanning using the SARIF upload API. Some large SARIF uploads are being rejected or silently truncated, and developers complain that certain alerts never appear in the Security tab. Which characteristic of GitHub's SARIF ingestion should the team account for to ensure their results are reliably processed?
A platform engineering team runs GitHub Enterprise Server 3.11 on-premises and is planning to enable code scanning with the default CodeQL setup across all repositories in an organization. During planning, a security manager notes that on GitHub Enterprise Cloud the same default setup 'just works' after clicking enable, but on their Server instance the team must complete an additional infrastructure step before default setup will function. Which prerequisite is unique to enabling CodeQL default setup on GitHub Enterprise Server (as opposed to Enterprise Cloud)?
You maintain a large Java monorepo where the default CodeQL analysis workflow runs on GitHub-hosted runners. Recently the 'Perform CodeQL Analysis' step began failing intermittently with the runner terminating during the database build, and the logs show the process was killed after consuming all available memory. The team must keep using GitHub Actions for scanning. What is the most appropriate first step to resolve the failures while preserving analysis quality?
You are a security manager for an organization with 40 repositories. Leadership wants a consistent, enforced policy: any pull request that introduces a new code scanning alert of 'critical' or 'high' security severity must be blocked from merging across all repositories, without requiring each repository admin to configure branch protection individually. You also want the enforcement to apply automatically to newly created repositories. Which approach best satisfies these requirements?
A platform team maintains a large repository with services written in Go, TypeScript, and a legacy COBOL component. They currently use CodeQL for the Go and TypeScript code but need static analysis for COBOL, which CodeQL does not support. Leadership wants all findings consolidated in the repository's Security tab alongside the existing CodeQL alerts. What is the most appropriate approach?
A platform team notices their CodeQL analysis workflow is frequently triggered multiple times in quick succession when developers push several commits to the same feature branch within minutes. This causes a backlog of queued CodeQL jobs, consuming Actions runner minutes and delaying results for the latest commit. The team wants to ensure that when a newer run starts for a branch, any in-progress or queued CodeQL runs for that same branch are automatically cancelled. Which change to the CodeQL workflow best achieves this?