Security model¶
SDETKit is built to be safe to run on a repository it does not trust, and to never act for you:
- Review first. Nothing is applied, merged or dismissed by SDETKit. Every decision artifact records
automation_allowed,patch_application_allowed,merge_authorizedandsemantic_equivalence_provenasfalse. - Repository security gate (
sdetkit security): offline scanning for risky code and leaked secrets, with a regression baseline. - Guarded local servers:
sdetkit serveandsdetkit ops serveanswer only callers that hold their token. - CI regression checks on every pull request.
Threat model assumptions¶
- The repository may contain untrusted code changes from contributors and automation.
gate fastruns the repository's own tests and tools, so run it on code you would runpyteston, and use an isolated environment for code you do not trust.- CI and local execution stay offline-capable for the core checks.
- Preventing accidental secret leakage and high-risk patterns takes priority over broad heuristic noise.
- Security checks are deterministic, so baselines and diffs are reliable.
What SDETKit will and will not change¶
gate fast --fixand--fix-onlyare the only options that edit your files: they runruff check --fixandruff format.diagnose run --proveapplies a candidate fix only in a throwaway copy of the repository and proves it in a second copy; your working tree is never modified, anddiagnose decide --approverecords a decision without applying anything.sdetkit serveandsdetkit ops serveneed a bearer token on every request except the health check. They listen on127.0.0.1and refuse requests addressed to other host names. Listening on another interface needs--allow-remote. See the tool server.opsworkflows blockshell=truecommand steps unless the workflow's policy setsallow_shell, and keep file writes inside the artifacts directory unless it setsallow_artifact_escape.
Security gate policy behavior¶
python -m sdetkit security enforces red-flag policy for:
- dangerous execution APIs
- insecure deserialization and YAML loading
- weak hashes
- obvious path traversal / unsafe writes
- secret leakage patterns
- network calls without timeouts
- debug prints in
src/(except for an explicit allowlist of operational CLI modules)
Allowlists:
- inline:
# sdetkit: allow-security <RULE_ID> - repo file:
tools/security_allowlist.json - module-level debug print exceptions:
PRINT_ALLOWED_MODULE_SUFFIXESinsrc/sdetkit/gates/security_gate.py
Baseline regression gate:
- baseline file:
tools/security.baseline.json - checks fail only on new findings when baseline exists
- checks fail on all violations when baseline is missing
Verification¶
python -m sdetkit security check --baseline tools/security.baseline.json --format text
python -m sdetkit doctor --ascii