Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_firewall_config.py: add NI services to default firewall configuration #50

Merged
merged 4 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* The `configure` operation now installs `libpwquality` and enables password quality checks. (#11)
* The `configure` operation now installs and configures `tmux` as the shell, including adding a 15 minute inactivity lock (#17)
* Added a `verify` operation to non-destructively check that the system is still SNAC-compliant. (#15)
* The `configure` operation installs `firewalld` with explicit control over both inbound and outbound
traffic. (#29)
* `firewalld` is configured to permit selected NI service traffic over wireguard. (#50)

### Changed

Expand Down
15 changes: 15 additions & 0 deletions nilrt_snac/_configs/_firewall_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def configure(self, args: argparse.Namespace) -> None:
self._opkg_helper.install("firewalld")
self._opkg_helper.install("firewalld-offline-cmd")
self._opkg_helper.install("firewalld-log-rotate")
self._opkg_helper.install("ni-firewalld-servicedefs")

_offlinecmd("--reset-to-defaults")

Expand Down Expand Up @@ -90,9 +91,23 @@ def configure(self, args: argparse.Namespace) -> None:
"--add-service=https",
"--add-service=wireguard",
"--add-service=dns",
"--add-service=ntp",
)
_offlinecmd("--policy=public-out", "--set-target=REJECT")

_offlinecmd("--policy=work-in",
"--add-service=ni-labview-realtime",
"--add-service=ni-labview-viserver",
"--add-service=ni-logos-xt",
"--add-service=ni-mxs",
"--add-service=ni-rpc-server",
"--add-service=ni-service-locator",
)
_offlinecmd("--policy=work-out",
"--add-service=amqp",
"--add-service=salt-master",
)

_cmd("--reload")

def verify(self, args: argparse.Namespace) -> bool:
Expand Down
Loading