2021-08-23 09:14:53 -04:00
|
|
|
//go:build ignore
|
2016-02-08 11:19:21 -05:00
|
|
|
// +build ignore
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
|
|
|
|
"github.com/docker/docker/profiles/seccomp"
|
|
|
|
)
|
|
|
|
|
|
|
|
// saves the default seccomp profile as a json file so people can use it as a
|
|
|
|
// base for their own custom profiles
|
|
|
|
func main() {
|
|
|
|
wd, err := os.Getwd()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
f := filepath.Join(wd, "default.json")
|
|
|
|
|
|
|
|
// write the default profile to the file
|
2016-07-13 09:41:30 -04:00
|
|
|
b, err := json.MarshalIndent(seccomp.DefaultProfile(), "", "\t")
|
2016-02-08 11:19:21 -05:00
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
2021-08-24 06:10:50 -04:00
|
|
|
if err := os.WriteFile(f, b, 0644); err != nil {
|
2016-02-08 11:19:21 -05:00
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
}
|