GH-500 — GitHub Advanced Security Cheat Sheet

Compact Cheat sheet for GitHub Advanced Security (GH-500): code scanning, CodeQL, secret scanning, Dependabot, dependency review, governance, and exam decision points.

This Cheat Sheet is independent review support for candidates preparing for the GitHub Advanced Security (GH-500) exam from GitHub. Use it to connect exam scenarios to the right GitHub Advanced Security feature, configuration pattern, and troubleshooting path.

Use the tables for a quick pre-exam check. Expand a topic’s notes for explanations, examples, and additional distinctions.

Scope and study context

The exam is likely to test whether you can choose the right GitHub Advanced Security capability for a scenario, configure it correctly, interpret alerts, and avoid unsafe defaults in real repositories and organizations. Focus less on memorizing product slogans and more on decision-making: Which feature solves the problem? Who can configure it? What happens in a pull request? What alert should be triaged first?

Use this Cheat Sheet as a compressed map, then move into IT Mastery practice:

  1. Start with topic drills for code scanning, secret scanning, dependency security, and administration.
  2. For every missed original practice question, identify the decision point you missed.
  3. Read the detailed explanations, especially for similar-sounding features.
  4. Build a short error log with traps such as “used Dependabot alert when dependency review was needed.”
  5. Finish with mixed mock exams so you practice switching contexts quickly.

Practical next step: take a focused GH-500 question bank drill on one weak area, review every explanation, then return to this checklist and confirm you can explain the correct feature choice in your own words.

Core GitHub Advanced Security feature map

AreaPrimary purposeTypical signalBest used forCommon exam trap
Code scanningFind code vulnerabilities and coding errorsCode scanning alerts, PR annotations, SARIF resultsSecure coding issues, data-flow flaws, custom static analysisIt is not dependency/SCA scanning and not runtime detection
CodeQLGitHub’s semantic code analysis engineCodeQL-generated code scanning alertsDeep source analysis, custom queries, variant analysisDefault setup is easier; advanced setup is needed for custom builds/queries
Third-party SARIF uploadBring external static analysis results into GitHubSARIF code scanning alertsCentralizing external tool findings in GitHubSARIF upload needs correct workflow permissions and commit/branch context
Secret scanningDetect secrets committed to repositoriesSecret scanning alertsLeaked tokens, keys, credentialsIt detects known/custom patterns; it does not prove no secret exists
Push protectionBlock supported secrets before they enter the repositoryBlocked push or bypass requestPreventing new secret leaksIt does not clean historical secrets already committed
Dependency graphInventory dependencies from manifests/lockfiles/submissionsDependency inventoryFoundation for Dependabot alerts and dependency reviewIf dependencies are not represented/submitted, alerts may be missing
Dependabot alertsIdentify vulnerable dependenciesSecurity alertKnown vulnerable package versionsAlerting requires dependency visibility and advisory data
Dependabot security updatesOpen PRs to fix vulnerable dependenciesSecurity update PRRemediating Dependabot alertsNot the same as scheduled version updates
Dependabot version updatesKeep dependencies current on a scheduleMaintenance PRReducing lag and future upgrade riskNot vulnerability-driven by itself
Dependency reviewEvaluate dependency changes in PRsPR check/failure/commentBlocking risky new dependencies before mergeIt reviews PR deltas; it is not a full repository scan
Security overviewOrganization/enterprise security posture viewAggregated coverage and alertsGovernance, prioritization, reportingIt summarizes; it does not replace feature-level triage
Repository security advisoriesCoordinate disclosure and fixes for a project vulnerabilityAdvisory draft/published advisoryMaintainer-managed vulnerability disclosureDifferent from Dependabot alerts raised against consumers
SECURITY.mdPublish security policy/contact processSecurity policy fileDirecting reporters and contributorsA policy does not enable scanning by itself
Audit logRecord security-relevant admin/user activityAudit eventsInvestigating changes, bypasses, settingsUse for “who changed/bypassed” questions, not code vulnerability discovery

Fast scenario-to-feature selection

Scenario keywordChooseWhy
“Find SQL injection, XSS, path traversal, unsafe deserialization in source”Code scanning with CodeQLSemantic/code-flow analysis
“Use organization-specific insecure API pattern”Custom CodeQL query or query packEncodes custom rules beyond default queries
“Existing SAST tool already produces results”Upload SARIF to code scanningCentralizes findings in GitHub UI
“Block a personal access token before it is pushed”Secret scanning push protectionPreventive control at push time
“Detect internal token format not known to GitHub”Secret scanning custom patternAdds organization-specific regex detection
“Find vulnerable npm/Maven/Python package version already in repo”Dependency graph + Dependabot alertsMatches dependency inventory to advisories
“Open PR automatically to fix a vulnerable dependency”Dependabot security updatesRemediation PRs for alerts
“Keep GitHub Actions or package versions current weekly/monthly”Dependabot version updatesScheduled maintenance updates
“Fail a PR that introduces a critical dependency vulnerability”Dependency review action / dependency review policyPR-time dependency risk gate
“See which repositories have GHAS features enabled”Security overview / security configurationsGovernance and coverage
“Standardize security settings for new repositories”Organization security configurationsApply consistent feature enablement
“Need who bypassed push protection or disabled scanning”Audit logAdministrative/event investigation
“Project maintainer needs private vulnerability coordination”Repository security advisory + private forkCoordinated disclosure and patch workflow

Enablement, permissions, and governance reference

LevelWhat is commonly managed thereExam-oriented notes
EnterpriseGHAS availability, enterprise-wide policies, audit visibility, security postureEnterprise settings can constrain organization and repository choices. Do not assume a repository admin can override enterprise policy.
OrganizationSecurity configurations, default feature enablement, security managers, custom secret patterns, overview viewsUse organization-level controls for consistency across many repositories.
RepositoryFeature toggles when permitted, workflow files, CodeQL config, Dependabot config, alert triageRepository settings are best for repo-specific tuning, but may be governed from above.
Branch/ruleset controlsRequired checks, review requirements, merge restrictionsUse with CodeQL/dependency review checks to prevent insecure changes from merging.
Security manager roleManage security alerts and settings across an organization without full owner privilegesHigh-yield least-privilege answer when broad security administration is needed.
Repository admin/maintainer/developer rolesConfigure workflows, triage alerts, fix findings depending on permission modelExact visibility/action depends on repository permissions and organization policy.
Notes and examples

Security configurations vs workflow files

NeedBetter fit
Enable GHAS features consistently across many repositoriesOrganization security configuration
Customize CodeQL build commands, query suites, paths, languagesCodeQL workflow/config file
Enforce that new repositories start with selected security settingsDefault security configuration
Standardize scanner behavior for many repositories with similar buildReusable workflow plus organization policy
Tune a single monorepo with special generated-code exclusionsRepository-specific CodeQL config

High-yield workflow: detect, prevent, triage, govern

    flowchart LR
	    A[Repository code and dependencies] --> B[Prevent]
	    B --> B1[Push protection]
	    B --> B2[Dependency review]
	    B --> B3[Required checks/rulesets]
	
	    A --> C[Detect]
	    C --> C1[Code scanning/CodeQL]
	    C --> C2[Secret scanning]
	    C --> C3[Dependabot alerts]
	
	    C1 --> D[Triage alerts]
	    C2 --> D
	    C3 --> D
	
	    D --> E[Fix, dismiss with reason, or document risk]
	    E --> F[Govern]
	    F --> F1[Security overview]
	    F --> F2[Security configurations]
	    F --> F3[Audit log]

Code scanning and CodeQL

Code scanning setup choices

Setup pathUse whenStrengthsWatch for
Default setupRepository has supported languages and standard build needsFast enablement, low maintenance, GitHub-managed workflow behaviorLimited customization; may not fit complex monorepos or special build steps
Advanced setupNeed custom queries, paths, build commands, workflow triggers, matrices, or permissionsFull workflow controlMisconfigured builds lead to incomplete analysis
CodeQL CLIAnalysis occurs outside GitHub Actions or in custom CIPortable, scriptable, useful for advanced pipelinesMust create/analyze databases and upload SARIF correctly
Third-party SARIFExisting scanner is preferred or requiredUnified alerts in GitHub code scanningSARIF quality and mapping affect alert usefulness
Variant analysisNeed to search for variants of a known issue pattern across codebasesPowerful for security research and organization-wide patternsNot a replacement for continuous scanning
Notes and examples

Code scanning event selection

TriggerUse forNotes
pull_requestPreventing new issues before mergeHigh-value for PR annotations and required checks
push to default/protected branchesUpdating baseline alerts after mergeCommon baseline scan trigger
scheduleRe-scan without code changes, pick up query improvementsUseful even when code is stable
workflow_dispatchManual/ad hoc scansGood for troubleshooting and one-off validation
External CI + SARIF uploadNon-GitHub Actions pipelinesRequires correct commit SHA/ref and upload permissions

Minimal advanced CodeQL workflow pattern

Use advanced setup when you need workflow control. Keep permissions least-privilege and add build steps only when required by the language/build system.

name: CodeQL

on:
  pull_request:
  push:
    branches: [main]
  schedule:
    - cron: "30 2 * * 1"

jobs:
  analyze:
    name: Analyze
    runs-on: ubuntu-latest

    permissions:
      actions: read
      contents: read
      security-events: write

    strategy:
      fail-fast: false
      matrix:
        language: [javascript-typescript]

    steps:
      - uses: actions/checkout@v4

      - uses: github/codeql-action/init@v3
        with:
          languages: ${{ matrix.language }}
          queries: +security-extended,security-and-quality

      # Add manual build steps here when autobuild is insufficient.

      - uses: github/codeql-action/analyze@v3

CodeQL build decision table

Repository/build characteristicPreferWhy
JavaScript/TypeScript, Python, Ruby with normal layoutDefault setup or advanced setup with no custom buildMany interpreted ecosystems do not need a compile step for useful analysis
Compiled language with standard projectDefault setup or autobuildLower maintenance if GitHub can infer build
Compiled language with custom build, private dependencies, generated sources, monorepoAdvanced setup with manual build commandsEnsures CodeQL observes the correct compilation/database
Multiple languagesMatrix or multiple language entriesKeeps analysis organized and avoids missing languages
Multiple independent projects in one repoPath filters, custom build, or separate jobs/categoriesAvoids scanning noise and result overwrites
External scannerSARIF uploadCode scanning UI can ingest compatible results

CodeQL configuration file reference

A CodeQL config file is useful when you want reusable path/query configuration separate from the workflow.

name: codeql-config

queries:
  - uses: security-extended
  - uses: security-and-quality

paths:
  - src

paths-ignore:
  - test
  - docs
  - "**/*.generated.*"
Configuration itemUse forTrap
queriesAdd standard suites or custom packsMore queries can mean more findings and longer analysis
pathsLimit analysis to relevant sourceOverly narrow paths can hide vulnerable code
paths-ignoreExclude generated/test/vendor codeDo not exclude code that ships to production
Manual build stepsMake database accurate for compiled languagesA successful workflow can still produce poor results if the wrong build ran
Matrix languagesAnalyze multiple languages cleanlyA language not listed may not be analyzed in advanced setup
security-events: writeUpload code scanning resultsMissing permission is a common SARIF/analyze failure

CodeQL query and pack distinctions

TermMeaningExam use
QueryA CodeQL rule that finds a patternAdd custom detection for a vulnerability class
Query suiteA curated set of queriesSelect security-extended or security-and-quality based on signal goals
Query pack / QL packPackaged queries and dependenciesShare custom queries across repositories
CodeQL databaseExtracted representation of code for analysisCreated during CodeQL analysis or with CodeQL CLI
ModelingTeaching CodeQL about frameworks/librariesImproves data-flow results for custom APIs
Variant analysisRunning a query to find related issue variantsUseful after discovering a specific bug pattern

CodeQL CLI pattern

Use the CLI when analysis is performed outside GitHub Actions or when building custom automation.

codeql database create codeql-db \
  --language=javascript-typescript \
  --source-root=.

codeql database analyze codeql-db \
  --format=sarif-latest \
  --output=codeql-results.sarif \
  codeql/javascript-queries

Then upload the SARIF through a GitHub Actions workflow or API-supported process with appropriate permissions.

SARIF upload reference

- uses: github/codeql-action/upload-sarif@v3
  with:
    sarif_file: results.sarif
    category: third-party-sast
SARIF issueLikely causeFix
Upload deniedMissing security-events: write or policy restrictionSet workflow permissions or adjust policy
Alerts attached to wrong branch/commitSARIF uploaded from wrong ref/SHAUpload in workflow context matching analyzed commit
Results overwrite each otherSame tool/category for multiple analysesUse distinct categories for different tools/languages
Alerts lack useful locationsPoor SARIF mappingEnsure results include file paths, regions, rule IDs
PR annotations missingScan not triggered on PR or paths not changed/mappedAdd PR trigger and confirm SARIF locations map to diff

Code scanning triage

ActionUse whenNotes
FixAlert represents a real issuePreferred for exploitable or reachable code
Dismiss as false positiveTool finding is incorrectInclude rationale; avoid hiding similar real issues
Dismiss as used in testsIntentional vulnerable pattern in test-only codeBetter long-term fix may be excluding test paths or using safe fixtures
Dismiss as won’t fix / accepted riskBusiness decision accepts riskShould be documented and reviewable
ReopenDismissed issue becomes relevant or reintroducedAlerts may reappear when code changes or analysis improves

What code scanning does

Code scanning helps identify vulnerabilities and coding errors in a repository. With GitHub Advanced Security, the most commonly tested engine is CodeQL, but code scanning can also ingest compatible third-party static analysis results through SARIF upload.

Think of code scanning as answering:

  • Does this code contain a known insecure pattern?
  • Did this pull request introduce a new alert?
  • Is a vulnerability still present on the default branch?
  • Should an alert be fixed, dismissed, or investigated further?

CodeQL analysis flow

StepWhat happensExam-relevant point
InitializeCodeQL prepares analysis for selected languagesLanguage detection and configuration matter
Build or extractCodeQL creates a database representation of the codeCompiled languages may need accurate build information
AnalyzeQueries run against the CodeQL databaseQuery suite choice affects alert coverage
Upload resultsResults appear as code scanning alertsSARIF category and branch context can affect display
TriageDevelopers fix, dismiss, or investigate alertsDismissal should be justified, not used as cleanup

Default setup

Default setup is appropriate when the repository fits GitHub’s supported automatic configuration model. It is valuable for broad rollout because it reduces workflow maintenance.

High-yield points:

  • It is designed for fast enablement.
  • It uses GitHub-managed configuration choices.
  • It may not be enough for custom build requirements.
  • It is usually not the right answer when the scenario demands custom queries, custom schedules, special build commands, or complex language handling.

Advanced setup

Advanced setup uses a GitHub Actions workflow for CodeQL. Choose it when you need control.

Common reasons to use advanced setup:

  1. Custom build commands.
  2. Custom query suites.
  3. Custom CodeQL packs or organization-authored queries.
  4. Specific workflow triggers.
  5. Matrix builds for multiple languages.
  6. Integration with a more complex CI process.

CodeQL query suites

Query suite ideaWhat to remember
Default security coverageBaseline security analysis suitable for many repositories
Extended security coverageBroader security detection, often more alerts
Security and quality coverageIncludes quality-oriented findings in addition to security-oriented findings
Custom queriesUseful for organization-specific rules, frameworks, or internal secure-coding requirements

Exam trap: More queries is not always better. Broader query suites can increase coverage but may also increase triage effort. In a scenario about reducing noise, do not blindly select the broadest suite.

CodeQL custom queries

You do not need to become a full CodeQL developer for a quick review, but you should understand the concepts.

ConceptMeaning
DatabaseCodeQL’s structured representation of the source code
QueryLogic that searches the database for patterns
SourceWhere untrusted or sensitive data originates
SinkDangerous operation where that data may cause harm
SanitizerValidation or transformation that makes data safer
Path problemAlert type that can show a flow path from source to sink
Query packPackaged CodeQL queries that can be reused and versioned

Common exam pattern: a scenario describes tainted user input reaching a dangerous API. The right mental model is source → flow steps → sanitizer check → sink.

SARIF upload

SARIF upload allows compatible third-party static analysis results to appear in GitHub code scanning.

Use SARIF when:

  • The organization already uses another scanner.
  • The language or framework is better covered by a specialized tool.
  • Results should be centralized in GitHub code scanning.
  • A CI workflow generates analysis results outside CodeQL.

Common traps:

  • SARIF upload does not mean the tool is CodeQL.
  • Multiple tools or categories should be distinguished clearly so alerts do not overwrite or confuse each other.
  • Uploading results is not the same as fixing alerts.

Code scanning alert lifecycle

Status or actionMeaningGood candidate behavior
OpenAlert is currently detectedPrioritize by severity, exploitability, and affected code
FixedThe issue is no longer detectedConfirm the fix is merged into the relevant branch
DismissedThe alert is intentionally closed without code changeUse only with a valid reason and documentation
ReopenedThe issue appears again or was not truly resolvedInvestigate regression or incomplete remediation

Decision rule: Fix when the finding is valid and reachable. Dismiss only when you can justify why the alert is not actionable.

Secret scanning and push protection

Secret scanning decision table

NeedUseWhy
Detect known provider tokens already committedSecret scanning alertsScans repository content for supported secret patterns
Prevent supported secrets from being pushedPush protectionBlocks at push time before secret lands
Detect internal credential formatCustom secret scanning patternAdds organization/repository-specific regex
Reduce false positives before rolloutTest/dry-run custom pattern where availableValidates pattern against real repositories
Investigate whether a bypass occurredAudit log and alert metadataTracks user/admin security-relevant actions
Remove exposed credential riskRevoke/rotate secret, then remediate code/history as neededDeleting code alone may not invalidate the secret
Notes and examples

Secret scanning vs push protection

CapabilitySecret scanningPush protection
Detects historical committed secretsYesNo
Blocks new pushes containing supported secretsNoYes
Creates alerts for triageYesYes, when bypassed or detected depending on flow
Supports custom patternsYesMay apply depending on configuration and support
Requires developer action before push succeedsNoYes
Best control typeDetectivePreventive

Push protection response choices

Developer sees blocked pushBest responseExam reasoning
Real secret accidentally committedRemove secret from commit and rotate/revoke itSecret may already be exposed locally or in attempted workflow
False positive test valueReplace with clearly fake value that does not match real patternAvoid repeated bypasses
Business-critical urgent pushBypass only if policy allows and reason is validBypass creates governance/audit concern
Secret needed by appStore in GitHub Actions secrets, environment secrets, or external secret managerDo not hard-code secrets in source

Custom secret pattern checklist

  • Define the secret format precisely enough to avoid broad matches.
  • Add surrounding context when possible, such as a prefix, key name, or delimiter.
  • Test against representative repositories before broad enablement.
  • Publish/apply at the narrowest level that meets the need.
  • Monitor false positives and tune the pattern.
  • Pair detection with an incident response process: revoke, rotate, remove, document.

Secret alert triage

Status/actionUse whenImportant distinction
OpenNeeds investigation or remediationDo not leave real credentials open after rotation
Resolved as revoked/rotatedCredential is invalidatedPreferred for real secrets
Resolved as false positiveMatch is not actually a secretTune custom pattern if repeated
Resolved as used in testsNon-production test credential is intentionalSafer to use fake values that cannot authenticate
Accepted risk / will not fixOrganization explicitly accepts exposure riskShould be rare and documented
ReopenCredential is still valid or reintroducedReassess scope and rotation

Secret scanning basics

Secret scanning detects credentials such as tokens, keys, and other secrets in repository content. It may detect provider-specific patterns and, where configured, custom patterns created by the organization.

Secret scanning helps answer:

  • Has a secret already been committed?
  • Which repository, commit, file, or surface exposed it?
  • Is the detected secret likely active or valid?
  • Who needs to rotate or revoke it?
  • Should a custom pattern be added for internal secrets?

Push protection

Push protection acts earlier than ordinary alerting. It can block a push or commit flow when a supported secret is detected before the secret lands in the repository.

FeatureMain purposeTiming
Secret scanning alertsDetect exposed secrets already presentAfter detection in repository content
Push protectionPrevent supported secrets from being pushedBefore or during push
Custom patternsDetect organization-specific secret formatsDepends on configuration and rollout
Bypass review or auditManage exceptionsAfter a user attempts to bypass

Common exam trap: Push protection is preventive; secret scanning alerts are detective. They complement each other.

Secret scanning response process

StepWhat to doWhy it matters
Validate contextCheck where the secret appeared and what it can accessNot all secrets have equal blast radius
Revoke or rotateDisable the exposed credential and issue a replacement if neededRemoving code history alone is not enough
Remove exposureDelete or rewrite the secret from code, config, or docs as appropriatePrevents repeated exposure
Investigate useReview logs or provider activityDetects possible compromise
Close alert with reasonDocument the outcomeMaintains auditability

Critical trap: Deleting the secret from the repository does not automatically make the secret safe. Rotation or revocation is usually the key security action.

Custom secret patterns

Custom patterns are useful when your organization has internal token formats that GitHub’s built-in partner patterns may not recognize.

Design pointGood practiceTrap
Regex specificityMatch the actual token structureOverly broad regex creates noisy alerts
Context requirementsUse surrounding text or format rules where helpfulMatching random strings as secrets
Dry run or test modeEvaluate alert volume before broad rolloutEnabling noisy patterns everywhere immediately
OwnershipDefine who triages alertsCreating alerts with no response process
ExclusionsKeep narrow and documentedExcluding large paths to hide noise

Alert triage priorities

Use severity, exploitability, reachability, and business context together. The highest numeric severity is important, but exam scenarios may include additional context that changes priority.

FactorWhy it matters
SeverityIndicates potential technical impact
ExposurePublic-facing code or internal-only code changes priority
ReachabilityVulnerable code that is actually invoked is more urgent
Secret validityActive credentials require immediate action
Asset criticalityProduction authentication service matters more than a demo repo
Fix availabilityAvailable patches or clear code fixes accelerate remediation
Age and recurrenceLong-lived or repeated alerts suggest process issues

Quick rule: Active leaked secret in a production system is usually urgent even if a static severity label is not present.

Dependency security and supply chain

Dependency feature relationships

    flowchart LR
	    A[Manifest, lockfile, or submitted dependencies] --> B[Dependency graph]
	    B --> C[Dependabot alerts]
	    C --> D[Dependabot security updates]
	    B --> E[Dependency review on PRs]
	    F[dependabot.yml schedule] --> G[Dependabot version updates]
Notes and examples

Dependency feature decision matrix

FeatureDetects/doesTriggerOutputUse when
Dependency graphIdentifies dependenciesRepository files or dependency submissionDependency inventoryYou need visibility into what packages are used
Dependency submission APIAdds build-resolved dependencies not visible in manifestsCI/build submissionEnriched dependency graphEcosystem/build system is not fully represented by checked-in files
Dependabot alertsMatches dependencies to advisoriesDependency graph + advisory dataSecurity alertYou need vulnerability awareness
Dependabot security updatesOpens PRs to remediate vulnerable dependenciesDependabot alert with available fix pathSecurity PRYou want automated vulnerability remediation
Dependabot version updatesOpens PRs for newer versions on a scheduledependabot.yml scheduleMaintenance PRYou want regular dependency freshness
Dependency reviewReviews dependency changes in PRsPull requestPR check/comment/failureYou want to block newly introduced vulnerable dependencies

Dependabot alerts vs updates

ItemDependabot alertsDependabot security updatesDependabot version updates
Primary goalNotify about vulnerable dependencyFix vulnerabilityKeep dependency current
Vulnerability-drivenYesYesNo
Opens PRNoYesYes
Requires dependabot.ymlNot always for alertingNot always for security updates, but config may tune behaviorYes
Best exam phrase“Identify vulnerable dependency”“Automatically create remediation PR”“Scheduled update PRs”

Dependabot configuration pattern

version: 2
updates:
  - package-ecosystem: "npm"
    directory: "/"
    schedule:
      interval: "weekly"

  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "weekly"
Config choiceUse forTrap
package-ecosystemSelect npm, Maven, pip, GitHub Actions, etc.Wrong ecosystem means no updates
directoryLocation of manifestMonorepos often need multiple entries
scheduleCadence for version update checksVersion updates are maintenance, not vulnerability alerting
GroupsCombine related updatesOver-grouping can make PRs harder to review
Private registry configAllow Dependabot to access private packagesDependabot secrets are separate from GitHub Actions secrets
Ignore rulesSuppress specific versions/dependenciesCan hide needed security fixes if too broad

Dependency review action pattern

name: Dependency Review

on:
  pull_request:

permissions:
  contents: read
  pull-requests: read

jobs:
  dependency-review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/dependency-review-action@v4
        with:
          fail-on-severity: high
Dependency review questionAnswer
“When does it run?”On pull requests
“What does it evaluate?”Dependency changes introduced by the PR
“How can it block merges?”Fail the PR check and require the check through rulesets/branch protection
“What does it depend on?”Dependency graph and recognizable dependency manifests/lockfiles
“Is it the same as Dependabot alerts?”No. Alerts report known vulnerabilities; review gates PR changes

Dependency triage

FindingBest first actionNotes
Vulnerable direct dependency with patch availableAccept Dependabot security update PR or manually upgradeDirect upgrades are usually straightforward
Vulnerable transitive dependencyUpgrade parent dependency or override if ecosystem supports itUnderstand dependency chain before dismissing
No fixed version availableMitigate usage, monitor advisory, document riskDo not invent a fix
Package unused in runtimeRemove dependency or dismiss with clear rationale“Not used” should be verified
Private package not detectedUse dependency submission or registry configurationVisibility problem, not necessarily no risk

Dependency graph

The dependency graph identifies dependencies declared in supported manifest and lock files. It is foundational because other features use dependency information.

Think of the dependency graph as an inventory layer:

  • What packages does the repository depend on?
  • Which versions are declared or resolved?
  • Which ecosystems are involved?
  • Are manifests and lock files accurate?

Trap: The dependency graph itself is not the same as a fix. It provides dependency visibility.

Dependabot alerts

Dependabot alerts identify dependencies with known vulnerabilities based on advisory data and version ranges.

ConceptMeaning
Affected packagePackage with a known vulnerability
Affected rangeVulnerable version range
Patched versionVersion that addresses the vulnerability, if available
SeverityRisk indicator, often based on vulnerability scoring and context
Manifest locationWhere the dependency is declared

Common exam decision: If a repository already contains a vulnerable dependency, think Dependabot alert. If a pull request introduces a vulnerable dependency, think dependency review.

Dependabot security updates

Dependabot security updates can open pull requests to update vulnerable dependencies when an upgrade path is available.

Remember:

  • Security updates are remediation-oriented.
  • They are not the same as version updates for routine freshness.
  • They may not work automatically if the ecosystem, version constraints, private registry authentication, or compatibility issues prevent a clean update.
  • Generated pull requests still need review and testing.

Dependency review

Dependency review evaluates dependency changes in pull requests. It can help prevent new vulnerable or disallowed dependencies before merge.

ScenarioBest answer
PR adds a package with a known critical vulnerabilityDependency review
Existing default branch has vulnerable package versionsDependabot alerts
Need automated PR to upgrade a vulnerable dependencyDependabot security updates
Need inventory of repository dependenciesDependency graph
Need organization-wide visibility into vulnerable reposSecurity overview

Common trap: Dependency review is PR-centered. It is not primarily a historical scanner for all existing dependency debt.

GitHub Actions security for GHAS workflows

SituationSecure patternTrap
CodeQL or SARIF uploadGrant security-events: write only where neededOverly broad workflow permissions
Analyze private dependenciesUse least-privilege credentials/secretsHard-coding tokens to make build work
PRs from forksBe careful with secrets and privileged triggerspull_request_target can be dangerous with untrusted code
Dependabot PR runs workflowUse Dependabot-aware permissions/secretsDependabot does not automatically get normal Actions secrets
Required security gatesRequire CodeQL/dependency review status checksA scanner that only reports after merge is not a preventive gate
Reusable workflowsStandardize GHAS scanning across reposStill need repo-specific language/build tuning

Repository security and disclosure

CapabilityUse whenKey distinction
SECURITY.mdYou want to tell users how to report vulnerabilitiesDocumentation/policy only
Private vulnerability reportingYou want external reporters to privately report issuesIntake mechanism
Repository security advisoryMaintainer coordinates fix and disclosureAdvisory workflow for the affected project
Temporary private forkPatch collaboration without public exposureUsed during advisory remediation
CVE request/publishing supportPublic vulnerability disclosure needs standardized identifierDo not confuse with scanner-generated alerts
Dependabot alertYour repository consumes a vulnerable dependencyConsumer-side notification

Security overview, campaigns, and prioritization

View/controlUse forPractical exam angle
Security overviewSee alert counts, feature coverage, risk across repositoriesBest answer for organization/enterprise posture questions
Security coverageIdentify repos missing code scanning, secret scanning, Dependabot, etc.Helps roll out GHAS consistently
Repository risk viewsPrioritize repositories with more severe/open alertsSupports remediation planning
Security configurationsApply standard security settingsGovernance at scale
Security campaigns / remediation tracking where availableCoordinate fixing selected alert groupsUseful for focused remediation, not initial detection
Audit logInvestigate settings changes, bypasses, admin actionsGovernance and accountability
Notes and examples

Prioritization reference

Highest priorityWhy
Exposed valid production secretImmediate credential compromise risk; rotate/revoke first
Critical reachable dependency vulnerability with exploit pathKnown vulnerable component in use
Code scanning alert in internet-facing/auth-sensitive pathApplication exploit risk
PR introducing new high/critical vulnerable dependencyPrevent before merge
Repeated push protection bypassesIndicates training or policy enforcement gap
Repositories with no security coverageBlind spot; enable baseline controls

Alert lifecycle quick reference

StepCode scanningSecret scanningDependabot
DetectCodeQL/third-party SARIF scanPattern match in repository or pushAdvisory match against dependency graph
NotifyAlert, PR annotation, checkAlert/block/bypass eventAlert and optional PR
TriageConfirm exploitability/reachabilityDetermine whether credential is real/validDetermine affected package path and fix availability
RemediateCode fix, safe API, validation, sanitizationRevoke/rotate, remove secret, purge if neededUpgrade, remove, override, or mitigate
CloseFixed by scan result or dismissedResolved with reasonFixed, dismissed, or no longer detected
GovernRequired checks, security overviewPush protection, audit logDependency review, rulesets, security overview

Common GH-500 traps

TrapCorrect exam reasoning
“Enable secret scanning to block secrets from being pushed.”Secret scanning detects; push protection blocks supported secrets at push time.
“Dependabot version updates fix vulnerabilities.”They update versions on a schedule. Security updates are vulnerability-driven.
“Dependency review scans the whole repository.”It evaluates dependency changes in a pull request.
“Code scanning finds vulnerable open-source packages.”That is dependency security. Code scanning analyzes source code.
“Default CodeQL setup is always best.”Use advanced setup for custom builds, queries, paths, triggers, or monorepos.
“Autobuild success means perfect analysis.”The build may be incomplete or not representative. Manual build may be needed.
“Dismissed alerts are gone forever.”They can reappear if code changes, analysis changes, or issue is reintroduced.
“Deleting a leaked secret from code fixes the incident.”Rotate/revoke the credential; assume exposure.
“Actions secrets are available to Dependabot.”Dependabot uses its own secret handling; configure accordingly.
“Security overview remediates issues.”It provides posture and prioritization; fixes happen in repos/workflows/dependencies.
“SARIF upload just needs a file.”It also needs correct permissions, commit/ref context, and useful locations/rules.
“A SECURITY.md enables vulnerability scanning.”It documents reporting policy only.

