-
Notifications
You must be signed in to change notification settings - Fork 1
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
Improve configuration of compatibility #3
Comments
Here is a new proposal replacing the current {
"ruleset": [
{
"handledAccessFs": [ "v6.all" ]
},
{
"handledAccessFs": [ "refer" ],
"cancelSandboxingIfAnyUnsupported": true
}
],
"pathBeneath": [
{
"allowedAccess": [ "execute", "read_file", "read_dir", "refer" ],
"parentFd": [ ".", "/usr", "/etc", "/proc", "/tmp" ],
"errorIfAnyUnusablePath": true
},
{
"allowedAccess": [ "write_file", "remove_dir", "remove_file", "make_char", "make_dir", "make_reg", "make_sock", "make_fifo", "make_block", "make_sym", "refer", "truncate" ],
"parentFd": [ "/tmp" ]
}
]
} With this first configuration:
"ruleset": [
{
"handledAccessFs": [ "v6.all" ]
}
],
"errorIfAnyUnsupported": true,
"pathBeneath": [
{
"allowedAccess": [ "v6.read_execute" ],
"parentFd": [ ".", "/usr", "/etc", "/proc", "/tmp" ]
},
{
"allowedAccess": [ "v6.read_write" ],
"parentFd": [ "/tmp" ]
}
] With this second configuration:
|
I might be missing something, but a potential issue I see is that these are three flags where two are generic, but one is specific to one part of landlock. Would this be more complicated then the current compat levels which are all generic? |
That's right, the two generic flags are
In some cases we might want to know if a file is missing, hence the specific
This proposal indeed brings narrower configuration bits. The current compat levels looks too generic and might be confusing. Soft and hard requirements are not clear enough: opencontainers/runtime-spec#1241 (comment) This new approach should be easier to understand and meet the requirements for tests and compatibility. |
This might be personal, but Also, If I'm getting the right meaning for all of this, it seems to me that all the flags are basically the same:
And
This would be a default policy that each rule can override with a "more local" policy like in the previous example. But if you want the behavior of having unchanged rules between prod and testing and have a single thing to set to enforce them all (like the global errorIfAnyUnsupported), maybe pathBeneath can also have a And maybe the value foe the policy can always be That wouldn't work if you want to differentiate errors of missing dirs vs missing paths in the pathBeneath section, but I think we can start with FailOnError and add FailOnMissingPath in the future, if needed. What do you think? |
For now, the configuration is close to the Rust library, but we need to make it simpler to use and easier to understand. See landlock-lsm/rust-landlock#58
The text was updated successfully, but these errors were encountered: