Performance Charts must set the secure flag for cookies.
Severity | Group ID | Group Title | Version | Rule ID | Date | STIG Version |
|---|---|---|---|---|---|---|
| medium | V-256643 | SRG-APP-000439-WSR-000155 | VCPF-70-000033 | SV-256643r888420_rule | 2023-02-21 | 1 |
Description
The secure flag is an option that can be set by the application server when sending a new cookie to the user within an HTTP response. The purpose of the secure flag is to prevent cookies from being observed by unauthorized parties due to the transmission of a cookie in clear text.
By setting the secure flag, the browser will prevent the transmission of a cookie over an unencrypted channel. The Performance Charts is configured to only be accessible over a Transport Layer Security (TLS) tunnel, but this cookie flag is still a recommended best practice.
ℹ️ Check
At the command prompt, run the following command:
# xmllint --format /usr/lib/vmware-perfcharts/tc-instance/webapps/statsreport/WEB-INF/web.xml | sed 's/xmlns=".*"//g' | xmllint --xpath '/web-app/session-config/cookie-config/secure' -
Expected result:
<secure>true</secure>
If the output of the command does not match the expected result, this is a finding.
✔️ Fix
Navigate to and open:
/usr/lib/vmware-perfcharts/tc-instance/webapps/statsreport/WEB-INF/web.xml
Navigate to the <session-config> node and configure it as follows:
<session-config>
<cookie-config>
<http-only>true</http-only>
<secure>true</secure>
</cookie-config>
<session-timeout>6</session-timeout>
</session-config>
Restart the service with the following command:
# vmon-cli --restart perfcharts