mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-23 07:29:00 -08:00
40 lines
830 B
Go
40 lines
830 B
Go
//go:generate tinygo build -o scanner.wasm -target=wasip1 --buildmode=c-shared scanner.go
|
|
//go:build tinygo.wasm
|
|
|
|
package main
|
|
|
|
import (
|
|
"github.com/aquasecurity/trivy/pkg/module/api"
|
|
"github.com/aquasecurity/trivy/pkg/module/serialize"
|
|
"github.com/aquasecurity/trivy/pkg/module/wasm"
|
|
)
|
|
|
|
const (
|
|
moduleVersion = 2
|
|
moduleName = "scanner"
|
|
)
|
|
|
|
func init() {
|
|
wasm.RegisterModule(PostScannerModule{})
|
|
}
|
|
|
|
type PostScannerModule struct{}
|
|
|
|
func (PostScannerModule) Version() int {
|
|
return moduleVersion
|
|
}
|
|
|
|
func (PostScannerModule) Name() string {
|
|
return moduleName
|
|
}
|
|
|
|
func (PostScannerModule) PostScanSpec() serialize.PostScanSpec {
|
|
return serialize.PostScanSpec{
|
|
Action: api.ActionInsert, // Add new vulnerabilities
|
|
}
|
|
}
|
|
|
|
func (PostScannerModule) PostScan(_ serialize.Results) (serialize.Results, error) {
|
|
return nil, nil
|
|
}
|