I’m trying to give some users access to a specific target in a project.
So at project scope, I have configured the following permission for those users: id=ttcp_Iy5NBZUphs;actions=authorize-session
But they are unable to connect:
$ boundary connect ssh -target-id ttcp_Iy5NBZUphs
Error from controller when performing authorize-session against target:
Error information:
Code:
Message: Forbidden
Status: 403
If I change the permission to id=*;type=target;actions=authorize-session, then they are able to connect, but of course to all targets in the project, which I would like to avoid.
I have just given it a try by updating my Terraform manifest, but when applying them, I’m having to following error:
Error: error updating grant strings on role: {"status":400, "code":"InvalidArgument", "message":"Errors in provided fields.", "details":{"request_fields":[{"name":"grant_strings", "description":"Improperly formatted grant \"id=ttcp_Iy5NBZUphs;type=target;actions=authorize-session\"."}]}}
I am facing the same issue when assigning a single target to the user
When i add this grant id=ttcp_Iy5NBZUphs;type=target;actions=authorize-session
i get this error Grant “id=ttcp_j0cELv3UI5;type=target;actions=authorize-session” could not be parsed successfully: parsed grant string would not result in any action being authorized
Then the grant id=ttcp_Iy5NBZUphs;actions=authorize-session should do the trick, right?
But by doing so, the users are still not able to connect, getting a 403 error.
Even though i tried using grant “id=ttcp_j0cELv3UI5;actions=authorize-session”,
still getting 403(Error from controller when performing authorize-session against target)
This is the role i am using for accessing target for a user
Role information:
Created Time: Sat, 24 Oct 2020 20:39:37 IST
Description: My first role
Grant Scope ID: p_CjaO7Xs3SA
ID: r_ajOpLRTzib
Name: my_role
Updated Time: Sun, 25 Oct 2020 11:47:23 IST
Version: 13
Scope:
ID: p_CjaO7Xs3SA
Name: One Infra
Parent Scope ID: o_EdzZTT1rjA
Type: project
Principals:
ID: u_M5ZUUSvuti
Type: user
Scope ID: o_EdzZTT1rjA
My guess is that the user you’re using to access the target it not actually the one specified in the grants. Can you verify that you are in fact logging in as that user?
Going through a login and connect session on the CLI and pasting the commands/output would be helpful.
This is actually a bug in the boundary client, as it converts the id to lower case before storing it, which causes the grant to not succeed. See as follows:
$ boundary roles add-grants -id=r_8qZLxfoobar -grant="id=hcst_9kF4FooBar;type=*;actions=create,delete,list,update"
Created Time: Wed, 18 Nov 2020 23:56:32 UTC
[..snip...]
Canonical Grants:
id=hcst_9kf4foobar;type=*;actions=create,delete,list,update
I’ve tested and confirmed that any grants targeting a specific ID don’t work due to this lowercasing. This is using the boundary server and client v0.1.1 downloaded from the Ubuntu/Debian package listed here Install Boundary | Boundary | HashiCorp Developer