The Hawkeye Scanner CLI is a project security, vulnerability and general risk highlighting tool. It is meant to be integrated into your pre-commit hooks and your pipelines.
Running & Configuring the Scanner
The Hawkeye scanner-cli assumes that your directory structure is such that it keeps the toolchain’s files on top level. Roughly, this is what it boils down to:
package.json
on top levelGemfile
on top levelrequirements.txt
on top levelcomposer.lock
on top levelbuild
(gradle) or target
(maven) folder, and include .java
and .jar
filesThis is not exhaustive as sometimes tools require further files to exist. To understand how the modules decide whether they can handle a project.
Also Read : Twifo CLI:Get Twitter User Information 2019
The docker image is hands-down the easiest way to the scanner. Please note that your project root (e.g. $PWD) needs to be mounted to /target
.
docker run –rm -v $PWD:/target hawkeyesec/scanner-cli
The docker build is also the recommended way to run the scanner in your CI pipelines. This is an example of running Hawkeye against one of your projects in GoCD:
npm
You can install and run hawkeye in a Node.js project via
npm install –save-dev @hawkeyesec/scanner-cli
npx hawkeye scan
This method is recommended in a Node.js project, where the other toolchains (e.g. python, ruby) are not required.
With this method, it is also recommended to invoke the scanner in a git pre-commit hook (e.g. via the pre-commit package) to fail the commit if issues are found.
Configuration Files (recommended)
You can configure the scanner via .hawkeyerc and .hawkeyeignore files in your project root.
The .hawkeyerc file is a JSON file that allows you to configure …
{
“all”: true|false,
“staged”: true|false,
“modules”: [“files-ccnumber”, “java-owasp”, “java-find-secbugs”],
“sumo”: “http://your.sumologic.foobar/collector”,
“http”: “http://your.logger.foobar/collector”,
“json”: “log/results.json”,
“failOn”: “low”|”medium”|”high”|”critical”,
“showCode”: true|false
}
The .hawkeyeignore
file is a collection of regular expressions matching paths and module error codes to exclude from the scan, and is equivalent to using the --exclude
flag. Lines starting with #
are regarded as comments.
Please note that any special charaters reserved in regular expressions (-[]{}()*+?.,^$|#\s) need to be escaped when used as a literal!
Please also note that the module error codes are usually not shown, since they are not primarily relevant for the user.
If you want to exclude a certain false positive, you can display the module error codes with the flag --show-code
or the showCode
property in the .hawkeyerc
.
^test/
this is a comment
^README.md
How it works
Hawkeye is designed to be extensible by adding modules and writers.
Modules are basically little bits of code that either implement their own logic, or wrap a third party tool and standardise the output. They only run if the required criteria are met. For example: The npm outdated
module would only run if a package.json
is detected in the scan target – as a result, you don’t need to tell Hawkeye what type of project you are scanning.
-m files-entropy
switch.If you have an idea for a module, please feel free open a feature request in the issues section.
If you have a bit of time left, please consider sending us a pull request. To see modules work, please head over to the modules folder to find how things are working.
Kali Linux 2024.4, the final release of 2024, brings a wide range of updates and…
This Go program applies a lifetime patch to PowerShell to disable ETW (Event Tracing for…
GPOHunter is a comprehensive tool designed to analyze and identify security misconfigurations in Active Directory…
Across small-to-medium enterprises (SMEs) and managed service providers (MSPs), the top priority for cybersecurity leaders…
The free and open-source security platform SecHub, provides a central API to test software with…
Don't worry if there are any bugs in the tool, we will try to fix…