Merge pull request #3100 from Security-Onion-Solutions/kilo

Add so-preflight + usage to so-monitor-add, fix managersearch missing from so-rule
This commit is contained in:
Mike Reeves
2021-02-23 17:32:41 -05:00
committed by GitHub
4 changed files with 160 additions and 4 deletions

View File

@@ -2,4 +2,22 @@
. /usr/sbin/so-common
usage() {
read -r -d '' message <<- EOM
usage: so-monitor-add [-h] NIC
positional arguments:
NIC The interface to add to the monitor bond (ex: eth2)
optional arguments:
-h, --help Show this help message and exit
EOM
echo "$message"
exit 1
}
if [[ $# -eq 0 || $# -gt 1 ]] || [[ $1 == '-h' || $1 == '--help' ]]; then
usage
fi
add_interface_bond0 "$1"

View File

@@ -58,7 +58,7 @@ def check_apply(args: dict, prompt: bool = True):
def find_minion_pillar() -> str:
regex = '^.*_(manager|standalone|import|eval)\.sls$'
regex = '^.*_(manager|managersearch|standalone|import|eval)\.sls$'
result = []
for root, _, files in os.walk(minion_pillar_dir):
@@ -67,7 +67,7 @@ def find_minion_pillar() -> str:
result.append(os.path.join(root, f_minion_id))
if len(result) == 0:
print_err('Could not find manager-type pillar (eval, standalone, manager, import). Are you running this script on the manager?')
print_err('Could not find manager-type pillar (eval, standalone, manager, managersearch, import). Are you running this script on the manager?')
sys.exit(3)
elif len(result) > 1:
res_str = ', '.join(f'\"{result}\"')