Quick troubleshooting table

SymptomLikely causeCheck/fix
CodeQL workflow passes but no alerts/resultsLanguage not detected, wrong paths, no analyzable code, upload issueConfirm language matrix, config paths, Security tab, workflow logs
CodeQL fails during buildMissing dependencies, wrong build command, private registry credentialsAdd setup steps, credentials, or manual build
SARIF upload failsMissing permission or invalid SARIFAdd security-events: write; validate SARIF
PR has no code scanning annotationScan not running on PR or finding not in changed linesAdd PR trigger; verify branch/ruleset behavior
Secret push not blockedPush protection not enabled or pattern not coveredEnable push protection and/or custom pattern
Too many custom secret false positivesRegex too broadAdd prefix/context and test pattern
Dependabot opens no PRNo supported manifest, no update path, config directory wrong, access issueCheck dependency graph, dependabot.yml, private registry config
Dependency review does not fail PRAction not installed, severity threshold too low, check not requiredConfigure action and require status check
Security overview shows missing coverageFeatures not enabled or policies not appliedApply security configuration or repo setting
Developers bypass push protection oftenTraining/policy issue or false-positive patternReview audit events and tune controls

Final exam-day selection guide

If the scenario asks for…Answer with…
“Prevent new leaked secrets”Secret scanning push protection
“Find existing leaked secrets”Secret scanning
“Custom internal credential detection”Custom secret scanning pattern
“Find source code vulnerabilities”Code scanning with CodeQL
“Use custom static analysis results in GitHub”SARIF upload
“Analyze complex compiled monorepo”Advanced CodeQL setup with manual build
“Add organization-specific vulnerability pattern”Custom CodeQL query/query pack
“Find vulnerable dependencies”Dependency graph + Dependabot alerts
“Automatically create dependency fix PR”Dependabot security updates
“Keep dependencies current”Dependabot version updates
“Block PRs adding risky dependencies”Dependency review with required check
“Standardize GHAS enablement across repos”Security configurations
“View posture across organization/enterprise”Security overview
“Investigate setting changes or bypasses”Audit log
“Document how to report vulnerabilities”SECURITY.md
“Coordinate disclosure for a project vulnerability”Repository security advisory
Notes and examples

Next step: practice applying these distinctions to GH-500 scenario questions, especially cases that mix CodeQL setup, secret scanning prevention, Dependabot remediation, and organization-level governance.

High-yield capability map

NeedGitHub capability to think of firstWhat it helps detect or controlCommon exam trap
Find vulnerable code patternsCode scanning with CodeQL or SARIF uploadSecurity and quality issues in source codeConfusing CodeQL analysis with dependency vulnerability detection
Customize static analysisAdvanced CodeQL setup, query suites, custom queries, CodeQL packsLanguage-specific analysis, custom policies, organization standardsAssuming default setup supports every custom build or query requirement
Block exposed credentials before they landSecret scanning push protectionSupported secrets detected during push or web commit flowsThinking secret scanning and push protection are the same thing
Find committed secrets already presentSecret scanning alertsTokens, keys, credentials, custom patternsTreating a resolved alert as proof the secret was rotated
Review vulnerable dependenciesDependabot alerts and dependency graphKnown vulnerable package versionsConfusing dependency graph inventory with remediation
Automatically propose dependency fixesDependabot security updatesPull requests for vulnerable dependencies when possibleAssuming every alert can be automatically fixed
Stop risky dependencies in PRsDependency reviewNewly introduced vulnerable or disallowed dependenciesUsing it for historical repository-wide remediation
Centralize security visibilitySecurity overview and organization or enterprise viewsAlert posture across repositoriesLooking only at one repository when the scenario says organization-wide
Harden CI/CDGitHub Actions permissions, reusable workflows, trusted actions, OIDC, environmentsWorkflow supply-chain and secret exposure riskUsing pull_request_target carelessly with untrusted code

Core decision rules

Pick the feature by timing

Timing of the problemBest feature familyExample scenario
Before code is mergedCode scanning PR checks, dependency review, branch protection or rulesets, push protectionA pull request introduces SQL injection or a vulnerable package
During development workflowGitHub Actions security controls, CodeQL workflow, Dependabot PRsCI should run CodeQL and fail if severe issues appear
After code already existsCode scanning alerts, secret scanning alerts, Dependabot alerts, security overviewA repository has accumulated unresolved alerts
Across many repositoriesOrganization or enterprise security settings, security configurations, security overviewStandardize scanning for all production repos
Notes and examples

Pick default setup or advanced setup

SituationPrefer default setupPrefer advanced setup
Standard repository with supported languagesYesMaybe not needed
Need custom CodeQL query suites or packsNoYes
Need custom build stepsNoYes
Need custom workflow triggersNoYes
Need matrix strategy or multi-language tuningLimitedYes
Need quick baseline enablement across repositoriesYesSometimes, after standardization

The exam commonly tests whether you know that default setup is fast and opinionated, while advanced setup gives control through a GitHub Actions workflow.

Administration, permissions, and rollout

Repository, organization, and enterprise thinking

GH-500 scenarios often describe the scope of the problem. Match the solution to that scope.

Scope in scenarioWhat to consider
Single repositoryRepository security settings, workflow configuration, branch protection, alert triage
Team-owned set of repositoriesOrganization security settings, security manager access, standard workflows
Many repositoriesSecurity configurations, organization policies, security overview, rollout strategy
Enterprise-wide governanceEnterprise-level policies, visibility, standardized enablement approach
Notes and examples

Security manager role and least privilege

Security work often requires alert visibility and configuration access without full administrative ownership of every repository. GitHub supports delegated security administration patterns, such as security-focused roles at the organization level.

Exam principle: Grant the minimum access needed to manage security alerts and settings. Do not make everyone an organization owner just to view or triage alerts.

Security overview

Security overview helps security teams monitor posture across repositories and organizations.

Use it to answer questions like:

  • Which repositories have code scanning disabled?
  • Which repositories have unresolved critical alerts?
  • Which teams own the riskiest repositories?
  • Are security features consistently enabled?
  • Where should remediation work be prioritized?

Trap: If the scenario asks for broad visibility, a repository-level alert page is too narrow.

Standardizing enablement

For large environments, manual per-repository setup is error-prone. Look for centralized approaches when the scenario mentions scale, consistency, governance, or onboarding many repositories.

Good rollout sequence:

  1. Identify repository scope and ownership.
  2. Decide required security features.
  3. Apply standard settings or configurations.
  4. Validate that alerts are flowing.
  5. Assign triage owners.
  6. Monitor adoption and exceptions.
  7. Improve based on false positives and remediation time.

GitHub Actions security concepts

GitHub Advanced Security questions may connect scanning with CI/CD. Know the security implications of workflow design.

Workflow permission basics

ControlWhy it matters
Least-privilege GITHUB_TOKEN permissionsReduces damage if a workflow is compromised
Explicit permissions at workflow or job levelAvoids overly broad defaults
Environment protection rulesAdds control for sensitive deployments
Secrets scoped to repositories, environments, or organizationsLimits who and what can access secrets
OIDC federationCan reduce long-lived cloud credentials in GitHub secrets
Pinning actionsReduces risk from unexpected third-party action changes
Notes and examples

Pull request event traps

Event patternRisk
Running untrusted fork code with write credentialsCan expose secrets or modify repository state
Using pull_request_target without careRuns in the target repository context and can be dangerous with untrusted code
Checking out attacker-controlled code in privileged workflowsMay allow workflow compromise
Broad token permissions in PR workflowsIncreases blast radius

Exam rule: If untrusted code is involved, be cautious with secrets, write tokens, privileged events, and checkout behavior.

Common GH-500 candidate mistakes

MistakeCorrect thinking
Treating all GitHub security features as interchangeableIdentify whether the issue is code, secret, dependency, workflow, or governance
Choosing advanced setup for every CodeQL scenarioDefault setup is often correct for fast standard enablement
Choosing default setup when custom builds or custom queries are requiredAdvanced setup is needed for control
Assuming a Dependabot alert automatically means a PR existsSecurity updates may need to be enabled and may not always generate a clean fix
Using dependency review for historical vulnerable dependenciesUse Dependabot alerts for existing dependency vulnerabilities
Ignoring lock filesResolved versions often matter for accurate dependency analysis
Dismissing code scanning alerts to reduce noiseDismiss only with defensible rationale
Removing a committed secret but not rotating itRotation or revocation is the security-critical action
Giving broad admin access to security staffPrefer delegated security roles and least privilege
Overlooking organization-wide visibilityUse security overview for cross-repository posture
Allowing powerful workflow tokens in untrusted PRsRestrict permissions and avoid privileged execution of untrusted code
Forgetting SARIF uploadThird-party analysis can be centralized in code scanning

Scenario shortcuts

If the scenario says “custom build”

Think: advanced CodeQL setup.

Why: CodeQL may need the project to be built in a specific way to analyze accurately.

If the scenario says “custom internal token format”

Think: secret scanning custom pattern.

Why: Built-in patterns may not know the organization’s private credential format.

If the scenario says “block secrets before commit or push”

Think: push protection.

Why: The goal is prevention before the secret is introduced.

If the scenario says “PR adds vulnerable library”

Think: dependency review.

Why: The problem is introduced in a pull request.

If the scenario says “repository already has vulnerable library”

Think: Dependabot alerts and possibly Dependabot security updates.

Why: The vulnerability already exists in the dependency inventory.

If the scenario says “single view across repositories”

Think: security overview.

Why: Repository-by-repository review does not scale.

If the scenario says “third-party static analysis results”

Think: SARIF upload to code scanning.

Why: SARIF is the interoperability format for code scanning results.

Rapid final checklist

Before your next GH-500 practice session, confirm you can answer these without notes:

  • When should you choose CodeQL default setup instead of advanced setup?
  • What CodeQL scenario requires custom workflow configuration?
  • What is the difference between code scanning, secret scanning, and dependency scanning?
  • What is the difference between secret scanning alerts and push protection?
  • Why is secret rotation more important than simply deleting a committed key?
  • When should you use custom secret patterns?
  • What is the dependency graph used for?
  • How do Dependabot alerts differ from Dependabot security updates?
  • How does dependency review protect pull requests?
  • When is SARIF upload the right answer?
  • What does security overview provide that a repository alert page does not?
  • Why is pull_request_target risky with untrusted code?
  • How should GITHUB_TOKEN permissions be configured?
  • What is the principle behind delegated security administration?
  • When is dismissing an alert appropriate?

Put the review into practice