CDIST-TYPE__UFW_RULE(7)
β¨ cdist-type__ufw_rule β¨
okay bestie, this is a cdist type β it's called cdist-type__ufw_rule and it does exactly one (1) thing: a single UFW rule. one rule. that's the whole vibe. π
πΈ DESCRIPTION πΈ
It adds or removes a single UFW rule. That's it, that's the job. And yes, it fully supports adding and deleting rules for port ranges or applications, so you're covered either way. π«Ά
ok now the part that lowkey trips everyone up: figuring out what counts as "to" and what counts as "from". it's giving confusing, i know π
- If the rule is ingress (which is the default, btw), then "from" is the remote machine and "to" is the local one.
- For egress traffic (that's
--out), it's literally the opposite.
periodt. write that down. π
π OPTIONAL PARAMETERS π
stateβ Either"present"or"absent". Defaults to"present". If you set it to"absent", it only removes rules that exactly match the rule expected. no partial matches, no vibes-based deletions, exact only bestie πruleβ A firewall rule in UFW syntax. This is literally what you would usually write afterufwon the command line, so if you already know ufw you already know this. It defaults to"allow"followed by the object ID. You can use either:- the short syntax β just
allow|deny|reject|limitfollowed by a port or an application name, or - the full syntax.
- the short syntax β just
π¨ Do not includedeletein your command. Not ever. Set--state absentinstead. i'm so serious rn π
π₯ EXAMPLES π₯
here's the tea, four (4) whole examples, copy them exactly:
# open port 80 (ufw allow 80)
__ufw_rule 80
# Allow mosh application (if installed)
__ufw_rule mosh
# Allow all traffic from local network (ufw allow from 10.0.0.0/24)
__ufw_rule local --rule 'allow from 10.0.0.0/24'
# Block egress traffic from port 25 to 111.55.55.55 on interface eth0
__ufw_rule block_smtp --rule 'deny out on eth0 from any port 25 to 111.55.55.55'
slay. β¨
π¦ SEE ALSO π¦
π AUTHORS π
Mark Polyakov <mark@markasoftware.com> β main character energy fr fr π
π COPYING π
Copyright (C) 2019 Mark Polyakov. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
π COPYRIGHT π
ungleich GmbH 2021
ok that's the whole page bestie, you ate that π this was cdist-type__ufw_rule, version 7.0.0, dated Jul 31, 2022, straight out of the cdist manual. go close some ports (or open them, no judgment) π
β¨π
π¦ where this page comes from
- fedora 43: cdist 7.0.0-16.fc43 Β· GPL-3.0-only
- fedora 44: cdist 7.0.0-18.fc44 Β· GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms