-
-
Notifications
You must be signed in to change notification settings - Fork 339
Feat: Enterprise-Grade Security Hardening and Build Overhaul #1230
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
Conversation
adamoutler
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| ### Plugin logging & outputs | ||
| - Always log via `mylog()` like other plugins do (no `print()`). Example: `mylog('verbose', [f'[{pluginName}] In script'])`. | ||
| - Use logging as shown in other plugins. | ||
| - Collect results with `Plugin_Objects.add_object(...)` during processing and call `plugin_objects.write_result_file()` exactly once at the end of the script. | ||
| - Prefer to log a brief summary before writing (e.g., total objects added) to aid troubleshooting; keep logs concise at `verbose` level unless debugging. | ||
| - Prefer to log a brief summary before writing (e.g., total objects added) to aid troubleshooting; keep logs concise at `info` level and use `verbose` or `debug` for extra context. | ||
|
|
||
| - Do not write ad‑hoc files for results; the only consumable output is `last_result.<PREF>.log` generated by `Plugin_Objects`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This documentation may be inaccurate. It's best to leave it. for review by maintainer.
install/production-filesystem/services/scripts/update_vendors.sh
Outdated
Show resolved
Hide resolved
install/production-filesystem/services/scripts/check-first-run-db.sh
Outdated
Show resolved
Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…-config.sh Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
🧹 Nitpick comments (2)
install/production-filesystem/services/scripts/check-first-run-config.sh (1)
5-5: Quote the variable in the file test to handle paths safely.If
${NETALERTX_CONFIG}ever contains spaces or special characters, the unquoted test will fail. Use quotes for defensive robustness:-if [ ! -f ${NETALERTX_CONFIG}/app.conf ]; then +if [ ! -f "${NETALERTX_CONFIG}/app.conf" ]; thenDockerfile (1)
191-191: Useexecin sudo stub for efficiency and clarity.Line 191 creates a sudo pass-through stub, but omits
exec, causing the shell to remain in memory unnecessarily. While functional, it's suboptimal.Apply this diff to use
exec:- echo -ne '#!/bin/sh\n"$@"\n' > /usr/bin/sudo && chmod +x /usr/bin/sudo + echo -ne '#!/bin/sh\nexec "$@"\n' > /usr/bin/sudo && chmod +x /usr/bin/sudo
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
Dockerfile(1 hunks)install/production-filesystem/services/scripts/check-first-run-config.sh(1 hunks)install/production-filesystem/services/scripts/update_vendors.sh(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-20T03:01:19.912Z
Learnt from: adamoutler
PR: jokob-sk/NetAlertX#1184
File: .devcontainer/Dockerfile:18-19
Timestamp: 2025-09-20T03:01:19.912Z
Learning: In the NetAlertX repository, .devcontainer/Dockerfile is auto-generated and should not be reviewed directly. Review comments about dependencies and build steps should be directed at the root Dockerfile where the actual source commands are located.
Applied to files:
Dockerfile
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: docker_dev
🔇 Additional comments (1)
Dockerfile (1)
145-145: Verify readlink robustness for Python binary resolution.Line 145 uses
$(readlink -f ${VIRTUAL_ENV_BIN}/python)to resolve the Python binary before applying capabilities. If the symlink does not resolve (e.g., binary not yet created, wrong name), setcap will silently fail and capabilities won't be set, causing runtime failures when scapy operations execute.Confirm via inspection or testing:
- Does
${VIRTUAL_ENV_BIN}/pythonexist and resolve correctly after the venv is copied?- Should you add a check or fall back to an explicit path like
${VIRTUAL_ENV_BIN}/python3if readlink fails?
install/production-filesystem/services/scripts/check-first-run-config.sh
Outdated
Show resolved
Hide resolved
install/production-filesystem/services/scripts/update_vendors.sh
Outdated
Show resolved
Hide resolved
install/production-filesystem/services/scripts/update_vendors.sh
Outdated
Show resolved
Hide resolved
…-config.sh Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Dang it coderabbit. We expect more of your diffs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
install/production-filesystem/services/scripts/check-first-run-config.sh (1)
5-5: Minor: Quote variable for consistency.Line 5 uses an unquoted variable
${NETALERTX_CONFIG}in the condition, while lines 6 and 10 properly quote it. For robustness against edge cases (e.g., paths with spaces), consider quoting consistently:-if [ ! -f ${NETALERTX_CONFIG}/app.conf ]; then +if [ ! -f "${NETALERTX_CONFIG}/app.conf" ]; thenThis is a minor consistency nit and unlikely to cause issues in practice given typical env-var usage.
install/production-filesystem/services/scripts/update_vendors.sh (1)
13-16: Optional: Update stale comment for clarity.The comment mentions updating
/usr/share/arp-scan, but the script actually writes to/services/run/tmp/ieee-oui.txt. Consider updating this comment to reflect the current output path and align with the production filesystem refactor.# ---------------------------------------------------------------------- # Main directories to update: -# /usr/share/arp-scan +# Output path: /services/run/tmp/ieee-oui.txt # ----------------------------------------------------------------------
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
install/production-filesystem/services/scripts/check-first-run-config.sh(1 hunks)install/production-filesystem/services/scripts/update_vendors.sh(1 hunks)
🔇 Additional comments (2)
install/production-filesystem/services/scripts/check-first-run-config.sh (1)
1-26: Excellent work addressing all prior issues—script is production-ready.The script properly resolves all three previous critical concerns:
- Error handling for
mkdirandcpwith early exit on failure (lines 6–13) ✓- Variable expansion in heredoc by using unquoted
<<EOF(line 17) ✓- User-facing message displays the actual path via variable interpolation (line 19) ✓
Color handling and stderr redirection are clean, and error messages are helpful. The control flow is straightforward and safe.
install/production-filesystem/services/scripts/update_vendors.sh (1)
1-44: Excellent hardening work—script is robust and production-ready.All prior issues have been properly addressed: strict error handling is in place, the download-process-validate-replace pipeline is bulletproof, cleanup is reliable, and exit codes are correct. The combination of
set -euo pipefail,if !error trapping, validation thresholds, and atomic file replacement make this a solid data-update script.
commit 90a07c6 Merge: 13341e3 031d810 Author: jokob-sk <jokob.sk@gmail.com> Date: Mon Nov 3 08:14:26 2025 +1100 Merge branch 'main' of https://github.com/jokob-sk/NetAlertX commit 13341e3 Author: jokob-sk <jokob.sk@gmail.com> Date: Mon Nov 3 08:14:15 2025 +1100 PLG: ARPSCAN prevent duplicates across subnets Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit 031d810 Merge: cb69990 b806f84 Author: Jokob @netalertx <96159884+jokob-sk@users.noreply.github.com> Date: Sun Nov 2 22:20:13 2025 +1100 Merge branch `next_release` into main commit b806f84 Author: jokob-sk <jokob.sk@gmail.com> Date: Sun Nov 2 22:16:28 2025 +1100 BE: invlaid return netalertx#1251 Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit 7c90c2e Author: jokob-sk <jokob.sk@gmail.com> Date: Sun Nov 2 22:12:30 2025 +1100 BE: spinner + timestamp work netalertx#1251 Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit cb69990 Merge: 71646e1 7037cf1 Author: Jokob @netalertx <96159884+jokob-sk@users.noreply.github.com> Date: Sun Nov 2 21:48:27 2025 +1100 Merge pull request netalertx#1268 from adamoutler/synology-fix Fix permissions on Synology commit 7037cf1 Author: Adam Outler <adamoutler@gmail.com> Date: Sun Nov 2 10:26:21 2025 +0000 fxi permissions on synology inherited commit a27ee5c Author: jokob-sk <jokob.sk@gmail.com> Date: Sun Nov 2 13:55:51 2025 +1100 BE: changes netalertx#1251 Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit c3c570e Author: jokob-sk <jokob.sk@gmail.com> Date: Sun Nov 2 13:51:17 2025 +1100 BE: added stateUpdated netalertx#1251 Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit 71646e1 Merge: e7ed9e0 dde542c Author: Jokob @netalertx <96159884+jokob-sk@users.noreply.github.com> Date: Sun Nov 2 13:49:39 2025 +1100 Merge pull request netalertx#1263 from adamoutler/FEAT--Make-Errors-More-Helpful Feat: make errors more helpful commit 2215272 Author: jokob-sk <jokob.sk@gmail.com> Date: Sun Nov 2 11:57:08 2025 +1100 BE: short-circuit of name resolution netalertx#1251 Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit dde542c Author: Adam Outler <adamoutler@gmail.com> Date: Sun Nov 2 00:12:50 2025 +0000 make /services/scripts executable by default commit 23a0fac Author: Adam Outler <adamoutler@gmail.com> Date: Sat Nov 1 23:54:54 2025 +0000 Address Coderabbit issue commit 2fdecce Author: jokob-sk <jokob.sk@gmail.com> Date: Sun Nov 2 09:07:59 2025 +1100 PLG: NMAPDEV stripping --vlan netalertx#1264 Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit db5381d Author: Adam Outler <adamoutler@gmail.com> Date: Sat Nov 1 15:12:54 2025 -0400 Update test/docker_tests/test_docker_compose_scenarios.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> commit f1fbc47 Author: Adam Outler <adamoutler@gmail.com> Date: Sat Nov 1 19:04:31 2025 +0000 coderabbit required fix commit 2a9d352 Author: Adam Outler <adamoutler@gmail.com> Date: Sat Nov 1 14:57:57 2025 -0400 Update test/docker_tests/configurations/test_all_docker_composes.sh Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> commit 51aa3d4 Author: Adam Outler <adamoutler@gmail.com> Date: Sat Nov 1 18:53:07 2025 +0000 coderabbit commit 70373b1 Author: Adam Outler <adamoutler@gmail.com> Date: Sat Nov 1 18:18:32 2025 +0000 Address coderabbit-discoverd issues commit e7ed9e0 Author: jokob-sk <jokob.sk@gmail.com> Date: Sat Nov 1 17:58:22 2025 +1100 BE: logging fix and comments why eve_PendingAlertEmail not cleared Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit 79887f0 Merge: a6bc96d ff96d38 Author: Adam Outler <adamoutler@gmail.com> Date: Fri Oct 31 23:59:45 2025 -0400 Merge branch 'jokob-sk:main' into FEAT--Make-Errors-More-Helpful commit a6bc96d Author: Adam Outler <adamoutler@gmail.com> Date: Fri Oct 31 22:47:35 2025 +0000 Corrections on testing and behaviors commit 8edef9e Author: Adam Outler <adamoutler@gmail.com> Date: Fri Oct 31 22:24:31 2025 +0000 All errors have documentation links commit 1e63cec Author: Adam Outler <adamoutler@gmail.com> Date: Fri Oct 31 22:24:08 2025 +0000 Revise tests. Use docker-compose.yml where possible commit ff96d38 Author: jokob-sk <jokob.sk@gmail.com> Date: Fri Oct 31 22:09:43 2025 +1100 DOCS:old docker installation guide Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit 537be0f Author: jokob-sk <jokob.sk@gmail.com> Date: Fri Oct 31 22:01:16 2025 +1100 BE: typos Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit b89917c Merge: daea3a2 f42186b Author: Hosted Weblate <hosted@weblate.org> Date: Fri Oct 31 11:55:36 2025 +0100 Merge branch 'origin/main' into Weblate. commit daea3a2 Author: jokob-sk <jokob.sk@gmail.com> Date: Fri Oct 31 21:55:15 2025 +1100 DOCS: WARNING use dockerhub docs Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit b86f636 Author: jokob-sk <jokob.sk@gmail.com> Date: Fri Oct 31 21:46:59 2025 +1100 Revert "DOCS: clearer local_path instructions" This reverts commit dfc64fd. commit 0b08995 Author: jokob-sk <jokob.sk@gmail.com> Date: Fri Oct 31 21:46:25 2025 +1100 Revert "DOCS: install refactor work" This reverts commit fe69972. commit f42186b Merge: 88f889f bc9fb6b Author: Hosted Weblate <hosted@weblate.org> Date: Fri Oct 31 11:10:55 2025 +0100 Merge branch 'origin/main' into Weblate. commit bc9fb6b Author: jeet moh <jeetdevpc@gmail.com> Date: Thu Oct 30 13:07:48 2025 +0100 Translated using Weblate (Persian (fa_FA)) Currently translated at 0.1% (1 of 762 strings) Translation: NetAlertX/core Translate-URL: https://hosted.weblate.org/projects/pialert/core/fa_FA/ commit 88f889f Merge: 533c99e afa257f Author: jokob-sk <jokob.sk@gmail.com> Date: Fri Oct 31 20:56:36 2025 +1100 Merge branch 'next_release' of https://github.com/jokob-sk/NetAlertX into next_release commit 533c99e Merge: 78ab0fb 64e4586 Author: jokob-sk <jokob.sk@gmail.com> Date: Fri Oct 31 20:45:31 2025 +1100 LNG: Swedish (sv_sv) commit afa257f Merge: 78ab0fb 64e4586 Author: jokob-sk <jokob.sk@gmail.com> Date: Fri Oct 31 20:45:31 2025 +1100 Merge branch 'next_release' of https://github.com/jokob-sk/NetAlertX into next_release commit 78ab0fb Author: jokob-sk <jokob.sk@gmail.com> Date: Fri Oct 31 20:24:13 2025 +1100 PLG: SNMPDSC typo commit 64e4586 Author: jokob-sk <jokob.sk@gmail.com> Date: Fri Oct 31 20:24:13 2025 +1100 PLG: Encode SMTP_PASS using base64 netalertx#1253 commit 2f7d9a0 Author: jokob-sk <jokob.sk@gmail.com> Date: Fri Oct 31 15:02:51 2025 +1100 PLG: snmpwalk -OXsq clarification netalertx#1231 commit d29700a Author: Adam Outler <adamoutler@gmail.com> Date: Fri Oct 31 00:07:34 2025 +0000 New mount test structure. commit 75072da Author: jokob-sk <jokob.sk@gmail.com> Date: Fri Oct 31 08:16:54 2025 +1100 GIT: build dev container from next_release branch Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit 19b1fc9 Merge: 63d6410 929eb16 Author: Jokob @netalertx <96159884+jokob-sk@users.noreply.github.com> Date: Fri Oct 31 08:15:12 2025 +1100 Merge pull request netalertx#1260 from jokob-sk/main BE: Devices Tiles SQL syntax error netalertx#1238 commit 63d6410 Author: jokob-sk <jokob.sk@gmail.com> Date: Fri Oct 31 08:12:38 2025 +1100 BE: handle missing buildtimestamp.txt Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit b89a44d Author: Adam Outler <adamoutler@gmail.com> Date: Thu Oct 30 21:05:24 2025 +0000 Improve startup checks commit 929eb16 Author: Jokob @netalertx <96159884+jokob-sk@users.noreply.github.com> Date: Thu Oct 30 20:48:38 2025 +0000 BE: Devices Tiles SQL syntax error netalertx#1238 commit 8cb1836 Author: Adam Outler <adamoutler@gmail.com> Date: Wed Oct 29 23:49:37 2025 +0000 Move all check- scripts to /entrypoint.d/ for better organization commit 512dedf Author: jokob-sk <jokob.sk@gmail.com> Date: Fri Oct 31 06:39:55 2025 +1100 FE: increase filter debounce to 750ms netalertx#1254 Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit 2a2782b Merge: 869f28b b726518 Author: jokob-sk <jokob.sk@gmail.com> Date: Thu Oct 30 14:52:34 2025 +1100 Merge branch 'next_release' of https://github.com/jokob-sk/NetAlertX into next_release commit b726518 Merge: f81a1b9 274beca Author: Jokob @netalertx <96159884+jokob-sk@users.noreply.github.com> Date: Thu Oct 30 14:52:19 2025 +1100 Merge pull request netalertx#1258 from jokob-sk/main BE: fix GRAPHQL_PORT commit 274beca Author: jokob-sk <jokob.sk@gmail.com> Date: Thu Oct 30 14:51:24 2025 +1100 BE: fix GRAPHQL_PORT Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit 869f28b Author: jokob-sk <jokob.sk@gmail.com> Date: Thu Oct 30 14:50:13 2025 +1100 DOCS: typos Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit f81a1b9 Author: jokob-sk <jokob.sk@gmail.com> Date: Thu Oct 30 14:31:22 2025 +1100 DOCS: Docker guides Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit 58fe531 Merge: 50f9277 8da136f Author: Jokob @netalertx <96159884+jokob-sk@users.noreply.github.com> Date: Thu Oct 30 13:56:17 2025 +1100 Merge pull request netalertx#1257 from jokob-sk/main BE: Remove GraphQL check from healthcheck commit 8da136f Author: jokob-sk <jokob.sk@gmail.com> Date: Thu Oct 30 13:55:05 2025 +1100 BE: Remove GraphQL check from healthcheck Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit 50f9277 Author: jokob-sk <jokob.sk@gmail.com> Date: Thu Oct 30 13:30:23 2025 +1100 DOCS: Docker guides (GRAPHQL_PORT fix) Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit 7ca9d2a Merge: b76272b 55171e0 Author: Jokob @netalertx <96159884+jokob-sk@users.noreply.github.com> Date: Thu Oct 30 13:16:05 2025 +1100 Merge pull request netalertx#1256 from adamoutler/next_release update docker compose commit b76272b Merge: fba5359 22aa995 Author: jokob-sk <jokob.sk@gmail.com> Date: Thu Oct 30 13:14:12 2025 +1100 Merge branch 'next_release' of https://github.com/jokob-sk/NetAlertX into next_release commit fba5359 Author: jokob-sk <jokob.sk@gmail.com> Date: Thu Oct 30 13:14:06 2025 +1100 DOCS: Docker guides Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit 55171e0 Author: Adam Outler <adamoutler@gmail.com> Date: Wed Oct 29 23:29:32 2025 +0000 update compose commit 22aa995 Merge: 647defb af80cff Author: Jokob @netalertx <96159884+jokob-sk@users.noreply.github.com> Date: Thu Oct 30 08:33:06 2025 +1100 Merge pull request netalertx#1255 from Tweebloesem/patch-2 Fix typo in PiHole integration guide commit af80cff Author: Tweebloesem <139498987+Tweebloesem@users.noreply.github.com> Date: Wed Oct 29 22:18:42 2025 +0100 Fix typo in PiHole integration guide commit 647defb Merge: 2148a7f ea5e236 Author: jokob-sk <jokob.sk@gmail.com> Date: Wed Oct 29 20:33:42 2025 +1100 Merge branch 'next_release' of https://github.com/jokob-sk/NetAlertX into next_release commit 2148a7f Author: jokob-sk <jokob.sk@gmail.com> Date: Wed Oct 29 20:33:32 2025 +1100 DOCS: Docker guides Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit ea5e236 Merge: 61de637 0079ece Author: Jokob @netalertx <96159884+jokob-sk@users.noreply.github.com> Date: Wed Oct 29 19:26:36 2025 +1100 Merge pull request netalertx#1249 from jokob-sk/main Sync commit 0079ece Merge: 5962312 8d4c7ea Author: Jokob @netalertx <96159884+jokob-sk@users.noreply.github.com> Date: Wed Oct 29 19:25:32 2025 +1100 Merge pull request netalertx#1248 from adamoutler/Easy-Permissions Easy permissions commit 61de637 Author: jokob-sk <jokob.sk@gmail.com> Date: Wed Oct 29 15:51:31 2025 +1100 DOCS: Docker guides Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit 57f3d6f Author: jokob-sk <jokob.sk@gmail.com> Date: Wed Oct 29 13:26:10 2025 +1100 DOCS: Security features - fix hierarchy Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit 2e76ff1 Author: jokob-sk <jokob.sk@gmail.com> Date: Wed Oct 29 13:21:12 2025 +1100 DOCS: Migration and Security features navigation link commit 8d4c7ea Author: Adam Outler <adamoutler@gmail.com> Date: Wed Oct 29 00:32:08 2025 +0000 less invasive permission changes commit b4027b6 Author: Adam Outler <adamoutler@gmail.com> Date: Wed Oct 29 00:08:32 2025 +0000 docker-compose needed for fast container rebuilds commit b36b3be Author: Adam Outler <adamoutler@gmail.com> Date: Wed Oct 29 00:08:09 2025 +0000 Fix permissions messages and test parms commit 7ddb7d2 Author: Adam Outler <adamoutler@gmail.com> Date: Tue Oct 28 23:58:02 2025 +0000 new method of fixing permissions commit 40341a8 Merge: 304d4d0 6afa52e Author: Jokob @netalertx <96159884+jokob-sk@users.noreply.github.com> Date: Wed Oct 29 07:37:55 2025 +1100 Merge pull request netalertx#1247 from adamoutler/next_release Security features overview commit 304d4d0 Merge: a353acf 4d148f3 Author: jokob-sk <jokob.sk@gmail.com> Date: Wed Oct 29 07:33:59 2025 +1100 Merge branch 'next_release' of https://github.com/jokob-sk/NetAlertX into next_release commit a353acf Author: jokob-sk <jokob.sk@gmail.com> Date: Wed Oct 29 07:32:56 2025 +1100 DOCS: builds Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit 6afa52e Author: Adam Outler <adamoutler@gmail.com> Date: Tue Oct 28 00:15:12 2025 +0000 Security features overview commit 5962312 Merge: 84183f0 3ba4100 Author: Jokob @netalertx <96159884+jokob-sk@users.noreply.github.com> Date: Tue Oct 28 08:31:30 2025 +1100 Merge pull request netalertx#1235 from adamoutler/hardening-fixes Hardening fixes commit 3ba4100 Author: Adam Outler <adamoutler@gmail.com> Date: Mon Oct 27 16:51:17 2025 -0400 Update install/production-filesystem/entrypoint.sh Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> commit a6ac492 Author: Adam Outler <adamoutler@gmail.com> Date: Mon Oct 27 20:19:17 2025 +0000 Add APP_CONF_OVERRIDE support commit 4d148f3 Author: Jokob @netalertx <96159884+jokob-sk@users.noreply.github.com> Date: Mon Oct 27 03:33:50 2025 +0000 DOCS: wording commit 9b0f45b Author: jokob-sk <jokob.sk@gmail.com> Date: Mon Oct 27 14:21:17 2025 +1100 DOCS: migration prep Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit 84183f0 Author: jokob-sk <jokob.sk@gmail.com> Date: Mon Oct 27 12:58:48 2025 +1100 LANG: ru_ru updates Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit 5dba0f1 Merge: 76419db 816b907 Author: Jokob @netalertx <96159884+jokob-sk@users.noreply.github.com> Date: Mon Oct 27 08:14:16 2025 +1100 Merge pull request netalertx#1244 from jokob-sk/main sync commit 095372a Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 26 16:49:28 2025 -0400 Rename GRAPHQL_PORT to APP_CONF_OVERRIDE commit d8c2dc0 Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 26 19:58:57 2025 +0000 Apply coderabit's latest hare-brained idea commit cfffaf4 Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 26 19:40:17 2025 +0000 Strengthen tests commit 01b64cc Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 26 19:34:28 2025 +0000 Changes requested by coderabbit. commit 63c4b0d Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 26 14:15:12 2025 -0400 Update .devcontainer/devcontainer.json Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> commit 5ec35aa Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 26 18:12:02 2025 +0000 Build the netalertx-test image on start so tests don't fail commit ededd39 Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 26 17:53:46 2025 +0000 Coderabbit fixes commit 15bc163 Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 26 12:45:42 2025 -0400 Update install/production-filesystem/services/scripts/check-root.sh Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> commit 74a67e3 Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 26 16:10:17 2025 +0000 Added clarifying examples to dockerfile commit 52b747b Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 26 15:54:01 2025 +0000 Remove warnings in devcontainer commit d2c28f6 Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 26 15:30:03 2025 +0000 Changes for tests identified by CodeRabbit commit 816b907 Author: Almaz <almazgamer228@gmail.com> Date: Sat Oct 25 09:56:34 2025 +0200 Translated using Weblate (Russian) Currently translated at 100.0% (762 of 762 strings) Translation: NetAlertX/core Translate-URL: https://hosted.weblate.org/projects/pialert/core/ru/ commit fb02774 Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 26 00:14:03 2025 +0000 Fix errors for tests commit 2663227 Author: jokob-sk <jokob.sk@gmail.com> Date: Sun Oct 26 11:07:34 2025 +1100 PLUG: SNMPDSC timeout multiplier netalertx#1231 Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit dfc64fd Author: jokob-sk <jokob.sk@gmail.com> Date: Sun Oct 26 10:59:42 2025 +1100 DOCS: clearer local_path instructions Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit b44369a Author: jokob-sk <jokob.sk@gmail.com> Date: Sun Oct 26 10:59:05 2025 +1100 PLUG: 0 in device tiles netalertx#1238 Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit 8ada2c3 Author: jokob-sk <jokob.sk@gmail.com> Date: Sun Oct 26 10:58:34 2025 +1100 BE: 0 in device tiles netalertx#1238 Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit c4a041e Author: Adam Outler <adamoutler@gmail.com> Date: Sat Oct 25 17:58:21 2025 +0000 Coderabit changes commit 170aeb0 Author: jokob-sk <jokob.sk@gmail.com> Date: Sat Oct 25 13:48:56 2025 +1100 PLUG: SNMPDSC timeout not respected netalertx#1231 Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit fe69972 Author: jokob-sk <jokob.sk@gmail.com> Date: Sat Oct 25 09:28:03 2025 +1100 DOCS: install refactor work Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit 32f9111 Author: Adam Outler <adamoutler@gmail.com> Date: Fri Oct 24 20:32:50 2025 +0000 Restore test_safe_builder_unit.py to upstream version (remove local changes) commit bb35417 Merge: fe69bc4 05890b3 Author: Jokob @netalertx <96159884+jokob-sk@users.noreply.github.com> Date: Sat Oct 25 07:07:12 2025 +1100 Merge pull request netalertx#1237 from JVKeller/patch-3 Change branch back to main. commit fe69bc4 Merge: 6a20128 c278865 Author: Jokob @netalertx <96159884+jokob-sk@users.noreply.github.com> Date: Sat Oct 25 07:06:41 2025 +1100 Merge pull request netalertx#1236 from AlmazzikDev/patch-1 Rename CONTRIBUTING to CONTRIBUTING.md commit 05890b3 Author: rell3k <keller.jeff@gmail.com> Date: Fri Oct 24 09:24:01 2025 -0400 Change branch back to main. Forgot to change git clone branch back to main. commit c278865 Author: Almaz <almaz@weissx.net> Date: Fri Oct 24 15:35:18 2025 +0300 Rename CONTRIBUTING to CONTRIBUTING.md commit 7f74c2d Author: Adam Outler <adamoutler@gmail.com> Date: Thu Oct 23 21:37:11 2025 -0400 docker compose changes commit 5a63b72 Merge: 0897c05 6a20128 Author: Adam Outler <adamoutler@gmail.com> Date: Thu Oct 23 21:19:30 2025 -0400 Merge main into hardening-fixes commit 0897c05 Author: Adam Outler <adamoutler@gmail.com> Date: Thu Oct 23 21:16:15 2025 -0400 Tidy up output commit 7a3bf67 Author: Adam Outler <adamoutler@gmail.com> Date: Thu Oct 23 20:46:39 2025 -0400 Remove code coverage from repository commit edd5bd2 Author: Adam Outler <adamoutler@gmail.com> Date: Thu Oct 23 23:33:04 2025 +0000 Devcontainer setup commit 3b7830b Author: Adam Outler <adamoutler@gmail.com> Date: Thu Oct 23 21:15:15 2025 +0000 Add unit tests and updated messages commit 356caca Author: Adam Outler <adamoutler@gmail.com> Date: Thu Oct 23 21:15:02 2025 +0000 Don't increment sqlite sequence commit d12ffb3 Author: Adam Outler <adamoutler@gmail.com> Date: Thu Oct 23 21:04:15 2025 +0000 Update readme with simple build instructions commit f70d3f3 Author: Adam Outler <adamoutler@gmail.com> Date: Thu Oct 23 20:36:04 2025 +0000 Limiter fix for older kernels commit 2789946 Author: Adam Outler <adamoutler@gmail.com> Date: Thu Oct 23 08:36:42 2025 +0000 use system speedtest, not un-updated & removed script commit 59c7d7b Author: Adam Outler <adamoutler@gmail.com> Date: Thu Oct 23 00:27:16 2025 +0000 Add test dependencies commit 0851680 Author: Adam Outler <adamoutler@gmail.com> Date: Wed Oct 22 23:51:36 2025 +0000 Add additional startup checks commit 1af19fe Author: Adam Outler <adamoutler@gmail.com> Date: Wed Oct 22 23:51:15 2025 +0000 Only nginx/python errors in docker logs. no stdout from backend. commit ce8bb53 Author: Adam Outler <adamoutler@gmail.com> Date: Wed Oct 22 19:48:58 2025 -0400 Refine devcontainer setup and docker tests commit 5636a15 Author: Adam Outler <adamoutler@gmail.com> Date: Wed Oct 22 00:02:03 2025 +0000 Add check permissions script commit 6a20128 Author: jokob-sk <jokob.sk@gmail.com> Date: Wed Oct 22 07:48:50 2025 +1100 BE: install refactor work Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit 05f0837 Author: Adam Outler <adamoutler@gmail.com> Date: Tue Oct 21 19:18:59 2025 +0000 Fix missing storage check commit 3441f77 Author: Adam Outler <adamoutler@gmail.com> Date: Tue Oct 21 19:10:48 2025 +0000 Fix always fresh install env commit d6bcb27 Author: Adam Outler <adamoutler@gmail.com> Date: Tue Oct 21 19:05:47 2025 +0000 Missing devcontainer build timestamp commit 5d7af88 Merge: b916542 6f2e556 Author: Jokob @netalertx <96159884+jokob-sk@users.noreply.github.com> Date: Tue Oct 21 12:35:08 2025 +1100 Merge pull request netalertx#1230 from adamoutler/hardening Feat: Enterprise-Grade Security Hardening and Build Overhaul commit 6f2e556 Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 19 12:18:16 2025 -0400 Remove duplicate file replacement logic in update_vendors.sh Dang it coderabbit. We expect more of your diffs. commit ea4c70e Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 19 12:15:55 2025 -0400 Update install/production-filesystem/services/scripts/check-first-run-config.sh Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> commit 5ed46da Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 19 15:55:28 2025 +0000 Set caps on actual python3.12 commit 628f35c Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 19 15:41:57 2025 +0000 Remove unused pythonpathpath variable commit 066fecf Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 19 15:39:54 2025 +0000 add caps to python instead of scapy. commit 660f0c2 Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 19 11:37:04 2025 -0400 Update install/production-filesystem/services/scripts/update_vendors.sh Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> commit 999feb2 Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 19 11:36:09 2025 -0400 Update install/production-filesystem/services/scripts/update_vendors.sh Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> commit 86bf0a3 Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 19 11:35:27 2025 -0400 Update install/production-filesystem/services/scripts/check-first-run-config.sh Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> commit 8eab7ee Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 19 11:33:07 2025 -0400 Update .devcontainer/scripts/setup.sh Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> commit 84f1283 Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 19 15:27:55 2025 +0000 Add novel coderabit no-write database creation commit dcf250d Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 19 15:12:27 2025 +0000 Coderabbit nitpicks. commit 131c0c0 Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 19 14:28:09 2025 +0000 Fix fish terminal. Smarter code completion and other nicities. commit a58b3e3 Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 19 14:18:07 2025 +0000 Coderabbit suggestions commit 14be7a2 Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 19 02:45:19 2025 +0000 Missing Slash commit 9b3ddda Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 19 02:35:57 2025 +0000 Fix persistent environment issues commit 1f46f20 Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 19 01:06:42 2025 +0000 Generate devcontainer configs commit 80c1459 Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 19 00:39:26 2025 +0000 Final touches on devcontainer commit 62536e4 Author: Adam Outler <adamoutler@gmail.com> Date: Sat Oct 18 14:07:27 2025 -0400 Coderabit suggestions commit 028335c Author: Adam Outler <adamoutler@gmail.com> Date: Sat Oct 18 13:45:48 2025 -0400 Coderabit suggestions commit 7483e46 Merge: c1b573f b916542 Author: Adam Outler <adamoutler@gmail.com> Date: Sat Oct 18 13:23:57 2025 -0400 Merge remote-tracking branch 'origin/main' into hardening commit c1b573f Author: Adam Outler <adamoutler@gmail.com> Date: Sat Oct 18 13:16:35 2025 -0400 Add some todos commit d11c9d7 Author: Adam Outler <adamoutler@gmail.com> Date: Fri Oct 17 16:36:48 2025 -0400 Improve warnings. commit b916542 Author: jokob-sk <jokob.sk@gmail.com> Date: Fri Oct 17 21:33:43 2025 +1100 BE: DB generate=ing script Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit 6da3cfd Author: jokob-sk <jokob.sk@gmail.com> Date: Fri Oct 17 21:33:22 2025 +1100 FE: docs mikrotik Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit d38e77f Author: jokob-sk <jokob.sk@gmail.com> Date: Fri Oct 17 21:32:53 2025 +1100 docs Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit 18eaee4 Author: jokob-sk <jokob.sk@gmail.com> Date: Fri Oct 17 21:32:22 2025 +1100 FE: lang Signed-off-by: jokob-sk <jokob.sk@gmail.com> commit 59e7463 Author: Safeguard <yo-safeguard@yandex.ru> Date: Thu Oct 16 10:55:31 2025 +0200 Translated using Weblate (Russian) Currently translated at 100.0% (762 of 762 strings) Translation: NetAlertX/core Translate-URL: https://hosted.weblate.org/projects/pialert/core/ru/ commit dc44411 Author: Adam Outler <adamoutler@gmail.com> Date: Thu Oct 16 21:49:54 2025 -0400 Improve mount permissions commit a3dae08 Author: Adam Outler <adamoutler@gmail.com> Date: Thu Oct 16 19:51:57 2025 -0400 Fix debian docker start commit e733f8a Author: Adam Outler <adamoutler@gmail.com> Date: Thu Oct 16 16:17:37 2025 -0400 Relay failed status to docker. commit ad0ddda Merge: 3686a4a 28e0e4a Author: Jokob @netalertx <96159884+jokob-sk@users.noreply.github.com> Date: Thu Oct 16 12:50:08 2025 +1100 Merge pull request netalertx#1229 from adamoutler/patch-5 Add script to regenerate the database from schema commit 28e0e4a Author: Adam Outler <adamoutler@gmail.com> Date: Wed Oct 15 20:53:03 2025 -0400 Fix database regeneration script to use correct file commit 324cde9 Author: Adam Outler <adamoutler@gmail.com> Date: Wed Oct 15 20:50:42 2025 -0400 Add script to regenerate the database from schema This script recreates the database from schema code and imports the schema into the new database file. commit f57ec74 Author: Adam Outler <adamoutler@gmail.com> Date: Thu Oct 16 00:09:07 2025 +0000 Minor alterations to ddevcontainer. commit de92c95 Author: Adam Outler <adamoutler@gmail.com> Date: Wed Oct 15 18:18:30 2025 -0400 break apart services, fix startup commit 3686a4a Author: anton garcias <isaga.percompartir@gmail.com> Date: Mon Oct 13 22:37:42 2025 +0200 Translated using Weblate (Catalan) Currently translated at 100.0% (762 of 762 strings) Translation: NetAlertX/core Translate-URL: https://hosted.weblate.org/projects/pialert/core/ca/ commit 44ba945 Author: Ettore Atalan <atalanttore@googlemail.com> Date: Sun Oct 12 22:12:37 2025 +0200 Translated using Weblate (German) Currently translated at 81.3% (620 of 762 strings) Translation: NetAlertX/core Translate-URL: https://hosted.weblate.org/projects/pialert/core/de/ commit 5109a08 Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 12 21:00:27 2025 -0400 Additional hardening commit 1be9155 Author: Adam Outler <adamoutler@gmail.com> Date: Sun Oct 12 15:05:20 2025 -0400 Set container parameters commit 3bf6ce6 Author: R <15691591183@163.com> Date: Sun Oct 12 15:49:48 2025 +0200 Translated using Weblate (Chinese (Simplified Han script)) Currently translated at 100.0% (762 of 762 strings) Translation: NetAlertX/core Translate-URL: https://hosted.weblate.org/projects/pialert/core/zh_Hans/ commit 1532256 Author: Massimo Pissarello <mapi68@gmail.com> Date: Sat Oct 11 01:39:43 2025 +0200 Translated using Weblate (Italian) Currently translated at 100.0% (762 of 762 strings) Translation: NetAlertX/core Translate-URL: https://hosted.weblate.org/projects/pialert/core/it/ commit be73e3a Author: Adam Outler <adamoutler@gmail.com> Date: Thu Oct 9 20:30:25 2025 -0400 debian dockerfile completed properly. commit 016a6ad Author: Adam Outler <adamoutler@gmail.com> Date: Wed Oct 8 19:55:16 2025 -0400 Dockerfile.debian building and running commit 558ab44 Author: Adam Outler <adamoutler@gmail.com> Date: Mon Oct 6 23:31:20 2025 +0000 Minimize differences between devcontainer and production commit 290b6c6 Author: Adam Outler <adamoutler@gmail.com> Date: Sat Oct 4 18:51:10 2025 +0000 Remove nohup.out commit ada9271 Author: Adam Outler <adamoutler@gmail.com> Date: Fri Oct 3 22:12:42 2025 +0000 all debugging online. commit 1e04e9f Author: Adam Outler <adamoutler@gmail.com> Date: Fri Oct 3 00:33:20 2025 +0000 Remove .git-placeholder, add dockerignore commit c81a054 Author: Adam Outler <adamoutler@gmail.com> Date: Fri Oct 3 00:08:26 2025 +0000 Coderabit commit 33aa849 Author: Adam Outler <adamoutler@gmail.com> Date: Thu Oct 2 21:19:29 2025 +0000 Debugging operational in vscode commit 0cd1dc8 Author: Adam Outler <adamoutler@gmail.com> Date: Tue Sep 30 22:01:03 2025 -0400 Scanning Operational with monitoring commit 044035e Author: Adam Outler <adamoutler@gmail.com> Date: Tue Sep 30 01:55:26 2025 +0000 Devcontainer overlay commit dc4848a Author: Adam Outler <adamoutler@gmail.com> Date: Sun Sep 28 21:59:06 2025 -0400 Information on default config and entrypoints for debug commit c6efe5a Author: Adam Outler <adamoutler@gmail.com> Date: Sun Sep 28 17:10:15 2025 -0400 All services moved to deployed filesystem commit d182a55 Author: Adam Outler <adamoutler@gmail.com> Date: Sat Sep 27 21:58:00 2025 -0400 Move filesystem to more generic name & add perms commit b47df7b Author: Adam Outler <adamoutler@gmail.com> Date: Sat Sep 27 19:48:36 2025 -0400 capcheck commit 46097bb Author: Adam Outler <adamoutler@gmail.com> Date: Sat Sep 27 19:15:07 2025 -0400 solid hardened config commit c5d7480 Merge: 2def3f1 d9feddd Author: Adam Outler <adamoutler@gmail.com> Date: Sat Sep 27 09:00:46 2025 -0400 Merge branch 'jokob-sk:main' into hardening commit 2def3f1 Author: Adam Outler <adamoutler@gmail.com> Date: Fri Sep 26 21:01:58 2025 -0400 Validated launch on runner & hardend commit 2419a26 Author: Adam Outler <adamoutler@gmail.com> Date: Fri Sep 26 17:52:17 2025 +0000 updated devcontainer dockerfile commit bad67b2 Author: Adam Outler <adamoutler@gmail.com> Date: Fri Sep 26 17:52:11 2025 +0000 fix dockerfile error commit 178fb54 Author: Adam Outler <adamoutler@gmail.com> Date: Fri Sep 26 17:32:58 2025 +0000 Python up and debuggable commit b0a6f88 Author: Adam Outler <adamoutler@gmail.com> Date: Fri Sep 26 17:14:20 2025 +0000 Update gitignore commit 798d246 Author: Adam Outler <adamoutler@gmail.com> Date: Fri Sep 26 11:56:27 2025 +0000 expand initial filesystem commit c228d45 Author: Adam Outler <adamoutler@gmail.com> Date: Thu Sep 25 23:03:55 2025 +0000 Devcontainer operational, services all down commit dfcc375 Author: Adam Outler <adamoutler@gmail.com> Date: Thu Sep 25 14:10:06 2025 -0400 Non-root launch commit 8ed21a8 Author: Adam Outler <adamoutler@gmail.com> Date: Thu Sep 25 07:43:42 2025 -0400 monolithic alpine container commit 2e694a7 Author: Adam Outler <adamoutler@gmail.com> Date: Wed Sep 24 19:46:11 2025 -0400 using 4 startup scripts instead of RC6 commit 29aa884 Author: Adam Outler <adamoutler@gmail.com> Date: Wed Sep 24 16:29:15 2025 -0400 architectural change 1
This commit fundamentally refactors the NetAlertX Docker build process, elevating it from a basic, minimal, functional setup to an enterprise-grade, security-first appliance. The primary goal is to drastically reduce the attack surface and implement a defense-in-depth strategy, making the container suitable for deployment in security-sensitive environments.
This is achieved by introducing a new, heavily hardened, multi-stage
Dockerfilebased on Alpine Linux, defining a secure filesystem layout, and clearly delineating it from a legacyDockerfile.debianintended only for development and testing.1. The New Hardened
Dockerfile(Alpine)The main
Dockerfilenow implements a three-stage build process to create a minimal, locked-down, and production-ready image.Stage 1:
buildergcc,musl-dev) and creates a Python virtual environment (venv).Stage 2:
runnernmap,php,python3, etc.) and copies the application code and thevenvfrom thebuilderstage.Stage 3:
hardened(The Production Image)This is the final stage and the core of the security overhaul. It takes the
runnerimage and applies a comprehensive set of security restrictions based on the principle of least privilege.Key Hardening Measures:
/app/server,/app/front) and service configurations are made read-only. This prevents any modification of the application code at runtime.netalertxuser (UID 20211): The application now runs as this unprivileged user.readonlyuser (UID 20212): A special user with no shell or write permissions owns the read-only application files. This is an "ownership-as-a-lock" pattern; even if an attacker gains control of thereadonlyuser, they cannot modify the files it owns.netalertx, and root access is effectively removed.apkis deleted from the final image, preventing the installation of new packages.sudo,/etc/sudoers,/etc/shadow, and/etc/gshadoware deleted./home,/root,/media, and/mntare removed./etc/passwdand/etc/groupare stripped to contain only thenetalertxandreadonlyusers/groups.nmap,arp-scan,nbtscan).setcap cap_net_raw,cap_net_admin+eipallows these tools to perform network scans without needing full root access.UMASK=0077: Ensures that any files created at runtime (in the writable directories) are private by default, accessible only by thenetalertxuser.sudoStub:sudois replaced with a harmless shell script stub. Any attempt by compromised code to callsudowill fail safely.HEALTHCHECKinstruction has been added. It periodically runs a script to verify that the application is running correctly, allowing container orchestrators to automatically restart the container if it becomes unhealthy.2.
Dockerfile.debian: A Compatibility and Testing ImageDockerfile.debianis provided for backward compatibility and testing purposes only.Dockerfile.debianserve as a checklist of modern security practices, highlighting the value of the hardened Alpine image by comparison.3. New Secure Filesystem Layout
A new, secure "Overlay" filesystem structure has been implemented to enforce a strict separation between immutable code and mutable runtime data. This is a cornerstone of the hardening strategy.
/app- Application Directory:back,front, andserverdirectories contain the application source code and are set to read-only, owned by thereadonlyuser.config,db,log, andapiare the only writable directories within/app. They are owned by thenetalertxuser with700permissions, ensuring that runtime data, logs, and configuration are isolated and cannot be accessed by other users. During normal operations, a ramdisk or a mount is required for each of these folders as the container is expected to be read-only./services- Service Management:nginx,php-fpm, andcrond. This directory is mostly read-only in the final image with the exception of the /services/run folder which contains lock files andtmpfunctions on a ramdisk./services/run./opt/venv- Python Virtual Environment:venvis entirely read-only, preventing any modification or installation of new packages at runtime.This filesystem design ensures the integrity of the application by making the code and configuration immutable while providing secure, isolated locations for necessary runtime data.
Summary of Impact
This is a transformative change for NetAlertX, moving it from a project that "just works" in Docker to one that adheres to enterprise-grade security standards.
Future enhancements
TODO.Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores