Updated October 2026
GitHub Advanced Security isn't one product anymore. Since April 2025, GitHub has sold it as two: GitHub Secret Protection and GitHub Code Security, and teams on GitHub Team can now buy them too. Between them, they cover your code, your secrets, and your dependencies.
What they don't test is the running application: the login flow, the access checks between users, the headers your server actually sends. This guide covers what each product includes, what it costs, how to turn it on, and how it compares with Snyk and SonarQube. Then it shows how to add runtime testing so those gaps close before a pull request merges.
Security Vulnerabilities: Understanding the Risks
Security vulnerabilities are weaknesses in your code that attackers can exploit.
Examples include:
- SQL Injection: When an attacker injects malicious code into your app to access or manipulate your database.
- Cross-Site Scripting (XSS): Attackers inject malicious scripts into your web pages to steal user data or hijack user sessions. Attackers can then impersonate your users and act on their behalf.
- Cross-Site Request Forgery (CSRF): Tricking users into doing unwanted actions on your website, like changing their password or making a purchase, by exploiting the trust your website has in a user's browser.
- Remote Code Execution (RCE): Vulnerabilities that allow attackers to execute code remotely on your system. This can happen because of system misconfigurations or unsafe handling of untrusted data, especially XML sources.
GHAS checks code, secrets, and dependencies for potential security issues.
What Is GitHub Advanced Security?
GitHub Advanced Security (GHAS) is GitHub's set of paid application security products, sold since April 2025 as GitHub Code Security and GitHub Secret Protection. Code Security finds and fixes vulnerabilities in code and dependencies with CodeQL, Copilot Autofix, and dependency review. Secret Protection detects leaked credentials and blocks new ones with secret scanning and push protection.
GHAS combines static analysis, software composition analysis, and secret scanning where you already push code. Those checks work on the repository's contents, leaving the running application's behavior for another layer of testing.
Check repository visibility and plan eligibility. Secret scanning runs automatically on public repositories, and code scanning is free on them once you turn on CodeQL default setup, so you only pay to run these on private or internal repos. And you need GitHub Team or Enterprise to buy either product.
GitHub Code Security
Code Security includes the following checks and remediation tools:
- Code scanning: finds potential security issues and coding errors using CodeQL or a third-party tool.
- CodeQL CLI: runs CodeQL locally or in another CI system and uploads results to GitHub.
- Copilot Autofix: generates suggested fixes for code scanning alerts.
- AI Scan: an AI-based scanning engine that runs during pull request review and covers languages and frameworks CodeQL doesn't.
- Security campaigns: group existing alerts so developers can burn down security debt together.
- Dependabot auto-triage rules and dependency review: decide which dependency alerts to ignore, snooze, or fix, and see the vulnerable versions a pull request would add before you merge it.
- Security overview: risk across the whole organization.
GitHub Secret Protection
Secret Protection covers the other half:
- Secret scanning: alerts on keys and tokens already checked into a repository.
- Push protection: blocks commits that contain secrets before they land.
- AI-detected secrets: finds unstructured credentials, such as passwords, that pattern matching misses.
- Custom patterns: detection for your organization's own secret formats.
- Delegated bypass and delegated alert dismissal: an approval step for who can push past a block or close an alert.
- Security campaigns and security overview, the same as in Code Security, applied to secrets.
GitHub Advanced Security Pricing
GHAS pricing is per product, per active committer, per month. These are the list prices on GitHub's Advanced Security page as of October 2026, which haven't changed since the April 2025 launch:
| Product | What you get | Price | Plans that can buy it |
|---|---|---|---|
| GitHub Secret Protection | Secret scanning, push protection, AI-detected secrets, custom patterns, delegated bypass | $19 per active committer/month | GitHub Team, GitHub Enterprise |
| GitHub Code Security | Code scanning (CodeQL and third-party), Copilot Autofix, AI Scan, security campaigns, dependency review, Dependabot auto-triage rules | $30 per active committer/month | GitHub Team, GitHub Enterprise |
| Included without either product | Code scanning and secret scanning on public repos; dependency graph and Dependabot alerts on every plan | $0 | All plans |
Buying both comes to $49 per active committer per month, so a team with 25 active committers would pay $1,225 a month at list price. Team plan customers buy from their organization settings and are billed on a pay-as-you-go, metered basis. Confirm current GitHub list prices before budgeting.
How to Enable and Use GitHub Advanced Security
Rolling out GitHub Advanced Security features takes four steps.
1. Buy and enable the products you need:
- Buy GitHub Secret Protection, GitHub Code Security, or both on a GitHub Team or GitHub Enterprise plan.
- Enable them at the organization level with a security configuration, which applies the same settings across many repositories at once, or per repository under Settings > Security and quality > Advanced Security.
- Not sure it's worth it yet? Organizations on Team and Enterprise can run a free risk assessment that scans up to 20 of your most active repositories and estimates how many findings Copilot Autofix could fix.
2. Configure the features you need:
- Code scanning: Default setup picks the languages, query suite, and triggering events for you. Advanced setup gives you a workflow file to customize.
- Secret scanning: Turn on secret scanning alerts and push protection so leaked credentials get flagged and new ones get blocked.
- Dependency review and Dependabot: Dependency review shows the vulnerable versions a pull request would introduce. Dependabot security updates open the pull requests that bump a vulnerable dependency to the minimum patched version.
3. Integrate with your workflow:
- GitHub Actions: CodeQL analysis runs in GitHub Actions workflows, and the dependency review action can fail a pull request check when it finds a vulnerable package.
- GitHub Apps: Extend GHAS with security-focused GitHub Apps for things like vulnerability management or security reporting.
4. Monitor and respond to alerts: Review alerts by severity, fix from the details in each alert, and use security overview to see where risk is piling up across the organization.
Code Scanning, CodeQL and Copilot Autofix
Code scanning is the core of GitHub Code Security, and CodeQL is the engine behind it. CodeQL builds a database that represents your codebase, then runs queries against that database to find problems like SQL injection and cross-site scripting. Here's how that flows:
- Analyze: CodeQL builds a database of your code, and many of its security queries use data flow analysis to trace how untrusted input moves through the application.
- Identify: It runs CodeQL query suites against that database to find known vulnerability patterns.
- Alert: When a potential vulnerability turns up, you get an alert with the issue, its location, and its severity.
- Remediate: Copilot Autofix proposes a fix for the alert that you can review and commit.
The alert view brings the vulnerable line, severity, and affected branches together. In this CodeQL example from GitHub’s documentation, Copilot Autofix can propose a change for review.
CodeQL covers C/C++, C#, Go, Java/Kotlin, JavaScript/TypeScript, Python, Ruby, Rust, Swift, and GitHub Actions workflows. For code outside that list, AI Scan runs during pull request review.
Code scanning also accepts results from tools other than CodeQL. Any tool that produces SARIF can upload it to GitHub, and the findings show up in the same alerts view. That's how runtime findings from a DAST scanner end up next to CodeQL results, and why it pays to run CodeQL and StackHawk together rather than treating them as separate programs.
Compliance and Integrations
GitHub Advanced Security won't make you compliant with anything on its own. What it does is produce evidence auditors ask for: alerts, fixes, push protection blocks, and an org-wide view in the security overview. Here's how that maps to common frameworks:
- HIPAA: Code and secret scanning help find flaws and exposed credentials that could lead to a breach of patient data, and the alert history supports evidence of ongoing vulnerability management.
- PCI DSS: Push protection helps keep credentials for cardholder data systems out of source control, and code scanning supports secure development requirements.
- GDPR: Scanning is part of the technical measures for protecting personal data, not the whole program.
On the integration side, GHAS runs in the same GitHub Actions workflows that build and test your code, and you can extend it with security-focused GitHub Apps. On GitHub Enterprise Cloud, it sits alongside controls like SAML single sign-on and the enterprise audit log.
Best Practices for Using GitHub Advanced Security
Prioritize these configuration and triage steps:
- Turn on push protection first: Block a detected secret before it enters the repository.
- Use default setup for code scanning: Let CodeQL choose languages, query suites, and triggers, then move to advanced setup only for repos that need it.
- Use CodeQL in VS Code: The CodeQL extension lets developers write, run, and test custom queries before they commit.
- Configure alerts: Route alerts by severity so the right team sees them while the code is still fresh.
- Use security campaigns to burn down existing alerts: Group related code scanning or secret scanning alerts, give each campaign a named contact and a remediation target, and let Copilot Autofix suggest fixes for the code alerts.
- Integrate with DAST tools: Pair GHAS with a DAST tool so you're testing the running app as well as the code.
GitHub Advanced Security vs Snyk vs SonarQube
Compare GitHub Advanced Security vs Snyk or GitHub Advanced Security vs SonarQube by analysis scope, integrations, and billing. Here's the short version as of October 2026:
| GitHub Advanced Security | Snyk | SonarQube | |
|---|---|---|---|
| Main scope | SAST (CodeQL, AI Scan), secret scanning, dependency review, and Dependabot | SCA, SAST, IaC and container scanning; DAST sold as a separate product | Code quality and SAST; SCA in its Advanced Security add-on |
| Where it runs | Inside GitHub (a separate GHAS for Azure DevOps also exists) | IDE, CLI and source code manager integrations | SonarQube Cloud, or self-managed SonarQube Server |
| Pricing model | Per active committer, per product | Free tier; Team from $25/month for up to 10 developers; Enterprise is credit-based | By lines of code analyzed; free up to 50k LOC, then paid tiers |
| Best fit | Teams already on GitHub that want security inside pull requests | Teams on several SCMs that want one dependency and container view | Teams that care about code quality gates as much as security |
GHAS puts alerts, Autofix, and campaigns alongside your pull requests. Snyk and SonarQube also support repositories on other platforms; compare their integrations with your workflow. In their core products, though, all three read source code and manifests rather than sending requests to your running app. Snyk sells DAST as a separate product.
What GitHub Advanced Security Doesn't Cover
GHAS analyzes code, secrets, and dependencies. It doesn't test the deployed app, so anything that only shows up when the app runs is outside its reach. Here's a practical way to see the split:
| Risk | Caught by GHAS? | Needs runtime testing? |
|---|---|---|
| Hardcoded keys and tokens | Yes: secret scanning and push protection | No |
| Known-vulnerable dependency versions | Yes: Dependabot alerts and dependency review | No |
| Injection in a language CodeQL covers | Often, when a query traces the data flow | Yes, to confirm the live endpoint is exploitable |
| Broken access control (user A reads user B's data) | Limited: the code can look correct | Yes: needs authenticated requests as different users |
| Authentication and session flaws | Partly, for patterns a query models | Yes |
| Missing security headers or permissive CORS | Only if set in analyzed code, not by a proxy or platform | Yes |
| Business logic flaws | No | Yes |
Broken access control sits at number one on the OWASP Top 10 2025, and it's the class where the code reads fine, but the behavior doesn't. A static rule can't easily tell that /api/orders/1234 should only return orders owned by the caller. A test that logs in as two users and requests each other's records can.
If your team is shipping Copilot output, our guide to securing Copilot-written code covers that workflow end to end. Our platform fills the runtime column.
Using GitHub Advanced Security with DAST
GHAS flags risks in your code. DAST tests the running app for exploitable behavior. Together, they give you source-level findings and runtime evidence to investigate before code reaches production.
What Is DAST?
Dynamic application security testing (DAST) platforms analyze your running application to find security vulnerabilities. Unlike static analysis, which examines your code, DAST interacts with your application like a real user or attacker would. This allows these tests to discover vulnerabilities that might only be present when the application is running, such as those related to authentication, authorization, server configuration, or dynamic behavior.
With StackHawk, we test your APIs and applications by simulating attacks against them and analyzing the responses to identify potential security weaknesses. By incorporating DAST, you can uncover vulnerabilities that platforms like GitHub Advanced Security might miss.
Adding StackHawk to GitHub Advanced Security
Our platform integrates with GitHub code scanning and GitHub Actions, and with Wingman it now runs inside GitHub Copilot itself. That changes where runtime testing happens. Instead of waiting for a pipeline, the coding agent tests the running app while the feature is still open in the editor.
Wingman runs the find, fix, verify loop inside Copilot. You install the Wingman plugin, point the agent at the app running locally, and it sends real HTTP requests to it. For a localhost target, scan requests stay on your machine; findings and application profiles go to the StackHawk platform. When a scan reports a finding, Copilot can propose a fix in your codebase. Review the diff, run the application's tests, and rescan the affected endpoint to check whether the finding still reproduces before opening the pull request. The same skills work in Claude Code, Cursor, Codex, and Antigravity.
With a StackHawk account and hawk CLI v6.0.0 or later installed and authenticated with hawk init --browser, add the marketplace and install the Wingman plugin in Copilot:
copilot plugin marketplace add stackhawk/agent-skills-marketplace
copilot plugin install wingman@stackhawk
That one plugin bundles the HawkScan, StackHawk API, Data Seed, and Optimize skills. For team-wide rollout, you can commit the skills to .github/skills/ in each repo so everyone working in it gets the same setup.
HawkScan tests the running app, then exports its findings as SARIF so GitHub can display them alongside code-scanning results. This example takes you from a small test application to processed alerts in GitHub.
Before you start, you need a StackHawk application and scan policy, plus permission to add repository secrets and run Actions. Use a public repository or an eligible organization-owned private repository with GitHub Code Security enabled. A personal private repository on GitHub Free or Pro does not qualify.
1. Copy the sample into a test repository
Copy the reproducible sample into your repository’s default branch, including the helper scripts and .github/workflows/scan.yml. The Python app is intentionally vulnerable and runs only on the Actions runner’s loopback interface. It uses synthetic data; do not deploy it as a public service.
Check that the repository contains the app, OpenAPI file, scanner configuration, and workflow before continuing. The workflow needs the helper scripts too, not just the YAML excerpt below.
The sample’s file tree shows the configuration and helper files used by the workflow.
2. Add your StackHawk settings
Open Settings > Secrets and variables > Actions, select Secrets, and use New repository secret to add these three values:
HAWK_API_KEY: your StackHawk API key.TEST_APP_ID: your test application’s ID.TEST_POLICY: the name of a scan policy covering reflected XSS and response-header checks.
You should now see all three secret names listed, without their values. Keep the values out of source files and logs. The sample’s stackhawk.yml reads those settings and points the scanner at the local app:
app:
applicationId: ${TEST_APP_ID}
env: Development
host: http://127.0.0.1:8768
scanPolicy:
name: ${TEST_POLICY}
openApiConf:
filePath: openapi.json
3. Check the scan and upload steps
The complete sample workflow grants contents: read and security-events: write, then installs HawkScan 6.6.0 with stackhawk/hawkscan-action@v3.2.0. These are its scan and upload steps:
- name: Scan synthetic loopback target and validate export
env:
HAWK_API_KEY: ${{ secrets.HAWK_API_KEY }}
TEST_APP_ID: ${{ secrets.TEST_APP_ID }}
TEST_POLICY: ${{ secrets.TEST_POLICY }}
run: python3 run_scan.py
- name: Upload genuine findings
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: stackhawk-ghas.sarif
category: synthetic-stackhawk-dast
wait-for-processing: true
run_scan.py starts the app, waits for it to respond, and runs hawk scan --json-output --sarif-ghas stackhawk.yml. It checks scan health and the export before the upload step sends stackhawk-ghas.sarif to GitHub.
For this public sample, the helper removes an optional description containing private application metadata but leaves the findings, rules, locations, and fingerprints intact. Its checks stop the upload if credentials or identifying metadata remain. Review your own export before publishing it.
The workflow keeps scanning and uploading as separate steps; wait-for-processing waits for GitHub to process the results.
4. Run the workflow
In Actions, choose Synthetic StackHawk SARIF validation, then Run workflow. Select the branch containing the sample and start the run. The workflow must be on the default branch for the manual trigger to be available.
When it finishes, open the run and check that both the scan and upload steps succeeded. The completed sample run shows the expected successful workflow outcome:
GitHub Actions completes the scan and SARIF upload in one workflow.
5. Check the code-scanning alerts
Sign in with an account that can view the repository’s code-scanning alerts. Open Security > Code scanning and filter for synthetic-stackhawk-dast. Open an alert and check its rule, affected path, and finding details. A successful Actions run is not a substitute for checking that GitHub processed the results.
The sample run produced 11 processed alerts across five rules. The scanned /search endpoint returned successful GET responses, with no timeouts or scan-level flags and one isolated connection failure. Review health and coverage alongside the alert count; this does not prove that every endpoint was tested.
StackHawk results for the tutorial’s loopback test app: 11 findings, 1 high, 5 medium, and 5 low.
Adapt the example to your application
Once the sample works, change the parts that describe your own test app:
- In
run_scan.py, adapt the app startup, readiness probes, and route-coverage checks. - Set
app.hostto your test app’s address and port, andapp.openApiConf.filePathto its OpenAPI file. - Supply your application ID through
TEST_APP_IDand policy name throughTEST_POLICY. These populateapp.applicationIdandapp.scanPolicy.name.
Finding counts depend on the policy and endpoints you test. Remove temporary repository secrets when the exercise is complete.
Migrating an older workflow? The deprecated codeScanningAlerts option created one scan-link alert when failureThreshold was met. The current integration uses --sarif-ghas and a separate SARIF upload for per-finding alerts.
This workflow brings StackHawk's runtime findings into GitHub alongside your code-scanning results. The next step is to review a finding, address it in the app, and rescan to check the change. For security teams that need the same coverage across every app and developer, our Scale plan adds attack surface discovery and unlimited agentic scans on top of Wingman.
Run StackHawk inside Copilot: test the running app, fix, and rescan before you open the PR. Wingman is $10 per user per month with unlimited apps and 50 scans per user per month. Start a 14-day free trial, no credit card required.
FAQ
For public repositories, secret scanning runs automatically, and code scanning is free once you enable CodeQL default setup. Every plan also includes the dependency graph and Dependabot alerts. Private and internal repositories need GitHub Code Security ($30) or GitHub Secret Protection ($19) per active committer per month.
Buy Code Security or Secret Protection on a GitHub Team or Enterprise plan. Then enable them for many repositories at once with an organization security configuration, or for one repo under Settings > Security and quality > Advanced Security.
No. GHAS covers static analysis, software composition analysis, and secret scanning. To test the running application, you add a DAST tool. StackHawk can send its results into GitHub Code Scanning so they show up next to CodeQL alerts.
