Skip to content

Commit

Permalink
Merge pull request #5682 from freedomofpress/5673-v3-ossec-warning
Browse files Browse the repository at this point in the history
adds daily OSSEC check/alert for v2 onion service config
  • Loading branch information
rmol authored Jan 12, 2021
2 parents baf0bfa + 4ae7469 commit e4d5f2f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
codecov:
disable_default_path_fixes: false
ignore:
- "securedrop/loaddata.py"
- "securedrop/upload-screenshots.py"
- "securedrop/qa_loader.py"
- "securedrop/create-dev-data.py"
Expand Down
7 changes: 7 additions & 0 deletions install_files/securedrop-ossec-agent/var/ossec/etc/ossec.conf
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@
<frequency>90000</frequency>
</localfile>

<localfile>
<log_format>command</log_format>
<command>grep "HiddenServiceVersion 2" /etc/tor/torrc | head -1</command>
<alias>v2_service_check</alias>
<frequency>86400</frequency>
</localfile>

<localfile>
<log_format>syslog</log_format>
<location>/var/log/kern.log</location>
Expand Down
15 changes: 15 additions & 0 deletions install_files/securedrop-ossec-server/var/ossec/etc/ossec.conf
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@
<frequency>90000</frequency>
</localfile>

<localfile>
<log_format>command</log_format>
<command>grep "HiddenServiceVersion 2" /etc/tor/torrc | head -1</command>
<alias>v2_service_check</alias>
<frequency>86400</frequency>
</localfile>

<reports>
<group>authentication_success</group>
<user type="relation">srcip</user>
Expand Down Expand Up @@ -160,6 +167,14 @@
<do_not_group />
</email_alerts>

<email_alerts>
<email_to>root@localhost</email_to>
<group>system_configuration</group>
<rule_id>400901</rule_id>
<do_not_delay />
<do_not_group />
</email_alerts>

<!-- rules global entry -->
<rules>
<include>rules_config.xml</include>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,11 @@
<regex>System configuration error:</regex>
<description>Indicates a problem with the configuration of the SecureDrop servers.</description>
</rule>
<rule id="400901" level="12" >
<if_sid>530</if_sid>
<options>alert_by_email</options> <!-- force email to be sent -->
<match>ossec: output: 'v2_service_check'</match>
<regex>HiddenServiceVersion 2</regex>
<description>v2 onion services are still enabled. Support for v2 onion services is deprecated and will be removed starting in February 2021. To preserve access to SecureDrop, you must migrate to v3 onion services: https://securedrop.org/v2-onion-eol</description>
</rule>
</group>

0 comments on commit e4d5f2f

Please sign in to comment.