Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,18 @@ http_access allow local_auth

#
# ACL - localnet - default these include ranges from selected interfaces (Allow local subnets)
{% if helpers.exists('OPNsense.proxy.forward.icap.enable') and OPNsense.proxy.forward.icap.enable == '1' %}
{% if helpers.exists('OPNsense.proxy.forward.icap.ResponseURL') %}
{% if helpers.exists('OPNsense.proxy.forward.addACLforInterfaceSubnets') and OPNsense.proxy.forward.addACLforInterfaceSubnets == '1'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why would you make the use of ICAP dependent on subnets. This does not make sense to me.

adaptation_access does not grant access to the proxy. This is done using http_access.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this relates to link-local addresses and localnet acl.
if there's no localnet acl - because link local addresses are removed/disabled and proxy interface netowrks aren't added to localnet -, the generated config will be invalid because localnet is referenced by the generated config part in this section.

and helpers.exists('OPNsense.proxy.forward.interfaces') and OPNsense.proxy.forward.interfaces != '' %}
{% if helpers.exists('OPNsense.proxy.forward.icap.enable') and OPNsense.proxy.forward.icap.enable == '1' %}
{% if helpers.exists('OPNsense.proxy.forward.icap.ResponseURL') %}
adaptation_access response_mod allow localnet
{% endif %}
{% if helpers.exists('OPNsense.proxy.forward.icap.RequestURL') %}
{% endif %}
{% if helpers.exists('OPNsense.proxy.forward.icap.RequestURL') %}
adaptation_access request_mod allow localnet
{% endif %}
{% endif %}
{% endif %}
http_access allow localnet
{% endif %}

# ACL - localhost
{% if helpers.exists('OPNsense.proxy.forward.icap.enable') and OPNsense.proxy.forward.icap.enable == '1' %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ acl localnet src {{intf_item.subnet}}/{{intf_item.subnet_bits}} # Possible inter
{% endif %}
{% endif %}
{% endif %}
# Default allow for local-link and private networks
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why delete it - would make more sense to have it behind a checkbox

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These link-local IPv6 ranges silently allow proxy usage from any device in a network where Squid is listening.
This rule allows proxy usage in config: http_access allow localnet

If I select some interfaces in Proxy interfaces selectbox, my options to block link local addresses is firewall or proxy authentication.
In my case squid listens in a service network but client networks are not reachable directly by OPNsense, so clients are allowed by a network list in "Allowed Subnets" options. (I don't want all devices to be able to use proxy in service network.)

I think this link local based proxy usage is a good feature so it would be better behind a checkbox or as a default value in "Allowed Subnets".


# ACL - Allow localhost for PURGE cache if enabled
{% if helpers.exists('OPNsense.proxy.general.cache.local') and OPNsense.proxy.general.cache.local.enabled == '1' %}
Expand Down