Skip to main content

Python adapter for the CDD Security Framework (Ratel Core)

Project description

CDD Framework - Python Adapter

Official Python adapter for the CDD (Cyberattack-Driven Development) framework. Effortlessly audit your application's security posture using our high-performance native Rust core.

The Cloud Detection & Defense (CDD) Python adapter allows you to integrate automated security audits into your Python projects.

It wraps the high-performance Ratel Core (Rust) into a developer-friendly Python package.

Installation

Install the adapter via pip (ensure you have access to your private/public registry):

pip install cdd-python

How it Works

This adapter follows the "Binary Pivot" architecture:

Zero-Config Extraction: At runtime, the library detects your OS (Windows, Linux, macOS) and extracts the embedded ratel binary to ~/.ratel/bin/.

Pythonic Standards: It automatically detects Python project structures (presence of requirements.txt or pyproject.toml) to place security scenarios in tests/security/.

Process Isolation: The audit runs as a native subprocess, keeping your Python environment fast and clean.

Usage

1. Initialization

Run this once to bootstrap your project with an expert security scenario.

Python

import cdd

# Generates tests/security/security.ratel
cdd.init() 

2. Configuration (Ratel DSL)

The security logic is defined in the .ratel file. This allows you to update security rules without touching your Python code.

File: tests/security/security.ratel

Code snippet

SCENARIO "Python API Security Audit"
TARGET "http://localhost:8000"

WITH SCOPE KERNEL
WITH SCOPE TERRITORY

IGNORE "FAVICON_FINGERPRINT"

3. Execution

Integrate the audit into your development workflow or CI/CD scripts.

import cdd

if __name__ == "__main__":
    print("Starting Security Audit...")
    
    # Executes the embedded Ratel binary using the .ratel file
    cdd.run()

Integration with Pytest

You can easily wrap the audit in a pytest suite:

def test_security_compliance():
    import cdd
    # CDD will raise a CalledProcessError if the audit fails
    cdd.run()

Part of the CDD-Framework organization.

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

cdd_python-0.5.0a2.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

cdd_python-0.5.0a2-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file cdd_python-0.5.0a2.tar.gz.

File metadata

  • Download URL: cdd_python-0.5.0a2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for cdd_python-0.5.0a2.tar.gz
Algorithm Hash digest
SHA256 fcfa2eec586123ff9d17d01f65ac80f5ce44cdcc6fe846644ce96f5870d775bf
MD5 c2f850954426ccf7dab2d86ad6b8aa0c
BLAKE2b-256 6b2d64bbf7016f7c6a8dc9c10959b456aa728d17b30cb44493f1a10cfa771cc5

See more details on using hashes here.

File details

Details for the file cdd_python-0.5.0a2-py3-none-any.whl.

File metadata

  • Download URL: cdd_python-0.5.0a2-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for cdd_python-0.5.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 a30ec83ba29e7971d0c0a87d3057e6d339c7a3fb52ae89c387e5cf2cffb5dfc1
MD5 3d1e8e1034bd1a3a69b1c1ac1e52ee4e
BLAKE2b-256 157835221953ef1c7ddd1a0c29112520c07754624abe75f8dc23701c8d57d2be

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