diff --git a/cmd/package/package.go b/cmd/package/package.go index af7702dbb8..0ba6ef05bb 100644 --- a/cmd/package/package.go +++ b/cmd/package/package.go @@ -66,6 +66,11 @@ func main() { Usage: "Identity to use for codesigning", Destination: &opt.SignIdentity, }, + &cli.BoolFlag{ + Name: "notarize", + Usage: "Whether to notarize macOS packages", + Destination: &opt.Notarize, + }, &cli.BoolFlag{ Name: "debug", Usage: "Enable debug logging", diff --git a/pkg/packaging/macos.go b/pkg/packaging/macos.go index a0afff82ee..59dcebb532 100644 --- a/pkg/packaging/macos.go +++ b/pkg/packaging/macos.go @@ -102,8 +102,10 @@ func BuildPkg(opt Options) error { } } - if err := notarizePkg(generatedPath); err != nil { - return err + if opt.Notarize { + if err := notarizePkg(generatedPath); err != nil { + return err + } } filename := fmt.Sprintf("orbit-osquery_%s_amd64.pkg", opt.Version) diff --git a/pkg/packaging/packaging.go b/pkg/packaging/packaging.go index 2c37ac5e35..2994a4db9f 100644 --- a/pkg/packaging/packaging.go +++ b/pkg/packaging/packaging.go @@ -27,6 +27,8 @@ type Options struct { Insecure bool // SignIdentity is the codesigning identity to use (only macOS at this time) SignIdentity string + // Notarize sets whether macOS packages should be Notarized. + Notarize bool } func copyFile(srcPath, dstPath string, perm os.FileMode) error {