We recently performed a PCI scan and one of the suggestion was that environment information shouldn't be disclosed. Does anyone have idea how to configure Glassfish server not disclose the server information.
I assume that you are referring to settings in the response headers. If so, you need to make three configuration changes, so start Glassfish and open its Administration Console. That's http://localhost:4848 in my case, but you may have something different.
Change 1:
-Dproduct.name=_{server}
where {server}
can be whatever you want, including an empty string. I chose -Dproduct.name=AnonymousServer
. Click Save. The value you specify will be set in the Server field of the response header. Change 2:
Change 3:
Finally, restart Glassfish, then connect to your application in a browser or a tool such as Postman, and verify that the response headers have changed. For example, here are before and after shots for a simple web application in Firefox, using its browser's developer tools. They show that after the configuration changes and restart:
Before the changes:
After the changes: