sevisual_query(1)
π 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.ATTRis 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
- fedora 43: sepolicy_analysis 0.1-32.fc43 Β· GPL-3.0-only
- fedora 44: sepolicy_analysis 0.1-33.fc44 Β· GPL-3.0-only
- Copyright 2016 Vit Mojzis, vmojzis@redhat.com
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms