Skip to content
This repository was archived by the owner on Aug 9, 2023. It is now read-only.

Commit bd3b726

Browse files
committed
scope down nextflow permissions
1 parent 60f21a9 commit bd3b726

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

src/templates/nextflow/nextflow-aio.template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ Resources:
208208
- !Ref ExistingNextflowBucket
209209
NextflowContainerImage: !Ref NextflowContainerImage
210210
BatchDefaultJobQueue: !GetAtt GenomicsWorkflowStack.Outputs.GenomicsEnvDefaultJobQueueArn
211+
BatchHighPriorityJobQueue: !GetAtt GenomicsWorkflowStack.Outputs.GenomicsEnvHighPriorityJobQueueArn
211212
TemplateRootUrl: !Ref TemplateRootUrl
212213
Tags: !FindInMap ["TagMap", "default", "tags"]
213214

src/templates/nextflow/nextflow-resources.template.yaml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,12 @@ Parameters:
8888
BatchDefaultJobQueue:
8989
Type: String
9090
Description: >-
91-
Name or ARN of the Batch Job Queue to use by default for workflow tasks.
91+
ARN of the Batch Job Queue to use by default for workflow tasks.
92+
93+
BatchHighPriorityJobQueue:
94+
Type: String
95+
Description: >-
96+
ARN of the Batch Job Queue to use for high priority workflow tasks.
9297
9398
TemplateRootUrl:
9499
Type: String
@@ -152,10 +157,33 @@ Resources:
152157
PolicyDocument:
153158
Version: 2012-10-17
154159
Statement:
155-
- Effect: Allow
160+
# Nextflow requires full read access to gather the state of jobs being executed
161+
- Sid: "AWS Batch Read Access - All"
162+
Effect: Allow
156163
Resource: "*"
157164
Action:
158-
- "batch:*"
165+
- "batch:List*"
166+
- "batch:Describe*"
167+
168+
# only permit access (job submission) to the queues and compute environments
169+
# configured to run nextflow
170+
- Sid: "AWS Batch Write Access - Job Submission"
171+
Effect: Allow
172+
Resource:
173+
- !Ref BatchDefaultJobQueue
174+
- !Ref BatchHighPriorityJobQueue
175+
Action:
176+
- "batch:*Job"
177+
178+
# nextflow needs to be able to create job definitions
179+
# these are prefixed with "nf-"
180+
- Sid: "AWS Batch Write Access - Job Definitions"
181+
Effect: Allow
182+
Resource:
183+
- arn:aws:batch:*:*:job-definition/nf-*:*
184+
Action:
185+
- "batch:*JobDefinition"
186+
159187
- PolicyName: !Sub Nextflow-S3Bucket-Access-${AWS::Region}
160188
PolicyDocument:
161189
Version: 2012-10-17

0 commit comments

Comments
 (0)