2016-02-08 11:19:21 -05:00
|
|
|
// +build ignore
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"io/ioutil"
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
|
2016-05-06 10:17:41 -04:00
|
|
|
"github.com/docker/docker/oci"
|
2016-02-08 11:19:21 -05:00
|
|
|
"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")
|
|
|
|
|
2016-05-06 10:17:41 -04:00
|
|
|
rs := oci.DefaultSpec()
|
|
|
|
|
2016-02-08 11:19:21 -05:00
|
|
|
// write the default profile to the file
|
2016-05-06 10:17:41 -04:00
|
|
|
b, err := json.MarshalIndent(seccomp.DefaultProfile(&rs), "", "\t")
|
2016-02-08 11:19:21 -05:00
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
2016-02-08 13:52:53 -05:00
|
|
|
if err := ioutil.WriteFile(f, b, 0644); err != nil {
|
2016-02-08 11:19:21 -05:00
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
}
|