-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: csaf correlation - correlate vulnerability to purls and sboms
feat: csaf correlation - correlate sbom to vulnerabilities chore: add basic test for product status correlation fix: broken sbom advisory logic fix: product status should only be valid for the current major stream fix: improve sbom product_status query fix: sbom status query to distinct on vulnerabilty id as well fix: improve the performance of vulnerability to sbom query feat: add sbom packages, with only names for now
- Loading branch information
Showing
13 changed files
with
521 additions
and
85 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
use sea_orm_migration::prelude::*; | ||
|
||
#[derive(DeriveMigrationName)] | ||
pub struct Migration; | ||
|
||
#[async_trait::async_trait] | ||
#[allow(deprecated)] | ||
impl MigrationTrait for Migration { | ||
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { | ||
manager | ||
.alter_table( | ||
Table::alter() | ||
.table(ProductStatus::Table) | ||
.drop_column(ProductStatus::BasePurlId) | ||
.to_owned(), | ||
) | ||
.await?; | ||
|
||
manager | ||
.alter_table( | ||
Table::alter() | ||
.table(ProductStatus::Table) | ||
.add_column(ColumnDef::new(ProductStatus::Component).string()) | ||
.to_owned(), | ||
) | ||
.await?; | ||
|
||
Ok(()) | ||
} | ||
|
||
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { | ||
manager | ||
.alter_table( | ||
Table::alter() | ||
.table(ProductStatus::Table) | ||
.drop_column(ProductStatus::Component) | ||
.to_owned(), | ||
) | ||
.await?; | ||
|
||
manager | ||
.alter_table( | ||
Table::alter() | ||
.table(ProductStatus::Table) | ||
.add_column(ColumnDef::new(ProductStatus::BasePurlId).uuid()) | ||
.add_foreign_key( | ||
TableForeignKey::new() | ||
.from_tbl(ProductStatus::Table) | ||
.from_col(ProductStatus::BasePurlId) | ||
.to_tbl(BasePurl::Table) | ||
.to_col(BasePurl::Id), | ||
) | ||
.to_owned(), | ||
) | ||
.await?; | ||
|
||
Ok(()) | ||
} | ||
} | ||
|
||
#[derive(DeriveIden)] | ||
enum ProductStatus { | ||
Table, | ||
BasePurlId, | ||
Component, | ||
} | ||
|
||
#[derive(DeriveIden)] | ||
enum BasePurl { | ||
Table, | ||
Id, | ||
} |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.