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

Feature Request: Batch processing of sbom file with count of components more then 2000 (AWS Inspector limit) #80

Open
iriabov opened this issue Jul 31, 2024 · 5 comments
Labels
Backlog Task is in the backlog, but not being worked on currently. enhancement New feature or request

Comments

@iriabov
Copy link

iriabov commented Jul 31, 2024

Description

We catch the limitation error in the AWS Inpector CLI command to scan SBOM files. Error log message:
An error occurred (ValidationException) when calling the ScanSbom operation: Input SBOM failed validation: Max number of components exceeded (2000)

You can find the package limit in AWS documentation:
https://docs.aws.amazon.com/inspector/v2/APIReference/API_scan_ScanSbom.html#API_scan_ScanSbom_RequestSyntax

The JSON file for the SBOM you want to scan. The SBOM must be in CycloneDX 1.5 format. This format limits you to passing 2000 components before throwing a ValidException error.

Expected Behavior

Divide the SBOM file by chunks (with the same metadata and max count of components - 2000). The next step is scanning these files independently. The last step is calculating vulnerabilities from all files.

Actual Behavior

We have an error in the scanning GH action:
An error occurred (ValidationException) when calling the ScanSbom operation: Input SBOM failed validation: Max number of components exceeded (2000)

Steps to Reproduce

Build the image with more the 2000 of components in SBOM file.

Other Information

Please provide any additional information such as logs or screenshots.

@s-kenji
Copy link
Member

s-kenji commented Aug 1, 2024

Hello, thank you for reaching out.
We are confirming receipt of your issue.
We will begin to triage the problem, and will report back when we have pertinent updates.

@bluesentinelsec bluesentinelsec changed the title Batch processing of sbom file with count of components more then 2000 (AWS Inspector limit) Feature Request: Batch processing of sbom file with count of components more then 2000 (AWS Inspector limit) Aug 9, 2024
@bluesentinelsec
Copy link
Contributor

Hello, thank you again for creating this issue.
We understand the 2,000 component limit is preventing you from completing Inspector scans.
Splitting the SBOM into smaller chunks is new functionality that we will have to implement.
We have this feature request in our backlog, but we do not have an ETA as to when work will begin.

I'm going to mark this issue as on-hold until we begin work on the feature.

@bluesentinelsec
Copy link
Contributor

@iriabov Hello, we recently increased the permitted component count to 5,000.
Regarding chunking, that is still being discussed internally as an enhancement.

@iriabov
Copy link
Author

iriabov commented Aug 22, 2024

Hi @bluesentinelsec
Awesome, thank you for update and thank you so much for your time and effort—I really appreciate it!
If it's alright with you, I could try to implement chunking and create a PR to review.

Thank you!

@bluesentinelsec
Copy link
Contributor

Hi @bluesentinelsec Awesome, thank you for update and thank you so much for your time and effort—I really appreciate it! If it's alright with you, I could try to implement chunking and create a PR to review.

Thank you!

Contributions are certainly welcome. :)
I would actually recommend that you write a stand alone script for this purpose, that way, you don't need to worry about any of the GitHub Actions integration. This is the basic workflow I have in mind:

#1. First generate a large sbom
./inspector-sbomgen container --image large_image:latest -o large_sbom.json

#2. Now scan the SBOM; the program will need to handle chunking the scan into multiple requests,
# and then reassembling the responses into a single JSON document.
./scan_sbom_in_chunks.py --f your_large_sbom.json --profile your_aws_profile

# You'll need to use the AWS SDK to interact with Inspector's ScanSbom API.

Be advised, I think this is a non-trivial program to write; no worries if you need to back out because this is likely a moderate amount of work. Otherwise, feel free to take a stab and we'll provide feedback if you open a pull request.

@bluesentinelsec bluesentinelsec added Backlog Task is in the backlog, but not being worked on currently. enhancement New feature or request and removed On Hold labels Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backlog Task is in the backlog, but not being worked on currently. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants