Skip to content

Add additional integrations to the CDR workflow#4084

Merged
gurevichdmitry merged 21 commits intomainfrom
dg-cdr-wf-add-integrations
Mar 31, 2026
Merged

Add additional integrations to the CDR workflow#4084
gurevichdmitry merged 21 commits intomainfrom
dg-cdr-wf-add-integrations

Conversation

@gurevichdmitry
Copy link
Copy Markdown
Collaborator

@gurevichdmitry gurevichdmitry commented Mar 29, 2026

Summary of your changes

This PR extends the environment by adding preinstalled integrations:

  • Elastic Defend for Linux
  • Elastic Defend for Windows
  • Okta
  • Okta Entity Analytics

It also adds support for:

  • Installing experimental features
  • Enabling Entity Store v2

@gurevichdmitry gurevichdmitry requested a review from a team as a code owner March 29, 2026 13:06
@mergify
Copy link
Copy Markdown

mergify bot commented Mar 29, 2026

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
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

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 PR extends the CDR test-environment provisioning workflow to preinstall additional Fleet integrations (Elastic Defend for Linux/Windows, Okta, Okta Entity Analytics), and adds workflow-level toggles for enabling Security Solution experimental flags and Entity Store v2 setup.

Changes:

  • Add Elastic Defend Fleet setup + install artifacts, plus WinRM-based enrollment flow for a Windows Defend host.
  • Add Okta + Okta Entity Analytics integrations attached to the Wiz CDR agent policy via shared context.
  • Add support for Security Solution experimental flags in Kibana and an Entity Store v2 enable/install/init flow (with a workflow toggle).

Reviewed changes

Copilot reviewed 39 out of 41 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/pyproject.toml Add pywinrm dependency for WinRM enrollment script.
tests/poetry.lock Lockfile updates for new Python dependencies.
tests/integrations_setup/install_wiz_integration.py Persist Wiz agent policy ID for reuse by other CDR integrations.
tests/integrations_setup/install_okta_integration.py New installer for Okta Fleet integration on Wiz agent policy.
tests/integrations_setup/install_entityanalytics_okta_integration.py New installer for Okta Entity Analytics Fleet integration on Wiz agent policy.
tests/integrations_setup/install_elastic_defend_integration.py New installer for Elastic Defend agent policy + integration + artifacts.
tests/integrations_setup/enroll_elastic_defend_winrm.py New WinRM-based Windows enrollment runner for Elastic Defend install script.
tests/integrations_setup/enable_entity_store_v2.py New script to enable/install/init Entity Store v2 and poll status.
tests/integrations_setup/data/package-policy-elastic-defend.json New endpoint package policy template for Elastic Defend.
tests/integrations_setup/data/okta-pkg.json New Okta package policy template.
tests/integrations_setup/data/entityanalytics_okta-pkg.json New entityanalytics_okta package policy template.
tests/integrations_setup/data/elastic-defend-windows.j2 New PowerShell installer template for Windows Elastic Agent.
tests/integrations_setup/data/elastic-defend-linux.j2 New Bash installer template for Linux Elastic Agent.
tests/integrations_setup/data/agent-policy-elastic-defend.json New agent policy template for Elastic Defend hosts.
tests/integrations_setup/configuration_fleet.py Add Okta-related environment configuration.
tests/integrations_setup/cdr_wiz_fleet_helpers.py Shared helpers for “use Wiz agent policy” integrations + prerelease detection.
tests/fleet_api/utils.py Add write_json() helper for sharing context via JSON file.
tests/fleet_api/entity_store_api.py Add internal APIs and polling to enable/install/init Entity Store v2.
tests/fleet_api/endpoint_package_policy.py Add helper to flip endpoint malware/ransomware modes to detect and persist policy.
tests/fleet_api/base_call_api.py Extend perform_api_call to accept ok_statuses and handle empty/204 responses.
tests/commonlib/framework/reporting.py Add pylint suppression for allure.link member detection.
deploy/test-environments/upload_state.sh Make key uploads conditional; add Elastic Defend keys + WinRM creds upload.
deploy/test-environments/modules/ec/variables.tf Add toggle for Kibana Security Solution experimental feature flags.
deploy/test-environments/modules/ec/main.tf Merge Kibana docker image override + experimental user_settings_yaml.
deploy/test-environments/modules/aws/ec2-windows/variables.tf New Windows EC2 module variables (incl. WinRM ingress CIDR).
deploy/test-environments/modules/aws/ec2-windows/terraform.tf New module provider constraints.
deploy/test-environments/modules/aws/ec2-windows/output.tf Outputs for Windows host IP/key/instance_id.
deploy/test-environments/modules/aws/ec2-windows/main.tf Provision Windows EC2 with WinRM enabled and supporting bootstrap.
deploy/test-environments/elk-stack/variables.tf Add top-level variable to control Kibana experimental flags.
deploy/test-environments/elk-stack/main.tf Pass Kibana experimental toggle into EC deployment module.
deploy/test-environments/cdr/variables.tf Add variables to enable/parameterize Elastic Defend Linux/Windows hosts.
deploy/test-environments/cdr/terraform.tf Add providers needed for new Windows module (tls/local).
deploy/test-environments/cdr/output.tf Export Elastic Defend Linux/Windows IPs/keys/instance_id outputs.
deploy/test-environments/cdr/main.tf Wire in Elastic Defend Linux EC2 + new Windows EC2 module.
deploy/test-environments/cdr/export_terraform_outputs.sh New helper to export Terraform outputs null-safely to GITHUB_OUTPUT.
.gitignore Ignore generated integration artifacts and connection/metadata JSON files.
.github/workflows/test-environment.yml Add inputs for Kibana experimental flags + entity store v2 toggle; pass Okta secrets.
.github/workflows/cdr-infra.yml Add inputs for Kibana experimental flags + entity store v2 toggle.
.github/actions/elk-stack/action.yml Pass Kibana experimental toggle into Terraform via TF_VAR.
.github/actions/cdr/action.yml Add Okta installers, Elastic Defend provisioning/enrollment steps, and entity store v2 toggle; switch to export helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@uri-weisman
Copy link
Copy Markdown
Collaborator

@coderabbitai full review

Copy link
Copy Markdown
Collaborator

@uri-weisman uri-weisman left a comment

Choose a reason for hiding this comment

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

Great work! approve with some comments


def main() -> None:
"""Create Fleet policies and write Elastic Defend install artifacts for CDR."""
package_version = get_package_version(cfg=cnfg.elk_config, package_name="endpoint", prerelease=True)
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.

can you use stack_version_uses_epm_prerelease for pre-release versions?

@gurevichdmitry gurevichdmitry merged commit a972957 into main Mar 31, 2026
10 checks passed
@gurevichdmitry gurevichdmitry deleted the dg-cdr-wf-add-integrations branch March 31, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants