mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Update Fleet Server policy
This commit is contained in:
@@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
. /usr/sbin/so-elastic-fleet-common
|
||||||
|
|
||||||
|
# Make the curl request to fetch the JSON data
|
||||||
|
json_output=$(curl -s -K /opt/so/conf/elasticsearch/curl.config -L -X GET "localhost:5601/api/fleet/agent_policies" -H 'kbn-xsrf: true')
|
||||||
|
|
||||||
|
# Extract the IDs that start with "FleetServer_" using jq
|
||||||
|
POLICY=$(echo "$json_output" | jq -r '.items[] | select(.id | startswith("FleetServer_")) | .id')
|
||||||
|
|
||||||
|
echo $POLICY
|
||||||
|
|
||||||
|
# Iterate over each ID in the POLICY variable and run the specified commands
|
||||||
|
for POLICYNAME in $POLICY; do
|
||||||
|
# First get the Integration ID
|
||||||
|
elastic_fleet_integration_check "$POLICYNAME" "/opt/so/conf/elastic-fleet/integrations/fleet-server/fleet-server.json"
|
||||||
|
# Now update the integration policy
|
||||||
|
elastic_fleet_integration_update "$INTEGRATION_ID" "@/opt/so/conf/elastic-fleet/integrations/fleet-server/fleet-server.json"
|
||||||
|
done
|
||||||
@@ -12,7 +12,10 @@ if [ ! -f /opt/so/state/eaintegrations.txt ]; then
|
|||||||
# First, check for any package upgrades
|
# First, check for any package upgrades
|
||||||
/usr/sbin/so-elastic-fleet-package-upgrade
|
/usr/sbin/so-elastic-fleet-package-upgrade
|
||||||
|
|
||||||
# Second, configure Elastic Defend Integration seperately
|
# Second, update Fleet Server policies
|
||||||
|
/sbin/so-elastic-fleet-integration-policy-elastic-fleet-server
|
||||||
|
|
||||||
|
# Third, configure Elastic Defend Integration seperately
|
||||||
/usr/sbin/so-elastic-fleet-integration-policy-elastic-defend
|
/usr/sbin/so-elastic-fleet-integration-policy-elastic-defend
|
||||||
|
|
||||||
# Initial Endpoints
|
# Initial Endpoints
|
||||||
|
|||||||
Reference in New Issue
Block a user