Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add redaction workflow logic #581

Merged
merged 7 commits into from
May 22, 2024
Merged

Add redaction workflow logic #581

merged 7 commits into from
May 22, 2024

Conversation

sfoslund
Copy link
Member

This PR is a follow up to #575, which added the CLI plumbing for the redact verb. This PR populates the redact workflow with the redaction logic. The current redaction logic involves the following components:

  • Remove the entire files section
  • Remove any relationship entries which include a file reference
  • Remove any packages.hasFiles entries
  • Remove any packages.sourceInfo entries (note that this property is not populated for SBOMs generated by this tool, but we have seen syft SBOMs in which this property contains file information)
  • If the document namespace indicates that the SBOM was generated via this sbom-tool, generate a new unique guid section of the document namespace

@sfoslund sfoslund requested a review from a team as a code owner May 21, 2024 21:35
@codecov-commenter
Copy link

codecov-commenter commented May 21, 2024

Codecov Report

Attention: Patch coverage is 84.10596% with 24 lines in your changes are missing coverage. Please review.

Project coverage is 59.82%. Comparing base (b005f3f) to head (03ae5e3).

Files Patch % Lines
...rosoft.Sbom.Api/Workflows/SBOMRedactionWorkflow.cs 85.52% 5 Missing and 6 partials ⚠️
...t.Sbom.Api/FormatValidator/ValidatedSBOMFactory.cs 0.00% 5 Missing ⚠️
...icrosoft.Sbom.Api/FormatValidator/ValidatedSBOM.cs 0.00% 4 Missing ⚠️
...DependencyInjection/ServiceCollectionExtensions.cs 0.00% 2 Missing ⚠️
...crosoft.Sbom.Api/Workflows/Helpers/SbomRedactor.cs 98.41% 0 Missing and 1 partial ⚠️
src/Microsoft.Sbom.Common/FileSystemUtils.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #581      +/-   ##
==========================================
+ Coverage   59.36%   59.82%   +0.46%     
==========================================
  Files         266      268       +2     
  Lines        8101     8249     +148     
  Branches      947      972      +25     
==========================================
+ Hits         4809     4935     +126     
- Misses       2870     2886      +16     
- Partials      422      428       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sfoslund
Copy link
Member Author

@DaveTryon @alisonlomaka thanks for the feedback, I believe I have made all the requested changes, let me know if I missed anything!

@sfoslund sfoslund merged commit b18bb46 into main May 22, 2024
6 checks passed
@sfoslund sfoslund deleted the sfoslund/redactLogic branch May 22, 2024 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants