* Audit record ordering requirements
[not found] <de87d7bb-a7df-0251-0f33-9aeeef3d0879.ref@schaufler-ca.com>
@ 2020-03-26 23:49 ` Casey Schaufler
2020-03-27 0:28 ` Paul Moore
0 siblings, 1 reply; 6+ messages in thread
From: Casey Schaufler @ 2020-03-26 23:49 UTC (permalink / raw)
To: Steve Grubb; +Cc: Richard Guy Briggs, linux-audit@redhat.com
I'm looking at adding an audit record type for the case where
there are multiple security modules providing subject data. There
are several reasons to create a new record rather than adding the
additional information to existing records, including possible
size overflows and format compatibility.
While working with the code I have found that it is much easier
if the new record (I'm calling it MAC_TASK_CONTEXTS) can be generated
before the "base" record, which could be a SYSCALL record, than
after it. Can I get away with this? I haven't seen any documentation
that says the CWD record has to follow the event's SYSCALL record,
but I wouldn't be at all surprised if it's implicitly assumed.
Thanks.
--
Linux-audit mailing list
Linux-audit@redhat.com
https://www.redhat.com/mailman/listinfo/linux-audit
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Audit record ordering requirements
2020-03-26 23:49 ` Audit record ordering requirements Casey Schaufler
@ 2020-03-27 0:28 ` Paul Moore
2020-03-27 14:03 ` Steve Grubb
0 siblings, 1 reply; 6+ messages in thread
From: Paul Moore @ 2020-03-27 0:28 UTC (permalink / raw)
To: Casey Schaufler; +Cc: Richard Guy Briggs, linux-audit@redhat.com
On Thu, Mar 26, 2020 at 7:49 PM Casey Schaufler <casey@schaufler-ca.com> wrote:
>
> I'm looking at adding an audit record type for the case where
> there are multiple security modules providing subject data. There
> are several reasons to create a new record rather than adding the
> additional information to existing records, including possible
> size overflows and format compatibility.
>
> While working with the code I have found that it is much easier
> if the new record (I'm calling it MAC_TASK_CONTEXTS) can be generated
> before the "base" record, which could be a SYSCALL record, than
> after it. Can I get away with this? I haven't seen any documentation
> that says the CWD record has to follow the event's SYSCALL record,
> but I wouldn't be at all surprised if it's implicitly assumed.
>From a kernel perspective, as long as the timestamp matches (so it's
considered part of the same "event") I've got no problem with that.
However, Steve's audit userspace has a lot of assumptions about how
things are done so it's probably best that he comments on this so his
tools don't blow up.
--
paul moore
www.paul-moore.com
--
Linux-audit mailing list
Linux-audit@redhat.com
https://www.redhat.com/mailman/listinfo/linux-audit
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Audit record ordering requirements
2020-03-27 0:28 ` Paul Moore
@ 2020-03-27 14:03 ` Steve Grubb
2020-03-27 14:08 ` Steve Grubb
2020-03-27 16:23 ` Casey Schaufler
0 siblings, 2 replies; 6+ messages in thread
From: Steve Grubb @ 2020-03-27 14:03 UTC (permalink / raw)
To: Paul Moore; +Cc: Richard Guy Briggs, linux-audit@redhat.com
On Thursday, March 26, 2020 8:28:51 PM EDT Paul Moore wrote:
> On Thu, Mar 26, 2020 at 7:49 PM Casey Schaufler <casey@schaufler-ca.com>
wrote:
> > I'm looking at adding an audit record type for the case where
> > there are multiple security modules providing subject data. There
> > are several reasons to create a new record rather than adding the
> > additional information to existing records, including possible
> > size overflows and format compatibility.
> >
> > While working with the code I have found that it is much easier
> > if the new record (I'm calling it MAC_TASK_CONTEXTS) can be generated
> > before the "base" record, which could be a SYSCALL record, than
> > after it. Can I get away with this? I haven't seen any documentation
> > that says the CWD record has to follow the event's SYSCALL record,
> > but I wouldn't be at all surprised if it's implicitly assumed.
>
> From a kernel perspective, as long as the timestamp matches (so it's
> considered part of the same "event") I've got no problem with that.
> However, Steve's audit userspace has a lot of assumptions about how
> things are done so it's probably best that he comments on this so his
> tools don't blow up.
There are some assumptions about what record is last in order to speed up
"aging" the event during search so that we know the event is complete and
ready for processing. We can always change that if needed. But a new kernel
won't be compatible with older tools.
The only long term fix for this would be to have something that says how many
records are in this event, then add a field for each record saying which one
it is. Then we can have a reliable way to decide when we have all records
ready for processing. This only affects searching/reporting, not logging.
But I think the records are in chronological order as the syscall traverses
the various observers in the kernel. And as Paul said, as long as they all
have the same timestamp/serial number, userspace will collect them all up.
-Steve
--
Linux-audit mailing list
Linux-audit@redhat.com
https://www.redhat.com/mailman/listinfo/linux-audit
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Audit record ordering requirements
2020-03-27 14:03 ` Steve Grubb
@ 2020-03-27 14:08 ` Steve Grubb
2020-03-27 16:14 ` Richard Guy Briggs
2020-03-27 16:23 ` Casey Schaufler
1 sibling, 1 reply; 6+ messages in thread
From: Steve Grubb @ 2020-03-27 14:08 UTC (permalink / raw)
To: linux-audit; +Cc: Richard Guy Briggs
On Friday, March 27, 2020 10:03:07 AM EDT Steve Grubb wrote:
> On Thursday, March 26, 2020 8:28:51 PM EDT Paul Moore wrote:
> > On Thu, Mar 26, 2020 at 7:49 PM Casey Schaufler <casey@schaufler-ca.com>
>
> wrote:
> > > I'm looking at adding an audit record type for the case where
> > > there are multiple security modules providing subject data. There
> > > are several reasons to create a new record rather than adding the
> > > additional information to existing records, including possible
> > > size overflows and format compatibility.
> > >
> > > While working with the code I have found that it is much easier
> > > if the new record (I'm calling it MAC_TASK_CONTEXTS) can be generated
> > > before the "base" record, which could be a SYSCALL record, than
> > > after it. Can I get away with this? I haven't seen any documentation
> > > that says the CWD record has to follow the event's SYSCALL record,
> > > but I wouldn't be at all surprised if it's implicitly assumed.
> >
> > From a kernel perspective, as long as the timestamp matches (so it's
> > considered part of the same "event") I've got no problem with that.
> > However, Steve's audit userspace has a lot of assumptions about how
> > things are done so it's probably best that he comments on this so his
> > tools don't blow up.
>
> There are some assumptions about what record is last in order to speed up
> "aging" the event during search so that we know the event is complete and
> ready for processing. We can always change that if needed. But a new kernel
> won't be compatible with older tools.
>
> The only long term fix for this would be to have something that says how
> many records are in this event, then add a field for each record saying
> which one it is. Then we can have a reliable way to decide when we have
> all records ready for processing. This only affects searching/reporting,
> not logging.
Or I can make a change to put EOF to disk. Currently, that is not done to
conserve disk space.
> But I think the records are in chronological order as the syscall traverses
> the various observers in the kernel. And as Paul said, as long as they all
> have the same timestamp/serial number, userspace will collect them all up.
>
> -Steve
>
>
> --
> Linux-audit mailing list
> Linux-audit@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-audit
--
Linux-audit mailing list
Linux-audit@redhat.com
https://www.redhat.com/mailman/listinfo/linux-audit
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Audit record ordering requirements
2020-03-27 14:08 ` Steve Grubb
@ 2020-03-27 16:14 ` Richard Guy Briggs
0 siblings, 0 replies; 6+ messages in thread
From: Richard Guy Briggs @ 2020-03-27 16:14 UTC (permalink / raw)
To: Steve Grubb; +Cc: linux-audit
On 2020-03-27 10:08, Steve Grubb wrote:
> On Friday, March 27, 2020 10:03:07 AM EDT Steve Grubb wrote:
> > On Thursday, March 26, 2020 8:28:51 PM EDT Paul Moore wrote:
> > > On Thu, Mar 26, 2020 at 7:49 PM Casey Schaufler <casey@schaufler-ca.com>
> >
> > wrote:
> > > > I'm looking at adding an audit record type for the case where
> > > > there are multiple security modules providing subject data. There
> > > > are several reasons to create a new record rather than adding the
> > > > additional information to existing records, including possible
> > > > size overflows and format compatibility.
> > > >
> > > > While working with the code I have found that it is much easier
> > > > if the new record (I'm calling it MAC_TASK_CONTEXTS) can be generated
> > > > before the "base" record, which could be a SYSCALL record, than
> > > > after it. Can I get away with this? I haven't seen any documentation
> > > > that says the CWD record has to follow the event's SYSCALL record,
> > > > but I wouldn't be at all surprised if it's implicitly assumed.
> > >
> > > From a kernel perspective, as long as the timestamp matches (so it's
> > > considered part of the same "event") I've got no problem with that.
> > > However, Steve's audit userspace has a lot of assumptions about how
> > > things are done so it's probably best that he comments on this so his
> > > tools don't blow up.
> >
> > There are some assumptions about what record is last in order to speed up
> > "aging" the event during search so that we know the event is complete and
> > ready for processing. We can always change that if needed. But a new kernel
> > won't be compatible with older tools.
> >
> > The only long term fix for this would be to have something that says how
> > many records are in this event, then add a field for each record saying
> > which one it is. Then we can have a reliable way to decide when we have
> > all records ready for processing. This only affects searching/reporting,
> > not logging.
>
> Or I can make a change to put EOF to disk. Currently, that is not done to
> conserve disk space.
I was going to say. We already had that functionality. It was recently
deleted. An EOF isn't a big record.
> > But I think the records are in chronological order as the syscall traverses
> > the various observers in the kernel. And as Paul said, as long as they all
> > have the same timestamp/serial number, userspace will collect them all up.
> >
> > -Steve
- RGB
--
Richard Guy Briggs <rgb@redhat.com>
Sr. S/W Engineer, Kernel Security, Base Operating Systems
Remote, Ottawa, Red Hat Canada
IRC: rgb, SunRaycer
Voice: +1.647.777.2635, Internal: (81) 32635
--
Linux-audit mailing list
Linux-audit@redhat.com
https://www.redhat.com/mailman/listinfo/linux-audit
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Audit record ordering requirements
2020-03-27 14:03 ` Steve Grubb
2020-03-27 14:08 ` Steve Grubb
@ 2020-03-27 16:23 ` Casey Schaufler
1 sibling, 0 replies; 6+ messages in thread
From: Casey Schaufler @ 2020-03-27 16:23 UTC (permalink / raw)
To: Steve Grubb, Paul Moore; +Cc: Richard Guy Briggs, linux-audit@redhat.com
On 3/27/2020 7:03 AM, Steve Grubb wrote:
> On Thursday, March 26, 2020 8:28:51 PM EDT Paul Moore wrote:
>> On Thu, Mar 26, 2020 at 7:49 PM Casey Schaufler <casey@schaufler-ca.com>
> wrote:
>>> I'm looking at adding an audit record type for the case where
>>> there are multiple security modules providing subject data. There
>>> are several reasons to create a new record rather than adding the
>>> additional information to existing records, including possible
>>> size overflows and format compatibility.
>>>
>>> While working with the code I have found that it is much easier
>>> if the new record (I'm calling it MAC_TASK_CONTEXTS) can be generated
>>> before the "base" record, which could be a SYSCALL record, than
>>> after it. Can I get away with this? I haven't seen any documentation
>>> that says the CWD record has to follow the event's SYSCALL record,
>>> but I wouldn't be at all surprised if it's implicitly assumed.
>> From a kernel perspective, as long as the timestamp matches (so it's
>> considered part of the same "event") I've got no problem with that.
>> However, Steve's audit userspace has a lot of assumptions about how
>> things are done so it's probably best that he comments on this so his
>> tools don't blow up.
> There are some assumptions about what record is last in order to speed up
> "aging" the event during search so that we know the event is complete and
> ready for processing. We can always change that if needed. But a new kernel
> won't be compatible with older tools.
>
> The only long term fix for this would be to have something that says how many
> records are in this event, then add a field for each record saying which one
> it is. Then we can have a reliable way to decide when we have all records
> ready for processing. This only affects searching/reporting, not logging.
>
> But I think the records are in chronological order as the syscall traverses
> the various observers in the kernel. And as Paul said, as long as they all
> have the same timestamp/serial number, userspace will collect them all up.
Most excellent. Considerable complexity averted.
>
> -Steve
>
>
--
Linux-audit mailing list
Linux-audit@redhat.com
https://www.redhat.com/mailman/listinfo/linux-audit
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-03-27 16:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <de87d7bb-a7df-0251-0f33-9aeeef3d0879.ref@schaufler-ca.com>
2020-03-26 23:49 ` Audit record ordering requirements Casey Schaufler
2020-03-27 0:28 ` Paul Moore
2020-03-27 14:03 ` Steve Grubb
2020-03-27 14:08 ` Steve Grubb
2020-03-27 16:14 ` Richard Guy Briggs
2020-03-27 16:23 ` Casey Schaufler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox