Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

200
Views
How is AWS Secrets Manager used in an Elastic Beanstalk application safe if the AWS_SECRET_KEY has to be stored in the EBS environment vars?

I have the following setup:

  • PHP Laravel application
  • AWS Elastic Beanstalk -> EC2 webserver
  • AWS Secret Manager to store the database password
  • Elastic Beanstalk environment variable to store the AWS_SECRET_KEY
  • TappNetwork/laravel-aws-secrets-manager to fetch the secrets

I used to store the database password (and other credentials) in the Beanstalk environment variables, but didn't want to store in plain text anymore.

I now store them in the AWS Secret Manager, but in order for the application to be able to fetch the secrets, the AWS_ACCESS_KEY_ID and AWS_SECRET_KEY need to be available in Laravel, so that they can be used in the communication between AWS SDK and our AWS setup.

This brings me back to square 1, because access to the access key and secret also allows access to the secret manager, if I'm not mistaken.

What am I missing here?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I now store them in the AWS Secret Manager, but in order for the application to be able to fetch the secrets,

You don't have to do this. Just like with regular EC2 instance, in EB you give permissions to SM or other AWS resources using EB instance profile.

This way your ENV is clean of any AWS keys, and AWS SDK automatically will query the profile on the instance to get the temp AWS credentials to access SM. You can also query the metadata yourself if you want to "manually" get these credentails.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!