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

This installs both the Python DSL and the pathfinder CLI binary for your platform.

Verify Installation

# Test CLI binary
pathfinder --version

# Test Python DSL
python -c "from codepathfinder import rule, calls; print('DSL OK')"

Supported Platforms

  • Linux (glibc): x86_64, aarch64
  • macOS: arm64 (Apple Silicon), x86_64 (Intel)
  • Windows: x86_64

Source distributions are available for other platforms - the binary will be downloaded automatically on first use.

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.5.tar.gz (34.4 kB view details)

Uploaded Source

Built Distributions

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

codepathfinder-1.1.5-py3-none-win_amd64.whl (3.7 MB view details)

Uploaded Python 3Windows x86-64

codepathfinder-1.1.5-py3-none-manylinux_2_17_x86_64.whl (3.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

codepathfinder-1.1.5-py3-none-manylinux_2_17_aarch64.whl (3.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

codepathfinder-1.1.5-py3-none-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

codepathfinder-1.1.5-py3-none-macosx_10_9_x86_64.whl (3.6 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: codepathfinder-1.1.5.tar.gz
  • Upload date:
  • Size: 34.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for codepathfinder-1.1.5.tar.gz
Algorithm Hash digest
SHA256 67a7ab5028c2728bb2a53b341d8f4e5b32646f799fcb232e8d25eaf38e5cea5e
MD5 8ddcfda8831203a80a8d1ab1e881cc54
BLAKE2b-256 422b820c3cbe0c18c4440848eb750408d8c4cb87fc8968d89809f96c4901177d

See more details on using hashes here.

File details

Details for the file codepathfinder-1.1.5-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for codepathfinder-1.1.5-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 d9dd69ca7aaffa6e719b87b4896a117f4ce27b3f15853c459fceb6e1db10320b
MD5 93e341f94527f350869d11a7158508b0
BLAKE2b-256 ebffe4dfedc867b663afc49b65b29d042b38677bce7ee365f802a1a71c87b8a2

See more details on using hashes here.

File details

Details for the file codepathfinder-1.1.5-py3-none-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for codepathfinder-1.1.5-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 93c1972bdf69b53eb1134c445fd586da6e12f8ccaff2acbb6400d3afae93534d
MD5 38960af12d6c5ba0b91d13e1a707e010
BLAKE2b-256 0218b3b3310752fbe13673b1d457bec8363977e54a938dcf9658db5b9ed4ca12

See more details on using hashes here.

File details

Details for the file codepathfinder-1.1.5-py3-none-manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for codepathfinder-1.1.5-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 000900c409c766dfa34777ddbfc0c0c3ae45a3d2b6c635dddb3280092967ef8a
MD5 edf129405a9b47deae76b88ec55eb6d6
BLAKE2b-256 a9d4f19fc84762db0e0544a50800fdd3186102581f37f64754db1eeb7c2eff44

See more details on using hashes here.

File details

Details for the file codepathfinder-1.1.5-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for codepathfinder-1.1.5-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6f0b624287067a387522a1966fe89be019514b9ff51537c5a66951c3ec0bc275
MD5 19de7379db4e6d7a0688792dc59ceeca
BLAKE2b-256 deafde822de9a5569d138773612562fbd30bb3a3421e2db174423ec215e0d005

See more details on using hashes here.

File details

Details for the file codepathfinder-1.1.5-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for codepathfinder-1.1.5-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b80facc948d9177051d68fbf024b5934857974bed6aee2e484a412dc6cc5e537
MD5 6b1cadeec000a4e92122c2b48c45a58c
BLAKE2b-256 61ae4184feb5536283333c4c6410607ba97cebf53a555057f6c5114c09c4c1fe

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