Commit graph

376 commits

Author SHA1 Message Date
Joe Kralicky
319a801e1d
error message improvements 2025-04-08 18:35:45 +00:00
Joe Kralicky
f9950856cd
fixes for mirror mode 2025-04-01 21:49:43 +00:00
Kenneth Jenkins
45da45a7a3 initialize a User record during ssh login 2025-04-01 14:10:52 -07:00
Kenneth Jenkins
9d23532bd1 send empty methods list for final deny response 2025-04-01 12:32:34 -07:00
Kenneth Jenkins
f794c6e7f3 log claims after device auth flow completed 2025-03-31 15:52:07 -07:00
Joe Kralicky
864c153549
improved metadata for auth and session recording 2025-03-30 00:28:23 +00:00
Kenneth Jenkins
9835cd08e4 ssh: store session metadata in a separate databroker record 2025-03-28 16:57:32 -07:00
Kenneth Jenkins
17fedbfa6f write asciicast recordings to the databroker for now
For demo purposes, store the asciicast recordings as a BytesValue in the
databroker. Eventually we'll likely want to replace this with some
S3-compatible object store.
2025-03-27 16:35:37 -07:00
Joe Kralicky
19b67bf32d
close ssh connection when session is revoked 2025-03-26 21:19:21 +00:00
Joe Kralicky
8eff4a48a4
Merge remote-tracking branch 'origin/main' into experimental/ssh 2025-03-25 22:06:24 +00:00
Joe Kralicky
a96ab2fe93
move internal/telemetry/trace => pkg/telemetry/trace (#5541) 2025-03-25 10:43:04 -04:00
Joe Kralicky
315ee2610f
refactor session state 2025-03-21 21:34:33 +00:00
Joe Kralicky
3225d3b032
wip: ssh cli mode 2025-03-21 18:38:26 +00:00
Joe Kralicky
5e06f2aef9
wip 2025-03-21 15:08:08 +00:00
Caleb Doxsey
bc263e3ee5
proxy: use querier cache for user info (#5532) 2025-03-20 09:50:22 -06:00
Joe Kralicky
08252f32df
Merge remote-tracking branch 'origin/kenjenkins/ssh-proxy-auth-integration' into experimental/ssh 2025-03-19 20:56:59 +00:00
Caleb Doxsey
d6b02441b3
authorize: return 403 on invalid sessions (#5536) 2025-03-19 14:41:28 -06:00
Joe Kralicky
165e4f2ed9
initial ssh proxy demo 2025-03-19 20:16:18 +00:00
Joe Kralicky
ff26890bf4
wip 2025-03-19 18:20:13 +00:00
Joe Kralicky
d89a7d97d7
wip 2025-03-17 17:55:26 +00:00
Kenneth Jenkins
ad183873f4
add global jwt_issuer_format option (#5508)
Add a corresponding global setting for the existing route-level
jwt_issuer_format option. The route-level option will take precedence
when set to a non-empty string.
2025-03-11 14:11:50 -07:00
Kenneth Jenkins
3b68db52a0 continuous auth prototype 2025-02-27 17:19:02 -08:00
Kenneth Jenkins
1da95d334c refactor to share more authorize check logic
should restore authorize log entries for ssh auth
2025-02-27 13:04:44 -08:00
Kenneth Jenkins
3e6f4464af make sure to include methods in deny response 2025-02-26 16:37:13 -08:00
Kenneth Jenkins
e45f11d281 somewhat working
Was missing a Querier on the context passed to Evaluate(). Add some
additional debug logging.
2025-02-25 14:57:22 -08:00
Kenneth Jenkins
e69ccaae68 WIP -- prototyping session/policy integration 2025-02-24 16:42:37 -08:00
Caleb Doxsey
a9e26b155d
identity: disable session refresh for idp token sessions, fix query cache invalidation (#5495) 2025-02-24 15:33:23 -07:00
Caleb Doxsey
b9fd926618
authorize: support authenticating with idp tokens (#5484)
* identity: add support for verifying access and identity tokens

* allow overriding with policy option

* authenticate: add verify endpoints

* wip

* implement session creation

* add verify test

* implement idp token login

* fix tests

* add pr permission

* make session ids route-specific

* rename method

* add test

* add access token test

* test for newUserFromIDPClaims

* more tests

* make the session id per-idp

* use type for

* add test

* remove nil checks
2025-02-18 13:02:06 -07:00
Joe Kralicky
d588135b3a
very bad demo code 2025-02-18 01:33:15 +00:00
Kenneth Jenkins
b0f89fc688
authorize: log JWT groups filtering (#5432)
Add a new Authorize Log Fields option for logging the number of groups
removed during JWT groups filtering. This will be enabled by default.

Additionally, when the log level is Debug (or more verbose), store and
log the IDs of any groups removed during JWT groups filtering.
2025-01-27 12:11:52 -08:00
Caleb Doxsey
97ba21b95a
proxy: add routes HTML page (#5443)
* proxy: add route portal json

* fix 405 issue

* proxy: add routes HTML page
2025-01-27 12:13:55 -07:00
Kenneth Jenkins
e9786f9719
authorize: filter only by group ID (#5437)
Change the JWT groups filtering behavior:
- to filter only by group ID (not group name)
- and only for groups sourced from directory sync (groups from a 
  "groups" claim will not be filtered)

This avoids the need to fetch all group names up front, which should 
improve performance in specific circumstances.
2025-01-24 14:43:45 -08:00
Denis Mishin
0bd6d8cc83
core/authz: remove unused mutex (#5442) 2025-01-22 15:59:06 -05:00
Caleb Doxsey
e816cef2a1
proxy: add route portal json (#5428)
* proxy: add route portal json

* fix 405 issue

* add link to issue

* Update proxy/portal/filter_test.go

Co-authored-by: Kenneth Jenkins <51246568+kenjenkins@users.noreply.github.com>

---------

Co-authored-by: Kenneth Jenkins <51246568+kenjenkins@users.noreply.github.com>
2025-01-22 13:45:20 -07:00
Caleb Doxsey
6e1fabec0b
authorize: cache warming (#5439)
* authorize: cache warming

* add Authorize to test?

* remove tracing querier

* only update connection when it changes
2025-01-22 09:27:22 -07:00
Joe Kralicky
396c35b6b4
New tracing system (#5388)
* update tracing config definitions

* new tracing system

* performance improvements

* only configure tracing in envoy if it is enabled in pomerium

* [tracing] refactor to use custom extension for trace id editing (#5420)

refactor to use custom extension for trace id editing

* set default tracing sample rate to 1.0

* fix proxy service http middleware

* improve some existing auth related traces

* test fixes

* bump envoyproxy/go-control-plane

* code cleanup

* test fixes

* Fix missing spans for well-known endpoints

* import extension apis from pomerium/envoy-custom
2025-01-21 13:26:32 -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
fb7b61a677
cleanup headers (#5408)
* cleanup headers

* return issuer format errors

* go mod
2025-01-06 09:52:29 -07:00
Joe Kralicky
68764407b8
authorize: enable WaitForReady on databroker query requests (#5415)
* authorize: enable WaitForReady on databroker query requests

(cherry picked from commit 1709a7b1f61d7b45c4a60d9374223d252260f576)

* go mod tidy
2025-01-03 11:01:16 -05:00
Caleb Doxsey
85ef08b3a0
authorize: handle gRPC requests (#5400) 2024-12-19 08:46:53 -07:00
Kenneth Jenkins
683c5a2eac
authorize: change handling of empty groups claim (#5394)
Make sure to serialize the JWT "groups" claim as an empty list rather
than a JSON null. This matches the behavior of Pomerium v0.27.2 and
earlier, and should provide better compatibility with some third-party
libraries.
2024-12-11 12:55:04 -08:00
Denis Mishin
2bb70258c3
authorize/log: remove audit logging (#5369) 2024-11-22 14:32:52 -05:00
Caleb Doxsey
3a8bdde211
authorize: remove wait for ready (#5376) 2024-11-22 10:17:00 -07:00
Caleb Doxsey
37017e2a5b
authorize: rewrite header evaluator to use go instead of rego (#5362)
* authorize: rewrite header evaluator to use go instead of rego

* cache signed jwt

* re-add missing trace

* address comments
2024-11-07 13:07:16 -07:00
Caleb Doxsey
ef12fda55c
authorize: additional header evaluator tests (#5363)
* authorize: additional header evaluator tests

* add groups to jwt test
2024-11-07 09:22:35 -07:00
Joe Kralicky
82fb9cf29d
authorize: serialize errors in metav1.Status format when kubernetes user-agent is detected (#5334)
* authorize: serialize errors in metav1.Status format when kubernetes user-agent is detected

* update unit tests
2024-11-06 11:51:51 -05:00
Joe Kralicky
4f0ff35b4c
Decouple audience claim value from issuer format (#5345) 2024-10-25 16:21:19 -04:00
Joe Kralicky
fe31799eb5
Fix many instances of contexts and loggers not being propagated (#5340)
This also replaces instances where we manually write "return ctx.Err()"
with "return context.Cause(ctx)" which is functionally identical, but
will also correctly propagate cause errors if present.
2024-10-25 14:50:56 -04:00
Joe Kralicky
e1880ba20f
Add new request header variable 'pomerium.jwt' (#5339) 2024-10-25 14:35:42 -04:00
Joe Kralicky
a42e286637
Add new jwt issuer format route option (#5338) 2024-10-25 13:07:47 -04:00