Merge pull request #12062 from Security-Onion-Solutions/fix/curator_remove

Curator Remove Changes
This commit is contained in:
weslambert
2023-12-20 15:16:47 -05:00
committed by GitHub
8 changed files with 38 additions and 31 deletions

32
salt/curator/disabled.sls Normal file
View File

@@ -0,0 +1,32 @@
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
# https://securityonion.net/license; you may not use this file except in compliance with the
# Elastic License 2.0.
so-curator:
docker_container.absent:
- force: True
so-curator_so-status.disabled:
file.line:
- name: /opt/so/conf/so-status/so-status.conf
- match: ^so-curator$
- mode: delete
so-curator-cluster-close:
cron.absent:
- identifier: so-curator-cluster-close
so-curator-cluster-delete:
cron.absent:
- identifier: so-curator-cluster-delete
delete_curator_configuration:
file.absent:
- name: /opt/so/conf/curator
- recurse: True
{% set files = salt.file.find(path='/usr/sbin', name='so-curator*') %}
delete_curator_scripts:
file.absent:
- names: {{files|yaml}}

View File

@@ -201,14 +201,6 @@ so-elasticsearch-roles-load:
- docker_container: so-elasticsearch - docker_container: so-elasticsearch
- file: elasticsearch_sbin_jinja - file: elasticsearch_sbin_jinja
{% if grains.role in ['so-eval', 'so-standalone', 'so-managersearch', 'so-heavynode', 'so-manager'] %} {% if grains.role in ['so-eval', 'so-standalone', 'so-managersearch', 'so-heavynode', 'so-manager'] %}
so-curator-cluster-close:
cron.absent:
- identifier: so-curator-cluster-close
so-curator-cluster-delete:
cron.absent:
- identifier: so-curator-cluster-delete
so-elasticsearch-indices-delete: so-elasticsearch-indices-delete:
cron.present: cron.present:
- name: /usr/sbin/so-elasticsearch-indices-delete > /opt/so/log/elasticsearch/cron-elasticsearch-indices-delete.log 2>&1 - name: /usr/sbin/so-elasticsearch-indices-delete > /opt/so/log/elasticsearch/cron-elasticsearch-indices-delete.log 2>&1

View File

@@ -11,7 +11,7 @@
. /usr/sbin/so-common . /usr/sbin/so-common
# Check for log files # Check for log files
for FILE in /opt/so/log/elasticsearch/*.log /opt/so/log/logstash/*.log /opt/so/log/kibana/*.log /opt/so/log/elastalert/*.log /opt/so/log/curator/*.log /opt/so/log/freqserver/*.log /opt/so/log/nginx/*.log; do for FILE in /opt/so/log/elasticsearch/*.log /opt/so/log/logstash/*.log /opt/so/log/kibana/*.log /opt/so/log/elastalert/*.log /opt/so/log/freqserver/*.log /opt/so/log/nginx/*.log; do
# If file exists, then look for errors or warnings # If file exists, then look for errors or warnings
if [ -f $FILE ]; then if [ -f $FILE ]; then

View File

@@ -23,10 +23,6 @@
/usr/sbin/so-restart logstash $1 /usr/sbin/so-restart logstash $1
{%- endif %} {%- endif %}
{%- if GLOBALS.role in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode']%}
/usr/sbin/so-restart curator $1
{%- endif %}
{%- if GLOBALS.role in ['so-eval','so-manager', 'so-managersearch', 'so-standalone']%} {%- if GLOBALS.role in ['so-eval','so-manager', 'so-managersearch', 'so-standalone']%}
/usr/sbin/so-restart elastalert $1 /usr/sbin/so-restart elastalert $1
{%- endif %} {%- endif %}

View File

@@ -22,10 +22,6 @@
/usr/sbin/so-start logstash $1 /usr/sbin/so-start logstash $1
{%- endif %} {%- endif %}
{%- if GLOBALS.role in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode']%}
/usr/sbin/so-start curator $1
{%- endif %}
{%- if GLOBALS.role in ['so-eval','so-manager', 'so-managersearch', 'so-standalone']%} {%- if GLOBALS.role in ['so-eval','so-manager', 'so-managersearch', 'so-standalone']%}
/usr/sbin/so-start elastalert $1 /usr/sbin/so-start elastalert $1
{%- endif %} {%- endif %}

View File

@@ -22,10 +22,6 @@
/usr/sbin/so-stop logstash $1 /usr/sbin/so-stop logstash $1
{%- endif %} {%- endif %}
{%- if GLOBALS.role in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode']%}
/usr/sbin/so-stop curator $1
{%- endif %}
{%- if GLOBALS.role in ['so-eval','so-manager', 'so-managersearch', 'so-standalone']%} {%- if GLOBALS.role in ['so-eval','so-manager', 'so-managersearch', 'so-standalone']%}
/usr/sbin/so-stop elastalert $1 /usr/sbin/so-stop elastalert $1
{%- endif %} {%- endif %}

View File

@@ -417,7 +417,6 @@ postupgrade_changes() {
[[ "$POSTVERSION" == 2.4.5 ]] && post_to_2.4.10 [[ "$POSTVERSION" == 2.4.5 ]] && post_to_2.4.10
[[ "$POSTVERSION" == 2.4.10 ]] && post_to_2.4.20 [[ "$POSTVERSION" == 2.4.10 ]] && post_to_2.4.20
[[ "$POSTVERSION" == 2.4.20 ]] && post_to_2.4.30 [[ "$POSTVERSION" == 2.4.20 ]] && post_to_2.4.30
[[ "$POSTVERSION" == 2.4.30 ]] && post_to_2.4.40
true true
} }
@@ -464,15 +463,6 @@ post_to_2.4.30() {
POSTVERSION=2.4.30 POSTVERSION=2.4.30
} }
post_to_2.4.40() {
echo "Stopping Curator"
so-curator-stop
echo "Removing Curator configuration"
rm -rf /opt/so/conf/curator/
rm -f /usr/sbin/so-curator-*
sed -i '/so-curator/d' /opt/so/conf/so-status/so-status.conf
}
repo_sync() { repo_sync() {
echo "Sync the local repo." echo "Sync the local repo."
su socore -c '/usr/sbin/so-repo-sync' || fail "Unable to complete so-repo-sync." su socore -c '/usr/sbin/so-repo-sync' || fail "Unable to complete so-repo-sync."

View File

@@ -74,6 +74,7 @@ base:
- suricata - suricata
- zeek - zeek
- strelka - strelka
- curator.disabled
- elastalert - elastalert
- utility - utility
- soctopus - soctopus
@@ -103,6 +104,7 @@ base:
- redis - redis
- elastic-fleet-package-registry - elastic-fleet-package-registry
- kibana - kibana
- curator.disabled
- elastalert - elastalert
- utility - utility
- soctopus - soctopus
@@ -138,6 +140,7 @@ base:
- suricata - suricata
- zeek - zeek
- strelka - strelka
- curator.disabled
- elastalert - elastalert
- utility - utility
- soctopus - soctopus
@@ -176,6 +179,7 @@ base:
- elasticsearch - elasticsearch
- logstash - logstash
- redis - redis
- curator.disabled
- elastic-fleet-package-registry - elastic-fleet-package-registry
- kibana - kibana
- elastalert - elastalert
@@ -195,6 +199,7 @@ base:
- elasticsearch - elasticsearch
- logstash - logstash
- redis - redis
- curator.disabled
- strelka - strelka
- pcap - pcap
- suricata - suricata