These scripts can be used to do some security checks in code, using tools as OWASP Dependency Check, Trivy, Sonarqube and others.
The scripts uses docker images for these tools, so it can be easier to keep them updated.
you can put these scripts in some folder in your PATH, so you can easily run them.
- update-checks
This script will update the latest docker images for Dependency Check, Trivy, Sonarqube and other tools used in the scripts. It will also update the db for Trivy
It is useful to run this script once a day
- dependency-check
This script will receive one parameter : The name of the project to be scanned (This is the title that will appear in the report)
It will run the dependency check against the package-lock.json file
- trivy-check-img
This script will receive one parameter : The name of the docker image to be scanned
It will scan the specified image for CRITICAL, HIGH, MEDIUM, and LOW OS (Operating System) vulnerabilities in the image, while it will ignore unfixed vulnerabilities
There are two other Trivy scripts.
trivy-check-fs will check the package-lock.json file for vulnerabilities (similar to dependency-check)
trivy-check-conf will check for configuration problems (i.e in Dockerfile)
- sonar-server
- sonar-check
These scripts will allow you to run a local Sonarqube server that will allow you to run and review sonar checks.
The sonar-server script will run the local sonar server. It will set it to be restarted always, so you only have to run it once.
Once the server is running for the first tie, you have to configure it by login into
- url: http://localhost:9000
- login: admin
- password: admin
The sonar-check script will run the sonar checks against your current folder. You will be able to see results in the local Sonarqube server.
You must update the script by setting the SONAR_LOGIN variable, to be the same as the acess token you generated in the local Sonarqube server.
You must have a sonar-project.properties file in the folder to be reviewed. You can guide yourself form the sample file provided.
- detect-secrets
- detect-secrets-all
This script will check for secrets in the current commit
This script will check for secrets in the current folder.
It will check inside node_modules also, so be carefull
- virus-check
This script will check the local folder for viruses using the ClamAV antivirus.
The antivirus db is also updated with the update-checks script.