libselinux: Add additional log callback details in man page for auditing.
PATCH 1/2 libselinux: Add additional log callback details in man page for auditing.
Add additional information about the log callback message types. Indicate which types could be audited and the relevant audit record types for them.
--- libselinux/man/man3/selinux_set_callback.3 | 9 +++++++++ 1 file changed, 9 insertions(+)
libselinux/man/man3/selinux_set_callback.3 +9 -0
@@ -51,6 +51,15 @@ argument indicates the type of message and will be set to one of the following: .B SELINUX_SETENFORCE +SELINUX_ERROR, SELINUX_WARNING, and SELINUX_INFO indicate standard log severity +levels and are not auditable messages. + +The SELINUX_AVC, SELINUX_POLICYLOAD, and SELINUX_SETENFORCE message types can be +audited with AUDIT_USER_AVC, AUDIT_USER_MAC_POLICY_LOAD, and AUDIT_USER_MAC_STATUS +values from libaudit, respectively. If they are not audited, SELINUX_AVC should be +considered equivalent to SELINUX_ERROR; similarly, SELINUX_POLICYLOAD and +SELINUX_SETENFORCE should be considered equivalent to SELINUX_INFO. + . .TP .B SELINUX_CB_AUDIT
Signature · 1 line
2.26.2
PATCH 2/2 libselinux: Change userspace AVC setenforce and policy load messages to audit format.
--- libselinux/src/avc_internal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
libselinux/src/avc_internal.c +2 -2
@@ -59,7 +59,7 @@ int avc_process_setenforce(int enforcing)int rc =0 ;avc_log (SELINUX_SETENFORCE , -"%s: received setenforce notice (enforcing=%d)\n" , +"%s: op=setenforce lsm=selinux enforcing=%d res=1" , avc_prefix, enforcing);if (avc_setenforce) goto out;
@@ -81,7 +81,7 @@ int avc_process_policyload(uint32_t seqno)int rc =0 ;avc_log (SELINUX_POLICYLOAD , -"%s: received policyload notice (seqno=%u)\n" , +"%s: op=load_policy lsm=selinux seqno=%u res=1" , avc_prefix, seqno); rc =avc_ss_reset (seqno);if (rc <0 ) {
Signature · 1 line
2.26.2
Re: [PATCH 2/2] libselinux: Change userspace AVC setenforce and policy load messages to audit format.
Quoted 19 lines · EDT Chris PeBenito
Signed-off-by Chris PeBenito <[email protected]>--- libselinux/src/avc_internal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)libselinux/src/avc_internal.c +1
-1@@ -59,7 +59,7 @@ int avc_process_setenforce(int enforcing)int rc =0 ;avc_log (SELINUX_SETENFORCE , -"%s: received setenforce notice (enforcing=%d)\n" , +"%s: op=setenforce lsm=selinux enforcing=%d res=1" , avc_prefix, enforcing);if (avc_setenforce) goto out;
libselinux/src/avc_internal.c int avc_process_policyload(uint32_t seqno) · line 87
Quoted 8 lines
libselinux/src/avc_internal.c +1
-1@@ -81,7 +81,7 @@ int avc_process_policyload(uint32_t seqno)int rc =0 ;avc_log (SELINUX_POLICYLOAD , -"%s: received policyload notice (seqno=%u)\n" , +"%s: op=load_policy lsm=selinux seqno=%u res=1" , avc_prefix, seqno); rc =avc_ss_reset (seqno);if (rc <0 ) {
These look good from an audit perspective.
Thanks,
-Steve
Re: [PATCH 2/2] libselinux: Change userspace AVC setenforce and policy load messages to audit format.
In reply to Chris PeBenitoQuoted 2 lines · Chris PeBenito
Signed-off-by Chris PeBenito <[email protected]>
Stephen Smalley
maintainerRe: [PATCH 2/2] libselinux: Change userspace AVC setenforce and policy load messages to audit format.
Quoted 7 lines · Stephen Smalley
Quoted 2 lines · Chris PeBenito
Signed-off-by Chris PeBenito <[email protected]>Acked-by Stephen Smalley <[email protected]>
Both applied.
Quoted 5 lines · Chris PeBenito
Add additional information about the log callback message types. Indicate which types could be audited and the relevant audit record types for them.
Signed-off-by Chris PeBenito <[email protected]>