Skip to content

Commit e149094

Browse files
authored
docs: fix modules path and update code example (#9539)
Signed-off-by: nikpivkin <[email protected]>
1 parent a4cbd6a commit e149094

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

docs/docs/advanced/modules.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ Trivy adheres to the XDG specification, so the location depends on whether XDG_D
4747
Trivy will now search XDG_DATA_HOME for the location of the Trivy modules cache.
4848
The preference order is as follows:
4949

50-
- XDG_DATA_HOME if set and .trivy/plugins exists within the XDG_DATA_HOME dir
51-
- $HOME/.trivy/plugins
50+
- XDG_DATA_HOME if set and .trivy/modules exists within the XDG_DATA_HOME dir
51+
- $HOME/.trivy/modules
5252

5353
For example, to download the WebAssembly module, you can execute the following command:
5454

@@ -137,6 +137,10 @@ $ go mod init github.com/aquasecurity/trivy-module-wordpress
137137
```go
138138
package main
139139

140+
import (
141+
"github.com/aquasecurity/trivy/pkg/module/wasm"
142+
)
143+
140144
const (
141145
version = 1
142146
name = "wordpress-module"
@@ -145,6 +149,10 @@ const (
145149
// main is required for Go to compile the Wasm module
146150
func main() {}
147151

152+
func init() {
153+
wasm.RegisterModule(WordpressModule{})
154+
}
155+
148156
type WordpressModule struct{
149157
// Cannot define fields as modules can't keep state.
150158
}

pkg/module/serialize/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ type PostScanSpec struct {
2626
Action PostScanAction
2727

2828
// IDs represent which vulnerability and misconfiguration ID will be updated or deleted in post scanning.
29-
// When the action is UPDATE, the matched result will be passed to the module.
29+
// When the action is UPDATE or DELETE, the matched result will be passed to the module.
3030
IDs []string
3131
}

0 commit comments

Comments
 (0)