cloud-gov / product

Program-level artifacts, workflow and issues for cloud.gov
Creative Commons Zero v1.0 Universal
29 stars 15 forks source link

Run March 2024 Pages ConMon scans #2958

Closed svenaas closed 3 months ago

svenaas commented 3 months ago

Re: #2956

cloud.gov Pages also provides continuous monitoring artifacts. The process for creating them is detailed below. Current we only run ZAP Scans.

ZAP Scans

From the ZAP documentation: "Zed Attack Proxy (ZAP) is a free, open-source penetration testing tool being maintained under the umbrella of The Software Security Project (SSP). ZAP is designed specifically for testing web applications and is both flexible and extensible."

We run ZAP from a Pages operator's local machine. ZAP opens a Firefox instance that is configured to proxy all requests through ZAP. ZAP can then analyze and modify the requests.

Preliminary work - Support User Setup

We scan our externally facing apps as support users of cloud.gov Pages, via the cloud.gov IdP, instead of admins. This avoids issues with ZAP "clicking" on links with undesired impacts.

Each user should have a support user account created in the zap-scans organization prior to their first run.

Install, Configure, and Update

Quit and restart ZAP if you change the JVM options

Running the ZAP scans

Running the ZAP scan takes approximately one hour but can consume a large amount of system resources during the final step:

Troubleshooting ZAP Scans

Ensure you are not running any other local webservers as the ports can infere with the scan.

If ZAP's Sites does not show the sites being visited, or if the scan operations do not seem to be successfully visiting sites, it may be necessary to disable Zscaler for the duration of the ConMon scan.

If a SecureAuth login loop occurs when trying to login to either of the production sites, it may be necessary to disable ZAP Firefox proxy settings prior to logging in by navigating to Settings -> Network Settings within Firefox and selecting the No proxy radio button . After successful authentication navigate back to Network Settings and select the Manual proxy configuration radio button. Reload both pages to update the site tree within ZAP.

If when you open ZAP's Firefox it fails to open displaying the "Explore your application with ZAP" landing page even though you've stopped Zscaler... try rebooting. Sometimes it's time, and it works.

In Firefox if you see a Java Unable to Connect Exception, try the following:

Close both Firefox and ZAP.

In ~/Library/Application Support/ZAP/log4j2.properties:

Change the following level's to debug so the entries look like this:

logger.paros.name = org.parosproxy.paros
logger.paros.level = debug

logger.zap.name = org.zaproxy.zap
logger.zap.level = debug

Open ZAP, follow the above and open Firefox. Try to go to the server that failed previously.

If that works, then change the levels back to info from debug, so they look like this:

logger.paros.name = org.parosproxy.paros
logger.paros.level = info

logger.zap.name = org.zaproxy.zap
logger.zap.level = info

Upload and wrap up

Upload all reports to Google Drive: https://drive.google.com/drive/u/0/folders/0B5fn0WMJaYDnaFdCak5WNWRGb1U in a folder named YYYYMMDD-ZAP-Nessus.

You can shut down ZAP and Firefox.

Acceptance criteria