Skip to content

[enh] Add opa_image Dockerfile build argument - #322

Merged
asafc merged 2 commits into
permitio:masterfrom
tibotix:opa-full-docker-image-build-arg
Nov 20, 2022
Merged

asafc merged 2 commits into
permitio:masterfrom
tibotix:opa-full-docker-image-build-arg

Conversation

@tibotix

@tibotix tibotix commented Nov 12, 2022

Copy link
Copy Markdown
Contributor

This is an improvement on top of #316 .

This PR changes the opa_tag Docker build argument to the opa_image Docker build argument.

The opa_image build argument allows for arbitrary docker images to be included in the opal standalone client as opposed to only an arbitrary tag. This makes it easier to integrate custom builds of opa within the opal-client by allowing to specify a different docker image repository other than the official openpolicyagent/opa repository. Custom opa builds may be needed for custom opa plugin integration.

This build argument allows for arbitrary docker images to be included in
the opal standalone client. This makes it easier to integrate a custom build
of opa within the opal-client.
@netlify

netlify Bot commented Nov 12, 2022 •

Copy link
Copy Markdown

✅ Deploy Preview for opal-docs canceled.

Name Link
🔨 Latest commit e780a27
🔍 Latest deploy log https://app.netlify.com/sites/opal-docs/deploys/637269e91601150008d4223e

@orweis
orweis requested a review from orishavit November 13, 2022 13:54
@orishavit

Copy link
Copy Markdown
Contributor

Hi @tibotix - thanks for the PR! I fear that this might be a bit of security risk - @asafc wdyt?

@tibotix

tibotix commented Nov 14, 2022

Copy link
Copy Markdown
Contributor Author

This is as secure as the input to the build argument opa_image is.
I understand your concerns, but do not think that this poses a high security risk, given the assumption that the input to the opa_image build argument is correctly parsed.

One thing we could do here though, is to split opa_image into 2 separate build arguments opa_image and opa_tag.
opa_image would contain the default string openpolicyagent/opa.
opa_tag would contain the default string latest-static.
The docker image reference would then be constructed using docker://${opa_image}:${opa_tag}.
In this way one who only want to change the official opa tag, could only use the opa_tag build argument and is safe again, as the opa_image build argument does not need to be specified and defaults to openpolicyagent/opa.

@tibotix

tibotix commented Nov 20, 2022

Copy link
Copy Markdown
Contributor Author

@orishavit I've added the opa_tag argument again to ensure a more fine grained control over the opa docker image source repository. Any updates on wether this can be merged? Please let me know :)

@asafc
asafc merged commit 9103043 into permitio:master Nov 20, 2022
EliMoshkovich added a commit that referenced this pull request Oct 1, 2026
- skopeo copy picks the TARGET arch explicitly (--override-arch), so arm64
  stays correct even if the stage ever runs on the build platform. The
  documented opa_image/opa_tag build args (#322) keep working.
- Note the OPA 1.19-1.21 compiler tightenings that can reject a policy that
  compiled on 1.9.
- EOPA note: v1.45.1 is built with go1.25.4 on OPA v1.10.1, so the Go stdlib
  and OPA server fixes after those stay missing too, not just pgx.
- CI's real-binary argv tests now use OPA 1.21.1, the version the image ships.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EliMoshkovich added a commit that referenced this pull request Oct 27, 2026
…o v1.45.1 (verified download) to address CVEs (#906)

* fix(docker): bump OPA and EOPA versions to address CVEs

- OPA: 1.9.0-static -> 1.16.1-static (fixes CVE-2025-68121, golang/stdlib)
- EOPA: v1.44.0 -> v1.45.1 (latest available release)

Note: CVE-2026-33815 and CVE-2026-33816 (jackc/pgx/v5@5.7.6) remain
unresolved — EOPA v1.45.1 still ships pgx v5.7.6 (fix requires >= 5.9.0).
A new EOPA release from Styra is needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(docker): bump OPA to 1.21.1, verify the EOPA download, note EOPA is archived

- OPA 1.16.1 -> 1.21.1 (latest, built with Go 1.27.1).
- EOPA: check the downloaded binary against the release's checksums.txt
  (per arch); a mismatch now fails the build instead of shipping it.
- EOPA's upstream repo is archived, so v1.45.1 is the last release and the
  pgx CVEs it carries won't be fixed upstream. Replace the "waiting for
  Styra" TODO with that fact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(docker): review follow-ups for the OPA/EOPA bump

- skopeo copy picks the TARGET arch explicitly (--override-arch), so arm64
  stays correct even if the stage ever runs on the build platform. The
  documented opa_image/opa_tag build args (#322) keep working.
- Note the OPA 1.19-1.21 compiler tightenings that can reject a policy that
  compiled on 1.9.
- EOPA note: v1.45.1 is built with go1.25.4 on OPA v1.10.1, so the Go stdlib
  and OPA server fixes after those stay missing too, not just pgx.
- CI's real-binary argv tests now use OPA 1.21.1, the version the image ships.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* PER-14697: review: OPA 1.21.4 pinned by digest; user docs for the OPA upgrade and the EOPA caveat; arm64 binary stages in PR CI

- OPA 1.21.1 -> 1.21.4 (Go 1.27.3): 1.21.2 and 1.21.4 are Go security rebuilds,
  1.21.3 fixes GHSA-g2pf-6v5v-qcc8 (unsigned bundle accepted). tests.yml's real-binary
  tests use the same version, and their download retries.
- The default OPA image is pinned by digest (opa_digest). Overriding opa_tag needs
  the matching opa_digest, or an empty one; the build stops and says so otherwise.
- documentation/docs/tutorials/opa-version-migration.mdx: "OPA bundled in the client
  image", the three OPA 1.19/1.21 compiler changes that can reject a policy that
  loaded on 1.9, and how to check a policy repo with opa check before upgrading.
- The quickstart's eOPA section warns that upstream eOPA is archived and its image
  keeps unfixed vulnerabilities. The pgx comment describes the class, not a list.
- tests.yml: a binary-stages job builds opa-extractor and eopa-extractor for
  linux/amd64 and linux/arm64, so a wrong digest or checksum fails a PR, not a release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* PER-14697: docs: the OPA 1.20.0 and/or keywords and the 1.21.0 `in` type check

Both are in OPA's release notes (1.20.0 highlights; 1.21.0 changelog, #5658), and
both can stop a policy that loaded on 1.9 from compiling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* PER-14697: review: what opa check can't catch; the digest check reports a failed inspect as such; docker actions pinned by SHA

- Docs: the YAML 1.2 change moves out of the 'rejected at load' list into 'Not
  caught by opa check' (it changes data silently), with what to search for, the
  1.21.3 bundle-signing change for OPA config files, and a link to OPA's changelog
  1.10.0-1.21.4. The section no longer says rc.2 ships OPA 1.21.4.
- Dockerfile: the manifest goes to a file, so a failed skopeo inspect (rate limit,
  auth, missing tag) stops the RUN with skopeo's error instead of a digest mismatch
  on empty input; the message and comment name opa_image as well as opa_tag.
- tests.yml binary-stages: setup-qemu-action and setup-buildx-action pinned by SHA
  (v3.7.0, v3.12.0), the major on_release.yml uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

3 participants