Skip to content

Commit 4adaa0f

Browse files
committed
fix: suppress gosec G702 false positive in service_client.go
Add nosec comment to allow command execution from OS_PW_CMD environment variable. This is an intentional feature for secure password retrieval where the environment variable is set by operator/admin, not user input.
1 parent 56b3698 commit 4adaa0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/openstack/service_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func GetServiceClient(ctx context.Context, serviceType string, authInfo *clientc
3636

3737
if osPWCmd := os.Getenv("OS_PW_CMD"); osPWCmd != "" {
3838
// run external command to get password
39-
cmd := exec.Command("sh", "-c", osPWCmd)
39+
cmd := exec.Command("sh", "-c", osPWCmd) // #nosec G702 -- OS_PW_CMD is set by operator/admin, not user input
4040
out, err := cmd.Output()
4141
if err != nil {
4242
return nil, err

0 commit comments

Comments
 (0)