MAC_BSDEXTENDED(4)
π MAC_BSDEXTENDED(4) π
okay so bestie, this is the manual page for mac_bsdextended β it's a file system firewall policy, and it's genuinely iconic for keeping your system's access rules in check. iykyk.
β¨ NAME β¨
mac_bsdextended β file system firewall policy. periodt. it's literally the bouncer for your files. π
π SYNOPSIS π
so if you wanna compile this policy straight into your kernel (main character energy), you drop these lines in your kernel configuration file:
options MAC
options MAC_BSDEXTENDED
or alternatively β if you're more of a "load it at boot time" vibe β put this line in your kernel configuration file:
options MAC
and then in loader.conf(5):
mac_bsdextended_load="YES"
slay. either way works. π¦
πΈ DESCRIPTION πΈ
the mac_bsdextended security policy module is literally giving "interface for the system administrator to impose mandatory rules regarding users and some system objects." no cap.
rules get uploaded to the module (typically using ugidfw(8), or some other tool utilizing libugidfw(3)) β that's where they're stored internally and used to determine whether to allow or deny specific accesses (see ugidfw(8)). it's giving organized. it's giving secure. we love to see it. β¨
π₯ IMPLEMENTATION NOTES π₯
okay so here's the tea β while the traditional mac(9) entry points are implemented, policy labels are not used. instead, access control decisions are made by iterating through the internal list of rules until a rule which denies the particular access is found, or the end of the list is reached.
the mac_bsdextended policy works similar to ipfw(8) or by using a first match semantic. this means that not all rules are applied, only the first matched rule. so if Rule A allows access and Rule B blocks access, Rule B will never be applied. it's giving "first come first served" but make it access control. π
bestie pls remember: first match wins. the rest don't even get a chance to speak. fr fr.
π SYSCTL VARIABLES π
the following sysctls may be used to tweak the behavior of mac_bsdextended:
security.mac.bsdextended.enabledβ set to zero or one to toggle the policy off or on. it's literally the on/off switch bestie.security.mac.bsdextended.rule_countβ list the number of defined rules, the maximum rule count is current set at 256. that's the limit, no cap. πsecurity.mac.bsdextended.rule_slotsβ list the number of rule slots currently being used. it's giving "how much of the closet is full."security.mac.bsdextended.firstmatch_enabledβ toggle between the old all rules match functionality and the new first rule matches functionality. this is enabled by default. so yeah, first match is the vibe unless you say otherwise. β¨security.mac.bsdextended.loggingβ log all access violations via theAUTHPRIVsyslog(3)facility. it's giving "snitch energy" but for security. we stan. πsecurity.mac.bsdextended.rulesβ currently does nothing interesting. literally nothing. it's giving placeholder. it's giving "we'll get to it later." π
π¦ SEE ALSO π¦
libugidfw(3), syslog(3), mac(4), mac_biba(4), mac_ddb(4), mac_ifoff(4), mac_lomac(4), mac_mls(4), mac_none(4), mac_partition(4), mac_portacl(4), mac_seeotheruids(4), mac_test(4), ipfw(8), ugidfw(8), mac(9)
like, read them. they're all part of the family. π«Ά
π HISTORY π
the mac_bsdextended policy module first appeared in FreeBSD 5.0 and was developed by the TrustedBSD Project. it's giving OG. it's giving legacy. we respect it.
the "match first case" and logging capabilities were later added by Tom Rhodes <trhodes@FreeBSD.org>. king behavior. π
π AUTHORS π
this software was contributed to the FreeBSD Project by NAI Labs, the Security Research Division of Network Associates Inc. under DARPA/SPAWAR contract N66001-01-C-8035 (βCBOSSβ), as part of the DARPA CHATS research program. it's giving government-funded but make it secure. we love a collab. π§
and that's the whole vibe bestie β this page was brought to you by Debian, dated October 11, 2024. stay secure, stay slay. πβ¨π
π¦ where this page comes from
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 2002 Networks Associates Technology, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms