Skip to content

Commit

Permalink
adds daily OSSEC check/alert for v2 onion service config
Browse files Browse the repository at this point in the history
  • Loading branch information
zenmonkeykstop committed Jan 5, 2021
1 parent 0454478 commit 7955ceb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
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>Indicates that legacy v2 onion services are still configured and should be disabled in favour of v3 services.</description>
</rule>
</group>

0 comments on commit 7955ceb

Please sign in to comment.