mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Merge pull request #964 from Infisical/update-security-docs
Add/update docs to include internals
This commit is contained in:
BIN
docs/images/internals/architecture.png
Normal file
BIN
docs/images/internals/architecture.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 383 KiB |
30
docs/internals/components.mdx
Normal file
30
docs/internals/components.mdx
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
title: "Components"
|
||||
description: "Infisical's components span multiple clients, an API, and a storage backend"
|
||||
---
|
||||
|
||||
## Infisical API
|
||||
|
||||
The Infisical API (sometimes referred to as the **backend**) contains the core platform logic.
|
||||
|
||||
## Storage backend
|
||||
|
||||
Infisical relies on a storage backend to store data including users and secrets.
|
||||
|
||||
Currently, the only supported storage backend is [MongoDB](https://www.mongodb.com) but we plan to add support for other options including PostgreSQL in Q1 2024.
|
||||
|
||||
## Redis
|
||||
|
||||
Infisical uses [Redis](https://redis.com) to enable more complex workflows including a queuing system to manage long running asynchronous tasks, cron jobs, as well as reliable cache for frequently used resources.
|
||||
|
||||
## Infisical Web UI
|
||||
|
||||
The Web UI is the browser-based portal that connects to the Infisical API.
|
||||
|
||||
## Infisical clients
|
||||
|
||||
Clients are any application or infrastructure that connecting to the Infisical API using one of the below methods:
|
||||
- Public API: Making API requests directly to the Infisical API.
|
||||
- Client SDK: A platform-specific library with method abstractions for working with secrets. Currently, there are two official SDKs: [Node SDK](https://github.com/Infisical/infisical-node) and [Python SDK](https://github.com/Infisical/infisical-python).
|
||||
- CLI: A terminal-based interface for interacting with the Infisical API.
|
||||
- Kubernetes Operator: This operator retrieves secrets from Infisical and securely store
|
||||
97
docs/internals/flows.mdx
Normal file
97
docs/internals/flows.mdx
Normal file
@@ -0,0 +1,97 @@
|
||||
---
|
||||
title: "Flows"
|
||||
description: "Infisical's core flows have strong cryptographic underpinnings"
|
||||
---
|
||||
|
||||
## Signup
|
||||
|
||||
When a user signs up for an account using email/password, they verify their email by correctly entering the 6-digit OTP code sent to it.
|
||||
|
||||
After this procedure, the user creates a password that is checked against strict requirements to ensure that it has sufficient entropy; this is critical because passwords have both authentication-related and cryptographic implications in Infisical. In accordance to the [secure remote password protocol (SRP)](https://en.wikipedia.org/wiki/Secure_Remote_Password_protocol), the password is used to generate a salt and X; this is kept handy on the client side.
|
||||
|
||||
Next, a few user-associated symmetric keys are generated for subsequent use:
|
||||
|
||||
- The password is transformed into a 256-bit symmetric key, called the generated key, using the [Argon2id](https://en.wikipedia.org/wiki/Argon2) key derivation function.
|
||||
- A 256-bit symmetric key, called the protected key, is generated.
|
||||
- A public-private key pair is generated.
|
||||
|
||||
The symmetric keys are used in sequence to encrypt the user’s private key:
|
||||
|
||||
- The protected key is used to encrypt the private key.
|
||||
- The generated key is used to encrypt the protected key.
|
||||
|
||||
Finally, the encrypted private key, the protected key, salt, and X are sent to the Infisical API to be stored in the storage backend. Note that the top-level secret used to secure the user’s account and private key is their password. Therefore, it must be unknown to the Infisical API and strong by nature.
|
||||
|
||||
## Login
|
||||
|
||||
When a user logs in, they enter their password to authenticate with Infisical via SRP. If successful, the encrypted protected key and encrypted private key are returned to the client side.
|
||||
|
||||
The password is then used in reverse sequence to decrypt the private key:
|
||||
|
||||
- The password is transformed back into the generated key.
|
||||
- The generated key is used to decrypt the encrypted protected key.
|
||||
- The protected key is used to decrypt the encrypted private key.
|
||||
|
||||
The private key is stored on the client side and kept handy.
|
||||
|
||||
## Single sign-on
|
||||
|
||||
When a SSO authentication method like Google, GitHub, or SAML SSO is used to login or signup to Infisical, the process is identical to logging in with email/password except that it is contingent on first successfully logging in via the authentication provider. This means, for example, a user with Google SSO enabled must first log in with Google and then enter their password for Infisical to complete logging into the platform.
|
||||
|
||||
This approach implies that the user’s password assumes only the role of a master decryption key or secret. It also ensures that the authentication provider does not know this top-level secret, keeping the platform zero-knowledge as intended.
|
||||
|
||||
## Account recovery
|
||||
|
||||
When a user signs up for Infisical, they are issued a backup PDF containing a symmetric key that can be used to recover their account by decrypting a copy of that user’s private key; using the backup PDF is the only way to recover a user’s account in the event of a lockout - this is intentional by design of Infisical’s zero-knowledge architecture.
|
||||
|
||||
We strongly encourage all users to download, print, and keep their backup PDFs in a secure location.
|
||||
|
||||
## Secrets
|
||||
|
||||
In Infisical, secrets belong to environments in projects, and projects belong to organizations. Each project can be thought of as a vault and has its own symmetric key, called the project key. The project key is used to encrypt the secrets contained in that project.
|
||||
|
||||
Similar to each user’s private key, the project key is sensitive and must remain unknown to the server to preserve the zero-knowledge aspect of Infisical; knowledge of the project key would allow the server to decrypt the secrets of that project which would be undesirable if the server is compromised.
|
||||
|
||||
In order to preserve the zero-knowledge aspect of Infisical, each project key is encrypted on the client side before being sent to the server. More specifically, for each project, we make copies of its project key for each member of that project; each copy is encrypted under that member’s public key and only then sent off to the server for storage. A few relevant sequences:
|
||||
|
||||
- The initial member of a project generates its project key, encrypts it under their public key, and uploads it to the server for storage.
|
||||
- When a new member is added to the project, an existing member of the project (e.g. the initial member) fetches their copy of the project key, decrypts that copy, encrypts it under the public key of the new member, and uploads it to the server for storage.
|
||||
- When a member is removed from a project, their copy of the project key is hard deleted from the storage backend.
|
||||
|
||||
When dealing with secrets, this implies a specific sequence of decryption/encryption steps to fetch and create/update them. Assuming that we’re dealing with the Infisical Web UI, let’s start with fetching secrets which happens after the user logs in and selects a project:
|
||||
|
||||
- The user fetches encrypted secrets back to the client side.
|
||||
- The user also fetches the encrypted project key, encrypted under their public key, for these secrets.
|
||||
- The encrypted project key is decrypted by the user’s private key which is kept handy on the client side.
|
||||
- The project key is finally used to decrypt the secrets belonging to the project.
|
||||
- The secrets are displayed to the user in the Infisical Web UI.
|
||||
|
||||
Similarly, when a user creates/updates a secret, the reverse sequence is performed:
|
||||
|
||||
- The user fetches the encrypted project key, encrypted under the user’s public key.
|
||||
- The project key is decrypted by the user’s private key which is kept handy on the client side.
|
||||
- The user encrypts the new/updated secret under the project key.
|
||||
- The user sends the new/updated secret to the server for storage.
|
||||
|
||||
These sequences are performed across various Infisical clients including the web UI, CLI, SDKs, and K8s operators when dealing with the Infisical API. They are also relevant in the implementations of Infisical’s versioning features like secret versions and snapshots.
|
||||
|
||||
## Native integrations
|
||||
|
||||
Previously, we mentioned that Infisical is zero-knowledge; this is partly true because Infisical can be used this way. Under certain circumstances, however, a user can explicitly share their copy of the project key with the server to enable more advanced features like native integrations.
|
||||
|
||||
The way a project key is shared with Infisical is via an abstraction that we call a bot. Each project has a bot with a public-private key pair generated on the server; the private key of each bot is symmetrically encrypted by the root encryption key of the server. This implies a few things:
|
||||
|
||||
- The server may partake in the sharing of project keys via its own public-private keys bound to each project bot.
|
||||
- The server root encryption key must be kept secure.
|
||||
|
||||
With that, let’s discuss native integrations. A native integrations is a connection between Infisical and a target platform like GitHub, GitLab, or Vercel that allows secrets to be synced from Infisical to the target platform using its API. Since native integrations require secrets to be sent over in plaintext, they require the server to have access to the secrets. The sequence for how integrations are implemented is fairly simple:
|
||||
|
||||
- A user explicitly shares copy of the project key with the server via the Infisical Web UI. In this step, the user fetches the public key of the bot assigned to that project, encrypts the project key under that public key, and sends it back to the server.
|
||||
- The user selects a target platform to integrate with their project and enters details such as the source environment within the project to send secrets from as well as the project and environment in the target platform to sync secrets to.
|
||||
- The user creates the integration, triggering the first sync wherein Infisical decrypts the project’s key, uses it to decrypt the secrets of that project, and sends the secrets to the target platform.
|
||||
- Finally, on any subsequent mutations applied to the source environment of an active integration, Infisical automatically triggers a re-sync to the target platform. This keeps Infisical as a ground source-of-truth for a team’s secrets.
|
||||
|
||||
## Resources
|
||||
|
||||
- For in depth details, consult the code.
|
||||
- To get started with Infisical, try out the [Getting Started](https://infisical.com/docs/documentation/getting-started/introduction) overview.
|
||||
10
docs/internals/overview.mdx
Normal file
10
docs/internals/overview.mdx
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: "Overview"
|
||||
description: "How Infisical works under the hood"
|
||||
---
|
||||
|
||||
This section covers the internals of Infisical including its technical underpinnings, architecture, and security properties.
|
||||
|
||||
<Note>
|
||||
Knowledge of this section is recommended but not required to use Infisical. However, if you're operating Infisical, we recommend understanding the internals.
|
||||
</Note>
|
||||
175
docs/internals/security.mdx
Normal file
175
docs/internals/security.mdx
Normal file
@@ -0,0 +1,175 @@
|
||||
---
|
||||
title: "Security"
|
||||
description: "Infisical's security model includes many considerations and initiatives"
|
||||
---
|
||||
|
||||
Given that Infisical is a secret management platform that manages sensitive data, the Infisical security model is very important.
|
||||
The goal of Infisical's security model is to ensure the security and integrity of all of its managed data as well as all associated operations.
|
||||
|
||||
This means that data at rest and in transit must be secure from eavesdropping or tampering. All clients must be authenticated and authorized to access data. Additionally, all interactions must be auditable and traced uniquely back to their source.
|
||||
|
||||
## Threat model
|
||||
|
||||
Infisical’s threat model spans communication, storage, response mechanisms, failover strategies, and more.
|
||||
|
||||
- Eavesdropping on communications: Infisical ensures end-to-end encryption for all client interactions with the Infisical API.
|
||||
- Tampering with data (at rest or in transit): Infisical implements data integrity checks to detect tampering. If inconsistencies are found, Infisical aborts transactions and raises alerts.
|
||||
- Unauthorized access (lacking authentication/authorization): Infisical mandates rigorous authentication and authorization checks for all inbound requests; it also offers multi-factor authentication and role-based access controls.
|
||||
- Actions without accountability: Infisical logs all project-level events, including policy updates, queries/mutations applied to secrets, and more. Every event is timestamped and information about actor, source (i.e. IP address, user-agent, etc.), and relevant metadata is included.
|
||||
- Breach of data storage confidentiality: Infisical encrypts all stored secrets using proven cryptographic techniques such as AES-256-GCM for symmetric encryption.
|
||||
- Loss of service availability or secret data due to failures: Infisical leverages the robust container orchestration capabilities of Kubernetes and the inherent high availability features of Bitnami MongoDB to ensure resilience and fault tolerance. By deploying multiple replicas of Infisical application on Kubernetes, operations can continue even if a single instance fails.
|
||||
- Unrecognized suspicious activities: Infisical monitors for any anomalous activities such as authentication attempts from previously unseen sources.
|
||||
- Unidentified system vulnerabilities: Infisical undergoes penetration tests and vulnerability assessments twice a year; we act on findings to bolster the system's defense mechanisms.
|
||||
|
||||
That said, Infisical does not consider the following as part of its threat model:
|
||||
|
||||
- Uncontrolled access to the storage mechanism: An attacker with unfettered access to the storage system can manipulate data in unpredictable ways, including erasing or tampering with stored secrets. Furthermore, the attacker could potentially implement state rollbacks to favor their objectives.
|
||||
- Disclosure of secret presence: If an adversary gains read access to the storage backend, they might discern the existence of certain secrets, even if the actual contents remain encrypted and concealed.
|
||||
- Runtime memory intrusion: An attacker with capabilities to probe the memory state of a live instance of Infisical can potentially compromise data confidentiality.
|
||||
- Vulnerabilities in affiliated systems: Some functionality may rely on third-party services and dependencies. Security lapses in these dependencies can indirectly jeopardize the confidentiality or integrity of the secrets.
|
||||
- Breaches via compromised clients: If a system or application accessing Infisical is compromised, and its credentials to the platform are exposed, an attacker might gain access at the privilege level of that compromised entity.
|
||||
- Configuration tampering by administrators: Any configuration data, whether supplied through admin interfaces or configuration files, needs scrutiny. If an attacker can manipulate these configurations, it poses risks to data confidentiality and integrity.
|
||||
- Physical access to deployment infrastructure: An attacker with physical access to the servers or infrastructure where Infisical is deployed can potentially compromise the system in ways that are challenging to guard against, such as direct hardware tampering or booting from malicious media.
|
||||
- Social engineering attacks on personnel: Attacks that target personnel, tricking them into divulging sensitive information or performing compromising actions, fall outside the platform's direct defensive purview.
|
||||
|
||||
It's essential to note that while these points fall outside the platform's direct threat model, they still form crucial considerations for an overarching security strategy.
|
||||
|
||||
## External threat overview
|
||||
|
||||
Infisical's architecture consists of various systems:
|
||||
|
||||
- Infisical API
|
||||
- Storage backend
|
||||
- Redis
|
||||
- Infisical Web UI
|
||||
- Infisical clients
|
||||
|
||||
The Infisical API requires that the Infisical Web UI and all Infisical clients are authenticated and authorized for every inbound request. If using [Infisical Cloud](https://app.infisical.com), all traffic is routed through [Cloudflare](https://www.cloudflare.com) which enforces TLS and requires a minimum of TLS 1.2.
|
||||
|
||||
The Infisical API is untrusted by design when dealing with secrets. All secrets are encrypted/decrypted on the client-side before reaching the Infisical API by default; granting Infisical access to secrets afterward is optional and up to your organization.
|
||||
|
||||
The storage backend used by Infisical is also untrusted by design. All sensitive data is encrypted either symmetrically with AES-256-GCM or asymmetrically with x25519-xsalsa20-poly1305 prior to entering the storage backend, depending on the context either on the client-side or server-side. Moreover, Infisical communicates with the storage backend over TLS to provide an added layer of security.
|
||||
|
||||
## Internal threat overview
|
||||
|
||||
Within Infisical, a critical security concern is an attacker gaining access to sensitive data that they are not permitted to, especially if they already has some degree of access to the system. There are currently two authentication methods categories used by clients for where we apply robust authentication and authorization logic.
|
||||
|
||||
### JWT / API Key
|
||||
|
||||
This token category is used by users and included in requests made from the Infisical Web UI or elsewhere to the Infisical API.
|
||||
|
||||
Each token is authenticated against the API and mapped to an existing user in Infisical. If no existing user is found for the token, the request is rejected by the API. Each token assumes the permission set of the user that it is mapped to. For example, if a user corresponding to a token is not allowed access to a certain organization or project, then the token is also not be valid for any requests concerning those specific resources.
|
||||
|
||||
In the event of compromise, an attacker could use the token to impersonate the associated user and perform actions within the permission set of that user. While they could retrieve secrets for a project that the user is part of, they could not, however, decrypt secrets if the project follows Infisical's default zero-knowlege architecture. In any case, it would be critical for the user to invalidate this token and change their password immediately to prevent further unintended actions and consequences.
|
||||
|
||||
### Service token
|
||||
|
||||
This token category is provisioned by users for applications and infrastructure to perform secret operations against the Infisical API.
|
||||
|
||||
Each token is scoped to a project in Infisical and configurable with an expiration date and permission set (also known as **scopes**) for specific environment(s) and path(s) within them. For example, you may provision an application a service token to authenticate against the Infisical API and retrieve secrets from some `/environment-variables` path in the production environment of a project. If the token is tried for another project, environment, or path outside of its permission set, then it is rejected by the API.
|
||||
|
||||
It should also be noted that projects in Infisical can be configured to restrict service token access to specific IP addresses or CIDR ranges; this can be useful for limiting access to traffic coming from corporate networks.
|
||||
|
||||
In the event of compromise, an attacker could use a service token to access the secrets that it is provisioned for. It would be critical here for project administrator(s) to revoke the token immediately to prevent further unintended access to resources; it would also be advisable currently to transfer secrets to a new project where a new project key is created on the client-side.
|
||||
|
||||
## Cryptography
|
||||
|
||||
Infisical uses AES-256-GCM for symmetric encryption and x25519-xsalsa20-poly1305 for asymmetric encryption operations; asymmetric algorithms are implemented with the [TweetNaCl.js](https://tweetnacl.js.org/#/) library which has been well-audited and recommended for use by cybersecurity firm Cure53. Lastly, the secure remote password (SRP) implementation uses [jsrp](https://github.com/alax/jsrp) package for user authentication.
|
||||
|
||||
By default, Infisical employs a zero-knowledge-first approach to securely storing and sharing secrets.
|
||||
|
||||
- Each secret belongs to a project and is symmetrically encrypted by that project's unique key. Each member of a project is shared a copy of the project key, encrypted under their public key, when they are first invited to join the project.
|
||||
Since these encryption operations occur on the client-side, the Infisical API is not able to view the value of any secret and the default zero-knowledge property of Infisical is retained; as you'd expect, it follows that decryption operations also occur on the client-side.
|
||||
- An exception to the zero-knowledge property occurs when a member of a project explicitly shares that project's unique key with Infisical. It is often necessary to share the project key with Infisical in order to use features like native integrations and secret rotation that wouldn't be possible to offer otherwise.
|
||||
|
||||
|
||||
## Infrastructure
|
||||
|
||||
### High availability
|
||||
|
||||
Infisical leverages the robust container orchestration capabilities of Kubernetes and the inherent high availability features of the storage backend (i.e. Bitnami MongoDB) to ensure resilience and fault tolerance.
|
||||
|
||||
- Kubernetes: By deploying multiple replicas of Infisical application on Kubernetes, operations continue even if a single instance fails. Kubernetes Services facilitate load balancing, effectively distributing traffic across your application’s instances and ensuring optimal performance.
|
||||
- Storage backend: Bitnami MongoDB supports replica sets, which provide data redundancy and automatic failover for the underlying database.
|
||||
- If using [Infisical Cloud](https://app.infisical.com), data is stored in a Mongo Atlas cluster with storage autoscaling and cluster tier autoscaling enabled; as you'd expect, the cluster sits on a dedicated node.
|
||||
|
||||
Together, Kubernetes’ self-healing mechanisms and Bitnami MongoDB’s failover capabilities work to create a highly available and fault-tolerant application capable of recovering gracefully from unexpected failures.
|
||||
|
||||
### Snapshots
|
||||
|
||||
A snapshot is a complete copy of data in the storage backend at a point in time.
|
||||
|
||||
If using [Infisical Cloud](https://app.infisical.com), snapshots of MongoDB databases are taken regularly; this can be enabled on your own storage backend as well.
|
||||
|
||||
### Offline usage
|
||||
|
||||
Many teams and organizations use the [Infisical CLI](https://infisical.com/docs/cli/overview) to fetch and inject secrets back from Infisical into their applications and infrastructure locally; the CLI has offline fallback capabiltiies.
|
||||
|
||||
If you have previously retrieved secrets for a specific project and environment, the `run/secret` command will utilize the saved secrets, even when offline, on subsequent fetch attempts to ensure that you always have access to secrets.
|
||||
|
||||
## Platform
|
||||
|
||||
### Web application
|
||||
|
||||
Infisical utilizes the latest HTTP security headers and employs a strict Content-Security-Policy to mitigate XSS.
|
||||
|
||||
JWT tokens are stored in browser memory and appended to outbound requests requiring authentication; refresh tokens are stored in `HttpOnly` cookies and included in future requests to `/api/token` for JWT token renewal.
|
||||
|
||||
### User authentication
|
||||
|
||||
Infisical supports several authentication methods including email/password, Google SSO, GitHub SSO, and SAML 2.0 (Okta, Azure, JumpCloud); Infisical also currently offers email-based 2FA with authenticator app methods coming in Q1 2024.
|
||||
|
||||
Infisical uses the [secure remote password protocol](https://en.wikipedia.org/wiki/Secure_Remote_Password_protocol#:~:text=The%20SRP%20protocol%20has%20a,the%20user%20to%20the%20server), commonly found in other zero-knowledge platform architectures, for authentication.
|
||||
Put simply, the protocol enables Infisical to validate a user's knowledge of their password without ever seeing it by constructing a mutual secret; we use this protocol because each user's password is used to seed the generation of a master encryption/decryption key via KDF for that user which the platform
|
||||
should not see.
|
||||
|
||||
Lastly, Infisical enforces strong password requirements according to the guidance set forth in [NIST Special Publication 800–63B](https://pages.nist.gov/800-63-3/sp800-63b.html#appA). Since passwords in Infisical also has cryptographic implications, Infisical validates each password on client-side to meet minimum length and entropy requirements; Infisical also considers each password against the [Have I Been Pwned (HIBP) API](https://haveibeenpwned.com), which checks the password against around 700M breached passwords, in a privacy-preserving way.
|
||||
|
||||
<Note>
|
||||
Since Infisical's unique zero-knowledge architecture requires a master decryption key for every user account, users with Google SSO, GitHub SSO, or SAML 2.0 enabled must still enter a secret after the
|
||||
authentication step to access their secrets in Infisical. In practice, this implies stronger security since users must successfully authenticate with a single sign-on provider and provide a master decryption key
|
||||
to access the platform.
|
||||
|
||||
We strongly encourage users to generate and store their passwords / master decryption key in a password manager, such as 1Password, Bitwarden, or Dashlane.
|
||||
</Note>
|
||||
|
||||
## Role-based access control (RBAC)
|
||||
|
||||
Infisical's RBAC feature enables organization owners and administrators to manage fine-grained access policies for members of their organization in Infisical; with RBAC, administrators can define custom roles with permission sets to be conveniently assigned to other members.
|
||||
|
||||
For example, you can define a role provisioning access to secrets in a specific project and environment in it with read-only permissions; the role can be assigned to members of an organization in Infisical.
|
||||
|
||||
### Audit logging
|
||||
|
||||
Infisical's audit logging feature spans 25+ events, tracking everything from permissioning changes to queries and mutations applied to secrets, for security and compliance teams at enterprises to monitor information access in the event of any suspicious activity or incident review. Every event is timestamped and information about actor, source (i.e. IP address, user-agent, etc.), and relevant metadata is included.
|
||||
|
||||
### IP allowlisting
|
||||
|
||||
Infisical's IP allowlisting feature can be configured to restrict client access to specific IP addresses or CIDR ranges. This applies to any client using service tokens and can be useful, for example, for limiting access to traffic coming from corporate networks.
|
||||
|
||||
By default, each project is initialized with the `0.0.0.0/0` entry, representing all possible IPv4 addresses. For enhanced security, we strongly recommend replacing the default entry with your client IPs to tighten access to your secrets.
|
||||
|
||||
## Penetration testing
|
||||
|
||||
Infisical hires external third parties to perform regular security assessment and penetration testing of the platform.
|
||||
|
||||
Most recently, Infisical commissioned cybersecurity firm [Oneleet](https://www.oneleet.com) to perform a full-coverage, gray box penetration test against the platform's entire attack surface to identify vulnerabilities according to industry standards (OWASP, ASVS, WSTG, TOP-10, etc.).
|
||||
|
||||
Please email security@infisical.com to request any reports including a letter of attestation for the conducted penetration test.
|
||||
|
||||
## Employee data access
|
||||
|
||||
Whether or not Infisical or your employees can access data in the Infisical instance and/or storage backend depends on many factors how you use Infisical:
|
||||
|
||||
- Infisical Self-Hosted: Self-hosting Infisical is common amongst organizations that prefer to keep data on their own infrastructure usually to adhere to strict regulatory and compliance requirements. In this option, organizations retain full control over their data and therefore govern the data access policy of their Infisical instance and storage backend.
|
||||
- Infisical Cloud: Using Infisical's managed service, [Infisical Cloud](https://app.infisical.com) means delegating data oversight and management to Infisical. Under our policy controls, employees are only granted access to parts of infrastructure according to principle of least privilege; this is especially relevent to customer data can only be accessed currently by executive management of Infisical. Moreover, any changes to sensitive customer data is prohibited without explicit customer approval.
|
||||
|
||||
It should be noted that, even on Infisical Cloud, it is physically impossible for employees of Infisical to view the values of secrets if users have not explicitly granted Infisical access to their project (i.e. opted out of zero-knowledge).
|
||||
|
||||
Please email security@infisical.com if you have any specific inquiries about employee data access policies.
|
||||
|
||||
## Get in touch
|
||||
|
||||
If you have any concerns about Infisical or believe you have uncovered a vulnerability, please get in touch via the e-mail address security@infisical.com. In the message, try to provide a description of the issue and ideally a way of reproducing it. The security team will get back to you as soon as possible.
|
||||
|
||||
Note that this security address should be used for undisclosed vulnerabilities. Please report any security problems to us before disclosing it publicly.
|
||||
49
docs/internals/service-tokens.mdx
Normal file
49
docs/internals/service-tokens.mdx
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
title: "Service tokens"
|
||||
description: "Understanding service tokens and their best practices"
|
||||
---
|
||||
|
||||
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
|
||||
properties and metadata.
|
||||
|
||||
### Database model
|
||||
|
||||
The storage backend model for a token contains the following information:
|
||||
|
||||
- ID: The token identifier.
|
||||
- Expiration: The date at which point the token is invalid.
|
||||
- Project: The project that the token is part of.
|
||||
- Scopes: The project environments and paths that the token has access to.
|
||||
- Encrypted project key: An encrypted copy of the project key.
|
||||
|
||||
### Token
|
||||
|
||||
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
|
||||
|
||||
When creating a new service token, it’s important to consider the principle of least privilege(PoLP) when setting its scope and expiration date. For example, if the client using the token only requires access to a staging environment, then you should scope the token to that environment only; you can further scope tokens to path(s) within environment(s) if you happen to use path-based secret storage. Likewise, if the client does not intend to access secrets indefinitely, then you may consider setting a finite lifetime for the token such as 6 months or 1 year from now. Finally, you should consider carefully whether or not your client requires the ability to read and/or write secrets from/to Infisical.
|
||||
|
||||
### Network access
|
||||
|
||||
We recommend configuring the IP whitelist settings of each project to allow either single IP addresses or CIDR-notated range of addresses to read/write secrets to Infisical. With this feature, you can specify the IP range of your client servers to restrict access to your project in Infisical.
|
||||
|
||||
### Storage
|
||||
|
||||
Since service tokens grant access to your secrets, we recommend storing them securely across your development cycle whether it be in a .env file in local development or as an environment variable of your deployment platform.
|
||||
|
||||
### Rotation
|
||||
|
||||
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.
|
||||
@@ -42,9 +42,9 @@
|
||||
},
|
||||
"anchors": [
|
||||
{
|
||||
"name": "Security",
|
||||
"icon": "shield-halved",
|
||||
"url": "security"
|
||||
"name": "Internals",
|
||||
"icon": "sitemap",
|
||||
"url": "internals"
|
||||
},
|
||||
{
|
||||
"name": "SDKs",
|
||||
@@ -349,6 +349,16 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Internals",
|
||||
"pages": [
|
||||
"internals/overview",
|
||||
"internals/components",
|
||||
"internals/flows",
|
||||
"internals/security",
|
||||
"internals/service-tokens"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Security",
|
||||
"pages": [
|
||||
|
||||
@@ -11,7 +11,7 @@ The 256-bit key is used to encrypt the private key; the 256-bit key itself is th
|
||||
|
||||
The encrypted private key, protected key, user identifier information, and SRP details are forwarded to the server.
|
||||
|
||||
Once authenticated via SRP, a user is issued a JWT and refresh token. The JWT token is stored in browser memory under a write-only class `SecurityClient` that appends the token to all future outbound requests requiring authentication. The refresh token is stored in an `HttpOnly` cookie and included in future requests to `/api/token` for JWT token renewal. This design side-steps potential XSS attacks on local storage.
|
||||
Once authenticated via SRP, a user is issued a JWT and refresh token. The JWT token is stored in browser memory and is appended to all future outbound requests requiring authentication. The refresh token is stored in an `HttpOnly` cookie and included in future requests to `/api/token` for JWT token renewal. This design side-steps potential XSS attacks on local storage.
|
||||
|
||||
<Info>
|
||||
Infisical authenticates users using the SRP protocol. With SRP, the server can
|
||||
|
||||
@@ -7,7 +7,9 @@ description: "Infisical's security statement."
|
||||
|
||||
Infisical uses end-to-end encryption (E2EE) whenever possible to securely store and share secret values. It uses secure remote password (SRP) to handle authentication and public-key cryptography for secret sharing and syncing; secrets are symmetrically encrypted by keys decryptable only by members of the project.
|
||||
|
||||
Infisical uses AES256-GCM for symmetric encryption and x25519-xsalsa20-poly1305 for asymmetric encryption operations mentioned in this brief; key generation and asymmetric algorithms are implemented with the [TweetNaCl.js](https://tweetnacl.js.org/#/) library which has been well-audited and recommended for use by cybersecurity firm Cure53. Lastly, the secure remote password (SRP) implementation uses [jsrp](https://github.com/alax/jsrp) package for user authentication. As part of our commitment to user privacy and security, we aim to conduct formal security and compliance audits in the following year.
|
||||
Infisical uses AES256-GCM for symmetric encryption and x25519-xsalsa20-poly1305 for asymmetric encryption operations mentioned in this brief; key generation and asymmetric algorithms are implemented with the [TweetNaCl.js](https://tweetnacl.js.org/#/) library which has been well-audited and recommended for use by cybersecurity firm Cure53. Lastly, the secure remote password (SRP) implementation uses [jsrp](https://github.com/alax/jsrp) package for user authentication.
|
||||
|
||||
As part of our commitment to user privacy and security, we undergo penetration tests twice a year and are working to achieve SOC 2 (Type II) compliance in Fall 2023.
|
||||
|
||||
## Scope
|
||||
|
||||
@@ -24,7 +26,8 @@ In subsequent sections, we refer:
|
||||
|
||||
As a secrets manager, we are deeply committed to enforcing the privacy and security of all users and data on the platform but acknowledge that it is virtually impossible to guarantee perfect security; unfortunately, even the most secure systems have vulnerabilities.
|
||||
|
||||
As part of our commitment, we do our best to maintain platform privacy and security, notify users if anything goes wrong, and rectify adverse situations immediately if anything happens. As Infisical grows, we will be adding more opt-in security measures to ensure better data protection and maintain trust within the growing community. With that, let’s make the most simple and secure secrets management system out there!
|
||||
As part of our commitment, we do our best to maintain platform privacy and security, notify users if anything goes wrong, and rectify adverse situations immediately if anything happens.
|
||||
We are continuously adding more opt-in security measures to ensure better data protection and maintain trust within the growing community. With that, let’s make the most simple and secure secrets management system out there!
|
||||
|
||||
Best,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user