Skip to content

[Cloud Security] Cloud Asset Discovery onboarding E2E tests (AWS/GCP/Azure)#223310

Merged
seanrathier merged 13 commits intoelastic:mainfrom
seanrathier:asset-integration-e2e-aws
Jul 8, 2025
Merged

[Cloud Security] Cloud Asset Discovery onboarding E2E tests (AWS/GCP/Azure)#223310
seanrathier merged 13 commits intoelastic:mainfrom
seanrathier:asset-integration-e2e-aws

Conversation

@seanrathier
Copy link
Copy Markdown
Contributor

@seanrathier seanrathier commented Jun 10, 2025

Summary

This PR adds end-to-end (E2E) tests for the Cloud Asset Discovery onboarding flow across AWS, Azure, and GCP. It also extends test utilities and updates Serverless Security configurations to support agentless integration.

Key changes:

  • Introduces new E2E test suites for AWS and GCP onboarding:

    • asset_inventory_onboarding_aws.cy.ts
    • asset_inventory_onboarding_gcp.cy.ts
    • asset_inventory_onboarding_azure.cy.ts
  • Adds new test helper functions to support the onboarding flows.

  • Enables the agentless integration option in the security_solution_cypress/serverless_config.ts, required for enabling agentless support in the CI for Cypress Security Serverless E2E tests.

    • The change is needed because Security Cypress E2E tests use the config when standing up an environment to run the tests labelled with @serverless
    • Note: Local and remote projects created via yarn serverless-security will display the agentless option in agentless-enabled integrations.
    • This feature flag is currently injected in Serverless projects and ECH deployments.
BuildKite Logs

Checklist

Related Issues

@seanrathier seanrathier requested review from a team as code owners June 10, 2025 21:36
@seanrathier seanrathier requested a review from nkhristinin June 10, 2025 21:36
@seanrathier seanrathier marked this pull request as draft June 10, 2025 21:36
@seanrathier seanrathier added Team:Cloud Security Cloud Security team related v9.1.0 backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes labels Jun 10, 2025
@seanrathier seanrathier requested a review from Copilot June 10, 2025 21:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds new E2E tests for the Cloud Asset Discovery onboarding for AWS and extends existing test helper methods. Key changes include:

  • Adding new Cypress scripts for asset inventory tests in package.json.
  • Introducing a new navigation URL constant for the asset inventory integration.
  • Creating several new helper functions and comprehensive E2E tests in asset_inventory_onboarding_aws.cy.ts.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
x-pack/test/security_solution_cypress/package.json Added Cypress script for asset inventory integration tests
x-pack/test/security_solution_cypress/cypress/urls/navigation.ts Added new URL constant for asset inventory integration
x-pack/test/security_solution_cypress/cypress/helpers/common.ts Added new helper functions for common assertions
x-pack/test/security_solution_cypress/cypress/e2e/asset_inventory/constants.ts Added constants to support asset inventory tests
x-pack/test/security_solution_cypress/cypress/e2e/asset_inventory/asset_inventory_onboarding_aws.cy.ts Added comprehensive AWS onboarding tests for asset inventory
Comments suppressed due to low confidence (4)

x-pack/test/security_solution_cypress/cypress/urls/navigation.ts:104

  • For consistency with other URL constants, consider prefixing ASSET_INVENTORY_INTEGRATION_URL with a '/' to ensure uniformity in route paths.
export const ASSET_INVENTORY_INTEGRATION_URL = 'app/fleet/integrations/cloud_asset_inventory/add-integration';

x-pack/test/security_solution_cypress/cypress/e2e/asset_inventory/asset_inventory_onboarding_aws.cy.ts:144

  • [nitpick] Consider enabling the assertion for SECRET_KEY to verify that the secret key input is correctly processed, or remove the commented code if it is no longer required.
// checkInputValue(SECRET_KEY, testSecretKey);

x-pack/test/security_solution_cypress/cypress/e2e/asset_inventory/asset_inventory_onboarding_aws.cy.ts:185

  • [nitpick] Consider enabling the assertion for TEMPORARY_KEY_SECRET_KEY to ensure that the temporary secret key value is being handled as expected, or remove the commented code if unneeded.
// checkInputValue(TEMPORARY_KEY_SECRET_KEY, testSecretKey);

