GH-500 — GitHub Advanced Security Quick Reference

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

This Quick Reference 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.

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.

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

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

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

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

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]

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

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

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

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.

Browse Certification Practice Tests by Exam Family