Repository navigation
Security
elkctl changes nothing without --yes on the command line or a person's
confirmation in an MCP client, keeps credentials out of URLs and logs, and
refuses a response it cannot trust. None of these can be turned off.
- Every command that changes a stack prints a preview and changes nothing.
--yesapplies it. The preview and the apply both print a banner naming the profile, host, and space, so neither a person nor a script can mistake which stack is about to change. See Dry run and apply. -
state pushnever deletes a remote rule, exception list, or value list. A rule missing from the directory is not a delete instruction; delete withrules delete,exceptions delete, orvalue-lists delete. Items inside a mirrored exception list, and values inside a mirrored value list, reconcile exactly, including deletes, because they are written in full. See Rules as Code. - The MCP server changes the stack only through a mutation class the operator enables at startup, and only after a person confirms each plan in the client; see MCP server.
- Profiles live in
~/.elasticctl/config.toml. On Unix-like systems the file is written with mode0600, and a read warns when group or other can read it. Each save writes a temporary file in the same directory and renames it over the old one, so a save never truncates the file in place or writes through a symlink. -
config showprints a profile with its secrets redacted. - Credentials never go in URLs. A
user:password@prefix in the Kibana or Elasticsearch URL is removed when the URL is resolved, before a profile is saved, and before any output names the host. Credentials come only from the API key, or from a username and password on a local lab. - Overriding the Kibana URL alone clears the profile's Elasticsearch URL, so a credential is never sent to a host from another deployment. See Resolution order.
-
--debuglogs each request's method, complete URL, and status, including on a timeout or connection error. It never logs a header or a body, so the authorization header never appears. Keep credentials out of query strings. -
doctortruncates an API key id longer than twelve characters. The secret half of a key is never printed.
A success-shaped response or a readable local file is not trusted on its shape
alone. Where a value is missing, contradictory, or malformed, elkctl fails
instead of treating it as zero, unknown, or empty:
- A bulk action, import, or case status change must return complete,
consistent counts or ids. Anything else is an
httperror, never "nothing happened". - Export trailers, rule preview hits, and the
doctoridentity check decode against their required fields. - A state directory whose
rules,exceptions, orvalue-listsroot, or a file in one, is a symlink is refused, and a lost directory entry fails the read. A value-list container file without its values file, or the reverse, is refused. An incomplete mirror cannot start astate push. - An interrupted
state pullrecovers its journal one phase at a time; a corrupt record fails without touching the target directory.
The design gives the full rules: fail-closed boundaries.
The server reaches only the stack, profile, and space chosen at startup.
It can:
- Read the routes its twenty-four default tools need, including the
Elasticsearch identity check
stack_doctoruses and the index pattern resolverule_readinessuses, which returns counts only. - With
--allow-query-tools, run synchronous ES|QL queries and index searches with the selected credential. - With
--allow-mutations, send one write request per plan, after a person confirms the plan in the client: a rule bulk action, an alert status or tag update, a case create, comment, or status update, or a disabled rule create. See MCP Mutation Kinds.
It cannot:
- Send a request that changes the stack, other than the one write of a
confirmed plan. It sends no
PUTorDELETE, noPATCHother than a case status update, and no Fleet setup, rule preview, import, async query, or point in time request. It deletes nothing and never runsstate push. - Change its target. No tool accepts a profile, space, host, URL, credential, configuration path, timeout, debug option, or file path.
- Read or write local files. Startup reads only the selected configuration and normal TLS trust material; tool calls create no files.
- Follow a redirect, or log requests: its transport has redirects and debug logging off.
- Return raw upstream errors. Error messages are fixed text per error kind and never include upstream bodies, URLs, or credentials.
A Kibana space does not restrict Elasticsearch index access: the query tools read every index the credential can read. Returned content is untrusted data; see MCP.
Report a security problem privately, as described in SECURITY.md. Never post credentials or stack URLs in a public issue.