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

topdown: deal with default functions #3505

Merged

Conversation

srenatus
Copy link
Contributor

They aren't supported, but they can lead to a situation where
ir.Empty() is false, but ir.Rules still has length 0.

Signed-off-by: Stephan Renatus stephan.renatus@gmail.com

@srenatus srenatus marked this pull request as draft May 28, 2021 12:45
@srenatus
Copy link
Contributor Author

external_test.go:97: expected {{"x": {"hello": false}}} but got {{"x": {"h": false, "hello": false}}}

Sure enough, the wasm tests need an exception here, because they implement the defaults differently.

@srenatus srenatus force-pushed the sr/issue-default-functions branch from 0d0e2e9 to e993550 Compare May 28, 2021 12:48
They aren't supported, but they can lead to a situation where
ir.Empty() is false, but ir.Rules still has length 0.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
@srenatus srenatus force-pushed the sr/issue-default-functions branch from e993550 to e8b1f3c Compare May 28, 2021 12:48
Copy link
Member

@tsandall tsandall left a comment

Choose a reason for hiding this comment

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

This is a strange edge case but I think we should cut a v0.29.3 bugfix release for this (since people may have deployed policies that are making use of this unsupported behaviour without realizing it.)

@srenatus srenatus marked this pull request as ready for review May 28, 2021 13:13
@srenatus srenatus merged commit 42c59b1 into open-policy-agent:main May 28, 2021
@srenatus srenatus deleted the sr/issue-default-functions branch May 28, 2021 13:18
rogeriopeixotocx added a commit to Checkmarx/kics that referenced this pull request Jun 18, 2021
Reverting PR #3503

These are the two queries failing:
https://github.com/Checkmarx/kics/blob/master/assets/queries/k8s/volume_mount_with_os_directory_write_permissions/query.rego
https://github.com/Checkmarx/kics/blob/master/assets/queries/terraform/kubernetes/volume_mount_with_os_directory_write_permissions/query.rego

We should check if this has anything to do with either:
open-policy-agent/opa#3501
open-policy-agent/opa#3505

*UPDATE*
This new query #3651 is failing after the update.
This might be related to this issue open-policy-agent/opa#3546

Signed-off-by: Rogério Peixoto <rogerio.peixoto@checkmarx.com>
rogeriopeixotocx added a commit to Checkmarx/kics that referenced this pull request Jun 18, 2021
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.

None yet

2 participants