Commit Graph

5059 Commits

Author SHA1 Message Date
Ashutosh Narkar 298f97d79d Prepare v0.64.1 release
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
v0.64.1
2024-04-26 11:20:43 -07:00
Shunsuke Suzuki faf6382367 ci: pin GitHub Actions macos runner version and build for darwin/amd64
Fixes: #6720

Signed-off-by: Shunsuke Suzuki <suzuki.shunsuke.1989@gmail.com>
(cherry picked from commit bf28d8e9dc)
2024-04-26 11:20:43 -07:00
Ashutosh Narkar e72e6f602a plugins/discovery: Update comparison logic for overrides
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
(cherry picked from commit bd969f3855)
2024-04-26 11:20:43 -07:00
Ashutosh Narkar 75cc90abee Prepare v0.64.0 release
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
v0.64.0
2024-04-25 10:05:57 -07:00
Ashutosh Narkar a400281406 server: Keep default decision path in-sync with manager's config
This change attempts to keep the default decision path used by the server
in sync with the one defined on the manager's config. Currently the
server only updates the default decision path when it's initialized and
when there is a commit on the store. The issue happens when the default
decision path is updated via the discovered config. In this case, the
manager's config is updated but there could be no store txn. Hence
the updated value of default decision path is not taken into account by
the server.

Fixes: #6697

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2024-04-24 12:06:09 -07:00
johndbro1 f2011b1bb0 Adding Raygun to the policy-testing ecosystem (#6712)
Signed-off-by: John Brothers <johnbr@gmail.com>
2024-04-24 20:07:15 +02:00
Johan Fylling b58e87f89b ast: Importing rego.v1 in v0 support modules when applicable (#6698)
Prioritizing generating v0 Rego with `rego.v1` import when producing support modules for non-`--v1-compatible` optimized builds.

Affects `opa build` when the `-O` flag is used for optimization, and `opa eval` for partial evaluation with the `-p` flag.

Fixes: #6450
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2024-04-24 19:02:30 +02:00
Ashutosh Narkar 44fa8ad64b Relax configuration check when Discovery is enabled
Previously if Discovery was enabled, other features like bundle downloading and status reporting could not be configured manually.
The reason for this was to prevent OPAs being deployed that could not be controlled through discovery. It's possible that
the system serving the discovered config is unaware of all options locally available in OPA. Hence, we relax the configuration
check when discovery is enabled so that the bootstrap configuration can contain plugin configurations. In case of conflicts,
the bootstrap configuration for plugins wins. These local configuration overrides from the bootstrap configuration are included
in the Status API messages so that management systems can get visibility into the local overrides.

**In general, the bootstrap configuration overrides the discovered configuration.** Previously this was not the case for all
configuration fields. For example, if the discovered configuration changes the `labels` section, only labels that are
additional compared to the bootstrap configuration are used, all other changes are ignored. This implies labels in the
bootstrap configuration override those in the discovered configuration. But for fields such as `default_decision`, `default_authorization_decision`,
`nd_builtin_cache`, the discovered configuration would override the bootstrap configuration. Now the behavior is more consistent
for the entire configuration and helps to avoid accidental configuration errors.

Fixes: #5722

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2024-04-23 15:32:37 -07:00
Johannes Larsson ef8532f228 auth: requestToken close response body
Signed-off-by: Johannes Larsson <johannes.a.larsson@gmail.com>
2024-04-23 13:43:49 -07:00
Ashutosh Narkar 8260697940 build: Update WASM Rego test generation setup (#6707)
This change updates the WASM Rego test generation docker
command to address CVE-2022-24765 in Git which could cause
it to execute arbitrary commands.

The error was seen when running the `make wasm-rego-test` target on
darwin/arm64.

Fixes: #6703

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2024-04-23 15:34:22 +02:00
Johan Fylling 091286b5b4 rego: Setting query Rego-version from configured imports
When `rego.v1` is in the list of imports directly applied on the `rego.Rego` SDK struct, this import, and it's effects, is applied to the query when parsed.
This change affects the `eval` and `bench` commands when the `--imports` flag is used.

Fixes: #6701

Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2024-04-22 14:19:22 -07:00
Philip Conrad 3954ba0c80 ci: Update Github Actions for Node 20. (#6670)
This commit updates the `upload-artifact` and `download-artifact`
Github actions to the latest version (v4), which should eliminate
the deprecation warning spam we're seeing in CI.

Note: We had to break up the merged "binaries" target into multiple,
smaller targets, which are grouped by OS for the `post-tag` and
`post-merge` workflows, and by OS + arch for the `pull-request`
workflow.

Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
2024-04-15 14:16:19 -04:00
Torin Sandall 93ff7191f1 docs/configuration: Tidy up headers in Services section (#6695)
Signed-off-by: Torin Sandall <torin@styra.com>
2024-04-13 04:58:26 +02:00
Johan Fylling 94724e612f docs: Updating OPA v1.0 docs
Documenting bundle rego-version.

Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2024-04-11 10:36:05 -07:00
Francisco Edno 8f551d9baa sdk: fix bug while activating v1 bundle with the bundle plugin (#6689)
Fixing issue where active parser options aren't propagated to module reload during bundle activation.

Signed-off-by: Francisco Rodrigues <ednofco@gmail.com>
2024-04-11 13:13:31 +02:00
Johan Fylling e23d771711 Add rego_version attribute to bundle manifest (#6579)
Adding a global `rego_version` attribute to bundle manifest, to inform OPA runtime about what rego-version (v0/v1) to use to parse/compile contained Rego files.
The rego-version of individual Rego files can be overridden through the `file_rego_versions` manifest attribute.

Implements: #6578

Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2024-04-10 19:06:07 +02:00
kunal.das ae636de8c0 fixes #6206; using cuboid rather than cube
Signed-off-by: kunal.das <kd.kunaldas92@gmail.com>
2024-04-10 09:10:56 -07:00
Johan Fylling e7e5b6bbfb deps: Improving deps command performance (#6688)
Improving memory footprint and execution time of deps command for policies with high dependency connectivity.

Fixes: #6685
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2024-04-09 19:24:37 +02:00
dependabot[bot] a94e585b0f build(deps): bump google.golang.org/grpc from 1.63.0 to 1.63.2
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.63.0 to 1.63.2.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.63.0...v1.63.2)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-09 09:43:10 -07:00
dependabot[bot] 5866c96e24 build(deps): bump github.com/containerd/containerd from 1.7.14 to 1.7.15
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.7.14 to 1.7.15.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v1.7.14...v1.7.15)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-08 09:06:31 -07:00
dependabot[bot] 8ad1a3f489 build(deps): bump golang.org/x/net from 0.23.0 to 0.24.0 (#6680) 2024-04-05 12:04:39 +00:00
Stephan Renatus c5ab20cc94 go.{mod,sum}: update (#6678)
This reflects the reality -- we hadn't been sure why the dependabot update had
not increased the stanza when it should have; but doing so now should unbreak
the nightly tests.

Signed-off-by: Stephan Renatus <stephan@styra.com>
2024-04-05 12:07:15 +02:00
Sean Williams e0ee7418b0 topdown: Add json.marshal_with_options() builtin for indented/"pretty-printed" and/or line-prefixed JSON (#6636)
Fixes #6630

Signed-off-by: Sean Williams <72675818+sean-r-williams@users.noreply.github.com>
2024-04-05 10:11:01 +02:00
Charlie Egan a1cefe20cd server: Retry cert reloading & test case step
In workflow runs like this:
https://github.com/open-policy-agent/opa/actions/runs/7803493290/job/21283458848#step:3:317

We can see two problems. This commit is meant to address them.

First, the test failed with this message:

```
expected unknown certificate authority error but got: Get "https://127.0.0.1:38699/v1/data": write tcp 127.0.0.1:52786->127.0.0.1:38699: write: connection reset by peer
```

Now this step in the test is retried like the other steps in the test
since it can fail too.

Second, the error `failed to reload TLS config` appears many times in
the logs for that test. This issue is caused by the server attempting to
read the new cert, key, and CA contents from disk while they are still
being written to. This PR also introduces a 100ms pause between upto 5
attempts to reload the config for any given change to the state on disk.
This should mean that the error is seen only when is is actually an
issue and the reload has failed after a reasonable time. In most cases,
running locally, the reload happens without error on the first run.

Signed-off-by: Charlie Egan <charlie@styra.com>
2024-04-04 12:38:48 -07:00
dependabot[bot] d1821df86a build(deps): bump github.com/prometheus/client_model from 0.5.0 to 0.6.1
Bumps [github.com/prometheus/client_model](https://github.com/prometheus/client_model) from 0.5.0 to 0.6.1.
- [Release notes](https://github.com/prometheus/client_model/releases)
- [Commits](https://github.com/prometheus/client_model/compare/v0.5.0...v0.6.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_model
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-04 10:17:19 -07:00
dependabot[bot] 0a19e454cf build(deps): bump google.golang.org/grpc from 1.62.1 to 1.63.0 (#6673)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.62.1 to 1.63.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.62.1...v1.63.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-04 12:28:28 +02:00
dependabot[bot] a52a897e0f build(deps): bump golang.org/x/net from 0.22.0 to 0.23.0 (#6671)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0.
- [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-04 10:35:04 +02:00
Stephan Renatus 457305a0a7 build(go): bump 1.22.1 -> 1.22.2 (#6672)
https://go.dev/doc/devel/release#go1.22.2

Signed-off-by: Stephan Renatus <stephan@styra.com>
2024-04-04 10:25:26 +02:00
Teemu Koponen 8fde8264d7 server: Remove unnecessary AST-to-JSON conversions.
This time for v0QueryPath, v1DataGet, and v1DataPost.

Signed-off-by: Teemu Koponen <koponen@styra.com>
2024-04-03 16:33:37 -07:00
Philip Conrad 88eaaa93ad compile/compile: Fix panic from CLI + metadata entrypoint overlaps.
This commit fixes a panic that could occur when `opa build` was provided
an entrypoint from both a CLI flag, and via entrypoint metadata
annotation.

The fix is simple: deduplicate the slice of entrypoint refs that the
compiler uses, before compiling WASM or Plan targets.

Fixes: #6661

Co-authored-by: Daniel Herzig <danielherzig96@gmail.com>
Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
2024-04-03 16:13:17 -07:00
Francisco Rodrigues e0060ce6a1 sdk: expose manager options
This commit adds the possibility to configure the plugin manager with
custom options.

It will allow SDK users to override the options already provided by the
SDK and to futher customize it with configurations that were not
previously available. This is an advanced feature as it requires
some knowledge about the inner workings of OPA.

One use case for this is to provide a prometheus registerer and have the
status plugin metrics available for the client to use it in a
/metrics endpoint, for example.

resolves #6662

Signed-off-by: Francisco Rodrigues <ednofco@gmail.com>
2024-04-03 14:58:56 -07:00
Teemu Koponen 27d6829d4c server: Remove an unnecessary AST-to-JSON conversion for the eval input.
The cost of this can become non-trivial with larger inputs.

Signed-off-by: Teemu Koponen <koponen@styra.com>
2024-04-03 12:40:40 -07:00
Charlie Egan 9a13941ab9 docs: Add Rego comparisons and update env0 (#6663)
These integrations feature on the learning rego page and the terraform
pages respectively.

Signed-off-by: Charlie Egan <charlie@styra.com>
2024-04-03 13:26:13 +01:00
Yariv Gavriel 8812c64270 add env0 integration & organization files (#6658)
Signed-off-by: yarivg <yarivgavriel2@gmail.com>
2024-04-03 12:18:52 +02:00
dependabot[bot] 87d4b1cc81 build(deps): bump peaceiris/actions-hugo from 2 to 3
Bumps [peaceiris/actions-hugo](https://github.com/peaceiris/actions-hugo) from 2 to 3.
- [Release notes](https://github.com/peaceiris/actions-hugo/releases)
- [Changelog](https://github.com/peaceiris/actions-hugo/blob/main/CHANGELOG.md)
- [Commits](https://github.com/peaceiris/actions-hugo/compare/v2...v3)

---
updated-dependencies:
- dependency-name: peaceiris/actions-hugo
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-02 14:16:12 -07:00
Ashutosh Narkar 599b2f4fdb Refresh maintainers term
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2024-04-02 14:10:02 -07:00
dependabot[bot] e866481630 build(deps): bump aquasecurity/trivy-action from 0.18.0 to 0.19.0
Bumps [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action) from 0.18.0 to 0.19.0.
- [Release notes](https://github.com/aquasecurity/trivy-action/releases)
- [Commits](https://github.com/aquasecurity/trivy-action/compare/0.18.0...0.19.0)

---
updated-dependencies:
- dependency-name: aquasecurity/trivy-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-28 10:06:40 -07:00
Johan Fylling 1074b6b6de Prepare v0.64.0 development
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2024-03-28 09:46:01 -07:00
Johan Fylling bb30b15369 Prepare v0.63.0 release (#6656)
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
v0.63.0
2024-03-28 16:50:15 +01:00
Charlie Egan b705d5b4ae docs: Clear up some uses of future keywords (#6653)
- link to the OPA v1.0 doc to add more context to the rego.v1 notes
- CONTINUED to use
  https://www.openpolicyagent.org/docs/latest/policy-language/#future-keywords
  as the source of truth for notes about future keywords.
- Removed some old style examples.

Signed-off-by: Charlie Egan <charlie@styra.com>
2024-03-28 14:21:55 +01:00
Anders Eknert a7d27ef1ff Add Rego v1 keywords (#6649)
Let me know if these should be in a box of their own — my reasoning
was that they should be avoided even prior to that, so if people won't
use them as var names or whatever, all the better.

Signed-off-by: Anders Eknert <anders@eknert.com>
2024-03-28 11:27:38 +01:00
Ashutosh Narkar d3a4a87f50 plugins/rest: Update service name while generating signature
The service name used for signing the request must be same as
the host header which is of the form https://sts.*

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2024-03-27 12:08:00 -07:00
Ashutosh Narkar 630b74683a download: Surface bundle download errors via debug logging
This change logs the error response body at debug level.
Since the errors could contain senstive info we don't
include them in the status message. So this approach helps to
get more information about the error at debug log level which
is mostly used in a non-prod setup.

Fixes: #6609

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2024-03-27 09:54:44 -07:00
Yogesh Sinha ea0dc0209c Adding a new function crypto.x509.parse_and_verify_certificates_with_options. Fixes #5882 (#6643)
Signed-off-by: Yogesh Sinha <sinhayogi@gmail.com>
2024-03-27 13:50:44 +00:00
Ashutosh Narkar 5f16f4a238 plugins/rest: Add support to get temp creds via AssumeRole
Adds support for signing AWS requests using temporary credentials
obtained from AWS STS via AssumeRole operation. One use-case of
this mechanism is for allowing existing IAM users to access AWS resources
that they don't already have access to. It is also useful as a means to
temporarily gain privileged access.

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2024-03-26 15:29:09 -07:00
0marq 6c08d3fa15 docs: Update delta bundle patch doc for remove op
Update remove description to mention that target path must exist.

Signed-off-by: 0marq <45561584+0marq@users.noreply.github.com>
2024-03-26 13:28:58 -07:00
occupyhabit d6c8c1b51b chore: remove repetitive words
Signed-off-by: occupyhabit <wangmengjiao@outlook.com>
2024-03-25 11:28:12 -07:00
Johan Fylling 143a8e6ac9 topdown: Fixing overactive Early Exit suppression
Fixing two issues where Early Exit was being suppressed when it shouldn't have been:

1. A cache hit for a rule/function discards EE for the call-site.
2. Non-EE rule/func discards EE for call-site.

Fixes: #6566
2024-03-21 19:34:33 +01:00
Ashutosh Narkar 629669e275 ADOPTERS.md: Add Facets.cloud to the list
Fixes: #6640

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2024-03-20 09:49:04 -07:00
Adam Setch fa5c72b36b docs: fix typo (#6637)
Signed-off-by: Adam Setch <adam.setch@outlook.com>
2024-03-18 20:59:22 +01:00