pomerium/internal
Cuong Manh Le 408f201d16
authorize/evaluator/opa/policy: fix allow rules with impersonate (#1094)
Currently, with impersonated request, the real user email/group still
has effects.

Example:

	data.route_policies as [{
	    "source": "example.com",
	    "allowed_users": ["x@example.com"]
	}] with
	input.databroker_data as {
	    "session": {
	        "user_id": "user1"
	    },
	    "user": {
	        "email": "x@example.com"
	    }
	} with
	input.http as { "url": "http://example.com" } with
	input.session as { "id": "session1", "impersonate_email": "y@example.com" }

Here user "x@example.com" is allowed, but was impersonated as
"y@example.com". As the rules indicated, the request must be denied,
because it only allows "x@example.com", not "y@example.com". The current
bug causes the request is still allowed.

To fix it, when evaluates rules for allowed email/group/domain, we must checking
that the impersonate email/groups is not set/empty.

Fixes #1091
2020-07-17 22:07:11 +07:00
..
autocert options refactor (#1088) 2020-07-16 14:30:15 -06:00
cmd/pomerium options refactor (#1088) 2020-07-16 14:30:15 -06:00
controlplane authorize/evaluator/opa/policy: fix allow rules with impersonate (#1094) 2020-07-17 22:07:11 +07:00
databroker Add storage backend interface (#1072) 2020-07-15 09:42:01 +07:00
directory internal/directory: improve google user groups list (#1092) 2020-07-17 16:51:26 +07:00
encoding cryptutil: move to pkg dir, add token generator (#1029) 2020-06-30 15:55:33 -06:00
envoy internal/envoy: improve handleLogs (#929) 2020-06-19 09:14:10 +07:00
fileutil *: remove import path comments (#545) 2020-03-16 10:13:47 -07:00
frontend authorize/evaluator/opa/policy: fix allow rules with impersonate (#1094) 2020-07-17 22:07:11 +07:00
hashutil authenticate: save oauth2 tokens to cache (#698) 2020-05-18 17:10:10 -04:00
httputil config: add PassIdentityHeaders option (#903) 2020-06-22 10:29:44 +07:00
identity grpc: rename internal/grpc to pkg/grpc (#1010) 2020-06-26 09:17:02 -06:00
log envoy: use envoy request id for logging across systems with http and gRPC (#691) 2020-05-18 17:10:10 -04:00
middleware authorize: allow CORS preflight requests (#672) 2020-05-18 17:10:10 -04:00
protoutil feature/databroker: user data and session refactor project (#926) 2020-06-19 07:52:44 -06:00
scheduler feature/databroker: user data and session refactor project (#926) 2020-06-19 07:52:44 -06:00
sessions kubernetes apiserver integration (#1063) 2020-07-14 08:33:24 -06:00
telemetry cache: add client telemetry (#975) 2020-06-22 18:18:44 -04:00
testutil controlplane: xds unit tests (#770) 2020-05-25 11:14:07 -06:00
tripper *: remove import path comments (#545) 2020-03-16 10:13:47 -07:00
urlutil cryptutil: move to pkg dir, add token generator (#1029) 2020-06-30 15:55:33 -06:00
version *: remove import path comments (#545) 2020-03-16 10:13:47 -07:00