en:security:reaction
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:security:reaction [2024/08/07 22:08] – [Architecture] lonclegr | en:security:reaction [2025/08/03 13:23] (current) – lonclegr | ||
|---|---|---|---|
| Line 13: | Line 13: | ||
| So I configured [[en: | So I configured [[en: | ||
| - | I accepted the risk because of two thins: | + | I accepted the risk because of two facts: | 
| - Since IPs don't change very often and I have two different ISP, the probability that both of them change at the same time is very low. So if one IP changes and I lose access to my server I can go the second home and update the configuration accordingly. | - Since IPs don't change very often and I have two different ISP, the probability that both of them change at the same time is very low. So if one IP changes and I lose access to my server I can go the second home and update the configuration accordingly. | ||
| - Worst case scenario, I can use the emergency console access from my server provider and update the configuration of [[en: | - Worst case scenario, I can use the emergency console access from my server provider and update the configuration of [[en: | ||
| Line 23: | Line 23: | ||
| I decided that I was going to use my last option: emergency console access to my server from the provider. But bad surprise again, my provider did not provide such a service. | I decided that I was going to use my last option: emergency console access to my server from the provider. But bad surprise again, my provider did not provide such a service. | ||
| - | As a result, I lost access to my server for days. In the meantime, I was looking for a more robust design. That's how [[https:// | + | As a result, I lost access to my server for days. In the meantime, I was looking for a more robust design. That's how [[https:// | 
| + | ===== New architecture ===== | ||
| + | |||
| + | In this new architecture, | ||
| + | |||
| + | {{ : | ||
| + | ===== Why not Fail2ban ? ===== | ||
| + | |||
| + | Well, for two main reasons I decided to use [[https:// | ||
| + | - Fail2ban is an old software with few new features | ||
| + | - Reaction uses recent technologies and is very efficient. And cherry on the cake, it has an ultimate goal of federating black-listed-IPs. | ||
| + | |||
| + | |||
| + | And since a good drawing is always better than long speech, let me share with you this one made by [[https:// | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | |||
| + | |||
| + | ===== Feedback ===== | ||
| + | |||
| + | I am using this tool within this new architecture for weeks now and I am very satisfied. | ||
| + | |||
| + | ==== Usage ==== | ||
| + | |||
| + | The service is up for 2 weeks and 2 days and memory usage is very low. | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | ==== Ansible playbook ==== | ||
| + | |||
| + | Here is my playbook I use to setup it on my server. It is not perfect but if it can help you to test easily 8-) | ||
| + | |||
| + | :!: I upgraded to reaction v2 on August 2025. Please [[reaction-v2|check it]]. | ||
| + | |||
| + | <code yaml> | ||
| + | - name: install packages required to have logs | ||
| + | package: | ||
| + | name: "{{ item }}" | ||
| + | state: latest | ||
| + | with_items: | ||
| + | - iptables | ||
| + | - iptables-persistent | ||
| + | - logrotate | ||
| + | - rsyslog | ||
| + | become: True | ||
| + | |||
| + | - name: stop reaction if running | ||
| + | service: | ||
| + | name: reaction.service | ||
| + | state: stopped | ||
| + | become: True | ||
| + | ignore_errors: | ||
| + | |||
| + | - name: download binary | ||
| + | ansible.builtin.get_url: | ||
| + | url: https:// | ||
| + | dest: / | ||
| + | mode: ' | ||
| + | become: True | ||
| + | |||
| + | - name: copy systemd file | ||
| + | copy: | ||
| + | src: files/ | ||
| + | dest: / | ||
| + | owner: root | ||
| + | group: root | ||
| + | mode: 0700 | ||
| + | become: True | ||
| + | |||
| + | |||
| + | - name: copy reaction.yml | ||
| + | copy: | ||
| + | src: files/ | ||
| + | dest: / | ||
| + | owner: root | ||
| + | group: root | ||
| + | mode: 0755 | ||
| + | become: True | ||
| + | |||
| + | - name: reload daemon | ||
| + | command: " | ||
| + | become: True | ||
| + | |||
| + | |||
| + | - name: enable reaction | ||
| + | command: " | ||
| + | become: True | ||
| + | |||
| + | - name: restart reaction | ||
| + | service: | ||
| + | name: reaction.service | ||
| + | state: restarted | ||
| + | become: True | ||
| + | </ | ||
| + | |||
| + | and the config file for SSH based on [[https:// | ||
| + | |||
| + | < | ||
| + | patterns: | ||
| + | ip: | ||
| + | regex: ' | ||
| + | streams: | ||
| + | ssh: | ||
| + | cmd: [' | ||
| + | filters: | ||
| + | fail: | ||
| + | regex: | ||
| + | - ' | ||
| + | - ' | ||
| + | - ' | ||
| + | |||
| + | retry: 3 | ||
| + | retryperiod: | ||
| + | actions: | ||
| + | ban: | ||
| + | cmd: [' | ||
| + | unban: | ||
| + | cmd: [' | ||
| + | after: ' | ||
| + | start: | ||
| + | - [ ' | ||
| + | - [ ' | ||
| + | stop: | ||
| + | - [ ' | ||
| + | - [ ' | ||
| + | - [ ' | ||
| + | </ | ||
| + | |||
| + | and the service | ||
| + | |||
| + | < | ||
| + | [Install] | ||
| + | WantedBy=multi-user.target | ||
| + | [Service] | ||
| + | ExecStart=/ | ||
| + | StateDirectory=reaction | ||
| + | RuntimeDirectory=reaction | ||
| + | WorkingDirectory=/ | ||
| + | </ | ||
| + | |||
| + | This code is based on the one you can find on the official blog of [[https:// | ||
| + | |||
| + | |||
| + | ===== Conclusion ===== | ||
| + | |||
| + | This tool is a very good initiative that everybody should support! At least everybody that needs such tool should give a try. The creator is very talented and tries to push the tool into a direction that can make everything more safe. | ||
en/security/reaction.1723082935.txt.gz · Last modified:  by lonclegr
                
                