Skip to content

Commit e2f2abc

Browse files
authored
Merge pull request #1049 from synfinatic/security
update security.md and update golangci-lint
2 parents cecde20 + e22d226 commit e2f2abc

File tree

5 files changed

+25
-13
lines changed

5 files changed

+25
-13
lines changed

.github/workflows/golangci-lint.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
uses: golangci/golangci-lint-action@v6
3131
with:
3232
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
33-
version: v${{ vars.GOLANGCI_LINT_VERSION }}
33+
version: '${{ vars.GOLANGCI_LINT_VERSION }}'
3434

3535
# Optional: working directory, useful for monorepos
3636
# working-directory: somedir

cmd/aws-sso/setup_wizard.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ func promptConsoleDuration(defaultValue int32) int32 {
491491
val = strings.TrimSpace(val)
492492

493493
x, _ := strconv.ParseInt(val, 10, 32)
494-
return int32(x)
494+
return int32(x) // #nosec
495495
}
496496

497497
func promptHistoryLimit(defaultValue int64) int64 {

docs/security.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,21 @@
33
## Supported Versions
44

55
The only version I support is the latest version of `aws-sso`. Should a new
6-
major version be released which is incompatible with v1.x, then this policy
6+
major version be released which is incompatible with v2.x, then this policy
77
will be updated at that time.
88

9+
Note: with the v2.x release, v1.x is no longer supported.
10+
11+
## Code signing
12+
13+
All commits by me are signed by my [commit signing GPG key](commit-sign-key.asc.md).
14+
15+
## Binary signatures
16+
17+
All releases have a corresponding detactched GPG signature using my [code signing GPG key](code-sign-key.asc.md).
18+
19+
## Reporting a Vulnerability
20+
921
## Reporting a Vulnerability
1022

1123
Please open a [security ticket in GitHub](

internal/sso/awssso_auth_test.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -223,15 +223,15 @@ func TestAuthenticate(t *testing.T) {
223223
UserCode: aws.String("user-code"),
224224
VerificationUri: aws.String("verification-uri"),
225225
VerificationUriComplete: aws.String("verification-uri-complete"),
226-
ExpiresIn: int32(expires),
226+
ExpiresIn: int32(expires), // #nosec
227227
Interval: 5,
228228
},
229229
Error: nil,
230230
},
231231
{
232232
CreateToken: &ssooidc.CreateTokenOutput{
233233
AccessToken: aws.String("access-token"),
234-
ExpiresIn: int32(expires),
234+
ExpiresIn: int32(expires), // #nosec
235235
IdToken: aws.String("id-token"),
236236
RefreshToken: aws.String("refresh-token"),
237237
TokenType: aws.String("token-type"),
@@ -247,15 +247,15 @@ func TestAuthenticate(t *testing.T) {
247247
assert.NoError(t, err)
248248
assert.True(t, as.ValidAuthToken())
249249
assert.Equal(t, "access-token", as.Token.AccessToken)
250-
assert.Equal(t, int32(expires), as.Token.ExpiresIn)
250+
assert.Equal(t, int32(expires), as.Token.ExpiresIn) // #nosec
251251
assert.Equal(t, "id-token", as.Token.IdToken)
252252
assert.Equal(t, "refresh-token", as.Token.RefreshToken)
253253
assert.Equal(t, "token-type", as.Token.TokenType)
254254

255255
// We should now have a valid auth token
256256
assert.True(t, as.ValidAuthToken())
257257
assert.Equal(t, "access-token", as.Token.AccessToken)
258-
assert.Equal(t, int32(expires), as.Token.ExpiresIn)
258+
assert.Equal(t, int32(expires), as.Token.ExpiresIn) // #nosec
259259
assert.Equal(t, "id-token", as.Token.IdToken)
260260
assert.Equal(t, "refresh-token", as.Token.RefreshToken)
261261
assert.Equal(t, "token-type", as.Token.TokenType)
@@ -381,7 +381,7 @@ func TestAuthenticateFailure(t *testing.T) {
381381
UserCode: aws.String("user-code"),
382382
VerificationUri: aws.String("verification-uri"),
383383
VerificationUriComplete: aws.String("verification-uri-complete"),
384-
ExpiresIn: int32(expires),
384+
ExpiresIn: int32(expires), // #nosec
385385
Interval: 5,
386386
},
387387
Error: nil,
@@ -408,7 +408,7 @@ func TestAuthenticateFailure(t *testing.T) {
408408
UserCode: aws.String("user-code"),
409409
VerificationUri: aws.String(""),
410410
VerificationUriComplete: aws.String("verification-uri-complete"),
411-
ExpiresIn: int32(expires),
411+
ExpiresIn: int32(expires), // #nosec
412412
Interval: 5,
413413
},
414414
Error: nil,
@@ -431,7 +431,7 @@ func TestAuthenticateFailure(t *testing.T) {
431431
UserCode: aws.String("user-code"),
432432
VerificationUri: aws.String("verification-uri"),
433433
VerificationUriComplete: aws.String("verification-uri-complete"),
434-
ExpiresIn: int32(expires),
434+
ExpiresIn: int32(expires), // #nosec
435435
Interval: 5,
436436
},
437437
Error: nil,
@@ -454,7 +454,7 @@ func TestAuthenticateFailure(t *testing.T) {
454454
UserCode: aws.String("user-code"),
455455
VerificationUri: aws.String("verification-uri"),
456456
VerificationUriComplete: aws.String("verification-uri-complete"),
457-
ExpiresIn: int32(expires),
457+
ExpiresIn: int32(expires), // #nosec
458458
Interval: 5,
459459
},
460460
Error: nil,
@@ -561,7 +561,7 @@ func TestReauthenticate(t *testing.T) {
561561
UserCode: aws.String("user-code"),
562562
VerificationUri: aws.String("verification-uri"),
563563
VerificationUriComplete: aws.String("verification-uri-complete"),
564-
ExpiresIn: int32(expires),
564+
ExpiresIn: int32(expires), // #nosec
565565
Interval: 5,
566566
},
567567
Error: nil,

internal/storage/keyring.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func fileKeyringPassword(prompt string) (string, error) {
147147
}
148148

149149
fmt.Fprintf(os.Stderr, "%s: ", prompt)
150-
b, err := term.ReadPassword(int(os.Stdin.Fd()))
150+
b, err := term.ReadPassword(int(os.Stdin.Fd())) // #nosec
151151
if err != nil {
152152
return "", err
153153
}

0 commit comments

Comments
 (0)