Skip to content

Commit 390c81e

Browse files
authored
BST-18043 Add the Azure Devops pipelines scan tests (#274)
1 parent 43bcb5a commit 390c81e

File tree

4 files changed

+49
-11
lines changed

4 files changed

+49
-11
lines changed

.github/workflows/scan-test.yml

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,45 @@ on:
55
types: [opened, synchronize, reopened]
66
paths: ['scanners/**']
77

8+
permissions:
9+
id-token: write # Required for OIDC
10+
811
jobs:
12+
azure-devops-pipelines:
13+
name: Azure DevOps Pipelines
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Azure Login (OIDC)
17+
uses: azure/login@v2
18+
with:
19+
client-id: ${{ secrets.BOOST_SCAN_RUNNER_ADO_CLIENT_ID }}
20+
tenant-id: ${{ secrets.BOOST_SCAN_RUNNER_ADO_TENANT_ID }}
21+
allow-no-subscriptions: true
22+
- name: Get Azure DevOps Token
23+
id: azure-token
24+
run: |
25+
token=$(az account get-access-token \
26+
--resource 499b84ac-1321-427f-aa17-267ca6975798 \
27+
--query accessToken -o tsv)
28+
echo "token=$token" >> $GITHUB_OUTPUT
29+
echo "::add-mask::$token"
30+
- name: Checkout scanner registry
31+
uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0 # Need full history to detect changes
34+
- name: Run Tests
35+
uses: boostsecurityio/scan-test-action@2a784e92451e9ba1561ca749ba630b7621adfcbf
36+
with:
37+
provider: azure-devops
38+
provider-config: |
39+
{
40+
"token": "${{ steps.azure-token.outputs.token }}",
41+
"organization": "BoostSecurity",
42+
"project": "cicd-tools",
43+
"pipeline_id": 1
44+
}
45+
registry-repo: "${{ github.repository_owner }}/${{ github.event.repository.name }}"
46+
base-ref: "${{ github.base_ref }}"
947
bitbucket-action:
1048
name: Bitbucket Pipelines
1149
runs-on: ubuntu-latest
@@ -26,7 +64,7 @@ jobs:
2664
with:
2765
fetch-depth: 0 # Need full history to detect changes
2866
- name: Run Tests
29-
uses: boostsecurityio/scan-test-action@53e2f687ab93ac5d150b88abd7341b72f6fbf384
67+
uses: boostsecurityio/scan-test-action@2a784e92451e9ba1561ca749ba630b7621adfcbf
3068
with:
3169
provider: bitbucket
3270
provider-config: |
@@ -55,7 +93,7 @@ jobs:
5593
with:
5694
fetch-depth: 0 # Need full history to detect changes
5795
- name: Run Tests
58-
uses: boostsecurityio/scan-test-action@53e2f687ab93ac5d150b88abd7341b72f6fbf384
96+
uses: boostsecurityio/scan-test-action@2a784e92451e9ba1561ca749ba630b7621adfcbf
5997
with:
6098
provider: github-actions
6199
provider-config: |
@@ -77,7 +115,7 @@ jobs:
77115
with:
78116
fetch-depth: 0 # Need full history to detect changes
79117
- name: Run Tests
80-
uses: boostsecurityio/scan-test-action@53e2f687ab93ac5d150b88abd7341b72f6fbf384
118+
uses: boostsecurityio/scan-test-action@2a784e92451e9ba1561ca749ba630b7621adfcbf
81119
with:
82120
provider: gitlab-ci
83121
provider-config: |

docs/setup-azure-devops.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ jobs:
9898
- name: Azure Login (OIDC)
9999
uses: azure/login@v2
100100
with:
101-
client-id: ${{ secrets.AZURE_CLIENT_ID }}
102-
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
101+
client-id: ${{ secrets.BOOST_SCAN_RUNNER_ADO_CLIENT_ID }}
102+
tenant-id: ${{ secrets.BOOST_SCAN_RUNNER_ADO_TENANT_ID }}
103103
allow-no-subscriptions: true
104104

105105
- name: Get Azure DevOps Token
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
version: "1.0"
22
tests:
3-
- name: "osv-scanner"
4-
type: "source-code"
5-
source:
6-
url: "git@github.com:google/osv-scanner.git"
7-
ref: "main"
83
- name: "gitleaks"
94
type: "source-code"
105
source:
116
url: "git@github.com:gitleaks/gitleaks.git"
127
ref: "v8.15.2"
8+
- name: "osv-scanner"
9+
type: "source-code"
10+
source:
11+
url: "git@github.com:google/osv-scanner.git"
12+
ref: "main"

scanners/boostsecurityio/trivy-image/tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ tests:
66
url: "https://github.com/martin-boost-dev/boost-poc-registry-testing-trivy"
77
ref: "main"
88
scan_paths:
9-
- "osv-scanner"
109
- "rclone"
10+
- "osv-scanner"

0 commit comments

Comments
 (0)