Skip to content

Privmon Sync Test Data Scenario#338

Open
CAWilson94 wants to merge 5 commits intoelastic:mainfrom
CAWilson94:privmon-sync-test
Open

Privmon Sync Test Data Scenario#338
CAWilson94 wants to merge 5 commits intoelastic:mainfrom
CAWilson94:privmon-sync-test

Conversation

@CAWilson94
Copy link
Copy Markdown
Contributor

@CAWilson94 CAWilson94 commented Mar 26, 2026

Updated organization data generation to support a specialised watchlist mode for testing privileged users prebuilt watchlist sync 🔥

Additionally, refactors how entity maintainer options are managed and improves flexibility for both quick and manual data generation commands. It introduces a new configuration array for maintainers, simplifies option handling, and adds new CLI flags to control which maintainers are included in quick runs.

Entity Maintainer Options Refactor:

  • Introduced a new ENTITY_MAINTAINERS_CONFIG array of objects in constants.ts to define maintainer keys, labels, default checked status, quick inclusion, and exclusion behavior, replacing hardcoded lists throughout the codebase.
  • Updated entity_store command to use ENTITY_MAINTAINERS_CONFIG for both quick and manual maintainer selection, ensuring consistent and centralized configuration. [1] [2]

New CLI Options and Behavior:

  • Added --exclude-wl flag to the entity_store quick command, allowing users to exclude watchlist maintainers from quick runs. The filtering logic now respects the excludeOnQuick property from the config.
  • Updated the manual maintainer selection prompt to dynamically generate choices from the config, improving maintainability and flexibility.
  • Added --privmon-wl option to the org_data quick command to enable Privileged User Monitoring watchlist integrations, passing this option through to the handler.

Commands Usage

Normal Path

  • Quick org data (all integrations, default)
    yarn start org-data-quick
  • Entity maintainers quick (includes watchlists)
    yarn start generate-entity-maintainers-data --quick

Testing Privmon Sync Path

  • Quick org data with PrivMon watchlist integrations only (AD and okta as its all we care about for this scenario)
    yarn start org-data-quick --privmon-wl
  • Entity maintainers quick (exclude watchlists, we want to update entities with these with watchlist sync)
    yarn start generate-entity-maintainers-data --quick --exclude-wl

… execution. Added '--exclude-wl' to entity store to filter out watchlists and '--privmon-wl' to org data for privileged user monitoring watchlist synctesting scenario
Copilot AI review requested due to automatic review settings March 26, 2026 12:55
@CAWilson94 CAWilson94 requested a review from a team as a code owner March 26, 2026 12:55
@CAWilson94 CAWilson94 requested a review from hop-dev March 26, 2026 12:55
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

Adds new CLI flags to adjust which integrations/maintainers are included during “quick” test-data generation, with the goal of improving flexibility around watchlist-related data.

Changes:

  • org_data: introduces --privmon-wl flag and attempts to pass it into the quick generator.
  • entity_store: introduces --exclude-wl to omit watchlists during --quick runs; temporarily removes the Watchlist choice from the interactive prompt.

Reviewed changes

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

File Description
src/commands/org_data/index.ts Adds --privmon-wl option and forwards it to the quick org data generator; updates quick command description.
src/commands/entity_store/index.ts Adds --exclude-wl option for quick maintainer generation; comments out Watchlist in interactive maintainer selection.

CAWilson94 and others added 3 commits March 26, 2026 12:59
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

@@ -140,50 +135,27 @@ export const entityStoreCommands: CommandModule = {
)
.option('--space <space>', 'Kibana space ID', 'default')
.option('--quick', 'Run all maintainers for 10000 entities without prompts')
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

The --quick help text says it will "Run all maintainers" but the behavior can now exclude watchlists via --exclude-wl, and (via config) could diverge further from "all" in the future. Consider updating the --quick description to reflect that it runs the configured quick-default maintainers (with optional exclusions) to avoid misleading CLI help.

Suggested change
.option('--quick', 'Run all maintainers for 10000 entities without prompts')
.option(
'--quick',
'Run quick-default maintainers for 10000 entities without prompts (respects --exclude-wl and maintainer config)',
)

Copilot uses AI. Check for mistakes.
@CAWilson94 CAWilson94 self-assigned this Mar 26, 2026
@CAWilson94 CAWilson94 changed the title Privmon Sync Test Privmon Sync Test Data Scenario Mar 26, 2026
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.

2 participants