Skip to content

Instantly share code, notes, and snippets.

@Yapcheekian
Created July 22, 2021 12:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yapcheekian/2bd068e9e29d8a7d79bd22e23b3a0896 to your computer and use it in GitHub Desktop.
Save Yapcheekian/2bd068e9e29d8a7d79bd22e23b3a0896 to your computer and use it in GitHub Desktop.
Integrate elastic cloud with okta

Okta

  1. Create an application in okta
  2. Choose SAML2.0
  3. Give a random app name
  4. Single sign on URL: KIBANA_ENDPOINT_URL/api/security/saml/callback
  5. Audience URI (SP Entity ID): KIBANA_ENDPOINT_URL/

elasticsearch.yml

xpack:
  security:
    authc:
      realms:
        saml: 
          cloud-saml: 
            order: 2 
            attributes.principal: "nameid:persistent" 
            attributes.groups: "groups" 
            idp.metadata.path: "<check with your identity provider>" 
            idp.entity_id: "<check with your identity provider>" 
            sp.entity_id: "KIBANA_ENDPOINT_URL/" 
            sp.acs: "KIBANA_ENDPOINT_URL/api/security/saml/callback"
            sp.logout: "KIBANA_ENDPOINT_URL/logout"

kibana.yml

xpack.security.authc.providers:
  saml.saml1:
    order: 0
    realm: cloud-saml
    description: "Log in with my SAML" 
  basic.basic1:
    order: 1

enteprise-search.yml

ent_search.auth.saml1.source: elasticsearch-saml 
ent_search.auth.saml1.order: 1 
ent_search.auth.saml1.description: "SAML login" 
ent_search.auth.saml1.icon: "https:/xxxx.jpg" 

By default, users authenticating via SAML have no roles assigned to them. For example, if you want all your users authenticating with SAML to get access to Kibana, issue the following request to Elasticsearch:

POST /_xpack/security/role_mapping/CLOUD_SAML_TO_KIBANA_ADMIN 
{
   "enabled": true,
    "roles": [ "kibana_admin" ], 
    "rules": { 
        "field": { "realm.name": "saml-realm-name" } 
    },
    "metadata": { "version": 1 }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment