Skip to content

Commit

Permalink
feature(trust): improved remote ip internal proxy support (#300)
Browse files Browse the repository at this point in the history
* feat(trusted_proxy): Add support for RemoteIPInternalProxy

* fix(syntax): add semicolon
  • Loading branch information
Marius van Witzenburg authored Jan 8, 2021
1 parent 6c52933 commit 22c647e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apache/files/Debian/conf-available/remoteip.conf.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ RemoteIPHeader {{ salt['pillar.get']('apache:mod_remoteip:RemoteIPHeader', 'X-Fo
{%- for trusted_proxy in salt['pillar.get']('apache:mod_remoteip:RemoteIPTrustedProxy', []) %}
RemoteIPTrustedProxy {{ trusted_proxy }}
{%- endfor %}
{%- for trusted_proxy in salt['pillar.get']('apache:mod_remoteip:RemoteIPInternalProxy', []) %}
RemoteIPInternalProxy {{ trusted_proxy }}
{%- endfor %}
3 changes: 3 additions & 0 deletions apache/files/RedHat/conf.modules.d/remoteip.conf.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ RemoteIPHeader {{ salt['pillar.get']('apache:mod_remoteip:RemoteIPHeader', 'X-Fo
{%- for trusted_proxy in salt['pillar.get']('apache:mod_remoteip:RemoteIPTrustedProxy', []) %}
RemoteIPTrustedProxy {{ trusted_proxy }}
{%- endfor %}
{%- for trusted_proxy in salt['pillar.get']('apache:mod_remoteip:RemoteIPInternalProxy', []) %}
RemoteIPInternalProxy {{ trusted_proxy }}
{%- endfor %}
3 changes: 3 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,9 @@ apache:
RemoteIPTrustedProxy:
- 10.0.8.0/24
- 127.0.0.1
RemoteIPInternalProxy:
- 10.10.8.0/24
- 127.0.0.1

# ``apache.mod_security`` formula additional configuration:
mod_security:
Expand Down
3 changes: 3 additions & 0 deletions test/salt/pillar/modules.sls
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,9 @@ apache:
RemoteIPTrustedProxy:
- 10.0.8.0/24
- 127.0.0.1
RemoteIPInternalProxy:
- 10.10.8.0/24
- 127.0.0.1

# ``apache.mod_security`` formula additional configuration:
mod_security:
Expand Down

0 comments on commit 22c647e

Please sign in to comment.