Skip to main content

No project description provided

Project description

sastastic

Ingests Semgrep SAST output (JSON) and creates Jira tickets for each finding. Designed to run in CI on every push — duplicate findings are automatically skipped and tickets for resolved findings are closed.

Requirements

  • Python 3.8+
  • A sast.json file in the working directory (Semgrep JSON output)
  • Jira API credentials set as environment variables

Installation

pip install sastastic

Environment Variables

Variable Description
JIRA_KEY Jira API token
JIRA_URL Jira REST API issue endpoint (e.g. https://your-org.atlassian.net/rest/api/3/issue)
JIRA_EMAIL Email address associated with the API token
JIRA_PROJECT Jira project key (e.g. SEC)

Variables can be set in the environment or in a .env file in the working directory.

Usage

sastastic — Create Jira tickets (CI/CD)

sastastic "app-name" "PARENT-TICKET"
  • app-name — label for the application being scanned (used in ticket summaries)
  • PARENT-TICKET — Jira issue key to attach findings to as subtasks (e.g. SEC-42)

Idempotent by design: each finding is fingerprinted and stored as a Jira label (sastastic-<fingerprint>). On subsequent runs:

  • Findings with an existing open ticket are skipped
  • Tickets whose finding no longer appears in the scan are automatically transitioned to Done

sastestic — Dry-run preview (local development)

Preview what tickets would be created without touching Jira.

sastestic [w] [--check-jira]

Flags:

Flag Description
(none) Parse sast.json and display all findings, sorted by severity
w Read sast.json as UTF-16 (required on some Windows environments)
--check-jira Connect to Jira and mark each finding as [NEW] or [EXISTS: KEY]

Example output (no flags):

Issue 1: [HIGH] CWE-89: SQL Injection
  Rule:    python.django.security.injection.tainted-sql-string
  File:    app/views.py line(s) 42-44
  Details: Detected user input used directly in a SQL query.

Issue 2: [MEDIUM] CWE-79: Cross-Site Scripting
  Rule:    javascript.react.security.audit.react-dangerouslysetinnerhtml
  File:    src/components/Comment.jsx line(s) 17-17
  Details: dangerouslySetInnerHTML usage detected.

Total: 2 findings: 1 HIGH, 1 MEDIUM

Example output (--check-jira):

Checking Jira for existing tickets...

Issue 1: [HIGH] CWE-89: SQL Injection  [EXISTS: SEC-101]
  Rule:    python.django.security.injection.tainted-sql-string
  File:    app/views.py line(s) 42-44
  Details: Detected user input used directly in a SQL query.

Issue 2: [MEDIUM] CWE-79: Cross-Site Scripting  [NEW]
  Rule:    javascript.react.security.audit.react-dangerouslysetinnerhtml
  File:    src/components/Comment.jsx line(s) 17-17
  Details: dangerouslySetInnerHTML usage detected.

Total: 2 findings: 1 HIGH, 1 MEDIUM
  Would create: 1 new ticket

Generating sast.json

Run Semgrep with JSON output and save to sast.json in your project root:

semgrep --config auto --json -o sast.json .

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

sastastic-1.2.0.tar.gz (44.4 kB view details)

Uploaded Source

Built Distribution

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

sastastic-1.2.0-py3-none-any.whl (32.1 kB view details)

Uploaded Python 3

File details

Details for the file sastastic-1.2.0.tar.gz.

File metadata

  • Download URL: sastastic-1.2.0.tar.gz
  • Upload date:
  • Size: 44.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for sastastic-1.2.0.tar.gz
Algorithm Hash digest
SHA256 e8c2ccf8f7997f018d9653c729ce4814a02546384b1aea06fcbcccb25bc03b45
MD5 e95e1117b2f677ea0612604cce177450
BLAKE2b-256 158007ecf63722969f399406dcd09dfda1b1b807304ed2d364cca78b101ce052

See more details on using hashes here.

File details

Details for the file sastastic-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: sastastic-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 32.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for sastastic-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f7229e2cf5b10fef62bae4023ccb90e47b283262760a824d39b5ed4804a4227
MD5 8a14f6da3b34c3dab37aa0ba2e1d95c3
BLAKE2b-256 72e03bff3b28453ab3fda92c08c02ecc92065410f6a959a576ed6bb3c82adfd8

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