Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat: Add documentation and refactor

Meet859c55642564
diff --git a/docs/documentation/platform/dynamic-secrets/ldap.mdx b/docs/documentation/platform/dynamic-secrets/ldap.mdx
new file mode 100644
index 0000000000..ccb629dcc2
--- /dev/null
+++ b/docs/documentation/platform/dynamic-secrets/ldap.mdx
@@ -0,0 +1,164 @@
+---
+title: "LDAP"
+description: "Learn how to dynamically generate user credentials via LDAP."
+---
+
+The Infisical LDAP dynamic secret allows you to generate user credentials on demand via LDAP. The integration is general to any LDAP implementation but has been tested with OpenLDAP and Active directory as of now.
+
+## Prerequisites
+
+1. Create a user with the necessary permissions to create users in your LDAP server.
+2. Ensure your LDAP server is reachable via Infisical instance.
+
+## Set up Dynamic Secrets with LDAP
+
+<Steps>
+ <Step title="Open Secret Overview Dashboard">
+ Open the Secret Overview dashboard and select the environment in which you would like to add a dynamic secret.
+ </Step>
+ <Step title="Click on the 'Add Dynamic Secret' button">
+ ![Add Dynamic Secret Button](../../../images/platform/dynamic-secrets/add-dynamic-secret-button.png)
+ </Step>
+ <Step title="Select 'LDAP'">
+ ![Dynamic Secret Modal](../../../images/platform/dynamic-secrets/dynamic-secret-ldap-select.png)
+ </Step>
+
+ <Step title="Provide the inputs for dynamic secret parameters">
+ <ParamField path="Secret Name" type="string" required>
+ Name by which you want the secret to be referenced
+ </ParamField>
+
+ <ParamField path="Default TTL" type="string" required>
+ Default time-to-live for a generated secret (it is possible to modify this value when a secret is generate)
+ </ParamField>
+
+ <ParamField path="Max TTL" type="string" required>
+ Maximum time-to-live for a generated secret.
+ </ParamField>
+
+ <ParamField path="URL" type="string" required>
+ LDAP url to connect to. _(Example: ldap://your-ldap-ip:389 or ldaps://domain:636)_
+ </ParamField>
+
+ <ParamField path="BIND DN" type="string" required>
+ DN to bind to. This should have permissions to create a new users.
+ </ParamField>
+
+ <ParamField path="BIND Password" type="string" required>
+ Password for the given DN.
+ </ParamField>
+
+ <ParamField path="CA" type="text">
+ CA certificate to use for TLS in case of a secure connection.
+ </ParamField>
+
+ <ParamField path="Creation LDIF" type="text" required>
+ LDIF file to run while creating a user in LDAP. This can include extra steps to assign the user to groups or set permissions.
+ Here `{{Username}}`, `{{Password}}` and `{{EncodedPassword}}` are templatized variables for the username and password generated by the dynamic secret.
+
+ **OpenLDAP** Example:
+ ```
+ dn: uid={{Username}},dc=acme,dc=com
+ changetype: add
+ objectClass: top
+ objectClass: person
+ objectClass: organizationalPerson
+ objectClass: inetOrgPerson
+ cn: John Doe
+ sn: Doe
+ uid: jdoe
+ userPassword: {{Password}}
+ ```
+
+ **Active Directory** Example:
+ ```
+ dn: CN={{Username}},OU=Test Create,DC=mcs19,DC=tech
+ changetype: add
+ objectClass: top
+ objectClass: person
+ objectClass: organizationalPerson
+ objectClass: user
+ userPrincipalName: {{Username}}@mcs19.tech
+ sAMAccountName: {{Username}}
+ unicodePwd::{{EncodedPassword}}
+ userAccountControl: 66048
+
+ dn: CN=test-group,OU=Test Create,DC=mcs19,DC=tech
+ changetype: modify
+ add: member
+ member: CN={{Username}},OU=Test Create,DC=mcs19,DC=tech
+ -
+ ```
+ </ParamField>
+
+ <ParamField path="Revocation LDIF" type="text" required>
+ LDIF file to run while revoking a user in LDAP. This can include extra steps to remove the user from groups or set permissions.
+ Here `{{Username}}` is a templatized variable for the username generated by the dynamic secret.
+
+ **OpenLDAP** Example:
+ ```
+ dn: uid={{Username}},dc=acme,dc=com
+ changetype: delete
+ ```
+
+ **Active Directory** Example:
+ ```
+ dn: CN={{Username}},OU=Test Create,DC=mcs19,DC=tech
+ changetype: delete
+ ```
+ </ParamField>
+
+ <ParamField path="Rollback LDIF" type="text">
+ LDIF file to run incase create fails midway.
+ Here `{{Username}}`, `{{Password}}` and `{{EncodedPassword}}` are templatized variables for the username generated by the dynamic secret.
+ </ParamField>
+
+</Step>
+
+ <Step title="Click `Submit`">
+ After submitting the form, you will see a dynamic secret created in the dashboard.
+ </Step>
+ <Step title="Generate dynamic secrets">
+ Once you've successfully configured the dynamic secret, you're ready to generate on-demand credentials.
+ To do this, simply click on the 'Generate' button which appears when hovering over the dynamic secret item.
+ Alternatively, you can initiate the creation of a new lease by selecting 'New Lease' from the dynamic secret lease list section.
+
+ ![Dynamic Secret](/images/platform/dynamic-secrets/dynamic-secret-generate-redis.png)
+ ![Dynamic Secret](/images/platform/dynamic-secrets/dynamic-secret-lease-empty-redis.png)
+
+ When generating these secrets, it's important to specify a Time-to-Live (TTL) duration. This will dictate how long the credentials are valid for.
+
+ ![Provision Lease](/images/platform/dynamic-secrets/provision-lease.png)
+
+ <Tip>
+ Ensure that the TTL for the lease fall within the maximum TTL defined when configuring the dynamic secret.
+ </Tip>
+
+
+ Once you click the `Submit` button, a new secret lease will be generated and the credentials from it will be shown to you. With an array of DN's depending on the LDIF file.
+
+ ![Provision Lease](/images/platform/dynamic-secrets/dynamic-secret-ldap-lease.png)
+
+ </Step>
+
+</Steps>
+
+## Active Directory Integration
+
+- Passwords in Active Directory are set using the `unicodePwd` field. This must be proceeded by two colons `::` as shown in the example.
+- Active directory uses the `userAccountControl` field to enable account.
+ - `userAccountControl` set to `512` enables a user.
+ - To disable AD's password expiration for this dynamic user account. The `userAccountControl` value for this is: `65536`.
+ - Since `userAccountControl` flag is cumulative set it to `512 + 65536` = `66048` to do both.
+- Active Directory does not permit direct modification of a user's `memberOf` attribute. The member attribute of a group and the `memberOf` attribute of a user are linked attributes, where the member attribute represents the forward link, which can be modified. In the context of AD group membership, the group's member attribute serves as the forward link. Therefore, to add a newly created dynamic user to a group, a modification request must be issued to the desired group, updating its membership to include the new user.
+
+## LDIF Entries
+
+User account management is handled through **LDIF entries**.
+
+#### Things to Remember
+
+- **No trailing spaces:** Ensure there are no trailing spaces on any line, including blank lines.
+- **Empty lines before modify blocks:** Every modify block must be preceded by an empty line.
+- **Multiple modifications:** You can define multiple modifications for a DN within a single modify block. Each modification should end with a single dash (`-`).
diff --git a/docs/images/platform/dynamic-secrets/dynamic-secret-ldap-lease.png b/docs/images/platform/dynamic-secrets/dynamic-secret-ldap-lease.png
new file mode 100644
index 0000000000..e053a8ddca
Binary files /dev/null and b/docs/images/platform/dynamic-secrets/dynamic-secret-ldap-lease.png differ
diff --git a/docs/images/platform/dynamic-secrets/dynamic-secret-ldap-select.png b/docs/images/platform/dynamic-secrets/dynamic-secret-ldap-select.png
new file mode 100644
index 0000000000..a8bc817a5c
Binary files /dev/null and b/docs/images/platform/dynamic-secrets/dynamic-secret-ldap-select.png differ
diff --git a/docs/mint.json b/docs/mint.json
index d2ca126056..5cc30d6e4b 100644
--- a/docs/mint.json
+++ b/docs/mint.json
@@ -168,7 +168,8 @@
"documentation/platform/dynamic-secrets/aws-iam",
"documentation/platform/dynamic-secrets/mongo-atlas",
"documentation/platform/dynamic-secrets/mongo-db",
- "documentation/platform/dynamic-secrets/azure-entra-id"
+ "documentation/platform/dynamic-secrets/azure-entra-id",
+ "documentation/platform/dynamic-secrets/ldap"
]
},
{
diff --git a/frontend/src/views/SecretMainPage/components/ActionBar/CreateDynamicSecretForm/CreateDynamicSecretForm.tsx b/frontend/src/views/SecretMainPage/components/ActionBar/CreateDynamicSecretForm/CreateDynamicSecretForm.tsx
index 3a92fadbf8..029ab62518 100644
--- a/frontend/src/views/SecretMainPage/components/ActionBar/CreateDynamicSecretForm/CreateDynamicSecretForm.tsx
+++ b/frontend/src/views/SecretMainPage/components/ActionBar/CreateDynamicSecretForm/CreateDynamicSecretForm.tsx
@@ -1,6 +1,6 @@
import { useState } from "react";
import { DiRedis } from "react-icons/di";
-import { SiApachecassandra, SiElasticsearch, SiMicrosoftazure, SiMongodb, SiRabbitmq } from "react-icons/si";
+import { SiApachecassandra, SiElasticsearch, SiFiles, SiMicrosoftazure, SiMongodb, SiRabbitmq } from "react-icons/si";
import { faAws } from "@fortawesome/free-brands-svg-icons";
import { faDatabase } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
@@ -86,7 +86,7 @@ const DYNAMIC_SECRET_LIST = [
title: "Azure Entra ID",
},
{
- icon: <SiMicrosoftazure size="1.5rem" />,
+ icon: <SiFiles size="1.5rem" />,
provider: DynamicSecretProviders.Ldap,
title: "LDAP",
}
diff --git a/frontend/src/views/SecretMainPage/components/DynamicSecretListView/CreateDynamicSecretLease.tsx b/frontend/src/views/SecretMainPage/components/DynamicSecretListView/CreateDynamicSecretLease.tsx
index e4d0037153..83cffdbf24 100644
--- a/frontend/src/views/SecretMainPage/components/DynamicSecretListView/CreateDynamicSecretLease.tsx
+++ b/frontend/src/views/SecretMainPage/components/DynamicSecretListView/CreateDynamicSecretLease.tsx
@@ -209,12 +209,14 @@ const renderOutputForm = (provider: DynamicSecretProviders, data: unknown) => {
value={PASSWORD}
helperText="Important: Copy these credentials now. You will not be able to see them again after you close the modal."
/>
- <SecretInput
- isReadOnly
- isVisible
- value={JSON.stringify(DN_ARRAY)}
- containerClassName="text-bunker-300 hover:border-primary-400/50 border border-mineshaft-600 bg-mineshaft-900 px-2 py-1.5"
- />
+ <FormControl label={"DNs"} className="flex-grow">
+ <SecretInput
+ isReadOnly
+ isVisible
+ value={JSON.stringify(DN_ARRAY)}
+ containerClassName="text-bunker-300 hover:border-primary-400/50 border border-mineshaft-600 bg-mineshaft-900 px-2 py-1.5"
+ />
+ </FormControl>
</div>
);
}