Skip to content

Commit

Permalink
Merge pull request #1049 from synfinatic/security
Browse files Browse the repository at this point in the history
update security.md and update golangci-lint
  • Loading branch information
synfinatic authored Sep 6, 2024
2 parents cecde20 + e22d226 commit e2f2abc
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: golangci/golangci-lint-action@v6
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v${{ vars.GOLANGCI_LINT_VERSION }}
version: '${{ vars.GOLANGCI_LINT_VERSION }}'

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
2 changes: 1 addition & 1 deletion cmd/aws-sso/setup_wizard.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ func promptConsoleDuration(defaultValue int32) int32 {
val = strings.TrimSpace(val)

x, _ := strconv.ParseInt(val, 10, 32)
return int32(x)
return int32(x) // #nosec
}

func promptHistoryLimit(defaultValue int64) int64 {
Expand Down
14 changes: 13 additions & 1 deletion docs/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,21 @@
## Supported Versions

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

Note: with the v2.x release, v1.x is no longer supported.

## Code signing

All commits by me are signed by my [commit signing GPG key](commit-sign-key.asc.md).

## Binary signatures

All releases have a corresponding detactched GPG signature using my [code signing GPG key](code-sign-key.asc.md).

## Reporting a Vulnerability

## Reporting a Vulnerability

Please open a [security ticket in GitHub](
Expand Down
18 changes: 9 additions & 9 deletions internal/sso/awssso_auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,15 @@ func TestAuthenticate(t *testing.T) {
UserCode: aws.String("user-code"),
VerificationUri: aws.String("verification-uri"),
VerificationUriComplete: aws.String("verification-uri-complete"),
ExpiresIn: int32(expires),
ExpiresIn: int32(expires), // #nosec
Interval: 5,
},
Error: nil,
},
{
CreateToken: &ssooidc.CreateTokenOutput{
AccessToken: aws.String("access-token"),
ExpiresIn: int32(expires),
ExpiresIn: int32(expires), // #nosec
IdToken: aws.String("id-token"),
RefreshToken: aws.String("refresh-token"),
TokenType: aws.String("token-type"),
Expand All @@ -247,15 +247,15 @@ func TestAuthenticate(t *testing.T) {
assert.NoError(t, err)
assert.True(t, as.ValidAuthToken())
assert.Equal(t, "access-token", as.Token.AccessToken)
assert.Equal(t, int32(expires), as.Token.ExpiresIn)
assert.Equal(t, int32(expires), as.Token.ExpiresIn) // #nosec
assert.Equal(t, "id-token", as.Token.IdToken)
assert.Equal(t, "refresh-token", as.Token.RefreshToken)
assert.Equal(t, "token-type", as.Token.TokenType)

// We should now have a valid auth token
assert.True(t, as.ValidAuthToken())
assert.Equal(t, "access-token", as.Token.AccessToken)
assert.Equal(t, int32(expires), as.Token.ExpiresIn)
assert.Equal(t, int32(expires), as.Token.ExpiresIn) // #nosec
assert.Equal(t, "id-token", as.Token.IdToken)
assert.Equal(t, "refresh-token", as.Token.RefreshToken)
assert.Equal(t, "token-type", as.Token.TokenType)
Expand Down Expand Up @@ -381,7 +381,7 @@ func TestAuthenticateFailure(t *testing.T) {
UserCode: aws.String("user-code"),
VerificationUri: aws.String("verification-uri"),
VerificationUriComplete: aws.String("verification-uri-complete"),
ExpiresIn: int32(expires),
ExpiresIn: int32(expires), // #nosec
Interval: 5,
},
Error: nil,
Expand All @@ -408,7 +408,7 @@ func TestAuthenticateFailure(t *testing.T) {
UserCode: aws.String("user-code"),
VerificationUri: aws.String(""),
VerificationUriComplete: aws.String("verification-uri-complete"),
ExpiresIn: int32(expires),
ExpiresIn: int32(expires), // #nosec
Interval: 5,
},
Error: nil,
Expand All @@ -431,7 +431,7 @@ func TestAuthenticateFailure(t *testing.T) {
UserCode: aws.String("user-code"),
VerificationUri: aws.String("verification-uri"),
VerificationUriComplete: aws.String("verification-uri-complete"),
ExpiresIn: int32(expires),
ExpiresIn: int32(expires), // #nosec
Interval: 5,
},
Error: nil,
Expand All @@ -454,7 +454,7 @@ func TestAuthenticateFailure(t *testing.T) {
UserCode: aws.String("user-code"),
VerificationUri: aws.String("verification-uri"),
VerificationUriComplete: aws.String("verification-uri-complete"),
ExpiresIn: int32(expires),
ExpiresIn: int32(expires), // #nosec
Interval: 5,
},
Error: nil,
Expand Down Expand Up @@ -561,7 +561,7 @@ func TestReauthenticate(t *testing.T) {
UserCode: aws.String("user-code"),
VerificationUri: aws.String("verification-uri"),
VerificationUriComplete: aws.String("verification-uri-complete"),
ExpiresIn: int32(expires),
ExpiresIn: int32(expires), // #nosec
Interval: 5,
},
Error: nil,
Expand Down
2 changes: 1 addition & 1 deletion internal/storage/keyring.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func fileKeyringPassword(prompt string) (string, error) {
}

fmt.Fprintf(os.Stderr, "%s: ", prompt)
b, err := term.ReadPassword(int(os.Stdin.Fd()))
b, err := term.ReadPassword(int(os.Stdin.Fd())) // #nosec
if err != nil {
return "", err
}
Expand Down

0 comments on commit e2f2abc

Please sign in to comment.