JFrog Advanced Scans Demo: Scanning WebGoat
JFrog Advanced Scans Demo: Scanning WebGoat
This article covers scanning a package that is known to be vulnerable, it is a good way to demonstrate that both Xray and JFrog Advanced Scans (JAS) are working as expected.
We published a great blog which goes into much more detail about this here, this article will cover replicating the findings. WebGoat is a deliberately insecure web application intended to demonstrate security scanning systems like Xray. JAS will be able to show us which vulnerabilities are applicable or not.
Initial Setup
First, make sure both Artifactory and Xray have been installed in the right environment. If you're setting up this demo in JFrog Cloud, you should already be all set and ready to go.
If you're setting things up in a self-hosted environment, you'll need to use a Helm installation, JFrog Advanced Scan mainly supports Helm installations. It is recommended to also set up Artifactory and Xray with helm too.
Instructions on how to install Artifactory on Helm can be found here and for Xray here. Then, please install and set up JAS so it is connected to Xray and ready to scan.
Next, it's time to set up Xray to scan packages, and Artifactory to pull Docker images. Details on how to do this for the first time are covered in this on-boarding guide.
In short, you have to set up a remote Docker repository and then pull the WebGoat image through it to cache it in Artifactory. Xray can then scan the image after its database has been loaded with vulnerability data.
Docker PullAt the end of the set up process, you can pull the webgoat image through the remote using a command like this:
#Subdomain method docker pull docker.art.local/webgoat/webgoat-8.0 #Repository Path method docker pull art.local/docker-remote/webgoat/webgoat-8.0
Xray will scan the image automatically, if it hasn't been scanned yet add the repository in the Admin -> Xray -> Settings -> Indexed Resources menu.
This is what the Xray scan should look like in the Artifactory -> Artifacts -> docker-remote menu if the scan is completed successfully:
Using an Advanced Scan
The default Xray scan of this package should reveal over 500 CVEs, as this package has many dependencies with known vulnerabilities. Xray is able to detect these, and we will focus on two CVEs from the original blog: CVE-2013-7285 (Applicable) and CVE-2022-21724 (Not applicable).
The "Advanced Scan" option should be available if JAS is installed and running correctly. You need to initiate an Advanced Scan after reviewing the original Xray results.
You can use the filter item to locate each CVE and review their details. In particular, note the "Impact Paths" chart to see where Xray found the vulnerability within the image layers:
CVE-2013-7285
The blog goes into more detail about why exactly this CVE is applicable, and it should appear with these menu items after Xray and JAS have completed their scans.
As described in the blog, the Postgres issue that Xray initially detected in the JDBC driver doesn't apply to the image because the vulnerable function isn't ever called.
There should be similar findings for the rest of the ~500 security vulnerabilities, more than half of the "Critical" CVEs shouldn't apply: