Compare commits
11 Commits
82151639ab
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| 113e72401e | |||
| 23ad0ff277 | |||
| ee8242d842 | |||
| 9ad7e73946 | |||
| 61705dd02f | |||
| 95d216ccd5 | |||
| d41bfb5aad | |||
| daa4a1c745 | |||
| deabcf2f69 | |||
| a5a4c6ab90 | |||
| 8336445ae8 |
BIN
files/usertwist
(Stored with Git LFS)
BIN
files/usertwist
(Stored with Git LFS)
Binary file not shown.
@@ -15,6 +15,7 @@ ProtectKernelModules=yes
|
||||
ProtectControlGroups=yes
|
||||
PrivateDevices=yes
|
||||
RestrictSUIDSGID=true
|
||||
ProtectHome=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -38,6 +38,7 @@
|
||||
name: usertwist
|
||||
group: usertwist
|
||||
system: true
|
||||
shell: /usr/sbin/nologin
|
||||
|
||||
- name: Put the service binary on the remote server
|
||||
ansible.builtin.copy:
|
||||
|
||||
@@ -1,31 +1,14 @@
|
||||
Role Name
|
||||
Setup IPTables
|
||||
=========
|
||||
|
||||
A brief description of the role goes here.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
|
||||
|
||||
Role Variables
|
||||
--------------
|
||||
|
||||
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
|
||||
Create iptables rules on the remote server to allow connection on WEB and SSH ports only
|
||||
|
||||
Example Playbook
|
||||
----------------
|
||||
|
||||
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
|
||||
|
||||
- hosts: servers
|
||||
roles:
|
||||
- { role: username.rolename, x: 42 }
|
||||
- setup_iptables
|
||||
|
||||
License
|
||||
-------
|
||||
@@ -35,4 +18,5 @@ BSD
|
||||
Author Information
|
||||
------------------
|
||||
|
||||
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
|
||||
Motysten
|
||||
E-Mail : mdm@athelas.fr
|
||||
|
||||
@@ -14,7 +14,7 @@ galaxy_info:
|
||||
# - GPL-3.0-only
|
||||
# - Apache-2.0
|
||||
# - CC-BY-4.0
|
||||
license: license (GPL-2.0-or-later, MIT, etc)
|
||||
license: MIT
|
||||
|
||||
min_ansible_version: 2.1
|
||||
|
||||
|
||||
@@ -11,7 +11,35 @@
|
||||
- "443"
|
||||
- "80"
|
||||
|
||||
- name: Accept connection on lo (for Caddy <-> usertwist communication)
|
||||
ansible.builtin.iptables:
|
||||
chain: INPUT
|
||||
protocol: tcp
|
||||
in_interface: lo
|
||||
jump: ACCEPT
|
||||
|
||||
- name: Set INPUT policy to DROP
|
||||
ansible.builtin.iptables:
|
||||
chain: INPUT
|
||||
policy: DROP
|
||||
policy: DROP
|
||||
|
||||
- name: Create iptables folder in /etc
|
||||
ansible.builtin.file:
|
||||
path: /etc/ansible
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Install iptables-persistent for rules persistence
|
||||
ansible.builtin.package:
|
||||
name: iptables-persistent
|
||||
update_cache: true
|
||||
|
||||
- name: Save IPv4 rules to keep them on reboot
|
||||
community.general.iptables_state:
|
||||
state: saved
|
||||
path: /etc/iptables/rules.v4
|
||||
|
||||
- name: Save IPv6 rules to keep them on reboot
|
||||
community.general.iptables_state:
|
||||
state: saved
|
||||
path: /etc/iptables/rules.v6
|
||||
Reference in New Issue
Block a user