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

feat: add kas parser #143

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

nejch
Copy link

@nejch nejch commented Oct 22, 2022

This is part 1 of adding a few git-based dependencies to trivy - see aquasecurity/trivy#3067. There is more context there, I'm not sure if this is the right place for a git-based parser so I'm happy to make changes, even if this code should live in another repo etc :)

An example real life kas file:
https://github.com/siemens/meta-iot2050/blob/master/kas/iot2050.yml

This PR is largely based on the pnpm parser PR as that had a similar yaml parser, though kas config files are even simpler.
I'll follow up on the trivy side with an analyzer, if this makes sense.

@CLAassistant
Copy link

CLAassistant commented Oct 22, 2022

CLA assistant check
All committers have signed the CLA.

@@ -22,6 +22,7 @@ require (
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
github.com/liamg/jfather v0.0.7 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/whilp/git-urls v1.0.0 // indirect
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how you'll feel about adding this little package. But still seemed better than manually parsing, especially if more git-based parsers are added later.

Comment on lines +54 to +57
version := repo.RefSpec
if version == "" {
version = "latest"
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I add the latest here because without a refspec, it will clone HEAD (like implicit latest in docker), so just wanted to ensure this still gets picked up for BOMs etc.

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.

2 participants