pomerium/internal/controlplane
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
..
luascripts authorize/evaluator/opa/policy: fix allow rules with impersonate (#1094) 2020-07-17 22:07:11 +07:00
grpc_accesslog.go envoy: add duration and size to access log (#735) 2020-05-19 12:11:48 -06:00
grpc_xds.go envoy: support autocert (#695) 2020-05-18 17:10:10 -04:00
http.go envoy: use envoy request id for logging across systems with http and gRPC (#691) 2020-05-18 17:10:10 -04:00
server.go options refactor (#1088) 2020-07-16 14:30:15 -06:00
xds.go config: add a consistent route ID (#905) 2020-06-16 09:20:18 -04:00
xds_cluster_test.go implement google cloud serverless authentication (#1080) 2020-07-16 08:25:14 -06:00
xds_clusters.go implement google cloud serverless authentication (#1080) 2020-07-16 08:25:14 -06:00
xds_listeners.go cryptutil: move to pkg dir, add token generator (#1029) 2020-06-30 15:55:33 -06:00
xds_listeners_test.go cryptutil: move to pkg dir, add token generator (#1029) 2020-06-30 15:55:33 -06:00
xds_lua.go envoy: fix lua warning (#731) 2020-05-19 10:21:50 -06:00
xds_routes.go internal/controlplane: set envoy prefix rewrite if present (#1034) 2020-07-03 09:35:36 +07:00
xds_routes_test.go internal/controlplane: set envoy prefix rewrite if present (#1034) 2020-07-03 09:35:36 +07:00