setrans.conf(5)
πΈ setrans.conf β the translation glow-up file π
okay bestie, pull up a chair, because this is setrans.conf(5) and it's literally the vibe-translator for your SELinux labels β¨
π NAME π
setrans.conf β the translation configuration file for MCS/MLS SELinux systems π
π DESCRIPTION π
So the tea is this: the /etc/selinux/{SELINUXTYPE}/setrans.conf config file is the one that decides how SELinux MCS/MLS labels get translated into human readable form by the mcstransd daemon. Like, it takes the crunchy machine speak and turns it into something a real human can read. main character behavior fr fr π
And the default policies? They come pre-loaded with:
- 16 sensitivity levels β that's
s0throughs15 - 1024 categories β that's
c0throughc1023
Multiple categories can be separated with commas β c0,c1,c3,c5 β and a range of categories can be shortened using dot notation, like c0.c3,c5. no cap, that's the shortcut of the century π¦
β¨ Keywords β¨
- Base β once a base is declared, every sensitivity label definition that comes after it gets all the modifiers applied to them during translation. But the sensitivity labels defined before the base declaration are immediately cached and no modifiers will be applied β those are used as direct translations. so like, order matters, bestie π
- Default β defines the category bit range that will be used for inverse bits.
- Domain β creates a new domain with the supplied name.
- Include β read and process the contents of the specified configuration file.
- Join β defines a character used to separate members of a modifier group when more than one is specified (ex.
USA/AUS). - ModifierGroup β a means of grouping category bit definitions by how they modify the sensitivity label.
- Prefix β word(s) that may proceed member(s) of a modifier group (ex.
REL USA). - Suffix β word(s) that may follow member(s) of a modifier group (ex.
USA EYES ONLY). - Whitespace β defines the set of acceptable white space characters that may be used in label being translated.
π Sensitivity Level Definition Examples π
s0=SystemLowβ defines a translation ofs0(the lowest sensitivity level) with no categories toSystemLow.s15:c0.c1023=SystemHighβ defines a translation ofs15:c0.c1023toSystemHigh.c0.c1023is shorthand for all categories. A colon separates the sensitivity level and categories.s0-s15:c0.c1023=SystemLow-SystemHighβ defines a range translation ofs0-s15:c0.c1023toSystemLow-SystemHigh. The two range components are separated by a dash.s0:c0=PatientRecordβ defines a translation of sensitivitys0with categoryc0toPatientRecord.s0:c1=Accountingβ defines a translation of sensitivitys0with categoryc1toAccounting.s2:c1,c2,c3=Confidential3Categoriess2:c1.c3=Confidential3Categories
both define a translation of sensitivity s2 with categories c1, c2 and c3 to Confidential3Categories. same energy, two spellings π
s5=TopSecretβ defines a translation of sensitivitys5with no categories toTopSecret.
π§ Constraint Examples π§
c0!c1β if category bits 0 and 1 are both set, the constraint will fail and the original context will be returned.c5.c9>c1β if category bits 5 through 9 are set, bit 1 must also be set or the constraint will fail and the original context will be returned.s1!c5,c9β if category bits 5 and 9 are set and the sensitivity level iss1, the constraint will fail and the original context will be returned.
fr fr, when a constraint fails, you get the original context back. no translation for you, bestie π
π AUTHOR π
- Written by Joe Nall
<joe@nall.com>. - Updated by Ted X. Toth
<txtoth@gmail.com>.
π₯ SEE ALSO π₯
selinux(8), mcs(8), mls(8), chcon(1)
π FILES π
/etc/selinux/{SELINUXTYPE}/setrans.conf
/usr/share/mcstrans/examples
and that's the whole page, periodt π
this lil doc came from txtoth@gmail.com and it's dated 13 July 2010 β yeah it's old but it's iconic, and it's living under the setrans.conf(5) manual name. mwah π«Άπ
π¦ where this page comes from
- centos-stream 10: mcstrans 3.11-1.el10 Β· GPL-2.0-or-later
- centos-stream 9: mcstrans 3.6-3.el9 Β· GPL+
- debian bookworm: mcstrans 3.4-1+b2 Β· GPL-2.0-or-later
- debian trixie: mcstrans 3.8.1-1 Β· GPL-2.0-or-later
- fedora 43: mcstrans 3.9-2.fc43 Β· GPL-2.0-or-later
- fedora 44: mcstrans 3.10-1.fc44 Β· GPL-2.0-or-later
- fedora 44: mcstrans 3.11-1.fc44 Β· GPL-2.0-or-later
- opensuse-leap 16.0: mcstrans 3.8.1-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: mcstrans 3.8.1-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: mcstrans 3.8.1-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: mcstrans 3.8.1-160000.2.2 Β· GPL-2.0-or-later
- ubuntu jammy: mcstrans 3.3-1 Β· GPL-2.0-or-later
- ubuntu noble: mcstrans 3.5-1 Β· GPL-2.0-or-later
- ubuntu questing: mcstrans 3.8.1-1
- ubuntu resolute: mcstrans 3.9-1 Β· GPL-2.0-or-later
- ubuntu stonking: mcstrans 3.11-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms