Skip to content

session-wrapper: add audit mode shadow evaluation and structured would-block findings #158

Description

@Rod-Persky

Parent epic: #152

session-wrapper: add audit mode shadow evaluation and structured would-block findings

Objective

Implement landlock-mode=audit as a rollout tool. Audit mode fetches and validates the TACACS+ profile, does not apply Landlock, and reports which intercepted execs would have been blocked by the profile.

Breaking changes are allowed. Audit mode is explicitly unsafe and must not be presented as a hard security boundary.

Required Behavior

In audit mode, session-wrapper should:

  • Fetch and parse the TACACS+ session profile exactly as enforce mode does.
  • Validate the profile and report validation problems as audit findings.
  • Continue starting the shell even when the profile would not be enforceable.
  • Do not install a Landlock ruleset.
  • Log clearly that no kernel Landlock boundary was applied.
  • Shadow-evaluate every intercepted execve/execveat path against the profile.
  • Emit structured findings for would-block execs.

Finding Fields

Each would-block finding should include, where available:

  • user
  • port
  • remote address
  • privilege level
  • requested path
  • argv
  • matched or missing profile rule
  • suggested landlock-exec or landlock-read addition where safe
  • effective UID/GID at exec time
  • original session principal

Findings may go to logs first. TACACS+ accounting or a local report sink can be added if it fits existing patterns.

Known Limitations

  • Audit mode can reliably report executable-path misses because seccomp already observes exec syscalls.
  • Audit mode cannot reliably discover every missing read/write dependency without enforcing Landlock or adding separate filesystem tracing.
  • Read/write tuning should happen through staged enforcement, targeted smoke tests, or a future tracing feature.

Acceptance Criteria

  • Audit mode fetches/parses/validates the same profile as enforce mode.
  • Audit mode starts the shell even when enforce mode would fail.
  • Audit mode logs that no kernel boundary was installed.
  • Intercepted /tmp/payload execution emits a would-block finding when /tmp is not executable in the profile.
  • Unit tests cover profile validation findings and exec shadow evaluation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions