mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-02 20:25:47 +00:00
Update docs
This commit is contained in:
@@ -4,14 +4,17 @@ description: "Understanding service tokens and their best practices."
|
||||
---
|
||||
|
||||
<Warning>
|
||||
Service tokens are deprecated and will be removed in the future. Please use the [machine identity](/documentation/platform/identities/machine-identities) approach instead.
|
||||
Service tokens are being deprecated in favor of [machine identities](/documentation/platform/identities/machine-identities).
|
||||
|
||||
They will be removed in the future in accordance with the deprecation notice and timeline stated [here](https://infisical.com/blog/deprecating-api-keys).
|
||||
|
||||
</Warning>
|
||||
|
||||
Many clients use service tokens to authenticate and read/write secrets from/to Infisical; they can be created in your project settings.
|
||||
|
||||
## Anatomy
|
||||
|
||||
A service token in Infisical consists of the token itself, a `string`, and a corresponding document in the storage backend containing its
|
||||
A service token in Infisical consists of the token itself, a `string`, and a corresponding document in the storage backend containing its
|
||||
properties and metadata.
|
||||
|
||||
### Database model
|
||||
@@ -26,12 +29,13 @@ The storage backend model for a token contains the following information:
|
||||
|
||||
### Token
|
||||
|
||||
A service token itself consist of two parts used for authentication and decryption, separated by the delimiter `.`.
|
||||
A service token itself consist of two parts used for authentication and decryption, separated by the delimiter `.`.
|
||||
|
||||
Consider the token `st.abc.def.ghi`. Here, `st.abc.def` can be used to authenticate with the API, by including it in the `Authorization` header under `Bearer st.abc.def`, and retrieve (encrypted) secrets as well as a project key back. Meanwhile, `ghi`, a hex-string, can be used to decrypt the project key used to decrypt the secrets.
|
||||
|
||||
Note that when using service tokens via select client methods like SDK or CLI, cryptographic operations are abstracted for you that is the token is parsed and encryption/decryption operations are handled. If using service tokens with the REST API and end-to-end encryption enabled, then you will have to handle the encryption/decryption operations yourself.
|
||||
|
||||
|
||||
## Recommendations
|
||||
|
||||
### Issuance
|
||||
@@ -50,4 +54,4 @@ Since service tokens grant access to your secrets, we recommend storing them sec
|
||||
|
||||
We recommend periodically rotating the service token, even in the absence of compromise. Since service tokens are capable of decrypting project keys used to decrypt secrets, all of which use AES-256-GCM encryption, they should be rotated before approximately 2^32 encryptions have been performed; this follows the guidance set forth by [NIST publication 800-38D](https://csrc.nist.gov/pubs/sp/800/38/d/final).
|
||||
|
||||
Note that Infisical keeps track of the number of times that service tokens are used and will alert you when you have reached 90% of the recommended capacity.
|
||||
Note that Infisical keeps track of the number of times that service tokens are used and will alert you when you have reached 90% of the recommended capacity.
|
||||
|
||||
Reference in New Issue
Block a user