-
Notifications
You must be signed in to change notification settings - Fork 20
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 FSCTv3 Common SBOM Baseline Attributes checker #224
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
@jspeed-meyers @goneall This is still a work in progress, the actual functionality of checking the compliance of CISA Framing Software Component Transparency, Third Edition is not ready but I would like to have your comments about the refactoring, particularly about class/subclassing, naming of parameters and things, and any potential break of backward compatibility. May be it would be nice as well if I can try if current code pass the CI checks on GitHub. Will put this to draft afterwards. Thank you. |
Thanks @bact Overall structure LGTM - but my expertise is not Python, so take my feedback with a grain of salt. I just approved the workflows - so they are running now. I haven't had a chance to review in detail - I'll try to look in more detail over the next week or so |
Thank you Gary. Not need to rush, I still working on this. I will turn this to draft. |
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
This looks great to me. Wow! I like it. I don't have anything to add at the moment. If the current tests are passing, then I'm a happy reviewer. |
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Also add a test data for missing concluded license Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
To fix import-error Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
We have to keep these for backward compatibility. Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
@bact: I begin paternity leave later today. If you want a review sometime today, please say something. I notice the build isn't passing, at the time of me writing this message, so I thought it might be best for me to hold off on a review. |
Signed-off-by: Arthit Suriyawongkul <[email protected]>
@jspeed-meyers I found a bug in my TagValue test data and I think it may take some time for me to figure that out. Trying to work on this as much as possible this afternoon but please don't worry about this. This can be waited. Please enjoy your leave :) |
Signed-off-by: Arthit Suriyawongkul <[email protected]>
TagValue is specific about casing of true/false Signed-off-by: Arthit Suriyawongkul <[email protected]>
To fix pylint warnings Signed-off-by: Arthit Suriyawongkul <[email protected]>
@jspeed-meyers I think I have found the bug in my test data. The boolean values in Tag/Value format are case sensitive and have to be exactly "true" or "false" (and not "True", "False", etc). So that make the test of concluded licenses failed at an irrelevant point. Fixed now. All tests are passed. If you have time today and feel like to review please kindly go ahead. If not, we still have a lot of time after you come back. Happy new year. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I admit to a hasty review. This looks good to me. @goneall: Would you please review too? It might be worthwhile to get one more reviewer to take a look too.
This is a large code and I admit to being overwhelmed while reviewing it, partly because I have too little time to review it properly.
Nice, @bact!
@@ -1,3 +1,12 @@ | |||
# SPDX-FileCopyrightText: 2024 SPDX contributors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding these SPDX file headers!
parser.add_argument( | ||
"--comply", | ||
choices=["fsct3-min", "ntia"], | ||
default="ntia", | ||
help="Specify which compliance standard to check against", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Thank you. Yes, it is a very large change and addition. Maybe it's better to take more time to review. I guess we can advertise that the addition of FSCTv3 is experimental, not guaranteed its completeness yet, and open for wider review. So this PR main contribution should be about restructuring the codebase to allow more compliance checkers in the future. And the priority is to keep the behavior of the NTIA minimum checker. Improvements can be made further to refine the completeness of FSCTv3 checker. And at some point we can advertise that it is supported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Went through a bit more carefully and did not notice any issues. Overall, LGTM.
I'm not particular sure about the use of the word "comply" (as used in the option "--comply"), "compliance", "conformance", "standard", "document", "specification", etc. that I may put inside the printing message/code comment, and also the README (#226), whether they have a specific/different meaning or preference within this project. Please flag any misuse or inconsistency. Thank you. |
I'm not the best to comment on the best term - I've been in meetings where participants expressed strong opinions, but I'm personally OK comply and compliance. In SPDX, we settled on "conformance" for the profile compliance term. Based on this one datapoint, conformance may be a less controversial choice. I think that is an OMG term if I recall correctly. I don't know if @kestewart has any feedback from the framing document work in terms of a preferred term. |
Objective
To add the compliance check of the Common SBOM Baseline Attributes, as outlined in "Framing Software Component Transparency, Third Edition" https://www.cisa.gov/resources-tools/resources/framing-software-component-transparency-2024
To resolve #214
What this PR do?
SbomChecker
class:NTIAChecker
BaseChecker
SbomChecker
now acts as a "dispatcher" or a factory that returns a subclass ofBaseChecker
based on the given "compliance" argument during instantiation.NTIAChecker
to maintain backward compatibilitySbomChecker
is expected to behave the same.BaseChecker
contains common methods likeparse_file
print_components_missing_info
andoutput_json
. These methods' details are specific to compliance standards and have to be implemented in subclasses.NTIAChecker
, a subclass ofBaseChecker
FSCT3Checker
, a subclass ofBaseChecker
, contains functionalities specific to Framing Software Component Transparency, Third Edition check--comply
parameter:main.py
to add a new parameter for choosing a compliance standard to check. It has two choices "fsct3-min" and "ntia". Default value is "ntia" to maintain backward compatibility.sbomcheck
command for CLI:sbomcheck
to theproject.scripts
section inpyproject.toml
sbomcheck
to the machinebin/
directory and allows the user to callsbomcheck
from command line.prog="ntia-checker",
is removed frommain.py
. This allows theArgumentParser
to determine the actual program name.Please see the design document https://docs.google.com/document/d/1pueRxlxoM9n1eG9g6AihjLvybEBTd77m22mRYBQltpg/edit?usp=sharing for reference.
Test