draugr

module
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0

README ΒΆ

Draugr

Developer-first, descriptor-driven security scanning orchestration.

CI OpenSSF Scorecard OpenSSF Best Practices Latest release License

Describe your app. Draugr figures out the rest.

You declare what you know about your software β€” where the repos are, what container images it builds, what endpoints it exposes, what infrastructure it runs on β€” in a single descriptor (draugr.saga.yaml). Draugr infers which security controls apply, runs the right scanner for each, and produces pass/fail evidence you can trust. Swap scanners freely β€” use the tools you already pay for, or Draugr's open-source defaults. Every result is normalized to SARIF.

This is the open-source core engine.

Status

🚧 Early, and moving fast. Working today:

  • Controls: images (Trivy), sca (Trivy fs), secrets (Gitleaks), sast (Semgrep, plus opt-in gosec for Go), iac (Trivy config), headers (native HTTP-header analyzer). See the integrations catalog.
  • Pipeline: end-to-end scan (plan β†’ scan β†’ judge β†’ report), content-hash caching, tunable parallelism (-j), results normalized to SARIF.
  • Prioritization: declare a component's exposure and criticality and Draugr ranks every finding P1–P4 (--min-priority to focus, --fail-on-priority to gate); optional KEV/EPSS enrichment for real-world exploitability.
  • Discovery ("the Ravens"): survey for Kubernetes images and GitHub org repositories.
  • Preflight & tooling: validate (schema-check a Saga), doctor (which scanner tools are present/missing), tools install (fetch pinned, checksum- and cosign-verified scanners β€” and cosign itself β€” into ~/.draugr/bin), and self-update (update draugr itself, verified).

More controls (DAST, TLS, SBOM, …) are on the roadmap. See docs/concepts.md for what maps to what.

Quickstart

Requirements: the external scanners for the controls you use β€” Trivy (images, sca, iac), Gitleaks (secrets), Semgrep (sast); git for repo scans. Or run draugr tools install to fetch pinned, verified copies. Go 1.26+ only to build from source.

Install from a release (recommended):

gh release download --repo draugr-dev/draugr \
  -p "draugr_*_$(uname -s | tr A-Z a-z)_amd64.tar.gz"   # omit a tag = latest
tar -xzf draugr_*_amd64.tar.gz draugr
sudo mv draugr /usr/local/bin/ && draugr version

Releases are cosign-signed with SBOMs and SLSA build provenance β€” see install & verifying downloads for the verifying curl recipe. Once installed, update in place with draugr self-update.

Or build from source:

git clone https://github.com/draugr-dev/draugr.git
cd draugr && make build      # produces ./bin/draugr
./bin/draugr version

Write a draugr.saga.yaml (see examples/):

release:
  name: my-app
  version: "1.0"
config:
  controllers:
    images:
      enabled: true
components:
  - name: web
    images:
      - image: alpine:3.19

Scan it:

draugr scan draugr.saga.yaml            # prints a JSON verdict; exits non-zero on fail
draugr scan draugr.saga.yaml -o out/    # also writes out/report.json + out/results.sarif
draugr scan draugr.saga.yaml --fail-on warning

Let discovery write the descriptor for you (the Ravens):

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

Full walkthrough: docs/quickstart.md.

Use in CI (GitHub Actions)

Add Draugr to a repository's CI and code scanning with the first-party action. It downloads a cosign-verified Draugr release, runs the scan, and hands the merged SARIF to GitHub code scanning β€” one clean Draugr tool in the Security tab:

permissions:
  contents: read
  security-events: write   # upload SARIF to code scanning

steps:
  - uses: actions/checkout@v4
  - id: draugr
    uses: draugr-dev/draugr@v0.16.0     # pin a release; installs Draugr for you
    with:
      saga: draugr.saga.yaml
      fail-on: warning                  # optional gate (default: error)
  - if: always()                        # publish findings even when the gate fails
    uses: github/codeql-action/upload-sarif@v3
    with:
      sarif_file: ${{ steps.draugr.outputs.sarif }}

The scanners each control needs (Trivy, Gitleaks, …) still have to be on the runner β€” install them alongside, or gate their presence with draugr doctor. See Run it in CI for the full workflow and all inputs.

Documentation

Full documentation index β†’ (grouped by task, with a "building blocks" glossary of Saga / Norn / Skald / the Ravens).

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 + 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 on its own repo every PR (dogfood self-scan), and we track our supply-chain posture with the OpenSSF Scorecard (badge above).
  • Report a vulnerability β€” see SECURITY.md.

Development

Requires Go 1.26+.

make build   # build ./bin/draugr
make gate    # full local gate: fmt, vet, golangci-lint, race tests + coverage, govulncheck
make test    # run tests
Observability

Draugr uses Cobra for the CLI, log/slog for structured logging (--log-level, --log-format json|text), and OpenTelemetry for traces and metrics. Telemetry is opt-in via the standard OTEL_* environment variables (e.g. OTEL_EXPORTER_OTLP_ENDPOINT) β€” a no-op with zero overhead when unset. Logs and spans never carry secrets.

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 scanning orchestration.
Command draugr is the Draugr CLI: developer-first, descriptor-driven security scanning orchestration.
internal
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.
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.
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.
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.
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.
selfupdate
Package selfupdate updates the running draugr binary to a released version.
Package selfupdate updates the running draugr binary to a released version.
surveyors
Package surveyors holds Draugr's built-in surveyors ("the Ravens").
Package surveyors holds Draugr's built-in surveyors ("the Ravens").
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.
version
Package version carries build metadata, injected at link time via -ldflags.
Package version carries build metadata, injected at link time via -ldflags.
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.
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.
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.
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 Raven framework: discovery plugins that inspect an environment and return Saga fragments, which are merged so the descriptor can write itself.
Package surveyor is the Raven framework: discovery 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 declaratively: describe how to build the command for a target, and the adapter runs it and parses its SARIF output.
Package tooladapter turns an external command-line security tool into a Draugr Scanner declaratively: describe how to build the command for a target, and the adapter runs it and parses its SARIF output.

Jump to

Keyboard shortcuts

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