Commit graph

3789 commits

Author SHA1 Message Date
Denis Mishin
db6449ecca
mcp: split mcp into server and client for better option grouping (#5666) 2025-06-24 10:21:32 -07:00
Kenneth Jenkins
d36c48a2bc
update Envoy to 1.34.1-rc1 (#5663) 2025-06-23 11:50:17 -07:00
Caleb Doxsey
5a12683c5c
config: add ssh settings (#5664) 2025-06-23 12:37:54 -06:00
Denis Mishin
f9e7308f12
mcp: add mcp_tool to ppl (#5662)
## Summary

Adds `mcp_tool` PPL criterion, that matches MCP tool names like 

```yaml
  - from: https://db.localhost.pomerium.io
    to: http://localhost:3000/mcp
    policy:
      allow:
        and:
          - email: 
              in: ["user@pomerium.com"]
          - mcp_tool:
              in: ["list_tables", "read_table", "search_records"]
    mcp: {}
```

## Related issues

Fix
https://linear.app/pomerium/issue/ENG-2393/mcp-authorize-each-incoming-request-to-an-mcp-route

## User Explanation

<!-- How would you explain this change to the user? If this
change doesn't create any user-facing changes, you can leave
this blank. If filled out, add the `docs` label -->

## Checklist

- [x] reference any related issues
- [x] updated unit tests
- [x] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review
2025-06-23 12:43:43 -04:00
Denis Mishin
55dd6ba7d0
mcp: send request body to authorize (#5660)
## Summary

In order to inspect the MCP requests and use the request payload in the
authorization decisions,
configure `ext_authz` to send the request payload as well. 

the body then would be available for inspection as it would contain the
json-rpc message like
```json
{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"_meta":{"progressToken":1},"name":"list_tables","arguments":{}}}
```

## Related issues

Ref:
https://linear.app/pomerium/issue/ENG-2393/mcp-authorize-each-incoming-request-to-an-mcp-route

## User Explanation

<!-- How would you explain this change to the user? If this
change doesn't create any user-facing changes, you can leave
this blank. If filled out, add the `docs` label -->

## Checklist

- [ ] reference any related issues
- [ ] updated unit tests
- [ ] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [ ] ready for review
2025-06-20 14:45:00 -04:00
dependabot[bot]
b0c2e2dede
chore(deps): bump the go group with 24 updates (#5638)
Bumps the go group with 24 updates:

| Package | From | To |
| --- | --- | --- |
| [cloud.google.com/go/storage](https://github.com/googleapis/google-cloud-go) | `1.53.0` | `1.55.0` |
| [github.com/VictoriaMetrics/fastcache](https://github.com/VictoriaMetrics/fastcache) | `1.12.2` | `1.12.4` |
| [github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2) | `1.79.3` | `1.80.0` |
| [github.com/docker/docker](https://github.com/docker/docker) | `28.1.1+incompatible` | `28.2.2+incompatible` |
| [github.com/exaring/otelpgx](https://github.com/exaring/otelpgx) | `0.9.1` | `0.9.3` |
| [github.com/google/go-jsonnet](https://github.com/google/go-jsonnet) | `0.20.0` | `0.21.0` |
| [github.com/jackc/pgx/v5](https://github.com/jackc/pgx) | `5.7.4` | `5.7.5` |
| [github.com/miekg/dns](https://github.com/miekg/dns) | `1.1.65` | `1.1.66` |
| [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) | `7.0.91` | `7.0.92` |
| [github.com/open-policy-agent/opa](https://github.com/open-policy-agent/opa) | `1.4.2` | `1.5.0` |
| [github.com/pires/go-proxyproto](https://github.com/pires/go-proxyproto) | `0.8.0` | `0.8.1` |
| [github.com/quic-go/quic-go](https://github.com/quic-go/quic-go) | `0.51.0` | `0.52.0` |
| [go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc](https://github.com/open-telemetry/opentelemetry-go-contrib) | `0.60.0` | `0.61.0` |
| [go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp](https://github.com/open-telemetry/opentelemetry-go-contrib) | `0.60.0` | `0.61.0` |
| [go.opentelemetry.io/contrib/propagators/autoprop](https://github.com/open-telemetry/opentelemetry-go-contrib) | `0.60.0` | `0.61.0` |
| [go.opentelemetry.io/otel/bridge/opencensus](https://github.com/open-telemetry/opentelemetry-go) | `1.35.0` | `1.36.0` |
| [go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc](https://github.com/open-telemetry/opentelemetry-go) | `1.35.0` | `1.36.0` |
| [go.opentelemetry.io/otel/exporters/otlp/otlptrace](https://github.com/open-telemetry/opentelemetry-go) | `1.35.0` | `1.36.0` |
| [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc](https://github.com/open-telemetry/opentelemetry-go) | `1.35.0` | `1.36.0` |
| [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp](https://github.com/open-telemetry/opentelemetry-go) | `1.35.0` | `1.36.0` |
| [go.opentelemetry.io/proto/otlp](https://github.com/open-telemetry/opentelemetry-proto-go) | `1.6.0` | `1.7.0` |
| [google.golang.org/api](https://github.com/googleapis/google-api-go-client) | `0.230.0` | `0.235.0` |
| [google.golang.org/genproto/googleapis/rpc](https://github.com/googleapis/go-genproto) | `0.0.0-20250428153025-10db94c68c34` | `0.0.0-20250528174236-200df99c418a` |
| [google.golang.org/grpc](https://github.com/grpc/grpc-go) | `1.72.0` | `1.72.2` |


Updates `cloud.google.com/go/storage` from 1.53.0 to 1.55.0
- [Release notes](https://github.com/googleapis/google-cloud-go/releases)
- [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/CHANGES.md)
- [Commits](googleapis/google-cloud-go@spanner/v1.53.0...spanner/v1.55.0)

Updates `github.com/VictoriaMetrics/fastcache` from 1.12.2 to 1.12.4
- [Release notes](https://github.com/VictoriaMetrics/fastcache/releases)
- [Commits](VictoriaMetrics/fastcache@v1.12.2...v1.12.4)

Updates `github.com/aws/aws-sdk-go-v2/service/s3` from 1.79.3 to 1.80.0
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](aws/aws-sdk-go-v2@service/s3/v1.79.3...service/s3/v1.80.0)

Updates `github.com/docker/docker` from 28.1.1+incompatible to 28.2.2+incompatible
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](moby/moby@v28.1.1...v28.2.2)

Updates `github.com/exaring/otelpgx` from 0.9.1 to 0.9.3
- [Release notes](https://github.com/exaring/otelpgx/releases)
- [Commits](exaring/otelpgx@v0.9.1...v0.9.3)

Updates `github.com/google/go-jsonnet` from 0.20.0 to 0.21.0
- [Release notes](https://github.com/google/go-jsonnet/releases)
- [Changelog](https://github.com/google/go-jsonnet/blob/master/.goreleaser.yml)
- [Commits](google/go-jsonnet@v0.20.0...v0.21.0)

Updates `github.com/jackc/pgx/v5` from 5.7.4 to 5.7.5
- [Changelog](https://github.com/jackc/pgx/blob/master/CHANGELOG.md)
- [Commits](jackc/pgx@v5.7.4...v5.7.5)

Updates `github.com/miekg/dns` from 1.1.65 to 1.1.66
- [Changelog](https://github.com/miekg/dns/blob/master/Makefile.release)
- [Commits](miekg/dns@v1.1.65...v1.1.66)

Updates `github.com/minio/minio-go/v7` from 7.0.91 to 7.0.92
- [Release notes](https://github.com/minio/minio-go/releases)
- [Commits](minio/minio-go@v7.0.91...v7.0.92)

Updates `github.com/open-policy-agent/opa` from 1.4.2 to 1.5.0
- [Release notes](https://github.com/open-policy-agent/opa/releases)
- [Changelog](https://github.com/open-policy-agent/opa/blob/main/CHANGELOG.md)
- [Commits](open-policy-agent/opa@v1.4.2...v1.5.0)

Updates `github.com/pires/go-proxyproto` from 0.8.0 to 0.8.1
- [Release notes](https://github.com/pires/go-proxyproto/releases)
- [Commits](pires/go-proxyproto@v0.8.0...v0.8.1)

Updates `github.com/quic-go/quic-go` from 0.51.0 to 0.52.0
- [Release notes](https://github.com/quic-go/quic-go/releases)
- [Commits](quic-go/quic-go@v0.51.0...v0.52.0)

Updates `go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc` from 0.60.0 to 0.61.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md)
- [Commits](open-telemetry/opentelemetry-go-contrib@zpages/v0.60.0...zpages/v0.61.0)

Updates `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp` from 0.60.0 to 0.61.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md)
- [Commits](open-telemetry/opentelemetry-go-contrib@zpages/v0.60.0...zpages/v0.61.0)

Updates `go.opentelemetry.io/contrib/propagators/autoprop` from 0.60.0 to 0.61.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md)
- [Commits](open-telemetry/opentelemetry-go-contrib@zpages/v0.60.0...zpages/v0.61.0)

Updates `go.opentelemetry.io/otel/bridge/opencensus` from 1.35.0 to 1.36.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](open-telemetry/opentelemetry-go@v1.35.0...v1.36.0)

Updates `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` from 1.35.0 to 1.36.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](open-telemetry/opentelemetry-go@v1.35.0...v1.36.0)

Updates `go.opentelemetry.io/otel/exporters/otlp/otlptrace` from 1.35.0 to 1.36.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](open-telemetry/opentelemetry-go@v1.35.0...v1.36.0)

Updates `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` from 1.35.0 to 1.36.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](open-telemetry/opentelemetry-go@v1.35.0...v1.36.0)

Updates `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` from 1.35.0 to 1.36.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](open-telemetry/opentelemetry-go@v1.35.0...v1.36.0)

Updates `go.opentelemetry.io/proto/otlp` from 1.6.0 to 1.7.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-proto-go/releases)
- [Commits](open-telemetry/opentelemetry-proto-go@v1.6.0...v1.7.0)

Updates `google.golang.org/api` from 0.230.0 to 0.235.0
- [Release notes](https://github.com/googleapis/google-api-go-client/releases)
- [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md)
- [Commits](googleapis/google-api-go-client@v0.230.0...v0.235.0)

Updates `google.golang.org/genproto/googleapis/rpc` from 0.0.0-20250428153025-10db94c68c34 to 0.0.0-20250528174236-200df99c418a
- [Commits](https://github.com/googleapis/go-genproto/commits)

Updates `google.golang.org/grpc` from 1.72.0 to 1.72.2
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.72.0...v1.72.2)

---
updated-dependencies:
- dependency-name: cloud.google.com/go/storage
  dependency-version: 1.55.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: github.com/VictoriaMetrics/fastcache
  dependency-version: 1.12.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
- dependency-name: github.com/aws/aws-sdk-go-v2/service/s3
  dependency-version: 1.80.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: github.com/docker/docker
  dependency-version: 28.2.2+incompatible
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: github.com/exaring/otelpgx
  dependency-version: 0.9.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
- dependency-name: github.com/google/go-jsonnet
  dependency-version: 0.21.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: github.com/jackc/pgx/v5
  dependency-version: 5.7.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
- dependency-name: github.com/miekg/dns
  dependency-version: 1.1.66
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
- dependency-name: github.com/minio/minio-go/v7
  dependency-version: 7.0.92
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
- dependency-name: github.com/open-policy-agent/opa
  dependency-version: 1.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: github.com/pires/go-proxyproto
  dependency-version: 0.8.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
- dependency-name: github.com/quic-go/quic-go
  dependency-version: 0.52.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc
  dependency-version: 0.61.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp
  dependency-version: 0.61.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: go.opentelemetry.io/contrib/propagators/autoprop
  dependency-version: 0.61.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: go.opentelemetry.io/otel/bridge/opencensus
  dependency-version: 1.36.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc
  dependency-version: 1.36.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace
  dependency-version: 1.36.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc
  dependency-version: 1.36.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp
  dependency-version: 1.36.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: go.opentelemetry.io/proto/otlp
  dependency-version: 1.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: google.golang.org/api
  dependency-version: 0.235.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: google.golang.org/genproto/googleapis/rpc
  dependency-version: 0.0.0-20250528174236-200df99c418a
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
- dependency-name: google.golang.org/grpc
  dependency-version: 1.72.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-17 09:36:50 -07:00
Denis Mishin
3cf420afc9
telemetry: backport component (#5655)
## Summary

Backport `telemetry.Component` that provides centralized tracing,
logging and metrics for operations.

## Related issues

<!-- For example...
- #159
-->

## User Explanation

<!-- How would you explain this change to the user? If this
change doesn't create any user-facing changes, you can leave
this blank. If filled out, add the `docs` label -->

## Checklist

- [ ] reference any related issues
- [ ] updated unit tests
- [ ] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [ ] ready for review

---------

Co-authored-by: Kenneth Jenkins <51246568+kenjenkins@users.noreply.github.com>
2025-06-16 13:10:51 -04:00
Caleb Doxsey
5ac7ae9c26
config: add circuit breaker thresholds (#5650)
## Summary
Add a new `circuit_breaker_thresholds` option:

```yaml
circuit_breaker_thresholds:
  max_connections: 1
  max_pending_requests: 2
  max_requests: 3
  max_retries: 4
  max_connection_pools: 5
```

This option can be set at the global level or at the route level. Each
threshold is optional and when not set a default will be used. For
internal clusters we will disable the circuit breaker. For normal routes
we will use the envoy defaults.

## Related issues
-
[ENG-2310](https://linear.app/pomerium/issue/ENG-2310/add-circuit-breaker-settings-per-route)

## Checklist
- [x] reference any related issues
- [x] updated unit tests
- [x] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review
2025-06-16 09:38:39 -06:00
Denis Mishin
e320a532de
ppl: add in string matcher (#5651)
## Summary

Adds `in` string matcher to PPL, that matches a string with an array of
strings.

## Related issues

Related: https://linear.app/pomerium/issue/ENG-2393

## User Explanation

<!-- How would you explain this change to the user? If this
change doesn't create any user-facing changes, you can leave
this blank. If filled out, add the `docs` label -->

## Checklist

- [x] reference any related issues
- [x] updated unit tests
- [x] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review
2025-06-13 22:50:07 -04:00
Denis Mishin
a66002eba6
pgxpool: enable metrics (#5653)
## Summary

Enables metrics for the `pgxpool` that is used by the PostgreSQL
databroker backend.
Metrics are updated at 1s interval. 
Will add the following metric output in the regular Prometheus
`/metrics` endpoint:

```
# HELP pomerium_pgxpool_acquire_duration_nanoseconds_total Total duration of all successful acquires from the pool in nanoseconds.
# TYPE pomerium_pgxpool_acquire_duration_nanoseconds_total counter
pomerium_pgxpool_acquire_duration_nanoseconds_total{db_client_connection_pool_name="localhost:5432/pomerium",db_system="postgresql",otel_scope_name="github.com/exaring/otelpgx",otel_scope_version="v0.9.1",hostname="MacBookPro"} 5.1058702e+07
# HELP pomerium_pgxpool_acquired_connections Number of currently acquired connections in the pool.
# TYPE pomerium_pgxpool_acquired_connections gauge
pomerium_pgxpool_acquired_connections{db_client_connection_pool_name="localhost:5432/pomerium",db_system="postgresql",otel_scope_name="github.com/exaring/otelpgx",otel_scope_version="v0.9.1",hostname="MacBookPro"} 0
# HELP pomerium_pgxpool_acquires_total Cumulative count of successful acquires from the pool.
# TYPE pomerium_pgxpool_acquires_total counter
pomerium_pgxpool_acquires_total{db_client_connection_pool_name="localhost:5432/pomerium",db_system="postgresql",otel_scope_name="github.com/exaring/otelpgx",otel_scope_version="v0.9.1",hostname="MacBookPro"} 91
# HELP pomerium_pgxpool_canceled_acquires_total Cumulative count of acquires from the pool that were canceled by a context.
# TYPE pomerium_pgxpool_canceled_acquires_total counter
pomerium_pgxpool_canceled_acquires_total{db_client_connection_pool_name="localhost:5432/pomerium",db_system="postgresql",otel_scope_name="github.com/exaring/otelpgx",otel_scope_version="v0.9.1",hostname="MacBookPro"} 0
# HELP pomerium_pgxpool_constructing_connections_milliseconds Number of connections with construction in progress in the pool.
# TYPE pomerium_pgxpool_constructing_connections_milliseconds gauge
pomerium_pgxpool_constructing_connections_milliseconds{db_client_connection_pool_name="localhost:5432/pomerium",db_system="postgresql",otel_scope_name="github.com/exaring/otelpgx",otel_scope_version="v0.9.1",hostname="MacBookPro"} 0
# HELP pomerium_pgxpool_empty_acquire_total Cumulative count of successful acquires from the pool that waited for a resource to be released or constructed because the pool was empty.
# TYPE pomerium_pgxpool_empty_acquire_total counter
pomerium_pgxpool_empty_acquire_total{db_client_connection_pool_name="localhost:5432/pomerium",db_system="postgresql",otel_scope_name="github.com/exaring/otelpgx",otel_scope_version="v0.9.1",hostname="MacBookPro"} 6
# HELP pomerium_pgxpool_idle_connections Number of currently idle connections in the pool.
# TYPE pomerium_pgxpool_idle_connections gauge
pomerium_pgxpool_idle_connections{db_client_connection_pool_name="localhost:5432/pomerium",db_system="postgresql",otel_scope_name="github.com/exaring/otelpgx",otel_scope_version="v0.9.1",hostname="MacBookPro"} 5
# HELP pomerium_pgxpool_max_connections Maximum size of the pool.
# TYPE pomerium_pgxpool_max_connections gauge
pomerium_pgxpool_max_connections{db_client_connection_pool_name="localhost:5432/pomerium",db_system="postgresql",otel_scope_name="github.com/exaring/otelpgx",otel_scope_version="v0.9.1",hostname="MacBookPro"} 10
# HELP pomerium_pgxpool_max_idle_destroys_total Cumulative count of connections destroyed because they exceeded MaxConnectionsIdleTime.
# TYPE pomerium_pgxpool_max_idle_destroys_total counter
pomerium_pgxpool_max_idle_destroys_total{db_client_connection_pool_name="localhost:5432/pomerium",db_system="postgresql",otel_scope_name="github.com/exaring/otelpgx",otel_scope_version="v0.9.1",hostname="MacBookPro"} 0
# HELP pomerium_pgxpool_max_lifetime_destroys_total Cumulative count of connections destroyed because they exceeded MaxConnectionsLifetime.
# TYPE pomerium_pgxpool_max_lifetime_destroys_total counter
pomerium_pgxpool_max_lifetime_destroys_total{db_client_connection_pool_name="localhost:5432/pomerium",db_system="postgresql",otel_scope_name="github.com/exaring/otelpgx",otel_scope_version="v0.9.1",hostname="MacBookPro"} 0
# HELP pomerium_pgxpool_new_connections_total Cumulative count of new connections opened.
# TYPE pomerium_pgxpool_new_connections_total counter
pomerium_pgxpool_new_connections_total{db_client_connection_pool_name="localhost:5432/pomerium",db_system="postgresql",otel_scope_name="github.com/exaring/otelpgx",otel_scope_version="v0.9.1",hostname="MacBookPro"} 6
# HELP pomerium_pgxpool_total_connections Total number of resources currently in the pool. The value is the sum of ConstructingConnections, AcquiredConnections, and IdleConnections.
# TYPE pomerium_pgxpool_total_connections gauge
pomerium_pgxpool_total_connections{db_client_connection_pool_name="localhost:5432/pomerium",db_system="postgresql",otel_scope_name="github.com/exaring/otelpgx",otel_scope_version="v0.9.1",hostname="MacBookPro"} 5
```

## Related issues

<!-- For example...
- #159
-->

## User Explanation

<!-- How would you explain this change to the user? If this
change doesn't create any user-facing changes, you can leave
this blank. If filled out, add the `docs` label -->

## Checklist

- [x] reference any related issues
- [x] updated unit tests
- [x] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review
2025-06-13 17:08:48 -04:00
Denis Mishin
777b3b12d2
mcp: client registration/token fixes (#5649)
## Summary

Fixes to MCP code registration and token requests. 

1. ease some requirements on fields that are RECOMMENDED 
2. fill in defaults
3. store both request and response in the client registration
4. check client secret in the /token request

## Related issues

- Fixes
https://linear.app/pomerium/issue/ENG-2462/mcp-ignore-unknown-grant-types-in-the-client-registration
- Fixes
https://linear.app/pomerium/issue/ENG-2461/mcp-support-client-secret-in-dynamic-client-registration
 
## User Explanation

<!-- How would you explain this change to the user? If this
change doesn't create any user-facing changes, you can leave
this blank. If filled out, add the `docs` label -->

## Checklist

- [x] reference any related issues
- [x] updated unit tests
- [x] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [ ] ready for review
2025-06-11 11:28:24 -04:00
Caleb Doxsey
200f2e8164
envoyconfig: add test for local reply (#5648) 2025-06-11 08:45:06 -06:00
Ross Smith
9311f98517
move mac build to mac-builds (#5633)
## Summary
In our efforts to sign and notarize binaries we want to consolidate
builds to a private repo for darwin. This moves the build to a workflow
in mac-builds, and moves goreleaser mac config to a separate file.


## Related issues

<!-- For example...
- #159
-->

## User Explanation

<!-- How would you explain this change to the user? If this
change doesn't create any user-facing changes, you can leave
this blank. If filled out, add the `docs` label -->

## Checklist

- [ ] reference any related issues
- [ ] updated unit tests
- [ ] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [ ] ready for review

---------

Co-authored-by: Kenneth Jenkins <51246568+kenjenkins@users.noreply.github.com>
2025-06-10 14:06:05 -04:00
Caleb Doxsey
80b6dae7b6
envoyconfig: add additional local reply mappers for gRPC (#5644)
## Summary
Refactor the local reply config to its own file, add support to the lua
function to detect gRPC requests, and add dedicated gRPC mappers for
response flags. I attempted to map the envoy error codes into things
that made sense for gRPC.

With grpcurl you'd see something like this:

```bash
$ grpcurl -v -vv -insecure example.com:443 list
Failed to list services: rpc error: code = Unavailable desc = {
  "requestId": "f9ce923a-4444-4a2a-9b60-12c86f82fe10",
  "status": "503",
  "statusText": "upstream_reset_before_response_started{remote_connection_failure|delayed_connect_error:_Connection_refused}"
}
```

Whereas previously it would render an HTML error.

## Related issues
-
[ENG-2426](https://linear.app/pomerium/issue/ENG-2426/core-error-formatting-for-grpc)

## Checklist

- [x] reference any related issues
- [x] updated unit tests
- [x] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review
2025-06-09 11:45:45 -06:00
Caleb Doxsey
5a8597b57b
cryptutil: fix normalize pem with certificate cycles (#5646)
## Summary
If a certificate was its own authority it would result in `NormalizePEM`
going into an infinite loop. This PR updates the code to avoid cycles
using a set.

## Related issues
-
[ENG-2423](https://linear.app/pomerium/issue/ENG-2423/enterprise-console-updatekeypair-check-is-too-restrictive)


## Checklist

- [x] reference any related issues
- [x] updated unit tests
- [ ] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review
2025-06-09 11:30:05 -06:00
Caleb Doxsey
4988aea751
fix pem normalization when file has no trailing newline (#5645) 2025-06-06 16:43:27 -06:00
Caleb Doxsey
9631d9ff1c
cryptutil: add a function to normalize PEM files so that leaf certificates appear first (#5642)
## Summary
Go requires that the first certificate in a bundle be the one associated
with a private key:

> LoadX509KeyPair reads and parses a public/private key pair from a pair
of files. The files must contain PEM encoded data. The certificate file
may contain intermediate certificates following the leaf certificate to
form a certificate chain. On successful return, Certificate.Leaf will be
populated.

I don't think Go is unusual in this regard, but to make the code more
tolerant, add a new `NormalizePEM` function which will take raw PEM data
and rewrite it so that leaf certificates appear first. This will be used
in zero and the enterprise console.

## Related issues
-
[ENG-2433](https://linear.app/pomerium/issue/ENG-2423/enterprise-console-updatekeypair-check-is-too-restrictive)

## Checklist
- [x] reference any related issues
- [x] updated unit tests
- [x] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review
2025-06-06 12:37:02 -06:00
Denis Mishin
6e765abe2e
mcp: ignore unknown fields in the client registration request (#5643)
## Summary

Some clients may send RFC7591 Client Registration Request with extra
fields that are not part of the spec, and we used too restrictive
decoder for that. This PR ignores the unknown fields.

## Related issues

<!-- For example...
- #159
-->

## User Explanation

<!-- How would you explain this change to the user? If this
change doesn't create any user-facing changes, you can leave
this blank. If filled out, add the `docs` label -->

## Checklist

- [ ] reference any related issues
- [ ] updated unit tests
- [ ] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [ ] ready for review
2025-06-04 18:27:04 -04:00
dependabot[bot]
37dc87b12f
chore(deps): bump the docker group in /.github with 3 updates (#5637)
Bumps the docker group in /.github with 3 updates: busybox, distroless/base and distroless/base-debian12.


Updates `busybox` from `37f7b37` to `f85340b`

Updates `distroless/base` from `2776987` to `cef75d1`

Updates `distroless/base-debian12` from `2776987` to `cef75d1`

---
updated-dependencies:
- dependency-name: busybox
  dependency-version: latest
  dependency-type: direct:production
  dependency-group: docker
- dependency-name: distroless/base
  dependency-version: latest
  dependency-type: direct:production
  dependency-group: docker
- dependency-name: distroless/base-debian12
  dependency-version: latest
  dependency-type: direct:production
  dependency-group: docker
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-04 06:07:50 -07:00
dependabot[bot]
02c9b7bccc
chore(deps): bump the github-actions group across 1 directory with 3 updates (#5641)
Bumps the github-actions group with 3 updates in the / directory:
[docker/build-push-action](https://github.com/docker/build-push-action),
[mikefarah/yq](https://github.com/mikefarah/yq) and
[actions/setup-go](https://github.com/actions/setup-go).

Updates `docker/build-push-action` from 6.16.0 to 6.18.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/docker/build-push-action/releases">docker/build-push-action's
releases</a>.</em></p>
<blockquote>
<h2>v6.18.0</h2>
<ul>
<li>Bump <code>@​docker/actions-toolkit</code> from 0.61.0 to 0.62.1 in
<a
href="https://redirect.github.com/docker/build-push-action/pull/1381">docker/build-push-action#1381</a></li>
</ul>
<blockquote>
<p>[!NOTE]
<a
href="https://docs.docker.com/build/ci/github-actions/build-summary/">Build
summary</a> is now supported with <a
href="https://docs.docker.com/build-cloud/">Docker Build Cloud</a>.</p>
</blockquote>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/docker/build-push-action/compare/v6.17.0...v6.18.0">https://github.com/docker/build-push-action/compare/v6.17.0...v6.18.0</a></p>
<h2>v6.17.0</h2>
<ul>
<li>Bump <code>@​docker/actions-toolkit</code> from 0.59.0 to 0.61.0 by
<a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in
<a
href="https://redirect.github.com/docker/build-push-action/pull/1364">docker/build-push-action#1364</a></li>
</ul>
<blockquote>
<p>[!NOTE]
Build record is now exported using the <a
href="https://docs.docker.com/reference/cli/docker/buildx/history/export/"><code>buildx
history export</code></a> command instead of the legacy export-build
tool.</p>
</blockquote>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/docker/build-push-action/compare/v6.16.0...v6.17.0">https://github.com/docker/build-push-action/compare/v6.16.0...v6.17.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="263435318d"><code>2634353</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/build-push-action/issues/1381">#1381</a>
from docker/dependabot/npm_and_yarn/docker/actions-t...</li>
<li><a
href="c0432d2e01"><code>c0432d2</code></a>
chore: update generated content</li>
<li><a
href="0bb1f27d6b"><code>0bb1f27</code></a>
set builder driver and endpoint attributes for dbc summary support</li>
<li><a
href="5f9dbf956c"><code>5f9dbf9</code></a>
chore(deps): Bump <code>@​docker/actions-toolkit</code> from 0.61.0 to
0.62.1</li>
<li><a
href="0788c444d8"><code>0788c44</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/build-push-action/issues/1375">#1375</a>
from crazy-max/remove-gcr</li>
<li><a
href="aa179ca4f4"><code>aa179ca</code></a>
e2e: remove GCR</li>
<li><a
href="1dc7386353"><code>1dc7386</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/build-push-action/issues/1364">#1364</a>
from crazy-max/history-export-cmd</li>
<li><a
href="9c9803f364"><code>9c9803f</code></a>
chore: update generated content</li>
<li><a
href="db1f6c46e8"><code>db1f6c4</code></a>
DOCKER_BUILD_EXPORT_LEGACY env var to opt-in for legacy export</li>
<li><a
href="721e8c79de"><code>721e8c7</code></a>
Bump <code>@​docker/actions-toolkit</code> from 0.59.0 to 0.61.0</li>
<li>See full diff in <a
href="14487ce63c...263435318d">compare
view</a></li>
</ul>
</details>
<br />

Updates `mikefarah/yq` from 4.45.1 to 4.45.4
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/mikefarah/yq/releases">mikefarah/yq's
releases</a>.</em></p>
<blockquote>
<h2>v4.45.4 - Fixing wrong map() behaviour on empty map</h2>
<ul>
<li>Fixing wrong map() behaviour on empty map <a
href="https://redirect.github.com/mikefarah/yq/issues/2359">#2359</a></li>
<li>Bumped dependencies</li>
</ul>
<h2>v4.45.3 - Fixes regression bug(s)</h2>
<ul>
<li>Fixing regression (<a
href="https://redirect.github.com/mikefarah/yq/issues/2353">#2353</a>,
<a
href="https://redirect.github.com/mikefarah/yq/issues/2359">#2359</a>,
<a
href="https://redirect.github.com/mikefarah/yq/issues/2325">#2325</a>)
introduced with in 4.45.2 with <a
href="https://redirect.github.com/mikefarah/yq/issues/2325">#2325</a>
fix</li>
<li>Bumped dependencies</li>
</ul>
<p>Sorry for the regression folks! 😓
fwiw I have since added automated tests to capture the scenarios
provided in the regression bug tickets</p>
<h2>v4.45.2</h2>
<ul>
<li>Added windows arm builds (Thanks <a
href="https://github.com/albertocavalcante"><code>@​albertocavalcante</code></a>,
<a
href="https://github.com/ShukantPal"><code>@​ShukantPal</code></a>)</li>
<li>Added s390x platform support (Thanks <a
href="https://github.com/ashokpariya0"><code>@​ashokpariya0</code></a>)</li>
<li>Additionally push docker images to ghcr.io (Thanks <a
href="https://github.com/reegnz"><code>@​reegnz</code></a>)</li>
<li>Fixing add when there is no node match <a
href="https://redirect.github.com/mikefarah/yq/issues/2325">#2325</a></li>
<li>sort_by works on maps</li>
<li>Bumped dependencies</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/mikefarah/yq/blob/master/release_notes.txt">mikefarah/yq's
changelog</a>.</em></p>
<blockquote>
<p>4.45.4:</p>
<ul>
<li>Fixing wrong map() behaviour on empty map <a
href="https://redirect.github.com/mikefarah/yq/issues/2359">#2359</a></li>
<li>Bumped dependencies</li>
</ul>
<p>4.45.3:</p>
<ul>
<li>Fixing regression introduced with in 4.45.2 with <a
href="https://redirect.github.com/mikefarah/yq/issues/2325">#2325</a>
fix 😓 sorry folks!</li>
<li>Bumped dependencies</li>
</ul>
<p>4.45.2:</p>
<ul>
<li>Added windows arm builds (Thanks <a
href="https://github.com/albertocavalcante"><code>@​albertocavalcante</code></a>,
<a
href="https://github.com/ShukantPal"><code>@​ShukantPal</code></a>)</li>
<li>Added s390x platform support (Thanks <a
href="https://github.com/ashokpariya0"><code>@​ashokpariya0</code></a>)</li>
<li>Additionally push docker images to ghcr.io (Thanks <a
href="https://github.com/reegnz"><code>@​reegnz</code></a>)</li>
<li>Fixing add when there is no node match <a
href="https://redirect.github.com/mikefarah/yq/issues/2325">#2325</a></li>
<li>sort_by works on maps</li>
<li>Bumped dependencies</li>
</ul>
<p>4.45.1:</p>
<ul>
<li>Create parent directories when --split-exp is used, Thanks <a
href="https://github.com/rudo-thomas"><code>@​rudo-thomas</code></a></li>
<li>Bumped dependencies</li>
</ul>
<p>4.44.6:</p>
<ul>
<li>Fixed deleting items in array bug <a
href="https://redirect.github.com/mikefarah/yq/issues/2027">#2027</a>,
<a
href="https://redirect.github.com/mikefarah/yq/issues/2172">#2172</a>;
Thanks <a
href="https://github.com/jandubois"><code>@​jandubois</code></a></li>
<li>Docker image for armv7 / raspberry pi3, Thanks <a
href="https://github.com/brianegge"><code>@​brianegge</code></a></li>
<li>Fixed no-colors regression <a
href="https://redirect.github.com/mikefarah/yq/issues/2218">#2218</a></li>
<li>Fixed various panic scenarios <a
href="https://redirect.github.com/mikefarah/yq/issues/2211">#2211</a></li>
<li>Bumped dependencies</li>
</ul>
<p>4.44.5:</p>
<ul>
<li>Fixing release pipeline</li>
</ul>
<p>4.44.4:</p>
<ul>
<li>Format comments with a gray foreground (Thanks <a
href="https://github.com/gabe565"><code>@​gabe565</code></a>)</li>
<li>Fixed handling of nulls with sort_by expressions <a
href="https://redirect.github.com/mikefarah/yq/issues/2164">#2164</a></li>
<li>Force no color output when NO_COLOR env presents (Thanks <a
href="https://github.com/narqo"><code>@​narqo</code></a>)</li>
<li>Fixed array subtraction update bug <a
href="https://redirect.github.com/mikefarah/yq/issues/2159">#2159</a></li>
<li>Fixed index out of range error</li>
<li>Can traverse straight from parent operator (parent.blah)</li>
<li>Bumped dependencies</li>
</ul>
<p>4.44.3:</p>
<ul>
<li>Fixed upper-case file extension detection, Thanks <a
href="https://github.com/ryenus"><code>@​ryenus</code></a> (<a
href="https://redirect.github.com/mikefarah/yq/issues/2121">#2121</a>)</li>
<li>Log printing follow no-colors flag <a
href="https://redirect.github.com/mikefarah/yq/issues/2082">#2082</a></li>
<li>Skip and warn when interpolating strings and theres a unclosed
bracket <a
href="https://redirect.github.com/mikefarah/yq/issues/2083">#2083</a></li>
<li>Fixed CSV content starting with # issue <a
href="https://redirect.github.com/mikefarah/yq/issues/2076">#2076</a></li>
<li>Bumped dependencies</li>
</ul>
<p>4.44.2:</p>
<ul>
<li>Handle numbers with underscores <a
href="https://redirect.github.com/mikefarah/yq/issues/2039">#2039</a></li>
<li>Unique now works on maps and arrays <a
href="https://redirect.github.com/mikefarah/yq/issues/2068">#2068</a></li>
<li>Added support for short hand splat with env[] expression <a
href="https://redirect.github.com/mikefarah/yq/issues/2071">#2071</a>,</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="b534aa9ee5"><code>b534aa9</code></a>
Bumping version</li>
<li><a
href="39a65b62d2"><code>39a65b6</code></a>
Updating release notes</li>
<li><a
href="1e3006e951"><code>1e3006e</code></a>
Removing old issue template</li>
<li><a
href="22949df0fd"><code>22949df</code></a>
Fixing running map against empty array bug <a
href="https://redirect.github.com/mikefarah/yq/issues/2359">#2359</a></li>
<li><a
href="734e2cd254"><code>734e2cd</code></a>
Bumping version</li>
<li><a
href="082b76affa"><code>082b76a</code></a>
Preparing release notes</li>
<li><a
href="5bc2cd03da"><code>5bc2cd0</code></a>
Bumping golang version</li>
<li><a
href="20407a07a5"><code>20407a0</code></a>
Adding more tests to prevent regression again :sweat</li>
<li><a
href="0a83da6b38"><code>0a83da6</code></a>
Bump github.com/pelletier/go-toml/v2 from 2.2.3 to 2.2.4</li>
<li><a
href="77da8b7d32"><code>77da8b7</code></a>
Bump golang from 1.24.2 to 1.24.3</li>
<li>Additional commits viewable in <a
href="8bf425b4d1...b534aa9ee5">compare
view</a></li>
</ul>
</details>
<br />

Updates `actions/setup-go` from 5.4.0 to 5.5.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/actions/setup-go/releases">actions/setup-go's
releases</a>.</em></p>
<blockquote>
<h2>v5.5.0</h2>
<h2>What's Changed</h2>
<h3>Bug fixes:</h3>
<ul>
<li>Update self-hosted environment validation by <a
href="https://github.com/priyagupta108"><code>@​priyagupta108</code></a>
in <a
href="https://redirect.github.com/actions/setup-go/pull/556">actions/setup-go#556</a></li>
<li>Add manifest validation and improve error handling by <a
href="https://github.com/priyagupta108"><code>@​priyagupta108</code></a>
in <a
href="https://redirect.github.com/actions/setup-go/pull/586">actions/setup-go#586</a></li>
<li>Update template link by <a
href="https://github.com/jsoref"><code>@​jsoref</code></a> in <a
href="https://redirect.github.com/actions/setup-go/pull/527">actions/setup-go#527</a></li>
</ul>
<h3>Dependency  updates:</h3>
<ul>
<li>Upgrade <code>@​action/cache</code> from 4.0.2 to 4.0.3 by <a
href="https://github.com/aparnajyothi-y"><code>@​aparnajyothi-y</code></a>
in <a
href="https://redirect.github.com/actions/setup-go/pull/574">actions/setup-go#574</a></li>
<li>Upgrade <code>@​actions/glob</code> from 0.4.0 to 0.5.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/actions/setup-go/pull/573">actions/setup-go#573</a></li>
<li>Upgrade ts-jest from 29.1.2 to 29.3.2 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/actions/setup-go/pull/582">actions/setup-go#582</a></li>
<li>Upgrade eslint-plugin-jest from 27.9.0 to 28.11.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/actions/setup-go/pull/537">actions/setup-go#537</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/jsoref"><code>@​jsoref</code></a> made
their first contribution in <a
href="https://redirect.github.com/actions/setup-go/pull/527">actions/setup-go#527</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/setup-go/compare/v5...v5.5.0">https://github.com/actions/setup-go/compare/v5...v5.5.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d35c59abb0"><code>d35c59a</code></a>
chore: update discussions url (<a
href="https://redirect.github.com/actions/setup-go/issues/527">#527</a>)</li>
<li><a
href="29694d72cd"><code>29694d7</code></a>
Add manifest validation and improve error handling (<a
href="https://redirect.github.com/actions/setup-go/issues/586">#586</a>)</li>
<li><a
href="78535dd5f2"><code>78535dd</code></a>
Bump eslint-plugin-jest from 27.9.0 to 28.11.0 (<a
href="https://redirect.github.com/actions/setup-go/issues/537">#537</a>)</li>
<li><a
href="bb65d8857b"><code>bb65d88</code></a>
Bump ts-jest from 29.1.2 to 29.3.2 (<a
href="https://redirect.github.com/actions/setup-go/issues/582">#582</a>)</li>
<li><a
href="7f17e836c0"><code>7f17e83</code></a>
Bump <code>@​actions/glob</code> from 0.4.0 to 0.5.0 (<a
href="https://redirect.github.com/actions/setup-go/issues/573">#573</a>)</li>
<li><a
href="dca8468d37"><code>dca8468</code></a>
Update self-hosted environment validation and bump undici version (<a
href="https://redirect.github.com/actions/setup-go/issues/556">#556</a>)</li>
<li><a
href="691cc3533f"><code>691cc35</code></a>
upgrade actions/cache to 4.0.3 (<a
href="https://redirect.github.com/actions/setup-go/issues/574">#574</a>)</li>
<li>See full diff in <a
href="0aaccfd150...d35c59abb0">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-03 09:36:28 -06:00
dependabot[bot]
24c7912866
chore(deps): bump the docker group with 3 updates (#5635)
Bumps the docker group with 3 updates: node, golang and distroless/base-debian12.


Updates `node` from `a1f1274` to `0b5b940`

Updates `golang` from `79390b5` to `29d9726`

Updates `distroless/base-debian12` from `02be006` to `cc8cf19`

---
updated-dependencies:
- dependency-name: node
  dependency-version: lts-bookworm
  dependency-type: direct:production
  dependency-group: docker
- dependency-name: golang
  dependency-version: 1.24-bookworm
  dependency-type: direct:production
  dependency-group: docker
- dependency-name: distroless/base-debian12
  dependency-version: debug
  dependency-type: direct:production
  dependency-group: docker
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-03 06:13:51 -07:00
Denis Mishin
b944e68232
mcp: implement connect (#5640)
## Summary

adds implementation of `/.pomerium/mcp/connect` method, that takes a
`redirect_url` parameter and would ensure the user goes thru required
redirects so that its session is hydrated with the upstream Oauth token
for the MCP server.
the `redirect_url` parameter host must match one of the _client_ mcp
routes (currently identified by the presence of `mcp:
pass_upstream_access_token: true` in the route.

## Related issues

Fix
https://linear.app/pomerium/issue/ENG-2321/mcp-support-handling-external-oauth-servers

## User Explanation

<!-- How would you explain this change to the user? If this
change doesn't create any user-facing changes, you can leave
this blank. If filled out, add the `docs` label -->

## Checklist

- [x] reference any related issues
- [x] updated unit tests
- [ ] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review
2025-06-02 17:19:34 -04:00
Caleb Doxsey
ff607fa018
databroker: add sync-cache (#5639)
## Summary
Add a new `SyncCache`:

```go
type SyncCache interface {
	// Clear deletes all the data for the given record type in the sync cache.
	Clear(recordType string) error
	// Records yields the databroker records stored in the cache.
	Records(recordType string) iter.Seq2[*Record, error]
	// Sync syncs the cache with the databroker.
	Sync(ctx context.Context, client DataBrokerServiceClient, recordType string) error
}
```

The cache maintains databroker records in a local pebble database (which
could be on-disk or in-memory). The way it's used is you first call
`.Sync(ctx, client, recordType)` and then `.Records(recordType)`, which
returns an iterator over all the records.

Internally we store the databroker records in a pebble key-value
database. Pebble was chosen because its fast and well-tested, but any
ordered key-value store would work. The first time we call `SyncLatest`
to retrieve all the records. Each subsequent time we call `Sync` with
the current server and record versions to retrieve only the changes.
This is significantly more efficient than calling `SyncLatest` every
time.

The primary use for this is in the enterprise-console as part of
directory sync to improve performance with large datasets.

## Related issues
-
[ENG-2401](https://linear.app/pomerium/issue/ENG-2401/enterprise-console-improve-performance-of-directory-sync-using-cached)

## Checklist

- [x] reference any related issues
- [x] updated unit tests
- [x] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review

---------

Co-authored-by: Denis Mishin <dmishin@pomerium.com>
2025-06-02 13:42:30 -06:00
Caleb Doxsey
c0a8b79ef1
fix metric to use milliseconds (#5632)
This was supposed to be in milliseconds not microseconds.
2025-06-02 09:36:10 -06:00
Caleb Doxsey
6918bf83cb
databroker: add a wait field to sync request (#5630)
## Summary
Add a new `wait` field to the sync request for the databroker. The
current behavior is to always wait for changes in a never-ending stream
of records, but there are cases where it would be useful to stream the
changes and stop when there are no changes remaining. The storage
backends already support this.

The `wait` field is optional and the default will be to wait, preserving
the existing behavior.

## Related issues
-
[ENG-2401](https://linear.app/pomerium/issue/ENG-2401/enterprise-console-improve-performance-of-directory-sync-using-cached)

## Checklist

- [x] reference any related issues
- [ ] updated unit tests
- [x] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review
2025-05-29 12:50:14 -06:00
Caleb Doxsey
13554ec78d
core: more metrics (#5629)
## Summary
Add some more metrics:

- Authenticate token verification
- Authorization log duration
- Authorization evaluator and header evaluator
- IDP token session creator

HTTP and gRPC endpoints are already instrumented via middleware, which
covers authenticate, proxy and databroker endpoints. Postgres is also
already instrumented using `otelpgx`.

## Related issues
-
[ENG-2407](https://linear.app/pomerium/issue/ENG-2407/add-additional-metrics-and-tracing-spans-to-pomerium)


## Checklist

- [x] reference any related issues
- [ ] updated unit tests
- [ ] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review
2025-05-29 09:34:41 -06:00
Denis Mishin
957e0982c1
mcp: fix upstream client access token (#5626)
## Summary

the `mcp: pass_upstream_access_token` option should take effect even if
no upstream oauth config is set.

## Related issues

<!-- For example...
- #159
-->

## User Explanation

<!-- How would you explain this change to the user? If this
change doesn't create any user-facing changes, you can leave
this blank. If filled out, add the `docs` label -->

## Checklist

- [ ] reference any related issues
- [ ] updated unit tests
- [ ] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [ ] ready for review
2025-05-28 16:20:02 -04:00
Caleb Doxsey
180884cc21
add metrics for cache (#5627)
## Summary
Add metrics for the global cache. Configure `otel` to export metrics to
prometheus.

## Related issues
-
[ENG-2407](https://linear.app/pomerium/issue/ENG-2407/add-additional-metrics-and-tracing-spans-to-pomerium)

## Checklist

- [x] reference any related issues
- [ ] updated unit tests
- [ ] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review
2025-05-28 09:49:30 -06:00
Caleb Doxsey
46865b596e
config: support weighted URLs in To field (#5624)
## Summary
Currently in core we support weighted URLs like this in the config file:

```yaml
to: 
  - https://a.example.com,1
  - https://b.example.com,2
```

However in the protobuf we use a separate `load_balancing_weights`
field:

```proto
message Route {
  repeated string to                     = 3;
  repeated uint32 load_balancing_weights = 37;
}
```

This PR updates the code to convert from protobuf so that it also
supports weights directly in the `to` addresses. The existing
`load_balancing_weights` behavior is preserved and will take precedence
when provided.

## Related issues
-
[ENG-2398](https://linear.app/pomerium/issue/ENG-2398/enterprise-api-upstream-weight-is-not-parsed)

## Checklist
- [x] reference any related issues
- [x] updated unit tests
- [x] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review
2025-05-20 12:15:10 -06:00
Caleb Doxsey
7a6d7c5a3c
config: use stable route ids for authorize matching and order xds responses (#5618)
## Summary
Update the `RouteID` to use the `policy.ID` if it is set. This makes it
so that updated routes use a stable identifier between updates so if the
envoy control plane is updated before the authorize service's internal
definitions (or vice-versa) the authorize service will still be able to
match the route.

The current behavior results in a 404 if envoy passes the old route id.
The new behavior will result in inconsistency, but it should be quickly
remedied. To help with debugging 4 new fields were added to the
authorize check log. The `route-id` and `route-checksum` as the
authorize sees it and the `envoy-route-id` and `envoy-route-checksum` as
envoy sees it.

I also updated the way we send updates to envoy to try and model their
recommended approach:

> In general, to avoid traffic drop, sequencing of updates should follow
a make before break model, wherein:
> 
> - CDS updates (if any) must always be pushed first.
> - EDS updates (if any) must arrive after CDS updates for the
respective clusters.
> - LDS updates must arrive after corresponding CDS/EDS updates.
> - RDS updates related to the newly added listeners must arrive after
CDS/EDS/LDS updates.
> - VHDS updates (if any) related to the newly added RouteConfigurations
must arrive after RDS updates.
> - Stale CDS clusters and related EDS endpoints (ones no longer being
referenced) can then be removed.

This should help avoid 404s when configuration is being updated.

## Related issues
-
[ENG-2386](https://linear.app/pomerium/issue/ENG-2386/large-number-of-routes-leads-to-404s-and-slowness)

## Checklist
- [x] reference any related issues
- [x] updated unit tests
- [x] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review
2025-05-19 10:52:15 -06:00
bobby
2f179658b6
Fix typo in Seal comment (#5620)
## Summary
- fix a typo in `pkg/hpke/hpke.go` comment

## Testing
- `go vet` *(fails: module download timed out)*
- `go test ./...` *(fails: module download timed out)*

[n.b. this was an experiment using codex]
2025-05-18 18:56:59 -07:00
bobby
9328243923
Fix comment grammar (#5621)
## Summary
- fix wording in routes.go comment referencing authenticate service
2025-05-18 18:46:43 -07:00
Kenneth Jenkins
e4dc218b81
authorize: move IdP token session creator initialization (#5616)d
IdP-token-based session creation makes requests to the authenticate 
service to verify tokens. We have a singleflight group to avoid having 
duplicate requests in flight, but it looks like this is not working as 
intended. Move the IncomingIDPTokenSessionCreator initialization into
the main authorize state object, and out of the request path.

Add an integration test to assert that making a large number of requests 
with the same IdP token will result in only one token verification
request to the authenticate service.
2025-05-14 13:54:39 -07:00
Caleb Doxsey
f9fd52067e
identity: add access token support for github (#5615)
## Summary
Implement direct access token support for GitHub. GitHub doesn't have
identity tokens, so that isn't supported. The "IdP Access Token Allowed
Audiences" option is also not supported because GitHub doesn't populate
an `aud` claim.

## Related issues
-
[ENG-2137](https://linear.app/pomerium/issue/ENG-2137/core-implement-token-validation-for-github)

## Checklist

- [x] reference any related issues
- [x] updated unit tests
- [x] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review
2025-05-13 10:59:47 -06:00
Caleb Doxsey
ba0fcffe81
storage: invalidate sync querier when records are updated (#5612)
## Summary
Invalidate the sync querier when records are updated so that we fallback
to databroker querying until the sync is complete.

## Related issues
For
[ENG-2377](https://linear.app/pomerium/issue/ENG-2377/core-initial-access-with-idp-accessidentity-tokens-sometimes-fails)


## Checklist

- [x] reference any related issues
- [x] updated unit tests
- [x] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review
2025-05-12 13:45:36 -06:00
Caleb Doxsey
f6b344fd9e
identity: add IdP access and identity token verification for OIDC (#5614)
## Summary
For the generic `oidc` provider, used by `auth0`, `cognito`, `gitlab`,
`google`, `oidc`, `okta`, `onelogin` and `ping`, add support for direct
access and identity token verification. Because Keycloak uses `oidc`
this also adds support for Keycloak.

Access tokens are verified by using the user info endpoint. If a call to
this endpoint succeeds using the access token, that access token is
considered valid and the user info claims will be returned.

Identity tokens are verified by using the jwks endpoint to retrieve the
signing key, and verifying that the identity token was signed with that
key. If the identity token is valid the claims in the JWT will be
returned.

## Related issues
-
[ENG-2312](https://linear.app/pomerium/issue/ENG-2312/core-implement-token-validation-for-keycloak)


## Checklist

- [x] reference any related issues
- [x] updated unit tests
- [x] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review
2025-05-12 13:45:25 -06:00
Caleb Doxsey
93b8c93daa
authenticate: add support for apple identity tokens (#5610)
## Summary
Add support for IdP identity token authorization for Apple. Apple does
not appear to support access token validation.

This allows a user to pass an identity token directly as a bearer token:

```
curl -H 'Authorization: Bearer Apple-Identity-Token' ...
```

## Related issues
-
[ENG-2000](https://linear.app/pomerium/issue/ENG-2000/core-implement-token-validation-for-apple)


## Checklist

- [x] reference any related issues
- [x] updated unit tests
- [x] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review
2025-05-09 11:01:34 -06:00
dependabot[bot]
c1c540f876
chore(deps): bump the go group across 1 directory with 31 updates (#5608)
* chore(deps): bump the go group across 1 directory with 31 updates

---
updated-dependencies:
- dependency-name: buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go
  dependency-version: 1.36.6-20250425153114-8976f5be98c1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
- dependency-name: cloud.google.com/go/storage
  dependency-version: 1.53.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-version: 1.29.14
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
- dependency-name: github.com/aws/aws-sdk-go-v2/service/s3
  dependency-version: 1.79.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
- dependency-name: github.com/caddyserver/certmagic
  dependency-version: 0.23.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: github.com/cloudflare/circl
  dependency-version: 1.6.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
- dependency-name: github.com/coreos/go-oidc/v3
  dependency-version: 3.14.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: github.com/docker/docker
  dependency-version: 28.1.1+incompatible
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: github.com/exaring/otelpgx
  dependency-version: 0.9.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
- dependency-name: github.com/fsnotify/fsnotify
  dependency-version: 1.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: github.com/gaissmai/bart
  dependency-version: 0.20.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
- dependency-name: github.com/grpc-ecosystem/go-grpc-middleware/v2
  dependency-version: 2.3.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
- dependency-name: github.com/mholt/acmez/v3
  dependency-version: 3.1.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
- dependency-name: github.com/miekg/dns
  dependency-version: 1.1.65
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
- dependency-name: github.com/minio/minio-go/v7
  dependency-version: 7.0.91
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
- dependency-name: github.com/open-policy-agent/opa
  dependency-version: 1.4.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: github.com/pires/go-proxyproto
  dependency-version: 0.8.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
- dependency-name: github.com/prometheus/client_golang
  dependency-version: 1.22.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: github.com/prometheus/client_model
  dependency-version: 0.6.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
- dependency-name: github.com/prometheus/procfs
  dependency-version: 0.16.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
- dependency-name: github.com/quic-go/quic-go
  dependency-version: 0.51.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: github.com/testcontainers/testcontainers-go
  dependency-version: 0.37.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: go.opentelemetry.io/proto/otlp
  dependency-version: 1.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: go.uber.org/mock
  dependency-version: 0.5.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
- dependency-name: golang.org/x/crypto
  dependency-version: 0.37.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: golang.org/x/net
  dependency-version: 0.39.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: golang.org/x/oauth2
  dependency-version: 0.29.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: golang.org/x/sync
  dependency-version: 0.13.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: golang.org/x/sys
  dependency-version: 0.32.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: google.golang.org/api
  dependency-version: 0.230.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: google.golang.org/genproto/googleapis/rpc
  dependency-version: 0.0.0-20250428153025-10db94c68c34
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
...

* hold back go-proxyproto, update protovalidate-go

The go-proxyproto module appears to have an incorrect go directive, so
hold off on this version update for now.

The bufbuild/protovalidate/protocolbuffers/go module requires a newer
version of the bufbuild/protovalidate-go module. This also introduces a
small formatting change to the validation error message in one of our
unit tests.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kenneth Jenkins <51246568+kenjenkins@users.noreply.github.com>
2025-05-07 10:04:03 -07:00
dependabot[bot]
881373cb08
chore(deps): bump github.com/open-policy-agent/opa from 1.3.0 to 1.4.0 (#5609)
Bumps
[github.com/open-policy-agent/opa](https://github.com/open-policy-agent/opa)
from 1.3.0 to 1.4.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/open-policy-agent/opa/releases">github.com/open-policy-agent/opa's
releases</a>.</em></p>
<blockquote>
<h2>v1.4.0</h2>
<p>This release contains a security fix addressing CVE-2025-46569.
It also includes a mix of new features, bugfixes, and dependency
updates.</p>
<h4>Security Fix: CVE-2025-46569 - OPA server Data API HTTP path
injection of Rego (<a
href="https://github.com/open-policy-agent/opa/security/advisories/GHSA-6m8w-jc87-6cr7">GHSA-6m8w-jc87-6cr7</a>)</h4>
<p>A vulnerability in the OPA server's <a
href="https://www.openpolicyagent.org/docs/latest/rest-api/#data-api">Data
API</a> allows an attacker to craft the HTTP path in a way that injects
Rego code into the query that is evaluated.<br />
The evaluation result cannot be made to return any other data than what
is generated by the requested path, but this path can be misdirected,
and the injected Rego code can be crafted to make the query succeed or
fail; opening up for oracle attacks or, given the right circumstances,
erroneous policy decision results.
Furthermore, the injected code can be crafted to be computationally
expensive, resulting in a Denial Of Service (DoS) attack.</p>
<p><strong>Users are only impacted if all of the following
apply:</strong></p>
<ul>
<li>OPA is deployed as a standalone server (rather than being used as a
Go library)</li>
<li>The OPA server is exposed outside of the local host in an untrusted
environment.</li>
<li>The configured <a
href="https://www.openpolicyagent.org/docs/latest/security/#authentication-and-authorization">authorization
policy</a> does not do exact matching of the input.path attribute when
deciding if the request should be allowed.</li>
</ul>
<p><strong>or, if all of the following apply:</strong></p>
<ul>
<li>OPA is deployed as a standalone server.</li>
<li>The service connecting to OPA allows 3rd parties to insert
unsanitised text into the path of the HTTP request to OPA’s Data
API.</li>
</ul>
<p>Note: With <strong>no</strong> <a
href="https://www.openpolicyagent.org/docs/latest/security/#authentication-and-authorization">Authorization
Policy</a> configured for restricting API access (the default
configuration), the RESTful <a
href="https://www.openpolicyagent.org/docs/latest/rest-api/#data-api">Data
API</a> provides access for managing Rego policies; and the RESTful <a
href="https://www.openpolicyagent.org/docs/latest/rest-api/#query-api">Query
API</a> facilitates advanced queries.
Full access to these APIs provides both simpler, and broader access than
what the security issue describes here can facilitate.
As such, OPA servers exposed to a network are <strong>not</strong>
considered affected by the attack described here if they are knowingly
not restricting access through an Authorization Policy.</p>
<p>This issue affects all versions of OPA prior to 1.4.0.</p>
<p>See the <a
href="https://github.com/open-policy-agent/opa/security/advisories/GHSA-6m8w-jc87-6cr7">Security
Advisory</a> for more details.</p>
<p>Reported by <a
href="https://github.com/GamrayW"><code>@​GamrayW</code></a>, <a
href="https://github.com/HyouKash"><code>@​HyouKash</code></a>, <a
href="https://github.com/AdrienIT"><code>@​AdrienIT</code></a>, authored
by <a
href="https://github.com/johanfylling"><code>@​johanfylling</code></a></p>
<h3>Runtime, Tooling, SDK</h3>
<ul>
<li>ast: Adding <code>rego_v1</code> feature to
<code>--v0-compatible</code> capabilities (<a
href="https://redirect.github.com/open-policy-agent/opa/pull/7474">#7474</a>)
authored by <a
href="https://github.com/johanfylling"><code>@​johanfylling</code></a></li>
<li>executable: Add version and icon to OPA windows executable (<a
href="https://redirect.github.com/open-policy-agent/opa/issues/3171">#3171</a>)
authored by <a
href="https://github.com/sspaink"><code>@​sspaink</code></a> reported by
<a
href="https://github.com/christophwille"><code>@​christophwille</code></a></li>
<li>format: Don't panic on format due to unexpected comments (<a
href="https://redirect.github.com/open-policy-agent/opa/issues/6330">#6330</a>)
authored by <a
href="https://github.com/sspaink"><code>@​sspaink</code></a> reported by
<a href="https://github.com/sirpi"><code>@​sirpi</code></a></li>
<li>format: Avoid modifying strings when formatting (<a
href="https://redirect.github.com/open-policy-agent/opa/issues/6220">#6220</a>)
authored by <a
href="https://github.com/sspaink"><code>@​sspaink</code></a> reported by
<a href="https://github.com/zregvart"><code>@​zregvart</code></a></li>
<li>plugins/status: FIFO buffer channel for status events to prevent
slow status API blocking (<a
href="https://redirect.github.com/open-policy-agent/opa/pull/7522">#7522</a>)
authored by <a
href="https://github.com/sspaink"><code>@​sspaink</code></a></li>
</ul>
<h3>Topdown and Rego</h3>
<ul>
<li>gqlparser: Add JSON annotation in
<code>internal/gqlparser/ast</code> to Position fields (<a
href="https://redirect.github.com/open-policy-agent/opa/pull/7509">#7509</a>)
authored by <a
href="https://github.com/robmyersrobmyers"><code>@​robmyersrobmyers</code></a></li>
<li>graphql: Cache GraphQL schema parse results (<a
href="https://redirect.github.com/open-policy-agent/opa/pull/7457">#7457</a>)
authored by <a
href="https://github.com/robmyersrobmyers"><code>@​robmyersrobmyers</code></a></li>
<li>topdown: Handling default functions in Partial Eval (<a
href="https://redirect.github.com/open-policy-agent/opa/issues/7220">#7220</a>)
authored by <a
href="https://github.com/johanfylling"><code>@​johanfylling</code></a></li>
<li>topdown: Fix wall clock time init for <code>PartialRun()</code> (<a
href="https://redirect.github.com/open-policy-agent/opa/issues/7490">#7490</a>)
authored by <a
href="https://github.com/srenatus"><code>@​srenatus</code></a></li>
<li>topdown: Zero alloc lower/upper unless changed (<a
href="https://redirect.github.com/open-policy-agent/opa/pull/7472">#7472</a>)
authored by <a
href="https://github.com/anderseknert"><code>@​anderseknert</code></a></li>
</ul>
<h3>Docs, Website, Ecosystem</h3>
<ul>
<li>adopters: Cloudsmith adds support for OPA (<a
href="https://redirect.github.com/open-policy-agent/opa/pull/7498">#7498</a>)
authored by <a
href="https://github.com/ndouglas-cloudsmith"><code>@​ndouglas-cloudsmith</code></a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/open-policy-agent/opa/blob/main/CHANGELOG.md">github.com/open-policy-agent/opa's
changelog</a>.</em></p>
<blockquote>
<h2>1.4.0</h2>
<p>This release contains a security fix addressing CVE-2025-46569.
It also includes a mix of new features, bugfixes, and dependency
updates.</p>
<h4>Security Fix: CVE-2025-46569 - OPA server Data API HTTP path
injection of Rego (<a
href="https://github.com/open-policy-agent/opa/security/advisories/GHSA-6m8w-jc87-6cr7">GHSA-6m8w-jc87-6cr7</a>)</h4>
<p>A vulnerability in the OPA server's <a
href="https://www.openpolicyagent.org/docs/latest/rest-api/#data-api">Data
API</a> allows an attacker to craft the HTTP path in a way that injects
Rego code into the query that is evaluated.<br />
The evaluation result cannot be made to return any other data than what
is generated by the requested path, but this path can be misdirected,
and the injected Rego code can be crafted to make the query succeed or
fail; opening up for oracle attacks or, given the right circumstances,
erroneous policy decision results.
Furthermore, the injected code can be crafted to be computationally
expensive, resulting in a Denial Of Service (DoS) attack.</p>
<p><strong>Users are only impacted if all of the following
apply:</strong></p>
<ul>
<li>OPA is deployed as a standalone server (rather than being used as a
Go library)</li>
<li>The OPA server is exposed outside of the local host in an untrusted
environment.</li>
<li>The configured <a
href="https://www.openpolicyagent.org/docs/latest/security/#authentication-and-authorization">authorization
policy</a> does not do exact matching of the input.path attribute when
deciding if the request should be allowed.</li>
</ul>
<p><strong>or, if all of the following apply:</strong></p>
<ul>
<li>OPA is deployed as a standalone server.</li>
<li>The service connecting to OPA allows 3rd parties to insert
unsanitised text into the path of the HTTP request to OPA’s Data
API.</li>
</ul>
<p>Note: With <strong>no</strong> <a
href="https://www.openpolicyagent.org/docs/latest/security/#authentication-and-authorization">Authorization
Policy</a> configured for restricting API access (the default
configuration), the RESTful <a
href="https://www.openpolicyagent.org/docs/latest/rest-api/#data-api">Data
API</a> provides access for managing Rego policies; and the RESTful <a
href="https://www.openpolicyagent.org/docs/latest/rest-api/#query-api">Query
API</a> facilitates advanced queries.
Full access to these APIs provides both simpler, and broader access than
what the security issue describes here can facilitate.
As such, OPA servers exposed to a network are <strong>not</strong>
considered affected by the attack described here if they are knowingly
not restricting access through an Authorization Policy.</p>
<p>This issue affects all versions of OPA prior to 1.4.0.</p>
<p>See the <a
href="https://github.com/open-policy-agent/opa/security/advisories/GHSA-6m8w-jc87-6cr7">Security
Advisory</a> for more details.</p>
<p>Reported by <a
href="https://github.com/GamrayW"><code>@​GamrayW</code></a>, <a
href="https://github.com/HyouKash"><code>@​HyouKash</code></a>, <a
href="https://github.com/AdrienIT"><code>@​AdrienIT</code></a>, authored
by <a
href="https://github.com/johanfylling"><code>@​johanfylling</code></a></p>
<h3>Runtime, Tooling, SDK</h3>
<ul>
<li>ast: Adding <code>rego_v1</code> feature to
<code>--v0-compatible</code> capabilities (<a
href="https://redirect.github.com/open-policy-agent/opa/pull/7474">#7474</a>)
authored by <a
href="https://github.com/johanfylling"><code>@​johanfylling</code></a></li>
<li>executable: Add version and icon to OPA windows executable (<a
href="https://redirect.github.com/open-policy-agent/opa/issues/3171">#3171</a>)
authored by <a
href="https://github.com/sspaink"><code>@​sspaink</code></a> reported by
<a
href="https://github.com/christophwille"><code>@​christophwille</code></a></li>
<li>format: Don't panic on format due to unexpected comments (<a
href="https://redirect.github.com/open-policy-agent/opa/issues/6330">#6330</a>)
authored by <a
href="https://github.com/sspaink"><code>@​sspaink</code></a> reported by
<a href="https://github.com/sirpi"><code>@​sirpi</code></a></li>
<li>format: Avoid modifying strings when formatting (<a
href="https://redirect.github.com/open-policy-agent/opa/issues/6220">#6220</a>)
authored by <a
href="https://github.com/sspaink"><code>@​sspaink</code></a> reported by
<a href="https://github.com/zregvart"><code>@​zregvart</code></a></li>
<li>plugins/status: FIFO buffer channel for status events to prevent
slow status API blocking (<a
href="https://redirect.github.com/open-policy-agent/opa/pull/7522">#7522</a>)
authored by <a
href="https://github.com/sspaink"><code>@​sspaink</code></a></li>
</ul>
<h3>Topdown and Rego</h3>
<ul>
<li>gqlparser: Add JSON annotation in
<code>internal/gqlparser/ast</code> to Position fields (<a
href="https://redirect.github.com/open-policy-agent/opa/pull/7509">#7509</a>)
authored by <a
href="https://github.com/robmyersrobmyers"><code>@​robmyersrobmyers</code></a></li>
<li>graphql: Cache GraphQL schema parse results (<a
href="https://redirect.github.com/open-policy-agent/opa/pull/7457">#7457</a>)
authored by <a
href="https://github.com/robmyersrobmyers"><code>@​robmyersrobmyers</code></a></li>
<li>topdown: Handling default functions in Partial Eval (<a
href="https://redirect.github.com/open-policy-agent/opa/issues/7220">#7220</a>)
authored by <a
href="https://github.com/johanfylling"><code>@​johanfylling</code></a></li>
<li>topdown: Fix wall clock time init for <code>PartialRun()</code> (<a
href="https://redirect.github.com/open-policy-agent/opa/issues/7490">#7490</a>)
authored by <a
href="https://github.com/srenatus"><code>@​srenatus</code></a></li>
<li>topdown: Zero alloc lower/upper unless changed (<a
href="https://redirect.github.com/open-policy-agent/opa/pull/7472">#7472</a>)
authored by <a
href="https://github.com/anderseknert"><code>@​anderseknert</code></a></li>
</ul>
<h3>Docs, Website, Ecosystem</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8b0720247e"><code>8b07202</code></a>
Prepare v1.4.0 release (<a
href="https://redirect.github.com/open-policy-agent/opa/issues/7541">#7541</a>)</li>
<li><a
href="ad2063247a"><code>ad20632</code></a>
Merge commit from fork</li>
<li><a
href="24ff9cfb3a"><code>24ff9cf</code></a>
fix: return the raw strings when formatting (<a
href="https://redirect.github.com/open-policy-agent/opa/issues/7525">#7525</a>)</li>
<li><a
href="254f3bf0b9"><code>254f3bf</code></a>
fix(status plugin): make sure the latest status is read before manually
trigg...</li>
<li><a
href="9b5f6010c0"><code>9b5f601</code></a>
docs: fix post merge badge (<a
href="https://redirect.github.com/open-policy-agent/opa/issues/7532">#7532</a>)</li>
<li><a
href="e490277477"><code>e490277</code></a>
docs: Point path versioned requests to new sites (<a
href="https://redirect.github.com/open-policy-agent/opa/issues/7531">#7531</a>)</li>
<li><a
href="d65888c14f"><code>d65888c</code></a>
plugins/status: FIFO buffer channel for status events to prevent slow
status ...</li>
<li><a
href="eb77d10971"><code>eb77d10</code></a>
docs: update edge links to use /docs/edge/ path (<a
href="https://redirect.github.com/open-policy-agent/opa/issues/7529">#7529</a>)</li>
<li><a
href="f07d604b4f"><code>f07d604</code></a>
docs: Set versioned docs links to point to archive (<a
href="https://redirect.github.com/open-policy-agent/opa/issues/7528">#7528</a>)</li>
<li><a
href="828b8cb156"><code>828b8cb</code></a>
docs: improve request headers documentation in REST APIs (<a
href="https://redirect.github.com/open-policy-agent/opa/issues/7524">#7524</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/open-policy-agent/opa/compare/v1.3.0...v1.4.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/open-policy-agent/opa&package-manager=go_modules&previous-version=1.3.0&new-version=1.4.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/pomerium/pomerium/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-06 11:19:35 -06:00
Denis Mishin
1a19ccabd8
mcp: add global runtime flag (#5604)
## Summary

Adds global runtime flag to enable/disable MCP support. (off by
default).

```yaml
runtime_flags:
  mcp: true
```

## Related issues

Fix:
https://linear.app/pomerium/issue/ENG-2367/place-mcp-support-behind-a-runtime-flag

## User Explanation

<!-- How would you explain this change to the user? If this
change doesn't create any user-facing changes, you can leave
this blank. If filled out, add the `docs` label -->

## Checklist

- [x] reference any related issues
- [ ] updated unit tests
- [ ] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [ ] ready for review
2025-05-02 16:33:42 -04:00
Caleb Doxsey
d1559eaa86
upgrade google.golang.org/grpc/health/grpc_health_v1 (#5605)
## Summary
Upgrade `google.golang.org/grpc/health/grpc_health_v1` which has a new
`List` method, so use the `UnimplementedHealthServer`.

## Related issues
- https://github.com/pomerium/ingress-controller/pull/1152

## User Explanation

<!-- How would you explain this change to the user? If this
change doesn't create any user-facing changes, you can leave
this blank. If filled out, add the `docs` label -->

## Checklist

- [ ] reference any related issues
- [ ] updated unit tests
- [ ] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review
2025-05-02 14:32:04 -06:00
Denis Mishin
6caf65a117
mcp: add list-routes client helper (#5596) 2025-05-01 15:02:28 -04:00
dependabot[bot]
d2e2f56d57
chore(deps): bump the docker group in /.github with 3 updates (#5603)
Bumps the docker group in /.github with 3 updates: busybox, distroless/base and distroless/base-debian12.


Updates `busybox` from `498a000` to `37f7b37`

Updates `distroless/base` from `74ddbf5` to `2776987`

Updates `distroless/base-debian12` from `74ddbf5` to `2776987`

---
updated-dependencies:
- dependency-name: busybox
  dependency-version: latest
  dependency-type: direct:production
  dependency-group: docker
- dependency-name: distroless/base
  dependency-version: latest
  dependency-type: direct:production
  dependency-group: docker
- dependency-name: distroless/base-debian12
  dependency-version: latest
  dependency-type: direct:production
  dependency-group: docker
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-01 11:54:12 -06:00
dependabot[bot]
5984f0f1e4
chore(deps): bump the github-actions group with 5 updates (#5600)
Bumps the github-actions group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [docker/build-push-action](https://github.com/docker/build-push-action) | `6.15.0` | `6.16.0` |
| [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) | `5.1.0` | `5.2.0` |
| [actions/setup-node](https://github.com/actions/setup-node) | `4.3.0` | `4.4.0` |
| [google-github-actions/auth](https://github.com/google-github-actions/auth) | `2.1.8` | `2.1.10` |
| [actions/setup-python](https://github.com/actions/setup-python) | `5.5.0` | `5.6.0` |


Updates `docker/build-push-action` from 6.15.0 to 6.16.0
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](471d1dc4e0...14487ce63c)

Updates `stefanzweifel/git-auto-commit-action` from 5.1.0 to 5.2.0
- [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases)
- [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md)
- [Commits](e348103e90...b863ae1933)

Updates `actions/setup-node` from 4.3.0 to 4.4.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](cdca7365b2...49933ea528)

Updates `google-github-actions/auth` from 2.1.8 to 2.1.10
- [Release notes](https://github.com/google-github-actions/auth/releases)
- [Changelog](https://github.com/google-github-actions/auth/blob/main/CHANGELOG.md)
- [Commits](71f986410d...ba79af0395)

Updates `actions/setup-python` from 5.5.0 to 5.6.0
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](8d9ed9ac5c...a26af69be9)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-version: 6.16.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: stefanzweifel/git-auto-commit-action
  dependency-version: 5.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: actions/setup-node
  dependency-version: 4.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: google-github-actions/auth
  dependency-version: 2.1.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: actions/setup-python
  dependency-version: 5.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-01 11:01:35 -06:00
dependabot[bot]
3b2963101e
chore(deps): bump the docker group with 2 updates (#5597)
Bumps the docker group with 2 updates: node and golang.


Updates `node` from `c7fd844` to `a1f1274`

Updates `golang` from `fa1a01d` to `79390b5`

---
updated-dependencies:
- dependency-name: node
  dependency-version: lts-bookworm
  dependency-type: direct:production
  dependency-group: docker
- dependency-name: golang
  dependency-version: 1.24-bookworm
  dependency-type: direct:production
  dependency-group: docker
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-01 11:00:58 -06:00
Caleb Doxsey
2d097ec2f8
add additional authorization check logs (#5598) 2025-05-01 10:57:28 -06:00
Denis Mishin
9d66f762e1
mcp: handle and pass upstream oauth2 tokens (#5595) 2025-05-01 12:42:31 -04:00
Denis Mishin
561b6040b5
mcp: redirect to upstream oauth2 for authentication (#5594) 2025-05-01 12:16:44 -04:00
Denis Mishin
5b024a8ada
mcp: pass access token to the upstream (#5593) 2025-04-29 12:13:18 -04:00
Denis Mishin
b9e3a5d301
mcp: add upstream oauth2 config types (#5592) 2025-04-28 19:18:44 -04:00