-
Notifications
You must be signed in to change notification settings - Fork 41.2k
executable jar security problem (launch.script) #4935
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
Given that you control the contents of the |
Ok. It may be worth writing in the documentation that the conf file owner must file to be root not writable to any user (and folder where jar placed should also can not be writable to any user). Or may be check ownership/acl before execute conf file? And what about executable jar owned by user? If my java app hacked by somebody, hacker can overwrite my executable jar and obtain root privileges after system restart. |
You should lock the file down to prevent it from being changed. For example, you could use We'll make some updates to the documentation to describe these best practices. |
The conf file must also exists and be write protected via chattr for the same reason. May be check ownership & chattr +i flag before execute conf file? |
That's not the case. You don't have to use a
That's too strong an opinion for the launch script to take. You may not be running the app as root, e.g. you might be executing the app directly, rather than via init.d. Furthermore, there are also other ways to secure things other than using |
@see commit a889546 @see https://www.freedesktop.org/software/systemd/man/systemd.service.html @see https://www.freedesktop.org/software/systemd/man/systemd.directives.html @see http://docs.spring.io/spring-boot/docs/1.3.x/reference/html/deployment-install.html#deployment-systemd-service @see http://journal.thobe.org/2013/02/jvms-and-kill-signals.html A couple of links about unsecure behavior of the default init-script: @see https://habrahabr.ru/post/275203/ (in Russian) @see spring-projects/spring-boot#4935 Addressed to #399 [ci skip]
@see commit a889546 @see https://www.freedesktop.org/software/systemd/man/systemd.service.html @see https://www.freedesktop.org/software/systemd/man/systemd.directives.html @see http://docs.spring.io/spring-boot/docs/1.3.x/reference/html/deployment-install.html#deployment-systemd-service @see http://journal.thobe.org/2013/02/jvms-and-kill-signals.html A couple of links about unsecure behavior of the default init-script: @see https://habrahabr.ru/post/275203/ (in Russian) @see spring-projects/spring-boot#4935 Addressed to php-coder#399 [ci skip]
I created an executable jar with spring boot (spring-boot-maven-plugin, true)
When run as the init.d service (as root), script executes .conf file with root privileges.
man bash:
The text was updated successfully, but these errors were encountered: