Skip to content

[8.x] [Response Ops][Reporting] Add health API to inform whether conditions are sufficient for scheduled reports (#216857)#217412

Merged
ymao1 merged 1 commit intoelastic:8.xfrom
ymao1:backport/8.x/pr-216857
Apr 8, 2025
Merged

[8.x] [Response Ops][Reporting] Add health API to inform whether conditions are sufficient for scheduled reports (#216857)#217412
ymao1 merged 1 commit intoelastic:8.xfrom
ymao1:backport/8.x/pr-216857

Conversation

@ymao1
Copy link
Contributor

@ymao1 ymao1 commented Apr 7, 2025

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

… are sufficient for scheduled reports (elastic#216857)

Resolves elastic#216319

## Summary

Adds an internal reporting health API to return whether conditions are
sufficient to support scheduled reports. For scheduled reporting, we
need for security and API keys to be enabled in Elasticsearch and for a
permanent encryption key to be set for the encrypted saved objects
plugin.

```
GET kbn:/internal/reporting/_health

Response
{
  "has_permanent_encryption_key": true,
  "is_sufficiently_secure": true
}
```

The issue also mentions returning whether a preconfigured email service
is configured, but that will be done as part of the main scheduled
reporting task.

## To Verify

1. Run kibana and ES with no special flags, both flags should be `true`
2. Run ES with `-E xpack.security.enabled=false`.
`is_sufficiently_secure` should be set to `false`
3. Run ES With `-E xpack.security.authc.api_key.enabled=false`.
`is_sufficient_secure` should be set to `false`

Note that in dev mode, an encryption key is auto-set if not defined in
the Kibana yml so `has_permanent_encryption_key` will always return
`true` in dev mode.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 3d54923)

# Conflicts:
#	src/platform/packages/private/kbn-reporting/common/routes.ts
#	x-pack/platform/plugins/private/reporting/server/core.ts
#	x-pack/platform/plugins/private/reporting/server/routes/index.ts
@ymao1 ymao1 merged commit a6ef046 into elastic:8.x Apr 8, 2025
11 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/reporting-common 86 87 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
fleet 1.8MB 1.8MB +20.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
reporting 50.3KB 50.3KB +20.0B
Unknown metric groups

API count

id before after diff
@kbn/reporting-common 96 97 +1

@ymao1 ymao1 deleted the backport/8.x/pr-216857 branch April 8, 2025 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants