BaghGuard

Reading this as an agent? The same content is available as Markdown at /docs.md, indexed at /llms.txt.

BaghGuard documentation

BaghGuard runs four open-source security scanners across the GitHub repositories you choose, normalizes everything they report into one schema, and shows it in a single dashboard. It can also alert you on Slack or by email, and open fix PRs for a narrow class of dependency issues.

This page is the reference for both people and automated agents. The exact same text is served three ways, all public and none requiring a session:

URLFormatFor
https://baghguard.com/docsHTMLReading in a browser
https://baghguard.com/docs.mdMarkdownAgents, scripts, curl
https://baghguard.com/llms.txtMarkdown indexAgents discovering what is here

How it works

   push to main/master ──> webhook receiver ──┐
                                              │
   every 6 hours ─────────────────────────────┤
                                              v
                              trivy · checkov · gitleaks · grype
                                              │
                                              v
                                   shared results volume
                                              │
                                              v
                                     result normalizer
                                              │
                                              v
                                    findings (PostgreSQL)
                                    │         │         │
                                    v         v         v
                              dashboard   Slack and   fix PRs
                                            email      (beta)
  1. A scan is triggered, either on the six-hourly schedule or immediately by a push to a repo that has the webhook installed.
  2. Each scanner clones the selected repositories and writes raw JSON results to a shared volume.
  3. The normalizer converts all four output formats into one findings schema, de-duplicates against what is already stored, and attributes each finding to the user who selected that repository.
  4. The dashboard, the alerters, and the remediator all read from that one findings table.

Findings are per-user. Two people who both select the same public repository each get their own copy, with their own open/ignored state.

Quick start

  1. Sign in at https://baghguard.com with your GitHub account.
  2. Wait for approval. New accounts start on a waitlist; you get an email when an admin approves yours.
  3. Select repositories on the Repos tab, then press Save Selection.
  4. Optionally turn on notifications in the same page: Slack, email, or automatic fix PRs.
  5. Wait for the first scan. It runs on the next six-hourly cycle, or immediately if you install the push webhook.
  6. Read the results on the Findings tab.

Access and approval

Sign-in is GitHub OAuth only - there are no BaghGuard passwords. The requested scopes are:

ScopeWhy
public_repoRead your public repositories, and push a branch plus open a PR if you enable automatic fix PRs
read:userYour username and avatar for the header
user:emailYour primary address, used to email you about approval and (if enabled) findings

New accounts are created with status pending. While pending you can sign in but you cannot select repositories or receive findings; the site shows a waitlist page instead. An admin approves or rejects each account. If yours was rejected, the waitlist page has a Request approval again button.

Sessions are a pg_session cookie, valid for 7 days, set HttpOnly, SameSite=Lax, Secure. Sign out clears the session server-side.

Selecting repositories

The Repos tab lists public repositories you own. Private repositories are not shown and cannot be scanned - the OAuth scope deliberately does not cover them. Forks and repositories owned by an organization you belong to are also excluded; the list is filtered to affiliation=owner.

  • Select any number of repositories and press Save Selection. Nothing is scanned until you do.
  • Your selection takes effect on the next scan cycle, not retroactively.
  • Deselecting a repository stops future scans of it. Findings already stored stay on your dashboard; mark them ignored if you no longer care about them.

Scanners and schedule

ScannerWhat it findsRuns at (UTC)
TrivyDependency CVEs and infrastructure-as-code misconfigurationEvery 6 hours, on the hour
CheckovTerraform and other IaC policy violationsEvery 6 hours, 15 minutes past
GitleaksSecrets committed to the repositoryEvery 6 hours, 30 minutes past
GrypeVulnerable dependenciesEvery 6 hours, 45 minutes past

The scanners are staggered on purpose so four clones of every selected repository do not start at the same moment.

Severity notes worth knowing when you read the dashboard:

  • Trivy is configured to report MEDIUM and above, so it will not surface LOW-severity CVEs.
  • Every Gitleaks finding is recorded as HIGH - a committed secret is treated as serious regardless of what kind of secret it is.
  • Checkov findings without a severity of their own default to MEDIUM.
  • Grype passes through whatever severity its vulnerability database reports.

Push-triggered scans

Scheduled scans mean a new vulnerability can sit unreported for up to six hours. A webhook closes that gap by running all four scanners as soon as you push.

SettingValue
Payload URLhttps://baghguard.com/webhook
Content typeapplication/json
SecretIssued by BaghGuard - ask before you add the webhook
EventsJust the push event

Only pushes to main or master trigger a scan; pushes to any other branch are acknowledged and ignored. Every delivery must carry a valid X-Hub-Signature-256 HMAC or it is rejected with 401.

Responses you will see in GitHub's Recent Deliveries tab:

{"status": "ok", "message": "Triggered 4 scanners",
 "scanners": ["trivy-scanner", "checkov-scanner",
              "gitleaks-scanner", "grype-scanner"]}
{"status": "skipped", "message": "Ignoring push to refs/heads/feature-x"}
{"status": "ok", "message": "Pong!"}

A push-triggered scan runs the same scanners over the same repository list as the scheduled one - it does not scan only the repository that was pushed.

The findings dashboard

The Findings tab shows everything found across your selected repositories.

  • Stat tiles across the top: total open findings and a count per severity.
  • Three breakdowns: by severity, by scanner, and by repository.
  • Open backlog, last 30 days: how your open findings have trended, so you can tell a growing backlog from a shrinking one.
  • Filters: Open/Ignored, severity chips, and a search box that matches repository, package, CVE ID, description, and file path.

Each finding carries the scanner that reported it, a severity, the CVE ID where there is one, the affected package, the file and line, a description, and a fix version when one is known.

Every finding is either:

StatusMeaning
openCounted in the tiles and charts, eligible for alerts and fix PRs
ignoredHidden from the default view and excluded from alerts; still stored, and you can switch back at any time

Ignoring is per-user, so it never hides a finding from anyone else who has selected the same repository. There is no "resolved" state to set by hand - re-scanning a fixed repository simply stops re-reporting the finding.

Notifications

Both channels are configured per-user at the bottom of the Repos tab, and both alert only on CRITICAL and HIGH open findings.

ChannelWhat you configureCadence
SlackAn incoming webhook URLChecked every 60 seconds
EmailOne or more addresses, comma-separatedA digest, once every 24 hours

Each cycle alerts on findings first seen since the previous cycle, so a finding you have already been told about is not repeated. Ignored findings are never alerted on.

Enabling Slack without a webhook URL, or email without at least one valid address, is rejected when you save.

Automatic fix PRs (Beta)

If you tick Open fix PRs automatically, BaghGuard will raise pull requests for the narrow class of findings it can fix mechanically and safely.

A finding is eligible only when all of these hold:

  • Severity is CRITICAL or HIGH.
  • It came from Trivy or Grype (dependency scanners).
  • The vulnerability database reports a known fix version.
  • The affected file is a requirements.txt, and the vulnerable package is a plain pin in it, such as flask==2.0.1.

Anything else - npm, Go modules, a version resolved through a lockfile, a range rather than a pin - is out of scope and is left for you.

What the PR looks like:

Branchbaghguard/fix-<package>-<version>
Title[BaghGuard] Fix <SEVERITY> <CVE list> in <package>
ChangeOne line in one requirements.txt, bumped to the fix version
BodyWhich CVEs it covers, the version it moves to, and the scanner descriptions

Things to be clear about before enabling it:

  • BaghGuard never merges. It opens the PR; you review, run your CI, and merge or close it.
  • The PR is authored by you, using the GitHub token from your sign-in. There is no bot account, so your repository's CI runs with your permissions as it normally would.
  • One PR per pin, not per CVE. Several CVEs against the same package collapse into one PR that bumps to a version clearing all of them.
  • One attempt per finding. If opening a PR fails, or the pin is not in a shape it can patch, that finding is recorded and never retried - it will not churn your repository with repeated attempts.
  • Eligible findings are picked up within about five minutes.

Using BaghGuard in CI

Separately from the hosted service there is a standalone GitHub Action that runs the same four scanners inside your own workflow and fails the build above a severity threshold you pick:

name: CI
on: [push, pull_request]

jobs:
  security-scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: sitardaniel/pipelineguard-action@main
        with:
          fail-on: HIGH
InputDefaultDescription
path.Directory to scan, relative to the repository root
fail-onHIGHMinimum severity that fails the build: CRITICAL, HIGH, MEDIUM, LOW, or NONE to report without failing
scannerstrivy,checkov,gitleaks,grypeComma-separated; drop the ones that do not apply to your repository

The action is self-contained: it needs no BaghGuard account, sends nothing to https://baghguard.com, and writes its results to the workflow run summary. Results from it do not appear on your dashboard.

Data, permissions, and security

Stored per user: GitHub numeric ID, username, avatar URL, primary email address, the OAuth access token, the repositories you selected, your notification settings, and your findings.

The access token is stored because scans and fix PRs happen asynchronously, after your browser session is gone. Signing out ends your session but does not revoke the token - to fully disconnect, revoke BaghGuard from GitHub's authorized OAuth apps settings.

