Skip to content

Commit 948f8c0

Browse files
add VULS_TAGS env into contiriv future-vuls (future-architect#1466)
1 parent 1c1e400 commit 948f8c0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

contrib/future-vuls/cmd/main.go

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"fmt"
88
"os"
99
"strconv"
10+
"strings"
1011

1112
"github.com/future-architect/vuls/config"
1213
"github.com/future-architect/vuls/models"
@@ -21,6 +22,7 @@ var (
2122
serverUUID string
2223
groupID int64
2324
token string
25+
tags []string
2426
url string
2527
)
2628

@@ -47,6 +49,9 @@ func main() {
4749
if len(token) == 0 {
4850
token = os.Getenv("VULS_TOKEN")
4951
}
52+
if len(tags) == 0 {
53+
tags = strings.Split(os.Getenv("VULS_TAGS"), ",")
54+
}
5055

5156
var scanResultJSON []byte
5257
if stdIn {
@@ -69,6 +74,9 @@ func main() {
6974
return
7075
}
7176
scanResult.ServerUUID = serverUUID
77+
if 0 < len(tags) {
78+
scanResult.Optional["VULS_TAGS"] = tags
79+
}
7280

7381
config.Conf.Saas.GroupID = groupID
7482
config.Conf.Saas.Token = token

0 commit comments

Comments
 (0)