Upload SBOM su Dependency-Track nella pipeline - #74
Merged
Conversation
Aggiunto il job dependency-track-upload al workflow maven.yml, che carica l'SBOM CycloneDX prodotto dal job sbom sotto il progetto GovPay-Backend, e lo script script/sbom/upload-sbom-parent-required.sh che esegue l'upload. Replica di quanto gia' attivo su govpay-common.
Il default del plugin CycloneDX e' projectType=library, che su Dependency-Track avrebbe classificato come libreria un progetto distribuito invece come applicazione. Aggiunto -DprojectType=application alla generazione dell'SBOM.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replica su questo componente il caricamento dell'SBOM su Dependency-Track, gia' attivo e verificato su govpay-common.
Cosa cambia
.github/workflows/maven.yml— nuovo jobdependency-track-upload, inserito subito dopo il jobsbomesistente:sbom-reporte caricasbom/cyclonedx/bom.cdx.jsonsotto il progetto padreGovPay-Backendmain/master/staging; forzabile con la variabileFORCE_DTRACK_UPLOAD_JOB, disattivabile conDISABLE_DTRACK_UPLOAD_JOB, che ha la precedenzacontinue-on-errorriproduce l'allow_failuredifferenziato del job GitLab: bloccante su tag e branch protetti, tollerante sulle esecuzioni forzatelatest: su tag la versione e' il tag ed e' marcatalatest, sui branch protetti e' il nome del branch, altrimentidevscript/sbom/upload-sbom-parent-required.sh— copia identica dello script gia' sumaindigovpay-common. Adattamento GovPay dello script GovDeskupload-sbom-dependency-track.sh, con la gerarchia collassata a un solo livello: il progetto padre deve gia' esistere e nessun livello intermedio viene creato. Nome e versione del progetto foglia sono ricavati dai metadati dell'SBOM, sovrascrivibili conDTRACK_PROJECT_NAMEeDTRACK_VERSION.Prerequisito
Secret
GOVPAY_DTRACK_API_KEYconfigurato sul repository, con permessiVIEW_PORTFOLIO,PROJECT_CREATION_UPLOAD,BOM_UPLOADePORTFOLIO_MANAGEMENT(quest'ultimo perche' sui tag la versione viene marcatalatest).Verifiche
YAML del workflow validato e job correttamente agganciato a
needs: [sbom]; sintassi dello script verificata. Il flusso completo, upload compreso, e' gia' stato eseguito con successo sugovpay-common.Non e' stato eseguito un run reale su questo repository: l'upload e' verificabile solo dopo il merge, oppure lanciando il workflow con
FORCE_DTRACK_UPLOAD_JOB, che e' tollerante ai fallimenti e non blocca la pipeline.