Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@silintl/vulnerability-scanner
Advanced tools
Scan your repos for vulnerabilities (such as dependencies with published security advisories)
Scan your repos for vulnerabilities (such as dependencies with published security advisories)
First, do this setup:
.env.dist
to .env
and add appropriate values.npm install
Next, use one of the following commands, depending on what you want to do. Note that if you also pass a URL to a CSV file specifying what versions of PHP and NodeJS various Docker images use, then any use of End-of-Life'd (EOL'd) versions of PHP and NodeJS will also be reported.
Run this, replacing "ORGANIZATION" with the desired GitHub org. name:
node cli/scan-github-org.js ORGANIZATION "[VERSIONS_CSV_URL]"
Run this, replacing "REPO" with the desired GitHub repo, in the format "repo-owner/repo-name":
node cli/scan-github-repo.js REPO "[VERSIONS_CSV_URL]"
Run this, replacing "WORKSPACE" with the desired Bitbucket workspace name:
node cli/scan-bitbucket-workspace.js WORKSPACE "[VERSIONS_CSV_URL]"
Run this, replacing "REPO" with the desired Bitbucket repo, in the format "repo-owner/repo-name":
node cli/scan-bitbucket-repo.js REPO "[VERSIONS_CSV_URL]"
Run this, replacing "GH_ORGANIZATION" with the desired GitHub org. name and "BB_WORKSPACE" with the desired Bitbucket workspace name:
node cli/scan-gh-bb.js GH_ORGANIZATION BB_WORKSPACE "[VERSIONS_CSV_URL]"
This library is also published as an npm package for use in other
JavaScript/Node applications:
https://www.npmjs.com/package/@silintl/vulnerability-scanner
To run this on AWS Lambda, see
https://github.com/silinternational/serverless-vulnerability-scanner
To run the (local) tests, simply run make test
. For more details, see the
Makefile
.
This repo uses semver, and its public interface (in order to determine what
changes would break backwards-compatibility) is defined as the functions
exported by ./index.js
.
Each of the commands for scanning one or more repos also accepts an optional URL to a CSV file with mapping information between Docker images and programming language versions (e.g. PHP, NodeJS).
Example CSV content:
Docker image,PHP version,NodeJS version
openjdk:8-jdk-alpine,NONE,NONE
php:7.3-apache-buster,7.3,NONE
node:16,NONE,v16
Note:
FROM
in the Dockerfile.7.3
, not 7.3.24
).v
and the major version
(such as v16
, not v16.13.1
).NONE
.Tip:
One easy way to maintain a URL-accessible CSV file is as a Google Sheet, using
the "File" > "Publish to Web" feature, selecting the desired sheet (tab),
specifying "CSV" as the format option, and using the given URL in calls to this
library.
If your list of vulnerabilities includes a warning like the following...
No record found in spreadsheet for php:7.3-apache-buster
... you simply need to add a row to your CSV file with that Docker image (in
this case, php:7.3-apache-buster
) and what version of PHP it uses (in this
case, 7.3
).
If you do not know what version of PHP it uses (and if it is a Docker image you
trust enough to run on your local computer), you can run a command like this,
replacing YOUR-DOCKER-IMAGE-STRING
with the actual value:
docker run --rm --entrypoint php YOUR-DOCKER-IMAGE-STRING -v
In the example above, that would mean running the following command:
docker run --rm --entrypoint php php:7.3-apache-buster -v
Note:
There is a little get-docker-lang-versions.sh
helper script for determining
the PHP, NodeJS, and Python versions (if any) used in a list of Docker images.
However, it may change (and even be renamed) in future changes to this library.
Feel free to use it, but don't depend on its current behavior or filename to
remain unchanged.
For example, you could create a file called docker-images-unknown-versions.txt
with a single docker image per line, then run the following:
cat docker-images-unknown-versions.txt | ./get-docker-lang-versions.sh
That would write out to a docker-lang-versions.txt
file the CSV data to use
in your spreadsheet of what programming language versions are used in what
Docker images. There is also a make docker-lang-versions
command you can run
to run the above code more easily (and not have to re-read this documenation
every time).
If your list of vulnerabilities includes a warning like the following...
Unknown PHP version: 8.1
... please submit a PR on this repo to add that PHP version and its EOL date to the "src/php.js" file's list of EOL dates.
To find the End-Of-Life (EOL) date for that version of PHP, go to https://www.php.net/supported-versions and find the latest date any kind of support is planned for that version (typically the "Security Support Until" date).
Thanks!
If your list of vulnerabilities includes a warning like the following...
Unknown NodeJS version: v19
... please submit a PR on this repo to add that NodeJS version and its EOL date to the "src/nodejs.js" file's list of EOL dates.
To find the End-Of-Life (EOL) date for that version of NodeJS, go to https://nodejs.org/en/about/releases/ and look at the "END-OF-LIFE" value for that version in the table near the end of the page.
Thanks!
FAQs
Scan your repos for vulnerabilities (such as dependencies with published security advisories)
The npm package @silintl/vulnerability-scanner receives a total of 1 weekly downloads. As such, @silintl/vulnerability-scanner popularity was classified as not popular.
We found that @silintl/vulnerability-scanner demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.