Skip to main content
Manage your Infisical secrets from your developer portal with the Infisical plugin for Backstage. The plugin adds a Secrets tab to entity pages, with support for environments and folders. For the full reference, see the plugin repository on GitHub.

Features

  • Secrets management: View, create, update, and delete secrets in Infisical
  • Folder navigation: Browse the folder structure of your Infisical projects
  • Multiple environments: Switch between the environments of a project
  • Search: Find secrets by key, value, or comment
  • Entity linking: Link Backstage entities to Infisical projects with annotations
  • Access control: Control who can view and change secrets with the Backstage permission framework
  • Multiple machine identities: Give each entity or environment its own Infisical machine identity
Access control, RBAC plugin support, and multiple machine identities need version 1.0.0 or later of the frontend and backend plugins. Earlier versions don’t check permissions, so any user who can see an entity can read and change its secrets. To upgrade, see Upgrade from version 0.1.1 or earlier.

Prerequisites

Step 1: Create a machine identity

The plugin authenticates to Infisical with a machine identity that has access to your project.
1
Create a machine identity that uses Universal Auth, and copy its Client ID and a Client Secret.
2
In your Infisical project, go to Access Control > Machine Identities and add the identity with the Viewer role. If Backstage users should create, update, or delete secrets, use the Member role instead.
3
In the project sidebar, select Settings > General, and copy the Project ID.
You need the client ID and client secret in Step 3, and the project ID in Step 5.

Step 2: Install the plugins

From the root of your Backstage app, install the frontend plugin, the backend plugin, and the common package that defines the plugin’s permissions:

Step 3: Configure the backend

Add the machine identity’s credentials to app-config.yaml, and turn on the permission framework:
To use an existing access token, such as one from Token Auth, replace the universalAuth block with auth_token. The plugin doesn’t renew the token, so the plugin stops working when the token expires.
Then add the backend plugin to packages/backend/src/index.ts:

Step 4: Add the tab to entity pages

Add the plugin to your app in packages/app/src/App.tsx:
Then add the tab to an entity page in packages/app/src/components/catalog/EntityPage.tsx. This example adds the tab to the page for services:
Add the infisical/projectId annotation to the entity’s catalog-info.yaml, with the project ID from Step 1:
The other annotations are optional: To check the setup, open the entity in Backstage and select the Secrets tab. The Secrets tab in Backstage
The Secrets tab shows the secrets in your Infisical project.

Control access with permissions

The plugin checks each request against five permissions, with the entity as the resource. Because the resource is a catalog entity, your permission policy can use catalog rules such as isEntityOwner. The Secrets tab hides the buttons for actions the user isn’t allowed to take.
If permission.enabled isn’t true, or your policy allows every permission, any user who can see an entity can reveal and change its secrets.
Whatever your policy allows, the plugin only gives access to the project, environment, and folder that the entity’s annotations allow.
To let every user list secrets but let only the entity’s owners reveal and change them, return a conditional decision with catalogConditions.isEntityOwner for the other four permissions. The plugin’s README has an example policy that you can copy.
If you manage permissions with the RBAC plugin, add infisical-backend to pluginsWithPermission, so that the five permissions appear in the role editor:
Grant catalog access with the catalog.entity.read permission, not with the catalog-entity resource type. The Infisical permissions also use the catalog-entity resource type, so a role with catalog-entity and the read action can also list secrets and reveal their values. For example:
The built-in RBAC admin role has catalog-entity with the read action, so RBAC admins can always reveal secret values.

Use a different machine identity per entity or environment

By default, every entity uses the machine identity under infisical.authentication. To give a team or an environment its own access in Infisical, add more identities under infisical.identities. Each identity appears as a separate actor in Infisical audit logs.
Then name the identities in the entity’s annotations:
For each request, the plugin uses the first identity that’s set:
  1. infisical/identity.<environment>, if the request is for that environment
  2. infisical/identity
  3. infisical.authentication
When you add identities:
  • Add each identity to the entity’s Infisical project, as in Step 1
  • Name each identity with letters and digits, optionally separated by - or _, with each part starting with a letter (payments-dev works, team-1 doesn’t)
  • Set allowedEntityRefs on identities with broad access, because anyone who can edit an entity’s catalog-info.yaml can name any identity
To list a project’s environments, the plugin uses the identity from infisical/identity or infisical.authentication, unless infisical/environment locks the entity to one environment. Give that identity access to the project too.

Upgrade from version 0.1.1 or earlier

Upgrade the frontend and backend plugins to version 1.0.0 together, because version 1.0.0 of each plugin doesn’t work with earlier versions of the other.
When you upgrade:
  • Install @infisical/backstage-plugin-infisical-common, as in Step 2
  • Install the software catalog backend if your app doesn’t have it, because the plugin reads entity annotations from the catalog
  • If your permission policy denies permissions by default, or you use the RBAC plugin, grant the infisical.secret.* permissions so users keep access to the Secrets tab
  • If your permission policy allows every permission, nothing changes for users, and you can now restrict access to secrets

Troubleshooting

The entity doesn’t have an infisical/projectId annotation. Add the annotation as in Step 5.
The user doesn’t have the infisical.secret.value.read permission. Grant the permission in your permission policy.
The plugin rejects a request with a 403 error if:
  • The user doesn’t have the permission for the action
  • The entity has an infisical/environment annotation, and the request is for a different environment
  • The request is for a folder outside the entity’s infisical/secretPath
  • The entity isn’t in the allowedEntityRefs of the identity it names
The plugin rejects a request with a 404 error if:
  • The entity doesn’t exist, or doesn’t have an infisical/projectId annotation
  • The entity names an identity that isn’t under infisical.identities
  • The entity doesn’t name an identity, and infisical.authentication isn’t set
The plugin sends the Backstage user and entity in the user agent of each request to Infisical, for example:
In Infisical audit logs, select an event to see its userAgent. If another Backstage backend plugin made the request, the user shows as service:<subject>. Your Backstage backend sets this value, so use it to trace requests, not as proof of who made them.

Next steps

Plugin repository

Read the full configuration reference and an example permission policy.

Machine identities

Learn how machine identities authenticate to Infisical.