You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update the README with some details about the CWE mapping (#407)
* Fix some typos in the README file
Signed-off-by: Cosmin Cojocar <[email protected]>
* Update the README with some details about the CWE mapping
Signed-off-by: Cosmin Cojocar <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+19-13Lines changed: 19 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,8 @@ Inspects source code for security problems by scanning the Go AST.
7
7
8
8
## License
9
9
10
-
Licensed under the Apache License, Version 2.0 (the "License");
11
-
you may not use this file except in compliance with the License.
10
+
Licensed under the Apache License, Version 2.0 (the "License").
11
+
You may not use this file except in compliance with the License.
12
12
You may obtain a copy of the License [here](http://www.apache.org/licenses/LICENSE-2.0).
13
13
14
14
## Project status
@@ -59,7 +59,7 @@ go get github.com/securego/gosec/cmd/gosec
59
59
Gosec can be configured to only run a subset of rules, to exclude certain file
60
60
paths, and produce reports in different formats. By default all rules will be
61
61
run against the supplied input files. To recursively scan from the current
62
-
directory you can supply './...' as the input argument.
62
+
directory you can supply `./...` as the input argument.
63
63
64
64
65
65
### Available rules
@@ -96,8 +96,8 @@ directory you can supply './...' as the input argument.
96
96
97
97
### Selecting rules
98
98
99
-
By default gosec will run all rules against the supplied file paths. It is however possible to select a subset of rules to run via the '-include=' flag,
100
-
or to specify a set of rules to explicitly exclude using the '-exclude=' flag.
99
+
By default, gosec will run all rules against the supplied file paths. It is however possible to select a subset of rules to run via the `-include=` flag,
100
+
or to specify a set of rules to explicitly exclude using the `-exclude=` flag.
Every issue detected by `gosec` is mapped to a [CWE (Common Weakness Enumeration)](http://cwe.mitre.org/data/index.html) which describes in more generic terms the vulnerability. The exact mapping can be found [here](https://github.com/securego/gosec/blob/53be8dd8644ee48802114178cff6eb7e29757414/issue.go#L49).
109
112
110
113
### Configuration
111
114
@@ -140,7 +143,7 @@ of functions which will be skipped when auditing the not checked errors:
140
143
141
144
### Dependencies
142
145
143
-
gosec will fetch automatically the dependencies of the code which is being analyzed when go modules are turned on (e.g.` GO111MODULE=on`). If this is not the case,
146
+
gosec will fetch automatically the dependencies of the code which is being analyzed when go module is turned on (e.g.` GO111MODULE=on`). If this is not the case,
144
147
the dependencies need to be explicitly downloaded by running the `go get -d` command before the scan.
145
148
146
149
### Excluding test files and folders
@@ -162,7 +165,8 @@ Also additional folders can be excluded as follows:
162
165
163
166
### Annotating code
164
167
165
-
As with all automated detection tools there will be cases of false positives. In cases where gosec reports a failure that has been manually verified as being safe it is possible to annotate the code with a '#nosec' comment.
168
+
As with all automated detection tools, there will be cases of false positives. In cases where gosec reports a failure that has been manually verified as being safe,
169
+
it is possible to annotate the code with a `#nosec` comment.
166
170
167
171
The annotation causes gosec to stop processing any further nodes within the
168
172
AST so can apply to a whole block or more granularly to a single expression.
@@ -183,10 +187,12 @@ func main(){
183
187
184
188
```
185
189
186
-
When a specific false positive has been identified and verified as safe, you may wish to suppress only that single rule (or a specific set of rules) within a section of code, while continuing to scan for other problems. To do this, you can list the rule(s) to be suppressed within the `#nosec` annotation, e.g: `/* #nosec G401 */` or `// #nosec G201 G202 G203 `
190
+
When a specific false positive has been identified and verified as safe, you may wish to suppress only that single rule (or a specific set of rules)
191
+
within a section of code, while continuing to scan for other problems. To do this, you can list the rule(s) to be suppressed within
192
+
the `#nosec` annotation, e.g: `/* #nosec G401 */` or `// #nosec G201 G202 G203`
187
193
188
-
In some cases you may also want to revisit places where #nosec annotations
189
-
have been used. To run the scanner and ignore any #nosec annotations you
194
+
In some cases you may also want to revisit places where `#nosec` annotations
195
+
have been used. To run the scanner and ignore any `#nosec` annotations you
190
196
can do the following:
191
197
192
198
```bash
@@ -244,7 +250,7 @@ The released version of the tool is available in the `dist` folder. The build in
244
250
gosec - Golang security checker
245
251
246
252
gosec analyzes Go source code to look for common programming mistakes that
247
-
can lead to security problems.
253
+
248
254
249
255
VERSION: 1.0.0
250
256
GIT TAG: v1.0.0
@@ -262,7 +268,7 @@ make image
262
268
```
263
269
264
270
You can run the `gosec` tool in a container against your local Go project. You just have to mount the project
265
-
into a volume as follow:
271
+
into a volume as follows:
266
272
267
273
```bash
268
274
docker run -it -v <YOUR PROJECT PATH>/<PROJECT>:/<PROJECT> securego/gosec /<PROJECT>/...
@@ -284,4 +290,4 @@ You can invoke now the `go generate` in the root of the project:
284
290
go generate ./...
285
291
```
286
292
287
-
This will generate the `rules/tls_config.go` file with will contain the current ciphers recommendation from Mozilla.
293
+
This will generate the `rules/tls_config.go` file which will contain the current ciphers recommendation from Mozilla.
0 commit comments