diff options
author | rwatson <rwatson@FreeBSD.org> | 2007-04-21 22:08:48 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2007-04-21 22:08:48 +0000 |
commit | 9792022e80db34231627556d308375adcce097ac (patch) | |
tree | 79040c30b241a706472da18aea9f2b933574e7c0 /sys/security/mac_bsdextended/mac_bsdextended.c | |
parent | 3df166efbcd71e69ee943f659199f3a930a39144 (diff) | |
download | FreeBSD-src-9792022e80db34231627556d308375adcce097ac.zip FreeBSD-src-9792022e80db34231627556d308375adcce097ac.tar.gz |
Allow MAC policy modules to control access to audit configuration system
calls. Add MAC Framework entry points and MAC policy entry points for
audit(), auditctl(), auditon(), setaudit(), aud setauid().
MAC Framework entry points are only added for audit system calls where
additional argument context may be useful for policy decision-making; other
audit system calls without arguments may be controlled via the priv(9)
entry points.
Update various policy modules to implement audit-related checks, and in
some cases, other missing system-related checks.
Obtained from: TrustedBSD Project
Sponsored by: SPARTA, Inc.
Diffstat (limited to 'sys/security/mac_bsdextended/mac_bsdextended.c')
-rw-r--r-- | sys/security/mac_bsdextended/mac_bsdextended.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sys/security/mac_bsdextended/mac_bsdextended.c b/sys/security/mac_bsdextended/mac_bsdextended.c index a0bb805..da99f2b 100644 --- a/sys/security/mac_bsdextended/mac_bsdextended.c +++ b/sys/security/mac_bsdextended/mac_bsdextended.c @@ -488,6 +488,30 @@ mac_bsdextended_check_vp(struct ucred *cred, struct vnode *vp, int acc_mode) } static int +mac_bsdextended_check_system_acct(struct ucred *cred, struct vnode *vp, + struct label *label) +{ + + return (mac_bsdextended_check_vp(cred, vp, MBI_WRITE)); +} + +static int +mac_bsdextended_check_system_auditctl(struct ucred *cred, struct vnode *vp, + struct label *label) +{ + + return (mac_bsdextended_check_vp(cred, vp, MBI_WRITE)); +} + +static int +mac_bsdextended_check_system_swapoff(struct ucred *cred, struct vnode *vp, + struct label *label) +{ + + return (mac_bsdextended_check_vp(cred, vp, MBI_WRITE)); +} + +static int mac_bsdextended_check_system_swapon(struct ucred *cred, struct vnode *vp, struct label *label) { @@ -739,6 +763,9 @@ static struct mac_policy_ops mac_bsdextended_ops = { .mpo_destroy = mac_bsdextended_destroy, .mpo_init = mac_bsdextended_init, + .mpo_check_system_acct = mac_bsdextended_check_system_acct, + .mpo_check_system_auditctl = mac_bsdextended_check_system_auditctl, + .mpo_check_system_swapoff = mac_bsdextended_check_system_swapoff, .mpo_check_system_swapon = mac_bsdextended_check_system_swapon, .mpo_check_vnode_access = mac_bsdextended_check_vnode_access, .mpo_check_vnode_chdir = mac_bsdextended_check_vnode_chdir, |