Skip to main content

Security scanner for CI/CD pipeline definitions and Docker images.

Project description

PipelineGuard

Security scanner tool for CI/CD pipeline definitions and Docker images.
Supports GitLab CI, GitHub Actions, and Jenkinsfile out of the box.


Quick start

pip install pipelineguard          # or: pip install -e .[dev] for dev
pipelineguard scan .               # scan the current repo
pipelineguard scan .gitlab-ci.yml  # scan a single file
pipelineguard scan . --format json --output report.json

Rule categories

Prefix Category Examples
SEC Secrets hardcoded AWS keys, GitHub tokens, PEM blocks
DOC Docker unpinned images, privileged containers, curl|sh
PRM Permissions write-all scopes, sudo in CI
ISO Isolation mutable action refs, eval in scripts

CLI flags

pipelineguard scan PATH
  --format   console|json           Output format (default: console)
  --output   FILE                   Write JSON report to file
  --severity critical,high,...      Filter which severities to report
  --fail-on  LEVEL                  Exit 1 if ≥ LEVEL found (default: critical)
  --no-remediation                  Hide fix hints
  -v / --verbose                    Debug logging

pipelineguard list-rules            Show all registered rules

Adding a new rule

  1. Create (or add to) a file in pipelineguard/rules/.
  2. Subclass BaseRule and implement check(pipeline) -> list[Issue].
  3. Set rule_id, title, severity, category as class attributes.
  4. Done — the registry auto-discovers it.
from pipelineguard.rules.base_rule import BaseRule
from pipelineguard.models.issue import Issue, Severity, IssueCategory

class MyRule(BaseRule):
    rule_id  = "MY-001"
    title    = "Example custom rule"
    severity = Severity.MEDIUM

    def check(self, pipeline):
        issues = []
        for job in pipeline.jobs:
            if "bad-thing" in " ".join(job.all_commands()):
                issues.append(Issue(
                    rule_id=self.rule_id, title=self.title,
                    description="Found bad-thing.",
                    severity=self.severity,
                    category=IssueCategory.MISCONFIGURATION,
                    source_file=pipeline.source_file,
                    job_name=job.name,
                ))
        return issues

Running tests

pytest                         # all tests
pytest --cov=pipelineguard     # with coverage

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pipelineguard-0.1.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pipelineguard-0.1.0-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file pipelineguard-0.1.0.tar.gz.

File metadata

  • Download URL: pipelineguard-0.1.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pipelineguard-0.1.0.tar.gz
Algorithm Hash digest
SHA256 83cb7b2c2427d17ee3b50b0db06a3f2bf9ae33073561aca6e5ae820ae20d3747
MD5 ad85c16ba4cc9fbf599ebeed96f48aeb
BLAKE2b-256 981b7f469eb3c02d140ee992b5d641d2a2d281c5d1d5573421516cf2e2158c69

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipelineguard-0.1.0.tar.gz:

Publisher: ci.yml on Dali1998/pipelineguard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pipelineguard-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pipelineguard-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pipelineguard-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 76383e31d11576ff4ed892a129f9f47690da7fb360d0919ceb71bdee2260a2cb
MD5 87eed4e5b474adcfd1e110d16cde5a22
BLAKE2b-256 b1967111038f248fd4a861a3e23811d024be814a7b191f60424df0a9dd057b97

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipelineguard-0.1.0-py3-none-any.whl:

Publisher: ci.yml on Dali1998/pipelineguard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page