Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
server_security
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Le Filament
Ansible Roles
server_security
Commits
328b050c
Commit
328b050c
authored
2 years ago
by
Théo - Le Filament
Browse files
Options
Downloads
Patches
Plain Diff
fix error when groups are missing
parent
683faade
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/iptables.conf.j2
+5
-5
5 additions, 5 deletions
templates/iptables.conf.j2
with
5 additions
and
5 deletions
templates/iptables.conf.j2
+
5
−
5
View file @
328b050c
...
@@ -3,11 +3,11 @@
...
@@ -3,11 +3,11 @@
:INPUT DROP [0:0]
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT DROP [0:0]
:OUTPUT DROP [0:0]
{% if inventory_hostname in groups.docker_elk %}
{% if
'docker_elk' in groups and
inventory_hostname in groups.docker_elk %}
:DOCKER-USER - [0:0]
:DOCKER-USER - [0:0]
{% endif %}
{% endif %}
:LOGGING - [0:0]
:LOGGING - [0:0]
{% if inventory_hostname in groups.docker_elk %}
{% if
'docker_elk' in groups and
inventory_hostname in groups.docker_elk %}
## DOCKER-USER chain
## DOCKER-USER chain
# Autoriser les logs entrants des serveurs en maintenance
# Autoriser les logs entrants des serveurs en maintenance
{% for host in groups.full_maintenance %}
{% for host in groups.full_maintenance %}
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
{% endif %}
{% endif %}
{% if inventory_hostname in groups.docker_nagios %}
{% if
'docker_gitlab' in groups and
inventory_hostname in groups.docker_nagios %}
-A INPUT -s 192.168.239.0/24 -p tcp -m tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT
-A INPUT -s 192.168.239.0/24 -p tcp -m tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT
{% endif %}
{% endif %}
# NRPE
# NRPE
...
@@ -72,7 +72,7 @@
...
@@ -72,7 +72,7 @@
-A OUTPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 22 -j ACCEPT
{% endif %}
{% endif %}
-A OUTPUT -p tcp -m tcp --dport {{ default_sshd_port }} -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport {{ default_sshd_port }} -j ACCEPT
{% for host in groups.gitlab | union(groups.docker_gitlab) %}
{% for host in groups.gitlab | union(groups.docker_gitlab
| default([])
) %}
-A OUTPUT -d {{ hostvars[host].ansible_host }} -p tcp -m tcp --dport 22 -j ACCEPT
-A OUTPUT -d {{ hostvars[host].ansible_host }} -p tcp -m tcp --dport 22 -j ACCEPT
-A OUTPUT -d {{ hostvars[host].ansible_host }} -p tcp -m tcp --dport 5050 -j ACCEPT
-A OUTPUT -d {{ hostvars[host].ansible_host }} -p tcp -m tcp --dport 5050 -j ACCEPT
{% endfor %}
{% endfor %}
...
@@ -100,7 +100,7 @@
...
@@ -100,7 +100,7 @@
-A OUTPUT -p udp -m udp --dport 11371 -j ACCEPT
-A OUTPUT -p udp -m udp --dport 11371 -j ACCEPT
{% if inventory_hostname in groups.full_maintenance %}
{% if inventory_hostname in groups.full_maintenance %}
# Log Server
# Log Server
{% for host in groups.docker_elk %}
{% for host in groups.docker_elk
| default([])
%}
-A OUTPUT -d {{ hostvars[host].ansible_host }} -p tcp -m tcp --dport {{ logstash_port }} -j ACCEPT
-A OUTPUT -d {{ hostvars[host].ansible_host }} -p tcp -m tcp --dport {{ logstash_port }} -j ACCEPT
{% endfor %}
{% endfor %}
-A OUTPUT -d {{ logstash_public_ip }} -p tcp -m tcp --dport {{ logstash_port }} -j ACCEPT
-A OUTPUT -d {{ logstash_public_ip }} -p tcp -m tcp --dport {{ logstash_port }} -j ACCEPT
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment