Skip to content

Conversation

@albertzaharovits
Copy link
Contributor

This commit contains the reference docs (xpack/docs) for the proxied PKI. Specifically, this contains PKI realm configuration instructions for delegation in x-pack/docs/en/security/authentication/configuring-pki-realm.asciidoc and docs for the newly introduced API in x-pack/docs/en/rest-api/security/delegate-pki-authentication.asciidoc

Stack overview docs are in another repo so there will be a follow-up PR. But, I am thinking to add them after Kibana also has a sketch of their docs, so I can link to them from Stack overview.

Relates #34396

@albertzaharovits albertzaharovits added >docs General docs changes :Security/Authentication Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc) labels Aug 6, 2019
@albertzaharovits albertzaharovits self-assigned this Aug 6, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-docs

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-security

IMPORTANT: You must enable SSL/TLS and enable client authentication to use PKI.

For more information, see {stack-ov}/pki-realm.html[PKI User Authentication].
IMPORTANT: If you only allow PKI authentication for clients connecting directly
Copy link
Contributor

Choose a reason for hiding this comment

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

It is unclear to me from the placement of the "only" what is prohibited here. Is one of these right?:

If clients must be authenticated by PKI in order to connect directly to {es} ...

If PKI authentication is required only by clients connecting directly to {es}...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Neither 🤦‍♂
I've rephrased it as:

IMPORTANT: You must enable SSL/TLS and enable client authentication, if you
only allow PKI authentication for clients connecting directly to {es}, but not
through {kib}.

@albertzaharovits
Copy link
Contributor Author

@bizybot With the exception of the proposed new section for authz in the delegated use case I have made all the changes suggested. I wanted users reading this to remain with the idea that authz is the same in the delegated use case (even though it is possible to distinguish such delegated users) and I feel that a separate section goes against it. Hope this is OK with you. I don't feel strongly about it.

Copy link
Contributor

@bizybot bizybot left a comment

Choose a reason for hiding this comment

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

LGTM, Thank you.

NOTE: PKI authentication delegation requires that
the `xpack.security.authc.token.enabled` setting is `true`.

NOTE: {kib} also needs to be configured to allow PKI certificate authentication.
Copy link
Contributor

Choose a reason for hiding this comment

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

When the Kibana docs exist, we should link to them here.

Copy link
Member

Choose a reason for hiding this comment

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

"field": {
"metadata.pki_delegated_by_user": null <1>
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this example backwards (or am I confused?)
This is saying:
The user has the "role_for_pki1_direct" role if they are authenticated by the "pki1" realm, unless they have a null delegation
That unless should be an and shouldn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, you're right! This is what I've changed it to:

{
  "roles" : [ "role_for_pki1_direct" ],
  "rules" : {
    "all": [
      {
        "field": {"realm.name": "pki1"}
      },
      {
        "field": {
          "metadata.pki_delegated_by_user": null <1>
        }
      }
    ]
  },
  "enabled": true
}

NOTE: The PKI, LDAP, Kerberos and SAML realms support using
<<authorization_realms, authorization realms>> as an alternative to role mapping.

NOTE: Users with no roles assigned will be unauthorized for any action.
Copy link
Contributor

Choose a reason for hiding this comment

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

True, but... if anonymous is enabled then all users have the anonymous role, so this sentence might confuse someone.
Perhaps, we need another NOTE (though I worry about overwhelming people with so many notes, so maybe just a regular sentence) that if anonymous is enabled, all users receive that role in addition to their mapped roles.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch! I did add another note:

NOTE: When {ref}/anonymous-access.html[anonymous access] is enabled the roles
of the anonymous user are mapped to all the other users as well.

This is important IMO.

albertzaharovits and others added 13 commits August 22, 2019 10:58
@albertzaharovits
Copy link
Contributor Author

Done addressing your review Tim! Appreciate it 👍 Please take another look.

Copy link
Contributor

@tvernum tvernum left a comment

Choose a reason for hiding this comment

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

LGTM, with 1 minor bit to fix up.

@albertzaharovits
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/bwc

@albertzaharovits
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/default-distro

@albertzaharovits
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/1

@albertzaharovits albertzaharovits merged commit 57d435d into elastic:proxied-pki Aug 23, 2019
@albertzaharovits albertzaharovits deleted the security-pki-docs branch August 23, 2019 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>docs General docs changes :Security/Authentication Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants