Skip to content

aws functional tests poc#770

Merged
gurevichdmitry merged 5 commits into
elastic:mainfrom
gurevichdmitry:cis-aws-func-tests-poc
Feb 23, 2023
Merged

aws functional tests poc#770
gurevichdmitry merged 5 commits into
elastic:mainfrom
gurevichdmitry:cis-aws-func-tests-poc

Conversation

@gurevichdmitry

@gurevichdmitry gurevichdmitry commented Feb 22, 2023

Copy link
Copy Markdown
Collaborator

Summary of your changes

  • Implemented functional tests for Rule 2.1.1
  • Refactored skip cases function
  • Added findings evidence to Allure report

How to run locally

  1. Build cloudbeat and opa bundle
go mod vendor
go build -v
  1. Deploy ELK environment

just deploy-tests-helm pre_merge ./tests/deploy/values/ci.yml

  1. Export environment vars:
export ES_HOST=http://127.0.0.1:9200
export ES_USERNAME="kibana_system"
export ES_PASSWORD="changeme"

Note: After deploying ELK stack Kibana is available at: http://127.0.0.1:5601

  1. Start cloudbeat

./cloudbeat -c "deploy/aws/cloudbeat-aws.yml" --path.logs "/tmp"

  1. Wait 5-10 minutes
  2. Execute tests
cd ./tests
poetry run pytest -k "aws" --alluredir=./allure/results/ --clean-alluredir 
  1. Open Allure report

allure serve ./allure/results

@mergify

mergify Bot commented Feb 22, 2023

Copy link
Copy Markdown
Contributor

This pull request does not have a backport label. Could you fix it @gurevichdmitry? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 8./d branch. /d is the digit
    NOTE: backport-skip has been added to this pull request.

@github-actions

Copy link
Copy Markdown

@gurevichdmitry
gurevichdmitry marked this pull request as ready for review February 23, 2023 15:15
@gurevichdmitry
gurevichdmitry requested review from a team as code owners February 23, 2023 15:15

@oren-zohar oren-zohar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, approved with comments

Comment thread tests/commonlib/utils.py
Comment on lines +60 to +68
allure.attach(
json.dumps(
event,
indent=4,
sort_keys=True,
),
rule_tag,
attachment_type=allure.attachment_type.JSON,
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

Comment thread tests/product/tests/test_aws_s3_service_rules.py
Comment thread tests/product/tests/test_aws_s3_service_rules.py
@gurevichdmitry
gurevichdmitry merged commit 086eac7 into elastic:main Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants