11 Commits

Author SHA1 Message Date
Johan Fylling a179a24c48 v1 API
All packages, except for `cmd` and `internal`, have been moved into a new `v1` root package.

Old packages are kept for backwards-compatibility reasons. All contained code is replaced with simple type aliases and proxy functions to `v1` implementations.

Old packages default to the Rego v0 syntax, new `v1` packages default to the Rego v1 syntax.

Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2024-12-12 15:27:34 +01:00
Johan Fylling 7bb6dbe36b Preparing for v1 API
Moving (most) source to v1 root package to prepare for v0/v1 API separation.

Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2024-12-12 15:09:03 +01:00
Sven Grosen e2721d3e01 Resurrect Workload Identity Work (#6802)
Add support for using Azure Workload Identity authentication.

Signed-off-by: Sven Grosen <svengrosen@gmail.com>
2024-07-01 20:02:06 +02:00
Johan Fylling 5464b005e8 Bumping golangci-lint to v1.59.1 (#6817)
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2024-06-19 15:13:43 +02:00
Evgenii Baranov f2ffbd6427 plugins/rest: Do local map modification in OAuth2 client credentials flow
Fixes: #6769

Signed-off-by: eubaranov <evgeniy.baranov@deliveryhero.com>
2024-05-30 09:54:54 -07:00
Grégoire Payen de La Garanderie d5265896de Disable the Authorization header for ECR redirects.
ECR uses S3 pre-signed URLs for OCI blobs. If the ECR auth header is
added to the pre-signed URL, S3 returns a 400 error.

We address the issue by checking whether the request host matches
the one specified in the OCI configuration.

Signed-off-by: Grégoire Payen de La Garanderie <gregoire.payen.de.la.garanderie@intel.com>
2024-05-09 14:37:51 -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 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
Ashutosh Narkar 919b290ef7 plugins: Surface AWS authentication error details
OPA supports multiple AWS authentication methods. Currently
on an unsuccessful authentication, OPA logs the error at the debug
level. It would be helpful especially in a prod env to surface these
errors via the Status API to assist with debugging issues. This change
attempts to achieve that.

Fixes: #6232

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2023-09-25 10:54:55 -07:00
Prasanth Ullattil db2f8ae7bb Add AWS KMS support for OAuth2 Client Credentials JWT authentication
This implementaion adds new configuration properties to "oauth2"
aws_kms: AWS KMS key details
aws_signing: Infomation for signing AWS requestion, similar to s3_signing

References:
1) https://github.com/go-jose/go-jose/blob/v3/asymmetric.go#L501
2) https://github.com/codelittinc/gobitauth/blob/master/sign.go#L101

Signed-off-by: Prasanth Ullattil <prasanth.ullattil@dnb.no>
2023-07-03 11:01:15 -07:00
DerGut b626a2c93b Use existing auth plugins with OCIDownloader
This change addresses solutions 2) and 3) of the related issue #5553.
It mainly starts using the (now exposed) `Config.AuthPlugin()` function
of the `rest` package in the `download.OCIDownloader`. This allows it
to use any `HTTPAuthPlugin` that is defined in the `Config.Credentials`
section and makes it much more consistent with behavior of the
`download.Downloader` and potential other uses of the rest package.

Fixes #5553

Signed-off-by: DerGut <jannik.steinmann@gmx.de>
2023-04-25 17:15:46 -07:00