Skip to content

[Feature] Better detection of LSM availability errors and proper fallback #230

Description

@aerosouund

What problem does this solve?

We currently detect BPF availability in the project through seeing if there is a bpf entry in /sys/kernel/security/lsm. But that file may have a false entry, or may not be mounted on that path. Resulting in a state where LSM may be present but undetected or falsely announced as available. We currently fallback to fmod_ret for all of those cases. A better strategy to detect this would be to actually try to load and attach LSM programs during init, and if they fail only do we fallback to trying fmod_ret which may also fail. In that case open/exec enforcement becomes truly unavailable and this should be announced to the user

Proposed change

See the fallback review discussion

Alternatives considered

No response.

Additional context

No response.

Delivery planning

Outcome: Trust protection. Priority: P1.

Attempt actual BPF-LSM load/attach, clean up failed partial state, then try fmod_ret. Test missing securityfs, load failure, attach failure, fallback success, and both paths unavailable. Record the selected hook and failure reasons per affected policy/node. Coordinate status with #188; behavior checks belong in #191.

Follow the repository build/test, kind behavior, documentation and redaction requirements. Acceptance must distinguish prevention from observation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or requestpriority/P1High: correctness, security or truth gap

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions