Skip to content

Commit 27737cf

Browse files
chore(ci): change token permissions (#5862)
* Improving security * Improving security
1 parent 09001b2 commit 27737cf

5 files changed

+23
-14
lines changed

.github/workflows/dispatch_analytics.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ jobs:
4343
statuses: read
4444
steps:
4545
- name: Configure AWS credentials
46-
uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355 # v2.2.0
46+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
4747
with:
4848
aws-region: eu-central-1
49-
role-to-assume: ${{ secrets.AWS_ANALYTICS_ROLE_ARN }}
49+
role-to-assume: ${{ secrets.AWS_LAYERS_ROLE_ARN }}
50+
mask-aws-account-id: true
5051

5152
- name: Invoke Lambda function
5253
run: |

.github/workflows/layer_govcloud_python313.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: Layer Deployment (GovCloud) - Temporary for Python 3.13
2+
13
# GovCloud Layer Publish
24
# ---
35
# This workflow publishes a specific layer version in an AWS account based on the environment input.
@@ -32,9 +34,11 @@ on:
3234
type: string
3335
required: true
3436

35-
name: Layer Deployment (GovCloud) - Temporary for Python 3.13
3637
run-name: Layer Deployment (GovCloud) - ${{ inputs.environment }}
3738

39+
permissions:
40+
contents: read
41+
3842
jobs:
3943
download:
4044
runs-on: ubuntu-latest

.github/workflows/reusable_deploy_v2_layer_stack.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,12 @@ jobs:
152152

153153
- name: Install poetry
154154
run: pipx install git+https://github.com/python-poetry/poetry@68b88e5390720a3dd84f02940ec5200bfce39ac6 # v1.5.0
155-
- name: aws credentials
156-
uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355 # v2.2.0
155+
- name: Configure AWS Credentials
156+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
157157
with:
158158
aws-region: ${{ matrix.region }}
159159
role-to-assume: ${{ secrets.AWS_LAYERS_ROLE_ARN }}
160+
mask-aws-account-id: true
160161
- name: Setup Node.js
161162
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
162163
with:

.github/workflows/reusable_deploy_v2_sar.yml

+10-8
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,19 @@ jobs:
8989
integrity_hash: ${{ inputs.source_code_integrity_hash }}
9090
artifact_name: ${{ inputs.source_code_artifact_name }}
9191

92-
93-
- name: AWS credentials
94-
uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355 # v2.2.0
92+
- name: Configure AWS credentials
93+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
9594
with:
9695
aws-region: ${{ env.AWS_REGION }}
9796
role-to-assume: ${{ secrets.AWS_LAYERS_ROLE_ARN }}
97+
mask-aws-account-id: true
9898

99-
# NOTE
100-
# We connect to Layers account to log our intent to publish a SAR Layer
101-
# we then jump to our specific SAR Account with the correctly scoped IAM Role
102-
# this allows us to have a single trail when a release occurs for a given layer (beta+prod+SAR beta+SAR prod)
99+
# NOTE
100+
# We connect to Layers account to log our intent to publish a SAR Layer
101+
# we then jump to our specific SAR Account with the correctly scoped IAM Role
102+
# this allows us to have a single trail when a release occurs for a given layer (beta+prod+SAR beta+SAR prod)
103103
- name: AWS credentials SAR role
104-
uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355 # v2.2.0
104+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
105105
id: aws-credentials-sar-role
106106
with:
107107
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
@@ -110,6 +110,8 @@ jobs:
110110
role-duration-seconds: 1200
111111
aws-region: ${{ env.AWS_REGION }}
112112
role-to-assume: ${{ secrets.AWS_SAR_V2_ROLE_ARN }}
113+
mask-aws-account-id: true
114+
113115
- name: Setup Node.js
114116
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
115117
with:

.github/workflows/reusable_deploy_v3_sar.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
# we then jump to our specific SAR Account with the correctly scoped IAM Role
9999
# this allows us to have a single trail when a release occurs for a given layer (beta+prod+SAR beta+SAR prod)
100100
- name: AWS credentials SAR role
101-
uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355 # v2.2.0
101+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
102102
id: aws-credentials-sar-role
103103
with:
104104
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
@@ -107,6 +107,7 @@ jobs:
107107
role-duration-seconds: 1200
108108
aws-region: ${{ env.AWS_REGION }}
109109
role-to-assume: ${{ secrets.AWS_SAR_V2_ROLE_ARN }}
110+
mask-aws-account-id: true
110111
- name: Setup Node.js
111112
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
112113
with:

0 commit comments

Comments
 (0)