Re: self protect process with landlock to getting killed

Mickaël Salaün <[email protected]> Wed, 28 Jun 2023 19:38:19 +0200
Newsgroups dev.linux.lists.landlock
Message-ID <[email protected]>
On 28/06/2023 17:20, Jay Freyensee wrote:
> 
> 
>>
>>>
>>> What about is there a way to protect the directory the landlock process
>>> sits in from being tampered/written-to by a non-landlock process?
>>
>> The same principle applies: this is not possible with Landlock itself.
>> The potential malicious processes should be sandboxed.
>>
>>
> Thanks for the response Mickael.  In this case, this would kind of be
> like a zero-day use case, that we wouldn't know all the malicious
> processes tampering with that process's directory up-front, we just know
> that we wouldn't want any non-landlocked process (known and unknown)
> tampering with the directory the landlocked process sits in.

If you cannot sandbox the "other" processes, then I guess all/most 
processes are potentially malicious. In this case you're indeed looking 
to reverse the protection: restrict all/most processes from tampering 
with well-defined resources. You then need to rely on a system-wide 
access control that can be put in place with different UID/GID, or other 
LSMs: SELinux, AppArmor, Smack or Tomoyo.

Regards,
  Mickaël

> 
> Thanks,
> 
> Jay
> 
>