Commit graph

108 commits

Author SHA1 Message Date
Denis Mishin
cb0e8aaf06
mcp: add oauth metadata endpoint (#5579) 2025-04-23 12:24:00 -04:00
Caleb Doxsey
c47055bece
upgrade to go v1.24 (#5562)
* upgrade to go v1.24

* add a macOS-specific //nolint comment too

---------

Co-authored-by: Kenneth Jenkins <51246568+kenjenkins@users.noreply.github.com>
2025-04-02 15:53:09 -06:00
Caleb Doxsey
4c9398e95b
config: fix layered bearer_token_format and idp_access_token_allowed_audiences (#5533) 2025-03-19 10:04:48 -06:00
Kenneth Jenkins
e1eca4e97c
config: fix jwt_issuer_format conversion (#5524)
Remove the previous conversion logic in NewPolicyFromProto() for the 
jwt_issuer_format field. This would prevent the new "unset" state from
working correctly. Add a unit test to verify that all three values
(unset, "hostOnly" and "uri") will successfully round trip to the proto
format and back again.

Also add a test case for the Options.ApplySettings() method to verify 
that an unset jwt_issuer_format will not overwrite the existing value
(if any) in the settings.
2025-03-12 16:13:16 -07:00
Joe Kralicky
5e94b2f8f1
Refactor trace config to match supported otel options (#5447)
* Refactor trace config to match supported otel options

* use duration instead of int64 for otel timeouts

* change 'trace client updated' log level to debug
2025-01-30 11:59:19 -05:00
Kenneth Jenkins
3a2e6ce10a
config: fix JWT groups filter option (#5429)
When applying the settings proto, update the JWT groups filter option
only if the filter set is non-empty.

This is important when deploying Pomerium via the Ingress Controller in
combination with Pomerium Enterprise. In this scenario there is a
settings proto applied from both Ingress Controller and the Enterprise
console, and we want to make sure the one from Ingress Controller does
not overwrite the filter settings from Enterprise.
2025-01-16 08:53:06 -08:00
Joe Kralicky
e5ede2d167
remove test code from config/options_test.go (#5423) 2025-01-14 14:00:38 -05:00
Kenneth Jenkins
21b9e7890c
authorize: add filter options for JWT groups (#5417)
Add a new option for filtering to a subset of directory groups in the
Pomerium JWT and Impersonate-Group headers. Add a JWTGroupsFilter field
to both the Options struct (for a global filter) and to the Policy
struct (for per-route filter). These will be populated only from the
config protos, and not from a config file.

If either filter is set, then for each of a user's groups, the group
name or group ID will be added to the JWT groups claim only if it is an
exact string match with one of the elements of either filter.
2025-01-08 13:57:57 -08:00
Caleb Doxsey
4a5b737763
config: fix lost branding settings when there are multiple configuration sources (#5401) 2024-12-19 08:47:28 -07:00
Caleb Doxsey
27947b19cb
core/config: add kubernetes_service_account_token_file (#5322)
* core/config: add kubernetes_service_account_token_file

* fix loading of token file
2024-10-10 14:53:45 -06:00
Joe Kralicky
0e13248685
Core-Zero Import (#5288)
* initial core-zero import implementation

* Update /config/import openapi description and use PUT instead of POST

* update import ui tests

* Add 413 as a possible response for /config/import

* Options/Settings type conversion tests and related bugfixes

* Fixes for proto type conversion and tests

* Update core-zero import client

* Update core-zero import client

* Update import api and environment detection

* update go.mod

* remove old testdata

* Remove usage of deleted setting after merge

* remove extra newline from --version output
2024-10-09 18:51:56 -04:00
Kenneth Jenkins
01d375f0bc
config: remove unused gRPC setting (#5308)
Remove the grpc_client_dns_roundrobin option as it appears to be unused
since commit bbec2cae9f.
2024-10-03 10:14:54 -07:00
Caleb Doxsey
f3620cf6e9
core/config: add databroker_storage_connection_string_file (#5242)
* core/config: add databroker_storage_connection_string_file

* add file to file list
2024-08-27 09:42:14 -06:00
Caleb Doxsey
d225288ab3
core/identity: dynamic authenticator registration (#5105) 2024-05-07 16:45:39 -06:00
Caleb Doxsey
1a5b8b606f
core/lint: upgrade golangci-lint, replace interface{} with any (#5099)
* core/lint: upgrade golangci-lint, replace interface{} with any

* regen proto
2024-05-02 14:33:52 -06:00
Denis Mishin
e7b3d3b6e9
config: add runtime flags (#5050) 2024-04-04 17:51:04 -04:00
Kenneth Jenkins
e83b14bcd5
config: remove deprecated client_ca option (#4918)
The client_ca and client_ca_file settings were deprecated in v0.23.
Remove these options and add a link to the corresponding explanation on
the Upgrading docs page.
2024-01-30 14:12:23 -08:00
Caleb Doxsey
f684910ab3
core/config: remove cookie secure option (#4907) 2024-01-12 13:28:14 -07:00
dependabot[bot]
615c6257e6
chore(deps): bump github.com/spf13/viper from 1.16.0 to 1.18.2 (#4861)
* chore(deps): bump github.com/spf13/viper from 1.16.0 to 1.18.2

Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.16.0 to 1.18.2.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.16.0...v1.18.2)

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

Signed-off-by: dependabot[bot] <support@github.com>

* fix race

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Caleb Doxsey <cdoxsey@pomerium.com>
2023-12-27 16:16:38 -07:00
Caleb Doxsey
d6221c07ce
core/config: remove debug option, always use json logs (#4857)
* core/config: remove debug option, always use json logs

* go mod tidy
2023-12-15 11:29:05 -07:00
Kenneth Jenkins
08c186a72e
integration: test with both authentication flows (#4817)
Add an environment variable to allow forcing either the stateful or the
stateless authenticate flow.

Split the existing integration test clusters "single" and "multi" into
four new clusters: "single-stateful", "single-stateless",
"multi-stateful", and "multi-stateless", so that the integration tests
will run for both the stateful and the stateless authenticate flows.

(The "kubernetes" cluster is not currently being run, so I've left it
alone for now.)
2023-12-07 16:06:41 -08:00
Kenneth Jenkins
5ccd7a520a
support both stateful and stateless authenticate (#4765)
Update the initialization logic for the authenticate, authorize, and
proxy services to automatically select between the stateful
authentication flow and the stateless authentication flow, depending on
whether Pomerium is configured to use the hosted authenticate service.

Add a unit test case to verify that the sign_out handler does not 
trigger a sign in redirect.
2023-12-07 14:24:13 -08:00
Caleb Doxsey
bcddbff6e1
core/redis: remove redis (#4768)
* core/redis: remove redis

* 20 minute max wait
2023-11-28 13:14:36 -07:00
Caleb Doxsey
cfc339548f
core/config: disable strict-transport-security header with staging autocert (#4741) 2023-11-13 09:21:44 -07:00
Caleb Doxsey
ab7b66691d
core/config: add support for maps in environments (#4717) 2023-11-08 16:27:08 -07:00
Caleb Doxsey
62a9299e02
core/config: remove support for base64 encoded certificates (#4718)
* core/config: update file watcher source to handle base64 encoded certificates

* fix data race

* core/config: only allow files in certificates

* remove test

* re-add test
2023-11-08 13:08:24 -07:00
Caleb Doxsey
3bdbd56222
core/config: add pass_identity_headers option (#4720)
* core/config: add pass_identity_headers option

* add to proto

* remove deprecated field
2023-11-08 13:07:37 -07:00
Caleb Doxsey
77f9893fe5
core/config: remove unnecessary authenticate route (#4719) 2023-11-08 09:12:44 -07:00
Kenneth Jenkins
4f648e9ac1
databroker: remove redis storage backend (#4699)
Remove the Redis databroker backend. According to
https://www.pomerium.com/docs/internals/data-storage#redis it has been
discouraged since Pomerium v0.18.

Update the config options validation to return an error if "redis" is 
set as the databroker storage backend type.
2023-11-02 11:53:25 -07:00
Kenneth Jenkins
5a735264b3
config: do not add route headers to global map (#4629)
Currently the GetSetResponseHeadersForPolicy() method may add entries to 
the global SetResponseHeaders map, which can lead to one route's headers
being applied to other routes.

Instead, make a copy of the SetResponseHeaders map before adding any 
route-specific response header entries.

Add additional unit tests for GetSetResponseHeaders() and 
GetSetResponseHeadersForPolicy().
2023-10-18 13:55:48 -07:00
Kenneth Jenkins
5a4acc5cd3
config: validate cookie_secure option (#4484)
Do not allow the combination of 'cookie_same_site: none' and
'cookie_secure: false'.

Cookies with SameSite=None must also set the Secure option, see
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#none.
2023-08-23 10:43:01 -07:00
Kenneth Jenkins
e448909042
authorize: remove incorrect "valid-client-certificate" reason (#4470)
Fix the logic around when to add the default invalid_client_certificate
rule: this should only be added if mTLS is enabled and the enforcement
mode is not set to "policy". Add a unit test for this logic.
2023-08-17 08:13:57 -07:00
Kenneth Jenkins
1b3ee7ff8f
config: add decode hook for the SANMatcher type (#4464) 2023-08-16 11:05:17 -07:00
Kenneth Jenkins
ed9a93fe5b
config: extra CA and CRL validation (#4455)
Return an error from DownstreamMTLSSettings.validate() if both CA and
CAFile are populated, or if both CRL and CRLFile are populated.
2023-08-10 16:15:11 -07:00
Kenneth Jenkins
24b09186a4
config: move mTLS settings to new struct (#4442)
Move downstream mTLS settings to a nested config file object, under the
key 'downstream_mtls', and add a new DownstreamMTLSSettings struct for
these settings.

Deprecate the existing ClientCA and ClientCAFile fields in the Options
struct, but continue to honor them for now (log a warning if either is
populated).

Delete the ClientCRL and ClientCRLFile fields entirely (in current
releases these cannot be set without causing an Envoy error, so this
should not be a breaking change).

Update the Settings proto to mirror this nested structure.
2023-08-08 10:22:48 -07:00
Kenneth Jenkins
a16bdd9cb0
config: support arbitrary nested config structs (#4440)
Update bindEnvs() to add support for binding nested fields of the
Options struct to environment variables. The variable names are formed
by joining the nested fields' mapstructure tags with underscores (after
first converting to uppercase).

This is in preparation for adding a new nested struct for downstream
mTLS settings that will look something like this:

  downstream_mtls:
    ca_file: /path/to/CA/cert.pem
    enforcement: reject_connection

With this change, these fields would be bound to the variables
DOWNSTREAM_MTLS_CA_FILE and DOWNSTREAM_MTLS_ENFORCEMENT.
2023-08-07 12:39:37 -07:00
Kenneth Jenkins
2bf83e20d8
Allow clearing default Azure and Google auth code options (#4315)
Allow users to clear the default IdP auth code options, by explicitly
setting an empty idp_request_params map.

To do this in a YAML config file, set:

    idp_request_params: {}
2023-06-27 09:11:54 -07:00
Caleb Doxsey
baf964f44a
config: update logic for checking overlapping certificates (#4216)
* config: update logic for checking overlapping certificates

* add test

* go mod tidy
2023-06-01 09:30:46 -06:00
Caleb Doxsey
a741cce50e
config: simplify default set response headers (#4196) 2023-05-30 17:44:06 -06:00
Caleb Doxsey
be0104b842
config: add cookie_same_site option (#4148) 2023-05-03 14:36:42 -06:00
Caleb Doxsey
498bc82e81
config: default to authenticate.pomerium.app when authenticate url is not specified (#4132) 2023-04-26 10:32:17 -06:00
Caleb Doxsey
bbed421cd8
config: remove source, remove deadcode, fix linting issues (#4118)
* remove source, remove deadcode, fix linting issues

* use github action for lint

* fix missing envoy
2023-04-21 17:25:11 -06:00
Caleb Doxsey
681cf6fa27
config: fix set_response_headers (#4026)
* config: fix set_response_headers

* fix disabling to support route headers when global headers are disabled
2023-04-20 17:07:23 -06:00
Caleb Doxsey
d2b732243a
cryptutil: generate certificates from deriveca (#3992) 2023-02-23 08:38:56 -07:00
Caleb Doxsey
67e12101fa
envoyconfig: clean up filter chain construction (#3844)
* cleanup filter chain construction

* rename domains to server names

* rename to hosts

* fix tests

* update function name

* improved domaain matching
2022-12-27 10:07:26 -07:00
Caleb Doxsey
3e892a8533
options: support multiple signing keys (#3828)
* options: support multiple signing keys

* fix controlplane method, errors
2022-12-22 09:31:09 -07:00
Caleb Doxsey
fa26587f19
remove forward auth (#3628) 2022-11-23 15:59:28 -07:00
Caleb Doxsey
9413123c0f
config: generate cookie secret if not set in all-in-one mode (#3742)
* config: generate cookie secret if not set in all-in-one mode

* fix tests

* config: add warning about cookie_secret

* breakup lines
2022-11-11 14:14:30 -07:00
Caleb Doxsey
2c9087f5e7
config: disable Strict-Transport-Security when using a self-signed certificate (#3743) 2022-11-10 16:01:06 -07:00
Caleb Doxsey
c178819875
move directory providers (#3633)
* remove directory providers and support for groups

* idp: remove directory providers

* better error messages

* fix errors

* restore postgres

* fix test
2022-11-03 11:33:56 -06:00