Skip to content

Commit af2b67c

Browse files
committed
Add nosec exclusions
1 parent 925f087 commit af2b67c

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

command/oauth/cmd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ func oauthCmd(c *cli.Context) error {
526526
fmt.Println(tok.AccessToken)
527527
}
528528
} else {
529-
b, err := json.MarshalIndent(tok, "", " ")
529+
b, err := json.MarshalIndent(tok, "", " ") // #nosec G117 -- printing the token details intentionally
530530
if err != nil {
531531
return errors.Wrapf(err, "error marshaling token data")
532532
}
@@ -1318,7 +1318,7 @@ func (o *oauth) badRequest(w http.ResponseWriter, msg string) {
13181318
w.Write([]byte(`</div>`))
13191319
w.Write([]byte(`<p style='font-size: 20px;'>`))
13201320
w.Write([]byte(`<strong style='font-size: 28px; color: red;'>Failure</strong><br />`))
1321-
w.Write([]byte(msg))
1321+
w.Write([]byte(msg)) // #nosec G705 -- message is either a string literal, or comes from (trusted) IdP
13221322
w.Write([]byte(`</p></body></html>`))
13231323
o.errCh <- errors.New(msg)
13241324
}

utils/cautils/tpm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ func (ac *attestationClient) verifyDecryptedSecret(ctx context.Context, secret [
649649
DecryptedSecret: secret,
650650
}
651651

652-
body, err := json.Marshal(sr)
652+
body, err := json.Marshal(sr) // #nosec G117 -- the decrypted secret is intentionally sent back to attestation CA (via HTTPS)
653653
if err != nil {
654654
return nil, fmt.Errorf("failed marshaling secret request: %w", err)
655655
}

0 commit comments

Comments
 (0)