Skip to content

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

get rid of resource from policies, only using account path

x032205c60c397e6a4f
diff --git a/backend/src/services/approval-policy/pam-access/pam-access-policy-factory.ts b/backend/src/services/approval-policy/pam-access/pam-access-policy-factory.ts
index 802632c063..cd88e92ebe 100644
--- a/backend/src/services/approval-policy/pam-access/pam-access-policy-factory.ts
+++ b/backend/src/services/approval-policy/pam-access/pam-access-policy-factory.ts
@@ -29,11 +29,6 @@ export const pamAccessPolicyFactory: TApprovalResourceFactory<
for (const policy of policies) {
const p = policy as TPamAccessPolicy;
for (const c of p.conditions.conditions) {
- if (c.resourceIds && !c.resourceIds.some((r) => r === inputs.resourceId)) {
- // eslint-disable-next-line no-continue
- continue;
- }
-
// Find the most specific path pattern
// TODO(andrey): Make matching logic more advanced by accounting for wildcard positions
for (const pathPattern of c.accountPaths) {
diff --git a/backend/src/services/approval-policy/pam-access/pam-access-policy-schemas.ts b/backend/src/services/approval-policy/pam-access/pam-access-policy-schemas.ts
index 2b1e95cef9..7d6dad9b91 100644
--- a/backend/src/services/approval-policy/pam-access/pam-access-policy-schemas.ts
+++ b/backend/src/services/approval-policy/pam-access/pam-access-policy-schemas.ts
@@ -12,14 +12,12 @@ import {
// Inputs
export const PamAccessPolicyInputsSchema = z.object({
- resourceId: z.string().uuid(),
accountPath: z.string()
});
// Conditions
export const PamAccessPolicyConditionsSchema = z
.object({
- resourceIds: z.string().uuid().array().optional(),
accountPaths: z.string().array() // TODO(andrey): Add path & wildcard validation
})
.array();
@@ -44,7 +42,6 @@ export const PamAccessPolicyConstraintsSchema = z.object({
// Request Data
export const PamAccessPolicyRequestDataSchema = z.object({
- resourceId: z.string().uuid(),
accountPath: z.string(),
accessDuration: DurationSchema
});