diff --git a/server/apparmor/apparmor_common.go b/server/apparmor/apparmor_common.go new file mode 100644 index 00000000..43670865 --- /dev/null +++ b/server/apparmor/apparmor_common.go @@ -0,0 +1,14 @@ +package apparmor + +const ( + // DefaultApparmorProfile is the name of default apparmor profile name. + DefaultApparmorProfile = "ocid-default" + + // ContainerAnnotationKeyPrefix is the prefix to an annotation key specifying a container profile. + ContainerAnnotationKeyPrefix = "container.apparmor.security.beta.kubernetes.io/" + + // ProfileRuntimeDefault is he profile specifying the runtime default. + ProfileRuntimeDefault = "runtime/default" + // ProfileNamePrefix is the prefix for specifying profiles loaded on the node. + ProfileNamePrefix = "localhost/" +) diff --git a/server/apparmor/apparmor.go b/server/apparmor/apparmor_supported.go similarity index 86% rename from server/apparmor/apparmor.go rename to server/apparmor/apparmor_supported.go index 824be5ec..ff9205ad 100644 --- a/server/apparmor/apparmor.go +++ b/server/apparmor/apparmor_supported.go @@ -17,20 +17,9 @@ import ( ) const ( - // DefaultApparmorProfile is the name of default apparmor profile name. - DefaultApparmorProfile = "ocid-default" - // profileDirectory is the file store for apparmor profiles and macros. profileDirectory = "/etc/apparmor.d" - // ContainerAnnotationKeyPrefix is the prefix to an annotation key specifying a container profile. - ContainerAnnotationKeyPrefix = "container.apparmor.security.beta.kubernetes.io/" - - // ProfileRuntimeDefault is he profile specifying the runtime default. - ProfileRuntimeDefault = "runtime/default" - // ProfileNamePrefix is the prefix for specifying profiles loaded on the node. - ProfileNamePrefix = "localhost/" - // readConfigTimeout is the timeout of reading apparmor profiles. readConfigTimeout = 10 ) diff --git a/server/apparmor/apparmor_unsupported.go b/server/apparmor/apparmor_unsupported.go index c98e6dc7..b4c107c0 100644 --- a/server/apparmor/apparmor_unsupported.go +++ b/server/apparmor/apparmor_unsupported.go @@ -2,19 +2,6 @@ package apparmor -const ( - // DefaultApparmorProfile is the name of default apparmor profile name. - DefaultApparmorProfile = "ocid-default" - - // ContainerAnnotationKeyPrefix is the prefix to an annotation key specifying a container profile. - ContainerAnnotationKeyPrefix = "container.apparmor.security.beta.kubernetes.io/" - - // ProfileRuntimeDefault is he profile specifying the runtime default. - ProfileRuntimeDefault = "runtime/default" - // ProfileNamePrefix is the prefix for specifying profiles loaded on the node. - ProfileNamePrefix = "localhost/" -) - // IsEnabled returns false, when build without apparmor build tag. func IsEnabled() bool { return false