Skip to content

Commit 5703ff9

Browse files
committed
[Security] Preventing PCAPI path traversal through PCUI by scoping down the policy used by PCUI lambda to invoke PCAPI. In particular allowing the invocation only on the expected stage.
1 parent 5194a2c commit 5703ff9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

infrastructure/parallelcluster-ui.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -898,8 +898,9 @@ Resources:
898898
- execute-api:Invoke
899899
Effect: Allow
900900
Resource: !Sub
901-
- arn:${AWS::Partition}:execute-api:${AWS::Region}:${AWS::AccountId}:${PCApiGateway}/*/*
902-
- { PCApiGateway: !Select [2, !Split ['/', !Select [0, !Split ['.', !GetAtt [ ParallelClusterApi, Outputs.ParallelClusterApiInvokeUrl ]]]]] }
901+
- arn:${AWS::Partition}:execute-api:${AWS::Region}:${AWS::AccountId}:${PCApiGateway}/${PCApiStage}/*
902+
- PCApiGateway: !Select [2, !Split ['/', !Select [0, !Split ['.', !GetAtt [ ParallelClusterApi, Outputs.ParallelClusterApiInvokeUrl ]]]]]
903+
PCApiStage: !Select [3, !Split ['/', !GetAtt [ ParallelClusterApi, Outputs.ParallelClusterApiInvokeUrl ]]]
903904

904905
CognitoPolicy:
905906
Type: AWS::IAM::ManagedPolicy

0 commit comments

Comments
 (0)