CDIST-TYPE__PF_APPLY_ANCHOR(7)

πŸ¦‹ cdist-type__pf_apply_anchor ✨

okay bestie, so this is cdist-type__pf_apply_anchor from the cdist manual (section 7, obviously πŸ’…) and it's literally here to apply a pf(4) anchor on $__target_host. yes. that's the whole gig. she's focused, she's iconic, she's giving main character energy πŸ‘‘


🌸 DESCRIPTION 🌸

so here's the tea: this type is what you reach for on *BSD systems when you wanna manage anchors for the pf firewall. that's it, that's the vibe 🧚

not me forgetting to mention β€” this type does not take care of copying the ruleset, okay?? that part is on you, and you gotta do it with like, e.g. __file. don't come for me, I'm just the messenger 😭

πŸŽ€ OPTIONAL PARAMETERS πŸŽ€

  • anchor_name β€” the name of the anchor to apply. if you don't set it, ${__object_id} gets used instead (she'll fill in for you, so generous πŸ’–). also, lowkey important: this type requires /etc/pf.d/${anchor_name} to actually exist on $__target_host. like, it has to be there fr fr, no anchor file no party πŸ™ˆ

🌈 EXAMPLES 🌈

okay so first you gotta copy the anchor file over to ${__target_host}:

# Copy anchor file to ${__target_host}
__file "/etc/pf.d/80_dns" --source - <<EOF
# Managed remotely, changes will be lost

pass quick proto {tcp,udp} from any to any port domain
EOF

and then you apply the anchor, like the queen you are ✨:

# Apply the anchor
require="__file/etc/pf.d/80_dns" __pf_apply_anchor 80_dns
# This is roughly equivalent to:
#   pfctl -a "${anchor_name}" -f "/etc/pf.d/${anchor_name}"
iykyk β€” that commented line is roughly equivalent to the two commands above, so if you already knew that, slay πŸ’…

πŸ‘‘ SEE ALSO πŸ‘‘


πŸ’œ AUTHORS πŸ’œ

  • Evilham <contact--@--evilham.com>
  • Kamila SoučkovΓ‘ <coding--@--kamila.is>
  • Jake Guffey <jake.guffey--@--eprotex.com>

πŸ“œ COPYING πŸ“œ

Copyright (C) 2020 Evilham. Copyright (C) 2016 Kamila SoučkovÑ. Copyright (C) 2012 Jake Guffey.

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. periodt 🫢


ungleich GmbH 2021


okay bestie that's the whole page, we ate and left no crumbs πŸ”₯ this was version 7.0.0 from Jul 31, 2022, brought to you by the cdist girlies β€” mwah, go apply some anchors πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from