-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor serverless workflow (#2894)
* update scheduler * refactor agentless integration install * update tests infra * update export plugin requirement * add project init wait * update script * update script * update script call * update script * update tests marker * update wf * remove message * update tests marker * add destroy job and fix linter * update workflow * update tf format * update serverless wf * update cis-agent-based action * update config env var (cherry picked from commit 2b7683d)
- Loading branch information
1 parent
b2505a5
commit 9ba246e
Showing
9 changed files
with
155 additions
and
30 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: 'CIS Agentless Integrations Installation' | ||
description: 'Deploy CIS Agentless Integrations to Elastic Cloud' | ||
inputs: | ||
cspm-azure-creds: | ||
description: "Azure credentials for CSPM agent deployment" | ||
required: true | ||
type: string | ||
es-user: | ||
description: "Elasticsearch user" | ||
default: "elastic" | ||
required: false | ||
type: string | ||
es-password: | ||
description: "Elasticsearch password" | ||
default: "changeme" | ||
required: false | ||
type: string | ||
kibana-url: | ||
description: "Kibana URL" | ||
default: "default" | ||
required: false | ||
type: string | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Install Agentless integrations | ||
id: agentless-integrations | ||
working-directory: tests/integrations_setup | ||
shell: bash | ||
env: | ||
AZURE_CREDENTIALS: ${{ inputs.cspm-azure-creds }} | ||
ES_USER: ${{ inputs.es-user }} | ||
ES_PASSWORD: ${{ inputs.es-password }} | ||
KIBANA_URL: ${{ inputs.kibana-url }} | ||
run: | | ||
poetry run python ./install_agentless_integrations.py |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
echo "Waiting for project to be available..." | ||
sleep_timeout=15 | ||
for i in {1..20}; do | ||
response=$(curl -s -H "Content-type: application/json" -H "Authorization: ApiKey ${API_KEY}" "${EC_URL}/api/v1/serverless/projects/security/${PROJECT_ID}/status") | ||
phase=$(echo "$response" | jq -r '.phase') | ||
if [ "$phase" = "initialized" ]; then | ||
echo "Project is available!" | ||
exit 0 | ||
else | ||
echo "Iteration $i: Project phase is '$phase'. Waiting..." | ||
sleep $sleep_timeout | ||
fi | ||
done | ||
echo "Project is not available after retries." | ||
exit 1 |
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