Skip to content

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

feat(code-signing): allow admins to pre-approve signing for themselves

bernie-g15b4906508a0
diff --git a/backend/src/services/signer/signer-policy-service.ts b/backend/src/services/signer/signer-policy-service.ts
index 185f1d8909..42423d33ff 100644
--- a/backend/src/services/signer/signer-policy-service.ts
+++ b/backend/src/services/signer/signer-policy-service.ts
@@ -8,7 +8,7 @@ import {
ResourcePermissionSignerActions,
ResourcePermissionSub
} from "@app/ee/services/permission/resource-permission";
-import { BadRequestError, ForbiddenRequestError, NotFoundError } from "@app/lib/errors";
+import { BadRequestError, NotFoundError } from "@app/lib/errors";
import { ms } from "@app/lib/ms";
import {
@@ -620,12 +620,6 @@ export const signerPolicyServiceFactory = ({
if (!dto.granteeUserId && !dto.granteeIdentityId) {
throw new BadRequestError({ message: "granteeUserId or granteeIdentityId is required." });
}
- if (
- (dto.actor === ActorType.USER && dto.granteeUserId === dto.actorId) ||
- (dto.actor === ActorType.IDENTITY && dto.granteeIdentityId === dto.actorId)
- ) {
- throw new ForbiddenRequestError({ message: "You cannot pre-approve signing access for yourself." });
- }
if (!dto.requestedSignings && !dto.requestedWindowEnd) {
throw new BadRequestError({ message: "Provide at least one of requestedSignings or requestedWindowEnd." });
}
diff --git a/docs/documentation/platform/pki/code-signing/approvals.mdx b/docs/documentation/platform/pki/code-signing/approvals.mdx
index c050d943aa..57dc614748 100644
--- a/docs/documentation/platform/pki/code-signing/approvals.mdx
+++ b/docs/documentation/platform/pki/code-signing/approvals.mdx
@@ -184,7 +184,7 @@ If you're an eligible approver for the **current** step of a pending request, an
</Steps>
<Note>
- You can never approve your own signing request, even if you are listed as an approver for the current step. Administrators also cannot pre-approve signing for themselves. These rules are always enforced and cannot be disabled.
+ You can never approve your own signing request, even if you are listed as an approver for the current step. This is always enforced and cannot be disabled. (Pre-approving signing for yourself is allowed — it is an administrator action, not an approval of your own request.)
</Note>
## Revoking access
diff --git a/frontend/src/pages/cert-manager/SignerDetailPage/components/PreApproveSigningModal.tsx b/frontend/src/pages/cert-manager/SignerDetailPage/components/PreApproveSigningModal.tsx
index fd6894c66f..08e8c59d2b 100644
--- a/frontend/src/pages/cert-manager/SignerDetailPage/components/PreApproveSigningModal.tsx
+++ b/frontend/src/pages/cert-manager/SignerDetailPage/components/PreApproveSigningModal.tsx
@@ -23,7 +23,6 @@ import {
Input,
TextArea
} from "@app/components/v3";
-import { useUser } from "@app/context";
import {
SignerMemberRole,
TEffectiveSignerMember,
@@ -88,8 +87,6 @@ export const PreApproveSigningModal = ({ isOpen, onOpenChange, signerId }: Props
const preApprove = usePreApproveSigning();
const [submitting, setSubmitting] = useState(false);
- const { user } = useUser();
-
const maxSignings = policy?.constraints?.maxSignings ?? null;
const maxWindowDuration = policy?.constraints?.maxWindowDuration ?? null;
@@ -97,8 +94,6 @@ export const PreApproveSigningModal = ({ isOpen, onOpenChange, signerId }: Props
const opts: MemberOption[] = [];
(users.data?.members ?? []).forEach((m: TEffectiveSignerMember) => {
if (!m.actorUserId) return;
- // you cannot pre-approve signing for yourself, so don't offer yourself as a grantee
- if (m.actorUserId === user?.id) return;
if (m.role === SignerMemberRole.Auditor) return;
opts.push({
value: `user:${m.actorUserId}`,
@@ -116,7 +111,7 @@ export const PreApproveSigningModal = ({ isOpen, onOpenChange, signerId }: Props
});
});
return opts;
- }, [users.data, identities.data, user?.id]);
+ }, [users.data, identities.data]);
const buildDefaults = (): FormData => {
const now = Date.now();