enabled/disable registry in ui

This commit is contained in:
m0duspwnens
2023-05-12 15:49:13 -04:00
parent 0860b1501e
commit 277ad61920
8 changed files with 60 additions and 0 deletions

View File

@@ -324,6 +324,13 @@ function add_soc_to_minion() {
" " >> $PILLARFILE
}
function add_registry_to_minion() {
printf '%s\n'\
"registry:"\
" enabled: True"\
" " >> $PILLARFILE
}
function create_fleet_policy() {
JSON_STRING=$( jq -n \
@@ -379,6 +386,7 @@ function createEVAL() {
add_nginx_to_minion
add_soctopus_to_minion
add_soc_to_minion
add_registry_to_minion
}
function createSTANDALONE() {
@@ -396,6 +404,7 @@ function createSTANDALONE() {
add_nginx_to_minion
add_soctopus_to_minion
add_soc_to_minion
add_registry_to_minion
}
function createMANAGER() {
@@ -411,6 +420,7 @@ function createMANAGER() {
add_nginx_to_minion
add_soctopus_to_minion
add_soc_to_minion
add_registry_to_minion
}
function createMANAGERSEARCH() {
@@ -426,6 +436,7 @@ function createMANAGERSEARCH() {
add_nginx_to_minion
add_soctopus_to_minion
add_soc_to_minion
add_registry_to_minion
}
function createIMPORT() {
@@ -436,6 +447,7 @@ function createIMPORT() {
add_influxdb_to_minion
add_nginx_to_minion
add_soc_to_minion
add_registry_to_minion
}
function createFLEET() {

0
salt/registry/config.sls Normal file
View File

View File

View File

@@ -0,0 +1,27 @@
# 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.
{% from 'allowed_states.map.jinja' import allowed_states %}
{% if sls.split('.')[0] in allowed_states %}
include:
- registry.sostatus
so-registry:
docker_container.absent:
- force: True
so-registry_so-status.disabled:
file.comment:
- name: /opt/so/conf/so-status/so-status.conf
- regex: ^so-registry$
{% else %}
{{sls}}_state_not_allowed:
test.fail_without_changes:
- name: {{sls}}_state_not_allowed
{% endif %}

View File

0
salt/registry/map.jinja Normal file
View File

View File

View File

@@ -0,0 +1,21 @@
# 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.
{% from 'allowed_states.map.jinja' import allowed_states %}
{% if sls.split('.')[0] in allowed_states %}
append_so-registry_so-status.conf:
file.append:
- name: /opt/so/conf/so-status/so-status.conf
- text: so-registry
- unless: grep -q so-registry /opt/so/conf/so-status/so-status.conf
{% else %}
{{sls}}_state_not_allowed:
test.fail_without_changes:
- name: {{sls}}_state_not_allowed
{% endif %}