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

[Response Ops][Actions] Adding configuration to override default MS Graph API Scope and Exchange URL values #175812

Merged
merged 6 commits into from
Feb 1, 2024

Conversation

ymao1
Copy link
Contributor

@ymao1 ymao1 commented Jan 29, 2024

Resolves #166064

Summary

Adds the following configurations to the kibana.yml config:

  • xpack.actions.microsoftGraphApiScope - overrides the default Graph API scope value of https://graph.microsoft.com/.default
  • xpack.actions.microsoftExchangeUrl - overrides the default value of https://login.microsoftonline.com

This allows users in different Azure environments to customize their endpoints as needed.

To Verify

We are unable to test this in a different environment but we can verify that the config overrides the defaults as expected by setting the config values to something different and the logging out the params that are sent to getOAuthClientCredentialsAccessToken in x-pack/plugins/stack_connectors/server/connector_types/email/send_email.ts. Then create an MS Exchange email connector and test it to see that the logged values are overridden as expected.

@ymao1
Copy link
Contributor Author

ymao1 commented Jan 29, 2024

/ci

@ymao1 ymao1 changed the title Making graph API scope and exchange UR [Response Ops][Actions] Adding configuration to override default MS Graph API Scope and Exchange URL values Jan 29, 2024
@ymao1 ymao1 self-assigned this Jan 29, 2024
@ymao1
Copy link
Contributor Author

ymao1 commented Jan 29, 2024

/ci

@ymao1 ymao1 added Feature:Actions Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) backport:prev-major Backport to (8.x, 8.17, 8.16) the previous major branch and other branches in development v8.13.0 release_note:skip Skip the PR/issue when compiling release notes labels Jan 29, 2024
@ymao1 ymao1 marked this pull request as ready for review January 29, 2024 17:54
@ymao1 ymao1 requested a review from a team as a code owner January 29, 2024 17:54
@elasticmachine
Copy link
Contributor

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


`xpack.actions.microsoftGraphApiScope`::
The URL for the Microsoft Graph API scope endpoint to use for MS Exchange email authentication. Default: `https://graph.microsoft.com/.default`.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lcawl Can you review the wording here?

@ymao1 ymao1 added v8.12.1 backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) and removed v8.12.1 labels Jan 29, 2024
@ymao1
Copy link
Contributor Author

ymao1 commented Feb 1, 2024

@elasticmachine merge upstream

@ymao1 ymao1 requested a review from ersin-erdal February 1, 2024 14:48
Copy link
Contributor

@ersin-erdal ersin-erdal left a comment

Choose a reason for hiding this comment

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

LGTM

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #1 / aiops log rate analysis with 'ft_farequote' farequote with spike displays index details

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
actions 270 273 +3

Page load bundle

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

id before after diff
actions 16.3KB 16.6KB +309.0B
Unknown metric groups

API count

id before after diff
actions 276 279 +3

History

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

cc @ymao1

@ymao1
Copy link
Contributor Author

ymao1 commented Feb 1, 2024

@elasticmachine run elasticsearch-ci/docs

