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

[Docs] Document Anonymous authentication provider. #84910

Merged

Conversation

azasypkin
Copy link
Member

@azasypkin azasypkin commented Dec 3, 2020

Document Anonymous authentication provider introduced in #79985 and #84074.

Preview

@azasypkin azasypkin added Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! Feature:Security/Authentication Platform Security - Authentication v8.0.0 release_note:skip Skip the PR/issue when compiling release notes docs v7.11.0 labels Dec 3, 2020
@azasypkin azasypkin marked this pull request as ready for review December 3, 2020 15:22
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security (Team:Security)


[source,yaml]
----------------------------------------
# Username and password credentials
Copy link
Member Author

Choose a reason for hiding this comment

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

note: not super happy about having technically invalid yaml snippet (because of duplicated entries), but couldn't think of a better option.

Copy link
Member

Choose a reason for hiding this comment

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

I think this is reasonable. We could split this out into 4 different snippets if necessary, but I think what you have here is fine.

Copy link
Member

@legrego legrego left a comment

Choose a reason for hiding this comment

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

As always, we'll let the docs team help refine my suggestions, but here's my first attempt. Thanks for writing this up, looks great!


[IMPORTANT]
============================================================================
Since anonymous access allows anyone to access {kib} as long as they can access network {kib} is exposed to, make sure to grant anonymous service account only as many privileges as really needed.
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
Since anonymous access allows anyone to access {kib} as long as they can access network {kib} is exposed to, make sure to grant anonymous service account only as many privileges as really needed.
Anyone with access to the network {kib} is exposed to will be able to access {kib}. Make sure that you've properly restricted the capabilities of the anonymous service account so that anonymous users can't perform destructive actions or escalate their own privileges.

Copy link
Member Author

Choose a reason for hiding this comment

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

Much better, thanks!

Since anonymous access allows anyone to access {kib} as long as they can access network {kib} is exposed to, make sure to grant anonymous service account only as many privileges as really needed.
============================================================================

Anonymous authentication gives users access to {kib} without requiring them to provide any sort of credentials. This can be useful if you want your users to skip the login step when you embed {kib} dashboard in another application or set up a demo {kib} instance in your internal network while still keeping other {kib} security features intact.
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
Anonymous authentication gives users access to {kib} without requiring them to provide any sort of credentials. This can be useful if you want your users to skip the login step when you embed {kib} dashboard in another application or set up a demo {kib} instance in your internal network while still keeping other {kib} security features intact.
Anonymous authentication gives users access to {kib} without requiring them to provide any sort of credentials. This can be useful if you want your users to skip the login step when you embed dashboards in another application or set up a demo {kib} instance in your internal network while still keeping other security features intact.


Anonymous authentication gives users access to {kib} without requiring them to provide any sort of credentials. This can be useful if you want your users to skip the login step when you embed {kib} dashboard in another application or set up a demo {kib} instance in your internal network while still keeping other {kib} security features intact.

To enable anonymous authentication in {kib}, you need to decide what credentials or so-called anonymous service account {kib} should use internally to authenticate anonymous requests to {es}. You can pick one of the three different approaches here:
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
To enable anonymous authentication in {kib}, you need to decide what credentials or so-called anonymous service account {kib} should use internally to authenticate anonymous requests to {es}. You can pick one of the three different approaches here:
To enable anonymous authentication in {kib}, you need to decide what credentials the anonymous service account {kib} should use internally to authenticate anonymous requests. There are three ways to specify these credentials:

[float]
===== Anonymous access and other types of authentication

You can also configure any other authentication mechanisms in addition to the anonymous access in {kib}. In this case Login Selector UI will present a dedicated `Continue as Guest` option for the anonymous access:
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
You can also configure any other authentication mechanisms in addition to the anonymous access in {kib}. In this case Login Selector UI will present a dedicated `Continue as Guest` option for the anonymous access:
You can configure other authentication providers in addition to anonymous access in {kib}. In this case Login Selector UI will present a dedicated `Continue as Guest` option for anonymous access:

credentials: "elasticsearch_anonymous_user" <1>
-----------------------------------------------

<1> The `elasticsearch_anonymous_user` is just a special constant that doesn't have any other meaning
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
<1> The `elasticsearch_anonymous_user` is just a special constant that doesn't have any other meaning
<1> The `elasticsearch_anonymous_user` is a special constant that indicates you wish to use Elasticsearch's anonymous user.

[float]
===== Anonymous access and embedding

One of the most popular use cases for the anonymous access is when you embed {kib} into other applications and don't want to force your users to log in just to view it. If you configured {kib} to use anonymous access as a sole authentication mechanism, you don't need to do anything special while embedding {kib}.
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
One of the most popular use cases for the anonymous access is when you embed {kib} into other applications and don't want to force your users to log in just to view it. If you configured {kib} to use anonymous access as a sole authentication mechanism, you don't need to do anything special while embedding {kib}.
One of the most popular use cases for anonymous access is when you embed {kib} into other applications and don't want to force your users to log in just to view it. If you configured {kib} to use anonymous access as the sole authentication mechanism, you don't need to do anything special while embedding {kib}.


One of the most popular use cases for the anonymous access is when you embed {kib} into other applications and don't want to force your users to log in just to view it. If you configured {kib} to use anonymous access as a sole authentication mechanism, you don't need to do anything special while embedding {kib}.

The things become a bit tricky if you configure multiple authentication mechanisms and use Login Selector UI to log in to {kib}. In this case embedded {kib} doesn't know whether you want your users to use anonymous access or not. If the intention is to use anonymous access then you should add `auth_provider_hint=<anonymous-provider-name>` query string parameter to the {kib} URL.
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need to qualify the Login Selector UI here. We are trying to discourage disabling this, so I think it's safe for us to assume in these docs that it'll be enabled.

Suggested change
The things become a bit tricky if you configure multiple authentication mechanisms and use Login Selector UI to log in to {kib}. In this case embedded {kib} doesn't know whether you want your users to use anonymous access or not. If the intention is to use anonymous access then you should add `auth_provider_hint=<anonymous-provider-name>` query string parameter to the {kib} URL.
If you have multiple authentication providers enabled, and you wish to automatically log in anonymous users when embedding, then you will need to add the `auth_provider_hint=<anonymous-provider-name>` query string parameter to the {kib} URL that you're embedding.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think we need to qualify the Login Selector UI here. We are trying to discourage disabling this, so I think it's safe for us to assume in these docs that it'll be enabled.

Wholeheartedly agree!


[source,yaml]
----------------------------------------
# Username and password credentials
Copy link
Member

Choose a reason for hiding this comment

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

I think this is reasonable. We could split this out into 4 different snippets if necessary, but I think what you have here is fine.

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-docs (Team:Docs)

@azasypkin azasypkin requested review from a team and legrego December 4, 2020 15:37
|===
| `xpack.security.authc.providers.`
`anonymous.<provider-name>.credentials` {ess-icon}
| Credentials that {kib} should use internally to authenticate anonymous requests to {es}. Possible values are: username and password credentials, API key or `elasticsearch_anonymous_user` constant if you want to leverage {ref}/anonymous-access.html[{es} anonymous access].
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| Credentials that {kib} should use internally to authenticate anonymous requests to {es}. Possible values are: username and password credentials, API key or `elasticsearch_anonymous_user` constant if you want to leverage {ref}/anonymous-access.html[{es} anonymous access].
| Credentials that {kib} should use internally to authenticate anonymous requests to {es}. Possible values are: username and password, API key, or the constant `elasticsearch_anonymous_user` if you want to leverage {ref}/anonymous-access.html[{es} anonymous access].

Anyone with access to the network {kib} is exposed to will be able to access {kib}. Make sure that you've properly restricted the capabilities of the anonymous service account so that anonymous users can't perform destructive actions or escalate their own privileges.
============================================================================

Anonymous authentication gives users access to {kib} without requiring them to provide any sort of credentials. This can be useful if you want your users to skip the login step when you embed dashboards in another application or set up a demo {kib} instance in your internal network while still keeping other security features intact.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Anonymous authentication gives users access to {kib} without requiring them to provide any sort of credentials. This can be useful if you want your users to skip the login step when you embed dashboards in another application or set up a demo {kib} instance in your internal network while still keeping other security features intact.
Anonymous authentication gives users access to {kib} without requiring them to provide credentials. This can be useful if you want your users to skip the login step when you embed dashboards in another application or set up a demo {kib} instance in your internal network, while still keeping other security features intact.


