pomerium/authorize
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
..
evaluator authorize/evaluator/opa/policy: fix allow rules with impersonate (#1094) 2020-07-17 22:07:11 +07:00
authorize.go options refactor (#1088) 2020-07-16 14:30:15 -06:00
authorize_test.go options refactor (#1088) 2020-07-16 14:30:15 -06:00
check_response.go implement google cloud serverless authentication (#1080) 2020-07-16 08:25:14 -06:00
google_cloud_serverless.go implement google cloud serverless authentication (#1080) 2020-07-16 08:25:14 -06:00
google_cloud_serverless_test.go implement google cloud serverless authentication (#1080) 2020-07-16 08:25:14 -06:00
grpc.go kubernetes apiserver integration (#1063) 2020-07-14 08:33:24 -06:00
grpc_test.go options refactor (#1088) 2020-07-16 14:30:15 -06:00
run.go grpc: rename internal/grpc to pkg/grpc (#1010) 2020-06-26 09:17:02 -06:00
session.go options refactor (#1088) 2020-07-16 14:30:15 -06:00
session_test.go options refactor (#1088) 2020-07-16 14:30:15 -06:00