From: peter enderborg <peter.enderborg@sony.com>
To: Paul Moore <paul@paul-moore.com>
Cc: <linux-kernel@vger.kernel.org>,
SElinux list <selinux@vger.kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Stephen Smalley <stephen.smalley.work@gmail.com>
Subject: Re: [RFC PATCH] selinux: Add denied trace with permssion filter
Date: Tue, 1 Sep 2020 19:18:46 +0200 [thread overview]
Message-ID: <aa37c79f-d908-0a75-4916-6aaa21426212@sony.com> (raw)
In-Reply-To: <CAHC9VhQiPTEarUWWA1RH8AsymhRpAa7kWTmmefTAqfouts8WGw@mail.gmail.com>
On 9/1/20 5:31 PM, Paul Moore wrote:
> On Mon, Aug 31, 2020 at 11:34 AM peter enderborg wrote:
>> On 8/31/20 4:16 PM, Paul Moore wrote:
>>> On Thu, Aug 27, 2020 at 10:04 AM peter enderborg wrote:
> ...
>
>>>> Im happly fine with replacing the selinux_audited with selinux_denied. However it is the case where there are more than one denial at the same time. Im not sure how and when it might happen.
>>> One thing I wondered about was why not build up a single string with
>>> all of the permissions instead of generating multiple trace events?
>>> In the previous discussion it was implied that this was due to
>>> limitations in the tracing subsystem's filtering, and based on the
>>> discussion thus far I'm guessing there is little desire for this
>>> information if it can't be filtered on?
>> The information is of course as essential as for audit messages.
>> I dont see much of the problem with having as the first suggestion with
>> a list. It works fine for trace_pipe. It is not failing due to that we can not
>> filter with that.
> I don't really have much personal experience with the kernel tracing
> tools, so an example would be helpful as I'm not really following what
> you are saying. Are you talking about something like
> "permission=foo,bar,baz"?
In the first patch we hade premission that was in the format:
permission={read !write open}
That would have work fine if it was not for that the permission can be created
dynamically. It would be very easy to change that to
permission=read permission=!write permission=open
But I think that will cause problems too. The create a format specifiaction
in the trace tree, and I dont think we can describe this format.
>
>> It is cause in other tools in user-space
>> that needs a plugin to parse it. It need static
>> mapping for something that is not really static. Not in runtime, and it will
>> change over time.
> I think we've all come to the conclusion that doing the permission
> bitmap-to-string translation in a plugin is not really desirable.
Yes. But Im arguing that we still have the same information,
but it will "cost" that we have more events. It is a fair trade-off,
it is usually a lot better to have the trace simple than
flexible and let it cost events when needed.
>> A other idea based on the first one is to have multiple pairs like
>>
>> class=file permission=read permission=write permission=open
>>
>> but then you need to filter on numeric values that are not static and
>> I don't know if library can make anything useful from that.
> Oh, wait, is the issue that the tracing subsystem can't filter on
> strings? That doesn't seem right, but I can understand why one might
> want to avoid that for performance reasons. If the tracing subsystem
> *can* filter on strings, why did you say that in the "perm=foo
> perm=bar" format one would need to filter on numeric values? I still
> think I'm missing something here ...
>
No. It can filter on strings. But it can not do any fuzzy matching.
They are equal not not equal. So if you have a parameter value
that is { open read !write } you need to specify a exact match.
With multiple events you match for "open" or "write" not "{ open read !write }".
So you get one event for "open" and a other event for "write".
The numeric values is not matching perm=, it is a match for the
bits in the denied= parameter that is present within selinux_audited event.
next prev parent reply other threads:[~2020-09-01 17:19 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-17 17:07 [PATCH v3 0/3] selinux: add detailed tracepoint on audited events Thiébaud Weksteen
2020-08-17 17:07 ` [PATCH v3 1/3] selinux: add " Thiébaud Weksteen
2020-08-18 14:31 ` Stephen Smalley
2020-08-17 17:07 ` [PATCH v3 2/3] selinux: add basic filtering for audit trace events Thiébaud Weksteen
2020-08-18 14:36 ` Stephen Smalley
2020-08-17 17:07 ` [PATCH v3 3/3] selinux: add permission names to trace event Thiébaud Weksteen
2020-08-17 20:13 ` Stephen Smalley
2020-08-17 20:29 ` Steven Rostedt
2020-08-18 16:09 ` Steven Rostedt
2020-08-19 13:11 ` Stephen Smalley
2020-08-21 2:31 ` Steven Rostedt
2020-08-21 12:29 ` Stephen Smalley
2020-08-21 13:19 ` Paul Moore
2020-08-21 13:39 ` peter enderborg
[not found] ` <CA+zpnLfNjDwxgoG2p3W8YfXxYVQDum4Eh_MJQvKP4rGLqsqACA@mail.gmail.com>
2020-08-21 13:46 ` Paul Moore
2020-08-17 20:16 ` Stephen Smalley
2020-08-18 8:11 ` peter enderborg
2020-08-18 12:13 ` Stephen Smalley
2020-08-21 2:22 ` Paul Moore
2020-08-21 5:53 ` peter enderborg
2020-08-21 12:14 ` Stephen Smalley
2020-08-21 13:10 ` Paul Moore
[not found] ` <20200824132252.31261-1-peter.enderborg@sony.com>
2020-08-24 13:22 ` [RFC PATCH] selinux: Add denied trace with permssion filter Peter Enderborg
2020-08-26 13:42 ` Paul Moore
2020-08-26 14:34 ` peter enderborg
2020-08-26 14:45 ` Paul Moore
2020-08-26 15:06 ` peter enderborg
2020-08-27 13:30 ` Paul Moore
2020-08-27 14:04 ` peter enderborg
2020-08-31 14:16 ` Paul Moore
2020-08-31 14:19 ` Robert Judy
2020-08-31 14:24 ` Paul Moore
2020-08-31 15:34 ` peter enderborg
2020-09-01 15:31 ` Paul Moore
2020-09-01 17:18 ` peter enderborg [this message]
2020-09-18 1:47 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aa37c79f-d908-0a75-4916-6aaa21426212@sony.com \
--to=peter.enderborg@sony.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=rostedt@goodmis.org \
--cc=selinux@vger.kernel.org \
--cc=stephen.smalley.work@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®