TOMOYO-PATTERNIZE(8)

πŸ“¦ version 2.6.1-20210910, in debian bookworm, ubuntu jammy, ubuntu noble, ubuntu questing

✨ TOMOYO-PATTERNIZE ✨

okay bestie, so this is a page from the System Administration Utilities collection β€” it's tomoyo-patternize(8), and it is literally the glow-up tool for your policy files πŸ’…


🌸 NAME 🌸

tomoyo-patternize β€” the utility that converts pathnames in your policy into patterns πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

tomoyo-patternize

tomoyo-patternize [configfile]

πŸ’– DESCRIPTION πŸ’–

So here's the vibe: this program reads your domain policy from standard input and swaps out pathnames for patterns. The replacement rules live in /etc/tomoyo/tools/patternize.conf β€” that's the config, that's where the magic is defined, no cap. ✨

The resulting policy gets sent straight to standard output, and it is so useful for shortening and simplifying your domain or exception policy. Like, it's giving "make my policy cute and compact" energy.

Important tea: pathnames used for domain names themselves will not be replaced. Nope, those stay exactly as they are πŸ™ˆ

Also, only the first matching rule is used for any particular pathname β€” first come, first served, periodt. And if a pathname doesn't match any rules? It's left unchanged. Untouched. Iconic behaviour honestly. πŸ‘‘


🧚 EXAMPLES 🧚

okay these are the examples from the config, and they ate:

Replace "proc:/self/fd/0" with "proc:/self/fd/\$"

rewrite path_pattern proc:/self/fd/\$

Replace "proc:/123/status" with "proc/\$/status"

rewrite head_pattern proc:/\$

Replace "dev(8,1):/etc/mtab~456" with "dev(8,1):/etc/mtab~\$"

rewrite tail_pattern /etc/mtab~\$

Replace "/tmp/phpZjk1k3" with @GROUP1

rewrite path_pattern /tmp/php\?\?\?\?\?\? @GROUP1

Replace integers between 0-100 or 100-200 with @GROUP2

rewrite number_pattern 0-100 @GROUP2
rewrite number_pattern 100-200 @GROUP2

Replace loopback addresses with @LOCALHOST

rewrite address_pattern 127.0.0.1 @LOCALHOST
rewrite address_pattern 0:0:0:0:0:0:0:1 @LOCALHOST
✨ psst β€” see the configuration file for more info on rule syntax, bestie. that's where the full lore lives.

πŸ’€ BUGS πŸ’€

If you find any bugs, send an email to <tomoyo-users-en@lists.osdn.me>. like, pls tell them, they wanna know 🫢


πŸ‘‘ AUTHORS πŸ‘‘

  • Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> β€” Main author. 🐧
  • Jamie Nguyen <jamie@tomoyolinux.co.uk> β€” Documentation and website. 🌈

🌟 SEE ALSO 🌟

See <https://tomoyo.osdn.jp> for more information.


and that's the whole page, bestie β€” no notes, absolutely slayed πŸ’…βœ¨

this was tomoyo-tools version 2.6.0, dated 2019-02-05, and it's the TOMOYO-PATTERNIZE(8) manual page. thanks for coming to my ted talk, mwah πŸŽ€πŸ’œ

πŸ“¦ where this page comes from