Skip to content

Commit 72bfcaf

Browse files
authored
chore: update docs (#137)
* chore: update docs * chore: update docs for new golang and python package resolving options
1 parent 323bbd4 commit 72bfcaf

File tree

4 files changed

+158
-40
lines changed

4 files changed

+158
-40
lines changed

README.md

Lines changed: 69 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ Dependency Analytics only accesses your manifest files to analyze your applicati
2424
vulnerability report.
2525

2626
**IMPORTANT:**
27-
<br >Currently, Dependency Analytics only supports projects that use Maven (`mvn`), and Node ecosystems (`npm`).
27+
<br >Currently, Dependency Analytics only supports projects that use Maven (`mvn`), Node (`npm`), Golang (`go mod`) and
28+
Python (`pip`) ecosystems.
2829
In future releases, Red Hat plans to support other programming languages.
2930

3031
##### Table of Contents
@@ -42,7 +43,11 @@ In future releases, Red Hat plans to support other programming languages.
4243
**Prerequisites**
4344

4445
- For Maven projects, analyzing a `pom.xml` file, you must have the `mvn` binary in your IDE's `PATH` environment.
45-
- For Node projects, analyzing a `package.json` file, you must have the `npm` binary in your IDE's `PATH` environment.
46+
- For Node projects, analyzing a `package.json` file, you must have the `npm` and `node` binaries in your IDE's `PATH`
47+
environment.
48+
- For Golang projects, analyzing a `go.mod` file, you must have the `go` binary in your IDE's `PATH` environment.
49+
- For Python projects, analyzing a `requirements.txt` file, you must have the `python3` and `pip3` binaries in your
50+
IDE's `PATH` environment.
4651

4752
**Procedure**
4853

@@ -80,28 +85,48 @@ according to your preferences.
8085
**Configurable parameters**
8186

8287
- **Maven** :
83-
<br >Path of the `mvn` executable allows Exhort to locate and execute the `mvn` commands to resolve dependencies for
84-
Maven projects.
85-
Path of the `JAVA_HOME` directory is required by the `mvn` executable.
86-
If the paths are not provided, your IDE's `PATH` and `JAVA_HONE` environments will be used to locate the executables.
87-
88-
- **Npm** :
89-
<br >Path of the `npm` executable allows Exhort to locate and execute `npm` commands to resolve dependencies for Node
90-
projects.
91-
Path of the directory containing the `node` executable is required by the `npm` executable.
92-
If the paths are not provided, your IDE's `PATH` environment will be used to locate the executables.
88+
<br >Set the full path of the Maven executable, which allows Exhort to locate and execute the `mvn` command to resolve
89+
dependencies for Maven projects.
90+
Path of the `JAVA_HOME` directory is required by the `mvn` executable.
91+
If the paths are not provided, your IDE's `PATH` and `JAVA_HONE` environments will be used to locate the executables.
92+
93+
- **Node** :
94+
<br >Set the full path of the Node executable, which allows Exhort to locate and execute the `npm` command to resolve
95+
dependencies for Node projects.
96+
Path of the directory containing the `node` executable is required by the `npm` executable.
97+
If the paths are not provided, your IDE's `PATH` environment will be used to locate the executables.
98+
99+
- **Golang** :
100+
<br >Set the full path of the Go executable, which allows Exhort to locate and execute the `go` command to resolve
101+
dependencies for Go projects.
102+
If the path is not provided, your IDE's `PATH` environment will be used to locate the executable.
103+
When option `Strictly match package version` is selected, the resolved dependency versions will be compared to the
104+
versions specified in the manifest file, and users will be alerted if any mismatch is detected.
105+
106+
- **Python** :
107+
<br >Set the full paths of the Python and the package installer for Python executables, which allows Exhort to locate
108+
and execute the `pip3` commands to resolve dependencies for Python projects.
109+
Python 2 executables `python` and `pip` can be used instead, if the `Use python 2.x` option is selected.
110+
If the paths are not provided, your IDE's `PATH` environment will be used to locate the executables.
111+
When option `Strictly match package version` is selected, the resolved dependency versions will be compared to the
112+
versions specified in the manifest file, and users will be alerted if any mismatch is detected.
113+
Python virtual environment can be applied, when selecting the `Use python virtual environment` option.
114+
If selecting option `Allow alternate package version` while using virtual environment, the dependency versions
115+
specified in the manifest file will be ignored, and dependency versions will be resolved dynamically instead (this
116+
feature cannot be enabled when `Strictly match package version` is selected).
93117

94118
- **Exhort Snyk Token** :
95-
<br >The Snyk token allows Exhort to authenticate with the Snyk Vulnerability Database.
96-
If a Snyk token is not provided, Snyk vulnerability information is not displayed.
119+
<br >The Snyk token allows Exhort to authenticate with the Snyk Vulnerability Database.
120+
If a Snyk token is not provided, Snyk vulnerability information is not displayed.
97121

98122
If you need a new Snyk token, you can generate a new
99123
token [here](https://app.snyk.io/login?utm_campaign=Code-Ready-Analytics-2020&utm_source=code_ready&code_ready=FF1B53D9-57BE-4613-96D7-1D06066C38C9).
100124

101125
## Features
102126

103127
- **Component analysis**
104-
<br >Upon opening a manifest file, such as a `pom.xml` or `package.json` file, a scan starts the analysis process.
128+
<br >Upon opening a manifest file, such as a `pom.xml`, `package.json`, `go.mod` or `requirements.txt` file, a scan
129+
starts the analysis process.
105130
The scan provides immediate inline feedback on detected security vulnerabilities for your application's dependencies.
106131
Such dependencies are appropriately underlined in red, and hovering over it gives you a short summary of the security
107132
concern.
@@ -115,7 +140,6 @@ token [here](https://app.snyk.io/login?utm_campaign=Code-Ready-Analytics-2020&ut
115140
If you wish to ignore vulnerabilities for a dependency in a `pom.xml` file, you must add `exhortignore` as a comment
116141
against the dependency, group id, artifact id, or version scopes of that particular dependency in the manifest file.
117142
For example:
118-
119143
```xml
120144
<dependency> <!--exhortignore-->
121145
<groupId>...</groupId>
@@ -126,10 +150,7 @@ token [here](https://app.snyk.io/login?utm_campaign=Code-Ready-Analytics-2020&ut
126150

127151
If you wish to ignore vulnerabilities for a dependency in a `package.json` file, you must add `exhortignore` as a
128152
attribute-value pair.
129-
If `exhortignore` is followed by a list of comma-separated Snyk vulnerability IDs, only the listed vulnerabilities
130-
will be ignored during analysis.
131153
For example:
132-
133154
```json
134155
{
135156
"name": "sample",
@@ -151,22 +172,36 @@ token [here](https://app.snyk.io/login?utm_campaign=Code-Ready-Analytics-2020&ut
151172
}
152173
```
153174

175+
If you wish to ignore vulnerabilities for a dependency in a `go.mod` file, you must add `exhortignore` as a comment
176+
against the dependency in the manifest file.
177+
For example:
178+
```text
179+
require (
180+
golang.org/x/sys v1.6.7 // exhortignore
181+
)
182+
```
183+
184+
If you wish to ignore vulnerabilities for a dependency in a `requirements.txt` file, you must add `exhortignore` as a
185+
comment against the dependency in the manifest file.
186+
For example:
187+
```text
188+
requests==2.28.1 # exhortignore
189+
```
190+
154191
- **Excluding developmental or test dependencies**
155192
<br >Red Hat Dependency Analytics does not analyze dependencies marked as `dev` or `test`, these dependencies are
156193
ignored.
157194
For example, setting `test` in the `scope` tag within a `pom.xml` file:
158-
159195
```xml
160196
<dependency>
161197
<groupId>...</groupId>
162198
<artifactId>...</artifactId>
163199
<version>...</version>
164200
<scope>test</scope>
165201
</dependency>
166-
```
202+
```
167203

168204
For example, setting `devDependencies` attributte in the `package.json` file:
169-
170205
```json
171206
{
172207
"name": "sample",
@@ -188,6 +223,18 @@ token [here](https://app.snyk.io/login?utm_campaign=Code-Ready-Analytics-2020&ut
188223
}
189224
```
190225

226+
For example, setting `exclude` attribute in the `go.mod` file:
227+
```text
228+
exclude golang.org/x/sys v1.6.7
229+
230+
exclude (
231+
golang.org/x/sys v1.6.7
232+
)
233+
```
234+
235+
You can create an alternative file to `requirements.txt`, for example, a `requirements-dev.txt` or
236+
a `requirements-test.txt` file where you can add the development or test dependencies there.
237+
191238
- **Red Hat Dependency Analytics report**
192239
<br >The Red Hat Dependency Analytics report is a temporary HTML file that exist if the **Red Hat Dependency Analytics
193240
Report** tab remains open.

src/main/resources/META-INF/plugin.xml

Lines changed: 89 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212
<p>
1313
Red Hat Dependency Analytics (RHDA) plugin gives you awareness to security concerns within your software supply
1414
chain while you build your application.
15-
<br>The Dependency Analytics plugin uses the Snyk REST API to query <a href="https://snyk.io/product/vulnerability-database/"
16-
rel="noopener noreferrer" target="_blank">Snyk's Vulnerability
15+
<br>The Dependency Analytics plugin uses the Snyk REST API to query <a
16+
href="https://snyk.io/product/vulnerability-database/"
17+
rel="noopener noreferrer" target="_blank">Snyk's Vulnerability
1718
Database</a> for the most up-to-date vulnerability information available.
18-
<br>Snyk uses industry-leading security intelligence by pulling from many data sources to give you exact vulnerability information.
19+
<br>Snyk uses industry-leading security intelligence by pulling from many data sources to give you exact
20+
vulnerability information.
1921
2022
<p>
2123
<b>NOTE:</b>
@@ -25,8 +27,8 @@
2527
the vulnerability report.
2628
<p>
2729
<b>IMPORTANT:</b>
28-
<br>Currently, Dependency Analytics only supports projects that use Maven (<code>mvn</code>), and Node ecosystems
29-
(<code>npm</code>).
30+
<br>Currently, Dependency Analytics only supports projects that use Maven (<code>mvn</code>), and Node
31+
(<code>npm</code>), Golang (<code>go mod</code>) and Python (<code>pip</code>) ecosystems.
3032
<br>In future releases, Red Hat plans to support other programming languages.
3133
<p>
3234
@@ -37,9 +39,15 @@
3739
<li>For Maven projects, analyzing a <code>pom.xml</code> file, you must have the <code>mvn</code> binary in your
3840
IDE's <code>PATH</code> environment.
3941
</li>
40-
<li>For Node projects, analyzing a <code>package.json</code> file, you must have the <code>npm</code> binary in your
42+
<li>For Node projects, analyzing a <code>package.json</code> file, you must have the <code>npm</code> and
43+
<code>node</code> binaries in your IDE's <code>PATH</code> environment.
44+
</li>
45+
<li>For Golang projects, analyzing a <code>go.mod</code> file, you must have the <code>go</code> binary in your
4146
IDE's <code>PATH</code> environment.
4247
</li>
48+
<li>For Python projects, analyzing a <code>requirements.txt</code> file, you must have the <code>python3</code> and
49+
<code>pip3</code> binaries in your IDE's <code>PATH</code> environment.
50+
</li>
4351
</ul>
4452
<p>
4553
<b>Procedure</b>
@@ -54,8 +62,8 @@
5462
<li>To start scanning your application for security vulnerabilities, and view the vulnerability report, you can do
5563
one of the following:
5664
<ul>
57-
<li>Open a manifest file, hover over a dependency marked by the inline Component Analysis, indicated by the wavy-red
58-
line under a dependency, and click <b>Detailed Vulnerability Report</b>.
65+
<li>Open a manifest file, hover over a dependency marked by the inline Component Analysis, indicated by the
66+
wavy-red line under a dependency, and click <b>Detailed Vulnerability Report</b>.
5967
</li>
6068
<li>Right click on a manifest file in the <b>Project</b> window, and click <b>Dependency Analytics
6169
Report</b>.
@@ -81,30 +89,62 @@
8189
8290
<h2>Configuration</h2>
8391
<p>
84-
The Red Hat Dependency Analytics plugin has some configurable parameters that allows you to customize its behavior according to your preferences.
92+
The Red Hat Dependency Analytics plugin has some configurable parameters that allows you to customize its behavior
93+
according to your preferences.
8594
<p>
8695
<b>Procedure</b>
8796
<ol>
8897
<li>Open the IntelliJ IDEA application.</li>
8998
<li>Click <b>Settings</b> from the menu, and click <b>Tools</b>.</li>
9099
<li>Click the <b>Red Hat Dependency Analytics</b>.</li>
91100
</ol>
92-
<img src="https://raw.githubusercontent.com/redhat-developer/intellij-dependency-analytics/main/src/main/resources/images/settings.png"
101+
<img src="https://raw.githubusercontent.com/redhat-developer/intellij-dependency-analytics/main/src/main/resources/images/settings.png"
93102
alt="Red Hat Dependency Analytics plugin settings">
94103
<p>
95104
<b>Configurable parameters</b>
96105
<ul>
97106
<li>
98107
<b>Maven</b>:
99-
<br>Path of the <code>mvn</code> executable allows Exhort to locate and execute the <code>mvn</code> commands to resolve dependencies forMaven projects.
108+
<br>Set the full path of the Maven executable, which allows Exhort to locate and execute the <code>mvn</code>
109+
command to resolve dependencies forMaven projects.
100110
<br>Path of the <code>JAVA_HOME</code> directory is required by the <code>mvn</code> executable.
101-
<br>If the paths are not provided, your IDE's <code>PATH</code> and <code>JAVA_HONE</code> environments will be used to locate the executables.
111+
<br>If the paths are not provided, your IDE's <code>PATH</code> and <code>JAVA_HONE</code> environments will be
112+
used to locate the executables.
113+
</li>
114+
<li>
115+
<b>Node</b>:
116+
<br>Set the full path of the Node executable, which allows Exhort to locate and execute <code>npm</code> command
117+
to resolve dependencies for Node projects.
118+
<br>Path of the directory containing the <code>node</code> executable is required by the <code>npm</code>
119+
executable.
120+
<br>If the paths are not provided, your IDE's <code>PATH</code> environment will be used to locate the
121+
executables.
102122
</li>
103123
<li>
104-
<b>Npm</b>:
105-
<br>Path of the <code>npm</code> executable allows Exhort to locate and execute <code>npm</code> commands to resolve dependencies for Node projects.
106-
<br>Path of the directory containing the <code>node</code> executable is required by the <code>npm</code> executable.
107-
<br>If the paths are not provided, your IDE's <code>PATH</code> environment will be used to locate the executables.
124+
<b>Golang</b>:
125+
<br>Set the full path of the Go executable, which allows Exhort to locate and execute the <code>go</code>
126+
command to resolve dependencies for Go projects.
127+
<br>If the path is not provided, your IDE's <code>PATH</code> environment will be used to locate the executable.
128+
<br>When option `Strictly match package version` is selected, the resolved dependency versions will be compared
129+
to the versions specified in the manifest file, and users will be alerted if any mismatch is detected.
130+
</li>
131+
<li>
132+
<b>Python</b>:
133+
<br>Set the full paths of the Python and the package installer for Python executables, which allows Exhort to
134+
locate and execute the <code>pip3</code> commands to resolve dependencies for Python projects.
135+
<br>Python 2 executables <code>python</code> and <code>pip</code> can be used instead, if the <code>Use python
136+
2.x</code> option is selected.
137+
<br>If the paths are not provided, your IDE's <code>PATH</code> environment will be used to locate the
138+
executables.
139+
<br>When option <code>Strictly match package version</code> is selected, the resolved dependency versions will
140+
be compared to the versions specified in the manifest file, and users will be alerted if any mismatch is
141+
detected.
142+
<br>Python virtual environment can be applied, when selecting the <code>Use python virtual environment</code>
143+
option.
144+
<br>If selecting option <code>Allow alternate package version</code> while using virtual environment, the
145+
dependency versions specified in the manifest file will be ignored, and dependency versions will be resolved
146+
dynamically instead. This feature cannot be enabled when <code>Strictly match package version</code> is
147+
selected.
108148
</li>
109149
<li>
110150
<b>Exhort Snyk Token</b>:
@@ -134,6 +174,7 @@
134174
<li>
135175
<b>Excluding dependencies with <code>exhortignore</code></b>
136176
<br>You can exclude a package from analysis by marking the package for exclusion.
177+
<br>
137178
<br>If you wish to ignore vulnerabilities for a dependency in a <code>pom.xml</code> file, you must add <code>exhortignore</code>
138179
as a comment against the dependency, group id, artifact id, or version scopes of that particular dependency in
139180
the manifest file.
@@ -145,10 +186,9 @@
145186
<br>&nbsp;&nbsp;&lt;version&gt;...&lt;/version&gt;
146187
<br>&lt;/dependency&gt;
147188
</code>
189+
<br>
148190
<br>If you wish to ignore vulnerabilities for a dependency in a <code>package.json</code> file, you must add
149191
<code>exhortignore</code> as a attribute-value pair.
150-
<br>If <code>exhortignore</code>is followed by a list of comma-separated Snyk vulnerability IDs, only the listed
151-
vulnerabilities will be ignored during analysis.
152192
<br>For example:
153193
<code>
154194
<br>{
@@ -170,11 +210,28 @@
170210
<br>&nbsp;&nbsp;]
171211
<br>}
172212
</code>
213+
<br>
214+
<br>If you wish to ignore vulnerabilities for a dependency in a <code>go.mod</code> file, you must add
215+
<code>exhortignore</code> as a comment against the dependency in the manifest file.
216+
<br>For example:
217+
<code>
218+
<br>require (
219+
<br>&nbsp;&nbsp;golang.org/x/sys v1.6.7 // exhortignore
220+
<br>)
221+
</code>
222+
<br>
223+
<br>If you wish to ignore vulnerabilities for a dependency in a <code>requirements.txt</code> file, you must add
224+
<code>exhortignore</code> as a comment against the dependency in the manifest file.
225+
<br>For example:
226+
<code>
227+
<br>requests==2.28.1 # exhortignore
228+
</code>
173229
</li>
174230
<li>
175231
<b>Excluding developmental or test dependencies</b>
176232
<br>Red Hat Dependency Analytics does not analyze dependencies marked as <code>dev</code> or <code>test</code>,
177233
these dependencies are ignored.
234+
<br>
178235
<br>For example, setting <code>test</code> in the <code>scope</code> tag within a <code>pom.xml</code> file:
179236
<code>
180237
<br>&lt;dependency&gt;
@@ -184,6 +241,7 @@
184241
<br>&nbsp;&nbsp;&lt;scope&gt;test&lt;/scope&gt;
185242
<br>&lt;/dependency&gt;
186243
</code>
244+
<br>
187245
<br>For example, setting <code>devDependencies</code> attributte in the <code>package.json</code> file:
188246
<code>
189247
<br>{
@@ -205,6 +263,17 @@
205263
<br>&nbsp;&nbsp;}
206264
<br>}
207265
</code>
266+
<br>
267+
<br>For example, setting <code>exclude</code> attribute in the <code>go.mod</code> file:
268+
<code>
269+
<br>exclude golang.org/x/sys v1.6.7
270+
<br>exclude (
271+
<br>&nbsp;&nbsp;golang.org/x/sys v1.6.7
272+
<br>)
273+
</code>
274+
<br>
275+
<br>You can create an alternative file to <code>requirements.txt</code>, for example, a <code>requirements-dev.txt</code>
276+
or a <code>requirements-test.txt</code> file where you can add the development or test dependencies there.
208277
</li>
209278
<li>
210279
<b>Red Hat Dependency Analytics Report</b>
@@ -258,6 +327,8 @@
258327
]]></description>
259328

260329
<change-notes><![CDATA[
330+
<p><b>0.7.1</b></p>
331+
<p>Enable component analysis for Golang (<code>go mod</code>) and Python (<code>pip</code>).</p>
261332
<p><b>0.7.0</b></p>
262333
<p>Initial release for the new Red Hat Dependency Analytics service.</p>
263334
<p>Based on exhort-java-api.</p>
32 KB
Loading
-2.44 MB
Binary file not shown.

0 commit comments

Comments
 (0)