Skip to main content

CodeSecure CI/CD Templates and Integration

Project description

CodeSecure CI/CD Integrations (codesecure-cicd)

The codesecure-cicd package provides automated security scanning integration for CI/CD pipelines with quality gates, PR decoration, baseline comparison, and security scoring.

๐ŸŽฏ Headless Runner & Docker

CodeSecure CI/CD is primarily distributed as a production-grade Docker image. This multi-stage image bundles all 9 security scanners and the CodeSecure platform into a single, self-contained environment.

  • Registry: gcr.io/codesecure-479807/codesecure
  • Scanners Included: Semgrep, Bandit, Checkov, Detect-Secrets, Syft (SBOM), npm-audit, pip-audit, pip-licenses, and Grype (SCA).

๐Ÿ”’ Licensing & Beta Access

CodeSecure CI/CD is currently in Beta and is free to use.

  • Beta Mode: No token required. Free access to all scanning features.
  • Post-Beta: A valid CODESECURE_TOKEN will be required for licensed use.
  • Enterprise: Custom on-premise deployments or air-gapped images available.

๐Ÿ“ฆ Installation & Usage

๐Ÿ‹ Docker (Recommended)

This is the fastest and most reliable way to run scans in CI/CD without managing dependencies.

docker run --rm -v $(pwd):/workspace \
  -e GOOGLE_API_KEY=${GOOGLE_API_KEY} \
  gcr.io/codesecure-479807/codesecure:1.0.23 \
  scan /workspace --format sarif,html --output reports

๐Ÿ Python (Development)

uv pip install codesecure-cicd

๐Ÿ”Œ Pipeline Templates

Integration Template Deployment Method
GitHub Actions templates/github-action.yml Docker Container (ghcr.io/gcr.io)
GitLab CI templates/gitlab-ci.yml Docker Image (gcr.io)
Azure Pipelines templates/azure-pipelines.yml Docker Container (gcr.io)
GitHub Public templates/github/codesecure-public.yml Docker Container
GitHub Private templates/github/codesecure-private.yml Docker Container

๐Ÿ› ๏ธ Quick Start (GitHub Actions)

jobs:
  scan:
    runs-on: ubuntu-latest
    container:
      image: gcr.io/codesecure-479807/codesecure:1.0.23
      env:
        CODESECURE_TOKEN: ${{ secrets.CODESECURE_TOKEN }}
    steps:
      - uses: actions/checkout@v4
      - run: codesecure scan . --fail-on critical,high

๐Ÿง  AI Enriched Reports: CodeSecure natively injects AI Findings directly into SARIF and Markdown exports. False positives are tagged in the properties bag to prevent alert fatigue, and AI Remediation steps are embedded in the markdown field to render seamlessly in the GitHub PR/GitLab MR interfaces!

โš™๏ธ Configuration

Place .codesecure.yml at your repository root:

scanners:
  enabled: [semgrep, bandit, checkov, detect-secrets, pip-audit]

quality_gate:
  fail_on: [critical, high]
  max_total: 50
  new_only: true
  baseline: .codesecure-baseline.json
  min_score: B

ai:
  enabled: true
  provider: google
  fp_detection: true
  remediation: true

reports:
  formats: [sarif, html, json, markdown]

๐Ÿ“ Package Structure

packages/cicd/
โ”œโ”€โ”€ src/codesecure_cicd/
โ”‚   โ”œโ”€โ”€ __init__.py          # Package exports
โ”‚   โ”œโ”€โ”€ quality_gate.py      # Quality gate evaluation
โ”‚   โ”œโ”€โ”€ baseline.py          # Baseline comparison engine
โ”‚   โ”œโ”€โ”€ security_score.py    # Aโ€“F score calculator
โ”‚   โ”œโ”€โ”€ pr_decorator.py      # PR comment generator
โ”‚   โ”œโ”€โ”€ license_gate.py      # Beta/Licensed mode gate
โ”‚   โ””โ”€โ”€ runner.py            # Headless CI runner
โ”œโ”€โ”€ templates/
โ”‚   โ”œโ”€โ”€ github-action.yml    # Advanced GitHub workflow
โ”‚   โ”œโ”€โ”€ gitlab-ci.yml        # GitLab CI pipeline
โ”‚   โ”œโ”€โ”€ azure-pipelines.yml  # Azure DevOps pipeline
โ”‚   โ””โ”€โ”€ github/
โ”‚       โ”œโ”€โ”€ codesecure-public.yml
โ”‚       โ””โ”€โ”€ codesecure-private.yml
โ”œโ”€โ”€ Dockerfile               # Production multi-stage build
โ”œโ”€โ”€ entrypoint.sh            # License check + CLI bridge
โ”œโ”€โ”€ pyproject.toml
โ””โ”€โ”€ README.md

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

codesecure_cicd-1.0.29-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file codesecure_cicd-1.0.29-py3-none-any.whl.

File metadata

File hashes

Hashes for codesecure_cicd-1.0.29-py3-none-any.whl
Algorithm Hash digest
SHA256 68add634c89e9132f4482ca81b00053b519fdeb0b069533fa99a9edf2d0789e1
MD5 8befaf1133f9156afb6635af3c7834ca
BLAKE2b-256 94ba65c2a309ea2f31ed14a5a20b47d85841b08f79940650dbe1cf0fc7416920

See more details on using hashes here.

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