Anonymous authentication gives users access to {kib} without requiring them to provide any sort of credentials. This can be useful if you want your users to skip the login step when you embed dashboards in another application or set up a demo {kib} instance in your internal network while still keeping other security features intact.

To enable anonymous authentication in {kib}, you need to decide what credentials the anonymous service account {kib} should use internally to authenticate anonymous requests. There are three ways to specify these credentials:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
To enable anonymous authentication in {kib}, you need to decide what credentials the anonymous service account {kib} should use internally to authenticate anonymous requests. There are three ways to specify these credentials:
To enable anonymous authentication in {kib}, you must decide what credentials the anonymous service account {kib} should use internally to authenticate anonymous requests. There are three ways to specify these credentials:


To enable anonymous authentication in {kib}, you need to decide what credentials the anonymous service account {kib} should use internally to authenticate anonymous requests. There are three ways to specify these credentials:

NOTE: You can configure only one anonymous authentication provider per {kib} instance.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest moving the sentence "There are three ways to specify these credentials" to after the Note.


NOTE: You can configure only one anonymous authentication provider per {kib} instance.

If you have a user that can authenticate to {es} using username and password, from a Native or LDAP security realms for instance, you can also use these credentials to impersonate the anonymous users. Here is how your `kibana.yml` can look like if you want to use username and password credentials:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
If you have a user that can authenticate to {es} using username and password, from a Native or LDAP security realms for instance, you can also use these credentials to impersonate the anonymous users. Here is how your `kibana.yml` can look like if you want to use username and password credentials:
If you have a user who can authenticate to {es} using username and password, for instance from a Native or LDAP security realms, you can also use these credentials to impersonate the anonymous users. Here is how your `kibana.yml` might look if you use username and password credentials:

[float]
===== Anonymous access and embedding

One of the most popular use cases for anonymous access is when you embed {kib} into other applications and don't want to force your users to log in just to view it. If you configured {kib} to use anonymous access as the sole authentication mechanism, you don't need to do anything special while embedding {kib}.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
One of the most popular use cases for anonymous access is when you embed {kib} into other applications and don't want to force your users to log in just to view it. If you configured {kib} to use anonymous access as the sole authentication mechanism, you don't need to do anything special while embedding {kib}.
One of the most popular use cases for anonymous access is when you embed {kib} into other applications and don't want to force your users to log in to view it. If you configured {kib} to use anonymous access as the sole authentication mechanism, you don't need to do anything special while embedding {kib}.


One of the most popular use cases for anonymous access is when you embed {kib} into other applications and don't want to force your users to log in just to view it. If you configured {kib} to use anonymous access as the sole authentication mechanism, you don't need to do anything special while embedding {kib}.

If you have multiple authentication providers enabled, and you wish to automatically log in anonymous users when embedding, then you will need to add the `auth_provider_hint=<anonymous-provider-name>` query string parameter to the {kib} URL that you're embedding.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
If you have multiple authentication providers enabled, and you wish to automatically log in anonymous users when embedding, then you will need to add the `auth_provider_hint=<anonymous-provider-name>` query string parameter to the {kib} URL that you're embedding.
If you have multiple authentication providers enabled, and you want to automatically log in anonymous users when embedding, then you will need to add the `auth_provider_hint=<anonymous-provider-name>` query string parameter to the {kib} URL that you're embedding.


If you have multiple authentication providers enabled, and you wish to automatically log in anonymous users when embedding, then you will need to add the `auth_provider_hint=<anonymous-provider-name>` query string parameter to the {kib} URL that you're embedding.

For example, if you generate the iFrame code to embed {kib} it will look like this:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
For example, if you generate the iFrame code to embed {kib} it will look like this:
For example, if you generate the iFrame code to embed {kib}, it will look like this:

<iframe src="https://localhost:5601/app/dashboards#/view/722b74f0-b882-11e8-a6d9-e546fe2bba5f?embed=true&_g=(....)" height="600" width="800"></iframe>
```

To make this iFrame leverage anonymous access automatically, you will need to modify a link to {kib} in `src` iFrame attribute to look like this:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
To make this iFrame leverage anonymous access automatically, you will need to modify a link to {kib} in `src` iFrame attribute to look like this:
To make this iFrame leverage anonymous access automatically, you will need to modify a link to {kib} in the `src` iFrame attribute to look like this:

<iframe src="https://localhost:5601/app/dashboards?auth_provider_hint=anonymous1#/view/722b74f0-b882-11e8-a6d9-e546fe2bba5f?embed=true&_g=(....)" height="600" width="800"></iframe>
```

Note that `auth_provider_hint` query string parameter goes _before_ the hash URL fragment.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Note that `auth_provider_hint` query string parameter goes _before_ the hash URL fragment.
Note that `auth_provider_hint` query string parameter goes *before* the hash URL fragment.

@azasypkin
Copy link
Member Author

Thanks for the review @gchaps and @legrego ! PR should be ready for another review pass whenever you have time.

@azasypkin azasypkin requested a review from gchaps December 7, 2020 06:59

There are three ways to specify these credentials:

If you have a user who can authenticate to {es} using username and password, for instance from a Native or LDAP security realms, you can also use these credentials to impersonate the anonymous users. Here is how your `kibana.yml` might look if you use username and password credentials:
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
If you have a user who can authenticate to {es} using username and password, for instance from a Native or LDAP security realms, you can also use these credentials to impersonate the anonymous users. Here is how your `kibana.yml` might look if you use username and password credentials:
If you have a user who can authenticate to {es} using username and password, for instance from the Native or LDAP security realms, you can also use these credentials to impersonate the anonymous users. Here is how your `kibana.yml` might look if you use username and password credentials:


It's also possible to use {kib} anonymous access in conjunction with the {es} anonymous access.

Prior to configuring {kib}, ensure that the anonymous access is enabled and properly configured in {es}. See {ref}/anonymous-access.html[Enabling anonymous access] for more information.
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
Prior to configuring {kib}, ensure that the anonymous access is enabled and properly configured in {es}. See {ref}/anonymous-access.html[Enabling anonymous access] for more information.
Prior to configuring {kib}, ensure that anonymous access is enabled and properly configured in {es}. See {ref}/anonymous-access.html[Enabling anonymous access] for more information.

[float]
===== Anonymous access and other types of authentication

You can configure more authentication providers in addition to anonymous access in {kib}. In this case, the Login Selector presents a dedicated *Continue as Guest* option for anonymous access:
Copy link
Member

Choose a reason for hiding this comment

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

This hints that they can customize the text if they'd like to 😄

Suggested change
You can configure more authentication providers in addition to anonymous access in {kib}. In this case, the Login Selector presents a dedicated *Continue as Guest* option for anonymous access:
You can configure more authentication providers in addition to anonymous access in {kib}. In this case, the Login Selector presents a configurable *Continue as Guest* option for anonymous access:


If you have multiple authentication providers enabled, and you want to automatically log in anonymous users when embedding, then you will need to add the `auth_provider_hint=<anonymous-provider-name>` query string parameter to the {kib} URL that you're embedding.

For example, if you generate the iFrame code to embed {kib}, it will look like this:
Copy link
Member

Choose a reason for hiding this comment

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

I blame Apple!

Suggested change
For example, if you generate the iFrame code to embed {kib}, it will look like this:
For example, if you generate the iframe code to embed {kib}, it will look like this:

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh no, so embarrassing! 🙈

<iframe src="https://localhost:5601/app/dashboards#/view/722b74f0-b882-11e8-a6d9-e546fe2bba5f?embed=true&_g=(....)" height="600" width="800"></iframe>
```

To make this iFrame leverage anonymous access automatically, you will need to modify a link to {kib} in the `src` iFrame attribute to look like this:
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
To make this iFrame leverage anonymous access automatically, you will need to modify a link to {kib} in the `src` iFrame attribute to look like this:
To make this iframe leverage anonymous access automatically, you will need to modify a link to {kib} in the `src` iframe attribute to look like this:

Copy link
Contributor

@gchaps gchaps left a comment

Choose a reason for hiding this comment

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

LGTM

@azasypkin azasypkin merged commit 467ba0a into elastic:master Dec 8, 2020
@azasypkin azasypkin deleted the issue-xxx-anonymous-provider-docs branch December 8, 2020 19:06
azasypkin added a commit to azasypkin/kibana that referenced this pull request Dec 8, 2020
@azasypkin
Copy link
Member Author

7.x/7.11.0: 393d1e4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported docs Feature:Security/Authentication Platform Security - Authentication release_note:skip Skip the PR/issue when compiling release notes Team:Docs Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants