Skip to content

Commit 93c1f74

Browse files
committed
feat(ci): add euvd
1 parent ca88d49 commit 93c1f74

File tree

10 files changed

+178
-51
lines changed

10 files changed

+178
-51
lines changed

.github/workflows/archive-raw.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ jobs:
5252
- "endoflife-date-products"
5353
- "erlang-ghsa"
5454
- "erlang-osv"
55+
# - "enisa-euvd-detail"
56+
- "enisa-euvd-list"
5557
- "exploit-exploitdb"
5658
- "exploit-github"
5759
- "exploit-inthewild"

.github/workflows/archive.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ on:
5454
- vuls-data-raw-endoflife-date-products
5555
- vuls-data-raw-erlang-ghsa
5656
- vuls-data-raw-erlang-osv
57+
# - vuls-data-raw-enisa-euvd-detail
58+
- vuls-data-raw-enisa-euvd-list
5759
- vuls-data-raw-exploit-exploitdb
5860
- vuls-data-raw-exploit-github
5961
- vuls-data-raw-exploit-inthewild

.github/workflows/backup-daily.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ jobs:
7777
- vuls-data-raw-epss
7878
- vuls-data-raw-erlang-ghsa
7979
- vuls-data-raw-erlang-osv
80+
# - vuls-data-raw-enisa-euvd-detail
81+
- vuls-data-raw-enisa-euvd-list
8082
- vuls-data-raw-exploit-exploitdb
8183
- vuls-data-raw-exploit-github
8284
- vuls-data-raw-exploit-inthewild

.github/workflows/backup-monthly.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ jobs:
7777
- vuls-data-raw-epss
7878
- vuls-data-raw-erlang-ghsa
7979
- vuls-data-raw-erlang-osv
80+
# - vuls-data-raw-enisa-euvd-detail
81+
- vuls-data-raw-enisa-euvd-list
8082
- vuls-data-raw-exploit-exploitdb
8183
- vuls-data-raw-exploit-github
8284
- vuls-data-raw-exploit-inthewild

.github/workflows/backup-weekly.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ jobs:
7777
- vuls-data-raw-epss
7878
- vuls-data-raw-erlang-ghsa
7979
- vuls-data-raw-erlang-osv
80+
# - vuls-data-raw-enisa-euvd-detail
81+
- vuls-data-raw-enisa-euvd-list
8082
- vuls-data-raw-exploit-exploitdb
8183
- vuls-data-raw-exploit-github
8284
- vuls-data-raw-exploit-inthewild

.github/workflows/fetch-all.yml

Lines changed: 57 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -172,38 +172,39 @@ jobs:
172172
with:
173173
target: ${{ matrix.target }}
174174

175-
fetch-nvd-api:
175+
fetch-cisco-json:
176+
name: Fetch vuls-data-raw-cisco-json
177+
uses: ./.github/workflows/fetch-cisco-json.yml
178+
secrets:
179+
CISCO_CLIENT_KEY: ${{ secrets.CISCO_CLIENT_KEY }}
180+
CISCO_CLIENT_SECRET: ${{ secrets.CISCO_CLIENT_SECRET }}
181+
182+
fetch-cisco-cvrf-or-csaf:
176183
name: Fetch vuls-data-raw-${{ matrix.target }}
184+
if: ${{ success() || failure() }}
185+
needs: fetch-cisco-json
177186
strategy:
178187
fail-fast: false
179-
max-parallel: 1
180188
matrix:
181189
target:
182-
- "nvd-api-cve"
183-
- "nvd-api-cpe"
184-
- "nvd-api-cpematch"
185-
uses: ./.github/workflows/fetch-nvd-api.yml
190+
- "cisco-cvrf"
191+
- "cisco-csaf"
192+
uses: ./.github/workflows/fetch-cisco-cvrf-or-csaf.yml
186193
with:
187194
target: ${{ matrix.target }}
188-
secrets:
189-
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
190195

