-
Notifications
You must be signed in to change notification settings - Fork 492
fix(deps): update module github.com/open-policy-agent/opa to v1.12.1 #3246
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
fix(deps): update module github.com/open-policy-agent/opa to v1.12.1 #3246
Conversation
ℹ Artifact update noticeFile name: cli/go.modIn order to perform the update(s) described in the table above, Renovate ran the
Details:
|
|
/gcbrun |
Summary of ChangesHello @renovate-bot, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request performs a significant update of the github.com/open-policy-agent/opa module from version v1.6.0 to v1.9.0. This upgrade brings a range of new capabilities, including the ability to compile Rego queries into SQL filters, improved rule indexing for more efficient policy evaluation, and enhanced SDK extensibility. Additionally, it incorporates support for EdDSA signatures in JWT built-ins and updates the project's Go version along with various other indirect dependencies, ensuring the project benefits from the latest features, performance improvements, and security fixes. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request updates the github.com/open-policy-agent/opa dependency from v1.6.0 to v1.9.0. This is a significant update, and I've highlighted a couple of points to be aware of. Specifically, the OPA update itself spans several minor versions with notable changes to the Go SDK, which warrants careful testing. Additionally, this update causes a downgrade of the transitive dependency go.uber.org/multierr, which could have unforeseen consequences. Please review the specific comments and ensure comprehensive testing is performed before merging.
77ddaf0 to
a98a5f8
Compare
|
/gcbrun |
a98a5f8 to
775b743
Compare
|
/gcbrun |
775b743 to
74d90e7
Compare
|
/gcbrun |
74d90e7 to
fccb6a2
Compare
|
/gcbrun |
fccb6a2 to
6a3964b
Compare
|
/gcbrun |
6a3964b to
e10b769
Compare
|
/gcbrun |
e10b769 to
5961565
Compare
|
/gcbrun |
5961565 to
f9501c3
Compare
|
/gcbrun |
f9501c3 to
6ba3ee3
Compare
|
/gcbrun |
6ba3ee3 to
c904155
Compare
|
/gcbrun |
c904155 to
1079441
Compare
|
/gcbrun |
1079441 to
bf28e6e
Compare
|
/gcbrun |
b299e70 to
d9c5ab0
Compare
|
/gcbrun |
d9c5ab0 to
dc067ab
Compare
|
/gcbrun |
dc067ab to
dafb322
Compare
|
/gcbrun |
|
/gcbrun |
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. |
|
/gemini review |
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.
Code Review
This PR updates the OPA dependency from v1.6.0 to v1.12.1. The API migration in cli/report/report.go is correct. However, I've identified a potential panic in the findReports function if a Rego query returns no results. I've added a comment with a suggestion to make the code more robust.
|
/gcbrun |
Adds a check for empty result sets from OPA evaluation to prevent panics when no documents are returned. Includes a regression test.
2c966a8 to
9d97c41
Compare
|
/gcbrun |
Fixes errcheck lint error found by golangci-lint.
|
/gcbrun |
|
/gemini review |
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.
Code Review
This pull request updates the github.com/open-policy-agent/opa dependency from v1.6.0 to v1.12.1. The changes include necessary API migrations for the updated dependency, a bug fix to prevent a panic when OPA evaluation yields no results, and a new test to cover this fix.
The changes are well-implemented and improve the robustness of the code. I've added a few suggestions to further improve code clarity and follow idiomatic testing practices in Go.
|
/gcbrun |
|
/gemini review |
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.
Code Review
This pull request updates the github.com/open-policy-agent/opa dependency from v1.6.0 to v1.12.1, a significant version jump. The code changes correctly adapt to breaking changes in the OPA SDK, specifically by updating the file loading mechanism. A crucial improvement is the added check for empty result sets from Rego evaluations, which prevents a potential panic and is well-covered by a new test case. The changes are well-implemented and improve the robustness of the reporting functionality.
This PR contains the following updates:
v1.6.0→v1.12.1Release Notes
open-policy-agent/opa (github.com/open-policy-agent/opa)
v1.12.1Compare Source
This bug fix release reverts a change to
regex.replacethat unintentionally changed its behaviour for anchored regular expressions.regex.replacerespect cancellation" (authored by @srenatus)v1.12.0Compare Source
This release contains a mix of new features, performance improvements, and bugfixes. Notably:
String Interpolation (#4733)
The Rego language has been extended to support String Interpolation,
which provides a readable means to compose strings containing dynamic values determined at evaluation time.
An interpolated string is composed of a template-string containing zero or more template-expressions that evaluates to a value at evaluation time.
The
$character prefix identifies a template-string, and template-expressions are declared by being enclosed in curly-braces ({,}).Additionally,
undefinedtemplate-expression values don't halt evaluation; instead,<undefined>will be injected into the generated string.{ "deny": [ "User <undefined>'s role was 'guest', but must be one of [\"admin\", \"employee\"]" ], }String interpolation is a more readable and less error-prone substitute for the
sprintfbuilt-in function.Authored by @johanfylling reported by @anderseknert
Runtime, SDK, Tooling
someandevery(#8105, #8131, #8138) authored by @charlieegan3regex.replacerespect cancellation (#8089) authored by @srenatusreplaceandstrings.replace_nrespect cancellation (#8089) authored by @srenatusconcat(#8090) authored by @srenatusCompiler, Topdown and Rego
Docs, Website, Ecosystem
Miscellaneous
v1.11.1Compare Source
This is a bugfix release:
Memory exhaustion via forged gzip header
A crafted HTTP request any of OPA's HTTP endpoints would lead OPA to use a large amount of memory, triggering
an out-of-memory process exit.
This weakness in OPA's HTTP API gzip handling is as old as the gzip handling itself. A configurable limit was introduced in v0.67.0, but it has been shown that this security measure wasn't sufficient to avoid running out of memory in memory-constrained setups.
Thanks to @thevilledev for reporting and fixing this issue.
It only applies to OPA running as server (as a binary or in a container, as "sidecar"). To trigger an OOM process exit using this weakness, an adversary must be able to send an HTTP request directly to OPA. This would be the case if they are in the same network, there is no proxy in front of OPA, or if OPA was exposed to the internet, which is advised against.
By the nature of HTTP encodings, this would be effective before token-based authentication and authorization policies, so these measures do not protect against the attack vector.
If all OPA endpoints are using TLS-based authentication (mutual TLS, "mTLS"), then an adversary cannot do harm with this method.
Please note that while we're taking all of these issues seriously, OPA isn't designed for adversary environments. It's strongly advised not to expose any of its endpoints to the public internet. Furthermore, available security measures should be applied regardless, for a defense in depth approach. See the documentation for the available means of authentication and authorization in OPA.
Please also check out our Security Policy for reporting critical issues and bugs.
Decision Logs dropped (introduced in OPA v1.9.0)
When the decision logs buffer was uploaded, the buffer limit inadvertently got reset to the default upload limit (32kb).
This causes logs to be dropped that shouldn't have been dropped.
This default is overridden by the configuration value
decision_logs.reporting.upload_size_limit_bytes, see the docs on decision logs.There's a Prometheus metric for dropped events,
counter_decision_logs_dropped_buffer_size_limit_bytes_exceeded,and you can check that for unexpectedly high counts.
Reported by @johanneslarsson #8123, fixed by @sspaink.
The release is otherwise identical to v1.11.0.
v1.11.0Compare Source
This release contains a mix of new features, performance improvements, and bugfixes. Notably:
http.sendbuilt-in functionImmutable Releases
Starting with this release, OPA releases are immutable for increased security.
Runtime, SDK, Tooling
--ignoreinevalcmd when using bundle flag (--bundle) (#8062) authored by @sspainkCompiler, Topdown and Rego
http.Transportinhttp.sendbuilt-in (#7927) authored by @sykesmsync.Poolfor eval func objects (#8054) authored by @anderseknertDocs, Website, Ecosystem
Miscellaneous
StringOperandByteSlicehelper (#8048) authored by @anderseknertBenchmarksworkflow (#8072) authored by @srenatusv1.10.1Compare Source
This is a bugfix release for the
splitbuiltin: In v1.10.0, it was looping infinitely when used with an empty-string delimiter.Reported by @SignalRichard, authored by @srenatus
The release is otherwise identical to v1.10.0.
v1.10.0Compare Source
This release contains a mix of new features, performance improvements, and bugfixes. Notably:
--fail-on-emptyflag foropa testIS NOT NULLquery statements in the Compile APINon-static OPA binaries for linux/arm64 and darwin/arm64
Starting with this release, OPA will ship non-static arm64 executables for linux and darwin.
These binaries have support for Wasm evaluation.
Furthermore, the openpolicyagent/opa:latest docker image is a multi-platform image with arm64 support.
Runtime, Tooling
opa test --fail-on-emptyto allow making bad-ror empty folders fail (#7943) reported and authored by @grosserwithkeyword (#7942) authored by @sspainkReadMaybeCompressedBody(#7966) authored by @anderseknertCompiler, Topdown and Rego
undeclarederror when printing nested comprehension (#7647) authored by @schmitd reported by @charlesdanielseval.Timeterm (#7968) authored by @anderseknertsplitbuilt-in calls (#7962) authored by @anderseknertDocs, Website, Ecosystem
CLI ReferencetoOperationsin TOC (#8001) authored by @johanfyllingMiscellaneous
GracefulShutdownPeriod(#7991) authored by @rMaxiQphttp.DefaultTransportfix toinit()(#7955) authored by @srenatusvendor/(#7975) authored by @srenatusThis is a major version update containing breaking API changes. If you're affected by this, please consult the tablewriter migration guide.
v1.9.0Compare Source
This release contains a mix of new features, performance improvements, and bugfixes. Notably:
Compile Rego Queries Into SQL Filters (#7887)
Compile API extensions with support for SQL filter generation previously exclusive to EOPA has been ported into OPA.
Example
With OPA running with this policy, we'll compile the query
data.filters.includeinto SQL filters:Example Request
{ "input": { "favorite": "pineapple" } }Example Response
{ "result": { "query": "WHERE fruits.name = E'pineapple'" } }See the documentation for more details.
Authored by @srenatus and @philipaconrad
Improved Rule Indexing For "Naked" Refs (#7897)
OPA's rule indexer is a means by which OPA can optimize evaluation performance.
Briefly, the indexer can in some cases determine that a rule won't successfully evaluate before it's evaluated based on the query input.
The indexer previously only considered terms in certain compound expressions, ignoring single terms; e.g. an expression containing a sole "naked" ref. This has now changed!
Example
Given a policy with an
allowrule containing two "naked" refs:input.fooandinput.bar:and the input document:
{ "foo": 1 }before this improvement, when evaluating the query
data.example.allow, we get the trace log:Here, we can see that the
allowrule is evaluated, but fails on theinput.barexpression, as it's referencing anundefinedvalue.With the improvement to the indexer, we instead get:
Where we can see that the
allowrule was never evaluated, since the input doesn't meet the conditions established by the indexer; i.e. bothinput.fooandinput.barmust havedefinedvalues.Authored by @srenatus
Runtime, Tooling
opa runwhen loading bundles in watch-mode (--watch) (#7870) authored by @sspaink reported by @johanfyllingCompiler, Topdown and Rego
numbers.range_stepbuilt-in error message (#7882) authored by @charlieegan3Docs, Website
everyandnotexamples (#7901) authored by @charlieegan3io.jwtandtimebuilt-ins (#7892) authored by @charlieegan3regexandstringbuilt-ins (#7890) authored by @charlieegan3Miscellaneous
v1.8.0Compare Source
This release contains a mix of new features, performance improvements, and bugfixes. Notably:
io.jwtbuilt-ins, including a newio.jwt.verify_eddsabuilt-in.EdDSA Support in built-ins (#7824)
Support for the EdDSA signing algorithm has been added to built-in functions in the
io.jwtnamespace.This introduces the new io.jwt.verify_eddsa built-in function, and adds EdDSA support for the following built-ins:
This feature benefited greatly from the groundwork laid by @lestrrat in (#7638). 👏 🎉 🥳
Authored by @johanfylling reported by @aromeyer
Runtime
cmd.RootCommanddefinition. (#7811) authored by @philipaconradFixing a breaking change to the go API introduced in OPA v1.7.0.
opa execparameters (#7850, #7840) authored by @srenatusFixing regressions introduced in OPA v1.7.0, where the
--fail-non-emptyand--stdin-inputflags were dropped."", discern from unset (#7831) authored by @srenatus reported by @ManuelNowackConfinaleTopdown
Object.Inserton existing key (#7820) authored by @anderseknertgithub.com/lestrrat-go/jwx/v3(#7638) authored by @lestrratDocs, Website
countdescription (#7836) authored by @charlieegan3Miscellaneous
TestCertReloadingless verbose (#7823) authored by @charlieegan3*-patchbuild targets (#7864) authored by @johanfyllingv1.7.1Compare Source
This is a bug fix release addressing two issues for users that include OPA's CLI in their own application's CLI:
cmdpackage (cmd.RootCommand)opa parsecommandv1.7.0Compare Source
This release contains a mix of new features, performance improvements, and bugfixes. Notably:
SDK Improvements
The OPA SDK/API has been improved to provide better extensibility an more points of integration for developers.
DefaultModuleLoader(#7794) authored by @srenatusQueryTracers,tracing.OptionsandCancelfromQueryContext(#7767) authored by @philipaconradTracingOptsintoEvalContext(#7778) authored by @srenatusExtraDiscoveryOptstoruntime.Params(#7766) authored by @srenatushttp.Flusher(#7772) authored by @srenatusuint64andfloat64metrics inrunBenchmark(#7761) authored by @srenatusRuntime, Tooling
AsBundle()(#7798) authored by @srenatusFactories()merge the factories (#7777) authored by @srenatusOPA will no longer send telemetry data when fetching the latest release version.
BatchDecisionIDfield to Decision Logs (#7791) authored by [@&#Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.