Skip to content

[Response Ops] Add xpack.actions.email.recipient_allowlist config#220058

Merged
jcger merged 31 commits intoelastic:mainfrom
jcger:issue-210355-email-recipients-allow-list
Jul 10, 2025
Merged

[Response Ops] Add xpack.actions.email.recipient_allowlist config#220058
jcger merged 31 commits intoelastic:mainfrom
jcger:issue-210355-email-recipients-allow-list

Conversation

@jcger
Copy link
Contributor

@jcger jcger commented May 5, 2025

Summary

Closes #210355

As this Kibana config contains sensitive data, we moved the validation to the server side only

Release note

Adds xpack.actions.email.recipient_allowlist kibana config.

@jcger jcger force-pushed the issue-210355-email-recipients-allow-list branch from 115c28e to cc5de1c Compare May 5, 2025 19:15

import { createTestConfig } from '../../../../../../common/config';

export const recipientAllowList = ['*.bar@example.org', '*@test.com'];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had to create a new config to be able to set the recipientAllowList

@jcger jcger force-pushed the issue-210355-email-recipients-allow-list branch from cc5de1c to 5950ac6 Compare May 5, 2025 19:17
@jcger jcger added backport:skip This PR does not require backporting Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// release_note:feature Makes this part of the condensed release notes v9.1.0 v8.19.0 labels May 6, 2025
@jcger jcger marked this pull request as ready for review May 6, 2025 07:41
@jcger jcger requested review from a team as code owners May 6, 2025 07:41
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

schema.object(
{
domain_allowlist: schema.maybe(schema.arrayOf(schema.string())),
recipient_allowlist: schema.maybe(schema.arrayOf(schema.string())),
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add this to src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker too?

Copy link
Contributor Author

@jcger jcger May 7, 2025

Choose a reason for hiding this comment

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

thanks, done in 539585c. I just realised that file is auto generated. Checking...

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, that file is NOT auto-generated. See: https://ela.st/docker-file-not-autogenerated - I keep forgetting to delete that line when I get in that file :-). Feel free to delete it yourself!

BTW, we will also want to add this to the cloud allow-list of config keys. We can point you to some example PRs where we've done this - it's fairly simple, but will be another PR since it's a different repo.

Copy link
Contributor Author

@jcger jcger May 19, 2025

Choose a reason for hiding this comment

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

I removed the "auto-generated" comment in 9d8c11f

Feel free to share those PRs here or via slack with me whenever you have time :)

Copy link
Contributor

Choose a reason for hiding this comment

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

example PR where we add the cloud allow-list entrie: https://github.com/elastic/cloud/pull/131284

@jcger jcger requested review from a team and pmuellr May 6, 2025 14:24
@jcger jcger requested a review from a team as a code owner May 7, 2025 10:43
@jcger jcger marked this pull request as ready for review July 3, 2025 16:42
@jcger jcger requested a review from a team as a code owner July 3, 2025 16:42
Copy link
Contributor

@florent-leborgne florent-leborgne left a comment

Choose a reason for hiding this comment

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

Hi, I'm not super familiar yet with this file.

In the new docs (since 9.0), we do not publish a new version of each page for each minor, and instead annotate the same page over time. That means that we need to ensure that anything added at a specific point in time is flagged as such. In this case, if I understand correctly, the setting will be added with 9.2.

I am just not super sure of how this file is processed exactly yet.

If this setting was already available in 9.0 and 9.1 and was just missing, you can ignore my comment.

Copy link
Member

@cnasikas cnasikas left a comment

Choose a reason for hiding this comment

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

LGTM! I tested and is working as expected.

/** treat any address which contains a mustache template as valid */
treatMustacheTemplatesAsValid?: boolean;
// addresses with this option won't be validated against the allowed recipient list
isSender?: boolean;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
isSender?: boolean;
ignoreReceipentAllowlistValidation?: boolean;

I think it is more explicit about the purpose of the option. The isSender does not convey what the function will do. Wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did it this way because next time we need to update the sender field behavior, we won't have to fear missing one of the existing "from" fields. But I don't care, if you feel strong about it, just let me know

Copy link
Member

@cnasikas cnasikas Jul 8, 2025

Choose a reason for hiding this comment

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

I think it is better if you see the function as a standalone one but not a strong opinion either.

@jcger jcger force-pushed the issue-210355-email-recipients-allow-list branch from 54a50bc to 2bc2f46 Compare July 8, 2025 10:54
@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

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

[✅] x-pack/platform/test/alerting_api_integration/spaces_only/tests/actions/connector_types/stack/email_recipient_allowlist/config.ts: 200/200 tests passed.

see run history

jcger and others added 2 commits July 10, 2025 15:38
@jcger jcger enabled auto-merge (squash) July 10, 2025 14:02
@jcger jcger force-pushed the issue-210355-email-recipients-allow-list branch from 3e3ae97 to a72150f Compare July 10, 2025 15:37
@jcger jcger merged commit d824ffe into elastic:main Jul 10, 2025
12 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
actions 13 14 +1

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/std 74 78 +4
actions 336 338 +2
total +6

Async chunks

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

id before after diff
stackConnectors 617.7KB 617.7KB +14.0B

Page load bundle

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

id before after diff
actions 17.2KB 17.8KB +663.0B
kbnUiSharedDeps-srcJs 3.8MB 3.8MB +345.0B
total +1008.0B
Unknown metric groups

API count

id before after diff
@kbn/std 120 124 +4
actions 342 344 +2
total +6

History

jcger added a commit that referenced this pull request Jul 21, 2025
…228230)

Parent issue #210355
Merged in #220058

---------

Co-authored-by: Nastasha Solomon <79124755+nastasha-solomon@users.noreply.github.com>
Co-authored-by: florent-leborgne <florent.leborgne@elastic.co>
Bluefinger pushed a commit to Bluefinger/kibana that referenced this pull request Jul 22, 2025
…lastic#228230)

Parent issue elastic#210355
Merged in elastic#220058

---------

Co-authored-by: Nastasha Solomon <79124755+nastasha-solomon@users.noreply.github.com>
Co-authored-by: florent-leborgne <florent.leborgne@elastic.co>
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
…lastic#220058)

## Summary

Closes elastic#210355

As this Kibana config contains sensitive data, we moved the validation
to the server side only

## Release note
Adds `xpack.actions.email.recipient_allowlist` kibana config.

---------

Co-authored-by: lcawl <lcawley@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: florent-leborgne <florent.leborgne@elastic.co>
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
…lastic#228230)

Parent issue elastic#210355
Merged in elastic#220058

---------

Co-authored-by: Nastasha Solomon <79124755+nastasha-solomon@users.noreply.github.com>
Co-authored-by: florent-leborgne <florent.leborgne@elastic.co>
crespocarlos pushed a commit to crespocarlos/kibana that referenced this pull request Jul 25, 2025
…lastic#228230)

Parent issue elastic#210355
Merged in elastic#220058

---------

Co-authored-by: Nastasha Solomon <79124755+nastasha-solomon@users.noreply.github.com>
Co-authored-by: florent-leborgne <florent.leborgne@elastic.co>
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:feature Makes this part of the condensed release notes Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v9.2.0