Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3762961
D3549.id9118.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D3549.id9118.diff
View Options
diff --git a/roles/core/init.sls b/roles/core/init.sls
--- a/roles/core/init.sls
+++ b/roles/core/init.sls
@@ -15,6 +15,7 @@
- .monitoring
- .motd
- .ntp
+ - .pf
- .src
- .rsyslog
- .salt
diff --git a/roles/core/pf/config.sls b/roles/core/pf/config.sls
new file mode 100644
--- /dev/null
+++ b/roles/core/pf/config.sls
@@ -0,0 +1,31 @@
+# -------------------------------------------------------------
+# Salt — Core — pf
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% set network = salt["node.resolve_network"]() %}
+
+# -------------------------------------------------------------
+# Main configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+/etc/pf.conf:
+ file.managed:
+ - source: salt://roles/core/pf/files/pf.conf
+ - template: jinja
+ - context:
+ public_ipv4_interface: {{ network["public_ipv4_interface"] }}
+
+# -------------------------------------------------------------
+# Tables
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+/etc/pf:
+ file.directory
+
+/etc/pf/badhosts:
+ cmd.run:
+ - name: touch /etc/pf/badhosts
+ - creates: /etc/pf/badhosts
diff --git a/roles/core/pf/files/pf.conf b/roles/core/pf/files/pf.conf
new file mode 100644
--- /dev/null
+++ b/roles/core/pf/files/pf.conf
@@ -0,0 +1,24 @@
+# -------------------------------------------------------------
+# pf
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/core/pf/files/pf.conf
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+# -------------------------------------------------------------
+# Tables
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+{% if public_ipv4_interface %}
+table <badhosts> persist file "/etc/pf/badhosts"
+block on {{ public_ipv4_interface }} from <badhosts> to any
+{%- else %}
+# Disabled table: /etc/pf/badhosts - no public IPv4 interface to attach
+{%- endif %}
diff --git a/roles/core/pf/files/rc/pf.conf b/roles/core/pf/files/rc/pf.conf
new file mode 100644
--- /dev/null
+++ b/roles/core/pf/files/rc/pf.conf
@@ -0,0 +1,16 @@
+# -------------------------------------------------------------
+# pf
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/core/pf/files/rc/pf.conf
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+pf_enable="YES"
diff --git a/roles/core/pf/files/rc/pflog.conf b/roles/core/pf/files/rc/pflog.conf
new file mode 100644
--- /dev/null
+++ b/roles/core/pf/files/rc/pflog.conf
@@ -0,0 +1,16 @@
+# -------------------------------------------------------------
+# pf
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/core/pf/files/rc/pflog.conf
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+pflog_enable="YES"
diff --git a/roles/core/pf/init.sls b/roles/core/pf/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/core/pf/init.sls
@@ -0,0 +1,14 @@
+# -------------------------------------------------------------
+# Salt — Core — pf
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% if grains["os"] == "FreeBSD" or grains["os"] == "OpenBSD" %}
+
+include:
+ - .config
+ - .services
+
+{% endif %}
diff --git a/roles/core/pf/services.sls b/roles/core/pf/services.sls
new file mode 100644
--- /dev/null
+++ b/roles/core/pf/services.sls
@@ -0,0 +1,20 @@
+# -------------------------------------------------------------
+# Salt — Core — pf
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+/etc/rc.conf.d/pf:
+ file.managed:
+ - source: salt://roles/core/pf/files/rc/pf.conf
+
+/etc/rc.conf.d/pflog:
+ file.managed:
+ - source: salt://roles/core/pf/files/rc/pflog.conf
+
+pf:
+ service.running
+
+pflog:
+ service.running
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 22, 18:23 (17 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2256386
Default Alt Text
D3549.id9118.diff (5 KB)
Attached To
Mode
D3549: Enable pf firewall
Attached
Detach File
Event Timeline
Log In to Comment