191-
fetch-redhat-package-manifest:
192-
name: Fetch vuls-data-raw-redhat-package-manifest
193-
uses: ./.github/workflows/fetch-redhat-package-manifest.yml
196+
fetch-epss:
197+
name: Fetch vuls-data-raw-epss
198+
uses: ./.github/workflows/fetch-epss.yml
194199

195-
fetch-msuc:
196-
name: Fetch vuls-data-raw-microsoft-msuc
197-
uses: ./.github/workflows/fetch-msuc.yml
200+
fetch-enisa-euvd-list:
201+
name: Fetch vuls-data-raw-enisa-euvd-list
202+
uses: ./.github/workflows/fetch-enisa-euvd-list.yml
198203

199204
fetch-fedora:
200205
name: Fetch vuls-data-raw-fedora
201206
uses: ./.github/workflows/fetch-fedora.yml
202207

203-
fetch-epss:
204-
name: Fetch vuls-data-raw-epss
205-
uses: ./.github/workflows/fetch-epss.yml
206-
207208
fetch-fortinet-csaf:
208209
name: Fetch vuls-data-raw-fortinet-csaf
209210
uses: ./.github/workflows/fetch-fortinet-csaf.yml
@@ -212,41 +213,25 @@ jobs:
212213
name: Fetch vuls-data-raw-fortinet-cvrf
213214
uses: ./.github/workflows/fetch-fortinet-cvrf.yml
214215

215-
fetch-vulncheck:
216-
name: Fetch vuls-data-raw-${{ matrix.target }}
217-
strategy:
218-
fail-fast: false
219-
matrix:
220-
target:
221-
- "vulncheck-kev"
222-
- "vulncheck-nist-nvd"
223-
- "vulncheck-nist-nvd2"
224-
uses: ./.github/workflows/fetch-vulncheck.yml
225-
with:
226-
target: ${{ matrix.target }}
227-
secrets:
228-
VULNCHECK_API_KEY: ${{ secrets.VULNCHECK_API_KEY }}
229-
230-
fetch-cisco-json:
231-
name: Fetch vuls-data-raw-cisco-json
232-
uses: ./.github/workflows/fetch-cisco-json.yml
233-
secrets:
234-
CISCO_CLIENT_KEY: ${{ secrets.CISCO_CLIENT_KEY }}
235-
CISCO_CLIENT_SECRET: ${{ secrets.CISCO_CLIENT_SECRET }}
216+
fetch-msuc:
217+
name: Fetch vuls-data-raw-microsoft-msuc
218+
uses: ./.github/workflows/fetch-msuc.yml
236219

237-
fetch-cisco-cvrf-or-csaf:
220+
fetch-nvd-api:
238221
name: Fetch vuls-data-raw-${{ matrix.target }}
239-
if: ${{ success() || failure() }}
240-
needs: fetch-cisco-json
241222
strategy:
242223
fail-fast: false
224+
max-parallel: 1
243225
matrix:
244226
target:
245-
- "cisco-cvrf"
246-
- "cisco-csaf"
247-
uses: ./.github/workflows/fetch-cisco-cvrf-or-csaf.yml
227+
- "nvd-api-cve"
228+
- "nvd-api-cpe"
229+
- "nvd-api-cpematch"
230+
uses: ./.github/workflows/fetch-nvd-api.yml
248231
with:
249232
target: ${{ matrix.target }}
233+
secrets:
234+
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
250235

251236
fetch-paloalto-json-or-csaf:
252237
name: Fetch vuls-data-raw-${{ matrix.target }}
@@ -262,6 +247,10 @@ jobs:
262247
with:
263248
target: ${{ matrix.target }}
264249

250+
fetch-redhat-package-manifest:
251+
name: Fetch vuls-data-raw-redhat-package-manifest
252+
uses: ./.github/workflows/fetch-redhat-package-manifest.yml
253+
265254
fetch-variot:
266255
name: Fetch vuls-data-raw-${{ matrix.target }}
267256
strategy:
@@ -276,23 +265,40 @@ jobs:
276265
secrets:
277266
VARIOT_API_KEY: ${{ secrets.VARIOT_API_KEY }}
278267

268+
fetch-vulncheck:
269+
name: Fetch vuls-data-raw-${{ matrix.target }}
270+
strategy:
271+
fail-fast: false
272+
matrix:
273+
target:
274+
- "vulncheck-kev"
275+
- "vulncheck-nist-nvd"
276+
- "vulncheck-nist-nvd2"
277+
uses: ./.github/workflows/fetch-vulncheck.yml
278+
with:
279+
target: ${{ matrix.target }}
280+
secrets:
281+
VULNCHECK_API_KEY: ${{ secrets.VULNCHECK_API_KEY }}
282+
279283
check:
280284
name: Decide whether to Git GC
281285
if: ${{ success() || failure() }}
282286
needs:
283287
[
284288
fetch-main,
285-
fetch-nvd-api,
286-
fetch-msuc,
287-
fetch-fedora,
289+
fetch-cisco-json,
290+
fetch-cisco-cvrf-or-csaf,
288291
fetch-epss,
292+
fetch-euvd,
293+
fetch-fedora,
289294
fetch-fortinet-csaf,
290295
fetch-fortinet-cvrf,
291-
fetch-vulncheck,
292-
fetch-cisco-json,
293-
fetch-cisco-cvrf-or-csaf,
296+
fetch-nvd-api,
297+
fetch-msuc,
294298
fetch-paloalto-json-or-csaf,
299+
fetch-redhat-package-manifest,
295300
fetch-variot,
301+
fetch-vulncheck,
296302
]
297303
runs-on: ubuntu-latest
298304
outputs:
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: Fetch EUVD List
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
inputs:
7+
fetch_signle:
8+
description: "Fetch EUVD list with signle thread"
9+
required: true
10+
default: false
11+
type: boolean
12+
13+
jobs:
14+
check:
15+
name: Decide whether to fetch signle
16+
runs-on: ubuntu-latest
17+
outputs:
18+
do_fetch_signle: ${{ steps.check.outputs.fetch_signle }}
19+
steps:
20+
- name: Check if fetch_signle
21+
id: check
22+
run: |
23+
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
24+
echo "fetch_signle=${{ inputs.fetch_signle }}" >> $GITHUB_OUTPUT
25+
exit 0
26+
fi
27+
28+
if [[ $(( ${{ github.run_number }} % 15 )) -eq 0 ]]; then
29+
echo "fetch_signle=true" >> $GITHUB_OUTPUT
30+
fi
31+
32+
fetch:
33+
name: Fetch vuls-data-raw-enisa-euvd-list
34+
runs-on: ubuntu-latest
35+
needs: check
36+
steps:
37+
- name: Maximize build space
38+
uses: easimon/maximize-build-space@v10
39+
with:
40+
root-reserve-mb: 32768
41+
remove-dotnet: "true"
42+
remove-android: "true"
43+
remove-haskell: "true"
44+
remove-codeql: "true"
45+
remove-docker-images: "true"
46+
47+
- name: Check out code into the Go module directory
48+
uses: actions/checkout@v5
49+
with:
50+
repository: MaineK00n/vuls-data-update
51+
ref: main
52+
53+
- name: Set up Go 1.x
54+
uses: actions/setup-go@v6
55+
with:
56+
go-version-file: "go.mod"
57+
58+
- name: Install vuls-data-update
59+
run: go install ./cmd/vuls-data-update
60+
61+
- name: Pull ghcr.io/${{ github.repository }}:vuls-data-raw-enisa-euvd-list
62+
run: vuls-data-update dotgit pull --dir . --checkout main ghcr.io/${{ github.repository }}:vuls-data-raw-enisa-euvd-list
63+
64+
- name: Fetch with single thread
65+
if: ${{ needs.check.outputs.do_fetch_signle == 'true' }}
66+
run: vuls-data-update fetch enisa-euvd-list --dir ghcr.io/${{ github.repository }}/vuls-data-raw-enisa-euvd-list --concurrency 1
67+
68+
- name: Fetch
69+
if: ${{ needs.check.outputs.do_fetch_signle != 'true' }}
70+
run: vuls-data-update fetch enisa-euvd-list --dir ghcr.io/${{ github.repository }}/vuls-data-raw-enisa-euvd-list
71+
72+
- name: Restore
73+
if: ${{ needs.check.outputs.do_fetch_signle != 'true' }}
74+
run: |
75+
deleted=$(git -C ghcr.io/${{ github.repository }}/vuls-data-raw-enisa-euvd-list ls-files --deleted)
76+
if [[ -n ${deleted} ]]; then
77+
git -C ghcr.io/${{ github.repository }}/vuls-data-raw-enisa-euvd-list restore ${deleted}
78+
fi
79+
80+
- name: Set Git config
81+
run: |
82+
if git -C ghcr.io/${{ github.repository }}/vuls-data-raw-enisa-euvd-list remote | grep -q "^origin$"; then
83+
git -C ghcr.io/${{ github.repository }}/vuls-data-raw-enisa-euvd-list remote set-url origin ghcr.io/${{ github.repository }}:vuls-data-raw-enisa-euvd-list
84+
else
85+
git -C ghcr.io/${{ github.repository }}/vuls-data-raw-enisa-euvd-list remote add origin ghcr.io/${{ github.repository }}:vuls-data-raw-enisa-euvd-list
86+
fi
87+
git -C ghcr.io/${{ github.repository }}/vuls-data-raw-enisa-euvd-list config user.email "action@github.com"
88+
git -C ghcr.io/${{ github.repository }}/vuls-data-raw-enisa-euvd-list config user.name "GitHub Action"
89+
90+
- name: Commit
91+
run: |
92+
if [[ -n $(git -C ghcr.io/${{ github.repository }}/vuls-data-raw-enisa-euvd-list status --porcelain) ]]; then
93+
git -C ghcr.io/${{ github.repository }}/vuls-data-raw-enisa-euvd-list add .
94+
git -C ghcr.io/${{ github.repository }}/vuls-data-raw-enisa-euvd-list commit -m "update" -m "GitHub Actions: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${{ job.check_run_id }}"
95+
fi
96+
97+
- name: Create dotgit tarball
98+
run: vuls-data-update dotgit compress ghcr.io/${{ github.repository }}/vuls-data-raw-enisa-euvd-list
99+
100+
- name: Push ghcr.io/${{ github.repository }}:vuls-data-raw-enisa-euvd-list
101+
run: vuls-data-update dotgit registry push --force --token ${{ secrets.GITHUB_TOKEN }} ghcr.io/${{ github.repository }}:vuls-data-raw-enisa-euvd-list vuls-data-raw-enisa-euvd-list.tar.zst

.github/workflows/gc-raw.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ jobs:
132132
- tag: vuls-data-raw-erlang-osv
133133
pack-threads: 2
134134
pack-windowMemory: 4g
135+
# - tag: vuls-data-raw-enisa-euvd-detail
136+
# pack-threads: 2
137+
# pack-windowMemory: 4g
138+
- tag: vuls-data-raw-enisa-euvd-list
139+
pack-threads: 2
140+
pack-windowMemory: 4g
135141
- tag: vuls-data-raw-exploit-exploitdb
136142
pack-threads: 2
137143
pack-windowMemory: 4g

.github/workflows/gc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ on:
9494
- vuls-data-raw-epss
9595
- vuls-data-raw-erlang-ghsa
9696
- vuls-data-raw-erlang-osv
97+
# - vuls-data-raw-enisa-euvd-detail
98+
- vuls-data-raw-enisa-euvd-list
9799
- vuls-data-raw-exploit-exploitdb
98100
- vuls-data-raw-exploit-github
99101
- vuls-data-raw-exploit-inthewild

.github/workflows/restore-all.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ jobs:
8585
- vuls-data-raw-epss
8686
- vuls-data-raw-erlang-ghsa
8787
- vuls-data-raw-erlang-osv
88+
# - vuls-data-raw-enisa-euvd-detail
89+
- vuls-data-raw-enisa-euvd-list
8890
- vuls-data-raw-exploit-exploitdb
8991
- vuls-data-raw-exploit-github
9092
- vuls-data-raw-exploit-inthewild

0 commit comments

Comments
 (0)