Search...curity(3pm)

πŸ“¦
version 8.12 Β· 4 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ Search::Elasticsearch::Client::8_0::Direct::Security ✨

🌸 NAME 🌸

Search::Elasticsearch::Client::8_0::Direct::Security β€” Plugin providing Security API for Search::Elasticsearch 8.x. πŸ’–

πŸŽ€ VERSION πŸŽ€

version 8.12

πŸ’… SYNOPSIS πŸ’…

my $response = $es->security->authenticate();

🌈 DESCRIPTION 🌈

This class extends the Search::Elasticsearch client with a "security" namespace, to support the Security APIs. The docs live at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api.html.

The full documentation for the Security feature is available here: https://www.elastic.co/guide/en/x-pack/current/xpack-security.html. Obsessed. ✨


πŸ‘‘ GENERAL METHODS πŸ‘‘

authenticate() πŸ’–

$response = $es->security->authenticate()

The authenticate() method checks that the "userinfo" is correct and returns a list of which roles are assigned to the user. Slay.

Peep the authenticate docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html for more information.

Query string parameters, bestie:

  • error_trace
  • human

clear_cached_realms() 🧚

$response = $es->security->clear_cached_realms(
    realms => $realms       # required  (comma-separated string)
);

The clear_cached_realms() method clears the caches for the specified realms. Fresh start energy.

Query string parameters:

  • error_trace
  • human
  • usernames

See the clear_cached_realms docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html for more information.


πŸ’œ USER METHODS πŸ’œ

put_user() 🫢

$response = $es->security->put_user(
    username => $username,     # required
    body     => {...}          # required
);

The put_user() method creates a new user or updates an existing user. Main character user management.

See the User Management docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-users.html for more information.

Query string parameters:

  • error_trace
  • human

get_user() 🌸

$response = $es->security->get_user(
    username => $username | \@usernames     # optional
);

The get_user() method retrieves info for the specified users (or all users). Nosy in a cute way.

See the User Management docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-users.html for more information.

Query string parameters:

  • error_trace
  • human

delete_user() πŸ’…

$response = $es->security->delete_user(
    username => $username       # required
);

The delete_user() method deletes the specified user. Gone, bye.

See the User Management docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-users.html for more information.

Query string parameters:

  • error_trace
  • human

change_password() πŸ”

$response = $es->security->change_password(
    username => $username       # optional
    body => {
        password => $password   # required
    }
)

The change_password() method changes the password for the specified user. Security glow-up.

See the User Management docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-users.html for more information.

disable_user() πŸ™ˆ

$response = $es->security->disable_user(
    username => $username       # required
);

The disable_user() method disables the specified user. Not me locking the door.

See the User Management docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-users.html for more information.

Query string parameters:

  • error_trace
  • human

enable_user() ✨

$response = $es->security->enable_user(
    username => $username       # required
);

The enable_user() method enables the specified user. Welcome back, bestie.

See the User Management docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-users.html for more information.

Query string parameters:

  • error_trace
  • human

πŸŽ€ ROLE METHODS πŸŽ€

put_role() πŸ‘‘

$response = $es->security->put_role(
    name => $name,             # required
    body     => {...}          # required
);

The put_role() method creates a new role or updates an existing role. Role assignment but make it fashion.

See the Role Management docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-roles.html for more information.

Query string parameters:

  • error_trace
  • human

get_role() 🌟

$response = $es->security->get_role(
    name => $name | \@names     # optional
);

The get_role() method retrieves info for the specified roles (or all roles). Tell me everything.

See the Role Management docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-roles.html for more information.

Query string parameters:

  • error_trace
  • human

delete_role() πŸ’€

$response = $es->security->delete_role(
    name => $name       # required
);

The delete_role() method deletes the specified role. It's giving removal.

See the Role Management docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-roles.html for more information.

Query string parameters:

  • error_trace
  • human

clear_cached_roles() 🧹

$response = $es->security->clear_cached_roles(
    names => $names       # required  (comma-separated string)
);

The clear_cached_roles() method clears the caches for the specified roles. Clean slate, periodt.

See the Role Management docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-roles.html for more information.

Query string parameters:

  • error_trace
  • human

🌈 ROLE MAPPING METHODS 🌈

put_role_mapping() πŸ—ΊοΈ

$response = $es->security->put_role_mapping(
    name => $name,             # required
    body     => {...}          # required
);

The put_role_mapping() method creates a new role mapping or updates an existing role mapping. Mapping the vibes.

See the Role Mapping docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-role-mapping.html for more information.

Query string parameters:

  • error_trace
  • human

get_role_mapping() πŸ”

$response = $es->security->get_role_mapping(
    name => $name,             # optional
);

The get_role_mapping() method retrieves one or more role mappings. Investigation mode.

See the Role Mapping docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-role-mapping.html for more information.

Query string parameters:

  • error_trace
  • human

delete_role_mapping() 🚫

$response = $es->security->delete_role_mapping(
    name => $name,             # required
);

The delete_role_mapping() method deletes a role mapping. Unmapped. Unbothered.

See the Role Mapping docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-role-mapping.html for more information.

Query string parameters:

  • error_trace
  • human

πŸ”‘ TOKEN METHODS πŸ”‘

get_token() 🎟️

$response = $es->security->get_token(
    body     => {...}          # required
);

The get_token() method enables you to create bearer tokens for access without requiring basic authentication. VIP pass energy.

See the Token Management docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-tokens.html for more information.

Query string parameters:

  • error_trace
  • human

invalidate_token() πŸ—‘οΈ

$response = $es->security->invalidate_token(
    body     => {...}          # required
);

The invalidate_token() method enables you to invalidate bearer tokens for access without requiring basic authentication. Token revoked, no cap.

See the Token Management docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-tokens.html for more information.

Query string parameters:

  • error_trace
  • human

πŸ—οΈ API KEY METHODS πŸ—οΈ

create_api_key() πŸ”

$response = $es->security->create_api_key(
    body    => {...}            # required
)

The create_api_key() API is used to create API keys which can be used for access instead of basic authentication. Key creation, iconic.

Query string parameters:

  • error_trace
  • filter_path
  • human
  • refresh

See the Create API Key docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html for more.

get_api_key() πŸ”Ž

$response = $es->security->get_api_key(
    id          => $id,         # optional
    name        => $name,       # optional
    realm_name  => $realm,      # optional
    username    => $username    # optional
)

The get_api_key() API is used to get information about an API key. Sleuthing but cute.

Query string parameters:

  • error_trace
  • filter_path
  • human
  • id
  • name
  • realm_name
  • username

See the Get API Key docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html for more.

invalidate_api_key() ❌

$response = $es->security->invalidate_api_key(
    id          => $id,         # optional
    name        => $name,       # optional
    realm_name  => $realm,      # optional
    username    => $username    # optional
)

The invalidate_api_key() API is used to invalidate an API key. Shutting it down.

Query string parameters:

  • error_trace
  • filter_path
  • human
  • id
  • name
  • realm_name
  • username

See the Invalidate API Key docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html for more.


πŸ‘‘ USER PRIVILEGE METHODS πŸ‘‘

get_user_privileges() πŸ’–

$response = $es->get_user_privileges();

The get_user_privileges() method retrieves the privileges granted to the current user. Know your power.

Query string parameters:

  • error_trace
  • filter_path
  • human

has_privileges() πŸ•΅οΈ

$response = $es->has_privileges(
    user    => $user,   # optional
    body    => {...}    # required
);

The has_privileges() method checks whether the current or specified user has the listed privileges. Permission check, bestie.

Query string parameters:

  • error_trace
  • filter_path
  • human

See the Has Privileges docs at https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html for more.

πŸŽ€ APPLICATION PRIVILEGE METHODS πŸŽ€

okay bestie, this is the part where you get to boss around application privileges β€” like who's allowed to do what inside a specific app you registered. very main character of you tbh πŸ’…


πŸ’– put_privileges() πŸ’–

$response = $es->put_privileges(
    application     => $application,    # required
    name            => $name,           # required
    body            => {...}            # required
);

Lowkey the whole point: put_privileges() creates or updates the named privilege for a particular application. new privilege? made. existing one? updated. either way it's giving "i'm in charge" ✨

Query string parameters you can pass along:

  • error_trace
  • filter_path
  • human
  • refresh

want the full lore? go read the Create or Update Application Privileges docs fr fr: https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html


πŸ’– get_privileges() πŸ’–

$response = $es->get_privileges(
    application     => $application,    # required
    name            => $name,           # required
);

What it does: get_privileges() retrieves the named privilege for a particular application. just a lil peek, no cap πŸ‘€

Query string parameters:

  • error_trace
  • filter_path
  • human

more deets in the Get Application Privileges docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html


πŸ’– delete_privileges() πŸ’–

$response = $es->delete_privileges(
    application     => $application,    # required
    name            => $name,           # required
);

What it does: delete_privileges() deletes the named privilege for a particular application. it's gone, bestie, periodt πŸ’€

Query string parameters:

  • error_trace
  • filter_path
  • human
  • refresh

the Delete Application Privileges docs have the rest: https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-privilege.html


πŸ‘‘ AUTHOR πŸ‘‘

Enrico Zimuel <enrico.zimuel@elastic.co> β€” the icon who wrote this, we love him for it 🫢


This software is Copyright (c) 2024 by Elasticsearch BV.

This is free software, licensed under:

The Apache License, Version 2.0, January 2004

okay that's the whole page, you're officially done reading a manpage and honestly? slay 🌈✨ this was Search...curity(3pm) from the User Contributed Perl Documentation, written by perl v5.38.2, dated 2024-02-04 β€” go forth and secure ur cluster, bestie, you got this πŸ’–πŸ¦‹

πŸ“¦ where this page comes from