mirror of
https://github.com/KeygraphHQ/shannon.git
synced 2026-08-15 16:00:29 +02:00
Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25edbd2b5d | ||
|
|
61abe5ecbe | ||
|
|
95e25455a0 | ||
|
|
e22a4c47b6 | ||
|
|
cb336456fb | ||
|
|
6c39101071 | ||
|
|
3f7d38de8f | ||
|
|
bcc8c3279c | ||
|
|
e7edef49d7 | ||
|
|
da3ea1570f | ||
|
|
6a83495182 |
@@ -34,6 +34,8 @@ It analyzes your source code, identifies attack paths, and executes real exploit
|
|||||||
- [Editions](#editions)
|
- [Editions](#editions)
|
||||||
- [Architecture](#architecture)
|
- [Architecture](#architecture)
|
||||||
- [Documentation](#documentation)
|
- [Documentation](#documentation)
|
||||||
|
- [Continuous Integration](#continuous-integration)
|
||||||
|
- [Common Questions](#common-questions)
|
||||||
- [Safety, Scope, and Limitations](#safety-scope-and-limitations)
|
- [Safety, Scope, and Limitations](#safety-scope-and-limitations)
|
||||||
- [License](#license)
|
- [License](#license)
|
||||||
- [About Keygraph](#about-keygraph)
|
- [About Keygraph](#about-keygraph)
|
||||||
@@ -73,7 +75,7 @@ Sample penetration test reports from intentionally vulnerable applications, prod
|
|||||||
|
|
||||||
- **Docker**: required for the worker container.
|
- **Docker**: required for the worker container.
|
||||||
- **Node.js 18+**: required for the recommended `npx` workflow.
|
- **Node.js 18+**: required for the recommended `npx` workflow.
|
||||||
- **AI provider credentials**: Anthropic, OpenAI, xAI, or AWS Bedrock - or [any other provider](docs/ai-providers.md#any-other-provider). Claude models are recommended. For suggested model IDs per provider, plus gateways and custom base URLs, see [AI providers](docs/ai-providers.md#suggested-models).
|
- **AI provider credentials**: Shannon runs on Anthropic, OpenAI, xAI, AWS Bedrock, [any other provider](docs/ai-providers.md#any-other-provider) in the harness catalogue, and any endpoint that speaks the Anthropic Messages API or the OpenAI Chat Completions API through a [custom base URL](docs/ai-providers.md#custom-base-url). You bring your own key, and Keygraph never proxies your model traffic. Shannon is provider-agnostic. See [AI providers](docs/ai-providers.md#suggested-models) for suggested model IDs.
|
||||||
- **Cyber safeguards cleared with your provider**: Anthropic and OpenAI apply real-time safeguards to cyber-security workloads, which can interrupt a scan mid-run. Complete their guidance for legitimate security testers before your first run - see [AI providers](docs/ai-providers.md#cyber-safeguards-do-this-before-your-first-scan).
|
- **Cyber safeguards cleared with your provider**: Anthropic and OpenAI apply real-time safeguards to cyber-security workloads, which can interrupt a scan mid-run. Complete their guidance for legitimate security testers before your first run - see [AI providers](docs/ai-providers.md#cyber-safeguards-do-this-before-your-first-scan).
|
||||||
|
|
||||||
### Run Shannon
|
### Run Shannon
|
||||||
@@ -107,6 +109,9 @@ For source builds, authenticated scans, provider-specific setup, and platform no
|
|||||||
- **Authenticated testing**: configuration files can describe login flows, test credentials, TOTP, email-based login flows, focus areas, and rules of engagement.
|
- **Authenticated testing**: configuration files can describe login flows, test credentials, TOTP, email-based login flows, focus areas, and rules of engagement.
|
||||||
- **OWASP-focused coverage**: Shannon targets exploitable Injection, XSS, SSRF, Broken Authentication, and Broken Authorization issues.
|
- **OWASP-focused coverage**: Shannon targets exploitable Injection, XSS, SSRF, Broken Authentication, and Broken Authorization issues.
|
||||||
- **Resumable workspaces**: Shannon can resume interrupted runs without re-running completed agents.
|
- **Resumable workspaces**: Shannon can resume interrupted runs without re-running completed agents.
|
||||||
|
- **Machine-readable output**: Shannon emits findings as structured JSON, and as SARIF 2.1.0 when you enable it in configuration. SARIF is the OASIS standard for static analysis results, so findings flow into any code scanning service, vulnerability management platform, security dashboard, or CI/CD pipeline that reads it.
|
||||||
|
- **Headless CI/CD execution**: Shannon runs fully headless and non-interactively, with environment-variable credentials and configuration-file support, so it fits ephemeral CI environments. This is included in Shannon Open Source and is not gated behind a commercial edition.
|
||||||
|
- **Bring your own key, provider-agnostic**: Shannon runs on Anthropic, OpenAI, xAI, AWS Bedrock, and any endpoint speaking the Anthropic Messages API or the OpenAI Chat Completions API, including self-hosted models served through Ollama, vLLM, or LM Studio and gateways such as OpenRouter and LiteLLM. You supply the credentials, so source code and model traffic stay inside your infrastructure.
|
||||||
|
|
||||||
## Editions
|
## Editions
|
||||||
|
|
||||||
@@ -198,8 +203,88 @@ Use these guides for operational detail:
|
|||||||
| [Workspaces and resuming](docs/workspaces.md) | Naming workspaces, resuming interrupted scans, and workspace storage. |
|
| [Workspaces and resuming](docs/workspaces.md) | Naming workspaces, resuming interrupted scans, and workspace storage. |
|
||||||
| [Safety and limitations](docs/safety.md) | Authorized-use requirements, non-production guidance, mutative effects, cost, and model caveats. |
|
| [Safety and limitations](docs/safety.md) | Authorized-use requirements, non-production guidance, mutative effects, cost, and model caveats. |
|
||||||
| [Coverage and roadmap](docs/coverage-roadmap.md) | Current vulnerability coverage and planned work. |
|
| [Coverage and roadmap](docs/coverage-roadmap.md) | Current vulnerability coverage and planned work. |
|
||||||
|
| [CI/CD integration](docs/ci-cd.md) | Headless execution, SARIF output, artifact paths, and GitHub Actions examples. |
|
||||||
| [Keygraph platform](docs/keygraph-platform.md) | The continuous, agentic pentesting platform: code analysis, black-box and white-box testing, finding management, remediation, verification, and enterprise deployment. |
|
| [Keygraph platform](docs/keygraph-platform.md) | The continuous, agentic pentesting platform: code analysis, black-box and white-box testing, finding management, remediation, verification, and enterprise deployment. |
|
||||||
|
|
||||||
|
## Continuous Integration
|
||||||
|
|
||||||
|
Shannon runs fully headless and non-interactively, so it fits ephemeral CI environments. Credentials are read from environment variables, so no interactive `setup` step is required. The example below uses GitHub Actions, but nothing about the run is GitHub-specific.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: Shannon Pentest
|
||||||
|
on: [pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pentest:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Run Shannon
|
||||||
|
run: |
|
||||||
|
npx @keygraph/shannon start \
|
||||||
|
-u ${{ vars.TARGET_URL }} \
|
||||||
|
-r . \
|
||||||
|
-w ci-${{ github.run_id }} \
|
||||||
|
-o ./shannon-results
|
||||||
|
|
||||||
|
# `start` launches the scan in the background. `logs` streams it and
|
||||||
|
# returns once the scan reports COMPLETED or FAILED.
|
||||||
|
npx @keygraph/shannon logs ci-${{ github.run_id }}
|
||||||
|
env:
|
||||||
|
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||||
|
|
||||||
|
- name: Upload report
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: shannon-report
|
||||||
|
path: ./shannon-results/
|
||||||
|
```
|
||||||
|
|
||||||
|
`-o` copies the run's deliverables, including the report and the structured findings in `report.json`, to a path the rest of your workflow can read.
|
||||||
|
|
||||||
|
Because Shannon reports only vulnerabilities it has actually exploited, what lands in your pipeline is proven rather than speculative. Set `report.min_severity` in a configuration file passed with `-c` to drop findings below a severity threshold, then gate merges on your own check over `report.json`.
|
||||||
|
|
||||||
|
See [CI/CD integration](docs/ci-cd.md) for artifact paths, SARIF output, authenticated targets, and cost and runtime notes.
|
||||||
|
|
||||||
|
## Common Questions
|
||||||
|
|
||||||
|
### Is Shannon free?
|
||||||
|
|
||||||
|
Yes. Shannon Open Source is free and licensed under AGPL-3.0. You run it yourself from the command line. Your only cost is the AI provider credits you supply.
|
||||||
|
|
||||||
|
### Can I self-host Shannon?
|
||||||
|
|
||||||
|
Yes. Shannon Open Source runs entirely on your own infrastructure in an ephemeral Docker container. Your source code is mounted read-only and never leaves your environment.
|
||||||
|
|
||||||
|
### Does Shannon support bring your own key (BYOK)?
|
||||||
|
|
||||||
|
Yes, always. You supply your own AI provider credentials in every deployment, open source and commercial. Keygraph never proxies your model traffic.
|
||||||
|
|
||||||
|
### Can Shannon run in CI/CD?
|
||||||
|
|
||||||
|
Yes. Shannon runs fully headless and non-interactively, with environment-variable credentials and configuration-file support. See [Continuous Integration](#continuous-integration) for a worked example, and [CI/CD integration](docs/ci-cd.md) for SARIF output and artifact paths. This is part of Shannon Open Source.
|
||||||
|
|
||||||
|
### Does Shannon output SARIF?
|
||||||
|
|
||||||
|
Yes. Shannon emits SARIF 2.1.0, the OASIS standard format for static analysis results, alongside structured JSON. Any SARIF consumer reads it: code scanning services, vulnerability management platforms, security dashboards, and CI/CD pipelines. Set `report.sarif` to `"true"` in your configuration file to enable the SARIF log.
|
||||||
|
|
||||||
|
### Which AI providers does Shannon support?
|
||||||
|
|
||||||
|
Anthropic, OpenAI, xAI, and AWS Bedrock are built in and configured directly by provider ID. Beyond those, Shannon runs on any endpoint that implements the Anthropic Messages API or the OpenAI Chat Completions API, reached through a custom base URL. The rule is the API format, not the vendor. Shannon uses a single unified model setting throughout a pentest.
|
||||||
|
|
||||||
|
### Can I run Shannon on a local or self-hosted model?
|
||||||
|
|
||||||
|
Yes. Shannon works with local models served through Ollama, vLLM, or LM Studio, which expose an OpenAI-compatible endpoint, as well as routers such as OpenRouter and gateways such as LiteLLM. Point Shannon at the endpoint with a custom base URL. See [AI providers](docs/ai-providers.md#custom-base-url).
|
||||||
|
|
||||||
|
### Does Shannon actually exploit vulnerabilities, or just scan?
|
||||||
|
|
||||||
|
Shannon executes real exploits. It reports a finding only when it has produced a working proof-of-concept, and discards hypotheses it cannot prove. It is a pentester, not a scanner.
|
||||||
|
|
||||||
|
### Is Shannon free for startups and nonprofits?
|
||||||
|
|
||||||
|
Shannon Open Source is free for everyone. In addition, the Keygraph Community Program gives eligible nonprofits and early-stage startups free access to the commercial Keygraph platform. See [keygraph.io](https://keygraph.io).
|
||||||
|
|
||||||
## Safety, Scope, and Limitations
|
## Safety, Scope, and Limitations
|
||||||
|
|
||||||
Shannon is not a passive scanner. Its exploitation agents can create users, submit forms, mutate application state, trigger outbound requests, and otherwise affect the target system. Use sandboxed, staging, or local development environments with disposable data.
|
Shannon is not a passive scanner. Its exploitation agents can create users, submit forms, mutate application state, trigger outbound requests, and otherwise affect the target system. Use sandboxed, staging, or local development environments with disposable data.
|
||||||
@@ -210,7 +295,7 @@ Important limitations:
|
|||||||
|
|
||||||
- Shannon Open Source focuses on actively exploitable issues such as Injection, XSS, SSRF, Broken Authentication, and Broken Authorization. Broader static-analysis coverage, including vulnerable dependencies and insecure configurations, is delivered through the Keygraph platform.
|
- Shannon Open Source focuses on actively exploitable issues such as Injection, XSS, SSRF, Broken Authentication, and Broken Authorization. Broader static-analysis coverage, including vulnerable dependencies and insecure configurations, is delivered through the Keygraph platform.
|
||||||
- Findings still require human review. LLM-generated reports can contain weakly supported or incorrect details.
|
- Findings still require human review. LLM-generated reports can contain weakly supported or incorrect details.
|
||||||
- Shannon is officially supported with Claude models. Smaller, alternative, or proxied non-Claude models may be incomplete or unstable.
|
- Anthropic, OpenAI, xAI, and AWS Bedrock are built-in providers, and any Anthropic Messages API or OpenAI Chat Completions API endpoint works through a custom base URL. Model capability varies, and a model that does not follow Shannon's instructions or tool-use constraints reliably will produce weaker results.
|
||||||
- A full run can take roughly 1 to 1.5 hours and may incur LLM API costs depending on model pricing and application complexity.
|
- A full run can take roughly 1 to 1.5 hours and may incur LLM API costs depending on model pricing and application complexity.
|
||||||
- Do not scan untrusted or adversarial codebases. AI-powered tools that read source code can be exposed to prompt injection.
|
- Do not scan untrusted or adversarial codebases. AI-powered tools that read source code can be exposed to prompt injection.
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export async function setup(): Promise<void> {
|
|||||||
const selected = await p.select({
|
const selected = await p.select({
|
||||||
message: 'Select your AI provider',
|
message: 'Select your AI provider',
|
||||||
options: [
|
options: [
|
||||||
{ value: 'anthropic' as const, label: 'Anthropic', hint: 'Claude models - recommended' },
|
{ value: 'anthropic' as const, label: 'Anthropic', hint: 'Claude models' },
|
||||||
{ value: 'openai' as const, label: 'OpenAI', hint: 'GPT models' },
|
{ value: 'openai' as const, label: 'OpenAI', hint: 'GPT models' },
|
||||||
{ value: 'xai' as const, label: 'xAI', hint: 'Grok models' },
|
{ value: 'xai' as const, label: 'xAI', hint: 'Grok models' },
|
||||||
{ value: 'amazon-bedrock' as const, label: 'AWS Bedrock', hint: 'Claude models via AWS' },
|
{ value: 'amazon-bedrock' as const, label: 'AWS Bedrock', hint: 'Claude models via AWS' },
|
||||||
|
|||||||
@@ -452,9 +452,11 @@ export async function runAuthzExploitAgent(input: ActivityInput): Promise<AgentM
|
|||||||
/**
|
/**
|
||||||
* Write report.sarif when the run is exploitative and the operator asked for it.
|
* Write report.sarif when the run is exploitative and the operator asked for it.
|
||||||
*
|
*
|
||||||
* Skipped entirely for analysis-only runs: those findings carry no severity, so every
|
* Skipped entirely for analysis-only runs. The original reason was that those findings carried
|
||||||
* `result.level` would be invented. Failures are logged and swallowed — the SARIF log is a
|
* no severity, so every `result.level` would have been invented; since severity is recorded in
|
||||||
* secondary artifact and must not fail a run whose report is already written.
|
* both modes an analysis run could now populate `level`, but it would report an assessed
|
||||||
|
* severity as a measured one, so the gate stays. Failures are logged and swallowed — the SARIF
|
||||||
|
* log is a secondary artifact and must not fail a run whose report is already written.
|
||||||
*/
|
*/
|
||||||
async function writeSarifIfEnabled(
|
async function writeSarifIfEnabled(
|
||||||
input: ActivityInput,
|
input: ActivityInput,
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ Shannon forwards only the selected provider's credential into the scan container
|
|||||||
|
|
||||||
### Any other provider
|
### Any other provider
|
||||||
|
|
||||||
Shannon accepts any provider and model present in the Pi harness catalogue. Browse them at [pi.dev/models](https://pi.dev/models). These are technically supported but not recommended. Claude models are best-supported (see the note below).
|
Shannon accepts any provider and model present in the Pi harness catalogue. Browse them at [pi.dev/models](https://pi.dev/models).
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
export SHANNON_AI_API_KEY=your-api-key # the provider's API key
|
export SHANNON_AI_API_KEY=your-api-key # the provider's API key
|
||||||
@@ -37,7 +37,7 @@ This path covers providers whose credential is a single API key. Providers that
|
|||||||
`npx @keygraph/shannon setup` exposes this as the **Other provider** option.
|
`npx @keygraph/shannon setup` exposes this as the **Other provider** option.
|
||||||
|
|
||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
> Claude models are the best-supported option. Shannon's evaluations, internal testing, and agent harness are tuned for Claude. Other models are permitted and validated against the harness catalogue, but may not follow Shannon's instructions or tool-use constraints as reliably. Use them at your own risk.
|
> Models are validated against the harness catalogue, but capability varies. A model that does not follow Shannon's instructions or tool-use constraints reliably will produce weaker pentests. Evaluate the model you choose against your own targets before depending on its results.
|
||||||
|
|
||||||
## Cyber safeguards (do this before your first scan)
|
## Cyber safeguards (do this before your first scan)
|
||||||
|
|
||||||
|
|||||||
+144
@@ -0,0 +1,144 @@
|
|||||||
|
# CI/CD Integration
|
||||||
|
|
||||||
|
Shannon runs headlessly and non-interactively, so it fits ephemeral CI environments. This guide covers credentials, artifact paths, SARIF upload, and the runtime and cost characteristics that shape where a Shannon job belongs in a pipeline.
|
||||||
|
|
||||||
|
Everything here is part of Shannon Open Source. None of it is gated behind a commercial edition.
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> Shannon actively executes exploits. Point CI jobs at ephemeral preview environments, staging, or disposable test deployments that you own. Do not run Shannon against production.
|
||||||
|
|
||||||
|
## Headless Requirements
|
||||||
|
|
||||||
|
A CI run needs three things:
|
||||||
|
|
||||||
|
- **Docker**, for the worker container. GitHub-hosted runners already provide it.
|
||||||
|
- **Node.js 18+**, for the `npx` workflow.
|
||||||
|
- **Provider credentials as environment variables**, so no interactive setup step runs.
|
||||||
|
|
||||||
|
`npx @keygraph/shannon setup` is the interactive credential wizard and is not used in CI. Export the variables instead:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export ANTHROPIC_API_KEY=...
|
||||||
|
```
|
||||||
|
|
||||||
|
`SHANNON_AI_MODEL` selects the provider and model as `<provider>:<model-id>`. Left unset, Shannon uses its default Claude model, so a job that exports only `ANTHROPIC_API_KEY` runs without further configuration. See [AI providers](ai-providers.md) for other providers, gateways, and custom base URLs.
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> Anthropic and OpenAI apply real-time safeguards to cyber-security workloads, which can interrupt a scan mid-run. Complete their guidance for legitimate security testers before wiring Shannon into a pipeline. See [cyber safeguards](ai-providers.md#cyber-safeguards-do-this-before-your-first-scan).
|
||||||
|
|
||||||
|
## How a Scan Runs in CI
|
||||||
|
|
||||||
|
`shannon start` launches the scan in a detached worker container and returns as soon as the run registers. It does not block until the pentest finishes.
|
||||||
|
|
||||||
|
`shannon logs <workspace>` streams the run's log and returns when the scan reports `COMPLETED` or `FAILED`. Pair the two commands to make a CI step wait for results:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npx @keygraph/shannon start -u "$TARGET_URL" -r . -c shannon.yaml -w ci-run -o ./shannon-results
|
||||||
|
npx @keygraph/shannon logs ci-run
|
||||||
|
```
|
||||||
|
|
||||||
|
Pass an explicit workspace name with `-w` so the `logs` command has a deterministic name to attach to. Without it, Shannon generates a name from the hostname and a timestamp.
|
||||||
|
|
||||||
|
## Output Artifacts
|
||||||
|
|
||||||
|
`-o <path>` copies the run's deliverables out of the workspace and into a directory the rest of your pipeline can read:
|
||||||
|
|
||||||
|
| File | Contents |
|
||||||
|
| --- | --- |
|
||||||
|
| `report.sarif` | SARIF 2.1.0 log. Written only when `report.sarif` is enabled and the run is exploitative. |
|
||||||
|
| `report.json` | Structured findings emitted by the report agent. The Markdown report is rendered from it. |
|
||||||
|
| `Security-Assessment-Report.pdf` | The human-facing report. |
|
||||||
|
| `comprehensive_security_assessment_report.md` | The assembled Markdown report. |
|
||||||
|
|
||||||
|
`report.sarif` and `Security-Assessment-Report.pdf` are also surfaced at the workspace root, so a step that reads from the workspace directly can rely on a stable path.
|
||||||
|
|
||||||
|
## SARIF Output
|
||||||
|
|
||||||
|
SARIF 2.1.0 is the OASIS standard interchange format for static analysis results. Any tool that reads SARIF ingests `report.sarif` unchanged, so the GitHub Actions example below is one consumer among many, not a requirement.
|
||||||
|
|
||||||
|
SARIF is opt-in. Enable it in a configuration file:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# shannon.yaml
|
||||||
|
report:
|
||||||
|
sarif: "true"
|
||||||
|
```
|
||||||
|
|
||||||
|
SARIF requires an exploitative run, which is the default. Shannon does not write a SARIF log for analysis-only runs (`exploit: "false"`).
|
||||||
|
|
||||||
|
Each finding becomes one SARIF result, filed under a rule per vulnerability class (`shannon/injection`, `shannon/xss`, `shannon/auth`, `shannon/authz`, `shannon/ssrf`) and tagged with its OWASP Top Ten 2025 category. Severity maps onto SARIF's three levels: `critical` and `high` become `error`, `medium` becomes `warning`, everything else becomes `note`.
|
||||||
|
|
||||||
|
See [Configuration](configuration.md#sarif-output) for the full mapping.
|
||||||
|
|
||||||
|
## GitHub Actions
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: Shannon Pentest
|
||||||
|
on: [pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pentest:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Run Shannon
|
||||||
|
run: |
|
||||||
|
npx @keygraph/shannon start \
|
||||||
|
-u ${{ vars.TARGET_URL }} \
|
||||||
|
-r . \
|
||||||
|
-c shannon.yaml \
|
||||||
|
-w ci-${{ github.run_id }} \
|
||||||
|
-o ./shannon-results
|
||||||
|
|
||||||
|
npx @keygraph/shannon logs ci-${{ github.run_id }}
|
||||||
|
env:
|
||||||
|
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||||
|
|
||||||
|
- name: Upload results
|
||||||
|
uses: github/codeql-action/upload-sarif@v3
|
||||||
|
with:
|
||||||
|
sarif_file: ./shannon-results/report.sarif
|
||||||
|
```
|
||||||
|
|
||||||
|
`security-events: write` is required for `upload-sarif` to publish into GitHub code scanning.
|
||||||
|
|
||||||
|
## Gating Merges
|
||||||
|
|
||||||
|
Shannon does not currently fail the job based on what it finds. `logs` returns successfully whether the scan completed or failed, so a passing step means the pipeline ran, not that the target is clean.
|
||||||
|
|
||||||
|
Two options for turning findings into a gate:
|
||||||
|
|
||||||
|
- **GitHub code scanning**: once the SARIF is uploaded, use code scanning's own pull request checks and severity rules to block a merge.
|
||||||
|
- **Your own check**: read `report.json` in a follow-up step and exit non-zero on the findings you care about.
|
||||||
|
|
||||||
|
Filter before you gate. `report.min_severity` drops findings below a severity threshold at report time, so both the SARIF and the JSON carry only what you want to act on:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# shannon.yaml
|
||||||
|
report:
|
||||||
|
min_severity: high
|
||||||
|
sarif: "true"
|
||||||
|
```
|
||||||
|
|
||||||
|
Because Shannon reports only vulnerabilities it has produced a working proof-of-concept for, a gate built on these results fires on proven exploitation rather than speculative alerts.
|
||||||
|
|
||||||
|
## Authenticated Targets
|
||||||
|
|
||||||
|
Most useful CI targets sit behind a login. Describe the login flow, test credentials, and rules of engagement in the same configuration file you pass with `-c`, and supply secrets through environment variables rather than committing them. See [Configuration](configuration.md).
|
||||||
|
|
||||||
|
## Runtime and Cost
|
||||||
|
|
||||||
|
A full run can take roughly 1 to 1.5 hours and incurs LLM API costs that scale with model pricing and application complexity. That shapes where the job belongs:
|
||||||
|
|
||||||
|
- Scheduled runs against a staging environment, or a manual `workflow_dispatch`, fit the runtime better than a check on every pull request.
|
||||||
|
- If you do run per pull request, scope it: limit `vuln_classes`, or trigger only on changes to security-sensitive paths.
|
||||||
|
- Give the job a generous `timeout-minutes`. GitHub-hosted runners default to a six-hour job limit, but the step will inherit whatever you set.
|
||||||
|
- Use `-w` with a stable workspace name to resume an interrupted run rather than restarting it from the first agent. See [Workspaces and resuming](workspaces.md).
|
||||||
|
|
||||||
|
## Other CI Systems
|
||||||
|
|
||||||
|
Nothing in the workflow is GitHub-specific. Any runner with Docker and Node.js 18+ can run the same two commands, export the same credentials, and collect the same artifacts from the `-o` directory. SARIF consumers other than GitHub code scanning read `report.sarif` unchanged.
|
||||||
@@ -106,12 +106,12 @@ rules:
|
|||||||
|
|
||||||
| Key | Effect |
|
| Key | Effect |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `min_severity` | Drops findings rated below this severity. Applies only when `exploit` is `"true"`. |
|
| `min_severity` | Drops findings rated below this severity. Applies in both exploitative and analysis-only runs. |
|
||||||
| `min_confidence` | Drops findings rated below this confidence. Applies only when `exploit` is `"false"`. |
|
| `min_confidence` | Drops findings rated below this confidence. Applies only when `exploit` is `"false"`. |
|
||||||
| `guidance` | Free-text instruction to the report agent, such as which topics to exclude. |
|
| `guidance` | Free-text instruction to the report agent, such as which topics to exclude. |
|
||||||
| `sarif` | Emits a SARIF 2.1.0 log alongside the Markdown report. Requires `exploit: "true"`. |
|
| `sarif` | Emits a SARIF 2.1.0 log alongside the Markdown report. Requires `exploit: "true"`. |
|
||||||
|
|
||||||
A finding carries one rating or the other, never both: an exploited finding is rated by severity, an analysis-only finding by confidence. Setting the threshold that does not apply to the run is ignored, and Shannon logs a warning naming the one to use instead.
|
Every finding carries a severity, but it does not mean the same thing in each mode: an exploitative run measures severity from what the exploit demonstrated, while an analysis-only run assesses it from the class of flaw and the impact it would have. An analysis-only finding carries a confidence rating alongside its severity, since nothing was proven. Setting `min_confidence` on an exploitative run is ignored, and Shannon logs a warning naming the threshold to use instead.
|
||||||
|
|
||||||
### SARIF Output
|
### SARIF Output
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ report:
|
|||||||
|
|
||||||
Each finding becomes one SARIF result, filed under a rule per vulnerability class (`shannon/injection`, `shannon/xss`, `shannon/auth`, `shannon/authz`, `shannon/ssrf`) and tagged with its OWASP Top Ten 2025 category. Results are anchored to the code location the analysis phase recorded, falling back to the HTTP entry point when the finding names no file. Severity maps onto SARIF's three levels: `critical` and `high` become `error`, `medium` becomes `warning`, everything else becomes `note`.
|
Each finding becomes one SARIF result, filed under a rule per vulnerability class (`shannon/injection`, `shannon/xss`, `shannon/auth`, `shannon/authz`, `shannon/ssrf`) and tagged with its OWASP Top Ten 2025 category. Results are anchored to the code location the analysis phase recorded, falling back to the HTTP entry point when the finding names no file. Severity maps onto SARIF's three levels: `critical` and `high` become `error`, `medium` becomes `warning`, everything else becomes `note`.
|
||||||
|
|
||||||
The log is written only for exploitative runs. An analysis-only run rates findings by confidence and produces no severity, so there is nothing to populate `level` with; `sarif` is ignored when `exploit` is `"false"`.
|
The log is written only for exploitative runs. `sarif` is ignored when `exploit` is `"false"`.
|
||||||
|
|
||||||
Supported rule types include `url_path`, `subdomain`, `domain`, `method`, `header`, `parameter`, and `code_path`.
|
Supported rule types include `url_path`, `subdomain`, `domain`, `method`, `header`, `parameter`, and `code_path`.
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -28,7 +28,7 @@ For maximum isolation, run Shannon inside a disposable virtual machine.
|
|||||||
## LLM and Automation Caveats
|
## LLM and Automation Caveats
|
||||||
|
|
||||||
- **Verification is required**: Shannon uses a proof-by-exploitation methodology, but final reports can still contain weakly supported or incorrect details. Human review is essential.
|
- **Verification is required**: Shannon uses a proof-by-exploitation methodology, but final reports can still contain weakly supported or incorrect details. Human review is essential.
|
||||||
- **Model support**: Shannon is officially supported only with Claude models. Alternative models may be incomplete, inaccurate, or unstable.
|
- **Model support**: results vary by model. A model that does not follow Shannon's instructions or tool-use constraints reliably may produce incomplete, inaccurate, or unstable runs.
|
||||||
- **Prompt injection risk**: Do not point Shannon at untrusted or adversarial codebases. AI-powered tools that read source code can be influenced by malicious repository content.
|
- **Prompt injection risk**: Do not point Shannon at untrusted or adversarial codebases. AI-powered tools that read source code can be influenced by malicious repository content.
|
||||||
|
|
||||||
## Scope of Analysis
|
## Scope of Analysis
|
||||||
|
|||||||
+296
-17
@@ -8,7 +8,7 @@
|
|||||||
# File: README.md
|
# File: README.md
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> **[Shannon 2.0 now runs on the Pi harness](https://github.com/KeygraphHQ/shannon/discussions/393)**
|
> **[Shannon 2.0 is officially here](https://github.com/KeygraphHQ/shannon/discussions/405)**
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<a href="https://trendshift.io/repositories/15604" target="_blank"><img src="https://trendshift.io/api/badge/repositories/15604" alt="KeygraphHQ%2Fshannon | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
<a href="https://trendshift.io/repositories/15604" target="_blank"><img src="https://trendshift.io/api/badge/repositories/15604" alt="KeygraphHQ%2Fshannon | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
||||||
|
|
||||||
Shannon is an autonomous, white-box AI pentester for web applications and APIs. <br />
|
Shannon is an autonomous, AI pentester for web applications and APIs. <br />
|
||||||
It analyzes your source code, identifies attack paths, and executes real exploits to prove vulnerabilities before they reach production.
|
It analyzes your source code, identifies attack paths, and executes real exploits to prove vulnerabilities before they reach production.
|
||||||
|
|
||||||
**This repository is Shannon Open Source: the full agent, run locally from your command line.**
|
**This repository is Shannon Open Source: the full agent, run locally from your command line.**
|
||||||
@@ -43,14 +43,16 @@ It analyzes your source code, identifies attack paths, and executes real exploit
|
|||||||
- [Editions](#editions)
|
- [Editions](#editions)
|
||||||
- [Architecture](#architecture)
|
- [Architecture](#architecture)
|
||||||
- [Documentation](#documentation)
|
- [Documentation](#documentation)
|
||||||
|
- [Continuous Integration](#continuous-integration)
|
||||||
|
- [Common Questions](#common-questions)
|
||||||
- [Safety, Scope, and Limitations](#safety-scope-and-limitations)
|
- [Safety, Scope, and Limitations](#safety-scope-and-limitations)
|
||||||
- [License and Enterprise Licensing](#license-and-enterprise-licensing)
|
- [License](#license)
|
||||||
- [About Keygraph](#about-keygraph)
|
- [About Keygraph](#about-keygraph)
|
||||||
- [Community and Support](#community-and-support)
|
- [Community and Support](#community-and-support)
|
||||||
|
|
||||||
## What is Shannon?
|
## What is Shannon?
|
||||||
|
|
||||||
Shannon is an autonomous AI pentester developed by [Keygraph](https://keygraph.io). It performs white-box security testing of web applications and their underlying APIs by combining source-code analysis with live exploitation.
|
Shannon is an autonomous AI pentester developed by [Keygraph](https://keygraph.io). It performs security testing of web applications and their underlying APIs by combining source-code analysis with live exploitation.
|
||||||
|
|
||||||
Shannon analyzes your web application's source code to identify potential attack vectors, then uses browser automation and command-line tools to execute real exploits against the running application and its APIs. Only vulnerabilities with a working proof-of-concept are included in the final report.
|
Shannon analyzes your web application's source code to identify potential attack vectors, then uses browser automation and command-line tools to execute real exploits against the running application and its APIs. Only vulnerabilities with a working proof-of-concept are included in the final report.
|
||||||
|
|
||||||
@@ -82,7 +84,7 @@ Sample penetration test reports from intentionally vulnerable applications, prod
|
|||||||
|
|
||||||
- **Docker**: required for the worker container.
|
- **Docker**: required for the worker container.
|
||||||
- **Node.js 18+**: required for the recommended `npx` workflow.
|
- **Node.js 18+**: required for the recommended `npx` workflow.
|
||||||
- **AI provider credentials**: Anthropic, OpenAI, xAI, or AWS Bedrock - or [any other provider](docs/ai-providers.md#any-other-provider). Claude models are recommended. Gateway and proxy setups are documented separately.
|
- **AI provider credentials**: Shannon runs on Anthropic, OpenAI, xAI, AWS Bedrock, [any other provider](docs/ai-providers.md#any-other-provider) in the harness catalogue, and any endpoint that speaks the Anthropic Messages API or the OpenAI Chat Completions API through a [custom base URL](docs/ai-providers.md#custom-base-url). You bring your own key, and Keygraph never proxies your model traffic. Shannon is provider-agnostic. See [AI providers](docs/ai-providers.md#suggested-models) for suggested model IDs.
|
||||||
- **Cyber safeguards cleared with your provider**: Anthropic and OpenAI apply real-time safeguards to cyber-security workloads, which can interrupt a scan mid-run. Complete their guidance for legitimate security testers before your first run - see [AI providers](docs/ai-providers.md#cyber-safeguards-do-this-before-your-first-scan).
|
- **Cyber safeguards cleared with your provider**: Anthropic and OpenAI apply real-time safeguards to cyber-security workloads, which can interrupt a scan mid-run. Complete their guidance for legitimate security testers before your first run - see [AI providers](docs/ai-providers.md#cyber-safeguards-do-this-before-your-first-scan).
|
||||||
|
|
||||||
### Run Shannon
|
### Run Shannon
|
||||||
@@ -103,7 +105,10 @@ Shannon pulls the worker image from Docker Hub, starts the required local infras
|
|||||||
For source builds, authenticated scans, provider-specific setup, and platform notes, see [Documentation](#documentation).
|
For source builds, authenticated scans, provider-specific setup, and platform notes, see [Documentation](#documentation).
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
> **Prefer to run on your Claude Code subscription instead of API credits?** The [`shannon-v1`](https://github.com/KeygraphHQ/shannon/tree/shannon-v1) branch is the last release built on the Claude Agent SDK, so it accepts a Claude Code OAuth token. Generate one with `claude setup-token`, then run `npx @keygraph/shannon@1.9.0 setup` and pick **OAuth Token**. Pentests then cost nothing beyond your existing subscription.
|
> **Prefer to use a subscription instead of API credits?**
|
||||||
|
>
|
||||||
|
> - **OpenAI Codex:** The latest version of Shannon supports ChatGPT Plus and Pro subscriptions. Follow the [OpenAI Codex subscription setup guide](docs/ai-providers.md#openai-codex-chatgpt-pluspro-subscription) to get started.
|
||||||
|
> - **Claude Code:** The latest version of Shannon does not support Claude Code subscriptions. Follow the [Claude Code subscription setup guide](docs/ai-providers.md#claude-code-subscription) to use version `1.9.0`, which is the final release built on the Claude Agent SDK.
|
||||||
|
|
||||||
## Key Capabilities
|
## Key Capabilities
|
||||||
|
|
||||||
@@ -113,6 +118,9 @@ For source builds, authenticated scans, provider-specific setup, and platform no
|
|||||||
- **Authenticated testing**: configuration files can describe login flows, test credentials, TOTP, email-based login flows, focus areas, and rules of engagement.
|
- **Authenticated testing**: configuration files can describe login flows, test credentials, TOTP, email-based login flows, focus areas, and rules of engagement.
|
||||||
- **OWASP-focused coverage**: Shannon targets exploitable Injection, XSS, SSRF, Broken Authentication, and Broken Authorization issues.
|
- **OWASP-focused coverage**: Shannon targets exploitable Injection, XSS, SSRF, Broken Authentication, and Broken Authorization issues.
|
||||||
- **Resumable workspaces**: Shannon can resume interrupted runs without re-running completed agents.
|
- **Resumable workspaces**: Shannon can resume interrupted runs without re-running completed agents.
|
||||||
|
- **Machine-readable output**: Shannon emits findings as structured JSON, and as SARIF 2.1.0 when you enable it in configuration. SARIF is the OASIS standard for static analysis results, so findings flow into any code scanning service, vulnerability management platform, security dashboard, or CI/CD pipeline that reads it.
|
||||||
|
- **Headless CI/CD execution**: Shannon runs fully headless and non-interactively, with environment-variable credentials and configuration-file support, so it fits ephemeral CI environments. This is included in Shannon Open Source and is not gated behind a commercial edition.
|
||||||
|
- **Bring your own key, provider-agnostic**: Shannon runs on Anthropic, OpenAI, xAI, AWS Bedrock, and any endpoint speaking the Anthropic Messages API or the OpenAI Chat Completions API, including self-hosted models served through Ollama, vLLM, or LM Studio and gateways such as OpenRouter and LiteLLM. You supply the credentials, so source code and model traffic stay inside your infrastructure.
|
||||||
|
|
||||||
## Editions
|
## Editions
|
||||||
|
|
||||||
@@ -199,13 +207,93 @@ Use these guides for operational detail:
|
|||||||
| --- | --- |
|
| --- | --- |
|
||||||
| [Source build and CLI commands](docs/development.md) | Cloning, building, common commands, output paths, and local development. |
|
| [Source build and CLI commands](docs/development.md) | Cloning, building, common commands, output paths, and local development. |
|
||||||
| [Configuration](docs/configuration.md) | Authenticated testing, login flows, rules of engagement, and report filters. |
|
| [Configuration](docs/configuration.md) | Authenticated testing, login flows, rules of engagement, and report filters. |
|
||||||
| [AI providers](docs/ai-providers.md) | Selecting the model, the supported providers (Anthropic, OpenAI, xAI, AWS Bedrock), and custom gateways. |
|
| [AI providers](docs/ai-providers.md) | Selecting the model, the supported providers (Anthropic, OpenAI, xAI, AWS Bedrock, and any other Pi-supported provider), and custom gateways. |
|
||||||
| [Platforms and networking](docs/platforms.md) | Windows/WSL2, Linux, macOS, Docker networking, local apps, and custom hostnames. |
|
| [Platforms and networking](docs/platforms.md) | Windows/WSL2, Linux, macOS, Docker networking, local apps, and custom hostnames. |
|
||||||
| [Workspaces and resuming](docs/workspaces.md) | Naming workspaces, resuming interrupted scans, and workspace storage. |
|
| [Workspaces and resuming](docs/workspaces.md) | Naming workspaces, resuming interrupted scans, and workspace storage. |
|
||||||
| [Safety and limitations](docs/safety.md) | Authorized-use requirements, non-production guidance, mutative effects, cost, and model caveats. |
|
| [Safety and limitations](docs/safety.md) | Authorized-use requirements, non-production guidance, mutative effects, cost, and model caveats. |
|
||||||
| [Coverage and roadmap](docs/coverage-roadmap.md) | Current vulnerability coverage and planned work. |
|
| [Coverage and roadmap](docs/coverage-roadmap.md) | Current vulnerability coverage and planned work. |
|
||||||
|
| [CI/CD integration](docs/ci-cd.md) | Headless execution, SARIF output, artifact paths, and GitHub Actions examples. |
|
||||||
| [Keygraph platform](docs/keygraph-platform.md) | The continuous, agentic pentesting platform: code analysis, black-box and white-box testing, finding management, remediation, verification, and enterprise deployment. |
|
| [Keygraph platform](docs/keygraph-platform.md) | The continuous, agentic pentesting platform: code analysis, black-box and white-box testing, finding management, remediation, verification, and enterprise deployment. |
|
||||||
|
|
||||||
|
## Continuous Integration
|
||||||
|
|
||||||
|
Shannon runs fully headless and non-interactively, so it fits ephemeral CI environments. Credentials are read from environment variables, so no interactive `setup` step is required. The example below uses GitHub Actions, but nothing about the run is GitHub-specific.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: Shannon Pentest
|
||||||
|
on: [pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pentest:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Run Shannon
|
||||||
|
run: |
|
||||||
|
npx @keygraph/shannon start \
|
||||||
|
-u ${{ vars.TARGET_URL }} \
|
||||||
|
-r . \
|
||||||
|
-w ci-${{ github.run_id }} \
|
||||||
|
-o ./shannon-results
|
||||||
|
|
||||||
|
# `start` launches the scan in the background. `logs` streams it and
|
||||||
|
# returns once the scan reports COMPLETED or FAILED.
|
||||||
|
npx @keygraph/shannon logs ci-${{ github.run_id }}
|
||||||
|
env:
|
||||||
|
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||||
|
|
||||||
|
- name: Upload report
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: shannon-report
|
||||||
|
path: ./shannon-results/
|
||||||
|
```
|
||||||
|
|
||||||
|
`-o` copies the run's deliverables, including the report and the structured findings in `report.json`, to a path the rest of your workflow can read.
|
||||||
|
|
||||||
|
Because Shannon reports only vulnerabilities it has actually exploited, what lands in your pipeline is proven rather than speculative. Set `report.min_severity` in a configuration file passed with `-c` to drop findings below a severity threshold, then gate merges on your own check over `report.json`.
|
||||||
|
|
||||||
|
See [CI/CD integration](docs/ci-cd.md) for artifact paths, SARIF output, authenticated targets, and cost and runtime notes.
|
||||||
|
|
||||||
|
## Common Questions
|
||||||
|
|
||||||
|
### Is Shannon free?
|
||||||
|
|
||||||
|
Yes. Shannon Open Source is free and licensed under AGPL-3.0. You run it yourself from the command line. Your only cost is the AI provider credits you supply.
|
||||||
|
|
||||||
|
### Can I self-host Shannon?
|
||||||
|
|
||||||
|
Yes. Shannon Open Source runs entirely on your own infrastructure in an ephemeral Docker container. Your source code is mounted read-only and never leaves your environment.
|
||||||
|
|
||||||
|
### Does Shannon support bring your own key (BYOK)?
|
||||||
|
|
||||||
|
Yes, always. You supply your own AI provider credentials in every deployment, open source and commercial. Keygraph never proxies your model traffic.
|
||||||
|
|
||||||
|
### Can Shannon run in CI/CD?
|
||||||
|
|
||||||
|
Yes. Shannon runs fully headless and non-interactively, with environment-variable credentials and configuration-file support. See [Continuous Integration](#continuous-integration) for a worked example, and [CI/CD integration](docs/ci-cd.md) for SARIF output and artifact paths. This is part of Shannon Open Source.
|
||||||
|
|
||||||
|
### Does Shannon output SARIF?
|
||||||
|
|
||||||
|
Yes. Shannon emits SARIF 2.1.0, the OASIS standard format for static analysis results, alongside structured JSON. Any SARIF consumer reads it: code scanning services, vulnerability management platforms, security dashboards, and CI/CD pipelines. Set `report.sarif` to `"true"` in your configuration file to enable the SARIF log.
|
||||||
|
|
||||||
|
### Which AI providers does Shannon support?
|
||||||
|
|
||||||
|
Anthropic, OpenAI, xAI, and AWS Bedrock are built in and configured directly by provider ID. Beyond those, Shannon runs on any endpoint that implements the Anthropic Messages API or the OpenAI Chat Completions API, reached through a custom base URL. The rule is the API format, not the vendor. Shannon uses a single unified model setting throughout a pentest.
|
||||||
|
|
||||||
|
### Can I run Shannon on a local or self-hosted model?
|
||||||
|
|
||||||
|
Yes. Shannon works with local models served through Ollama, vLLM, or LM Studio, which expose an OpenAI-compatible endpoint, as well as routers such as OpenRouter and gateways such as LiteLLM. Point Shannon at the endpoint with a custom base URL. See [AI providers](docs/ai-providers.md#custom-base-url).
|
||||||
|
|
||||||
|
### Does Shannon actually exploit vulnerabilities, or just scan?
|
||||||
|
|
||||||
|
Shannon executes real exploits. It reports a finding only when it has produced a working proof-of-concept, and discards hypotheses it cannot prove. It is a pentester, not a scanner.
|
||||||
|
|
||||||
|
### Is Shannon free for startups and nonprofits?
|
||||||
|
|
||||||
|
Shannon Open Source is free for everyone. In addition, the Keygraph Community Program gives eligible nonprofits and early-stage startups free access to the commercial Keygraph platform. See [keygraph.io](https://keygraph.io).
|
||||||
|
|
||||||
## Safety, Scope, and Limitations
|
## Safety, Scope, and Limitations
|
||||||
|
|
||||||
Shannon is not a passive scanner. Its exploitation agents can create users, submit forms, mutate application state, trigger outbound requests, and otherwise affect the target system. Use sandboxed, staging, or local development environments with disposable data.
|
Shannon is not a passive scanner. Its exploitation agents can create users, submit forms, mutate application state, trigger outbound requests, and otherwise affect the target system. Use sandboxed, staging, or local development environments with disposable data.
|
||||||
@@ -216,13 +304,13 @@ Important limitations:
|
|||||||
|
|
||||||
- Shannon Open Source focuses on actively exploitable issues such as Injection, XSS, SSRF, Broken Authentication, and Broken Authorization. Broader static-analysis coverage, including vulnerable dependencies and insecure configurations, is delivered through the Keygraph platform.
|
- Shannon Open Source focuses on actively exploitable issues such as Injection, XSS, SSRF, Broken Authentication, and Broken Authorization. Broader static-analysis coverage, including vulnerable dependencies and insecure configurations, is delivered through the Keygraph platform.
|
||||||
- Findings still require human review. LLM-generated reports can contain weakly supported or incorrect details.
|
- Findings still require human review. LLM-generated reports can contain weakly supported or incorrect details.
|
||||||
- Shannon is officially supported with Claude models. Smaller, alternative, or proxied non-Claude models may be incomplete or unstable.
|
- Anthropic, OpenAI, xAI, and AWS Bedrock are built-in providers, and any Anthropic Messages API or OpenAI Chat Completions API endpoint works through a custom base URL. Model capability varies, and a model that does not follow Shannon's instructions or tool-use constraints reliably will produce weaker results.
|
||||||
- A full run can take roughly 1 to 1.5 hours and may incur LLM API costs depending on model pricing and application complexity.
|
- A full run can take roughly 1 to 1.5 hours and may incur LLM API costs depending on model pricing and application complexity.
|
||||||
- Do not scan untrusted or adversarial codebases. AI-powered tools that read source code can be exposed to prompt injection.
|
- Do not scan untrusted or adversarial codebases. AI-powered tools that read source code can be exposed to prompt injection.
|
||||||
|
|
||||||
Read the full [Safety and limitations](docs/safety.md) guide before running Shannon in a new environment.
|
Read the full [Safety and limitations](docs/safety.md) guide before running Shannon in a new environment.
|
||||||
|
|
||||||
## License and Enterprise Licensing
|
## License
|
||||||
|
|
||||||
Shannon Open Source is licensed under the [GNU Affero General Public License v3.0](LICENSE).
|
Shannon Open Source is licensed under the [GNU Affero General Public License v3.0](LICENSE).
|
||||||
|
|
||||||
@@ -523,12 +611,12 @@ rules:
|
|||||||
|
|
||||||
| Key | Effect |
|
| Key | Effect |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `min_severity` | Drops findings rated below this severity. Applies only when `exploit` is `"true"`. |
|
| `min_severity` | Drops findings rated below this severity. Applies in both exploitative and analysis-only runs. |
|
||||||
| `min_confidence` | Drops findings rated below this confidence. Applies only when `exploit` is `"false"`. |
|
| `min_confidence` | Drops findings rated below this confidence. Applies only when `exploit` is `"false"`. |
|
||||||
| `guidance` | Free-text instruction to the report agent, such as which topics to exclude. |
|
| `guidance` | Free-text instruction to the report agent, such as which topics to exclude. |
|
||||||
| `sarif` | Emits a SARIF 2.1.0 log alongside the Markdown report. Requires `exploit: "true"`. |
|
| `sarif` | Emits a SARIF 2.1.0 log alongside the Markdown report. Requires `exploit: "true"`. |
|
||||||
|
|
||||||
A finding carries one rating or the other, never both: an exploited finding is rated by severity, an analysis-only finding by confidence. Setting the threshold that does not apply to the run is ignored, and Shannon logs a warning naming the one to use instead.
|
Every finding carries a severity, but it does not mean the same thing in each mode: an exploitative run measures severity from what the exploit demonstrated, while an analysis-only run assesses it from the class of flaw and the impact it would have. An analysis-only finding carries a confidence rating alongside its severity, since nothing was proven. Setting `min_confidence` on an exploitative run is ignored, and Shannon logs a warning naming the threshold to use instead.
|
||||||
|
|
||||||
### SARIF Output
|
### SARIF Output
|
||||||
|
|
||||||
@@ -542,7 +630,7 @@ report:
|
|||||||
|
|
||||||
Each finding becomes one SARIF result, filed under a rule per vulnerability class (`shannon/injection`, `shannon/xss`, `shannon/auth`, `shannon/authz`, `shannon/ssrf`) and tagged with its OWASP Top Ten 2025 category. Results are anchored to the code location the analysis phase recorded, falling back to the HTTP entry point when the finding names no file. Severity maps onto SARIF's three levels: `critical` and `high` become `error`, `medium` becomes `warning`, everything else becomes `note`.
|
Each finding becomes one SARIF result, filed under a rule per vulnerability class (`shannon/injection`, `shannon/xss`, `shannon/auth`, `shannon/authz`, `shannon/ssrf`) and tagged with its OWASP Top Ten 2025 category. Results are anchored to the code location the analysis phase recorded, falling back to the HTTP entry point when the finding names no file. Severity maps onto SARIF's three levels: `critical` and `high` become `error`, `medium` becomes `warning`, everything else becomes `note`.
|
||||||
|
|
||||||
The log is written only for exploitative runs. An analysis-only run rates findings by confidence and produces no severity, so there is nothing to populate `level` with; `sarif` is ignored when `exploit` is `"false"`.
|
The log is written only for exploitative runs. `sarif` is ignored when `exploit` is `"false"`.
|
||||||
|
|
||||||
Supported rule types include `url_path`, `subdomain`, `domain`, `method`, `header`, `parameter`, and `code_path`.
|
Supported rule types include `url_path`, `subdomain`, `domain`, `method`, `header`, `parameter`, and `code_path`.
|
||||||
|
|
||||||
@@ -605,7 +693,7 @@ Shannon forwards only the selected provider's credential into the scan container
|
|||||||
|
|
||||||
### Any other provider
|
### Any other provider
|
||||||
|
|
||||||
Shannon accepts any provider and model present in the Pi harness catalogue. Browse them at [pi.dev/models](https://pi.dev/models). These are technically supported but not recommended. Claude models are best-supported (see the note below).
|
Shannon accepts any provider and model present in the Pi harness catalogue. Browse them at [pi.dev/models](https://pi.dev/models).
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
export SHANNON_AI_API_KEY=your-api-key # the provider's API key
|
export SHANNON_AI_API_KEY=your-api-key # the provider's API key
|
||||||
@@ -617,7 +705,7 @@ This path covers providers whose credential is a single API key. Providers that
|
|||||||
`npx @keygraph/shannon setup` exposes this as the **Other provider** option.
|
`npx @keygraph/shannon setup` exposes this as the **Other provider** option.
|
||||||
|
|
||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
> Claude models are the best-supported option. Shannon's evaluations, internal testing, and agent harness are tuned for Claude. Other models are permitted and validated against the harness catalogue, but may not follow Shannon's instructions or tool-use constraints as reliably. Use them at your own risk.
|
> Models are validated against the harness catalogue, but capability varies. A model that does not follow Shannon's instructions or tool-use constraints reliably will produce weaker pentests. Evaluate the model you choose against your own targets before depending on its results.
|
||||||
|
|
||||||
## Cyber safeguards (do this before your first scan)
|
## Cyber safeguards (do this before your first scan)
|
||||||
|
|
||||||
@@ -724,12 +812,55 @@ The variable is rejected in preflight where it cannot take effect: with a non-`o
|
|||||||
|
|
||||||
`npx @keygraph/shannon setup` covers this under **Custom Base URL**, which asks which API your gateway serves and configures the matching provider for you.
|
`npx @keygraph/shannon setup` covers this under **Custom Base URL**, which asks which API your gateway serves and configures the matching provider for you.
|
||||||
|
|
||||||
|
## OpenAI Codex (ChatGPT Plus/Pro subscription)
|
||||||
|
|
||||||
|
A ChatGPT Plus or Pro Codex subscription can run Shannon. Shannon reuses a login created by Pi.
|
||||||
|
|
||||||
|
Before running a pentest, review the [cyber safeguards requirements](#cyber-safeguards-do-this-before-your-first-scan).
|
||||||
|
|
||||||
|
1. Install Pi by following the instructions at [pi.dev](https://pi.dev).
|
||||||
|
2. Log in with your subscription using Pi's [subscription authentication guide](https://pi.dev/docs/latest/providers#subscriptions). This creates `~/.pi/agent/auth.json` with an `openai-codex` entry.
|
||||||
|
|
||||||
|
3. Select a Codex model and enable Pi authentication:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export SHANNON_USE_PI_AUTH=1
|
||||||
|
export SHANNON_AI_MODEL=openai-codex:gpt-5.5
|
||||||
|
```
|
||||||
|
|
||||||
|
4. In npx mode, run `npx @keygraph/shannon start ...` from the same shell. In source-build mode, add the two variables to `.env` and run `./shannon start ...`.
|
||||||
|
|
||||||
|
Supported Codex models are `gpt-5.6-sol`, `gpt-5.5`, and `gpt-5.4`.
|
||||||
|
|
||||||
|
## Claude Code subscription
|
||||||
|
|
||||||
|
The latest version of Shannon does not support Claude Code subscriptions. The [`shannon-v1`](https://github.com/KeygraphHQ/shannon/tree/shannon-v1) branch is the final release built on the Claude Agent SDK and supports Claude Code OAuth.
|
||||||
|
|
||||||
|
Before running a pentest, review the [cyber safeguards requirements](#cyber-safeguards-do-this-before-your-first-scan).
|
||||||
|
|
||||||
|
1. Generate a Claude Code OAuth token:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
claude setup-token
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Run the setup flow for the final `shannon-v1` release:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npx @keygraph/shannon@1.9.0 setup
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Select **OAuth Token** and enter the token generated by Claude Code.
|
||||||
|
4. Start the pentest with `npx @keygraph/shannon@1.9.0 start ...`.
|
||||||
|
|
||||||
|
These instructions apply only to `shannon-v1`.
|
||||||
|
|
||||||
## Validation
|
## Validation
|
||||||
|
|
||||||
Checks run before a scan starts, so mistakes fail immediately rather than partway through a run:
|
Checks run before a scan starts, so mistakes fail immediately rather than partway through a run:
|
||||||
|
|
||||||
- **Provider and model ID** — validated against the Pi harness catalogue. An unknown provider or model ID fails preflight with a pointer to [pi.dev/models](https://pi.dev/models). A custom base URL exempts the model ID, since a gateway may serve its own names.
|
- **Provider and model ID** — validated against the Pi harness catalogue. An unknown provider or model ID fails preflight with a pointer to [pi.dev/models](https://pi.dev/models). A custom base URL exempts the model ID, since a gateway may serve its own names.
|
||||||
- **Credential presence** — always validated for the selected provider.
|
- **Credential presence** — validated for the selected provider, or read from Pi when `SHANNON_USE_PI_AUTH=1`.
|
||||||
- **Credential validity** — one minimal request against the model the scan will use, so a rejected key, an exhausted quota, or a model the account cannot reach fails before any agent runs. Bedrock included: its bearer token and region go through the same probe.
|
- **Credential validity** — one minimal request against the model the scan will use, so a rejected key, an exhausted quota, or a model the account cannot reach fails before any agent runs. Bedrock included: its bearer token and region go through the same probe.
|
||||||
|
|
||||||
## Migrating from the three-tier configuration
|
## Migrating from the three-tier configuration
|
||||||
@@ -934,7 +1065,7 @@ For maximum isolation, run Shannon inside a disposable virtual machine.
|
|||||||
## LLM and Automation Caveats
|
## LLM and Automation Caveats
|
||||||
|
|
||||||
- **Verification is required**: Shannon uses a proof-by-exploitation methodology, but final reports can still contain weakly supported or incorrect details. Human review is essential.
|
- **Verification is required**: Shannon uses a proof-by-exploitation methodology, but final reports can still contain weakly supported or incorrect details. Human review is essential.
|
||||||
- **Model support**: Shannon is officially supported only with Claude models. Alternative models may be incomplete, inaccurate, or unstable.
|
- **Model support**: results vary by model. A model that does not follow Shannon's instructions or tool-use constraints reliably may produce incomplete, inaccurate, or unstable runs.
|
||||||
- **Prompt injection risk**: Do not point Shannon at untrusted or adversarial codebases. AI-powered tools that read source code can be influenced by malicious repository content.
|
- **Prompt injection risk**: Do not point Shannon at untrusted or adversarial codebases. AI-powered tools that read source code can be influenced by malicious repository content.
|
||||||
|
|
||||||
## Scope of Analysis
|
## Scope of Analysis
|
||||||
@@ -955,7 +1086,6 @@ For broader coverage, the Keygraph platform adds black-box and white-box agentic
|
|||||||
|
|
||||||
A full test run typically takes roughly 1 to 1.5 hours. LLM API costs vary by model pricing, target complexity, selected provider, and concurrency.
|
A full test run typically takes roughly 1 to 1.5 hours. LLM API costs vary by model pricing, target complexity, selected provider, and concurrency.
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# File: docs/coverage-roadmap.md
|
# File: docs/coverage-roadmap.md
|
||||||
@@ -986,6 +1116,155 @@ For organizations that need broader static and organizational coverage now, see
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
# File: docs/ci-cd.md
|
||||||
|
|
||||||
|
# CI/CD Integration
|
||||||
|
|
||||||
|
Shannon runs headlessly and non-interactively, so it fits ephemeral CI environments. This guide covers credentials, artifact paths, SARIF upload, and the runtime and cost characteristics that shape where a Shannon job belongs in a pipeline.
|
||||||
|
|
||||||
|
Everything here is part of Shannon Open Source. None of it is gated behind a commercial edition.
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> Shannon actively executes exploits. Point CI jobs at ephemeral preview environments, staging, or disposable test deployments that you own. Do not run Shannon against production.
|
||||||
|
|
||||||
|
## Headless Requirements
|
||||||
|
|
||||||
|
A CI run needs three things:
|
||||||
|
|
||||||
|
- **Docker**, for the worker container. GitHub-hosted runners already provide it.
|
||||||
|
- **Node.js 18+**, for the `npx` workflow.
|
||||||
|
- **Provider credentials as environment variables**, so no interactive setup step runs.
|
||||||
|
|
||||||
|
`npx @keygraph/shannon setup` is the interactive credential wizard and is not used in CI. Export the variables instead:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export ANTHROPIC_API_KEY=...
|
||||||
|
```
|
||||||
|
|
||||||
|
`SHANNON_AI_MODEL` selects the provider and model as `<provider>:<model-id>`. Left unset, Shannon uses its default Claude model, so a job that exports only `ANTHROPIC_API_KEY` runs without further configuration. See [AI providers](ai-providers.md) for other providers, gateways, and custom base URLs.
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> Anthropic and OpenAI apply real-time safeguards to cyber-security workloads, which can interrupt a scan mid-run. Complete their guidance for legitimate security testers before wiring Shannon into a pipeline. See [cyber safeguards](ai-providers.md#cyber-safeguards-do-this-before-your-first-scan).
|
||||||
|
|
||||||
|
## How a Scan Runs in CI
|
||||||
|
|
||||||
|
`shannon start` launches the scan in a detached worker container and returns as soon as the run registers. It does not block until the pentest finishes.
|
||||||
|
|
||||||
|
`shannon logs <workspace>` streams the run's log and returns when the scan reports `COMPLETED` or `FAILED`. Pair the two commands to make a CI step wait for results:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npx @keygraph/shannon start -u "$TARGET_URL" -r . -c shannon.yaml -w ci-run -o ./shannon-results
|
||||||
|
npx @keygraph/shannon logs ci-run
|
||||||
|
```
|
||||||
|
|
||||||
|
Pass an explicit workspace name with `-w` so the `logs` command has a deterministic name to attach to. Without it, Shannon generates a name from the hostname and a timestamp.
|
||||||
|
|
||||||
|
## Output Artifacts
|
||||||
|
|
||||||
|
`-o <path>` copies the run's deliverables out of the workspace and into a directory the rest of your pipeline can read:
|
||||||
|
|
||||||
|
| File | Contents |
|
||||||
|
| --- | --- |
|
||||||
|
| `report.sarif` | SARIF 2.1.0 log. Written only when `report.sarif` is enabled and the run is exploitative. |
|
||||||
|
| `report.json` | Structured findings emitted by the report agent. The Markdown report is rendered from it. |
|
||||||
|
| `Security-Assessment-Report.pdf` | The human-facing report. |
|
||||||
|
| `comprehensive_security_assessment_report.md` | The assembled Markdown report. |
|
||||||
|
|
||||||
|
`report.sarif` and `Security-Assessment-Report.pdf` are also surfaced at the workspace root, so a step that reads from the workspace directly can rely on a stable path.
|
||||||
|
|
||||||
|
## SARIF Output
|
||||||
|
|
||||||
|
SARIF 2.1.0 is the OASIS standard interchange format for static analysis results. Any tool that reads SARIF ingests `report.sarif` unchanged, so the GitHub Actions example below is one consumer among many, not a requirement.
|
||||||
|
|
||||||
|
SARIF is opt-in. Enable it in a configuration file:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# shannon.yaml
|
||||||
|
report:
|
||||||
|
sarif: "true"
|
||||||
|
```
|
||||||
|
|
||||||
|
SARIF requires an exploitative run, which is the default. Shannon does not write a SARIF log for analysis-only runs (`exploit: "false"`).
|
||||||
|
|
||||||
|
Each finding becomes one SARIF result, filed under a rule per vulnerability class (`shannon/injection`, `shannon/xss`, `shannon/auth`, `shannon/authz`, `shannon/ssrf`) and tagged with its OWASP Top Ten 2025 category. Severity maps onto SARIF's three levels: `critical` and `high` become `error`, `medium` becomes `warning`, everything else becomes `note`.
|
||||||
|
|
||||||
|
See [Configuration](configuration.md#sarif-output) for the full mapping.
|
||||||
|
|
||||||
|
## GitHub Actions
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: Shannon Pentest
|
||||||
|
on: [pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pentest:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Run Shannon
|
||||||
|
run: |
|
||||||
|
npx @keygraph/shannon start \
|
||||||
|
-u ${{ vars.TARGET_URL }} \
|
||||||
|
-r . \
|
||||||
|
-c shannon.yaml \
|
||||||
|
-w ci-${{ github.run_id }} \
|
||||||
|
-o ./shannon-results
|
||||||
|
|
||||||
|
npx @keygraph/shannon logs ci-${{ github.run_id }}
|
||||||
|
env:
|
||||||
|
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||||
|
|
||||||
|
- name: Upload results
|
||||||
|
uses: github/codeql-action/upload-sarif@v3
|
||||||
|
with:
|
||||||
|
sarif_file: ./shannon-results/report.sarif
|
||||||
|
```
|
||||||
|
|
||||||
|
`security-events: write` is required for `upload-sarif` to publish into GitHub code scanning.
|
||||||
|
|
||||||
|
## Gating Merges
|
||||||
|
|
||||||
|
Shannon does not currently fail the job based on what it finds. `logs` returns successfully whether the scan completed or failed, so a passing step means the pipeline ran, not that the target is clean.
|
||||||
|
|
||||||
|
Two options for turning findings into a gate:
|
||||||
|
|
||||||
|
- **GitHub code scanning**: once the SARIF is uploaded, use code scanning's own pull request checks and severity rules to block a merge.
|
||||||
|
- **Your own check**: read `report.json` in a follow-up step and exit non-zero on the findings you care about.
|
||||||
|
|
||||||
|
Filter before you gate. `report.min_severity` drops findings below a severity threshold at report time, so both the SARIF and the JSON carry only what you want to act on:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# shannon.yaml
|
||||||
|
report:
|
||||||
|
min_severity: high
|
||||||
|
sarif: "true"
|
||||||
|
```
|
||||||
|
|
||||||
|
Because Shannon reports only vulnerabilities it has produced a working proof-of-concept for, a gate built on these results fires on proven exploitation rather than speculative alerts.
|
||||||
|
|
||||||
|
## Authenticated Targets
|
||||||
|
|
||||||
|
Most useful CI targets sit behind a login. Describe the login flow, test credentials, and rules of engagement in the same configuration file you pass with `-c`, and supply secrets through environment variables rather than committing them. See [Configuration](configuration.md).
|
||||||
|
|
||||||
|
## Runtime and Cost
|
||||||
|
|
||||||
|
A full run can take roughly 1 to 1.5 hours and incurs LLM API costs that scale with model pricing and application complexity. That shapes where the job belongs:
|
||||||
|
|
||||||
|
- Scheduled runs against a staging environment, or a manual `workflow_dispatch`, fit the runtime better than a check on every pull request.
|
||||||
|
- If you do run per pull request, scope it: limit `vuln_classes`, or trigger only on changes to security-sensitive paths.
|
||||||
|
- Give the job a generous `timeout-minutes`. GitHub-hosted runners default to a six-hour job limit, but the step will inherit whatever you set.
|
||||||
|
- Use `-w` with a stable workspace name to resume an interrupted run rather than restarting it from the first agent. See [Workspaces and resuming](workspaces.md).
|
||||||
|
|
||||||
|
## Other CI Systems
|
||||||
|
|
||||||
|
Nothing in the workflow is GitHub-specific. Any runner with Docker and Node.js 18+ can run the same two commands, export the same credentials, and collect the same artifacts from the `-o` directory. SARIF consumers other than GitHub code scanning read `report.sarif` unchanged.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
# File: docs/keygraph-platform.md
|
# File: docs/keygraph-platform.md
|
||||||
|
|
||||||
# Keygraph Platform
|
# Keygraph Platform
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Use this file as the concise entry point for AI agents and LLMs reading this rep
|
|||||||
|
|
||||||
## Start Here
|
## Start Here
|
||||||
|
|
||||||
- [README](README.md): Main project overview, editions, quick start, Shannon capabilities, Keygraph platform positioning, safety notes, licensing, and support links.
|
- [README](README.md): Main project overview, editions, quick start, continuous integration, Shannon capabilities, Keygraph platform positioning, common questions, safety notes, licensing, and support links.
|
||||||
- [Full Combined Context](llms-full.txt): README and documentation combined into one file for agents that need maximum local context.
|
- [Full Combined Context](llms-full.txt): README and documentation combined into one file for agents that need maximum local context.
|
||||||
|
|
||||||
## Shannon
|
## Shannon
|
||||||
@@ -18,6 +18,7 @@ Use this file as the concise entry point for AI agents and LLMs reading this rep
|
|||||||
- [Workspaces and Resuming](docs/workspaces.md): Workspace storage, naming, resuming interrupted scans, and examples.
|
- [Workspaces and Resuming](docs/workspaces.md): Workspace storage, naming, resuming interrupted scans, and examples.
|
||||||
- [Safety and Limitations](docs/safety.md): Authorized-use requirements, non-production guidance, mutative effects, model caveats, scope limits, cost, and performance.
|
- [Safety and Limitations](docs/safety.md): Authorized-use requirements, non-production guidance, mutative effects, model caveats, scope limits, cost, and performance.
|
||||||
- [Coverage and Roadmap](docs/coverage-roadmap.md): Current Shannon coverage and roadmap direction.
|
- [Coverage and Roadmap](docs/coverage-roadmap.md): Current Shannon coverage and roadmap direction.
|
||||||
|
- [CI/CD Integration](docs/ci-cd.md): Headless and non-interactive execution, environment-variable credentials, SARIF 2.1.0 and JSON artifact paths, GitHub Actions examples, and merge-gating options.
|
||||||
|
|
||||||
## Keygraph Platform
|
## Keygraph Platform
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user