x-pack/test/security_solution_cypress/cypress/e2e/asset_inventory/asset_inventory_onboarding_aws.cy.ts:224

  • [nitpick] Consider enabling the secret key assertion in the shared credentials test to ensure comprehensive validation of the integration configuration, or remove the commented line if it is redundant.
// checkInputValue(TEMPORARY_KEY_SECRET_KEY, testSecretKey);

@seanrathier seanrathier marked this pull request as ready for review June 11, 2025 15:27
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-cloud-security-posture (Team:Cloud Security)

@seanrathier seanrathier force-pushed the asset-integration-e2e-aws branch 2 times, most recently from a5cdae8 to 20d3247 Compare June 11, 2025 20:17
@seanrathier seanrathier changed the title [Cloud Security] Cloud Asset Discovery onboarding E2E tests - AWS [Cloud Security] Cloud Asset Discovery onboarding E2E tests - AWS/GCP Jun 11, 2025
@elastic elastic deleted a comment from elasticmachine Jun 11, 2025
@seanrathier seanrathier requested review from a team as code owners June 12, 2025 20:16
Copy link
Copy Markdown
Contributor

@opauloh opauloh left a comment

Choose a reason for hiding this comment

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

LGTM 💯

@seanrathier seanrathier force-pushed the asset-integration-e2e-aws branch from 537f74e to 3d650ef Compare June 13, 2025 19:36
@seanrathier seanrathier removed the request for review from a team June 13, 2025 19:56
@seanrathier seanrathier force-pushed the asset-integration-e2e-aws branch from 8ac1d51 to eb29551 Compare June 13, 2025 20:41
@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#8374

[✅] Asset Inventory - Cypress: 25/25 tests passed.

see run history

Copy link
Copy Markdown
Contributor

@azasypkin azasypkin left a comment

Choose a reason for hiding this comment

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

Changes in config/serverless.security.yml LGTM.

That being said, enabling fleet.agentless functionality in serverless, which might potentially be a significant change in available functionality, doesn't really correspond to the PR title "Cloud Asset Discovery onboarding E2E tests - AWS/GCP" that implies the change is test-only.

@seanrathier
Copy link
Copy Markdown
Contributor Author

@azasypkin, @maxcold

I've updated the title and added more context about the config change.

Copy link
Copy Markdown
Member

@afharo afharo left a comment

Choose a reason for hiding this comment

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

Config changes LGTM

@seanrathier seanrathier force-pushed the asset-integration-e2e-aws branch from 58f75f1 to 425e4c1 Compare June 26, 2025 14:20
@seanrathier seanrathier changed the title [Cloud Security] Cloud Asset Discovery onboarding E2E tests (AWS/GCP/Azure) and enabling agentless feature in serverless.security.yml [Cloud Security] Cloud Asset Discovery onboarding E2E tests (AWS/GCP/Azure) Jun 27, 2025
Copy link
Copy Markdown
Contributor

@semd semd left a comment

Choose a reason for hiding this comment

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

LGTM!

@seanrathier seanrathier added v9.2.0 and removed v9.1.0 labels Jun 27, 2025
@seanrathier seanrathier enabled auto-merge (squash) June 27, 2025 17:35
@seanrathier seanrathier requested a review from a team June 30, 2025 12:50
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great work on these onboarding E2E tests!
As a suggestion, consider using our Cypress design patterns—specifically, moving UI selectors into a /screens folder and reusable actions into /tasks. This makes tests easier to maintain and scale as the suite grows.

You can see screens examples here.

And tasks examples here

Let me know if you want any pointers—happy to help!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@vgomez-el I updated the locations of the tests to screens and tasks

@seanrathier seanrathier force-pushed the asset-integration-e2e-aws branch from 8cb3ef1 to 3799641 Compare July 7, 2025 15:12
@seanrathier seanrathier requested a review from vgomez-el July 7, 2025 17:26
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

Copy link
Copy Markdown
Contributor

@vgomez-el vgomez-el left a comment

Choose a reason for hiding this comment

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

LGTM!

@seanrathier seanrathier merged commit 6e2ec34 into elastic:main Jul 8, 2025
12 checks passed
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
@seanrathier seanrathier deleted the asset-integration-e2e-aws branch March 6, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Cloud Security Cloud Security team related v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants