forked from dockersecuritytools/batten
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbatten.go
39 lines (30 loc) · 785 Bytes
/
batten.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
38
39
package main
import (
"os"
"github.com/dockersecuritytools/batten/batten"
"github.com/dockersecuritytools/batten/cli"
"gopkg.in/alecthomas/kingpin.v1"
)
const (
Name = "batten"
Description = "Hardening and Auditing Tool For Docker Hosts & Containers"
Version = "0.1.0"
)
var (
app = kingpin.New(Name, Description)
appDebug = kingpin.Flag("debug", "Enable debug mode.").Bool()
appCheck = app.Command("check", "Check host for known issues.")
)
func main() {
kingpin.Version(Version)
args, err := app.Parse(os.Args[1:])
switch kingpin.MustParse(args, err) {
case appCheck.FullCommand():
for i, check := range batten.Checks {
results := batten.RunCheck(check)
cli.FormatResultsForConsole(i, results)
}
default:
app.Usage(os.Stdout)
}
}