Closed gfou-al closed 2 years ago
My SSO appears to be working OK. However, I do get the same error when I try to use the aws ssm start-session command with "An error occurred (ForbiddenException) when calling the GetRoleCredentials operation: No access"
We've been looking at it and regardless of which server you use when logging in it always picks one, not the one you want. So when you attempt to connect it errors because you are not connected to the server you expect. Still looking at it
Can you update our guidance document based on what we've found?
Doing further investigation. Found I connect to core-vpc-sandbox (not sure why) as terraform and the policies against this ID are terraform AllowServiceLinkedRole which probably doesn't provide enough access to change accounts/roles etc.
In my case I created a new key and added this to the mod platform environments and the ssh started to work.
As it's now working I will move this to closed. There was an issue with the NACL change stopping keys being sent through but mine was the key no longer worked (swapped laptop since they were generated) and new ones solved this issue.
The issue with the bastion host key change warning (https://github.com/ministryofjustice/modernisation-platform/issues/1307) has been resolved with this PR https://github.com/ministryofjustice/modernisation-platform/pull/2181.
However, I was not able to use an SSO profile to connect to the bastion as documented here: https://user-guide.modernisation-platform.service.justice.gov.uk/user-guide/accessing-ec2s.html#accessing-ec2s
~/.aws/config
~/.ssh/config
To reproduce the issue, follow these steps:
Or, to narrow it down a bit further, follow the steps:
Instead, I used an IAM profile in
~/.aws/config
, for example:And used the above profile for the ProxyCommand inside the
.ssh/config
.I am unsure if we should update the documentation to use an IAM profile instead of an SSO profile, but that's what made it working for me locally in order to be able to test. Another question is, how the SSO profile worked in the first place and what made it stop working. I created a PR for the ops team to revert the
sso:GetRoleCredentials
permission from modernisation_platform_developer policy because it did not help resolving the issue with the SSO profile: https://github.com/ministryofjustice/aws-root-account/pull/581