Initial cut to remove Playbook and deps

This commit is contained in:
DefensiveDepth
2024-03-25 19:42:31 -04:00
parent 57553bc1e5
commit d7ecad4333
67 changed files with 1 additions and 3226 deletions

View File

@@ -792,7 +792,6 @@ create_manager_pillars() {
create_global
create_sensoroni_pillar
backup_pillar
soctopus_pillar
docker_pillar
redis_pillar
idstools_pillar
@@ -1109,10 +1108,6 @@ generate_ssl() {
generate_passwords(){
title "Generate Random Passwords"
MYSQLPASS=$(get_random_value)
PLAYBOOKDBPASS=$(get_random_value)
PLAYBOOKADMINPASS=$(get_random_value)
PLAYBOOKAUTOMATIONPASS=$(get_random_value)
INFLUXPASS=$(get_random_value)
INFLUXTOKEN=$(head -c 64 /dev/urandom | base64 --wrap=0)
SENSORONIKEY=$(get_random_value)
@@ -1167,11 +1162,6 @@ install_cleanup() {
# that will disrupt automated tests should be placed beneath this statement.
[ -n "$TESTING" ] && return
# If Mysql is running stop it
if docker ps --format "{{.Names}}" 2>&1 | grep -q "so-mysql"; then
logVmd "/usr/sbin/so-mysql-stop"
fi
if [[ $setup_type == 'iso' ]]; then
info "Removing so-setup permission entry from sudoers file"
logCmd "sed -i '/so-setup/d' /etc/sudoers"
@@ -1279,17 +1269,11 @@ telegraf_pillar() {
manager_pillar() {
touch $adv_manager_pillar_file
title "Create the manager pillar"
if [[ $is_import ]]; then
PLAYBOOK=0
else
PLAYBOOK=1
fi
printf '%s\n'\
"manager:"\
" proxy: '$so_proxy'"\
" no_proxy: '$no_proxy_string'"\
" elastalert: 1"\
" playbook: $PLAYBOOK"\
"" > "$manager_pillar_file"
}
@@ -1362,16 +1346,6 @@ backup_pillar() {
touch $adv_backup_pillar_file
}
soctopus_pillar() {
title "Create the soctopus pillar file"
touch $adv_soctopus_pillar_file
printf '%s\n'\
"soctopus:"\
" playbook:"\
" rulesets:"\
" - windows" > "$soctopus_pillar_file"
}
docker_pillar() {
title "Create the docker pillar file"
touch $adv_docker_pillar_file
@@ -1413,7 +1387,7 @@ make_some_dirs() {
mkdir -p $local_salt_dir/salt/firewall/portgroups
mkdir -p $local_salt_dir/salt/firewall/ports
for THEDIR in bpf pcap elasticsearch ntp firewall redis backup influxdb strelka sensoroni soc soctopus docker zeek suricata nginx telegraf logstash soc manager kratos idstools idh elastalert stig global;do
for THEDIR in bpf pcap elasticsearch ntp firewall redis backup influxdb strelka sensoroni soc docker zeek suricata nginx telegraf logstash soc manager kratos idstools idh elastalert stig global;do
mkdir -p $local_salt_dir/pillar/$THEDIR
touch $local_salt_dir/pillar/$THEDIR/adv_$THEDIR.sls
touch $local_salt_dir/pillar/$THEDIR/soc_$THEDIR.sls
@@ -1949,7 +1923,6 @@ saltify() {
salt_install_module_deps() {
logCmd "salt-pip install docker --no-index --only-binary=:all: --find-links files/salt_module_deps/docker/"
logCmd "salt-pip install pymysql --no-index --only-binary=:all: --find-links files/salt_module_deps/pymysql/"
}
salt_patch_x509_v2() {
@@ -1967,11 +1940,6 @@ secrets_pillar(){
mkdir -p $local_salt_dir/pillar
printf '%s\n'\
"secrets:"\
" mysql: $MYSQLPASS"\
" playbook_db: $PLAYBOOKDBPASS"\
" playbook_admin: $PLAYBOOKADMINPASS"\
" playbook_automation: $PLAYBOOKAUTOMATIONPASS"\
" playbook_automation_api_key: "\
" import_pass: $IMPORTPASS"\
" influx_pass: $INFLUXPASS" > $local_salt_dir/pillar/secrets.sls
fi

View File

@@ -775,10 +775,6 @@ if ! [[ -f $install_opt_file ]]; then
error "Failed to run so-elastic-fleet-setup"
fail_setup
fi
if [[ ! $is_import ]]; then
title "Setting up Playbook"
logCmd "so-playbook-reset"
fi
checkin_at_boot
set_initial_firewall_access
logCmd "salt-call schedule.enable -linfo --local"

View File

@@ -112,12 +112,6 @@ export sensoroni_pillar_file
adv_sensoroni_pillar_file="$local_salt_dir/pillar/sensoroni/adv_sensoroni.sls"
export adv_sensoroni_pillar_file
soctopus_pillar_file="$local_salt_dir/pillar/soctopus/soc_soctopus.sls"
export soctopus_pillar_file
adv_soctopus_pillar_file="$local_salt_dir/pillar/soctopus/adv_soctopus.sls"
export adv_soctopus_pillar_file
docker_pillar_file="$local_salt_dir/pillar/docker/soc_docker.sls"
export docker_pillar