sediff(1)
π
sediff β the SELinux policy difference tool (yes, that's the manual name, we're in sediff(1) bestie)
β¨ NAME β¨
sediff β the SELinux policy difference tool. It's giving "spot the difference" but for policy files. π
πΈ SYNOPSIS πΈ
sediff [OPTIONS] [EXPRESSION] POLICY1 POLICY2
π¦ DESCRIPTION π¦
Okay so basically: sediff figures out the differences between two SELinux policies. That's it. That's the whole vibe. You hand it two policies, it tells you what changed. π
π POLICY π
A policy is a single file containing a binary policy, bestie. Keep that in mind:
- On Linux systems this file is usually named by version, for example,
policy.30. - On Android systems this file is usually named
sepolicy.
π¨ And if you don't provide it? sediff will print an error message and exit. No policy, no party. π
π EXPRESSIONS π
You may specify an expression listing the policy elements to differentiate. If you don't provide one, then lowkey all supported policy elements get examined. All of them. Every single one. Iconic behavior fr fr. β¨
π Component Differences
--commonβ find differences in common permission sets.-c,--classβ find differences in object classes.-t,--typeβ find differences in attributes associated with types.-a,--attributeβ find differences in types assigned to attributes.-r,--roleβ find differences in types authorized for roles.-u,--userβ find differences in roles authorized for users.-b,--boolβ find differences in the default values of booleans.--sensitivityβ find differences in sensitivity definitions.--categoryβ find differences in category definitions.--levelβ find differences in MLS level definitions.
π₯ Type Enforcement Rule Differences
-Aβ find differences inallowandallowxpermrules.--allowβ find differences inallowrules.--auditallowβ find differences inauditallowrules.--dontauditβ find differences indontauditrules.--allowxpermβ find differences inallowxpermrules.--auditallowxpermβ find differences inauditallowxpermrules.--dontauditxpermβ find differences indontauditxpermrules.-T,--type_transβ find differences intype_transitionrules.--type_memberβ find differences intype_memberrules.--type_changeβ find differences intype_changerules.
π RBAC Rule Differences
--role_allowβ find differences in roleallowrules.--role_transβ find differences inrole_transitionrules.
π MLS Rule Differences
--range_transβ find differences inrange_transitionrules.
π§ Constraint Differences
--constrainβ find differences inconstrainrules.--mlsconstrainβ find differences inmlsconstrainrules.--validatetransβ find differences invalidatetransrules.--mlsvalidatetransβ find differences inmlsvalidatetransrules.
π Labeling Statement Differences
--ibendportconβ find differences inibendportcon(InfiniBand endport context) statements.--ibpkeyconβ find differences inibpkeycon(InfiniBand partition key context) statements.--initialsidβ find differences in initial SID statements.--fs_useβ find differences infs_use_*statements.--genfsconβ find differences ingenfsconstatements.--netifconβ find differences innetifconstatements.--nodeconβ find differences innodeconstatements.--portconβ find differences inportconstatements.
β Other Differences
--defaultβ find differences indefault_*statements.--propertyβ find differences in policy properties. Only applicable for binary policies (policy version, MLS enabled/disabled, unknown permissions setting).--polcapβ find differences in policy capabilities.--typeboundsβ find differences intypeboundstatements.
π OPTIONS π
-h,--helpβ print help information and exit. Your bestie when you're lost. π«Ά--statsβ print difference statistics only. Just the numbers, no yapping.--versionβ print version information and exit.-v,--verboseβ print additional informational messages. For when you wanna know everything.--debugβ enable debugging output. π
π DIFFERENCES π
sediff categorizes differences in policy elements into one of three forms. Three. Not four. Here they are:
- added β the element exists only in the modified policy. Brand new, main character energy. β¨
- removed β the element exists only in the original policy. Gone. Left the group chat. π
- modified β the element exists in both policies but its semantic meaning has changed. For example, a class is modified if one or more permissions are added or removed. Same name, different person. π
πΈ EXAMPLE πΈ
Show differences in boolean settings:
# sediff -b /backup/policy.33 /etc/selinux/targeted/policy/policy.33
Show statistics for allow and allowxperm rule changes (how many rules where added, removed, or modified):
#sediff -A --stats /backup/policy.33 /etc/selinux/targeted/policy/policy.33
π AUTHOR π
Chris PeBenito <pebenito@ieee.org> β the icon, the moment, the legend. π
π BUGS π
Please report bugs via the SETools bug tracker, https://github.com/SELinuxProject/setools/issues. Not me being a bug reporter bestie, but do it, fr fr. π
π¦ SEE ALSO π¦
apol(1), sedta(1), seinfo(1), seinfoflow(1), sesearch(1) β the whole squad. Go read them, iykyk. π
SELinux Project Β· 2016-04-19 β that's the source and the date bestie, and that's a wrap on sediff(1). Slay, go diff some policies. π
β¨
π¦ where this page comes from
- centos-stream 10: setools-console 4.7.1-1.1.el10 Β· GPL-2.0-only
- fedora 43: setools-console 4.6.0-2.fc43 Β· GPL-2.0-only
- fedora 43: setools-console 4.6.0-4.fc43 Β· GPL-2.0-only
- fedora 44: setools-console 4.6.0-5.fc44 Β· GPL-2.0-only
- fedora 44: setools-console 4.6.0-6.fc44 Β· GPL-2.0-only
- nixos 26.05: setools 4.6.0
- nixpkgs unstable: setools 4.7.1
- ubuntu questing: setools 4.6.0-2
- ubuntu resolute: setools 4.6.0-2build3
- ubuntu stonking: setools 4.7.1-1
- Copyright (c) 2016 Tresys Technology, LLC. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms