-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Configure the bearer token in the SecureStore - Document using ssh with aws-sso and ECS Server - Bump to v1.17.0 Fixes: #915
- Loading branch information
1 parent
446119c
commit 61145d5
Showing
9 changed files
with
203 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
PROJECT_VERSION := 1.16.1 | ||
PROJECT_VERSION := 1.17.0 | ||
DOCKER_REPO := synfinatic | ||
PROJECT_NAME := aws-sso | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Using aws-sso on remote hosts with SSH | ||
|
||
This is intended to show how to use your `aws-sso` credentials on a remote/bastion | ||
host, without requring you to install or configure `aws-sso` on that host, while maintaining | ||
security. | ||
|
||
## Overview | ||
|
||
**Note:** Before going any further, this document assumes you have already | ||
[installed and configured](quickstart.md) aws-sso on your local system. | ||
If not, do that now. :) | ||
|
||
Accessing one or more AWS Identity Center based IAM Roles uses the [ECS Server](ecs-server.md) | ||
feature and then running the ECS Server locally and using ssh to forward the port to the remote | ||
host. Security is provided via a bearer token you configure on each side and all traffic is | ||
encrypted over ssh. | ||
|
||
**Note:** The root user or anyone with [CAP_NET_RAW or CAP_NET_ADMIN](https://man7.org/linux/man-pages/man7/capabilities.7.html) | ||
will be able to intercept the HTTP traffic on the endpoint and obtain the bearer token | ||
and/or any IAM Credentials stored in the ECS Server. As of this time, `aws-sso` does | ||
not support HTTPS for full end-to-end encryption. | ||
|
||
## On your local system | ||
|
||
1. Configure a [bearer token](https://datatracker.ietf.org/doc/html/rfc6750#section-2.1) | ||
for security to prevent unauthorized use of your IAM credentials: | ||
`aws-sso ecs bearer-token -t 'Bearer <secret>` | ||
1. Start the ECS Server (preferably in a screen or tmux session): | ||
`aws-sso ecs run` | ||
1. Load your selected IAM credentials into the ECS Server: | ||
`aws-sso ecs load --profile=<aws profile name>` | ||
1. SSH to the remote system using the [-R flag to forward tcp/4144](https://man.openbsd.org/ssh#R): | ||
`ssh -R 4144:localhost:4144 <remotehost>` | ||
|
||
## On your remote system (once you have logged in as described above) | ||
|
||
1. Tell the AWS SDK how to talk to the ECS Server over SSH: | ||
`export AWS_CONTAINER_CREDENTIALS_FULL_URI=http://localhost:4144/` | ||
1. Tell the AWS SDK the bearer token secret from the first step on your local system: | ||
`export AWS_CONTAINER_AUTHORIZATION_TOKEN='Bearer <secret>` | ||
1. Verify everything works: | ||
`aws sts get-caller-identity` | ||
|
||
**Important:** You must choose a strong secret value for your bearer token secret! This is | ||
what prevents anyone else from using your IAM credentials without your permission. Your bearer | ||
token should be long and random enough to prevent bruteforce attacks. | ||
|
||
See the [ECS Server documentation](ecs-server.md) for more information about the ECS server and | ||
how to use multiple IAM role credentials simultaneously. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.