-
Notifications
You must be signed in to change notification settings - Fork 41.2k
adding a forced run_user assignment to launch.script #16667
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
Comments
@psytester Passing |
It depends on whether the security by design is a key feature of spring-boot or not. ;-) |
This comment has been minimized.
This comment has been minimized.
Hi, I'm looking forward to make a contribution to Spring and this issue seems a good start point. Focusing on the issue, I see it as a very very simple change with, probably, little impact. I only don't know yet about tests, can someone point me to where are defined tests for the launch script? |
Hi @wagnerluis1982, Thanks very much for offering to pick this one up. The launch script is unfortunately a little harder to test than the Java code. We have a series of integration tests here. Probably SysVinitLaunchScriptIT is the one you want to look at. Don't worry too much if you can't get to the tests, we can always add some ourselves before we merge. |
Hi @philwebb, Thanks. You may assign to myself this issue. I hope to have some code until weekend. |
Hi, about the
I, personally, prefer (a), but I wanted to hear your opinions. |
My preference would be to fail hard since it's probably a configuration error. |
Hi @philwebb, By "fail hard" you mean let the Or you mean to handle the error early? |
I'm not sure really. I just meant that ignoring the error and running normally isn't a good option. It looks like we try to use |
@philwebb I got and I agree, thanks! |
Closing in favor of PR #16973 |
The launch.script should be enhanced to be more security robust
spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/resources/org/springframework/boot/loader/tools/launch.script
The launch.script extracts the run_user in line 129 by the file owner
run_user=$(ls -ld "$jarfile" | awk '{print $3}')
But it should be possible to explicitly give the launch.script a RUN_AS=user, no matter who owns the file.
This prevents the following misconfigurations, which will currently cause the process to start as root.
id: ‘1010’: no such user
With the desired extension it would then be able to force the launcher to use the target user, no matter what the file system says.
Sysadmins are humans and making faults at installation ;-)
The text was updated successfully, but these errors were encountered: