-
Notifications
You must be signed in to change notification settings - Fork 116
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(rego): accept fs.FS for data #1191
Conversation
since trivy already support accepting rego data, maybe it better to enhance |
We need to load files, create a memory filesystem, and add the Go struct there, then we can pass it to Also, I think data is likely passed as a Go struct in the OPA world. It doesn't have to be a file. |
I've updated PR to accept |
lgtm |
@knqyf263 the idea seems fine to me but how will we expose this to the callers? More specifically, would any trivy flags would need to be changed OR internally instead of creating temp files, the caller would pass along something that implements fs.FS? |
Yes, but it would be simple. If the caller just wants to use defsec as before, they can use os.DirFS, which is a wrapper of a real file system. In Trivy, we create fs.FS for data like we already do for policy. |
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.
lgtm
4069377
to
6587822
Compare
Add a new option to pass the data file system so that the file system can be abstract.
aquasecurity/trivy#3578