Security Reference

Security permission keys and who holds them, session and token lifetimes, cookies, visibility rules, and the endpoints behind keys, keychains, tokens, and sessions.

This page states how keys, keychains, tokens, and sessions behave, exactly, as of Layer5 Cloud v1.0.278. For the model, read the Keys, Keychains, Sessions, and Tokens concepts. For tasks, use the security guides. For base URL, authentication, and the organization header, see the Cloud API. All paths below sit under /api unless noted.

Provider Admin holds every key. The table lists the default holders of the other roles. “Interface” means the control or tab is disabled or replaced by a permission error screen. “Server” means the Layer5 Cloud server refuses the request with HTTP 403.

KeyGovernsDefault holders besides Provider AdminEnforced by
View TokensThe Tokens tabUser, Team Admin, Workspace Admin, Organization AdminInterface
Create TokenCreating an API tokenOrganization AdminInterface only
Download TokenDownloading a token fileUser, Team Admin, Workspace Admin, Organization AdminInterface; the server returns only your own tokens
Delete TokenRevoking a token, and the Logout control on the Sessions tabOrganization AdminInterface only; the server deletes only your own tokens
View SessionsThe Sessions tabUser, Team Admin, Workspace Admin, Organization AdminInterface
Logout from a SessionSeeded for ending a sessionUser, Team Admin, Workspace Admin, Organization AdminNot checked. The interface uses Delete Token for Logout.
View KeysSeeded for the Keys tabUser, Team Admin, Workspace Admin, Organization AdminNot checked. Every signed-in user sees the Keys tab.
Edit KeyCreating and changing a keyNoneInterface and server
Delete KeyDeleting a keyNoneInterface and server
View KeychainsThe Keychains tabUser, Team Admin, Workspace Admin, Organization AdminInterface
Create KeychainCreating a keychainNoneInterface only. The server accepts any signed-in user.
Edit KeychainRenaming a keychain, adding or removing its keysNoneInterface. The server requires the keychain’s owner or a Provider Admin.
Delete KeychainDeleting a keychainNoneInterface. The server requires the keychain’s owner or a Provider Admin.
Assign Keychains to RolesAdding or removing a keychain on a roleOrganization AdminServer

Roles that hold the keys come from the default keychains: View keys sit in User View, Create Token and Delete Token in Security Management, Download Token in Security Management and User Edit, and the key and keychain management keys in Provider Management. See Roles and Permissions for the full role-by-keychain mapping.

ResourceWho sees itScope
KeysSystem-owned default keys, plus keys you createdDeployment-wide; not per organization
KeychainsSystem-owned default keychains, plus keychains you ownDeployment-wide; not per organization
API tokensYour own, never the token value in the listUser account
SessionsYour ownUser account

Default keys and keychains are owned by the system. Deleting a key or keychain is a soft delete, and a deleted key or keychain stops granting access immediately.

The values are the defaults of the Layer5 Cloud deployment configuration. Operators of self-hosted deployments can change them.

CredentialLifetimeNotes
Browser session (access token)24 hoursNot extended by activity. The user signs in again after it lapses.
Refresh token1000 hoursSingle-use. Each refresh issues a new refresh token. Meshery Server uses it to renew without a new sign-in.
API tokenNo expiryEnds only when deleted.
Sign-in flow12 hoursTime allowed to complete a sign-in.
Privileged-action window15 minutes in the packaged defaultAfter the window, sensitive account changes ask the user to sign in again. A deployment can set a different value.
Anonymous Kanvas session24 hoursFor use without signing in. It does not appear in the Sessions list.
CookiePurposeAttributes
provider_tokenThe browser session credentialHttpOnly, Secure over HTTPS, SameSite Lax
has_sessionTells the interface a session exists. Carries no secret and cannot authenticate a request.Readable by page scripts, SameSite Lax, expires with the session

The cookie domain is shared across the platform’s hosts for organizations that use the platform sign-in provider. It is host-only for organizations that bring their own identity provider, and for custom domains outside the platform’s domain.

Success responses are JSON unless stated. Errors from the handlers below return a plain-text message. Refusals from the authorization layer return JSON. A missing or revoked credential returns 401 with {"message": "user must be logged in to perform this operation"}.

Method and pathWho may callBehavior
GET /auth/keysSigned-in userLists keys you can see. Parameters: page, pageSize, order, search (matches the key name). Default order: most recently updated first.
GET /auth/keys/{keyId}Signed-in userReturns one key. A malformed id returns 400.
POST /auth/keysEdit KeyCreates or updates a key.
DELETE /auth/keys/{keyId}Delete KeySoft-deletes the key. Returns 204.
GET /identity/orgs/{orgId}/users/keysSigned-in userReturns your effective keys in the organization. The interface uses it to enable controls.
Method and pathWho may callBehavior
GET /auth/keychainsSigned-in userLists keychains you can see. Parameters: page, pageSize, order, search (matches the keychain name).
GET /auth/keychains/{keychainId}Signed-in userReturns one keychain.
GET /auth/keychains/{keychainId}/keysSigned-in userLists the keys in a keychain. search matches the key description.
POST /auth/keychainsSigned-in userCreates a keychain owned by the caller.
PUT /auth/keychains/{keychainId}Provider Admin or the keychain’s ownerUpdates the keychain name.
POST /auth/keychains/{keychainId}/{keyId}Provider Admin or the keychain’s ownerAdds a key.
DELETE /auth/keychains/{keychainId}/{keyId}Provider Admin or the keychain’s ownerRemoves a key.
DELETE /auth/keychains/{keychainId}Provider Admin or the keychain’s ownerSoft-deletes the keychain and its key mappings.
POST and DELETE /identity/orgs/{orgId}/roles/{roleId}/keychains/{keychainId}Assign Keychains to RolesAdds or removes a keychain on a role. Roles are global, so the change applies in every organization.

A caller who is neither a Provider Admin nor the owner receives 403 with user <email> must be Provider Admin or Keychain Owner for "<id>" Keychain to perform this operation. A malformed keychain id on these routes returns 500 with invalid keychain id.

Tokens and sessions share one store. isOauth=false selects API tokens and isOauth=true selects sessions.

Method and pathWho may callBehavior
POST /identity/tokens?name=&purpose=Signed-in userCreates a token for the caller. name is required: an empty name returns 400 with Token name missing. purpose is optional. Writes a create event.
GET /identity/tokens?isOauth=Signed-in userLists your tokens or sessions. Default order: newest first. search matches name and purpose. The response never contains token values.
GET /identity/tokens/{id}Token ownerReturns the token for download. Returns 404 for an unknown or revoked token and 400 for a malformed id. Writes a download event.
DELETE /identity/tokens?tokenId=Token ownerRevokes the token or session. A malformed id returns 400 with invalid token id. An unknown or already-deleted id returns 400 with tokens does not exist. Writes a delete event.
GET /identity/tokens/infinite?userId=&provider=Provider AdminIssues a non-expiring token for another account. The token is listed under that account. Others receive 403.
POST /refresh (outside /api)Holder of a refresh tokenExchanges a refresh token for a new session credential. Returns 400 with a JSON error if the token is missing, malformed, or already used.
GET /logout (outside /api)Signed-in browserEnds the browser’s identity session.

When Layer5 Cloud cannot read the revocation record, it refuses the request rather than accept a token it cannot check.

ActionEvent
Create a token<email> generated token <name> (category token, action create)
Download a tokenToken <name> downloaded (category token, action download). A failed download is also recorded, with an error severity.
Delete a token or log out a session<email> revoked token <name> (category token, action delete)

Key and keychain changes do not write audit events.

Related Reading