Skip to content

Commit 6465f7f

Browse files
committed
feat(lightwell): add vulnerability ingestion job
This adds a new job that ingests and syncs vulnerability data from Jira to our DB. It tries to map whatever is currently available to the desired data format specified by the DB.
1 parent 0b524d2 commit 6465f7f

23 files changed

Lines changed: 2491 additions & 4 deletions

cmd/jobs/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ func loadJobs() map[string]jobFunc {
2929
"remove-custom-epel-repos": jobs.RemoveCustomEpelRepos,
3030
"cancel-tasks": jobs.CancelTasks,
3131
"send-template-update-events": jobs.SendTemplateUpdateEvents,
32+
"sync-lightwell-vulnerabilities": jobs.SyncLightwellVulnerabilities,
3233
}
3334
}
3435

configs/config.yaml.example

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,11 @@ clients:
175175
oidc_issuer:
176176
grpc_insecure:
177177
timeout: 30s
178-
178+
# Jira variables for syncing lightwell vulnerabilities.
179+
jira:
180+
url: ""
181+
user: ""
182+
token: ""
179183

180184
# Configuration for the mocks
181185
mocks:

deployments/build/deployment.template.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,21 @@ objects:
270270
- sync-lightwell-advisories
271271
env:{{ENV_VARS}}
272272

273+
- name: sync-lightwell-vulnerabilities
274+
schedule: ${SYNC_LIGHTWELL_VULNERABILITIES_CRON_JOB}
275+
suspend: ${{SUSPEND_SYNC_LIGHTWELL_VULNERABILITIES}}
276+
concurrencyPolicy: "Forbid"
277+
podSpec:
278+
securityContext:
279+
runAsNonRoot: true
280+
runAsUser: 1001
281+
image: ${IMAGE}:${IMAGE_TAG}
282+
inheritEnv: true
283+
command:
284+
- /jobs
285+
- sync-lightwell-vulnerabilities
286+
env:{{ENV_VARS}}
287+
273288
- name: transform-pulp-logs
274289
schedule: "0 1 * * *"
275290
suspend: ${{SUSPEND_TRANSFORM_PULP_LOGS}}

deployments/build/env-variables.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,16 @@ env:
227227
name: lightwell-content-sources-password
228228
key: password
229229
optional: true
230+
- name: CLIENTS_JIRA_URL
231+
value: ${{CLIENTS_JIRA_URL}}
232+
- name: CLIENTS_JIRA_USER
233+
value: ${{CLIENTS_JIRA_USER}}
234+
- name: CLIENTS_JIRA_TOKEN
235+
valueFrom:
236+
secretKeyRef:
237+
name: jira-content-sources-token
238+
key: token
239+
optional: true
230240
- name: EPEL_ORG_ID_SKIP
231241
value: ${EPEL_ORG_ID_SKIP}
232242
- name: OPTIONS_INTERNAL_USER
@@ -285,6 +295,12 @@ parameters:
285295
description: whether to suspend the sync-lightwell-advisories cronjob
286296
required: false
287297
value: "false"
298+
- name: SYNC_LIGHTWELL_VULNERABILITIES_CRON_JOB
299+
value: "0 */2 * * *"
300+
- name: SUSPEND_SYNC_LIGHTWELL_VULNERABILITIES
301+
description: whether to suspend the sync-lightwell-vulnerabilities cronjob
302+
required: false
303+
value: "true"
288304
- name: SUSPEND_CRON_JOB
289305
value: "false"
290306
- name: IMAGE_TAG
@@ -482,6 +498,12 @@ parameters:
482498
- name: CLIENTS_LIGHTWELL_USERNAME
483499
description: Username for accessing lightwell content using basic auth
484500
value: ''
501+
- name: CLIENTS_JIRA_URL
502+
description: URL of the Jira instance used for Lightwell vulnerability ingestion
503+
value: ''
504+
- name: CLIENTS_JIRA_USER
505+
description: Username for Jira API access
506+
value: ''
485507
- name: EPEL_ORG_ID_SKIP
486508
description: comma separated list of org ids to skip when turning snapshotting off
487509
- name: OPTIONS_INTERNAL_USER

0 commit comments

Comments
 (0)