Basic Question
I have a basic question -- it's something I've assumed, but never explicitly checked:
When SELinux is running in permissive mode and an action is attempted that violates the security settings, the system logs this event. Obviously, if SELinux were running in enforcing mode this action would have been denied, but would an entry STILL have been made in the log file?
Thanks,
Rich Mayo
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 4 lines · Richard Mayo
When SELinux is running in permissive mode and an action is attempted that violates the security settings, the system logs this event. Obviously, if SELinux were running in enforcing mode this action would have been denied, but would an entry STILL have been made in the log file?
Yes. As a matter of fact, this is how I refine my policies - write a basic set, very strict, then see if it works and if not which log entries it generates. Often, it throws errors, but works nevertheless, that's when I put in dontaudit rules. This is why I do this in enforcing mode, even though it's tedious - because only this way I can see if it really needs the permissions it requests.
Signature · 8 lines
http://web.lemuria.org/pubkey.html pub 1024D/2D7A04F5 2002-05-16 Tom Vogt <[email protected]> Key fingerprint = C731 64D1 4BCF 4C20 48A4 29B2 BF01 9FA1 2D7A 04F5 -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 7 lines · Richard Mayo
I have a basic question -- it's something I've assumed, but never explicitly checked:
When SELinux is running in permissive mode and an action is attempted that violates the security settings, the system logs this event. Obviously, if SELinux were running in enforcing mode this action would have been denied, but would an entry STILL have been made in the log file?
When a domain_auto_trans causes an attempt to use a domain that is not permitted for the role then nothing is logged in enforcing mode - the execution just silently fails. In permissive mode it is allowed and a message is logged about an invalid context being generated (and when you switch back to enforcing mode the context in question is mapped to unlabelled_t from memory).
In all other cases of access being denied the message will be logged in enforcing mode (subject to the usual rate limit).
Signature · 10 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 2 lines · Russell Coker
In all other cases of access being denied the message will be logged in enforcing mode (subject to the usual rate limit).
Just in case Russell didn't make it clear, in enforcing mode there is a rate limit; from the comment for avc_ratelimit:
/*
* This enforces a rate limit: not more than one kernel message
* every 5secs to make a denial-of-service attack impossible. */
This only takes affect in enforcing mode:
static inline int check_avc_ratelimit(void)
{
if (selinux_enforcing)
return avc_ratelimit();
else {
/* If permissive, then never suppress messages. */
return 1;
}
}Over messages are simply discarded:
void avc_audit(...)
{
...
if (!check_avc_ratelimit())
return;...
print avc message here
}
Signature · 6 lines
Brian May <[email protected]> -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.