mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
cleanup: address gosec warnings
gosec warns about security problems by scanning the Go AST. Issues Reported: G101 (CWE-798): Potential hardcoded credentials (Confidence: LOW, Severity: HIGH) G204 (CWE-78): Subprocess launched with variable (Confidence: HIGH, Severity: MEDIUM) G304 (CWE-22): Potential file inclusion via variable (Confidence: HIGH, Severity: MEDIUM) Signed-off-by: Yug <yuggupta27@gmail.com>
This commit is contained in:
@ -96,7 +96,7 @@ func (cp *ConnPool) Destroy() {
|
||||
|
||||
func (cp *ConnPool) generateUniqueKey(monitors, user, keyfile string) (string, error) {
|
||||
// the keyfile can be unique for operations, contents will be the same
|
||||
key, err := ioutil.ReadFile(keyfile) // nolint: gosec, #nosec
|
||||
key, err := ioutil.ReadFile(keyfile) // #nosec:G304, file inclusion via variable.
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("could not open keyfile %s: %w", keyfile, err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user