-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
37 lines (28 loc) · 848 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// main.go
package main
import (
"github.com/unicrons/powerpipe-securityhub-importer/cmd"
"github.com/unicrons/powerpipe-securityhub-importer/pkg/aws"
"github.com/unicrons/powerpipe-securityhub-importer/pkg/logger"
log "github.com/sirupsen/logrus"
)
func main() {
flags, err := cmd.ParseFlags()
if err != nil {
log.Error("error parsing flags:", err)
return
}
roleName := flags.RoleName
findingsPath := flags.FindingsFile
sessionName := flags.SessionName
onlyFailed := flags.OnlyFailed
logFormat := flags.LogFormat
logger.SetLoggerFormat(logFormat)
log.Info("starting powerpipe securityhub importer")
err = aws.SecurityHubImportFindings(findingsPath, roleName, sessionName, onlyFailed)
if err != nil {
log.Error("error importing security findings:", err)
return
}
log.Info("securityhub finding import finished")
}