-
Notifications
You must be signed in to change notification settings - Fork 492
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13547 from Security-Onion-Solutions/2.4/soupchanges
Elastic Fleet refactoring
- Loading branch information
Showing
6 changed files
with
91 additions
and
33 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
salt/elasticfleet/files/integrations-dynamic/fleet-server/fleet-server.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"package": { | ||
"name": "fleet_server", | ||
"version": "" | ||
}, | ||
"name": "fleet_server-1", | ||
"namespace": "default", | ||
"policy_id": "FleetServer_hostname", | ||
"vars": {}, | ||
"inputs": { | ||
"fleet_server-fleet-server": { | ||
"enabled": true, | ||
"vars": { | ||
"custom": "server.ssl.supported_protocols: [\"TLSv1.2\", \"TLSv1.3\"]\nserver.ssl.cipher_suites: [ \"ECDHE-RSA-AES-128-GCM-SHA256\", \"ECDHE-RSA-AES-256-GCM-SHA384\", \"ECDHE-RSA-AES-128-CBC-SHA\", \"ECDHE-RSA-AES-256-CBC-SHA\", \"RSA-AES-128-GCM-SHA256\", \"RSA-AES-256-GCM-SHA384\"]" | ||
}, | ||
"streams": {} | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
salt/elasticfleet/tools/sbin/so-elastic-fleet-integration-policy-elastic-fleet-server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/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 | ||
|
||
# Get all the fleet policies | ||
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_" | ||
POLICY=$(echo "$json_output" | jq -r '.items[] | select(.id | startswith("FleetServer_")) | .id') | ||
|
||
# Iterate over each ID in the POLICY variable | ||
for POLICYNAME in $POLICY; do | ||
printf "\nUpdating Policy: $POLICYNAME\n" | ||
|
||
# First get the Integration ID | ||
elastic_fleet_integration_check "$POLICYNAME" "/opt/so/conf/elastic-fleet/integrations/fleet-server/fleet-server.json" | ||
|
||
# Modify the default integration policy to update the policy_id and an with the correct naming | ||
UPDATED_INTEGRATION_POLICY=$(jq --arg policy_id "$POLICYNAME" --arg name "fleet_server-$POLICYNAME" ' | ||
.policy_id = $policy_id | | ||
.name = $name' /opt/so/conf/elastic-fleet/integrations/fleet-server/fleet-server.json) | ||
|
||
# Now update the integration policy using the modified JSON | ||
elastic_fleet_integration_update "$INTEGRATION_ID" "$UPDATED_INTEGRATION_POLICY" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters