sediff(1)

πŸ“¦
version 4.7.1 Β· 3 versions
, in centos-stream 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’… 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 in allow and allowxperm rules.
  • --allow β€” find differences in allow rules.
  • --auditallow β€” find differences in auditallow rules.
  • --dontaudit β€” find differences in dontaudit rules.
  • --allowxperm β€” find differences in allowxperm rules.
  • --auditallowxperm β€” find differences in auditallowxperm rules.
  • --dontauditxperm β€” find differences in dontauditxperm rules.
  • -T, --type_trans β€” find differences in type_transition rules.
  • --type_member β€” find differences in type_member rules.
  • --type_change β€” find differences in type_change rules.

πŸ‘‘ RBAC Rule Differences

  • --role_allow β€” find differences in role allow rules.
  • --role_trans β€” find differences in role_transition rules.

🌟 MLS Rule Differences

  • --range_trans β€” find differences in range_transition rules.

🧚 Constraint Differences

  • --constrain β€” find differences in constrain rules.
  • --mlsconstrain β€” find differences in mlsconstrain rules.
  • --validatetrans β€” find differences in validatetrans rules.
  • --mlsvalidatetrans β€” find differences in mlsvalidatetrans rules.

πŸ“ Labeling Statement Differences

  • --ibendportcon β€” find differences in ibendportcon (InfiniBand endport context) statements.
  • --ibpkeycon β€” find differences in ibpkeycon (InfiniBand partition key context) statements.
  • --initialsid β€” find differences in initial SID statements.
  • --fs_use β€” find differences in fs_use_* statements.
  • --genfscon β€” find differences in genfscon statements.
  • --netifcon β€” find differences in netifcon statements.
  • --nodecon β€” find differences in nodecon statements.
  • --portcon β€” find differences in portcon statements.

⭐ Other Differences

  • --default β€” find differences in default_* 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 in typebound statements.

πŸ’… 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. πŸ’…βœ¨