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.0.0.tar.gz (24.4 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.0.0-py3-none-any.whl (25.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for codepathfinder-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a04c7801a4ff001b5234b5a9d95ccece5f71d0d55a1af5e1c44405c98b38c912
MD5 342b38dd3ed609f820a190f950cc5047
BLAKE2b-256 63ccf63b9bc1dd53a13813520b45d1deeebfbec8aee19d397999219ead95ebe6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: codepathfinder-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 25.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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f45fb8a231dc55fd953398cf29d4ec9308ab02af371932bc300cf065db66050
MD5 ac74e23924fb7e4ae14d0032943ede53
BLAKE2b-256 fee95c49239349764ace679245de6de2e92acb15ab5f7fc256be5f21a651090e

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