Skip to content
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

ECS Support #45

Open
ajhodges opened this issue Jun 18, 2018 · 3 comments
Open

ECS Support #45

ajhodges opened this issue Jun 18, 2018 · 3 comments

Comments

@ajhodges
Copy link

I don't think this is really an issue with keymaker, nor is it something that's appropriate to turn into a PR... but here's some info on how to get keymaker working in an ECS container.

Setup openssh-server and keymaker in your Dockerfile and then create an entrypoint.sh script that looks like this:

#!/bin/bash
sed -i -e "2iexport AWS_CONTAINER_CREDENTIALS_RELATIVE_URI=$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI\\" /usr/sbin/keymaker-get-public-keys
sed -i -e "2iexport AWS_CONTAINER_CREDENTIALS_RELATIVE_URI=$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI\\" /usr/local/bin/keymaker-create-account-for-iam-user
exec "$@"

Then configure your task to use this entrypoint. This pulls the value of AWS_CONTAINER_CREDENTIALS_RELATIVE_URI into the keymaker scripts. This value has to be present for the IAM task role permissions to work with boto3/keymaker. There might be an easier/better way to pass this environment variable to the keymaker user as it executes those scripts, but this is the only way I could get it to work. Wanted to pass this along in case others come across the same issue.

@kislyuk
Copy link
Owner

kislyuk commented Jun 20, 2018

Thank you for posting this! Would you be interested in editing the Readme to add this information, and opening a PR?

@ajhodges
Copy link
Author

The only reason I didn't do that is because I'm honestly not that familiar with sshd and there may be a better way of passing the environment variable to the daemon other than 'patching' your scripts.

@maxcountryman
Copy link

@ajhodges this doesn't seem to be required. I'm running Keymaker with ECS and haven't needed to do any injection to make it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants