Skip to content

Commit

Permalink
fix runas message for tomcat
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonEverling committed Feb 2, 2024
1 parent 6c2377e commit 22388fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/usr/lib/ocie/include/config/tomcat
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function tomcat_set_env()
{
echo "export JAVA_OPTS=\"${JAVA_OPTS} ${APP_PARAMS}\"" > ${CATALINA_HOME}/bin/setenv.sh
echo "export VADC_IP_REG=\"${APP_PROXIES}\"" >> ${CATALINA_HOME}/bin/setenv.sh
chown tomcat:tomcat "${CATALINA_HOME}/bin/setenv.sh";
chown ${APP_OWNER}:${APP_GROUP} "${CATALINA_HOME}/bin/setenv.sh";
chmod a+x "${CATALINA_HOME}/bin/setenv.sh";
}

Expand Down
9 changes: 7 additions & 2 deletions src/usr/sbin/ociectl
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,15 @@ function ocie_start()
ocie_keys;
ocie_config;
ocie_deploy;
if [[ "${APP_OWNER}" == "root" ]];then
RUNAS="${APP_OWNER}";
# DISA STIG V-222986, Tomcat owner is root but runas is tomcat
if [[ "${APP_TYPE}" == "tomcat" ]];then
RUNAS="tomcat";
fi;
if [[ "${RUNAS}" == "root" ]];then
echo "Ocie: Application is set to run as [ root ], set APP_OWNER to change the account";
else
echo "Ocie: Application will run as [ ${APP_OWNER} ] OR you can set APP_OWNER to [ root ] and risk it for the biscuit";
echo "Ocie: Application will run as [ ${RUNAS} ] OR you can set APP_OWNER to [ root ] and risk it for the biscuit";
fi;
echo "Ocie: Initialization complete, starting container";
app_start;
Expand Down

0 comments on commit 22388fc

Please sign in to comment.