Add GUI IP Access Restriction feature#10112
Conversation
Implement IP-based access control for the web GUI to prevent unauthorized access from non-whitelisted addresses. This feature: - Adds System > Settings > Administration > IP Access Control section - Enforces IP whitelist on every HTTP request (not just login) - Supports single IPv4/IPv6 addresses and CIDR subnets - Logs all blocked/allowed access events to audit log with [GUI-ACL] prefix - Includes lockout prevention validation on both client and server side - Integrates with existing Audit log viewer for reviewing access events Files modified: - authgui.inc: Added check_security_ip_acl() enforcement function - system_advanced_admin.php: Added UI form, configuration handling, and JavaScript - ACL.xml: Registered audit log page for privilege assignment The feature is disabled by default and only blocks traffic when explicitly enabled and configured with allowed networks.
|
just add a firewall rule, optionally with an alias to lock out (or lock-in) only specific networks on the network layer. |
|
Thanks for the suggestion! I understand the point about using firewall rules + aliases at the network layer - OPNsense However, the GUI IP Access Restriction feature I added is complementary and serves a different purpose: Network Layer (Existing in OPNsense):
Application Layer (This new feature):
Both can be used together for defence in depth:
This gives admins flexibility - they can restrict just the GUI without blocking entire device access. |
|
@Monviech good point, almost forgot about that one :) Group access controls are documented in https://docs.opnsense.org/manual/users.html#users-groups-privileges |
|
So this feature is not a valid point to add one, as we have other ways to deal with it, right? |
|
You could also use a reverse proxy (there are a few, OPNWAF https://docs.opnsense.org/vendor/deciso/opnwaf.html for example which is apache based and in our business core product) or caddy, ha-proxy etc, and then use them for e.g. certificate auth or IP address restrictions when reverse proxying the WebGUI. Inside core, the user group privileges (so API access) can have individual IP access ranges defined, the WebGUI will still show, but you are not allowed to log in. API restrictions are quite common on other platforms as well. As there is enough flexibility with other available options already, your proposal does not fit in that well. (Also something like this is way better security wise, nobody can spoof a certificate, source IP restrictions is essentially a bit like smoke and mirrors.) |
Summary
Implement IP-based access control for the web GUI to restrict access to non-whitelisted IP addresses.
Changes
check_security_ip_acl()enforcement function that validates every request against configured IP whitelistFeatures
Testing
127.0.0.1to allowed networks and saveLog Output
[GUI-ACL] BLOCKED access from X.X.X.X (not in whitelist)[GUI-ACL] ALLOWED access from X.X.X.X(logged once per session)