28
loading...
This website collects cookies to deliver better user experience
installbuilder
, found in the compressed file you downloaded. Hit Next
(after each of the following steps as well).fortify.license
issourceanalyzer
from the command line. A second way is using the Scan Wizard to help you create a script that runs the scan. And the third way is to use the Audit Workbench to run your scan, which is probably the easiest one. The last two methods eventually run sourceanalyzer
. Unfortunately, if we’re talking about an Angular project — but this applies to any project that contains Typescript files, the only way I found to scan Typescript files was to use the command line.sourceanalyzer
by looking at how the generated script calls it.ScanWizard
executable), which generates a script for your platform, based on some inputs and options. Run it, and you will see a wizard with this screen (I have already selected a Project Root):Add Project Root
button and specify the path to your application. Then hit Next
. The wizard will then scan your project root and find all the source code files that it can potentially scan. It might take a few seconds. You will now see this screen:node_modules
unless you want to scan all your dependencies. By deselecting directories, the wizard will update the file count and automatically detect the languages used in those directories. You can deselect languages as well if you don’t want to scan a particular set of files. Note that Typescript doesn’t appear in the list of languages. Don’t worry, I’ll tell you later how to add Typescript files to the scan.Next
will take you to the Translation and Scan screen of the wizard. In this screen you select for which platform you want to generate a script. You can also select whether you want a quick scan. Note that if you select this option, your scan will be faster, but you will be sacrificing accuracy. I recommend that you use this option the first time you run a scan. That way you don’t have to wait as long to make adjustments, if needed. Once you’re satisfied with your settings, you can turn off the “quick scan”.Next
button, you end up with the actual script:Finish
the wizard and you will find the output script on your project’s root directory. By default the script didn’t have executable rights after it gets created. To fix that, simply add executable rights like this on a UNIX-like system:chmod +x FortifySCA.sh
bin
directory to your PATH environment. On Unix-like systems, you do something like this:export PATH=$PATH:/Applications/Fortify/Fortify_SCA_and_Apps_18.20/bin
com.fortify.sca.hoa.Enable=true
com.fortify.sca.Phase0HigherOrder.Languages=javascript,typescript
com.fortify.sca.EnableDOMModeling=true
-D
option on the command-line{Fortify Installed Dir}/Core/config/fortify-sca-quickscan.properties
file, but only if you specify the-quick
option to run a “quick” scan.Core/config/fortify-sca.properties
file.Core/config/fortify.properties
which has more higher-level properties that users seldom need to change. You could also put your properties here../FortifySCA.sh -Dcom.fortify.sca.EnableDOMModeling=true -
Dcom.fortify.hoa.Enable=true -
Dcom.fortify.sca.Phase0HigherOrder.Languages=javascript,typescript
sourceanalyzer
. But you could simply reference the same Build ID that your script generated (look for BUILDID=
in your script).sourceanalyzer -b <build_id> clean
sourceanalyzer -b <build_id> <path_to_code_root>/**/*.ts
sourceanalyzer -Xmx14745M -Xms400M -Xss24M -b <build_id> -quick -scan -f results.fpr
-X**
flags, and also providing the -quick
flag). This is because I ran this on my laptop, which doesn’t have enough memory to run a full scan. Remove these options once you have your final setup on a machine that has more than 16GB of memory. See the documentation links at the end of this article for system requirements..fpr
) of your scan. Audit Workbench is one of the applications that you can download with Fortify. In it, you see all the vulnerabilities categorized by levels; Critical, High, Medium, and Low.Don’t wait until you’re ready to ship to scan your application.
ReportGenerator
and BIRTReportGenerator
. I had used the open source reporting engine BIRT before (and liked it), and it was recommended by the documentation anyway, so that’s the one we’re using.BIRTReportGenerator -template "OWASP Top 10" -source results.fpr -output myreport.pdf -format PDF -showSuppressed -Version "OWASP Top 10 2017"
BIRTReportGenerator -help
--Version
option for some of the report templates. These target specific versions of specifications that you might be interested in being compliant.Note that the free trial version of Fortify on Demand does not support Typescript
.fpr
files). It makes it easier to see trends, and make comparisons between scans.tslint
for example. However, if your company is already licensing Fortify for WebInspect (dynamic analysis), then most likely you also have access to the static code analyzer.