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.1.tar.gz (30.9 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.1-py3-none-any.whl (34.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: codepathfinder-1.1.1.tar.gz
  • Upload date:
  • Size: 30.9 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.1.tar.gz
Algorithm Hash digest
SHA256 86e3bf6d34255abfef3c760a89fb5ee12f16e5cc9cad09404cda5f024052c06c
MD5 f9fe325bcd8f431e1a27a1d892970a7f
BLAKE2b-256 70d892e80b8cd7212e7f1cf143233db49958d6fc7602159f3cec328a7f5339ed

See more details on using hashes here.

File details

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

File metadata

  • Download URL: codepathfinder-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 34.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fdd37da369fb9612558ed3779ed4a2b4f50a740a58fdae7a0f1265af263dcc9c
MD5 ad6b13ae94d71a0a4ba4d53a6641dde5
BLAKE2b-256 0fa5c8d37a5ac619e2b8d234913067418a105bcce4622da03f141d3f39263bbd

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