Certified Application Security Engineer – Java (CASE-Java) — Question 7
Alice, a Server Administrator (Tomcat), wants to ensure that Tomcat can be shut down only by the user who owns the Tomcat process. Select the appropriate setting of the CATALINA_HOME/conf in server.xml that will enable him to do so.
Answer options
- A. < server port="" shutdown="" >
- B. < server port="-1" shutdown="" >
- C. < server port="-1" shutdown="SHUTDOWN" >
- D. < server port="8080" shutdown="SHUTDOWN" >
Correct answer: C
Explanation
The correct answer is C because setting the server port to -1 disables the HTTP connector while allowing shutdown commands that match 'SHUTDOWN' to be processed, ensuring only the owner can shut it down. Option A does not specify a shutdown command, making it ineffective. Option B is similar to C but lacks the shutdown command, and option D allows shutdown but does not restrict it to the owner since it does not disable the port.