Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Alerting] allow email action to not require auth #60839

Merged
merged 5 commits into from
Mar 23, 2020

Conversation

pmuellr
Copy link
Member

@pmuellr pmuellr commented Mar 21, 2020

resolves #57143

Currently, the built-in email action requires user/password properties to be
set in it's secrets parameters. This PR changes that requirement, so they
are no longer required.

For maintainers

resolves elastic#57143

Currently, the built-in email action requires user/password properties to be
set in it's secrets parameters.  This PR changes that requirement, so they
are no longer required.
@pmuellr pmuellr added Feature:Alerting v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.7.0 Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) labels Mar 21, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

@@ -20,10 +19,10 @@ import { ActionsConfigurationUtilities } from '../actions_config';
export type ActionTypeConfigType = TypeOf<typeof ConfigSchema>;

const ConfigSchemaProps = {
service: nullableType(schema.string()),
Copy link
Member Author

Choose a reason for hiding this comment

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

the nullableType function was a pre-cursor to having schema.nullable() available, so I removed it here.

@pmuellr
Copy link
Member Author

pmuellr commented Mar 23, 2020

It's not clear to me that this is a complete solution for using the cloud relay mail server, as I tested this with some "stand alone" smtp server (eg, maildev), and node mailer returned errors "self signed certificate". Not clear what that even means, but I don't fully understand the smtp protocol as it's used in practice today - it sounds like it wants to use TLS, even if we have the "secure" option off.

The changes in the PR are a first step in the right direction though, and could work in some environments.

@pmuellr pmuellr marked this pull request as ready for review March 23, 2020 13:17
@pmuellr pmuellr requested a review from a team as a code owner March 23, 2020 13:17
Copy link
Contributor

@mikecote mikecote left a comment

Choose a reason for hiding this comment

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

Code LGTM

@pmuellr
Copy link
Member Author

pmuellr commented Mar 23, 2020

@elasticmachine merge upstream

Copy link
Contributor

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

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

I think that we should handle a validation case, when user entered a user name and didn't set a password like we do for Webhook. With current changes I'm able to set password only or user only value and successfully save.

}
)
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it makes sense to do like we have for a webhook:

if (!action.secrets.user && action.secrets.password) {
errors.user.push(
i18n.translate(
'xpack.triggersActionsUI.sections.addAction.webhookAction.error.requiredHostText',
{
defaultMessage: 'Username is required.',
}
)
);
}
if (!action.secrets.password && action.secrets.user) {
errors.password.push(
i18n.translate(
'xpack.triggersActionsUI.sections.addAction.webhookAction.error.requiredPasswordText',
{
defaultMessage: 'Password is required.',
}
)
);
}

Copy link
Member Author

Choose a reason for hiding this comment

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

makes sense, I'll do that

Copy link
Contributor

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

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

Changes LGTM!

@pmuellr
Copy link
Member Author

pmuellr commented Mar 23, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@pmuellr pmuellr merged commit 72bc0ea into elastic:master Mar 23, 2020
pmuellr added a commit to pmuellr/kibana that referenced this pull request Mar 23, 2020
resolves elastic#57143

Currently, the built-in email action requires user/password properties to be
set in it's secrets parameters.  This PR changes that requirement, so they
are no longer required.
pmuellr added a commit that referenced this pull request Mar 24, 2020
resolves #57143

Currently, the built-in email action requires user/password properties to be
set in it's secrets parameters.  This PR changes that requirement, so they
are no longer required.
gmmorris added a commit to gmmorris/kibana that referenced this pull request Mar 24, 2020
* master: (34 commits)
  [APM] add service map config options to legacy plugin (elastic#61002)
  [App Arch] migrate legacy CSS to new platform (core_plugins/kibana_react) (elastic#59882)
  Migrated styles for "share" plugin to new platform (elastic#59981)
  [ML] Module setup with dynamic model memory estimation (elastic#60656)
  Drilldowns (elastic#59632)
  Upgrade mocha dev-dependency from 6.2.2 to 7.1.1 (elastic#60779)
  [SIEM] Overview: Recent cases widget (elastic#60993)
  [ML] Functional tests - stabilize df analytics clone tests (elastic#60497)
  [SIEM] Updates process and TLS tables to use ECS 1.5 fields (elastic#60854)
  Migrate doc view part of discover (elastic#58094)
  Revert "[APM] Collect telemetry about data/API performance (elastic#51612)"
  fix(NA): log rotation watchers usage (elastic#60956)
  [SIEM] [CASES] Build lego blocks case details view (elastic#60864)
  Create Painless Lab app (elastic#57538)
  [SIEM] Move Timeline Template field to first step of rule creation (elastic#60840)
  [Reporting/New Platform Migration] Use a new config service on server-side (elastic#55882)
  [Alerting] allow email action to not require auth (elastic#60839)
  [Maps] Default ES document layer scaling type to clusters and show scaling UI in the create wizard (elastic#60668)
  [APM] Collect telemetry about data/API performance (elastic#51612)
  Implement Kibana Login Selector (elastic#53010)
  ...
pmuellr added a commit to pmuellr/kibana that referenced this pull request Apr 9, 2020
PR elastic#60839 added support for
unauthenticated emails, but didn't actually do enough to make it work.

This PR completes that support, and adds some tests.

You can do manual testing now with [maildev](http://maildev.github.io/maildev/).
pmuellr added a commit that referenced this pull request Apr 13, 2020
PR #60839 added support for
unauthenticated emails, but didn't actually do enough to make it work.

This PR completes that support, and adds some tests.

You can do manual testing now with [maildev](http://maildev.github.io/maildev/).
pmuellr added a commit to pmuellr/kibana that referenced this pull request Apr 13, 2020
…c#63086)

PR elastic#60839 added support for
unauthenticated emails, but didn't actually do enough to make it work.

This PR completes that support, and adds some tests.

You can do manual testing now with [maildev](http://maildev.github.io/maildev/).
pmuellr added a commit to pmuellr/kibana that referenced this pull request Apr 13, 2020
…c#63086)

PR elastic#60839 added support for
unauthenticated emails, but didn't actually do enough to make it work.

This PR completes that support, and adds some tests.

You can do manual testing now with [maildev](http://maildev.github.io/maildev/).
pmuellr added a commit that referenced this pull request Apr 14, 2020
#63412)

PR #60839 added support for
unauthenticated emails, but didn't actually do enough to make it work.

This PR completes that support, and adds some tests.

You can do manual testing now with [maildev](http://maildev.github.io/maildev/).
pmuellr added a commit that referenced this pull request Apr 14, 2020
#63411)

PR #60839 added support for
unauthenticated emails, but didn't actually do enough to make it work.

This PR completes that support, and adds some tests.

You can do manual testing now with [maildev](http://maildev.github.io/maildev/).
@mikecote mikecote added release_note:enhancement and removed release_note:skip Skip the PR/issue when compiling release notes labels Apr 15, 2020
wayneseymour pushed a commit that referenced this pull request Apr 15, 2020
PR #60839 added support for
unauthenticated emails, but didn't actually do enough to make it work.

This PR completes that support, and adds some tests.

You can do manual testing now with [maildev](http://maildev.github.io/maildev/).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported Feature:Alerting release_note:enhancement Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Email action - user and password should be optional
5 participants