G12 — security-hardening drift surface + preset¶
Registry: UC-WF-security-hardening (complete)
Effort: M · Risk: low
Problem¶
The "did this release silently weaken hardening?" usage model is now covered for ELF. abicheck captures and diffs the checksec-style surface and ships a security policy preset so hardening drift can be gated without hand-authoring YAML. This plan records the implementation history; the original gaps were:
- Discoverability — there is no built-in
securityseverity preset or shipped policy, so gating requires hand-authoring YAML and knowing the kind slugs. - Thin captured surface —
elfcarries onlyhas_executable_stack+rpath/runpath. Not captured: RELRO / BIND_NOW (full/partial/none), PIE, stack-canary, FORTIFY_SOURCE, writable+executable segments. The most common checksec-style regressions (full-RELRO → partial, PIE dropped) are invisible because the property was never recorded.
Goal & acceptance criteria¶
- [x] ELF snapshot captures RELRO, BIND_NOW, PIE, stack-canary, FORTIFY, and
W^X segment presence (a
checksec-equivalent block). - [x] New
RISKChangeKinds for the meaningful regressions (e.g.relro_weakened,pie_disabled) added per the rootCLAUDE.mdprocedure. - [x] A shipped
policies/security.yamland/or--severity-preset securitymakes hardening gating turnkey. - [x] A release that weakens a hardening property fails under the security preset; an unchanged one passes.
Design¶
- Extend
abicheck/elf_metadata.pyto read the dynamic section / program headers / symbols for the checksec properties. - Add the diff rules in
abicheck/diff_platform.pyand the new kinds inchecker_policy.py(keep themRISKby default, gateable tobreak). - Ship
policies/security.yamlmapping the hardening kinds tobreak/warn.
Files & surfaces¶
abicheck/elf_metadata.py,abicheck/diff_platform.py,abicheck/checker_policy.py, a newpolicies/security.yaml, severity preset wiring inabicheck/severity.py.
Tests¶
- Unit: two
.sos differing only in RELRO/PIE → expected kind + gated verdict. - Extend
tests/test_diff_platform_deep.pycoverage of the new properties.
Out of scope¶
Non-ELF hardening (PE /GS, /DYNAMICBASE; macOS hardened runtime) — once the
ELF mechanism exists.