Other things worth knowing:

  • Findings are scoped to their owner in the database, not just hidden in the UI. There is no endpoint that returns another user's findings.
  • Webhook deliveries are authenticated with an HMAC signature; unsigned or wrongly signed requests are rejected.
  • The site is HTTPS-only; HTTP redirects, and certificates come from Let's Encrypt.
  • Admin endpoints are restricted to a fixed allowlist of GitHub usernames configured on the server, not to a role you can grant yourself.

To report a security problem in BaghGuard itself, see SECURITY.md rather than opening a public issue.

HTTP endpoints

Everything except the public routes needs the pg_session cookie. Routes marked "approved" additionally reject accounts still on the waitlist.

MethodPathAuthPurpose
GET/healthpublicLiveness check, returns {"status":"healthy"}
GET/docspublicThis page
GET/docs.mdpublicThis page as Markdown
GET/llms.txtpublicDocumentation index for agents
GET/loginpublicStarts GitHub OAuth
GET/auth/callbackpublicOAuth redirect target
GET/logoutsessionEnds the session, redirects to /
GET/approvedRepository selection page
GET/findingsapprovedFindings dashboard
POST/saveapprovedSave selected repositories and notification settings
POST/findings/statusapprovedSet one finding to open or ignored
POST/request-againsessionAsk for another approval review after a rejection
GET/adminadminWaitlist review page
POST/admin/approveadminApprove one account
POST/admin/rejectadminReject one account
POST/admin/approve-alladminApprove every pending account
POST/admin/notify-waitlistadminEmail the waitlist that BaghGuard is live
POST/webhookHMACGitHub push events

POST /save takes:

{
  "repos": ["https://github.com/you/your-repo"],
  "notify": {
    "slack_enabled": true,
    "slack_webhook": "https://hooks.slack.com/services/...",
    "email_enabled": true,
    "email_to": ["you@example.com"],
    "remediate_enabled": false
  }
}

and returns {"status": "ok", "count": 1}.

POST /findings/status takes {"id": "<finding-uuid>", "status": "ignored"} and returns {"status": "ok"}. status must be open or ignored.

Errors from any JSON route are {"error": "<message>"} with a 4xx/5xx code.

Notes for agents

If you are an automated agent working on behalf of a BaghGuard user:

  • Start from https://baghguard.com/docs.md. It is the same content as this page in Markdown, and it is public - fetch it directly rather than trying to scrape the HTML.
  • There are no API tokens. Every route other than /health, /docs, /docs.md, /llms.txt, and the OAuth entry points requires a pg_session cookie that only an interactive GitHub OAuth login can produce. You cannot provision your own access; if you need a signed-in session, the person you are working for has to complete the login.
  • Most routes return HTML, not JSON. Only /save, /findings/status, /health, and the /admin/* routes speak JSON. The findings themselves are embedded in the /findings page as a JSON array, not exposed as a separate endpoint.
  • Scoping is server-side. Every query is filtered by the session's user. Do not construct requests that try to read another account's findings; they will not work, and attempting it is not a supported use of the service.
  • Safe to do unattended on a user's behalf, once they have a session: reading findings, marking a finding ignored, changing which repositories are selected.
  • Ask a human first before: enabling automatic fix PRs, merging a fix PR BaghGuard opened, changing notification recipients, or anything under /admin.
  • Be gentle. These are single-instance services. Poll no faster than the underlying cadence is worth - findings only change when a scan completes, which is at most every six hours unless a push triggers one.

Troubleshooting

SymptomLikely causeWhat to do
Signed in, but the site shows a waitlist pageYour account is still pendingWait for approval; you will get an email
A repository is missing from the Repos tabIt is private, a fork, or owned by an organizationOnly public repositories you own can be scanned
No findings after selecting repositoriesThe first scheduled scan has not run yetWait for the next six-hourly cycle, or install the push webhook
No Slack alertsWebhook URL is wrong, or the findings are below CRITICAL/HIGHRe-check the URL on the Repos tab; only CRITICAL and HIGH are alerted
Email alerts arrive lateEmail is a daily digest, not real-timeUse Slack if you need alerts within a minute
No fix PR for a fixable CVENot a requirements.txt pin, no known fix version, or one was already attemptedFix that pin by hand; each finding is only attempted once
A push does not trigger a scanPushed to a branch other than main/master, or the HMAC secret does not matchCheck GitHub's Recent Deliveries for the response body

Support

Source: pipelineguard-app (services), pipelineguard-gitops (Kubernetes manifests), pipelineguard-action (the CI action).