Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
docs(integrations): add External Infisical connection and sync documentation
Igor Correa2df9bd2c5332
diff --git a/docs/integrations/app-connections/external-infisical.mdx b/docs/integrations/app-connections/external-infisical.mdxnew file mode 100644index 0000000000..e295149626--- /dev/null+++ b/docs/integrations/app-connections/external-infisical.mdx@@ -0,0 +1,53 @@+---+title: "Infisical Connection"+description: "Learn how to configure an Infisical Connection to sync secrets between Infisical instances."+---++Infisical supports connecting to a remote Infisical instance using a **Machine Identity** (Universal Auth).+This enables you to sync secrets from one Infisical project to another — for example, from your cloud instance to a self-hosted deployment.++## Setup Infisical Connection in Infisical++<Steps>+ <Step title="Navigate to the remote Infisical instance">+ Open the **remote** Infisical instance (the one you want to sync secrets *to*) and navigate to **Organization** > **Access Control** > **Machine Identities**.+ + </Step>+ <Step title="Create a Machine Identity">+ Create a new Machine Identity. Give it a descriptive name (e.g., `infisical-sync-identity`).+ + </Step>+ <Step title="Configure Universal Auth">+ Select **Universal Auth** as the authentication method and create the identity.+ + </Step>+ <Step title="Copy the Client ID and create a Client Secret">+ Copy the **Client ID**. Then click **Create Client Secret** and copy the generated secret. Store both values in a secure location — the secret will not be shown again.+ + </Step>+ <Step title="Add the Machine Identity to the target project">+ Navigate to the project on the remote instance that you want to sync secrets to. Under **Project Settings** > **Access Control** > **Machine Identities**, add the Machine Identity you created and grant it at least **Member** role (write access is required to sync secrets).+ + </Step>+ <Step title="Navigate to App Connections in Infisical">+ Switch back to your **source** Infisical instance. Navigate to **Organization** > **App Connections** and click **Add Connection**.+ + </Step>+ <Step title="Select the Infisical Connection option">+ Choose the **Infisical** option from the connection list.+ + </Step>+ <Step title="Fill in the connection form">+ Complete the connection form with the following details:++ - **Instance URL**: The base URL of the remote Infisical instance (e.g., `https://infisical.example.com`).+ - **Machine Identity Client ID**: The Client ID copied in a previous step.+ - **Machine Identity Client Secret**: The Client Secret copied in a previous step.++ + </Step>+ <Step title="Connection Created">+ Your **Infisical Connection** is now available for use in Secret Syncs.+ + </Step>+</Steps>diff --git a/docs/integrations/secret-syncs/external-infisical.mdx b/docs/integrations/secret-syncs/external-infisical.mdxnew file mode 100644index 0000000000..1594d8117c--- /dev/null+++ b/docs/integrations/secret-syncs/external-infisical.mdx@@ -0,0 +1,150 @@+---+title: "Infisical Sync"+description: "Learn how to configure an Infisical Sync to replicate secrets between Infisical instances."+---++**Prerequisites:**++ - Set up and add secrets to [Infisical Cloud](https://app.infisical.com)+ - Create an [Infisical Connection](/integrations/app-connections/external-infisical)++<Tabs>+ <Tab title="Infisical UI">+ 1. Navigate to **Project** > **Integrations** and select the **Secret Syncs** tab. Click on the **Add Sync** button.+ ++ 2. Select the **Infisical** option.+ ++ 3. Configure the **Source** from where secrets should be retrieved, then click **Next**.+ ++ - **Environment**: The project environment to retrieve secrets from.+ - **Secret Path**: The folder path to retrieve secrets from.++ <Tip>+ If you need to sync secrets from multiple folder locations, check out [secret imports](/documentation/platform/secret-reference#secret-imports).+ </Tip>++ 4. Configure the **Destination** on the remote Infisical instance, then click **Next**.+ ++ - **Infisical Connection**: The Infisical Connection to authenticate with.+ - **Project**: The project on the remote Infisical instance to sync secrets to.+ - **Environment**: The environment inside the selected remote project.+ - **Secret Path**: The folder path inside the selected environment. If the remote instance does not yet expose folder-tree access for machine identities, you can type the path manually (e.g. `/` or `/my-folder`).++ <Note>+ The Machine Identity used in the connection must have at least **Member** role on the target project in the remote instance.+ </Note>++ 5. Configure the **Sync Options** to specify how secrets should be synced, then click **Next**.+ ++ - **Initial Sync Behavior**: Determines how Infisical should resolve the initial sync.+ - **Overwrite Destination Secrets**: Removes any secrets at the destination not present in Infisical.+ - **Import Secrets (Prioritize Infisical)**: Imports secrets from the destination; conflicts are resolved in favor of the source Infisical instance.+ - **Import Secrets (Prioritize Destination)**: Imports secrets from the destination; conflicts are resolved in favor of the remote instance.+ - **Key Schema**: Template that determines how secret names are transformed when syncing, using `{{secretKey}}` as a placeholder for the original secret name and `{{environment}}` for the environment.+ <Note>+ We highly recommend using a Key Schema to ensure that Infisical only manages the specific keys you intend, keeping everything else untouched.+ </Note>+ - **Auto-Sync Enabled**: If enabled, secrets will automatically be synced from the source location when changes occur. Disable to enforce manual syncing only.+ - **Disable Secret Deletion**: If enabled, Infisical will not remove secrets from the sync destination. Enable this option if you intend to manage some secrets manually outside of Infisical.++ 6. Configure the **Details** of your Infisical Sync, then click **Next**.+ ++ - **Name**: The name of your sync. Must be slug-friendly.+ - **Description**: An optional description for your sync.++ 7. Review your Infisical Sync configuration, then click **Create Sync**.+ ++ 8. If enabled, your Infisical Sync will begin syncing your secrets to the destination endpoint.+ ++ </Tab>+ <Tab title="API">+ To create an **Infisical Sync**, make an API request to the [Create Infisical Sync](/api-reference/endpoints/secret-syncs/infisical/create) API endpoint.++ ### Sample request++ ```bash Request+ curl --request POST \+ --url https://app.infisical.com/api/v1/secret-syncs/external-infisical \+ --header 'Content-Type: application/json' \+ --data '{+ "name": "my-infisical-sync",+ "projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",+ "description": "an example sync",+ "connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",+ "environment": "dev",+ "secretPath": "/my-secrets",+ "isEnabled": true,+ "syncOptions": {+ "initialSyncBehavior": "overwrite-destination"+ },+ "destinationConfig": {+ "projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",+ "environment": "prod",+ "secretPath": "/"+ }+ }'+ ```++ ### Sample response++ ```bash Response+ {+ "secretSync": {+ "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",+ "name": "my-infisical-sync",+ "description": "an example sync",+ "isEnabled": true,+ "version": 1,+ "folderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",+ "connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",+ "createdAt": "2023-11-07T05:31:56Z",+ "updatedAt": "2023-11-07T05:31:56Z",+ "syncStatus": "succeeded",+ "lastSyncJobId": "123",+ "lastSyncMessage": null,+ "lastSyncedAt": "2023-11-07T05:31:56Z",+ "importStatus": null,+ "lastImportJobId": null,+ "lastImportMessage": null,+ "lastImportedAt": null,+ "removeStatus": null,+ "lastRemoveJobId": null,+ "lastRemoveMessage": null,+ "lastRemovedAt": null,+ "syncOptions": {+ "initialSyncBehavior": "overwrite-destination"+ },+ "projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",+ "connection": {+ "app": "external-infisical",+ "name": "my-infisical-connection",+ "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"+ },+ "environment": {+ "slug": "dev",+ "name": "Development",+ "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"+ },+ "folder": {+ "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",+ "path": "/my-secrets"+ },+ "destination": "external-infisical",+ "destinationConfig": {+ "projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",+ "environment": "prod",+ "secretPath": "/"+ }+ }+ }+ ```+ </Tab>+</Tabs>