Skip to main content

Seccomp profile hardening score engine

Project description

seccompute

OCI Seccomp profile hardening score engine. CLI and python module that helps assess and score seccomp profiles for common flaws, bypasses, and general hardiness.

Install

pip install seccompute

Quickstart

seccompute - --grade << 'EOF'
{
  "defaultAction": "SCMP_ACT_ALLOW",
  "syscalls": [
    {
      "names": ["socket", "bind", "listen", "accept", "accept4", "connect",
                "sendto", "sendmsg", "sendmmsg", "recvfrom", "recvmsg", "recvmmsg"],
      "action": "SCMP_ACT_ERRNO",
    }
  ]
}
EOF

Grade A — tight profile with io_uring bypass risk:

Grade A output

Grade F — permissive profile with T1 syscalls exposed:

Grade F output

CLI reference

seccompute [profile] [options]

input / modes:
  profile           Path to seccomp profile (JSON or YAML), or - for stdin
  --arch ARCH       Target architecture (default: SCMP_ARCH_X86_64)
  --min-score N     Exit 2 if score is below N (for CI gates)
  --compare-docker  Compare profile against Docker/Moby default seccomp allowlist
  --rules DIR       Directory with custom rule files; missing files fall back to built-ins

output:
  --grade           Show letter-grade visualization (ANSI color)
  --format FORMAT   Output format: json (default) or text
  --json            Shorthand for --format json
  --verbose         Per-syscall details to stderr

Examples

CLI:

seccompute examples/example.json                                      # JSON output
seccompute examples/example.json --grade                              # letter-grade visualization
seccompute examples/profile3-network-blocked-iouring-bypass.yaml      # YAML profile

Python API:

from seccompute import score_profile

profile = {
    "defaultAction": "SCMP_ACT_ERRNO",
    "syscalls": [
        {"names": ["read", "write", "exit"], "action": "SCMP_ACT_ALLOW"}
    ]
}

result = score_profile(profile)
print(result.score)   # e.g. 98
print(result.grade)   # e.g. "A"

Multi-Dimensional Scoring and Combo Bypasses

Scoring model

Tier Examples Max deduction
T1 — critical bpf, ptrace, init_module 7+ pts each
T2 — high io_uring_*, perf_event_open 0.5 pts each
T3 — medium clone, chroot, mount 0.1–0.2 pts each

A profile exposing any T1 syscall receives a forced F regardless of total score. Combo findings (e.g. io_uring bypass chains) are reported separately and do not affect the numeric score.

Combo Bypass Detection

When a profile allows syscall combinations that bypass seccomp restrictions, seccompute reports attack chain details — the bypass path, bypassed syscalls, and CVE/technique references:

[HIGH] io_uring network bypass: io_uring_setup, io_uring_enter
       bypasses: accept, bind, connect, socket, send, recv, ...
       refs: TECHNIQUE-io-uring-escape, CVE-2023-2598, CVE-2024-0582

More Information

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

seccompute-3.0.2.tar.gz (36.5 kB view details)

Uploaded Source

Built Distribution

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

seccompute-3.0.2-py3-none-any.whl (34.9 kB view details)

Uploaded Python 3

File details

Details for the file seccompute-3.0.2.tar.gz.

File metadata

  • Download URL: seccompute-3.0.2.tar.gz
  • Upload date:
  • Size: 36.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for seccompute-3.0.2.tar.gz
Algorithm Hash digest
SHA256 4182c4f53ceb3f71641329797a8b752090e83c4681fa3c2f1c3d3783fad3cd42
MD5 d1e03700af2ae5b428af7b87f4a3c2ea
BLAKE2b-256 705f60782c338664fc11035fae67eba5024254aec9713a91d3d2265df70ab343

See more details on using hashes here.

Provenance

The following attestation bundles were made for seccompute-3.0.2.tar.gz:

Publisher: release.yml on antitree/seccompute

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file seccompute-3.0.2-py3-none-any.whl.

File metadata

  • Download URL: seccompute-3.0.2-py3-none-any.whl
  • Upload date:
  • Size: 34.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for seccompute-3.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c6dbc7f02ddcf70f74469a47243a6bdb0c3e9ed31f532785dd64356615e03145
MD5 019eadb89d7081499d94ecd962ee7b8d
BLAKE2b-256 931776c313893b033a05cfa5f6c1f447c9a9f9580b121500b29654fce7c65515

See more details on using hashes here.

Provenance

The following attestation bundles were made for seccompute-3.0.2-py3-none-any.whl:

Publisher: release.yml on antitree/seccompute

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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