-
Notifications
You must be signed in to change notification settings - Fork 180
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
Scorecards collector/certifier #249
Comments
@nathannaveen Thanks for all your PRs and helping out the project! Would this issue be of interest to you? If so, i can spend some time to flesh out some details around a design. |
Yes, that would be interesting. I'm new to this project, so I might need some guidance. Thanks! |
hi @nathannaveen ! I've added more details on the issue. Let me know if you have more questions or if anything else i can do to clarify what the issue is asking for! |
Hi @lumjjb, thanks for the details! I have a few clarifications. When you say:
Do you mean to include another function in Including this additional function to When you say:
Do you mean to create something like: func NewScorecardQuery(repo string) certifier.QueryComponents {
return &packageQuery{
client: repo,
}
} Do we want to get Scorecard also has a REST API and a BigQuery data set, have we considered using these as well? Is there a reason not to, if so, why? Looks like there is work being done to query the BigQuery data set #214 we could potentially use some of that work to query scorecard data. What does the |
One of the things that can be done is to change to use an type Certifier interface {
// CertifyComponent takes the type Component and recursively scans each dependency
// aggregating the results for the top/root level artifact. As attestation documents are generated
// they are push to the docChannel to be ingested
CertifyComponent(ctx context.Context, rootComponent interface{}, docChannel chan<- *processor.Document) error
}
type QueryComponents interface {
// GetComponents runs as a goroutine to get the components that will be certified by the Certifier interface
GetComponents(ctx context.Context, compChan chan<- interface{}) error
} and use type assertion on // CertifyComponent takes in the root component from the gauc database and does a recursive scan
// to generate vulnerability attestations
func (o *osvCertifier) CertifyComponent(ctx context.Context, rootComponent interface{}, docChannel chan<- *processor.Document) error {
o.rootComponents = rootComponent.(*certifier.Component)
_, err := o.certifyHelper(ctx, o.rootComponents, docChannel)
if err != nil {
return err
}
return nil
} This will make it generic and can be used for anything. |
Yes that is correct. |
Thanks for your suggesions! Scorecard also needs a github API token which can be passed to |
Created a PR to make the certifier generic so it will make it easier for you to integrate scorecard. Will fix up the tests and merge soon. |
pr #340 merged. Should make it easier to integrate the scorecard collector :) |
@pxp928 Thanks! @lumjjb Could you please answer these questions because I am blocked?
|
@naveensrinivasan any thoughts on the best way to implement this for GUAC? Has there been more work done on the library side for scorecard? |
Hi @naveensrinivasan sorry for the delayed response!
The big query data set unfortunately is not complete, and so for the releases we looked at - for example, kubernetes the commits of the releases do not have a row in the dataset. In GUAC's case it needs the precision of the particular commit. You're right... having it use the binary may be a bit tricky... For now, perhaps let's use the library, and I will follow up with scorecard folks to see if they will be able to keep supporting it going forward. |
Hi @nathannaveen , i've assigned you the issue! Let us know if you have any more questions! |
@lumjjb Thank you, I have started working on it! |
Have a scorecards collector/certifier that based on a list of repos or git commit IDs will obtain score cards information and emit scorecard documents.
This issue is to create a an implementation of the Certifier interface, which will find artifacts within the graph, run scorecards on their repos/hash targets and produce the emit the scorecards data for ingestion.
This is similar to the OSV certifier, with the difference that:
QueryComponents
interface to be able to returnassembler.ArtifactNode
as wellCertify
functionscorecards
which will be almost an exact copy of the one for OSV certifier, which can be used for testing purposes.The out come is that let's say the graph has 3 artifact nodes
It should end up running scorecards on the 3 targets
And then emit the scorecards JSON documents to the doc channel (and it will be ingested in GUAC)
The PRs should pretty much follow closely something like #245 with the changes as mentioned above.
The text was updated successfully, but these errors were encountered: