Skip to content

fix(sandbox): emit warning when Landlock filesystem sandbox degrades silently#599

Open
johntmyers wants to merge 2 commits intomainfrom
fix/landlock-silent-degradation-warning
Open

fix(sandbox): emit warning when Landlock filesystem sandbox degrades silently#599
johntmyers wants to merge 2 commits intomainfrom
fix/landlock-silent-degradation-warning

Conversation

@johntmyers
Copy link
Collaborator

Summary

  • Upgrade Landlock degradation log from debug! to warn! so operators running at default log levels are alerted when the filesystem sandbox is bypassed
  • Add info!-level startup log showing the requested ABI, compatibility mode, and path counts so operators always know what Landlock protections are active

Related Issue

Closes #584

Changes

crates/openshell-sandbox/src/sandbox/linux/landlock.rs

  1. debug!warn! on Landlock failure (line 82-86): When BestEffort mode swallows a Landlock error, the operator now sees a warn!-level message with an actionable hint to set hard_requirement if they want this to be fatal. Previously this was debug! — invisible at production log levels.

  2. info! log at sandbox apply (lines 33-39): Logs the requested ABI version, compatibility mode, and number of read-only/read-write paths before applying Landlock rules. This gives operators a clear signal of what protections are being applied on every sandbox start.

Both changes align Landlock's observability with the existing pattern in netns.rs, which already uses warn! for similar degradation scenarios.

Testing

  • cargo check -p openshell-sandbox — passes
  • cargo clippy -p openshell-sandbox — no new warnings
  • mise run pre-commit — passes (license check failure is pre-existing on architecture/plans/ files, unrelated)

Checklist

  • Conventional commit format
  • Pre-commit checks pass
  • No secrets or credentials committed
  • Changes scoped to the issue at hand

…silently

BestEffort Landlock previously swallowed failures at debug level, making
sandbox bypass invisible to operators at default log levels. Upgrade the
degradation log to warn with an actionable message pointing to the
hard_requirement setting. Add info-level startup log showing the
requested ABI and path counts so operators always know what Landlock
protections are active.

Closes #584
pimlock
pimlock previously approved these changes Mar 25, 2026
Signed-off-by: John Myers <johntmyers@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sec(sandbox): BestEffort Landlock silently degrades to no filesystem sandbox

2 participants