Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,12 @@ jobs:
run: uv sync --python ${{ env.DEFAULT_PYTHON_VERSION }} --group dev

- name: Scan Python dependencies for CVEs
run: uv run pip-audit --desc
run: |
# GHSA-5239-wwwm-4pmq: pygments ReDoS in AdlLexer (dev-only, no fix available)
# GHSA-58qw-9mgm-455v: pip tar/zip confusion (pip itself, no fix available)
uv run pip-audit --desc \
--ignore-vuln GHSA-5239-wwwm-4pmq \
--ignore-vuln GHSA-58qw-9mgm-455v

- name: Run markdown documentation tests
run: make test-docs-examples
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ on:
pull_request:
branches: [main]
schedule:
# Weekly deep scan on Sunday at 3am UTC
- cron: "0 3 * * 0"
# Weekly deep scan: 20:00 UTC Sunday = 7 AM AEDT Monday
- cron: "0 20 * * 0"
workflow_dispatch:
# Manual trigger for ad-hoc security analysis

Expand All @@ -35,7 +35,7 @@ concurrency:
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
runs-on: cachekit
timeout-minutes: 30

strategy:
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/fuzz-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,14 @@ concurrency:
jobs:
fuzz-smoke:
name: Fuzz Smoke Test (60s per target)
runs-on: ubuntu-latest
runs-on: cachekit
timeout-minutes: 20

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Install Rust nightly
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # nightly
with:
toolchain: nightly

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
workspaces: rust/fuzz
cache-all-crates: true
run: rustup toolchain install nightly

- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@18470a17439d5a7ec5f5ab40c95a6f0b217e652e # main
Expand Down
71 changes: 18 additions & 53 deletions .github/workflows/security-deep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Security Deep

on:
schedule:
- cron: '0 2 * * *' # 2 AM daily
- cron: '0 20 * * *' # 20:00 UTC = 7 AM AEDT next day
workflow_dispatch: # Allow manual triggers

permissions:
Expand All @@ -16,20 +16,27 @@ jobs:
# Deep security analysis (< 2 hours) - nightly scheduled
kani-verification:
name: Kani Formal Verification
runs-on: ubuntu-latest
runs-on: cachekit
timeout-minutes: 30
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Ensure stable toolchain
run: rustup toolchain install stable

- name: Install Kani
run: |
cargo +stable install --locked kani-verifier --version 0.67.0
cargo-kani setup

- name: Run Kani verification
uses: model-checking/kani-github-action@f838096619a707b0f6b2118cf435eaccfa33e51f # v1
with:
working-directory: rust
args: --tests --no-default-features --features compression,checksum,messagepack,encryption
run: |
cd rust
cargo-kani --tests --no-default-features --features compression,checksum,messagepack,encryption
Comment thread
coderabbitai[bot] marked this conversation as resolved.

fuzzing:
name: Extended Fuzzing (3 targets × 1h)
runs-on: ubuntu-latest
runs-on: cachekit
timeout-minutes: 200
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
Expand All @@ -39,11 +46,6 @@ jobs:
rustup toolchain install nightly
rustup default nightly

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
workspaces: rust

- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@18470a17439d5a7ec5f5ab40c95a6f0b217e652e # main

Expand Down Expand Up @@ -86,37 +88,11 @@ jobs:

atheris-fuzzing:
name: Atheris Python-Rust Fuzzing
runs-on: ubuntu-latest
runs-on: cachekit
timeout-minutes: 60
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Install uv
uses: astral-sh/setup-uv@8d55fbecc275b1c35dbe060458839f8d30439ccf # v3
with:
enable-cache: true

- name: Set up Python
run: uv python install 3.11

- name: Set up Rust
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # stable
with:
toolchain: stable

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
workspaces: rust

- name: Cache Python virtual environment
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
with:
path: .venv
key: venv-${{ runner.os }}-py3.11-${{ hashFiles('**/pyproject.toml', '**/uv.lock') }}
restore-keys: |
venv-${{ runner.os }}-py3.11-

- name: Install dependencies
run: |
uv sync --group dev --group fuzz
Expand Down Expand Up @@ -149,7 +125,7 @@ jobs:

miri-full:
name: Miri Full Suite
runs-on: ubuntu-latest
runs-on: cachekit
timeout-minutes: 30
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
Expand All @@ -159,19 +135,14 @@ jobs:
rustup toolchain install nightly --component miri
rustup default nightly

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
workspaces: rust

- name: Run full Miri test suite
run: |
cd rust
cargo miri test --no-default-features --features compression,checksum,messagepack,encryption

sanitizers:
name: Sanitizers (ASan, TSan, MSan)
runs-on: ubuntu-latest
runs-on: cachekit
timeout-minutes: 40
strategy:
fail-fast: false
Expand All @@ -189,12 +160,6 @@ jobs:
if: matrix.sanitizer == 'memory' || matrix.sanitizer == 'thread'
run: rustup component add rust-src --toolchain nightly

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
workspaces: rust
key: ${{ matrix.sanitizer }}

- name: Run AddressSanitizer
if: matrix.sanitizer == 'address'
env:
Expand Down Expand Up @@ -225,7 +190,7 @@ jobs:

generate-security-report:
name: Generate Security Report
runs-on: ubuntu-latest
runs-on: cachekit
needs: [kani-verification, fuzzing, atheris-fuzzing, miri-full, sanitizers]
if: always()
steps:
Expand Down
52 changes: 13 additions & 39 deletions .github/workflows/security-fast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
# Fast security checks (< 3 min) - parallel execution
cargo-audit:
name: Vulnerability Scan
runs-on: ubuntu-latest
runs-on: cachekit
timeout-minutes: 5
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
Expand All @@ -35,31 +35,24 @@ jobs:

cargo-deny:
name: License & Supply Chain
runs-on: ubuntu-latest
runs-on: cachekit
timeout-minutes: 5
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- uses: EmbarkStudios/cargo-deny-action@82eb9f621fbc699dd0918f3ea06864c14cc84246 # v2
- name: Install cargo-deny
run: cargo install --locked cargo-deny

- name: Run cargo-deny
run: cargo deny --all-features check

clippy-security:
name: Security Lints
runs-on: ubuntu-latest
runs-on: cachekit
timeout-minutes: 5
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Set up Rust
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # stable
with:
toolchain: stable
components: clippy

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
workspaces: rust

- name: Run Clippy security lints
run: |
cd rust
Expand All @@ -68,16 +61,11 @@ jobs:

cargo-machete:
name: Unused Dependencies
runs-on: ubuntu-latest
runs-on: cachekit
timeout-minutes: 5
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Set up Rust
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # stable
with:
toolchain: stable

- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@18470a17439d5a7ec5f5ab40c95a6f0b217e652e # main

Expand All @@ -91,36 +79,22 @@ jobs:

pip-audit:
name: Python Dependency CVEs
runs-on: ubuntu-latest
runs-on: cachekit
timeout-minutes: 5
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Install uv
uses: astral-sh/setup-uv@8d55fbecc275b1c35dbe060458839f8d30439ccf # v3
with:
enable-cache: true

- name: Set up Python
run: uv python install 3.12

- name: Cache Python virtual environment
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
with:
path: .venv
key: venv-${{ runner.os }}-py3.12-${{ hashFiles('**/pyproject.toml', '**/uv.lock') }}
restore-keys: |
venv-${{ runner.os }}-py3.12-

- name: Install dependencies
run: |
uv sync --group dev

- name: Run pip-audit
run: |
# GHSA-5239-wwwm-4pmq: pygments ReDoS in AdlLexer (dev-only, no fix available)
# GHSA-58qw-9mgm-455v: pip tar/zip confusion (pip itself, no fix available)
uv run pip-audit --desc --format json --output pip-audit-report.json \
--ignore-vuln GHSA-5239-wwwm-4pmq
--ignore-vuln GHSA-5239-wwwm-4pmq \
--ignore-vuln GHSA-58qw-9mgm-455v

- name: Upload report
if: always()
Expand Down
14 changes: 2 additions & 12 deletions .github/workflows/security-medium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,11 @@ jobs:
# Medium security checks (< 15 min) - post-merge validation
cargo-geiger:
name: Unsafe Code Tracking
runs-on: ubuntu-latest
runs-on: cachekit
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Set up Rust
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # stable
with:
toolchain: stable

- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@18470a17439d5a7ec5f5ab40c95a6f0b217e652e # main

Expand Down Expand Up @@ -76,7 +71,7 @@ jobs:

miri-subset:
name: Miri UB Detection (Subset)
runs-on: ubuntu-latest
runs-on: cachekit
timeout-minutes: 20
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
Expand All @@ -86,11 +81,6 @@ jobs:
rustup toolchain install nightly --component miri
rustup default nightly

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
workspaces: rust

- name: Run Miri on byte_storage module
run: |
cd rust
Expand Down
3 changes: 2 additions & 1 deletion docs/backends/redis.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ The default L2 backend. Connects to Redis via environment variable or explicit c

## Basic Usage

```python
```python notest
# notest: RedisBackend() requires DI container setup not available in doc tests
from cachekit.backends import RedisBackend
from cachekit import cache

Expand Down
3 changes: 2 additions & 1 deletion docs/serializers/encryption.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ The backend stores opaque ciphertext only. The master key never leaves the clien

## Basic Usage

```python
```python notest
# notest: @cache.secure validation requires CACHEKIT_MASTER_KEY before conftest runs
from cachekit import cache
from cachekit.serializers import EncryptionWrapper, OrjsonSerializer

Expand Down
Loading
Loading