API Overview & Security
The Eviden KMS server exposes multiple API interfaces over HTTP/TLS and TCP, including standard KMIP protocols, a native REST cryptographic API, access control endpoints, and enterprise cloud provider integrations.
This page provides an architectural overview of all available API endpoints, the request processing pipeline, and the server-side API security measures enforced across all routes.
API Endpoints
The KMS server exposes endpoints grouped by function:
| Interface | Base Path | Protocol / Format | Purpose |
|---|---|---|---|
| KMIP 2.1 JSON TTLV | POST /kmip/2_1 | KMIP 2.1 over JSON TTLV | Primary standard KMIP management & cryptographic operations |
| KMIP 1.4 JSON TTLV | POST /kmip/1_4 | KMIP 1.4 over JSON TTLV | Legacy KMIP 1.4 client compatibility |
| KMIP Binary Socket | Port 5696 | KMIP TTLV over TLS TCP | Binary wire-format KMIP protocol (TLS + mTLS required) |
| REST Native Crypto | /v1/crypto/* | REST / JSON (JOSE-aligned) | Key generation, encryption, decryption, sign, verify, and MAC |
| Access Control | /access/* | REST / JSON | Object ownership queries, grant/revoke permissions, Crypto Officer ceremony |
| System & Diagnostics | /health, /version (public); /server-info (auth required) | REST / JSON | Service health checks, version information, and server capabilities |
| JWKS Public Keys | GET /.well-known/jwks.json | JSON Web Key Set | Public key distribution for active keys tagged with jwks (unauthenticated) |
| PKI & Revocation | GET /public/certificates/{issuer_id}/crl, GET /ocsp/{request} | RFC 5280 CRL / RFC 6960 OCSP | Public certificate revocation list distribution and OCSP responder |
| OpenAPI / Swagger | GET /openapi.yaml, GET /swagger | OpenAPI 3.1 & Swagger UI | Interactive documentation and API schema download (publicly served) |
| Cloud Integrations | /aws, /google_cse, /ms_dke, /azureekm | Vendor-specific REST protocols | External Key Store integrations (AWS XKS, Google CSE, MS DKE, Azure EKM) |
See KMIP Support for KMIP protocol details and Ownership and access rights for access control endpoints.
Calling the KMIP API
This API is documented in the KMIP section of this manual.
Calling the authorization API
This API is documented in the authorization section of this manual.
Authentication
The Eviden server supports various authentication mechanisms: see the authentication section of this manual for details.
When authenticating using JWT, an HTTP Authorization header must be passed with the JWT token as a bearer token:
Authorization: Bearer <JWT_TOKEN>
Security Architecture & Middleware Pipeline
All HTTP requests pass through an Actix-web middleware pipeline executing in LIFO order (the last middleware added via .wrap() runs first on incoming requests). The pipeline enforces defense-in-depth across two distinct tiers:
- Application Level: Applied globally across the entire HTTP server (all scopes and routes).
- Scope Level: Applied to specific service scopes (such as the default KMIP and REST scope, or dedicated cloud provider scopes).
Security Measures
1. Transport Security (TLS & mTLS)
All communication with the KMS server is encrypted using TLS:
- Protocol Versions: Supports TLS 1.2 and TLS 1.3.
- Cipher Profiles: Uses Mozilla Intermediate v5 cipher suites by default. The cipher list can be customized using
--tls-cipher-suitesor thetls_cipher_suiteskey inkms.toml. - Mutual TLS (mTLS): Configured with
clients_ca_cert_file. Client certificates presented during TLS negotiation are validated against the specified CA. The client certificate's Subject Common Name (CN) is extracted as the authenticated user identity. - KMIP Binary Socket Listener: The binary KMIP socket on port 5696 requires both TLS and a
clients_ca_cert_fileconfigured to start. The server refuses to listen without them.
For configuration details, see Enabling TLS and Obtaining TLS Certificates.
2. Rate Limiting (DoS & Brute-Force Mitigation)
The KMS server includes a built-in token bucket rate limiter keyed by client peer IP address, backed by the governor crate.
- Sustained Limit & Burst: Configured via
rate_limit_per_second(CLI:--rate-limit-per-second, env:KMS_RATE_LIMIT_PER_SECOND). When set, the burst capacity is automatically scaled to 3x the sustained rate. - HTTP 429 Responses: Requests exceeding the quota receive
HTTP 429 Too Many Requests, returningRetry-AfterandX-RateLimit-Afterheaders indicating the wait time in seconds. - Global Coverage: Wrapped at the application level, protecting all endpoints including unauthenticated routes and authentication proxies.
- Startup Protection Warnings: The server warns at startup if rate limiting is omitted while high-cost endpoints are active (e.g., the unauthenticated
/v1/auth/*proxy or the Crypto Officer ceremony endpoint).
The rate limiter keys strictly on the TCP connection's peer IP address, not on the X-Forwarded-For header. When deployed behind a reverse proxy or load balancer, all client requests arrive from the proxy's IP address and will share a single rate-limiting bucket. In such deployments, configure rate limiting at the reverse proxy/ingress layer, or size rate_limit_per_second accordingly.
For configuration syntax, see Server configuration file.
3. Authentication Pipeline
The HTTP server validates client identities through a cascading middleware chain. When an authenticator succeeds, it populates an AuthenticatedUser extension on the request.
Supported authentication methods include:
- TLS Client Certificates (
tls_auth): Authenticates via X.509 client certificateCNpresented over mTLS. - JWT / OIDC Bearer Tokens (
jwt_auth): Validates OpenID Connect JWT tokens (including JWT-SVID for SPIFFE workloads) from configured identity providers against remote or local JWKS keys. Sent viaAuthorization: Bearer <TOKEN>. - Cosmian Auth Verifier (
AuthVerifier): Validates Bearer tokens against JWKS keys when tokens do not include akidheader. - API Tokens (
api_token): Validates static pre-shared bearer tokens corresponding to symmetric key objects stored in the KMS database. - SPIRE App-Tokens (
spire_token): ValidatesX-Vault-Tokenheaders for HashiCorp Vault-compatible Zero-Trust integrations. - AWS SigV4 (
Sigv4MWare): Authenticates AWS KMS requests on the/awsscope using AWS Signature Version 4 HMAC signatures. - Web UI Sessions (
SessionAuth): Uses anHttpOnly,SameSite=Laxcookie (auth_session) sealed with AES-256-GCM (key derived fromui_session_salt, or random per process when it is unset). The 24-hour lifetime is enforced by the server, not only by the browserMax-Age.
Web UI Session Lifetime and Revocation
The server enforces the session lifetime itself, from values sealed inside the cookie:
- Idle timeout: a session unused for 1 hour is refused. Activity on session-authenticated routes extends it: the cookie is re-issued (same session id, same absolute expiry) when its last activity is 5 minutes old or more.
- Absolute lifetime: 24 hours from login, never extended.
- Logout revocation:
/ui/logoutrecords the session id in the KMS database, so a copy of the cookie kept elsewhere is refused by every instance sharing that database until its expiry. If the revocation cannot be read, the session is refused; if it cannot be written at logout, the cookie is still dropped from the browser and a warning is logged. - Account changes: disabling an account at the identity provider or the Auth Verifier does not end an open KMS UI session before its idle or absolute expiry.
- Load balancer: every instance must use the same
ui_session_saltand the samekms_public_url(the public URL of the load balancer), because both feed the cookie key derivation; without akms_public_url, the URL is built from each instance's own hostname and port and the instances reject each other's cookies. The/ui/login_asthrottle is per instance, so the effective quota grows with the number of instances.
Cookies issued by a previous version carry no session id and are refused: users log in again once after an upgrade.
POST /ui/login_as (Auth Verifier password login) is throttled before any credential is relayed: 10 attempts per minute per client IP and 5 per minute per username (case-insensitive; a username longer than 256 bytes is refused with 400), answered with 429 Too Many Requests and a Retry-After header. A 429 from the Auth Verifier itself is relayed to the browser the same way. The client IP is the TCP peer, or the X-Forwarded-For client when the peer is listed in trusted_proxy_cidrs (--audit-trusted-proxy-cidrs); behind a reverse proxy that is not listed there, the per-IP quota is shared by all users.
Fail-Closed Enforcement (EnsureAuth)
The EnsureAuth middleware runs after all credential extractors:
- If authentication is enabled and all extractors fail, the request is rejected with
401 Unauthorized. - If no authentication methods are configured, the request falls back to the configured
default_username(defaultadmin), unless--force-default-usernameis specified.
See Authenticating users to the server and PKCE Authentication.
4. Object Authorization & Access Rights
Once authenticated, the server evaluates access control rules per cryptographic object:
- Ownership: Every key or secret object has an assigned creator/owner established at creation (
Create,CreateKeyPair,Import). - Granular Permissions: Object owners or administrators can grant or revoke granular rights (
Read,Modify,Destroy,UseKey,Authorize, etc.) via/access/grantand/access/revoke. - Role Management (
[roles] crypto_officer_users): Restricts critical administrative privileges and key lifecycle management to designated Crypto Officer identities. - Crypto Officer Ceremony: Optional quorum-based dual control requiring multi-party authorization for high-security key operations.
See Ownership and access rights and Role Management and Key Ceremony.
5. HTTP Protocol & Boundary Hardening
- Security Headers: All HTTP responses include
X-Frame-Options: DENYandContent-Security-Policy: frame-ancestors 'none'to block clickjacking and prevent framing in unauthorized web contexts. - Payload Size Limits: Strict 64 MB deserialization ceiling prevents memory exhaustion and DoS from maliciously oversized KMIP or JSON bodies.
- CORS Scope Isolation: The default KMIP and REST scope (
/kmip,/v1/crypto,/access) defaults to same-origin. Cross-origin access requires explicit approval incors_allowed_origins. The cloud provider scopes/awsand/google_cseenable permissive CORS as required by their protocol specifications. The/ms_dkescope (Microsoft Double Key Encryption) denies cross-origin browser requests, like Azure EKM: Office DKE clients are native applications that send no browserOrigin.
6. Audit Logging & Non-Repudiation
When enabled, the audit logging middleware records every request of the default scope (/kmip, /access, certificates, …) and of the REST Native Crypto API (/v1/crypto) into a tamper-evident, cryptographically chained JSONL log. The other scopes (Google CSE, Microsoft DKE, AWS XKS, Azure EKM, /tokenize, Vault transit/PKI) are not recorded:
- Pre-Authentication Recording: In these scopes, the audit middleware wraps outside the authentication layers, capturing both successful operations and failed attempts (
401 Unauthorized,403 Forbidden). - REST Native Crypto API events: the
operationis the HTTP method and route (e.g.POST /v1/crypto/encrypt,DELETE /v1/crypto/keys/{kid}) andobject_uidis the key used, the created key, or, forencryptwithcek_kid, the exported CEK key. - Trusted Proxy CIDRs: Client IP addresses are extracted from
X-Forwarded-Foronly when the immediate peer IP matches configured CIDR ranges inaudit_trusted_proxy_cidrs. - Failure Modes: Configurable via
audit_failure_modeto eithercontinue(log failure and proceed) orreject(return HTTP 503 if an event cannot be queued for the writer; a later backend write failure is recorded by anaudit:evictionevent, not a 503).
See Audit logs and SIEM integration.
REST Native Crypto API
In addition to the KMIP protocol, the server exposes a lightweight JOSE-compatible REST API under /v1/crypto for encrypt, decrypt, sign, verify, and MAC operations. See the REST Native Crypto API page for full documentation.
OpenAPI Specification and Swagger UI
The KMS server exposes its complete API as an OpenAPI 3.1 specification and serves an interactive Swagger UI browser directly from the server binary. Both are publicly accessible at /openapi.yaml and /swagger.
See OpenAPI Specification and Swagger UI for full details on the interactive documentation, downloading the spec, and using external tools.