Skip to content

Commit ac815af

Browse files
authored
Fix axios supply chain vulnerability in CI scripts (#5524)
* Fix axios supply chain vulnerability in CI scripts Pin axios to exact versions and add --ignore-scripts to prevent postinstall script execution in CI pipelines. Ref: #5517 * Added npm ci and private feed
1 parent 7bdb530 commit ac815af

4 files changed

Lines changed: 324 additions & 1 deletion

File tree

.azure-pipelines/pipeline.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,12 @@ extends:
129129
timeoutInMinutes: 300
130130
steps:
131131
- template: /.azure-pipelines/get-pat.yml@self
132+
- task: NpmAuthenticate@0
133+
inputs:
134+
workingFile: .azure-pipelines/scripts/.npmrc
132135
- bash: |
133136
cd ./.azure-pipelines/scripts/
134-
npm install axios minimist
137+
npm ci --ignore-scripts
135138
136139
releaseBranch="${{ parameters.branch }}"
137140
sourceBranch="$(Build.SourceBranch)"

.azure-pipelines/scripts/.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
registry=https://pkgs.dev.azure.com/mseng/PipelineTools/_packaging/PipelineTools_PublicPackages/npm/registry/
2+
3+
always-auth=true

.azure-pipelines/scripts/package-lock.json

Lines changed: 307 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "azure-pipelines-canary-scripts",
3+
"version": "1.0.0",
4+
"private": true,
5+
"description": "CI scripts for Azure Pipelines Agent canary tests",
6+
"dependencies": {
7+
"axios": "1.14.0",
8+
"minimist": "1.2.8"
9+
}
10+
}

0 commit comments

Comments
 (0)