Path parameters

  • namespacestring Required

    The name of the namespace. Omit this parameter to retrieve information about all service accounts. If you omit this parameter, you must also omit the service parameter.

  • servicestring Required

    The service name. Omit this parameter to retrieve information about all service accounts that belong to the specified namespace.

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • *object Additional properties
      Hide * attribute Show * attribute object
      • role_descriptorobject Required
        Hide role_descriptor attributes Show role_descriptor attributes object
        • clusterarray[string] Required

          A list of cluster privileges. These privileges define the cluster level actions that API keys are able to execute.

        • indicesarray[object] Required

          A list of indices permissions entries.

          Hide indices attributes Show indices attributes object
          • Hide field_security attributes Show field_security attributes object
            • exceptstring | array[string]
            • grantstring | array[string]
          • namesstring | array[string]

            A list of indices (or index name patterns) to which the permissions in this entry apply.

          • privilegesarray[string] Required

            The index level privileges that owners of the role have on the specified indices.

          • querystring | object

            While creating or updating a role you can provide either a JSON structure or a string to the API. However, the response provided by Elasticsearch will only be string with a json-as-text content.

            Since this is embedded in IndicesPrivileges, the same structure is used for clarity in both contexts.

            One of:

            An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.

          • allow_restricted_indicesboolean Generally available

            Set to true if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the names list, Elasticsearch checks privileges against these indices regardless of the value set for allow_restricted_indices.

        • remote_indicesarray[object] Generally available; Added in 8.14.0

          A list of indices permissions for remote clusters.

          The subset of index level privileges that can be defined for remote clusters.

          Hide remote_indices attributes Show remote_indices attributes object
          • clustersstring | array[string] Required
          • Hide field_security attributes Show field_security attributes object
            • exceptstring | array[string]
            • grantstring | array[string]
          • namesstring | array[string]

            A list of indices (or index name patterns) to which the permissions in this entry apply.

          • privilegesarray[string] Required

            The index level privileges that owners of the role have on the specified indices.

          • querystring | object

            While creating or updating a role you can provide either a JSON structure or a string to the API. However, the response provided by Elasticsearch will only be string with a json-as-text content.

            Since this is embedded in IndicesPrivileges, the same structure is used for clarity in both contexts.

            One of:

            An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.

          • allow_restricted_indicesboolean Generally available

            Set to true if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the names list, Elasticsearch checks privileges against these indices regardless of the value set for allow_restricted_indices.

        • remote_clusterarray[object] Generally available; Added in 8.15.0

          A list of cluster permissions for remote clusters. NOTE: This is limited a subset of the cluster permissions.

          The subset of cluster level privileges that can be defined for remote clusters.

          Hide remote_cluster attributes Show remote_cluster attributes object
          • clustersstring | array[string] Required
          • privilegesarray[string] Required

            The cluster level privileges that owners of the role have on the remote cluster.

            Values are monitor_enrich or monitor_stats.

        • globalarray[object] | object

          An object defining global privileges. A global privilege is a form of cluster privilege that is request-aware. Support for global privileges is currently limited to the management of application privileges.

          One of:
          Hide attribute Show attribute object
        • applicationsarray[object]

          A list of application privilege entries

          Hide applications attributes Show applications attributes object
          • applicationstring Required

            The name of the application to which this entry applies.

          • privilegesarray[string] Required

            A list of strings, where each element is the name of an application privilege or action.

          • resourcesarray[string] Required

            A list resources to which the privileges are applied.

        • metadataobject
          Hide metadata attribute Show metadata attribute object
        • run_asarray[string]

          A list of users that the API keys can impersonate.

        • An optional description of the role descriptor.

        • Hide restriction attribute Show restriction attribute object
          • workflowsarray[string] Required

            A list of workflows to which the API key is restricted. NOTE: In order to use a role restriction, an API key must be created with a single role descriptor.

        • Hide transient_metadata attribute Show transient_metadata attribute object
GET /_security/service/{namespace}/{service}
GET /_security/service/elastic/fleet-server
resp = client.security.get_service_accounts(
    namespace="elastic",
    service="fleet-server",
)
const response = await client.security.getServiceAccounts({
  namespace: "elastic",
  service: "fleet-server",
});
response = client.security.get_service_accounts(
  namespace: "elastic",
  service: "fleet-server"
)
$resp = $client->security()->getServiceAccounts([
    "namespace" => "elastic",
    "service" => "fleet-server",
]);
curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/service/elastic/fleet-server"
Response examples (200)
A successful response from `GET /_security/service/elastic/fleet-server`. The response contains information about the `elastic/fleet-server` service account.
{
  "elastic/fleet-server": {
    "role_descriptor": {
      "cluster": [
        "monitor",
        "manage_own_api_key",
        "read_fleet_secrets"
      ],
      "indices": [
        {
          "names": [
            "logs-*",
            "metrics-*",
            "traces-*",
            ".logs-endpoint.diagnostic.collection-*",
            ".logs-endpoint.action.responses-*",
            ".logs-endpoint.heartbeat-*"
          ],
          "privileges": [
            "write",
            "create_index",
            "auto_configure"
          ],
          "allow_restricted_indices": false
        },
        {
          "names": [
            "profiling-*"
          ],
          "privileges": [
            "read",
            "write"
          ],
          "allow_restricted_indices": false
        },
        {
          "names": [
            "traces-apm.sampled-*"
          ],
          "privileges": [
            "read",
            "monitor",
            "maintenance"
          ],
          "allow_restricted_indices": false
        },
        {
          "names": [
            ".fleet-secrets*"
          ],
          "privileges": [
            "read"
          ],
          "allow_restricted_indices": true
        },
        {
          "names": [
            ".fleet-actions*"
          ],
          "privileges": [
            "read",
            "write",
            "monitor",
            "create_index",
            "auto_configure",
            "maintenance"
          ],
          "allow_restricted_indices": true
        },
        {
          "names": [
            ".fleet-agents*"
          ],
          "privileges": [
            "read",
            "write",
            "monitor",
            "create_index",
            "auto_configure",
            "maintenance"
          ],
          "allow_restricted_indices": true
        },
        {
          "names": [
            ".fleet-artifacts*"
          ],
          "privileges": [
            "read",
            "write",
            "monitor",
            "create_index",
            "auto_configure",
            "maintenance"
          ],
          "allow_restricted_indices": true
        },
        {
          "names": [
            ".fleet-enrollment-api-keys*"
          ],
          "privileges": [
            "read",
            "write",
            "monitor",
            "create_index",
            "auto_configure",
            "maintenance"
          ],
          "allow_restricted_indices": true
        },
        {
          "names": [
            ".fleet-policies*"
          ],
          "privileges": [
            "read",
            "write",
            "monitor",
            "create_index",
            "auto_configure",
            "maintenance"
          ],
          "allow_restricted_indices": true
        },
        {
          "names": [
            ".fleet-policies-leader*"
          ],
          "privileges": [
            "read",
            "write",
            "monitor",
            "create_index",
            "auto_configure",
            "maintenance"
          ],
          "allow_restricted_indices": true
        },
        {
          "names": [
            ".fleet-servers*"
          ],
          "privileges": [
            "read",
            "write",
            "monitor",
            "create_index",
            "auto_configure",
            "maintenance"
          ],
          "allow_restricted_indices": true
        },
        {
          "names": [
            ".fleet-fileds*"
          ],
          "privileges": [
            "read",
            "write",
            "monitor",
            "create_index",
            "auto_configure",
            "maintenance"
          ],
          "allow_restricted_indices": true
        },
        {
          "names": [
            "synthetics-*"
          ],
          "privileges": [
            "read",
            "write",
            "create_index",
            "auto_configure"
          ],
          "allow_restricted_indices": false
        }
      ],
      "applications": [
        {
          "application": "kibana-*",
          "privileges": [
            "reserved_fleet-setup"
          ],
          "resources": [
            "*"
          ]
        }
      ],
      "run_as": [],
      "metadata": {},
      "transient_metadata": {
        "enabled": true
      }
    }
  }
}