sevisual_query(1)

πŸ“¦ version 0.1, in fedora 43, fedora 44

πŸ’– sevisual_query β€” SELinux policy visual query πŸ’–

okay bestie, sit down, we're doing SELinux policy aesthetics today. this is sevisual_query(1) from the SELinux Policy Analysis Tool, and it's literally the main character of policy debugging. πŸ¦‹


✨ SYNOPSIS ✨

sevisual_query [-h] [-s SOURCE | -t TARGET]
                    [-sg SOURCE_GROUP | -tg TARGET_GROUP] [-c TCLASS]
                    [-p PERMS] [-a ATTR] [-b BOOL] [-ea] [-dg]
                    [-fb [FILTER_BOOLS]] [-fa ATTR] [-sm SIZE_MULTIPLIER]
                    [policy]

🌸 DESCRIPTION 🌸

so what this does is it creates a visual representation β€” a pdf with vector graphics, very demure, very mindful β€” of part of a given SELinux policy, specifically the part concerning the type you picked. πŸ’…

the way it works is: rules that got assigned via attributes get distinguished by color codes, and dashed lines mean conditional rules. no cap. 🌈


πŸŽ€ OPTIONS πŸŽ€

πŸ“ Positional arguments:

  • policy β€” Path to the SELinux policy to be used.

πŸ‘‘ Optional arguments:

  • -h, --help β€” show this help message and exit
  • -sm SIZE_MULTIPLIER, --size_multiplier SIZE_MULTIPLIER β€” Graph canvas size multiplier (>1 increases space between nodes). so like, if ur graph is giving cramped, bump this bestie.

πŸ” Rule search (similar to sesearch):

  • -s SOURCE, --source SOURCE β€” Source type of the TE rule.
  • -t TARGET, --target TARGET β€” Target type of the TE rule.
  • -sg SOURCE_GROUP, --source_group SOURCE_GROUP β€” Source type (consider whole domain group containing the type) of the TE rule.
  • -tg TARGET_GROUP, --target_group TARGET_GROUP β€” Target type (consider whole domain group containing the type) of the TE rule.
  • -c TCLASS, --class TCLASS β€” Comma separated list of object classes
  • -p PERMS, --perms PERMS β€” Comma separated list of permissions.
  • -a ATTR, --attr ATTR β€” Comma separated list of attributes.
  • -b BOOL, --bool BOOL β€” Comma separated list of Booleans in the conditional expression.
  • -ea β€” Expand rules ending in attribute (to all types that have given attribute). it's giving thorough πŸ’–

🧚 Filtering:

  • -dg β€” Group SELinux domains based on package they belong to.
  • -fb [FILTER_BOOLS], --filter_bools [FILTER_BOOLS] β€” Filter rules based on current boolean setting or comma separated list of [boolean]:[on/off]
  • -fa ATTR, --filter_attrs ATTR β€” Filter out rules allowed for specified attributes. ATTR is comma separated list of attributes.

πŸ“ EXAMPLE πŸ“

Show policy concerning bluetooth_t type (only access to files, other types are grouped into packages):

$ sevisual_query -s bluetooth_t -c file -dg
$ okular graph.pdf

🌟 SEE ALSO 🌟

seextract_cil(1), seexport_graph(1)


πŸ’€ HINTS πŸ’€

Have a look at seexport_graph which can work with whole policy package and the resulting visualization is interactive. iykyk πŸ‘€


πŸ’œ AUTHOR πŸ’œ

Vit Mojzis <vmojzis@redhat.com>


not me being obsessed with a policy visualization tool 😭 but fr fr, go make ur graphs pretty bestie ✨

and that's a wrap! this was sevisual_query(1) from 2017-02-09 β€” slay, periodt. πŸŽ€πŸ’–πŸ¦‹

πŸ“¦ where this page comes from