Skip to content

Commit

Permalink
fix: do not redact the expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
ZackarySantana committed Sep 25, 2024
1 parent 057007d commit 21d2315
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion agent/command/assume_ec2_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (r *ec2AssumeRole) execute(ctx context.Context, comm client.Communicator, l
conf.NewExpansions.PutAndRedact(globals.AWSAccessKeyId, creds.AccessKeyID)
conf.NewExpansions.PutAndRedact(globals.AWSSecretAccessKey, creds.SecretAccessKey)
conf.NewExpansions.PutAndRedact(globals.AWSSessionToken, creds.SessionToken)
conf.NewExpansions.PutAndRedact(globals.AWSRoleExpiration, creds.Expiration)
conf.NewExpansions.Put(globals.AWSRoleExpiration, creds.Expiration)

return nil
}
Expand Down
3 changes: 2 additions & 1 deletion agent/command/assume_ec2_role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ func TestEC2AssumeRoleExecute(t *testing.T) {
assert.True(t, hasAccessKey)
assert.True(t, hasSecretAccessKey)
assert.True(t, hasSessionToken)
assert.True(t, hasExpiration)
// The expiration should not be redacted.
assert.False(t, hasExpiration)
})
},
} {
Expand Down

0 comments on commit 21d2315

Please sign in to comment.