Expand description
An async client for Kibana security operations and Fleet management.
The layout follows the official Elasticsearch Rust client: a Transport
owns the connection, credentials and limits; Kibana groups the API into
namespaces; every endpoint is a builder that is configured and then sends.
use security_client_rs::{Kibana, http::{Credentials, Transport, TransportBuilder, Url}};
use security_client_rs::security::{QueryRule, Severity};
let transport = TransportBuilder::new(Url::parse("https://kibana.example:5601").unwrap())
.auth(Credentials::EncodedApiKey("base64-key".into()))
.build()?;
let client = Kibana::new(transport).space("soc")?;
let page = client.security().find_rules().per_page(100).send().await?.json().await?;
println!("{} rules", page.total);
let rule = QueryRule::new("Failed logins", "Repeated failures", "event.outcome: failure")
.severity(Severity::High);
let created = client.security().create_rule(&rule).send().await?.json().await?;
assert!(!created.enabled);Space-scoped routes use the client’s selected space (Kibana::space);
space administration, roles and status are always global. Requests are
never retried and redirects are never followed. Non-success statuses become
Error::Api. Routes without a named builder are available through
Kibana::request.
Module documentation covers the workflows: security for rule selectors
and imports, exceptions and cases for edits with concurrency tokens,
fleet for integration formats and asynchronous actions, and pagination
and poll for bounded traversal and waiting.
Re-exports§
pub use http::Transport;
Modules§
- cases
- Cases and their comments. Updates use optimistic concurrency through case versions.
- exceptions
- Detection exception lists and items.
Singlelists are scoped to a Kibana space;Agnosticlists are shared across spaces. Referenced value-list contents are managed separately and are not included in exception exports. - fleet
- Agent policies, integration packages, package policies, and enrolled agents.
- http
- The HTTP transport and wire types shared by every endpoint.
- pagination
- Streams over paginated collections.
- poll
- Deadlines for waiting on asynchronous Kibana work, such as Fleet actions.
- roles
- Kibana role administration. Role routes are global even on a scoped client.
- security
- Security detection rules. These are distinct from generic Kibana alerting rules.
- spaces
- Kibana space administration. Space routes are global even on a scoped client.
Structs§
- Decode
Error - A response body that did not match the expected type.
- Import
Error - Import
Failure - One object that failed during an HTTP-successful rule or exception import.
- Kibana
- The Kibana client. API groups are reached through namespace methods such as
security, each returning request builders. - Request
- A request to any Kibana route, created by
Kibana::request. - Status
GET /api/status- Transport
Error - A connection, TLS, timeout, or body-streaming failure.
Enums§
- Error
- Responses that fail keep their status and headers. Bodies may contain
operational data, so neither
DisplaynorDebugprints them, nor any response value quoted by a decoding error; readError::bodyorDecodeError::innerdeliberately. - Scope
- Whether a route is resolved inside the client’s selected space.
- Sort
Order - Result ordering for search endpoints.