Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: Add landlock support #723

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

DRAFT: Add landlock support #723

wants to merge 2 commits into from

Conversation

valoq
Copy link
Contributor

@valoq valoq commented Oct 1, 2024

This PR adds landlock filesystem isolation to ouch as discussed in #722

At the moment this is just a quickly hacked implementation to demonstrate the use of landlock in ouch.
It restricts the entire filesystem to be read only and only permits write actions in the current working directory of the process.

In order to test the isolation feature, use the -d option to write the decompressed files to a path outside of $PWD
A final implementation would address the -d option as well to allow writing to specified output directories, but I left it untouched for now to allow an easy demonstration/test of the landlock feature.

Todo:

  • restrict write permissions to the .tmp-XXXXXX directory, including permissions for said directory to rename itself to the final name LANDLOCK_ACCESS_FS_MAKE_DIR (This should avoid writing to any control files in $HOME like .bashrc)
  • Identify all special cases that require permissions (see failed unit tests)

@valoq
Copy link
Contributor Author

valoq commented Oct 1, 2024

Note that the test failed due to the missing permissions.
This is expected for the current version but also indicates the missing cases to add permissions for before merging.

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.

1 participant