Skip to content

Commit

Permalink
Allow Firehose authentication using sts credentials (kolide#2034)
Browse files Browse the repository at this point in the history
  • Loading branch information
edulop91 authored and zwass committed Apr 24, 2019
1 parent 75868a7 commit ad12ee4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions server/logging/firehose.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,17 @@ type firehoseLogWriter struct {
}

func NewFirehoseLogWriter(region, id, secret, stream string, logger log.Logger) (*firehoseLogWriter, error) {
sess, err := session.NewSession(&aws.Config{
Credentials: credentials.NewStaticCredentials(id, secret, ""),
Region: &region,
})
conf := &aws.Config{
Region: &region,
}

// Only provide static credentials if we have them
// otherwise use the default credentials provider chain
if id != "" && secret != "" {
conf.Credentials = credentials.NewStaticCredentials(id, secret, "")
}

sess, err := session.NewSession(conf)
if err != nil {
return nil, errors.Wrap(err, "create Firehose client")
}
Expand Down

0 comments on commit ad12ee4

Please sign in to comment.