Commit graph

179 commits

Author SHA1 Message Date
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
Caleb Doxsey
5373e25ac4
core/config: add support for stripping the port for matching routes (#5085)
* core/config: add support for stripping the port for matching routes

* fix test

* rename option, improve port detection

* add more test cases
2024-04-26 08:24:46 -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
5e0079c649
core/databroker: disable identity manager user refresh when hosted authenticate is used (#4905) 2024-01-12 13:30:03 -07:00
Caleb Doxsey
f684910ab3
core/config: remove cookie secure option (#4907) 2024-01-12 13:28:14 -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
Caleb Doxsey
a2fd95aae6
core/ci: update linting (#4844)
* core/ci: update linting

* re-add exportloopref

* re-add gocheckcompilerdirectives

* re-add stylecheck

* re-add usestdlibvars

* upgrade lint

---------

Co-authored-by: Denis Mishin <dmishin@pomerium.com>
2023-12-14 09:07:54 -08: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
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
Denis Mishin
bfcc970839
databroker: build config concurrently, option to bypass validation (#4655)
* validation: option to bypass

* concurrently build config

* add regex_priority_order and route sorting

* rm mutex
2023-11-06 13:21:29 -05: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
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
9d4d31cb4f
authorize: implement client certificate CRL check (#4439)
Update isValidClientCertificate() to also consult the configured
certificate revocation lists. Update existing test cases and add a new
unit test to exercise the revocation support. Restore the skipped
integration test case.

Generate new test certificates and CRLs using a new `go run`-able source
file.
2023-08-03 15:59:11 -07:00
Caleb Doxsey
438aecd7bc
config: add customization options for logging (#4383)
* config: add customization options for logging

* config: validate log fields

* allocate slices once
2023-07-24 13:17:03 -06:00
Caleb Doxsey
78e7a3e7d0
config: validate log levels (#4367)
* config: validate log levels

* fix SetLevel

* document unset, merge warn/warning
2023-07-17 16:41:48 -06: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
Denis Mishin
80ffefeafd
fix WillHaveCertificateForServerName check to be strict match for derived cert name (#4167) 2023-05-09 18:54:50 -04: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
b50d5f3203
config: add additional dns lookup families, default to V4_PREFERRED (#3957) 2023-02-10 16:29:23 -07:00
Denis Mishin
ab430624f2
tls_derive: rename for consistency (#3905)
rename for consistency with other tls options
2023-01-17 17:04:26 -05:00
Caleb Doxsey
1e6a483ce9
config: add missing options (#3882)
* config: add missing options

* remove _file options from protobuf

* fix

* lint
2023-01-12 10:55:12 -07:00
Denis Mishin
488bcd6f72
auto tls (#3856) 2023-01-05 16:35:58 -05:00
Denis Mishin
e019885218
mTLS: allow gRPC TLS for all in one (#3854)
* make grpc_insecure an optional bool

* use internal addresses for all in one databroker and tls
2023-01-03 12:45:04 -05:00
Caleb Doxsey
271b0787a8
config: add support for extended TCP route URLs (#3845)
* config: add support for extended TCP route URLs

* nevermind, add duplicate names
2022-12-27 12:50:33 -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
ba07afc245
hpke: add HPKE key to JWKS endpoint (#3762)
* hpke: add HPKE key to JWKS endpoint

* fix test, add http caching headers

* fix error message

* use pointers
2022-11-23 08:45:59 -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
Denis Mishin
74a7daed4f
add config option check logging (#3722) 2022-11-05 00:25:09 -04: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
Denis Mishin
d8f4355f66
fix unused key warnings in routes (#3711) 2022-10-28 14:59:43 -04:00
Caleb Doxsey
daed2d260c
config: disable envoy admin by default, expose stats via envoy route (#3677) 2022-10-18 16:25:03 -06:00
Caleb Doxsey
71b1bcfac5
config: default to http2 (#3660)
* config: default to http2

* fix test
2022-10-12 14:46:06 -06:00