Why do all files in a deployed php app on elastic beanstalk belong to root

0

We're running a php app on elastic beanstalk, using the elastic beanstalk default php environment (and default options for everything). PHP 8.2 running on 64bit Amazon Linux 2023.

I've noticed that every file on our server instances running on elastic beanstalk belongs to root. This includes all the bundle files deployed using eb deploy and also anything uploaded on to the server at runtime (note we don't actually use uploading to the servers in production, we just tested it for this issue).

This doesn't seem right to me, I was expecting them to belong to 'webapp'. I've also noticed that the php get_current_user() command returns 'root'. Is this expected behaviour? Could this also be affecting the default stacks for other languages?

w
asked 3 months ago253 views
2 Answers
1
Accepted Answer

This turns out to be a mistake on our side with figuring out who the file owner is, fileowner($file) in php is not returning data

w
answered 3 months ago
profile picture
EXPERT
reviewed 2 months ago
profile picture
EXPERT
reviewed 3 months ago
0

This is an expected behavior, since Elastic Beanstalk is an AWS Managed Service (PaaS), the majority of the control will be taken by the default user (root). See the supported AWS Documentation for your reference:

Customizing Software on Linux Servers Custom Platforms Scripts

AWS
answered 3 months ago
profile picture
EXPERT
reviewed 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions