Skip to content

[Entity Analytics][Chore] Tidy Privmon URLs, imports and routes#233400

Merged
hop-dev merged 8 commits intoelastic:mainfrom
hop-dev:privmon-tidy
Sep 2, 2025
Merged

[Entity Analytics][Chore] Tidy Privmon URLs, imports and routes#233400
hop-dev merged 8 commits intoelastic:mainfrom
hop-dev:privmon-tidy

Conversation

@hop-dev
Copy link
Contributor

@hop-dev hop-dev commented Aug 28, 2025

Summary

Currently blocked by #233112

Some tidying of the privmon code:

  • move all privmon URLs to constants
  • split monitoring entity source routes into their own files
  • tidy .gen imports by creating a few .index.ts files (allows us to consolidate imports and makes the paths a lot shorter)

It might be nicer to review commit by commit

@hop-dev hop-dev self-assigned this Aug 28, 2025
@hop-dev hop-dev requested review from a team as code owners August 28, 2025 20:22
@hop-dev hop-dev added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels Aug 28, 2025
@hop-dev hop-dev added the Team:Entity Analytics Security Entity Analytics Team label Aug 28, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-entity-analytics (Team:Entity Analytics)

export const PRIVMON_USERS_CSV_SIZE_TOLERANCE_BYTES = 1024 * 50; // ~= 50kb
export const PRIVMON_USERS_CSV_MAX_SIZE_BYTES_WITH_TOLERANCE =
PRIVMON_USERS_CSV_MAX_SIZE_BYTES + PRIVMON_USERS_CSV_SIZE_TOLERANCE_BYTES;

Copy link
Contributor Author

@hop-dev hop-dev Aug 28, 2025

Choose a reason for hiding this comment

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

the shiny new URL consts all organised

dataClient.audit(
PrivilegeMonitoringEngineActions.INIT,
EngineComponentResourceEnum.privmon_engine,
MonitoringEngineComponentResourceEnum.privmon_engine,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this variable name conflicted with a variable name in the entity store

Copy link
Member

@bmorelli25 bmorelli25 left a comment

Choose a reason for hiding this comment

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

docs-owned changes ✅

@elasticmachine
Copy link
Contributor

⏳ Build in-progress, with failures

Failed CI Steps

History

cc @hop-dev

});
}
}
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, thank you! 🚀 Just to double-check I’ve got the diffs right:
• Updated the URL to use the constant
• Logger now passed in
• Route registered via the createMonitoringEntitySourceRoute factory

Did I miss anything? 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thats right!

try {
await assertAdvancedSettingsEnabled(
await context.core,
ENABLE_PRIVILEGED_USER_MONITORING_SETTING
Copy link
Contributor

Choose a reason for hiding this comment

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

noice

Copy link
Contributor

@CAWilson94 CAWilson94 left a comment

Choose a reason for hiding this comment

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

LOOKS_GOOD_TO_ME thanks for taking the time to do this 🎉

@hop-dev hop-dev merged commit 08da8a2 into elastic:main Sep 2, 2025
12 checks passed
@hop-dev hop-dev deleted the privmon-tidy branch September 2, 2025 13:18
MichelLosier pushed a commit to MichelLosier/kibana that referenced this pull request Sep 2, 2025
…tic#233400)

## Summary

Currently blocked by elastic#233112

Some tidying of the privmon code:

- move all privmon URLs to constants
- split monitoring entity source routes into their own files
- tidy .gen imports by creating a few .index.ts files (allows us to
consolidate imports and makes the paths a lot shorter)

It might be nicer to review commit by commit
kowalczyk-krzysztof pushed a commit to kowalczyk-krzysztof/kibana that referenced this pull request Sep 3, 2025
…tic#233400)

## Summary

Currently blocked by elastic#233112

Some tidying of the privmon code:

- move all privmon URLs to constants
- split monitoring entity source routes into their own files
- tidy .gen imports by creating a few .index.ts files (allows us to
consolidate imports and makes the paths a lot shorter)

It might be nicer to review commit by commit
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:Entity Analytics Security Entity Analytics Team v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants