* Checking for audit_enabled in the kernel
@ 2006-11-14 17:48 Paul Moore
2006-11-14 19:01 ` Steve Grubb
0 siblings, 1 reply; 4+ messages in thread
From: Paul Moore @ 2006-11-14 17:48 UTC (permalink / raw)
To: linux-audit
I'm trying to find a way to quickly determine if auditing is enabled and it
looks like the only real way to do that is to declare audit_enabled as an extern
and check the variable directly. Is there some interface for this that I am
missing?
--
paul moore
linux security @ hp
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Checking for audit_enabled in the kernel
2006-11-14 17:48 Checking for audit_enabled in the kernel Paul Moore
@ 2006-11-14 19:01 ` Steve Grubb
2006-11-14 19:07 ` Steve Grubb
2006-11-14 20:57 ` Paul Moore
0 siblings, 2 replies; 4+ messages in thread
From: Steve Grubb @ 2006-11-14 19:01 UTC (permalink / raw)
To: linux-audit
On Tuesday 14 November 2006 12:48, Paul Moore wrote:
> I'm trying to find a way to quickly determine if auditing is enabled and it
> looks like the only real way to do that is to declare audit_enabled as an
> extern and check the variable directly. Is there some interface for this
> that I am missing?
A good example of how to do this is in audit.h:
static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp)
{
if (unlikely(!audit_dummy_context()))
return __audit_ipc_obj(ipcp);
return 0;
}
__audit_ipc_obj is the real function that does the actual work. The
audit_dummy_context() function uses current, so it may not be suitable to use
on events that come from netlink. In that case, we'd need a new function that
takes a task struct.
-Steve
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Checking for audit_enabled in the kernel
2006-11-14 19:01 ` Steve Grubb
@ 2006-11-14 19:07 ` Steve Grubb
2006-11-14 20:57 ` Paul Moore
1 sibling, 0 replies; 4+ messages in thread
From: Steve Grubb @ 2006-11-14 19:07 UTC (permalink / raw)
To: linux-audit
On Tuesday 14 November 2006 14:01, Steve Grubb wrote:
> A good example of how to do this is in audit.h:
Actually, this is wrong - disregard. This would be modeled more like sending a
user space rule into the kernel. In that case, audit_enabled is checked
directly. Its already a public variable but just not in the audit.h file to
prevent its proliferation. You can do this:
extern int audit_enabled;
in your file and use it.
-Steve
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Checking for audit_enabled in the kernel
2006-11-14 19:01 ` Steve Grubb
2006-11-14 19:07 ` Steve Grubb
@ 2006-11-14 20:57 ` Paul Moore
1 sibling, 0 replies; 4+ messages in thread
From: Paul Moore @ 2006-11-14 20:57 UTC (permalink / raw)
To: Steve Grubb; +Cc: linux-audit
Steve Grubb wrote:
> On Tuesday 14 November 2006 12:48, Paul Moore wrote:
>
>>I'm trying to find a way to quickly determine if auditing is enabled and it
>>looks like the only real way to do that is to declare audit_enabled as an
>>extern and check the variable directly. Is there some interface for this
>>that I am missing?
>
> A good example of how to do this is in audit.h:
>
> static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp)
> {
> if (unlikely(!audit_dummy_context()))
> return __audit_ipc_obj(ipcp);
> return 0;
> }
>
> __audit_ipc_obj is the real function that does the actual work. The
> audit_dummy_context() function uses current, so it may not be suitable to use
> on events that come from netlink. In that case, we'd need a new function that
> takes a task struct.
>From what I can tell audit_dummy_context() is really only useful in detecting if
syscall auditing is enabled (it always returns true if CONFIG_AUDITSYSCALL is
not checked at compile time) and not audit in general. I'm pretty sure I want
something that depends on audit in general and not just syscall auditing.
--
paul moore
linux security @ hp
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-11-14 20:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-14 17:48 Checking for audit_enabled in the kernel Paul Moore
2006-11-14 19:01 ` Steve Grubb
2006-11-14 19:07 ` Steve Grubb
2006-11-14 20:57 ` Paul Moore
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox