draugr

module
v0.189.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: Apache-2.0

README

Draugr

Know which security findings to fix first, across the scanners you already run. SAST, SCA, secrets, IaC and containers, every finding ranked by exposure, criticality, exploitability and, for Go, reachability.

CI OpenSSF Scorecard OpenSSF Best Practices Latest release License

Describe your app in one file, and Draugr hands back the findings in the order to fix them.

Every application carries problems nobody put there on purpose: a library that turned out to have a hole in it, a password committed by accident, a server setting that leaves a door open. Draugr finds them, works out which ones actually matter for your app, and answers the question you are really asking before a release, is this safe to ship?

It runs the established open-source scanners for you, Trivy, Semgrep, Gitleaks and others, so there is nothing to choose between, wire up, or read five of. You describe what you built, once, in one file: where the repositories are, what images it builds, what it exposes, what infrastructure it runs on. Draugr picks the checks that apply, runs the right tool for each, and produces evidence you can hand to somebody else. Bring the scanners you already pay for, or use the open-source defaults.

Findings are ranked, not listed. A scanner's "critical" describes a flaw in the abstract, how bad it could be at its worst, anywhere. The same flaw is act-now in the service strangers can reach and backlog in the internal tool three people use, and no scanner can tell those apart because the difference is in the file you wrote, not in the code. And draugr diff gates a pull request on new findings only, so inheriting two hundred existing ones does not block every change.

Quickstart · See it in action · What it checks · In your pipeline · Documentation · What Draugr doesn't promise · Security

See it in action

Priority (P1–P4) is not severity. Severity says how bad a flaw is at its worst, anywhere. Priority weighs that against how exposed and how important the part of your app it sits in is, which no scanner can work out, because it is not in the code.

draugr-dev/draugr-demo is a deliberately vulnerable app wired to Draugr: every control lights up, findings land in the repo's Security → Code scanning tab, and its example pull requests show the new-vs-fixed diff.

Quickstart

curl -fsSL https://draugr.dev/install.sh | sh

Installs to ~/.local/bin, no sudo, and installs nothing if the archive fails verification. The script is readable in the repo; a download by hand, the GitHub CLI and go install are in the install guide.

draugr tools install   # fetch the scanners a scan here runs, pinned and verified
draugr scan .          # scan this repository, no descriptor needed

tools install reads the tree as draugr init does, or the descriptor beside it, so a small service gets the few scanners it runs rather than every one Draugr can provision. --all when you are preparing a machine for several projects.

Then describe what you actually ship, with draugr init writing a first draft:

project: my-app
release:
  version: "1.0"
config:
  controls:
    images:
      enabled: true
components:
  - name: web
    images:
      - image: alpine:3.19
draugr scan draugr.saga.yaml            # console summary; exits non-zero on fail
draugr scan draugr.saga.yaml -o out/    # also writes report.json + results.sarif
draugr scan draugr.saga.yaml --format markdown   # or html, junit, json, sarif

Your editor already knows this file. Draugr's JSON Schema is registered with SchemaStore, so any *.saga.yaml gets completion, hover docs and typo warnings on open with nothing to configure.

Or let discovery write the descriptor for you:

draugr survey github repos --org my-org -o draugr.saga.yaml
draugr survey k8s images --namespace prod -o draugr.saga.yaml

Full walkthrough: quickstart.

Want Draugr set up on your open-source project? Ask in the pinned discussion with the repository's link. We'll open a pull request that adds a descriptor tuned to the project and a workflow, and says what's worth fixing and what was set aside.

What it checks

Each control is backed by a tool Draugr executes rather than bundles, so every scanner stays under its own license, and you can swap it.

Control Looks for By default
sca known flaws in the libraries you depend on Trivy, Grype, OSV-Scanner and Mend opt-in
secrets passwords and keys committed by accident Gitleaks
sast patterns in the code you wrote that let somebody in Semgrep, gosec opt-in for Go
iac settings that leave a door open, in Terraform, Kubernetes and Dockerfiles Trivy, KICS opt-in
images what is baked into your container images Trivy, Grype opt-in
licenses terms attached to code you did not write Trivy
dast problems only visible from outside a running app Nuclei, authenticated, and from an OpenAPI spec
headers how your site answers a browser native
tls certificates and encryption native
kubernetes your Kubernetes cluster, against the CIS benchmarks native, kube-bench opt-in
cloud your cloud account as it is, against the CIS benchmarks Prowler
threats whether anything you talk to is on a public blocklist abuse.ch URLhaus
provenance whether an image is signed by the builder you expect Sigstore cosign

Every scanner, what it sends and whose terms it carries: integrations catalog.

Alongside them: content-hash caching, an SBOM per repository and image, KEV/EPSS enrichment, per-control gate thresholds, and suppressions that stay in the report with the reason someone gave rather than disappearing.

In your pipeline

The first-party GitHub Action installs Draugr, and with tools: true the scanners the descriptor needs. On a pull request it compares the head with the base, posts the findings the change adds and fixes as one comment, and fails on a new P1 finding. On a push to main it runs the full scan, fails on any P1 finding, and sends every finding to the Security tab as one Draugr tool.

name: Security
on:
  push:
    branches: [main]
  pull_request:
permissions:
  contents: read
  pull-requests: write          # the pull-request comment
  security-events: write        # the Security tab, on a push
jobs:
  draugr:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0          # the comparison needs the base commit
      - id: draugr
        uses: draugr-dev/draugr@v0   # pin @vX.Y.Z for reproducible CI
        with:
          saga: draugr.saga.yaml
          tools: true             # provision the scanners the controls need
          fail-on-new: P1         # fail a pull request on a new P1 finding
      - if: always() && github.event_name == 'push'   # even when the gate fails
        uses: github/codeql-action/upload-sarif@v3
        with:
          sarif_file: ${{ steps.draugr.outputs.sarif }}

Save it as .github/workflows/draugr.yml and commit it with the draugr.saga.yaml that draugr init wrote. The upload needs code scanning, which public repositories have and private ones get with GitHub Advanced Security; without it, delete the last step. To block a merge on a failing run, make the draugr check a required status check in the branch's protection rule or ruleset.

GitHub Actions · Code scanning: findings in the Security tab · GitLab: an include, GitLab's own report formats, a sticky merge-request comment · Azure Pipelines: a step template · pre-commit: a hook that fails a commit adding a finding

From an AI coding assistant. Ask one to check a change and it will, using whatever scanner it finds over a scope it chose. draugr mcp serves Draugr over the Model Context Protocol so it reads your committed descriptor instead. A scan that does more than read the checkout, such as probing a live host or sending data to a third party, asks you first.

claude mcp add draugr -- draugr mcp

See use Draugr from an AI coding assistant.

Glama score for the Draugr MCP server

Documentation

Documentation index →

What Draugr doesn't promise

A passing verdict means the controls you configured found nothing they were looking for. It is not a statement that your software is secure. It is silent about anything your descriptor does not declare, controls you did not enable, and whatever the underlying scanners miss. License findings are information, not legal advice. Draugr is provided under Apache-2.0 without warranty.

The details, including whose terms the scanners carry and your responsibility for authorization when scanning live endpoints: scope and disclaimer.

Security & supply chain

A security tool should hold itself to what it checks. Draugr does:

  • Standard output. Every finding is normalized to SARIF 2.1.0 (OASIS), so results flow into GitHub / GitLab / Azure DevOps code scanning and any SARIF-aware tool.
  • Signed releases and provenance. Release archives' checksums.txt is keyless-signed with cosign (Sigstore) into a checksums.txt.sigstore.json bundle, and each release publishes SLSA build-provenance attestations (gh attestation verify …); verify before installing (recipe).
  • SBOMs. A Syft SBOM is published for every release archive.
  • Verified tooling. draugr tools install fetches scanners pinned by SHA-256 and, where the upstream signs them, verifies the cosign signature too, and cosign itself is installable, so verification is self-sufficient.
  • We scan ourselves. Draugr runs its own scan on every pull request to this repository, static analysis included (Semgrep and gosec through the sast control, and gosec again in golangci-lint), and the findings are in the repository's Security tab. Supply-chain posture is tracked on the OpenSSF Scorecard.
  • Report a vulnerability. See SECURITY.md.

Development

Requires Go 1.26+. make build builds ./bin/draugr; make gate runs the full local gate (fmt, vet, lint, race tests with coverage and govulncheck). See CONTRIBUTING.md.

License

Draugr is licensed under the Apache License 2.0.

Directories

Path Synopsis
cmd
draugr command
Command draugr is the Draugr CLI: developer-first, descriptor-driven security and compliance qualification.
Command draugr is the Draugr CLI: developer-first, descriptor-driven security and compliance qualification.
contrib
converters/npm-audit command
Command npm-audit turns what `npm audit --json` writes into a Draugr converter file, for an import with format draugr-converter.
Command npm-audit turns what `npm audit --json` writes into a Draugr converter file, for an import with format draugr-converter.
internal
awsaccess
Package awsaccess asks AWS which identity the credentials in the environment are, and which actions that identity's policies allow.
Package awsaccess asks AWS which identity the credentials in the environment are, and which actions that identity's policies allow.
azureaccess
Package azureaccess asks Azure Resource Manager whether the credentials in the environment can read a subscription, and which actions they hold on it.
Package azureaccess asks Azure Resource Manager whether the credentials in the environment can read a subscription, and which actions they hold on it.
builtins
Package builtins assembles the default registry of controllers and scanners that ship with Draugr.
Package builtins assembles the default registry of controllers and scanners that ship with Draugr.
ciguard
Package ciguard holds assertions about this repository's own CI configuration.
Package ciguard holds assertions about this repository's own CI configuration.
cli
Package cli assembles the Draugr command-line interface on top of Cobra.
Package cli assembles the Draugr command-line interface on top of Cobra.
controllers
Package controllers holds Draugr's built-in controllers (e.g.
Package controllers holds Draugr's built-in controllers (e.g.
credential
Package credential decides which credential a descriptor may name and where it may be sent.
Package credential decides which credential a descriptor may name and where it may be sent.
depsdev
Package depsdev asks deps.dev what is known about the packages a scan found.
Package depsdev asks deps.dev what is known about the packages a scan found.
draugrhome
Package draugrhome answers where Draugr keeps what it downloads: the tools `draugr tools install` provisions, the data they need, and the feeds a scan reads without the network.
Package draugrhome answers where Draugr keeps what it downloads: the tools `draugr tools install` provisions, the data they need, and the feeds a scan reads without the network.
english
Package english forms the words a count is attached to.
Package english forms the words a count is attached to.
enrich
Package enrich builds the signals a scan ranks its findings with: exploitability, the age a cached feed may reach, and dependency health.
Package enrich builds the signals a scan ranks its findings with: exploitability, the age a cached feed may reach, and dependency health.
exploitdata
Package exploitdata turns a scan's exploitability settings into the KEV and EPSS data its prioritizer ranks with, and describes where that data came from.
Package exploitdata turns a scan's exploitability settings into the KEV and EPSS data its prioritizer ranks with, and describes where that data came from.
feeds
Package feeds fetches and caches the exploitability datasets Draugr can enrich findings with: CISA's Known Exploited Vulnerabilities catalog and FIRST's EPSS scores.
Package feeds fetches and caches the exploitability datasets Draugr can enrich findings with: CISA's Known Exploited Vulnerabilities catalog and FIRST's EPSS scores.
gcpaccess
Package gcpaccess asks Google Cloud which permissions the caller's credentials hold on a project.
Package gcpaccess asks Google Cloud which permissions the caller's credentials hold on a project.
git
Package git provides repository checkouts for scanners that operate on source trees.
Package git provides repository checkouts for scanners that operate on source trees.
inventory
Package inventory lists what a source tree holds that a control has something to say about: dependency files, vendored JavaScript, infrastructure code, Dockerfiles, API documents, and SARIF files another tool wrote, in the tree or from a CI step.
Package inventory lists what a source tree holds that a control has something to say about: dependency files, vendored JavaScript, infrastructure code, Dockerfiles, API documents, and SARIF files another tool wrote, in the tree or from a CI step.
login
Package login holds a person's short-lived, check-only token for a Draugr server: the OAuth 2.0 device authorization grant (RFC 8628) that issues it, the revocation (RFC 7009) that ends it, and the OS keychain that keeps it between runs.
Package login holds a person's short-lived, check-only token for a Draugr server: the OAuth 2.0 device authorization grant (RFC 8628) that issues it, the revocation (RFC 7009) that ends it, and the OS keychain that keeps it between runs.
manifests
Package manifests recognizes the files in a tree that declare or pin dependencies, and accounts for the ones a dependency scan did not read.
Package manifests recognizes the files in a tree that declare or pin dependencies, and accounts for the ones a dependency scan did not read.
mcp
Package mcp exposes Draugr to AI coding agents over the Model Context Protocol.
Package mcp exposes Draugr to AI coding agents over the Model Context Protocol.
mendapi
Package mendapi is the client for Mend's v1.3 API: the half of a Mend scan that returns findings.
Package mendapi is the client for Mend's v1.3 API: the half of a Mend scan that returns findings.
needs
Package needs answers what a scan of a descriptor would run: the scanners its enabled controls select, and the external tools those scanners execute.
Package needs answers what a scan of a descriptor would run: the scanners its enabled controls select, and the external tools those scanners execute.
netpolicy
Package netpolicy holds one answer to one question: may this process reach the network?
Package netpolicy holds one answer to one question: may this process reach the network?
nonshipping
Package nonshipping names the directories a repository keeps beside its code without shipping them: documentation, examples and tests.
Package nonshipping names the directories a repository keeps beside its code without shipping them: documentation, examples and tests.
observability
Package observability provides Draugr's logging and telemetry foundations: structured logging via log/slog and distributed tracing via OpenTelemetry.
Package observability provides Draugr's logging and telemetry foundations: structured logging via log/slog and distributed tracing via OpenTelemetry.
preflight
Package preflight checks that this machine can reach what a scan would read: each repository at its revision, the paths a component is scoped to, each image, each endpoint.
Package preflight checks that this machine can reach what a scan would read: each repository at its revision, the paths a component is scoped to, each image, each endpoint.
registry
Package registry asks a container registry whether it will serve an image's manifest to this machine, with the credentials a scanner running here would use.
Package registry asks a container registry whether it will serve an image's manifest to this machine, with the credentials a scanner running here would use.
sagafetch
Package sagafetch fetches Saga fragments held in other repositories.
Package sagafetch fetches Saga fragments held in other repositories.
sagatest
Package sagatest holds a descriptor to both of the readers that judge it: the JSON Schema an editor validates against, and the loader `draugr validate` runs.
Package sagatest holds a descriptor to both of the readers that judge it: the JSON Schema an editor validates against, and the loader `draugr validate` runs.
sbom
Package sbom generates Software Bills of Materials by shelling out to Syft.
Package sbom generates Software Bills of Materials by shelling out to Syft.
scaffold
Package scaffold renders the starter Saga `draugr init` writes for a source tree.
Package scaffold renders the starter Saga `draugr init` writes for a source tree.
scanners
Package scanners holds Draugr's built-in scanners, which wrap individual security tools and normalize their output to SARIF.
Package scanners holds Draugr's built-in scanners, which wrap individual security tools and normalize their output to SARIF.
scanpolicy
Package scanpolicy holds the scoring choices a scan makes, so every entry point into Draugr makes the same ones.
Package scanpolicy holds the scoring choices a scan makes, so every entry point into Draugr makes the same ones.
schemagen
Package schemagen writes the Saga JSON Schema from pkg/saga's types and the registry that answers for its controls, and the fragment and config schemas derived from it.
Package schemagen writes the Saga JSON Schema from pkg/saga's types and the registry that answers for its controls, and the fragment and config schemas derived from it.
schemagen/gen command
Command gen writes the Saga JSON Schema from pkg/saga's types and the plugin registry, and the fragment and config schemas derived from it.
Command gen writes the Saga JSON Schema from pkg/saga's types and the plugin registry, and the fragment and config schemas derived from it.
selfupdate
Package selfupdate updates the running draugr binary to a released version.
Package selfupdate updates the running draugr binary to a released version.
suggest
Package suggest finds the name somebody most likely meant, for a "did you mean" beside an error.
Package suggest finds the name somebody most likely meant, for a "did you mean" beside an error.
surfaces
Package surfaces maps what a descriptor declares to the controls that look at it.
Package surfaces maps what a descriptor declares to the controls that look at it.
surveyors
Package surveyors holds Draugr's built-in surveyors.
Package surveyors holds Draugr's built-in surveyors.
toolexec
Package toolexec runs the external tools Draugr orchestrates, and reports what it ran.
Package toolexec runs the external tools Draugr orchestrates, and reports what it ran.
tools
Package tools describes the external command-line scanners Draugr orchestrates and detects whether they are installed.
Package tools describes the external command-line scanners Draugr orchestrates and detects whether they are installed.
tools/cmd/pinbump command
Command pinbump moves one pinned scanner to a new version and records what that version hashes to.
Command pinbump moves one pinned scanner to a new version and records what that version hashes to.
version
Package version carries build metadata, injected at link time via -ldflags.
Package version carries build metadata, injected at link time via -ldflags.
versionorder
Package versionorder orders the versions of one package by the rules of the ecosystem it comes from.
Package versionorder orders the versions of one package by the rules of the ecosystem it comes from.
vexload
Package vexload resolves the VEX sources a descriptor names into documents a run can apply.
Package vexload resolves the VEX sources a descriptor names into documents a run can apply.
pkg
cache
Package cache stores scan results keyed by content hash so unchanged targets are not re-scanned.
Package cache stores scan results keyed by content hash so unchanged targets are not re-scanned.
ci
Package ci reports the continuous-integration job a scan is running in.
Package ci reports the continuous-integration job a scan is running in.
config
Package config is Draugr's machine- and organization-level configuration, kept apart from the Saga on purpose.
Package config is Draugr's machine- and organization-level configuration, kept apart from the Saga on purpose.
converter
Package converter reads the file a converter writes for Draugr to import: the findings of a tool Draugr has no reader for, with those of Draugr's own result properties a declared converter may set.
Package converter reads the file a converter writes for Draugr to import: the findings of a tool Draugr has no reader for, with those of Draugr's own result properties a declared converter may set.
dephealth
Package dephealth ranks a finding by what is known about the dependency it is in, rather than only by what is known about the flaw.
Package dephealth ranks a finding by what is known about the dependency it is in, rather than only by what is known about the flaw.
diff
Package diff compares two Draugr scan results and classifies every finding as new, fixed, or unchanged, the security delta of a change (typically a PR's head vs the base branch).
Package diff compares two Draugr scan results and classifies every finding as new, fixed, or unchanged, the security delta of a change (typically a PR's head vs the base branch).
engine
Package engine orchestrates a run: it expands a Saga into scan jobs (controllers × components), executes them with bounded parallelism, and aggregates each control's results.
Package engine orchestrates a run: it expands a Saga into scan jobs (controllers × components), executes them with bounded parallelism, and aggregates each control's results.
exploit
Package exploit enriches a finding's severity with real-world exploitability signals: CISA KEV (Known Exploited Vulnerabilities, confirmed exploited in the wild) and FIRST EPSS (Exploit Prediction Scoring System, probability of exploitation).
Package exploit enriches a finding's severity with real-world exploitability signals: CISA KEV (Known Exploited Vulnerabilities, confirmed exploited in the wild) and FIRST EPSS (Exploit Prediction Scoring System, probability of exploitation).
norn
Package norn evaluates scan results against policy to produce a verdict (pass/fail) per control and overall.
Package norn evaluates scan results against policy to produce a verdict (pass/fail) per control and overall.
plugin
Package plugin is the Draugr plugin SDK.
Package plugin is the Draugr plugin SDK.
prioritization
Package prioritization turns a finding's severity and its component's risk classification (exposure × business criticality) into a single Priority band.
Package prioritization turns a finding's severity and its component's risk classification (exposure × business criticality) into a single Priority band.
publish
Package publish delivers rendered reports (report.Artifact) to destinations.
Package publish delivers rendered reports (report.Artifact) to destinations.
report
Package report renders a scan result in a chosen format.
Package report renders a scan result in a chosen format.
saga
Package saga defines the Draugr descriptor ("Saga"), the declarative account of an application's security surface (repositories, images, hosts, infrastructure) plus the controller configuration that drives a scan.
Package saga defines the Draugr descriptor ("Saga"), the declarative account of an application's security surface (repositories, images, hosts, infrastructure) plus the controller configuration that drives a scan.
sarif
Package sarif provides Draugr's result currency: a pragmatic model of SARIF 2.1.0 findings, plus merge and deduplication.
Package sarif provides Draugr's result currency: a pragmatic model of SARIF 2.1.0 findings, plus merge and deduplication.
sbom
Package sbom is the Software Bill of Materials surface: the document type a run produces and the contract for producing one.
Package sbom is the Software Bill of Materials surface: the document type a run produces and the contract for producing one.
skald
Package skald renders scan results and verdicts into evidence: a JSON summary and merged SARIF.
Package skald renders scan results and verdicts into evidence: a JSON summary and merged SARIF.
surveyor
Package surveyor is the discovery framework: plugins that inspect an environment and return Saga fragments, which are merged so the descriptor can write itself.
Package surveyor is the discovery framework: plugins that inspect an environment and return Saga fragments, which are merged so the descriptor can write itself.
tooladapter
Package tooladapter turns an external command-line security tool into a Draugr Scanner.
Package tooladapter turns an external command-line security tool into a Draugr Scanner.
tui
Package tui holds the terminal-presentation rules Draugr applies everywhere it writes for a person: when color is allowed, what the colors mean, and how to link to more detail.
Package tui holds the terminal-presentation rules Draugr applies everywhere it writes for a person: when color is allowed, what the colors mean, and how to link to more detail.
vex
Package vex reads OpenVEX documents somebody else wrote.
Package vex reads OpenVEX documents somebody else wrote.
test
sealed
Package sealed builds what the sealed coverage tier runs against: advisory databases generated from one file of our own text, a container with no network, the expectations a scenario states, and the comparison between those and what a scan produced.
Package sealed builds what the sealed coverage tier runs against: advisory databases generated from one file of our own text, a container with no network, the expectations a scenario states, and the comparison between those and what a scan produced.
sealed/serve command
Command serve runs a command inside a sealed container with sealed.ServedHandler listening on the loopback interface beside it:
Command serve runs a command inside a sealed container with sealed.ServedHandler listening on the loopback interface beside it:

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL