dependency-track/dev/scripts
nscuro b112c1997c
Preprocess CWE dictionary
The current setup is parsing the CWE dictionary XML at runtime and persisting it to the database (`CweImporter`), just to load it from the database again into memory (`CweResolver`). Both `CweImporter` and `CweResolver` end up holding the entire CWE dictionary in static `Map`s, which is unnecessary.

CWEs are synchronized with the database on startup, where each CWE is processed in a database transaction. That is over 1400 transactions before anything meaningful is done.

As of v4.5 (https://github.com/DependencyTrack/dependency-track/issues/1467), CWEs are stored as serialized list in the `VULNERABILITY` table. The `CWE` table is thus not required anymore, as nothing is referring to it. Lookups can be served immediately from in-memory maps.

With this change, the CWE dictionary is pre-processed with a Python script. It generates a Java class that holds all entries in a static `LinkedHashMap`. Persistence logic around CWEs is removed, and the `CWE` table is dropped.

This is a backport from Hyades.

Signed-off-by: nscuro <nscuro@protonmail.com>
2023-12-08 23:52:59 +01:00
..
copy-grafana-dashboard.sh Add avg. event processing duration to Grafana dashboard 2023-11-04 19:36:04 +01:00
cwe-dictionary-generate.py Preprocess CWE dictionary 2023-12-08 23:52:59 +01:00
data-nist-generate-dummy.sh Move Compose files and scripts to dev directory 2023-05-29 18:46:14 +02:00
dbschema-generate.datanucleus.properties Move Compose files and scripts to dev directory 2023-05-29 18:46:14 +02:00
dbschema-generate.log4j.properties Move Compose files and scripts to dev directory 2023-05-29 18:46:14 +02:00
dbschema-generate.sh Move Compose files and scripts to dev directory 2023-05-29 18:46:14 +02:00
docs-build.sh Move Compose files and scripts to dev directory 2023-05-29 18:46:14 +02:00
docs-dev-docker.sh Add dev script to launch local Jekyll with Docker 2023-08-27 20:54:52 +02:00
docs-dev.sh Move Compose files and scripts to dev directory 2023-05-29 18:46:14 +02:00
logs-clear.sh Move Compose files and scripts to dev directory 2023-05-29 18:46:14 +02:00
update-spdx-license-list.sh Add script to update SPDX license list 2023-09-01 22:35:17 +02:00