diff --git a/pkg/operator/ceph/cluster/crash/crash.go b/pkg/operator/ceph/cluster/crash/crash.go index 66f021bf6..160f6e244 100644 --- a/pkg/operator/ceph/cluster/crash/crash.go +++ b/pkg/operator/ceph/cluster/crash/crash.go @@ -39,7 +39,7 @@ import ( const ( crashCollectorKeyringUsername = "client.crash" - crashCollectorSecretName = "rook-ceph-crash-collector-keyring" + crashCollectorKeyName = "rook-ceph-crash-collector-keyring" ) // ClusterResource operator-kit Custom Resource Definition diff --git a/pkg/operator/ceph/cluster/crash/keyring.go b/pkg/operator/ceph/cluster/crash/keyring.go index 38424b0eb..52dabe439 100644 --- a/pkg/operator/ceph/cluster/crash/keyring.go +++ b/pkg/operator/ceph/cluster/crash/keyring.go @@ -80,7 +80,7 @@ func createOrUpdateCrashCollectorSecret(namespace, crashCollectorSecretKey strin s := &corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ - Name: crashCollectorSecretName, + Name: crashCollectorKeyName, Namespace: namespace, }, Data: crashCollectorSecret, diff --git a/pkg/operator/ceph/cluster/mgr/dashboard.go b/pkg/operator/ceph/cluster/mgr/dashboard.go index d04f90cec..e0da2a26f 100755 --- a/pkg/operator/ceph/cluster/mgr/dashboard.go +++ b/pkg/operator/ceph/cluster/mgr/dashboard.go @@ -34,10 +34,11 @@ import ( ) const ( - dashboardModuleName = "dashboard" - dashboardPortHTTPS = 8443 - dashboardPortHTTP = 7000 - dashboardUsername = "admin" + dashboardModuleName = "dashboard" + dashboardPortHTTPS = 8443 + dashboardPortHTTP = 7000 + dashboardUsername = "admin" + // #nosec because of the word `Password` dashboardPasswordName = "rook-ceph-dashboard-password" passwordLength = 20 passwordKeyName = "password" @@ -273,6 +274,7 @@ func (c *Cluster) getOrGenerateDashboardPassword() (string, error) { } func generatePassword(length int) (string, error) { + // #nosec because of the word password const passwordChars = "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" passwd, err := generateRandomBytes(length) if err != nil { diff --git a/pkg/operator/ceph/csi/secrets.go b/pkg/operator/ceph/csi/secrets.go index 36df4acf3..60033a14b 100644 --- a/pkg/operator/ceph/csi/secrets.go +++ b/pkg/operator/ceph/csi/secrets.go @@ -25,6 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// #nosec because of the word `Secret` const ( csiKeyringRBDProvisionerUsername = "client.csi-rbd-provisioner" csiKeyringRBDNodeUsername = "client.csi-rbd-node" @@ -32,6 +33,7 @@ const ( csiRBDProvisionerSecret = "rook-csi-rbd-provisioner" ) +// #nosec because of the word `Secret` const ( csiKeyringCephFSProvisionerUsername = "client.csi-cephfs-provisioner" csiKeyringCephFSNodeUsername = "client.csi-cephfs-node" diff --git a/pkg/operator/ceph/test/podspec.go b/pkg/operator/ceph/test/podspec.go index 895577238..da44c5c42 100644 --- a/pkg/operator/ceph/test/podspec.go +++ b/pkg/operator/ceph/test/podspec.go @@ -67,9 +67,11 @@ func NewPodSpecTester(t *testing.T, spec *v1.PodSpec) *PodSpecTester { func (ps *PodSpecTester) AssertVolumesMeetCephRequirements( daemonType config.DaemonType, daemonID string, ) { + // #nosec because of the word `Secret` keyringSecretName := fmt.Sprintf("rook-ceph-%s-%s-keyring", daemonType, daemonID) if daemonType == config.MonType { - keyringSecretName = "rook-ceph-mons-keyring" // mons share a keyring + // #nosec because of the word `Secret` + keyringSecretName = "rook-ceph-mons-keyring" } requiredVols := []string{"rook-config-override", keyringSecretName} if daemonType != config.RbdMirrorType { diff --git a/pkg/operator/edgefs/cluster/target/layout.go b/pkg/operator/edgefs/cluster/target/layout.go index 258e742c6..368d26c0f 100644 --- a/pkg/operator/edgefs/cluster/target/layout.go +++ b/pkg/operator/edgefs/cluster/target/layout.go @@ -32,7 +32,8 @@ import ( const ( // DefaultContainerMaxCapacity - max allowed container disks capacity, if exeeded then new new container will be added DefaultContainerMaxCapacity = "132Ti" - S3PayloadSecretsPath = "/opt/nedge/etc/secrets/" + // #nosec because of the word `Secret` + S3PayloadSecretsPath = "/opt/nedge/etc/secrets/" ) // CreateQualifiedHeadlessServiceName creates a qualified name of the headless service for a given replica id and namespace,