-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GRPC API error handling is wrong #6225
Comments
All of these issues seem to be related to the way the Teleport library performs authorization and is not specific to gRPC. Most of these are intentional and are not easily changed, so it would be best to work around them when possible.
This could mean that the server address is wrong or the user's keys are wrong. If you are using
3, 5) This is intentional for security purposes: Lines 368 to 375 in fbae7ad
Are you able to avoid the access denied case by ensuring you only use users's with proper permissions? Or only go through with affecting the cloudformation state when the action is performed by an admin role? |
@Joerger @russjones regarding |
|
1 - Okay, this is not important at all. I think, if knowing the access state presents the security risk - we should sacrifice convenience in the sake of security and treat all the "Not Found" errors as real. @klizhentas @Joerger |
(nit) When I try to delete role belongs to a user via tctl, I get:
"ERROR: failed to delete role that still in use by a user. Check system server logs for more details."
It does not specify which user or users are involved, and, in the same time, logs are empty (most likely, -d will tell me something, but I do not usually start Terraform with -d)
(important) If keys are expired, no meaningful error is generated. After a long timeout, it reports the following instead:
"Error: all auth methods failed
context deadline exceeded"
Code 503 (Gateway timeout?). This error could mean network timeout. I need to know for sure that keys are wrong to report it to the user.
(nit) If I try to generate keys for a missing user via tctl, instead of meaningful message, I get:
"Error: [10] access denied"
I expect to have "user is missing".
(important) If I use keys for a user missing on Teleport side, instead of meaningful message, I get:
"Error: [10] access denied"
I expect to get a message that something is wrong with my keys, "User %u not found" is preferrable.
(blocking) If I use user which has no rights on performing specific action, instead of meaningful message, I get:
"Error: not found"
In the same time, if I forgot to add permissions on some resources to this user, I get the same error.
I expect to get something like "User %u has no permissions to perform CreateUser" with 403 in case I have no perms, and 404 in case I try to access a resource which does not exist, but I have rights to operate on.
That is very confusing because I need to distinguish "no access" and "does not exist" situations in order to make Terraform provider work correctly with resources deleted outside Terraform (see https://github.com/hashicorp/terraform-provider-aws/blob/main/aws/resource_aws_cloudformation_stack_set_instance.go#L192, I need to know for sure if a resource is missing in the same situation on my side)
The text was updated successfully, but these errors were encountered: