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

Using gof3r in docker image to run on ECS #140

Open
dn-github opened this issue Aug 1, 2019 · 5 comments
Open

Using gof3r in docker image to run on ECS #140

dn-github opened this issue Aug 1, 2019 · 5 comments

Comments

@dn-github
Copy link

I am trying to use gof3r in my docker image and running the container on AWS ECS. The ECS has proper IAM set to access S3 bucket, hence I expect gof3r to download a file from my S3 bucket. However gof3r returns error saying 'No AWS Keys Found'.
Do I expect gof3r to run with IAM permission anytime soon?

@ajbeach2
Copy link

https://github.com/ajbeach2/s3gof3r

I forked for this specific reason. I haven't gotten around to submitting a PR but it seems this repo may or may not be actively maintained.

@ady1981
Copy link

ady1981 commented Aug 22, 2019

@ajbeach2
We tried to run github.com/ajbeach2/s3gof3r version on ECS instance (with proper credentials settings) but without success.
Here are the details:

  • we build a ecs_gof3r executable via:
    env GOOS=linux GOARCH=amd64 go build -o ecs_gof3r github.com/ajbeach2/s3gof3r/gof3r
  • we COPY the ecs_gof3r into docker image over ubuntu:16.04:
    COPY ./etc/ecs_gof3r /app/etc/ecs_gof3r
  • we test the credentials settings via running aws cli inside ECS instanse like this docker run example:
docker run -it \
...
 ${IMAGE_NAME} \
 /usr/local/bin/aws s3 cp s3://dev-gefjon-sandbox-2/test.txt -

The result was without errors.

  • but ecs_gof3r example did not run successfully:
docker run -it \
...
 ${IMAGE_NAME} \
/app/etc/ecs_gof3r get -b dev-gefjon-sandbox-2 -k test.txt --endpoint s3-eu-central-1.amazonaws.com

Output:

2019-08-22 12:40:37 gof3r error: no AWS keys found

That could we do wrong?

@ajbeach2
Copy link

@ady1981
aww sorry, i left out some details. My branch doesn't work with the CLI. I have only been using it as a package. I added a method called ECSKeys() that loads from keys the ECS role.

k, err := ECSKeys() // get S3 keys from ECS
if err != nil {
    return err
}

// Open bucket to put file into
s3 := New("", k)
b := s3.Bucket("bucketName")

@ajbeach2
Copy link

@ady1981 I just pushed a fix to master of my branch.

the change is here:
ajbeach2@e1c1768

This should work with the CLI now can you try again?

@ady1981
Copy link

ady1981 commented Aug 22, 2019

@ajbeach2
We rebuilt the CLI with the ECSKeys usage fix + dependence fix ('github.com/ajbeach2/s3gof3r' -> 'github.com/rlmcpherson/s3gof3r' in all imports) and now it works ok.
Thanks!

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