|
15 | 15 | # 1. After the `make-release` workflow finishes and the PR for the documentation update gets created, trigger this workflow manually via `workflow_dispatch` with environment, version, and partition inputs for each Gamma and Prod environment in the China and GovCloud partitions |
16 | 16 | # 2. Monitor deployment progress and verify successful layer publication across all target regions |
17 | 17 | # 3. Once this workflow is completed, the PR for the documentation update can me merged |
| 18 | +# |
| 19 | +# CodeQL Security Note: |
| 20 | +# This workflow uses dynamic secret access via secrets[format(...)] which triggers |
| 21 | +# an "Excessive Secrets Exposure" alert. However, this is safe because: |
| 22 | +# - Secrets are scoped per environment (China/GovCloud Gamma/Prod) |
| 23 | +# - Each job only accesses secrets for its specific partition and region |
| 24 | +# - No global secrets array containing mixed credentials (API keys, PEM files, etc.) |
| 25 | +# - The secrets object is already minimally scoped to the environment being used |
18 | 26 |
|
19 | 27 | on: |
20 | 28 | workflow_dispatch: |
@@ -142,6 +150,7 @@ jobs: |
142 | 150 | - name: Configure AWS Credentials |
143 | 151 | uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1 |
144 | 152 | with: |
| 153 | + # Dynamic secret access is safe here - secrets are scoped per environment |
145 | 154 | role-to-assume: ${{ secrets[format('IAM_ROLE_{0}', steps.transform.outputs.CONVERTED_REGION)] }} |
146 | 155 | aws-region: ${{ matrix.region}} |
147 | 156 | mask-aws-account-id: true |
@@ -175,6 +184,7 @@ jobs: |
175 | 184 | LAYER_VERSION: ${{ steps.create-layer.outputs.LAYER_VERSION }} |
176 | 185 | run: | |
177 | 186 | export layer_output='AWSLambdaPowertoolsTypeScriptV2-${{matrix.region}}.json' |
| 187 | + # Dynamic secret access is safe here - secrets are scoped per environment |
178 | 188 | aws --region ${{ matrix.region}} lambda get-layer-version-by-arn --arn 'arn:${{ needs.setup.outputs.partition }}:lambda:${{ matrix.region}}:${{ secrets[format('AWS_ACCOUNT_{0}', steps.transform.outputs.CONVERTED_REGION)] }}:layer:AWSLambdaPowertoolsTypeScriptV2:${{ env.LAYER_VERSION }}' > $layer_output |
179 | 189 | REMOTE_SHA=$(jq -r '.Content.CodeSha256' $layer_output) |
180 | 190 | LOCAL_SHA=$(jq -r '.Content.CodeSha256' AWSLambdaPowertoolsTypeScriptV2.json) |
|
0 commit comments