inspect
Descriptionโ
Displays detailed analysis results for the selected package version.
Use this command to identify security and software quality issues discovered during analysis. Detected issues are associated with files they affect. Their remediation can be planned and prioritized by the issue type, priority, severity, or effort required to resolve them.
When used with its filtering options, inspect
can show the following:
- detected and suppressed software quality issues,
- a comprehensive list of active and triaged vulnerabilities,
- detected behaviors,
- detected malicious and suspicious software components,
- sensitive information and exposed secrets detected within packages.
When no option is specified, the --[show]-issues
output is shown by default.
Depending on the issue type, a different person within the organization might be assigned to review or remediate. While this varies from one organization to another, general triage guidance is that the malware incidents get investigated by a security team. Container deployment issues should be handled by DevOps, letting the developers focus on vulnerabilities and other software quality issues.
If an organization has an application security team, its members can further review mitigation coverage gaps, software bill of materials, and vet third-party component behaviors.
To completely resolve a reported issue means to address it on each of the files reported in the violations list.
Status of reproducible build artifactsโ
If a package version has a reproducible build artifact, you can view its status independently of the main artifact by appending the ?build=repro
option to the package URL in the inspect
command.
All supported inspect
command options can be used together with this option to filter the information about the reproducible build artifact.
To view the status of reproducible build checks for a package version, use the checks command.
Usageโ
rl-secure inspect <purl> [<options>]
rl-secure inspect --purl=<purl> [<options>]
Optionsโ
Option | Description |
---|---|
-p, --purl | Required. Package URL for which to display analysis results, in the format [pkg:type/]<project></package><@version> |
?build=repro | Instead of showing detailed analysis results for the main package version artifact, show the results for the reproducible build artifact. The option must be appended to the package URL like in the following example: pkg:rl/my-project/my-package/version@1.0?build=repro . When this option is used for a package version that doesn't have any reproducible build artifacts, the command exits with an error. |
--all, --show-all | Show all available metrics. When used together with other options, it implicitly satisfies their usage conditions. For example, if an option can only be used together with --secrets , you can use it with --all instead, and it will work without having to specify --secrets . |
--issues, --show-issues | Show issues. This option is used by default when no other option is specified. |
--dsc-sort | Specify the criteria for sorting the output (priority, severity, effort, count) in descending order. |
--asc-sort | Specify the criteria for sorting the output (priority, severity, effort, count) in ascending order. |
-s, --rl-store | Path to an initialized package store containing the package URL. If you don't specify the path, the current directory is used. |
--diff-with | Used for creating diffs (comparisons) between two package versions (the version for which you're generating the report and another, usually preceding version). Both package versions must be in the same project and package. Specify a previously analyzed package version to include diff information in the report. Only the version part of the package URL needs to be specified. Does not work with reproducible builds. |
--no-files | Don't show the list of files in which an issue was detected. Applies to all issue types, but cannot be used together with the --evidence option for secrets. |
--no-color | Don't add color to the output. |
-h, --help | Display usage information and exit. |
Filter issues by statusโ
Option | Description |
---|---|
--fail, --fail-only | Show only components with FAIL status. Can't be used together with --pass . Must be used with --issues or --all to produce meaningful output. |
--pass, --pass-only | Show only components with PASS status. Can't be used together with --fail . Must be used with --issues or --all to produce meaningful output. |
--blockers, --level-blockers | Show only the issues that are preventing migration to the specified SAFE Level. Specify the level as an integer value from 1 to 5. For example, --blockers=4 indicates if there are any issues blocking the upgrade to SAFE Level 4. |
Filter issues by typeโ
Option | Description |
---|---|
--malware, --show-malware | Show malware. |
--behaviors, --show-behaviors | Show behaviors. When package community information is available, behavior prevalence can be one of the following: Common , Uncommon , Anomalous , Important , Malicious .Common = the detected behavior is often found in the community the component belongs to.Uncommon = the detected behavior is rare within the community the component belongs to.Anomalous = the detected behavior was never seen in the community the component belongs to.Important = the detected behavior is not malicious but should be prioritized for code intent review.Malicious = the detected behavior is seen only in malicious packages within the community the component belongs to.If no prevalence information for a behavior is currently available, the CLI output will state that. |
--cves, --vulnerabilities, --show-cves | Show vulnerabilities. Can only be sorted by severity. |
--secrets, --show-secrets | Show sensitive information and exposed secrets (such as service credentials, tokens, and private keys). The exposure status can be one of the following: Exposed , Suppressed , Unknown .Exposed indicates when the secret was first recorded in the ReversingLabs cloud, and that it is newer than the configured leak threshold. The threshold is used to define the age after which secrets are no longer considered active (usually according to organization password policies).Suppressed indicates when the secret was first recorded in the in the ReversingLabs cloud, and that it is older than the configured leak threshold. It is assumed the secrets older than the threshold have been rotated or revoked in the meantime. Therefore, they're no longer considered exposed.Unknown indicates the secret has no records in the ReversingLabs cloud, and it's therefore not possible to calculate how long it has been exposed.You can configure the secrets exposure time by modifying the policy configuration files. |
--endpoints, --with-endpoints | Must be used together with --secrets and --evidence . Shows the liveness status for a verified secret per endpoint. |
--evidence, --with-evidence | Must be used together with --secrets . Shows secret exposure window time (if that information is available) and points to the evidence in specific files within a package. For text-based files, the output shows the exact line number where the secret was detected. |
Examplesโ
Show SAFE Levels upgrade blockersโ
This example shows how to use the --blockers
option to identify issues in a package that prevent your software from reaching a higher level of maturity.
In this example, the scan level is set to 3 in the policy configuration for this specific project. That means we want all package versions in the project to pass level 3.
We also want to know if our packages would pass or fail on the next level, so we're looking for issues that are considered blockers in our upgrade path to level 4.
For threat hunting (TH) policies, the triggered behavior ID and its description are shown under the Root Cause part of the CLI output. This allows you to pinpoint the software behaviors preventing you from reaching the desired SAFE Level.
- Simplified input
- Extended input
- Output
rl-secure inspect pkg:rl/my-project/my-package@1.0 --blockers=4
rl-secure inspect --purl=pkg:rl/my-project/my-package@1.0 --level-blockers=4 --rl-store=/home/armando/my-repository/
[ SQ31102 ] [ L3:PASS ] <P0> / [H] Severity [H] Effort / will FAIL:L4 / (x1)
Detected presence of actively exploited vulnerabilities.
Violations ---------------------------------------------------------------------
1) my_package.zip
--------------------------------------------------------------------------------
[ TH15104 ] [ L3:FAIL ] <P0> / [H] Severity [H] Effort / (x2)
Detected presence of files with behaviors exclusively used by
malicious software.
Root Cause ---------------------------------------------------------------------
[ BH15180 ] Base64 encodes files with certutil.
[ BH16144 ] Downloads a file using certutil.
Violations ---------------------------------------------------------------------
1) files/data/unpacked.file
Show secrets with evidence and endpoint livenessโ
This example shows how to use the inspect
command to focus on and prevent sensitive information exposure in your packages.
The --secrets
option filters the command output to display only the issues related to secrets.
For example, if a file within a package contains AWS credentials or has embedded private keys, the output will include the file.
Adding the --evidence
option makes the command output more informative.
For every detected secret, it shows the exposure time window (if available) and points to the file contents that triggered the detection.
This helps you understand the severity of the issue and address it more rapidly by locating the source of the problem.
Using the --endpoints
option displays the liveness status (if supported) of every detected secret on each service endpoint.
The time when the liveness check was last performed is displayed next to the liveness status.
This allows you to pinpoint the secrets that are still used on specific services and can therefore be exploited.
In this example, there are two instances of secrets exposure in the analyzed package.
The first issue (starting at Line 2
in the Output tab) is categorized as "commonly distributed sensitive data".
Technically, this type of sensitive information is not considered secret, and it usually indicates the presence of testing data that has already been shared in public.
Therefore, this issue is assigned a lower priority (P4) by default.
Liveness status is not supported for this secret type, as indicated by the Liveness
line.
The Evidence
line shows where the secret appears in the file.
The second issue (starting at Line 11
in the Output tab) is assigned P0 priority.
Presence of active web service access credentials has been detected in the package and it requires further investigation.
Endpoints where this secret is considered active are indicated in the output under Evidence: [x] ACTIVE on
.
The command expects the package store to exist in the current directory.
Use the -s
or --rl-store
options to provide an alternative path to the package store (as shown in the "Extended input" tab).
- Simplified input
- Extended input
- Output
rl-secure inspect pkg:rl/my-project/my-package@1.0 --secrets --with-evidence --with-endpoints
rl-secure inspect --purl=pkg:rl/my-project/my-package@1.0 --secrets --with-evidence --with-endpoints --rl-store=/home/armando/my-repository/
--------------------------------------------------------------------------------
[ SECRETS ] [ CI:PASS ] <P4> / Meta (Facebook) long-lived access token / SQ34101 (x1)
Detected presence of commonly distributed sensitive data.
Detections ---------------------------------------------------------------------
1) unpacked_files/0/package/test_data/credentials
Exposure: over 1 year ago (Suppressed)
------------------------------------------------------------------
Liveness: UNSUPPORTED - 1 minute ago
Evidence: { #01 / Offset: 0x00147566 (EAARE0ZATe***) }
--------------------------------------------------------------------------------
[ SECRETS ] [ CI:FAIL ] <P0> / AWS long-term credentials / SQ34404 (x1)
Detected presence of active web service access credentials.
Detections ---------------------------------------------------------------------
1) unpacked_files/0/package/auth/aws/token.json
Exposure: about 2 years ago (Exposed)
------------------------------------------------------------------
Liveness: ACTIVE - 1 minute ago
Evidence: { #01 / Line: ........8829 (AKIAIPJNWM***) }
( [x] ACTIVE on: Amazon Web Services )
--------------------------------------------------------------------------------
Show malicious componentsโ
This example displays the malicious components contained within an NPM ua-parser-js
package.
More specifically, version 0.7.29 contains a known software supply chain attack.
Malicious components were detected by a few different threat detection technologies the ReversingLabs analysis engine relies on. The command output displays the most accurate result, which in this case is a hash-based detection that was vetted by our Threat Research team.
The command expects the package store to exist in the current directory.
Use the -s
or --rl-store
options to provide an alternative path to the package store (as shown in the "Extended input" tab).
- Simplified input
- Extended input
- Output
rl-secure inspect pkg:rl/npm/ua-parser-js@0.7.29 --malware
rl-secure inspect --purl=pkg:rl/npm/ua-parser-js@0.7.29 --malware --rl-store=/home/armando/my-repository/
--------------------------------------------------------------------------------
[ MALWARE ] [ SEVERITY:08/10 ] Archive-GZIP.Downloader.Generic
Discovered by: Analyst sample override
Detections ---------------------------------------------------------------------
1) <Submitted package>
--------------------------------------------------------------------------------
[ MALWARE ] [ SEVERITY:08/10 ] Archive-TAR.Downloader.Generic
Discovered by: Analyst sample override
Detections ---------------------------------------------------------------------
1) unpacked_files/0
--------------------------------------------------------------------------------
[ MALWARE ] [ SEVERITY:08/10 ] Script-BAT.Downloader.Generic
Discovered by: Analyst sample override
Detections ---------------------------------------------------------------------
1) unpacked_files/0/package/preinstall.bat
--------------------------------------------------------------------------------
[ MALWARE ] [ SEVERITY:08/10 ] Script-JS.Downloader.Generic
Discovered by: Analyst sample override
Detections ---------------------------------------------------------------------
1) unpacked_files/0/package/preinstall.js
--------------------------------------------------------------------------------
[ MALWARE ] [ SEVERITY:08/10 ] Script-Shell.Downloader.Generic
Discovered by: Analyst sample override
Detections ---------------------------------------------------------------------
1) unpacked_files/0/package/preinstall.sh
--------------------------------------------------------------------------------
[ MALWARE ] [ SEVERITY:08/10 ] Text.Downloader.Generic
Discovered by: Analyst sample override
Detections ---------------------------------------------------------------------
1) unpacked_files/0/package/package.json
Display known vulnerabilitiesโ
This example shows how to focus the analysis summary on CVEs with the --vulnerabilities
option.
This approach is ideal for quick failure triage and integration with CI systems.
We previously added Apache Solr 8.10.0 to the package store with the scan
command.
Version 8.10.0 contains a known vulnerability: CVE-2021-44228 (Log4Shell).
Since this vulnerability can have a high impact, CISA issued a patching mandate to United States government agencies.
If you want to get a cleaner output without the list of files where each vulnerability was detected, use the --no-files
option.
The command expects the package store to exist in the current directory.
Use the -s
or --rl-store
options to provide an alternative path to the package store (as shown in the "Extended input" tab).
- Simplified input
- Extended input
- Output
rl-secure inspect pkg:rl/apache/solr@8.10.0 --vulnerabilities --no-files
rl-secure inspect --purl=pkg:rl/apache/solr@8.10.0 --vulnerabilities --no-files --rl-store=/home/armando/my-repository/
--------------------------------------------------------------------------------
[ CVSS:v3 ] [C] 10.00 / CVE-2021-44228 (Log4Shell)
Exploitable: YES (MALWARE)
Introduced in: 2.0-beta9 (9 years ago)
Resolved in: 2.15.0 (9 months ago)
Patch mandate: YES (MANDATORY)
Discovered by: Chen Zhaojun (Alibaba Group Holding Limited)
Description: Apache Log4j2 2.0-beta9 up to 2.14.1 (excluding
security releases 2.12.2, 2.12.3, and 2.3.1) JNDI features used
in configuration, log messages, and parameters do not protect
against attacker controlled LDAP and other JNDI related
endpoints. An attacker who can control log messages or log
message parameters can execute arbitrary code loaded from LDAP
servers when message lookup substitution is enabled. From log4j
2.15.0, this behavior has been disabled by default. From
version 2.16.0 (along with 2.12.2, 2.12.3, and 2.3.1), this
functionality has been completely removed. Note that this
vulnerability is specific to log4j-core and does not affect
log4net, log4cxx, or other Apache Logging Services projects.
--------------------------------------------------------------------------------
Show detected behaviorsโ
This example shows how to focus the analysis summary on detected behaviors with the --behaviors
option.
We're displaying behaviors based on their IDs, in ascending order.
For every detected behavior, you can see what possibly triggered it and in which file it was found. This helps you address the issue more rapidly by locating the source of the problem.
When available, the prevalence information can help you understand how common the behavior is in the package community.
The command expects the package store to exist in the current directory.
Use the -s
or --rl-store
options to provide an alternative path to the package store (as shown in the "Extended input" tab).
- Simplified input
- Extended input
- Output
rl-secure inspect pkg:rl/nupkg/winscphelper@1.0.13 --behaviors
rl-secure inspect --purl=pkg:rl/nupkg/winscphelper@1.0.13 --behaviors --rl-store=/home/armando/my-repository/
--------------------------------------------------------------------------------
[ BH12110 ] / Category: REGISTRY / (x2)
Accesses list of all installed applications.
--------------------------------------------------------------------------------
Explained: Commonly triggered by the use of "RegOpenKeyA" and "RegQueryValueA"
APIs and the
"software\microsoft\windows\currentversion\installer\folders"
string.
Prevalence ---------------------------------------------------------------------
Behavior is UNCOMMON for packages in NuGet repository
Detections ---------------------------------------------------------------------
1) content/WinSCP.exe
2) lib/WinSCPnet.dll
--------------------------------------------------------------------------------
[ BH13272 ] / Category: STEAL / (x1)
Retrieves text from the clipboard.
--------------------------------------------------------------------------------
Explained: Commonly triggered by the use of "OpenClipboard" and
"GetClipboardData" Windows APIs, or methods with similar
functionality in other environments.
Prevalence ---------------------------------------------------------------------
Behavior is UNCOMMON for packages in NuGet repository
Detections ---------------------------------------------------------------------
1) content/WinSCP.exe
--------------------------------------------------------------------------------
[ BH19529 ] / Category: SEARCH / (x1)
Retrieves a list of printers installed on a computer.
--------------------------------------------------------------------------------
Explained: Commonly triggered by the use of the "EnumPrintersA" Windows API,
or methods with similar functionality in other environments.
Prevalence ---------------------------------------------------------------------
Behavior is COMMON for packages in NuGet repository
Detections ---------------------------------------------------------------------
1) content/WinSCP.exe
--------------------------------------------------------------------------------
[ BH19330 ] / Category: PERMISSIONS / (x1)
Enumerates user/account privilege information.
--------------------------------------------------------------------------------
Explained: Commonly triggered by the use of the "GetTokenInformation" Windows
API, or methods with similar functionality in other environments.
Prevalence ---------------------------------------------------------------------
Behavior is COMMON for packages in NuGet repository
Detections ---------------------------------------------------------------------
1) content/WinSCP.exe
--------------------------------------------------------------------------------
[ BH12199 ] / Category: EXECUTION / (x1)
Creates a new process which executes a shell.
--------------------------------------------------------------------------------
Explained: Commonly triggered by the use of the "execl" API and the
"/bin/bash" string, or similar functionality in other environments.
Prevalence ---------------------------------------------------------------------
Behavior is UNCOMMON for packages in NuGet repository
Detections ---------------------------------------------------------------------
1) content/WinSCP.exe
--------------------------------------------------------------------------------
Show failing issues ordered by effortโ
This example shows how the inspect
command can help with prioritization.
We're displaying the highest priority issues sorted by the least effort required to remediate.
Combining the --fail-only
option with --asc-sort
to order issues by remediation effort (from lowest to highest) produces an actionable list of issues that are high-impact and easy to fix.
In this case, the presence of private certificates is one of the issues in the command output that require investigation. Given that the policy violation filenames imply testing-only usage, the next recommended step is to add them to the list of suppressed issues.
The command expects the package store to exist in the current directory.
Use the -s
or --rl-store
options to provide an alternative path to the package store (as shown in the "Extended input" tab).
- Simplified input
- Extended input
- Output
rl-secure inspect pkg:rl/apache/solr@8.10 --issues --fail-only --asc-sort=effort
rl-secure inspect --purl=pkg:rl/apache/solr@8.10 --issues --fail-only --asc-sort=effort --rl-store=/home/armando/my-repository/
--------------------------------------------------------------------------------
[ SQ20122 ] [ L5:FAIL ] <P0> / [H] Severity [M] Effort / will PASS:L1 / (x5)
Detected digital signatures used for code signing that do not have
code signing listed for their intended use.
Violations ---------------------------------------------------------------------
1) unpacked_files/0/solr-8.10.0/contrib/extraction/lib/bcmail-jdk15on-1.65.jar
2) unpacked_files/0/solr-8.10.0/contrib/extraction/lib/bcpkix-jdk15on-1.65.jar
3) unpacked_files/0/solr-8.10.0/contrib/extraction/lib/bcprov-jdk15on-1.65.jar
4) unpacked_files/0/solr-8.10.0/server/solr-webapp/webapp/WEB-INF/lib/commons-compiler-3.0.9.jar
5) unpacked_files/0/solr-8.10.0/server/solr-webapp/webapp/WEB-INF/lib/janino-3.0.9.jar
--------------------------------------------------------------------------------
Show diff analysis summaryโ
This example shows how to use the inspect
command to display all issues introduced since the older version.
We previously scanned both the older (8.10) and the newer version (8.11.3).
With the report
command, we first generated separate reports for each version and then a diff report between them.
If all the conditions have been met, you can now display the diff analysis information in the CLI output. This allows you to view policies triggered on diff, as well as the issues that affect the newer (8.11.3) version.
The command expects the package store to exist in the current directory.
Use the -s
or --rl-store
options to provide an alternative path to the package store (as shown in the "Extended input" tab).
- Simplified input
- Extended input
- Output
rl-secure inspect pkg:rl/apache/solr@8.11.3 --diff-with=8.10
rl-secure inspect --purl=pkg:rl/apache/solr@8.11.3 --diff-with=8.10 --rl-store=/home/armando/my-repository/
--------------------------------------------------------------------------------
[ SQ34109 ] [ L3:FAIL ] <P0> / [H] Severity [M] Effort / will PASS:L2 / (x2)
Detected presence of embedded private keys.
Violations ---------------------------------------------------------------------
1) unpacked_files/0/solr-8.11.3/dist/solrj-lib/netty-handler-4.1.99.Final.jar/io/netty/handler/ssl/OpenSsl.class
2) unpacked_files/0/solr-8.11.3/server/solr-webapp/webapp/WEB-INF/lib/netty-handler-4.1.99.Final.jar/io/netty/handler/ssl/OpenSsl.class
--------------------------------------------------------------------------------
[ SQ34301 ] [ L3:PASS ] <P4> / [L] Severity [L] Effort / (x1)
Detected presence of placeholder credentials within network
protocol strings.
Suppressed ---------------------------------------------------------------------
Author: Spectra Assure
Date: 2024-01-01T12:00:00+0000 (3 months ago)
Reason: Suppressed common network protocol credentials [automatic]
Violations ---------------------------------------------------------------------
1) unpacked_files/0/solr-8.11.3/CHANGES.txt
--------------------------------------------------------------------------------
[ TH16102 ] [ L3:PASS ] <P4> / [L] Severity [H] Effort / (x2)
Detected presence of files containing bidirectional Unicode control
characters.
Root Cause ---------------------------------------------------------------------
[ BH15228 ] Contains the ZWNJ (zero width non-joiner) Unicode
character.
Violations ---------------------------------------------------------------------
1) unpacked_files/0/solr-8.11.3/contrib/analysis-extras/lib/icu4j-62.1.jar/com/ibm/icu/impl/data/icudt62b/pool.res
2) unpacked_files/0/solr-8.11.3/contrib/extraction/lib/icu4j-62.1.jar/com/ibm/icu/impl/data/icudt62b/pool.res
--------------------------------------------------------------------------------