-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix AWS S3 functional tests failures (#2006)
- Loading branch information
1 parent
9199c68
commit 67be6ed
Showing
4 changed files
with
83 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: CIS-AWS-CI | ||
|
||
on: | ||
pull_request_target: | ||
branches: | ||
- main | ||
- "[0-9]+.[0-9]+" | ||
types: [opened, synchronize, reopened] | ||
push: | ||
branches: | ||
- main | ||
- "[0-9]+.[0-9]+" | ||
|
||
jobs: | ||
Run-CSPM-AWS-Tests: | ||
name: CIS AWS integration test | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 60 | ||
permissions: | ||
contents: "read" | ||
id-token: "write" | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Init Hermit | ||
run: ./bin/hermit env -r >> $GITHUB_ENV | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.9" | ||
|
||
- name: Install Poetry | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
poetry --version | ||
- name: Build cloudbeat binary | ||
uses: magefile/mage-action@v3 | ||
with: | ||
version: latest | ||
args: build | ||
|
||
- name: Run Elasticsearch | ||
uses: elastic/elastic-github-actions/elasticsearch@master | ||
with: | ||
stack-version: ${{ env.ELK_VERSION }} | ||
security-enabled: false | ||
|
||
- name: Elasticsearch disable dynamic mapping for findings | ||
run: ./.ci/scripts/disable_dynamic_mapping.sh | ||
|
||
- name: Run cloudbeat in background | ||
env: | ||
ES_HOST: http://localhost:9200 | ||
ES_USERNAME: elastic | ||
ES_PASSWORD: changeme | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_TEST_ACC }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_TEST_ACC }} | ||
AWS_ACCOUNT_TYPE: single-account | ||
run: | | ||
./cloudbeat -c deploy/aws/cloudbeat-aws.yml -d '*' & | ||
- name: Wait for cloudbeat to send events | ||
run: sleep 264 | ||
|
||
- name: Check for findings | ||
working-directory: ./tests | ||
env: | ||
USE_K8S: false | ||
run: | | ||
poetry install | ||
poetry run pytest -k "aws" --alluredir=./allure/results/ --clean-alluredir | ||
- name: Print cloudbeat logs | ||
if: always() | ||
continue-on-error: true | ||
run: | | ||
cat logs/cloudbeat* |
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 was deleted.
Oops, something went wrong.