-
Notifications
You must be signed in to change notification settings - Fork 7
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(schema): Add schema generation #32
Conversation
|
||
b := newBuilder() | ||
|
||
inputValue := reflect.ValueOf(state.State{}) |
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.
@nikpivkin state.State{}
comes from defsec today and is shared across trivy-iac and trivy-aws as well. It's one of those dependencies which is hard to get away from as it's shared between all of the components.
pkg/rules/register.go
Outdated
"github.com/aquasecurity/trivy-policies/pkg/types" | ||
) | ||
|
||
func Register(rule scan.Rule, f scan.CheckFunc) types.RegisteredRule { |
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.
This function is used to register Go rules. For example, https://github.com/aquasecurity/trivy-policies/blob/main/rules/cloud/policies/aws/s3/block_public_acls.go#L11. Maybe we should make Go rules in trivy-policies public and register them with trivy-iac? Or what should we do?
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.
Maybe we should make Go rules in trivy-policies public and register them with trivy-iac?
Yes that's the idea. I was planning for that happen via
Line 9 in 335c783
"github.com/aquasecurity/trivy-iac/pkg/rules" |
But it seems a couple of tests are failing at the moment. Upon investigating them it seems they don't seem to be registered Go rules, so an import somewhere is missing (which would trigger the registration of Go rules).
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.
@simar7 When importing rules, they are saved in the rules registry, which is located in trivy-policies. Therefore, importing rules is not enough.
@simar7 "github.com/aquasecurity/trivy-policies/pkg/rego"
"github.com/aquasecurity/trivy-policies/pkg/rego/embed" |
* bump defsec and trivy-policies * test: use embedded FS * refactor: use embedded FS to generate documentation * chore: bump defsec and trivy-policies * refactor: use registered rules as is
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.
Tested with Trivy.
No description provided.