@ymao1 ymao1 merged commit f7e4f7a into elastic:main Feb 1, 2024
19 checks passed
@ymao1 ymao1 deleted the configurable-ms-exchange branch February 1, 2024 17:41
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 1, 2024
…raph API Scope and Exchange URL values (elastic#175812)

Resolves elastic#166064

## Summary

Adds the following configurations to the `kibana.yml` config:
* `xpack.actions.microsoftGraphApiScope` - overrides the default Graph
API scope value of `https://graph.microsoft.com/.default`
* `xpack.actions.microsoftExchangeUrl` - overrides the default value of
`https://login.microsoftonline.com`

This allows users in different Azure environments to customize their
endpoints as needed.

## To Verify

We are unable to test this in a different environment but we can verify
that the config overrides the defaults as expected by setting the config
values to something different and the logging out the params that are
sent to `getOAuthClientCredentialsAccessToken` in
`x-pack/plugins/stack_connectors/server/connector_types/email/send_email.ts`.
Then create an MS Exchange email connector and test it to see that the
logged values are overridden as expected.

---------

Co-authored-by: Kibana Machine <[email protected]>
(cherry picked from commit f7e4f7a)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
7.17 Backport failed because of merge conflicts
8.12

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 175812

Questions ?

Please refer to the Backport tool documentation

@ymao1
Copy link
Contributor Author

ymao1 commented Feb 1, 2024

💚 All backports created successfully

Status Branch Result
7.17

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

ymao1 added a commit to ymao1/kibana that referenced this pull request Feb 1, 2024
…raph API Scope and Exchange URL values (elastic#175812)

Resolves elastic#166064

## Summary

Adds the following configurations to the `kibana.yml` config:
* `xpack.actions.microsoftGraphApiScope` - overrides the default Graph
API scope value of `https://graph.microsoft.com/.default`
* `xpack.actions.microsoftExchangeUrl` - overrides the default value of
`https://login.microsoftonline.com`

This allows users in different Azure environments to customize their
endpoints as needed.

## To Verify

We are unable to test this in a different environment but we can verify
that the config overrides the defaults as expected by setting the config
values to something different and the logging out the params that are
sent to `getOAuthClientCredentialsAccessToken` in
`x-pack/plugins/stack_connectors/server/connector_types/email/send_email.ts`.
Then create an MS Exchange email connector and test it to see that the
logged values are overridden as expected.

---------

Co-authored-by: Kibana Machine <[email protected]>
(cherry picked from commit f7e4f7a)

# Conflicts:
#	docs/settings/alert-action-settings.asciidoc
#	x-pack/plugins/actions/common/index.ts
#	x-pack/plugins/actions/server/actions_client/actions_client.test.ts
#	x-pack/plugins/actions/server/actions_config.test.ts
#	x-pack/plugins/actions/server/actions_config.ts
#	x-pack/plugins/actions/server/builtin_action_types/lib/send_email.test.ts
#	x-pack/plugins/actions/server/builtin_action_types/lib/send_email.ts
#	x-pack/plugins/actions/server/config.test.ts
#	x-pack/plugins/actions/server/config.ts
#	x-pack/plugins/actions/server/integration_tests/axios_utils_connection.test.ts
#	x-pack/plugins/actions/server/integration_tests/axios_utils_proxy.test.ts
#	x-pack/plugins/actions/server/lib/custom_host_settings.test.ts
#	x-pack/plugins/actions/server/plugin.test.ts
kibanamachine added a commit that referenced this pull request Feb 1, 2024
…lt MS Graph API Scope and Exchange URL values (#175812) (#176085)

# Backport

This will backport the following commits from `main` to `8.12`:
- [[Response Ops][Actions] Adding configuration to override default MS
Graph API Scope and Exchange URL values
(#175812)](#175812)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Ying
Mao","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-02-01T17:41:52Z","message":"[Response
Ops][Actions] Adding configuration to override default MS Graph API
Scope and Exchange URL values (#175812)\n\nResolves
https://github.com/elastic/kibana/issues/166064\r\n\r\n##
Summary\r\n\r\nAdds the following configurations to the `kibana.yml`
config:\r\n* `xpack.actions.microsoftGraphApiScope` - overrides the
default Graph\r\nAPI scope value of
`https://graph.microsoft.com/.default`\r\n*
`xpack.actions.microsoftExchangeUrl` - overrides the default value
of\r\n`https://login.microsoftonline.com`\r\n\r\nThis allows users in
different Azure environments to customize their\r\nendpoints as
needed.\r\n\r\n## To Verify\r\n\r\nWe are unable to test this in a
different environment but we can verify\r\nthat the config overrides the
defaults as expected by setting the config\r\nvalues to something
different and the logging out the params that are\r\nsent to
`getOAuthClientCredentialsAccessToken`
in\r\n`x-pack/plugins/stack_connectors/server/connector_types/email/send_email.ts`.\r\nThen
create an MS Exchange email connector and test it to see that
the\r\nlogged values are overridden as
expected.\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"f7e4f7a636763d46cb6a38b21a5eb6e67595ddfe","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Feature:Actions","Team:ResponseOps","backport:prev-minor","backport:prev-MAJOR","v8.13.0"],"title":"[Response
Ops][Actions] Adding configuration to override default MS Graph API
Scope and Exchange URL
values","number":175812,"url":"https://github.com/elastic/kibana/pull/175812","mergeCommit":{"message":"[Response
Ops][Actions] Adding configuration to override default MS Graph API
Scope and Exchange URL values (#175812)\n\nResolves
https://github.com/elastic/kibana/issues/166064\r\n\r\n##
Summary\r\n\r\nAdds the following configurations to the `kibana.yml`
config:\r\n* `xpack.actions.microsoftGraphApiScope` - overrides the
default Graph\r\nAPI scope value of
`https://graph.microsoft.com/.default`\r\n*
`xpack.actions.microsoftExchangeUrl` - overrides the default value
of\r\n`https://login.microsoftonline.com`\r\n\r\nThis allows users in
different Azure environments to customize their\r\nendpoints as
needed.\r\n\r\n## To Verify\r\n\r\nWe are unable to test this in a
different environment but we can verify\r\nthat the config overrides the
defaults as expected by setting the config\r\nvalues to something
different and the logging out the params that are\r\nsent to
`getOAuthClientCredentialsAccessToken`
in\r\n`x-pack/plugins/stack_connectors/server/connector_types/email/send_email.ts`.\r\nThen
create an MS Exchange email connector and test it to see that
the\r\nlogged values are overridden as
expected.\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"f7e4f7a636763d46cb6a38b21a5eb6e67595ddfe"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.13.0","branchLabelMappingKey":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/175812","number":175812,"mergeCommit":{"message":"[Response
Ops][Actions] Adding configuration to override default MS Graph API
Scope and Exchange URL values (#175812)\n\nResolves
https://github.com/elastic/kibana/issues/166064\r\n\r\n##
Summary\r\n\r\nAdds the following configurations to the `kibana.yml`
config:\r\n* `xpack.actions.microsoftGraphApiScope` - overrides the
default Graph\r\nAPI scope value of
`https://graph.microsoft.com/.default`\r\n*
`xpack.actions.microsoftExchangeUrl` - overrides the default value
of\r\n`https://login.microsoftonline.com`\r\n\r\nThis allows users in
different Azure environments to customize their\r\nendpoints as
needed.\r\n\r\n## To Verify\r\n\r\nWe are unable to test this in a
different environment but we can verify\r\nthat the config overrides the
defaults as expected by setting the config\r\nvalues to something
different and the logging out the params that are\r\nsent to
`getOAuthClientCredentialsAccessToken`
in\r\n`x-pack/plugins/stack_connectors/server/connector_types/email/send_email.ts`.\r\nThen
create an MS Exchange email connector and test it to see that
the\r\nlogged values are overridden as
expected.\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"f7e4f7a636763d46cb6a38b21a5eb6e67595ddfe"}}]}]
BACKPORT-->

Co-authored-by: Ying Mao <[email protected]>
@kibanamachine kibanamachine added v8.12.1 backport missing Added to PRs automatically when the are determined to be missing a backport. labels Feb 1, 2024
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Feb 6, 2024
@mistic
Copy link
Member

mistic commented Feb 7, 2024

This PR didn't make it on time to the latest build candidate of v8.12.1. Updating the labels.

@mistic mistic added v8.12.2 and removed v8.12.1 labels Feb 7, 2024
fkanout pushed a commit to fkanout/kibana that referenced this pull request Feb 7, 2024
…raph API Scope and Exchange URL values (elastic#175812)

Resolves elastic#166064

## Summary

Adds the following configurations to the `kibana.yml` config:
* `xpack.actions.microsoftGraphApiScope` - overrides the default Graph
API scope value of `https://graph.microsoft.com/.default`
* `xpack.actions.microsoftExchangeUrl` - overrides the default value of
`https://login.microsoftonline.com`

This allows users in different Azure environments to customize their
endpoints as needed.

## To Verify

We are unable to test this in a different environment but we can verify
that the config overrides the defaults as expected by setting the config
values to something different and the logging out the params that are
sent to `getOAuthClientCredentialsAccessToken` in
`x-pack/plugins/stack_connectors/server/connector_types/email/send_email.ts`.
Then create an MS Exchange email connector and test it to see that the
logged values are overridden as expected.

---------

Co-authored-by: Kibana Machine <[email protected]>
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
…raph API Scope and Exchange URL values (elastic#175812)

Resolves elastic#166064

## Summary

Adds the following configurations to the `kibana.yml` config:
* `xpack.actions.microsoftGraphApiScope` - overrides the default Graph
API scope value of `https://graph.microsoft.com/.default`
* `xpack.actions.microsoftExchangeUrl` - overrides the default value of
`https://login.microsoftonline.com`

This allows users in different Azure environments to customize their
endpoints as needed.

## To Verify

We are unable to test this in a different environment but we can verify
that the config overrides the defaults as expected by setting the config
values to something different and the logging out the params that are
sent to `getOAuthClientCredentialsAccessToken` in
`x-pack/plugins/stack_connectors/server/connector_types/email/send_email.ts`.
Then create an MS Exchange email connector and test it to see that the
logged values are overridden as expected.

---------

Co-authored-by: Kibana Machine <[email protected]>
fkanout pushed a commit to fkanout/kibana that referenced this pull request Mar 4, 2024
…raph API Scope and Exchange URL values (elastic#175812)

Resolves elastic#166064

## Summary

Adds the following configurations to the `kibana.yml` config:
* `xpack.actions.microsoftGraphApiScope` - overrides the default Graph
API scope value of `https://graph.microsoft.com/.default`
* `xpack.actions.microsoftExchangeUrl` - overrides the default value of
`https://login.microsoftonline.com`

This allows users in different Azure environments to customize their
endpoints as needed.

## To Verify

We are unable to test this in a different environment but we can verify
that the config overrides the defaults as expected by setting the config
values to something different and the logging out the params that are
sent to `getOAuthClientCredentialsAccessToken` in
`x-pack/plugins/stack_connectors/server/connector_types/email/send_email.ts`.
Then create an MS Exchange email connector and test it to see that the
logged values are overridden as expected.

---------

Co-authored-by: Kibana Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-major Backport to (8.x, 8.17, 8.16) the previous major branch and other branches in development backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:Actions release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.12.2 v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Encountering a "Confidential Client is not supported in Cross Cloud request" error in Azure Gov Cloud
6 participants