Skip to content

Commit ab815eb

Browse files
Merge pull request #659 from microsoft/pls-pipeline-security-fix
ci: fix pipeline vulnerabilities
2 parents c787e63 + e5c5f8a commit ab815eb

13 files changed

+877
-144
lines changed

.github/workflows/deploy-linux.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ on:
9393

9494
schedule:
9595
- cron: '0 9,21 * * *' # Runs at 9:00 AM and 9:00 PM GMT
96-
96+
permissions:
97+
contents: read
98+
actions: read
9799
jobs:
98100
Run:
99101
uses: ./.github/workflows/deploy-orchestrator.yml

.github/workflows/deploy-orchestrator.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ on:
6464

6565
env:
6666
AZURE_DEV_COLLECT_TELEMETRY: ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
67-
67+
permissions:
68+
contents: read
69+
actions: read
70+
6871
jobs:
6972
docker-build:
7073
uses: ./.github/workflows/job-docker-build.yml

.github/workflows/deploy-windows.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ on:
8383

8484
# schedule:
8585
# - cron: '0 9,21 * * *' # Runs at 9:00 AM and 9:00 PM GMT
86-
86+
permissions:
87+
contents: read
88+
actions: read
89+
8790
jobs:
8891
Run:
8992
uses: ./.github/workflows/deploy-orchestrator.yml

.github/workflows/deploy.yml

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ env:
2020
GPT_MIN_CAPACITY: 150
2121
TEXT_EMBEDDING_MIN_CAPACITY: 80
2222
BRANCH_NAME: ${{ github.event.workflow_run.head_branch || github.head_ref || github.ref_name }}
23-
23+
permissions:
24+
contents: read
25+
actions: read
26+
2427
jobs:
2528
deploy:
2629
runs-on: ubuntu-latest
@@ -31,26 +34,21 @@ jobs:
3134
- name: Checkout Code
3235
uses: actions/checkout@v5
3336

34-
- name: Setup Azure CLI
35-
run: |
36-
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
37-
az --version # Verify installation
38-
3937
- name: Login to Azure
4038
run: |
4139
az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
4240
4341
- name: Run Quota Check
4442
id: quota-check
43+
env:
44+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
45+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
46+
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
47+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
48+
GPT_MIN_CAPACITY: ${{ env.GPT_MIN_CAPACITY }}
49+
TEXT_EMBEDDING_MIN_CAPACITY: ${{ env.TEXT_EMBEDDING_MIN_CAPACITY }}
50+
AZURE_REGIONS: ${{ vars.AZURE_REGIONS }}
4551
run: |
46-
export AZURE_CLIENT_ID=${{ secrets.AZURE_CLIENT_ID }}
47-
export AZURE_TENANT_ID=${{ secrets.AZURE_TENANT_ID }}
48-
export AZURE_CLIENT_SECRET=${{ secrets.AZURE_CLIENT_SECRET }}
49-
export AZURE_SUBSCRIPTION_ID="${{ secrets.AZURE_SUBSCRIPTION_ID }}"
50-
export GPT_MIN_CAPACITY=${{ env.GPT_MIN_CAPACITY }}
51-
export TEXT_EMBEDDING_MIN_CAPACITY=${{ env.TEXT_EMBEDDING_MIN_CAPACITY }}
52-
export AZURE_REGIONS="${{ vars.AZURE_REGIONS }}"
53-
5452
chmod +x scripts/checkquota.sh
5553
if ! scripts/checkquota.sh; then
5654
# If quota check fails due to insufficient quota, set the flag
@@ -224,11 +222,6 @@ jobs:
224222
env:
225223
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
226224
steps:
227-
- name: Setup Azure CLI
228-
run: |
229-
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
230-
az --version # Verify installation
231-
232225
- name: Login to Azure
233226
run: |
234227
az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}

.github/workflows/docker-build-and-push.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ on:
2626
- '!src/tests/**'
2727
merge_group:
2828
workflow_dispatch:
29-
29+
permissions:
30+
contents: read
31+
actions: read
32+
3033
jobs:
3134
build-and-push:
3235
runs-on: ubuntu-latest

.github/workflows/job-cleanup-deployment.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ on:
4040
description: 'Docker Image Tag'
4141
required: true
4242
type: string
43-
43+
permissions:
44+
contents: read
45+
actions: read
46+
4447
jobs:
4548
cleanup-deployment:
4649
runs-on: ${{ inputs.runner_os }}
@@ -52,14 +55,6 @@ jobs:
5255
ENV_NAME: ${{ inputs.ENV_NAME }}
5356
IMAGE_TAG: ${{ inputs.IMAGE_TAG }}
5457
steps:
55-
- name: Setup Azure CLI
56-
shell: bash
57-
run: |
58-
if [[ "${{ runner.os }}" == "Linux" ]]; then
59-
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
60-
fi
61-
az --version
62-
6358
- name: Login to Azure
6459
shell: bash
6560
run: |

0 commit comments

Comments
 (0)