Best practices for allowing an outside developer access to my AWS instance?

We have an outside developer that we have hired to build a piece of enterprise software for us. They are going to be using an S3 bucket (creating it and filling it) as part of the development process. Post-development, the application will obviously need access to the bucket, but the developer will not.

What are the best practices for giving the outside guy enough permissions to develop and test the app, but not so much they can do damage within my AWS instance. I also want to be able to revoke their access once the development process is complete and add them back for future development and feature add-ons.

Thoughts? Anything I should definitely NOT do in this process?

Thanks in advance for your comments…

[update 1] Developer is asking for " “Bucket Name”, “Access Key Id”, “Secret Access Key” also we need GUI access to S3 bucket because we need to set the ACL rule for the bucket in order to make it accessible only for our application " - Risks with this???

I would create a non permissive role they can use to assume a developer role that has the permissions they would need.

As far as I know the best practice for such things is to create IAM roles and/or users, and grant specific permissions that way - https://docs.aws.amazon.com/iam/

Do not give them access to the production app. Create a snapshot/backup of any current resources they will need access to and create a dev environment separate from the existing environment (no access by IAM permissions or by networking). Give him IAM access to that environment ONLY and SSH access to that environment ONLY. Once the app is complete remove their access. Deploy the app onto your production instance.

Create a code repo that has branch protections. CI/CD from that repo to separate non-prod/prod environments, however you guys do it. Create a role that has read access only to those environments.

To revoke access remove the trust relationship on that role.

Alternatively create a role that has write access to the non-prod environments that they can use.

This, combined with IAM, seems like the way to go. How would I go about creating a S3 development environment? (not a professional system admin here…)

IAM and roles is the direction I was heading. Presumably, I should create a role for the application as well as the third-party developer? That way the app still has access to the resources created after the development process?

dont give him access to aws if all he needs is to put things in to s3; have him commit the files to your github repo and setup a trigger to push files to s3 as part of the ci/cd pipeline; you can google for examples on how to do this; once project is done remove his access from your github repo

Yes exactly. The role should also be created together with the resources for the application through either Cloudformation or Terraform (or similar tools).

For the 3rd party either create a user they can log into with limited rights or a role they can assume from their AWS account. I’d do the User account as its more visible in the long run.

See the updates to my original post for the permissions they have requested…

I have used Localstack multiple times with good results. Localstack allows you to run services on your own machine that imitate some core AWS services such as S3, SQS, and DynamoDB.

In your application, you will have to point to a local service instead of the default location for the AWS service. In other words, the part of your code where a client for the AWS service is created, you will have to create a client pointing to your own machine instead.

you can create an IAM role and assign it to your ec2 instances; this way your app will have permissions on accessing the bucket and you dont have to worry about rotating out IAM user secret/access tokens once the dev leaves; its still best practice to use some form of ci/cd pipeline to update the code deployed on the instances; PM me if you want to chat in more details

They don’t need GUI access to set a bucket policy, they can use the CLI or API. They should be able to just give you a copy of the policy which you can then review and set on the bucket yourself. If for some reason they absolutely need to be able to change it themselves you can create a policy that allows s3:PutBucketPolicy on the specific bucket they should have access to.

> cross-account assume role

O.O

Right now all our route 53 traffic is handled by one account shared across all of our accounts. Is this “cross-account assume role” how I would automate the update of a route 53 record from any of the other accounts? what’s the best practice here? is there some magic to this for cloudformation?

Just create a separate AWS account for dev purposes, and give him access to that.