Skip to main content

Python DSL for code-pathfinder security patterns

Project description

Code-Pathfinder Python DSL

Python DSL for defining security patterns in Code Pathfinder - an open-source security suite combining structural code analysis with AI-powered vulnerability detection.

Project Goals:

  • Real-time IDE integration bringing security insights directly into your editor
  • AI-assisted analysis leveraging LLMs to understand context and identify vulnerabilities
  • Unified workflow coverage from local development to CI/CD pipelines
  • Flexible reporting supporting DefectDojo, GitHub Advanced Security, SARIF, and other platforms

Documentation: https://codepathfinder.dev/

Installation

pip install codepathfinder

Quick Example

from codepathfinder import rule, flows, calls
from codepathfinder.presets import PropagationPresets

@rule(id="sql-injection", severity="critical", cwe="CWE-89")
def detect_sql_injection():
    """Detects SQL injection vulnerabilities"""
    return flows(
        from_sources=calls("request.GET", "request.POST"),
        to_sinks=calls("execute", "executemany"),
        sanitized_by=calls("quote_sql"),
        propagates_through=PropagationPresets.standard(),
        scope="global"
    )

Features

  • Matchers: calls(), variable() for pattern matching
  • Dataflow Analysis: flows() for source-to-sink taint tracking
  • Propagation: Explicit propagation primitives (assignment, function args, returns)
  • Logic Operators: And(), Or(), Not() for complex rules
  • JSON IR: Serializes to JSON for Go executor integration

Documentation

For detailed documentation, visit https://codepathfinder.dev/

Requirements

  • Python 3.8+
  • No external dependencies (stdlib only!)

License

AGPL-3.0 - GNU Affero General Public License v3

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

codepathfinder-1.1.0.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

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

codepathfinder-1.1.0-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

File details

Details for the file codepathfinder-1.1.0.tar.gz.

File metadata

  • Download URL: codepathfinder-1.1.0.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for codepathfinder-1.1.0.tar.gz
Algorithm Hash digest
SHA256 1dd46b5e0dea5ff9518fe6ccab6b0a577fcd919c732eda48b6342131e41d0a6d
MD5 d23ac2050edee6a63a62ff8f96a6d605
BLAKE2b-256 15017bc2575f748c2b1671480806207b11de880766f53eb1b6b6ee07691dd821

See more details on using hashes here.

File details

Details for the file codepathfinder-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: codepathfinder-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for codepathfinder-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be9b9f359500bf35eeccdea5d377af29c8d6d80ddfd40095b25fdc90b93e83a6
MD5 f1264d832612d538a1d841718c544849
BLAKE2b-256 58071571c8608c94d251d4e9a244a47d180c438c2b82ea948da19cda515f5e0a

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