Skip to content

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

Addressed PR comments

Carlos Monastyrski70074bea0e6f
diff --git a/backend/src/services/signer/signer-service.ts b/backend/src/services/signer/signer-service.ts
index 28f2907156..35646e50f0 100644
--- a/backend/src/services/signer/signer-service.ts
+++ b/backend/src/services/signer/signer-service.ts
@@ -1132,7 +1132,10 @@ export const signerServiceFactory = ({
if (!matchingGrant) {
throw new ForbiddenRequestError({
- message: "Signing requires approval. Get approval before signing.",
+ message:
+ `Signing with signer '${signer.name}' requires approved access, but none is currently active. ` +
+ `Access may not have been requested or approved yet, may have expired, or may have reached its signature limit. ` +
+ `Request and approve signing access for this signer, then try again.`,
name: "ApprovalRequired"
});
}
diff --git a/docs/documentation/platform/pki/code-signing/pkcs11-module.mdx b/docs/documentation/platform/pki/code-signing/pkcs11-module.mdx
index 774916716c..7c400981b8 100644
--- a/docs/documentation/platform/pki/code-signing/pkcs11-module.mdx
+++ b/docs/documentation/platform/pki/code-signing/pkcs11-module.mdx
@@ -10,8 +10,20 @@ The Infisical **PKCS#11 module** is a small native library (`.so`, `.dylib`, or
Signing on Windows with `signtool`? Use the [Windows KSP](/documentation/platform/pki/code-signing/windows-ksp) instead.
</Note>
+## Before you start
+
+You authenticate as a member of the Signer, using either a **Machine Identity** or your own Infisical **access token**. To use a Machine Identity, set it up once:
+
+1. **Create a Machine Identity** and enable **[Universal Auth](/documentation/platform/identities/universal-auth)** on it, then copy its **Client ID** and **Client Secret**. The module uses these to authenticate, and you will set them in [Configuration](#configuration) below.
+2. **Add the identity to the Signer** with the Administrator or Operator role, from the Signer's **Members** tab. Auditors cannot sign.
+3. If the Signer has an [approval policy](/documentation/platform/pki/code-signing/approvals), get [active signing access](/documentation/platform/pki/code-signing/approvals#access-lifecycle) before signing (or use [Automatic Signing Access Requests](#automatic-signing-access-requests)).
+
+<Note>
+ To sign as yourself instead, use your own access token (see [Configuration](#configuration)). You still need to be a member of the Signer with the Administrator or Operator role.
+</Note>
+
<Info>
- Before installing the module, ensure a Product Admin has created a [Signer](/documentation/platform/pki/code-signing/signers) and added the machine identity (or user) you plan to authenticate as. If the Signer has an [approval policy](/documentation/platform/pki/code-signing/approvals), you'll also need [active access](/documentation/platform/pki/code-signing/approvals#access-lifecycle).
+ The [Signer](/documentation/platform/pki/code-signing/signers) itself is created by a Product Admin. If you do not have one yet, create it first.
</Info>
## Installation
@@ -52,7 +64,7 @@ The output binary lands in the current directory.
## Configuration
-The module reads its config from `/etc/infisical/pkcs11.conf` (override the path with `INFISICAL_PKCS11_CONFIG`):
+The module reads its config from `/etc/infisical/pkcs11.conf` (override the path with `INFISICAL_CONFIG`):
```json
{
@@ -72,10 +84,23 @@ export INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET="<machine-identity-client-secret>"
Credentials can also live in the config file under `auth.client_id` and `auth.client_secret`, but environment variables are strongly recommended so secrets don't end up in version control, backups, or shared logs.
</Note>
+#### Sign with an access token instead
+
+Instead of a machine identity, you can hand the module an Infisical access token directly, either your own or a machine identity's. Set `INFISICAL_TOKEN` and the module uses it as-is:
+
+```bash
+export INFISICAL_SERVER_URL="https://app.infisical.com"
+export INFISICAL_TOKEN="<your-access-token>"
+```
+
+<Warning>
+ Access tokens expire, so this access is **temporary**. The module does not refresh the token; once it expires, signing fails until you supply a new one. This is handy for signing as yourself or for a quick one-off; for unattended or CI/CD signing use a machine identity, which the module re-authenticates automatically.
+</Warning>
+
If you put the config somewhere other than `/etc/infisical/pkcs11.conf`:
```bash
-export INFISICAL_PKCS11_CONFIG=/path/to/your/pkcs11.conf
+export INFISICAL_CONFIG=/path/to/your/pkcs11.conf
```
### Configuration reference
@@ -83,9 +108,10 @@ export INFISICAL_PKCS11_CONFIG=/path/to/your/pkcs11.conf
| Field | Required | Default | Description |
|-------|----------|---------|-------------|
| `server_url` | Yes | None | Infisical server URL. Must use `http://` (local dev) or `https://`. |
-| `auth.method` | No | `universal-auth` | Authentication method. |
-| `auth.client_id` | No | None | Machine identity client ID. Prefer the env var. |
-| `auth.client_secret` | No | None | Machine identity client secret. Prefer the env var. |
+| `auth.method` | No | `universal-auth` | Authentication method: `universal-auth` or `token`. |
+| `auth.client_id` | No | None | Machine identity client ID, for `universal-auth`. Prefer the env var. |
+| `auth.client_secret` | No | None | Machine identity client secret, for `universal-auth`. Prefer the env var. |
+| `auth.token` | No | None | An Infisical access token, for `token` auth. Prefer the env var. |
| `tls.ca_cert_path` | No | None | Custom CA bundle path for self-hosted Infisical with a private CA. |
| `tls.skip_verify` | No | `false` | Skip TLS verification (development only, never enable in production). |
| `cache.token_ttl_seconds` | No | `300` | How long the auth token is cached. |
@@ -102,8 +128,9 @@ export INFISICAL_PKCS11_CONFIG=/path/to/your/pkcs11.conf
|----------|-------------|
| `INFISICAL_UNIVERSAL_AUTH_CLIENT_ID` | Machine identity client ID. Overrides config. |
| `INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET` | Machine identity client secret. Overrides config. |
-| `INFISICAL_PKCS11_SERVER_URL` | Override `server_url`. |
-| `INFISICAL_PKCS11_CONFIG` | Path to the config file (default `/etc/infisical/pkcs11.conf`). |
+| `INFISICAL_TOKEN` | An Infisical access token (a user or machine identity token). Selects token auth; used instead of the client ID/secret. |
+| `INFISICAL_SERVER_URL` | Override `server_url`. |
+| `INFISICAL_CONFIG` | Path to the config file (default `/etc/infisical/pkcs11.conf`). |
<Note>
Environment variables always take precedence over values in the configuration file.
diff --git a/docs/documentation/platform/pki/code-signing/windows-ksp.mdx b/docs/documentation/platform/pki/code-signing/windows-ksp.mdx
index 365e3d086c..8965f18bda 100644
--- a/docs/documentation/platform/pki/code-signing/windows-ksp.mdx
+++ b/docs/documentation/platform/pki/code-signing/windows-ksp.mdx
@@ -12,18 +12,30 @@ Here is what happens when you sign a file: `signtool` hands the plug-in a short
This is the Windows version of the [PKCS#11 module](/documentation/platform/pki/code-signing/pkcs11-module). Both use the same Infisical [Signers](/documentation/platform/pki/code-signing/signers) behind the scenes. Use the PKCS#11 module for cross-platform tools like `jarsigner`, `osslsigncode`, and `cosign`. Use the Windows KSP when you sign with `signtool`.
+## Before you start
+
+You authenticate as a member of the Signer, using either a **Machine Identity** or your own Infisical **access token**. To use a Machine Identity, set it up once in Infisical:
+
+1. **Create a Machine Identity** and enable **[Universal Auth](/documentation/platform/identities/universal-auth)** on it, then copy its **Client ID** and **Client Secret**. The provider uses these to authenticate, and you will set them in [Configuration](#configuration) below.
+2. **Add the identity to the Signer** with the Administrator or Operator role, from the Signer's **Members** tab. Auditors cannot sign.
+3. If the Signer has an [approval policy](/documentation/platform/pki/code-signing/approvals), get [active signing access](/documentation/platform/pki/code-signing/approvals#access-lifecycle) before signing.
+
+<Note>
+ To sign as yourself instead, use your own access token (see [Configuration](#configuration)). You still need to be a member of the Signer with the Administrator or Operator role.
+</Note>
+
<Info>
- Before you start, a Product Admin needs to have created a [Signer](/documentation/platform/pki/code-signing/signers) and added the machine identity you plan to use. If that Signer has an [approval policy](/documentation/platform/pki/code-signing/approvals), you also need [active access](/documentation/platform/pki/code-signing/approvals#access-lifecycle) to sign.
+ The [Signer](/documentation/platform/pki/code-signing/signers) itself is created by a Product Admin. If you do not have one yet, create it first.
</Info>
## Requirements
- A 64-bit Windows computer (Windows 10/11 or Windows Server 2016 and later) where you are an **Administrator**. Setting up the plug-in changes a system-wide Windows setting, which needs admin rights.
-- The 64-bit **`signtool`**, Microsoft's signing tool, which comes with the [Windows SDK](https://developer.microsoft.com/windows/downloads/windows-sdk/). The provider is 64-bit, so the 32-bit `signtool` cannot load it.
+- **`signtool`**, Microsoft's signing tool, which comes with the [Windows SDK](https://developer.microsoft.com/windows/downloads/windows-sdk/). Most setups use the 64-bit `signtool`; there is also a 32-bit build, with a matching plug-in. The two plug-in files are `infisical-ksp.dll` (64-bit) and `infisical-ksp-x86.dll` (32-bit). Use the one that matches the `signtool` you run.
## Installation
-Download the plug-in file, `infisical-ksp.dll`, from the [releases page](https://github.com/Infisical/infisical-ksp/releases) into the folder you are working in:
+Download the plug-in file from the [releases page](https://github.com/Infisical/infisical-ksp/releases) into the folder you are working in. Most people use the 64-bit `signtool`, so get `infisical-ksp.dll`:
```powershell
Invoke-WebRequest `
@@ -31,6 +43,10 @@ Invoke-WebRequest `
-OutFile "infisical-ksp.dll"
```
+<Note>
+ Signing with the 32-bit `signtool`? Download `infisical-ksp-x86.dll` instead, and see the 32-bit note under [Register the provider](#register-the-provider).
+</Note>
+
## Register the provider
Registering means telling Windows the plug-in exists, so `signtool` can find it. This copies the file into a Windows system folder and adds a few entries to the Windows registry (the database of system settings). Open **PowerShell as Administrator**, go to the folder that holds `infisical-ksp.dll`, and run:
@@ -49,13 +65,25 @@ $cur = @((Get-ItemProperty $iface).Providers)
if ($cur -notcontains $prov) { Set-ItemProperty -Path $iface -Name Providers -Value ($cur + $prov) }
```
+<Note>
+ **Using the 32-bit `signtool`?** It loads plug-ins from `SysWOW64` instead of `System32`, so also place the 32-bit file there under the same name. The registry entries above are shared by both, so you do not repeat them: `Copy-Item .\infisical-ksp-x86.dll "$env:windir\SysWOW64\infisical-ksp.dll" -Force`.
+</Note>
+
<Warning>
**Restart the computer once after this step.** Windows keeps a saved list of its plug-ins and only notices a newly added one after a reboot.
</Warning>
## Configuration
-The plug-in reads its settings from a file at `%ProgramData%\Infisical\config.json`. To use a different location, set the `INFISICAL_KSP_CONFIG` variable. Create the file with, at minimum, your Infisical address:
+The plug-in needs your Infisical address and the login it should use. The simplest setup is environment variables only, with no config file. This is the machine identity your admin added to the Signer:
+
+```powershell
+$env:INFISICAL_SERVER_URL = "https://app.infisical.com"
+$env:INFISICAL_UNIVERSAL_AUTH_CLIENT_ID = "<machine-identity-client-id>"
+$env:INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET = "<machine-identity-client-secret>"
+```
+
+If you prefer a config file, create one at `%ProgramData%\Infisical\config.json` (or point `INFISICAL_CONFIG` at a different location) with at least your Infisical address, and keep credentials in environment variables:
```json
{
@@ -64,25 +92,32 @@ The plug-in reads its settings from a file at `%ProgramData%\Infisical\config.js
}
```
-Next, give the plug-in the login it should use, as environment variables. This is the machine identity your admin added to the Signer:
+<Note>
+ You can also put these credentials inside the config file (`auth.client_id` and `auth.client_secret`), but environment variables are safer, because the secret will not get saved into your code or log files. Whatever runs `signtool` must have these variables set: for a build pipeline that is the build job, and for hands-on use it is the same PowerShell window.
+</Note>
+
+#### Sign with an access token instead
+
+Instead of a machine identity, you can hand the plug-in an Infisical access token directly, either your own or a machine identity's. Set `INFISICAL_TOKEN` and the plug-in uses it as-is:
```powershell
-$env:INFISICAL_UNIVERSAL_AUTH_CLIENT_ID = "<machine-identity-client-id>"
-$env:INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET = "<machine-identity-client-secret>"
+$env:INFISICAL_SERVER_URL = "https://app.infisical.com"
+$env:INFISICAL_TOKEN = "<your-access-token>"
```
-<Note>
- You can also put these credentials inside the config file (`auth.client_id` and `auth.client_secret`), but environment variables are safer, because the secret will not get saved into your code or log files. Whatever runs `signtool` must have these variables set: for a build pipeline that is the build job, and for hands-on use it is the same PowerShell window.
-</Note>
+<Warning>
+ Access tokens expire, so this access is **temporary**. The plug-in does not refresh the token; once it expires, signing fails until you supply a new one. This is handy for signing as yourself or for a quick one-off, but for unattended or CI/CD signing use a machine identity, which the plug-in re-authenticates automatically.
+</Warning>
### Configuration reference
| Field | Required | Default | Description |
|-------|----------|---------|-------------|
| `server_url` | Yes | None | Your Infisical address. Must start with `http://` (local testing) or `https://`. |
-| `auth.method` | No | `universal-auth` | How to log in. Leave this as `universal-auth`. |
-| `auth.client_id` | No | None | The machine identity's client ID. Prefer the environment variable. |
-| `auth.client_secret` | No | None | The machine identity's secret. Prefer the environment variable. |
+| `auth.method` | No | `universal-auth` | How to log in: `universal-auth` (machine identity) or `token` (an access token used directly). |
+| `auth.client_id` | No | None | The machine identity's client ID, for `universal-auth`. Prefer the environment variable. |
+| `auth.client_secret` | No | None | The machine identity's secret, for `universal-auth`. Prefer the environment variable. |
+| `auth.token` | No | None | An Infisical access token, for `token` auth. Prefer the environment variable. |
| `tls.ca_cert_path` | No | None | Path to a custom CA file, for self-hosted Infisical that uses a private CA. |
| `tls.skip_verify` | No | `false` | Skip checking the server's TLS certificate. For local testing only, never in production. |
| `cache.token_ttl_seconds` | No | `300` | How long to reuse a login token before logging in again. |
@@ -97,8 +132,9 @@ $env:INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET = "<machine-identity-client-secret>"
|----------|-------------|
| `INFISICAL_UNIVERSAL_AUTH_CLIENT_ID` | The machine identity's client ID. Wins over the config file. |
| `INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET` | The machine identity's secret. Wins over the config file. |
-| `INFISICAL_KSP_SERVER_URL` | Sets `server_url`. |
-| `INFISICAL_KSP_CONFIG` | Path to the config file (default `%ProgramData%\Infisical\config.json`). |
+| `INFISICAL_TOKEN` | An Infisical access token (a user or machine identity token). Selects token auth; used instead of the client ID/secret. |
+| `INFISICAL_SERVER_URL` | Sets `server_url`. |
+| `INFISICAL_CONFIG` | Path to the config file (default `%ProgramData%\Infisical\config.json`). |
<Note>
If a value is set both as an environment variable and in the config file, the environment variable wins.
@@ -106,7 +142,7 @@ $env:INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET = "<machine-identity-client-secret>"
## Sign with signtool
-First, put the Signer's certificate on the computer. A certificate is the public half of your signing identity, so it is safe to share. Download it using the Signer's **certificate** action in Infisical, or paste it in:
+First, put the Signer's certificate on the computer. A certificate is the public half of your signing identity, so it is safe to share. In Infisical, open the Signer and use **Export certificate** to download it, or paste it in:
```powershell
$certPem = @"
@@ -176,6 +212,7 @@ $iface = "$base\Configuration\Local\Default\00010001\KEY_STORAGE"
$cur = @((Get-ItemProperty $iface -ErrorAction SilentlyContinue).Providers) | Where-Object { $_ -ne $prov }
Set-ItemProperty -Path $iface -Name Providers -Value $cur
Remove-Item "$env:windir\System32\infisical-ksp.dll" -Force -ErrorAction SilentlyContinue
+Remove-Item "$env:windir\SysWOW64\infisical-ksp.dll" -Force -ErrorAction SilentlyContinue
```
This deletes the registry entries and removes the DLL from `System32`. Your `%ProgramData%\Infisical` config and log files are left in place; delete that folder too if you no longer need them.
diff --git a/docs/documentation/platform/pki/guides/code-signing/apksigner.mdx b/docs/documentation/platform/pki/guides/code-signing/apksigner.mdx
index 2138f06a2b..ed0aa5eee8 100644
--- a/docs/documentation/platform/pki/guides/code-signing/apksigner.mdx
+++ b/docs/documentation/platform/pki/guides/code-signing/apksigner.mdx
@@ -22,7 +22,7 @@ Sign Android APK and Android App Bundle (AAB) files using `apksigner` with the I
Configure the Infisical PKCS#11 module with your machine identity credentials. Without this, the signing commands below fail with an auth error.
-Create `/etc/infisical/pkcs11.conf` (or set `INFISICAL_PKCS11_CONFIG` to point elsewhere):
+Create `/etc/infisical/pkcs11.conf` (or set `INFISICAL_CONFIG` to point elsewhere):
```yaml
auth:
@@ -124,7 +124,7 @@ Example for a Gradle-based Android project in CI:
```bash
export INFISICAL_UNIVERSAL_AUTH_CLIENT_ID="${INFISICAL_CLIENT_ID}"
export INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET="${INFISICAL_CLIENT_SECRET}"
-export INFISICAL_PKCS11_CONFIG="/path/to/pkcs11.conf"
+export INFISICAL_CONFIG="/path/to/pkcs11.conf"
# Build unsigned APK
./gradlew assembleRelease
diff --git a/docs/documentation/platform/pki/guides/code-signing/cosign.mdx b/docs/documentation/platform/pki/guides/code-signing/cosign.mdx
index 56a4284c3b..6123afb9e3 100644
--- a/docs/documentation/platform/pki/guides/code-signing/cosign.mdx
+++ b/docs/documentation/platform/pki/guides/code-signing/cosign.mdx
@@ -23,7 +23,7 @@ Sign OCI container images using `cosign` (from the Sigstore project) with the In
Configure the Infisical PKCS#11 module with your machine identity credentials. Without this, the signing commands below fail with an auth error.
-Create `/etc/infisical/pkcs11.conf` (or set `INFISICAL_PKCS11_CONFIG` to point elsewhere):
+Create `/etc/infisical/pkcs11.conf` (or set `INFISICAL_CONFIG` to point elsewhere):
```yaml
auth:
@@ -141,7 +141,7 @@ Example for a container build pipeline:
```bash
export INFISICAL_UNIVERSAL_AUTH_CLIENT_ID="${INFISICAL_CLIENT_ID}"
export INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET="${INFISICAL_CLIENT_SECRET}"
-export INFISICAL_PKCS11_CONFIG="/path/to/pkcs11.conf"
+export INFISICAL_CONFIG="/path/to/pkcs11.conf"
export COSIGN_PKCS11_MODULE_PATH="/usr/local/lib/libinfisical-pkcs11.so"
# Build and push the image
diff --git a/docs/documentation/platform/pki/guides/code-signing/gpg.mdx b/docs/documentation/platform/pki/guides/code-signing/gpg.mdx
index 1dce8f3e6e..951b667dfa 100644
--- a/docs/documentation/platform/pki/guides/code-signing/gpg.mdx
+++ b/docs/documentation/platform/pki/guides/code-signing/gpg.mdx
@@ -23,7 +23,7 @@ Use GnuPG with the Infisical PKCS#11 module via `gnupg-pkcs11-scd` to sign git c
Configure the Infisical PKCS#11 module with your machine identity credentials. Without this, the signing commands below fail with an auth error.
-Create `/etc/infisical/pkcs11.conf` (or set `INFISICAL_PKCS11_CONFIG` to point elsewhere):
+Create `/etc/infisical/pkcs11.conf` (or set `INFISICAL_CONFIG` to point elsewhere):
```yaml
auth:
@@ -203,7 +203,7 @@ For CI pipelines, configure the GPG agent in non-interactive mode. You need to c
```bash
export INFISICAL_UNIVERSAL_AUTH_CLIENT_ID="${INFISICAL_CLIENT_ID}"
export INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET="${INFISICAL_CLIENT_SECRET}"
-export INFISICAL_PKCS11_CONFIG="/path/to/pkcs11.conf"
+export INFISICAL_CONFIG="/path/to/pkcs11.conf"
# Set up ephemeral GPG home directory
export GNUPGHOME=$(mktemp -d)
diff --git a/docs/documentation/platform/pki/guides/code-signing/jarsigner.mdx b/docs/documentation/platform/pki/guides/code-signing/jarsigner.mdx
index f3e5946723..d991f671c1 100644
--- a/docs/documentation/platform/pki/guides/code-signing/jarsigner.mdx
+++ b/docs/documentation/platform/pki/guides/code-signing/jarsigner.mdx
@@ -22,7 +22,7 @@ Sign Java JAR files using `jarsigner` with the Infisical PKCS#11 module. The mod
Configure the Infisical PKCS#11 module with your machine identity credentials. Without this, the signing commands below fail with an auth error.
-Create `/etc/infisical/pkcs11.conf` (or set `INFISICAL_PKCS11_CONFIG` to point elsewhere):
+Create `/etc/infisical/pkcs11.conf` (or set `INFISICAL_CONFIG` to point elsewhere):
```yaml
auth:
@@ -114,7 +114,7 @@ For automated signing in CI/CD pipelines, use environment variables for credenti
```bash
export INFISICAL_UNIVERSAL_AUTH_CLIENT_ID="${INFISICAL_CLIENT_ID}"
export INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET="${INFISICAL_CLIENT_SECRET}"
-export INFISICAL_PKCS11_CONFIG="/path/to/pkcs11.conf"
+export INFISICAL_CONFIG="/path/to/pkcs11.conf"
jarsigner \
-keystore NONE \
diff --git a/docs/documentation/platform/pki/guides/code-signing/openssl.mdx b/docs/documentation/platform/pki/guides/code-signing/openssl.mdx
index 69818d1d58..e796a9a1b6 100644
--- a/docs/documentation/platform/pki/guides/code-signing/openssl.mdx
+++ b/docs/documentation/platform/pki/guides/code-signing/openssl.mdx
@@ -23,7 +23,7 @@ Use OpenSSL with the Infisical PKCS#11 module via the `libp11` engine for genera
Configure the Infisical PKCS#11 module with your machine identity credentials. Without this, the signing commands below fail with an auth error.
-Create `/etc/infisical/pkcs11.conf` (or set `INFISICAL_PKCS11_CONFIG` to point elsewhere):
+Create `/etc/infisical/pkcs11.conf` (or set `INFISICAL_CONFIG` to point elsewhere):
```yaml
auth:
@@ -205,7 +205,7 @@ openssl cms -sign \
```bash
export INFISICAL_UNIVERSAL_AUTH_CLIENT_ID="${INFISICAL_CLIENT_ID}"
export INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET="${INFISICAL_CLIENT_SECRET}"
-export INFISICAL_PKCS11_CONFIG="/path/to/pkcs11.conf"
+export INFISICAL_CONFIG="/path/to/pkcs11.conf"
export OPENSSL_CONF="/path/to/infisical-openssl.cnf"
# Sign release artifacts
diff --git a/docs/documentation/platform/pki/guides/code-signing/osslsigncode.mdx b/docs/documentation/platform/pki/guides/code-signing/osslsigncode.mdx
index 762ded3389..f4efdc4098 100644
--- a/docs/documentation/platform/pki/guides/code-signing/osslsigncode.mdx
+++ b/docs/documentation/platform/pki/guides/code-signing/osslsigncode.mdx
@@ -22,7 +22,7 @@ Sign Windows Authenticode artifacts using `osslsigncode` with the Infisical PKCS
Configure the Infisical PKCS#11 module with your machine identity credentials. Without this, the signing commands below fail with an auth error.
-Create `/etc/infisical/pkcs11.conf` (or set `INFISICAL_PKCS11_CONFIG` to point elsewhere):
+Create `/etc/infisical/pkcs11.conf` (or set `INFISICAL_CONFIG` to point elsewhere):
```yaml
auth:
@@ -146,7 +146,7 @@ Signature verification: ok
```bash
export INFISICAL_UNIVERSAL_AUTH_CLIENT_ID="${INFISICAL_CLIENT_ID}"
export INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET="${INFISICAL_CLIENT_SECRET}"
-export INFISICAL_PKCS11_CONFIG="/path/to/pkcs11.conf"
+export INFISICAL_CONFIG="/path/to/pkcs11.conf"
osslsigncode sign \
-pkcs11module /usr/local/lib/libinfisical-pkcs11.so \
diff --git a/frontend/src/pages/cert-manager/SignerDetailPage/components/ConnectToSignerDrawer/ConnectToSignerDrawer.tsx b/frontend/src/pages/cert-manager/SignerDetailPage/components/ConnectToSignerDrawer/ConnectToSignerDrawer.tsx
index 918abdaad0..81a09fe02e 100644
--- a/frontend/src/pages/cert-manager/SignerDetailPage/components/ConnectToSignerDrawer/ConnectToSignerDrawer.tsx
+++ b/frontend/src/pages/cert-manager/SignerDetailPage/components/ConnectToSignerDrawer/ConnectToSignerDrawer.tsx
@@ -4,6 +4,8 @@ import {
ChevronLeftIcon,
CopyIcon,
FileSignatureIcon,
+ HardDriveIcon,
+ KeyRoundIcon,
MonitorIcon,
TerminalIcon
} from "lucide-react";
@@ -32,6 +34,7 @@ import {
SignerPermissionSub,
useSignerPermission
} from "@app/context/SignerPermissionContext";
+import { getAuthToken } from "@app/hooks/api/reactQuery";
import { TSigner, useExportSignerCertificate } from "@app/hooks/api/signers";
import { PkiDocsUrls } from "../../../pki-docs-urls";
@@ -47,6 +50,7 @@ import {
pkcs11InstallSnippet,
pkcs11SignSnippet,
Pkcs11Tool,
+ SignerAuth,
Snippet
} from "./snippets";
@@ -57,6 +61,13 @@ type Props = {
};
type Method = "pkcs11" | "ksp";
+type AuthMethod = "token" | "machine-identity";
+
+const STEP_TITLES: Record<1 | 2 | 3, string> = {
+ 1: "Choose a tool",
+ 2: "Authentication",
+ 3: "Install & sign"
+};
const CommandBlock = ({ snippet }: { snippet: Snippet }) => {
const [copied, setCopied] = useState(false);
@@ -169,11 +180,46 @@ const SubStep = ({
</div>
);
+const AuthOptionCard = ({
+ icon,
+ title,
+ description,
+ isSelected,
+ onSelect
+}: {
+ icon: ReactNode;
+ title: string;
+ description: string;
+ isSelected: boolean;
+ onSelect: () => void;
+}) => (
+ <button
+ type="button"
+ aria-pressed={isSelected}
+ onClick={onSelect}
+ className={cn(
+ "flex items-start gap-3 rounded-lg border p-4 text-left transition",
+ isSelected
+ ? "border-project bg-project/10 ring-1 ring-project"
+ : "border-border bg-card hover:bg-container-hover"
+ )}
+ >
+ <div className="flex size-8 flex-none items-center justify-center rounded-md bg-container text-foreground">
+ {icon}
+ </div>
+ <div className="min-w-0">
+ <p className="font-medium text-foreground">{title}</p>
+ <p className="mt-1 text-sm text-accent">{description}</p>
+ </div>
+ </button>
+);
+
export const ConnectToSignerDrawer = ({ signer, isOpen, onOpenChange }: Props) => {
- const [step, setStep] = useState<1 | 2>(1);
+ const [step, setStep] = useState<1 | 2 | 3>(1);
const [method, setMethod] = useState<Method>("ksp");
const [os, setOs] = useState<OS>("linux");
const [tool, setTool] = useState<Pkcs11Tool>("jarsigner");
+ const [authMethod, setAuthMethod] = useState<AuthMethod>("token");
useEffect(() => {
if (isOpen) setStep(1);
@@ -192,39 +238,74 @@ export const ConnectToSignerDrawer = ({ signer, isOpen, onOpenChange }: Props) =
isOpen && method === "ksp" && canExportCert
);
+ const auth: SignerAuth =
+ authMethod === "token"
+ ? { mode: "token", token: getAuthToken() || "<your-access-token>" }
+ : { mode: "machine-identity" };
+
+ const authNote =
+ authMethod === "token" ? (
+ <p className="mt-2 text-xs text-yellow-600">
+ This uses your personal access token, which expires, so this setup is temporary. For
+ unattended or CI/CD signing, use a machine identity instead.
+ </p>
+ ) : (
+ <p className="mt-2 text-xs text-accent">
+ Replace <span className="font-mono">&lt;client-id&gt;</span> and{" "}
+ <span className="font-mono">&lt;client-secret&gt;</span> with your Machine Identity&apos;s
+ Universal Auth credentials.
+ </p>
+ );
+
const rightDocHref =
method === "ksp" ? PkiDocsUrls.codeSigning.windowsKsp : PkiDocsUrls.codeSigning.pkcs11Module;
- const rightPanel =
- step === 1 ? (
- <>
- <p className="mt-4 text-sm font-semibold text-foreground">What this step does</p>
- <p className="mt-2 text-sm leading-relaxed text-muted">
- Pick the tool you already sign with.{" "}
- <span className="font-medium">Standard signing tools</span> like jarsigner, osslsigncode,
- and cosign work on Linux, macOS, and Windows.{" "}
- <span className="font-medium">Windows signtool</span> is native Authenticode signing on
- Windows. Either way, the private key stays in Infisical.
- </p>
- </>
- ) : (
+ const renderRightPanel = () => {
+ if (step === 1) {
+ return (
+ <>
+ <p className="mt-4 text-sm font-semibold text-foreground">What this step does</p>
+ <p className="mt-2 text-sm leading-relaxed text-muted">
+ Pick the tool you already sign with.{" "}
+ <span className="font-medium">Standard signing tools</span> like jarsigner,
+ osslsigncode, and cosign work on Linux, macOS, and Windows.{" "}
+ <span className="font-medium">Windows signtool</span> is native Authenticode signing on
+ Windows. Either way, the private key stays in Infisical.
+ </p>
+ </>
+ );
+ }
+ if (step === 2) {
+ return (
+ <>
+ <p className="mt-4 text-sm font-semibold text-foreground">What this step does</p>
+ <p className="mt-2 text-sm leading-relaxed text-muted">
+ Choose how the signing machine logs in to Infisical.{" "}
+ <span className="font-medium">Your own access token</span> is quickest, but it is
+ temporary because tokens expire. A <span className="font-medium">machine identity</span>{" "}
+ is best for unattended or CI/CD signing.
+ </p>
+ </>
+ );
+ }
+ return (
<>
<p className="mt-4 text-sm font-semibold text-foreground">What this step does</p>
{method === "ksp" ? (
<p className="mt-2 text-sm leading-relaxed text-muted">
- Download and register the Key Storage Provider once per machine, set your Machine
- Identity credentials, then sign with <span className="font-mono text-xs">signtool</span>
- . The Signer is selected by name with <span className="font-mono text-xs">/kc</span>.
+ Download and register the Key Storage Provider once per machine, set your credentials,
+ then sign with <span className="font-mono text-xs">signtool</span>. The Signer is
+ selected by name with <span className="font-mono text-xs">/kc</span>.
</p>
) : (
<p className="mt-2 text-sm leading-relaxed text-muted">
- Download the module, point a config file at it, and set your Machine Identity
- credentials. Then run your tool against this Signer by name:{" "}
- <span className="font-mono text-xs">{name}</span>.
+ Download the module, point a config file at it, and set your credentials. Then run your
+ tool against this Signer by name: <span className="font-mono text-xs">{name}</span>.
</p>
)}
</>
);
+ };
return (
<Sheet open={isOpen} onOpenChange={onOpenChange}>
@@ -235,11 +316,12 @@ export const ConnectToSignerDrawer = ({ signer, isOpen, onOpenChange }: Props) =
</div>
<div className="flex-1">
<SheetTitle className="flex items-center gap-2 text-lg">
- How to sign with {name}
+ Set up signing for {name}
<DocumentationLinkBadge href={PkiDocsUrls.codeSigning.connect} />
</SheetTitle>
<SheetDescription>
- Set up your machine to sign with this Signer using the tool you already use.
+ Sign with this Signer using the tool you already use. Your signing key never leaves
+ Infisical.
</SheetDescription>
</div>
</SheetHeader>
@@ -253,18 +335,19 @@ export const ConnectToSignerDrawer = ({ signer, isOpen, onOpenChange }: Props) =
activeStep={step - 1}
orientation="vertical"
onStepChange={(i) => {
- if (i < step - 1) setStep((i + 1) as 1 | 2);
+ if (i < step - 1) setStep((i + 1) as 1 | 2 | 3);
}}
>
<StepperList>
<StepperStep index={0} title="Choose a tool" description="What you sign with" />
- <StepperStep index={1} title="Install & sign" description="Set up your machine" />
+ <StepperStep index={1} title="Authentication" description="How you log in" />
+ <StepperStep index={2} title="Install & sign" description="Set up your machine" />
</StepperList>
</Stepper>
</aside>
<div className="flex min-w-0 flex-1 flex-col overflow-y-auto px-8 py-6">
- {step === 1 ? (
+ {step === 1 && (
<>
<h2 className="text-lg font-semibold text-foreground">Choose your signing tool</h2>
<p className="mt-1 mb-6 text-sm text-muted">
@@ -290,13 +373,40 @@ export const ConnectToSignerDrawer = ({ signer, isOpen, onOpenChange }: Props) =
/>
</div>
</>
- ) : (
+ )}
+ {step === 2 && (
+ <>
+ <h2 className="text-lg font-semibold text-foreground">
+ Choose how to authenticate
+ </h2>
+ <p className="mt-1 mb-6 text-sm text-muted">
+ Pick how the machine running the signing tool proves who it is to Infisical.
+ </p>
+ <div className="grid grid-cols-1 gap-4 md:grid-cols-2">
+ <AuthOptionCard
+ icon={<KeyRoundIcon className="size-4" />}
+ title="Use my credentials"
+ description="Sign as yourself with your own Infisical access token. Quickest to set up, but temporary because the token expires."
+ isSelected={authMethod === "token"}
+ onSelect={() => setAuthMethod("token")}
+ />
+ <AuthOptionCard
+ icon={<HardDriveIcon className="size-4" />}
+ title="Use a machine identity"
+ description="Authenticate with a Machine Identity's Universal Auth credentials. Best for CI/CD and unattended signing."
+ isSelected={authMethod === "machine-identity"}
+ onSelect={() => setAuthMethod("machine-identity")}
+ />
+ </div>
+ </>
+ )}
+ {step === 3 && (
<>
<h2 className="text-lg font-semibold text-foreground">Install &amp; sign</h2>
<p className="mt-1 mb-6 text-sm text-muted">
{method === "ksp"
- ? `Set up Microsoft signtool via the Infisical Key Storage Provider to sign with ${name}.`
- : `Set up jarsigner, osslsigncode, or any PKCS#11-compatible tool to sign with ${name}.`}
+ ? "Install the Infisical Key Storage Provider, then sign with Microsoft signtool."
+ : "Install the Infisical PKCS#11 module, then sign with jarsigner, osslsigncode, or any PKCS#11 tool."}
</p>
{method === "ksp" ? (
@@ -304,28 +414,33 @@ export const ConnectToSignerDrawer = ({ signer, isOpen, onOpenChange }: Props) =
<SubStep
index={1}
title="Download the provider"
- description="Download the Key Storage Provider DLL (Windows x86_64)."
+ description="Download the Key Storage Provider DLL for 64-bit Windows."
>
<CommandBlock snippet={kspDownloadSnippet()} />
</SubStep>
<SubStep
index={2}
title="Register with Windows"
- description="Registers the provider (a few registry entries) and copies the DLL into System32. Run as Administrator, once per machine, then reboot so Windows loads it. Signing also needs signtool, included with the Windows SDK."
+ description="Copies the DLL into System32 and adds the registry entries. Run as Administrator once per machine, then reboot so Windows loads it. Signing also needs signtool, from the Windows SDK."
>
<CommandBlock snippet={kspRegisterSnippet()} />
</SubStep>
<SubStep
index={3}
title="Configure"
- description="Create the config file and set your Machine Identity credentials."
+ description={
+ authMethod === "token"
+ ? "Point the provider at Infisical with your access token."
+ : "Create the config file and set the Machine Identity credentials."
+ }
>
- <CommandBlock snippet={kspConfigureSnippet(serverUrl)} />
+ <CommandBlock snippet={kspConfigureSnippet(serverUrl, auth)} />
+ {authNote}
</SubStep>
<SubStep
index={4}
title="Add the Signer's certificate"
- description="This Signer's certificate is filled in below. Run it to write the file; signtool reads it with /f."
+ description="The certificate is filled in below. Run this to save it; signtool reads it with /f."
>
{canExportCert ? (
<CommandBlock snippet={kspCertSnippet(name, signerCert?.certificatePem)} />
@@ -363,9 +478,14 @@ export const ConnectToSignerDrawer = ({ signer, isOpen, onOpenChange }: Props) =
<SubStep
index={2}
title="Configure"
- description="Create a config file and set your Machine Identity credentials as environment variables."
+ description={
+ authMethod === "token"
+ ? "Create a config file and set your access token as an environment variable."
+ : "Create a config file and set the Machine Identity credentials as environment variables."
+ }
>
- <CommandBlock snippet={pkcs11ConfigureSnippet(os, serverUrl)} />
+ <CommandBlock snippet={pkcs11ConfigureSnippet(os, serverUrl, auth)} />
+ {authNote}
</SubStep>
<SubStep
index={3}
@@ -399,28 +519,28 @@ export const ConnectToSignerDrawer = ({ signer, isOpen, onOpenChange }: Props) =
<div className="mb-auto">
<div className="flex items-center justify-between gap-2">
<p className="text-[11px] font-medium tracking-wider text-muted uppercase">
- Step {step} · {step === 1 ? "Choose a tool" : "Install & sign"}
+ Step {step} · {STEP_TITLES[step]}
</p>
<DocumentationLinkBadge
- href={step === 1 ? PkiDocsUrls.codeSigning.connect : rightDocHref}
+ href={step === 3 ? rightDocHref : PkiDocsUrls.codeSigning.connect}
/>
</div>
- {rightPanel}
+ {renderRightPanel()}
</div>
</aside>
</div>
<SheetFooter className="flex-row items-center justify-between border-t">
- <span className="text-sm text-muted">Step {step} of 2</span>
+ <span className="text-sm text-muted">Step {step} of 3</span>
<div className="flex gap-2">
- {step === 2 && (
- <Button variant="outline" onClick={() => setStep(1)}>
+ {step > 1 && (
+ <Button variant="outline" onClick={() => setStep((step - 1) as 1 | 2 | 3)}>
<ChevronLeftIcon />
Back
</Button>
)}
- {step === 1 ? (
- <Button variant="project" onClick={() => setStep(2)}>
+ {step < 3 ? (
+ <Button variant="project" onClick={() => setStep((step + 1) as 1 | 2 | 3)}>
Continue
</Button>
) : (
diff --git a/frontend/src/pages/cert-manager/SignerDetailPage/components/ConnectToSignerDrawer/snippets.ts b/frontend/src/pages/cert-manager/SignerDetailPage/components/ConnectToSignerDrawer/snippets.ts
index ec3338644a..dbb240fe13 100644
--- a/frontend/src/pages/cert-manager/SignerDetailPage/components/ConnectToSignerDrawer/snippets.ts
+++ b/frontend/src/pages/cert-manager/SignerDetailPage/components/ConnectToSignerDrawer/snippets.ts
@@ -8,6 +8,21 @@ export type Snippet = {
export type OS = "linux" | "macos" | "windows";
export type Pkcs11Tool = "jarsigner" | "osslsigncode" | "pkcs11-tool";
+export type SignerAuth = { mode: "token"; token: string } | { mode: "machine-identity" };
+
+const credLines = (auth: SignerAuth, shell: "powershell" | "bash"): string => {
+ if (shell === "powershell") {
+ return auth.mode === "token"
+ ? `$env:INFISICAL_TOKEN = "${auth.token}"`
+ : `$env:INFISICAL_UNIVERSAL_AUTH_CLIENT_ID = "<client-id>"
+$env:INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET = "<client-secret>"`;
+ }
+ return auth.mode === "token"
+ ? `export INFISICAL_TOKEN="${auth.token}"`
+ : `export INFISICAL_UNIVERSAL_AUTH_CLIENT_ID="<client-id>"
+export INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET="<client-secret>"`;
+};
+
const PKCS11_RELEASES = "https://github.com/Infisical/infisical-pkcs-11/releases/latest/download";
const KSP_RELEASES = "https://github.com/Infisical/infisical-ksp/releases/latest/download";
@@ -48,23 +63,21 @@ Expand-Archive libinfisical-pkcs11.zip -DestinationPath . -Force`
}
};
-export const pkcs11ConfigureSnippet = (os: OS, serverUrl: string): Snippet => {
+export const pkcs11ConfigureSnippet = (os: OS, serverUrl: string, auth: SignerAuth): Snippet => {
if (os === "windows") {
return {
language: "powershell",
code: `New-Item -ItemType Directory -Force -Path "$env:ProgramData\\Infisical" | Out-Null
'{ "server_url": "${serverUrl}" }' | Set-Content "$env:ProgramData\\Infisical\\pkcs11.conf"
-$env:INFISICAL_PKCS11_CONFIG = "$env:ProgramData\\Infisical\\pkcs11.conf"
-$env:INFISICAL_UNIVERSAL_AUTH_CLIENT_ID = "<client-id>"
-$env:INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET = "<client-secret>"`
+$env:INFISICAL_CONFIG = "$env:ProgramData\\Infisical\\pkcs11.conf"
+${credLines(auth, "powershell")}`
};
}
return {
language: "bash",
code: `sudo mkdir -p /etc/infisical
echo '{ "server_url": "${serverUrl}" }' | sudo tee /etc/infisical/pkcs11.conf > /dev/null
-export INFISICAL_UNIVERSAL_AUTH_CLIENT_ID="<client-id>"
-export INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET="<client-secret>"`
+${credLines(auth, "bash")}`
};
};
@@ -145,12 +158,11 @@ $cur = @((Get-ItemProperty $iface).Providers)
if ($cur -notcontains $prov) { Set-ItemProperty -Path $iface -Name Providers -Value ($cur + $prov) }`
});
-export const kspConfigureSnippet = (serverUrl: string): Snippet => ({
+export const kspConfigureSnippet = (serverUrl: string, auth: SignerAuth): Snippet => ({
language: "powershell",
code: `New-Item -ItemType Directory -Force -Path "$env:ProgramData\\Infisical" | Out-Null
'{ "server_url": "${serverUrl}" }' | Set-Content "$env:ProgramData\\Infisical\\config.json"
-$env:INFISICAL_UNIVERSAL_AUTH_CLIENT_ID = "<client-id>"
-$env:INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET = "<client-secret>"`
+${credLines(auth, "powershell")}`
});
export const kspCertSnippet = (signerName: string, certPem?: string): Snippet => {
diff --git a/frontend/src/pages/cert-manager/SignerDetailPage/components/SigningOperationsTable.tsx b/frontend/src/pages/cert-manager/SignerDetailPage/components/SigningOperationsTable.tsx
index e0cab3aa8d..1c03f1ac02 100644
--- a/frontend/src/pages/cert-manager/SignerDetailPage/components/SigningOperationsTable.tsx
+++ b/frontend/src/pages/cert-manager/SignerDetailPage/components/SigningOperationsTable.tsx
@@ -151,7 +151,7 @@ export const SigningOperationsTable = ({ signer, signerId, projectId }: Props) =
<CardDescription>Trail of signing operations on this signer.</CardDescription>
<CardAction>
<Button variant="neutral" size="sm" onClick={() => setIsConnectOpen(true)}>
- How to sign
+ Set up signing
</Button>
</CardAction>
</CardHeader>