Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom S3 Endpoint not authenticating via HTTPS #1051

Closed
ThoreKr opened this issue Sep 25, 2019 · 13 comments
Closed

Custom S3 Endpoint not authenticating via HTTPS #1051

ThoreKr opened this issue Sep 25, 2019 · 13 comments
Labels
component/loki good first issue These are great first issues. If you are looking for a place to start, start here! help wanted We would love help on these issues. Please come help us!

Comments

@ThoreKr
Copy link

ThoreKr commented Sep 25, 2019

When trying to set up loki with a custom s3 endpoint (ceph rgw) we always get authentication issues.
As far as header logging and tcpdump have shown loki initially tries to connect via http to the rgw. This call does contain an authorization header.

We redirect from HTTP to HTTPS (301), causing the http client to strip the authentication header and resend the request, causing the request to fail.

This issue seems to be located here: https://github.com/weaveworks/common/blob/54b7e30527f846e1515fb5a85d0ff5674f05a267/aws/config.go#L48

As apparently there is currently no way to force a direct connection via HTTPS.

@chancez
Copy link
Contributor

chancez commented Sep 26, 2019

Note it looks like https does work in the latest version of weaveworks/common: https://github.com/weaveworks/common/blob/master/aws/config.go#L53

@chancez
Copy link
Contributor

chancez commented Sep 26, 2019

But currently loki is using:

[[constraint]]
  name = "github.com/weaveworks/common"
  source = "https://github.com/sandlis/weaveworks-common"
  branch = "server-listen-addr"

@cyriltovena
Copy link
Contributor

cyriltovena commented Sep 26, 2019 via email

@cyriltovena
Copy link
Contributor

#945

@cyriltovena cyriltovena added component/loki good first issue These are great first issues. If you are looking for a place to start, start here! hacktoberfest help wanted We would love help on these issues. Please come help us! labels Sep 26, 2019
@ThoreKr
Copy link
Author

ThoreKr commented Sep 28, 2019

I created a loki build based on weaveworks/common#167 now it does connect to the radosgw on port 443, but sends an http package (with an Authorization header).

@ThoreKr
Copy link
Author

ThoreKr commented Sep 28, 2019

Hum, it seems to be partially related to stuff still being placed underneath vendor/github,com/weavework/common which is still outdated.

Not sure what needs to be updated here.

@MrSaints
Copy link
Contributor

We've encountered a similar problem using Loki with DigitalOcean Spaces.

@ThoreKr
Copy link
Author

ThoreKr commented Oct 18, 2019

Unfortunately it seems like there is little hope to get this working someday soon.

@ThoreKr
Copy link
Author

ThoreKr commented Nov 11, 2019

@MrSaints since #1226 has been merged a custom built version works for us.

@ThoreKr ThoreKr closed this as completed Nov 11, 2019
@MrSaints
Copy link
Contributor

Thanks for the update, and for your personal time needed to push this through 👍

@mrmassis
Copy link

Hi, sorry by reopen this issue.
I couldnt find the way to configure ceph rgw https in loki.
Anyone can help me?

@ThoreKr
Copy link
Author

ThoreKr commented Jun 20, 2020

This is my storage config:

storage_config:
  boltdb:
    directory: /var/lib/loki/index

  aws:
    s3: "https://access_key:secret_access_key@radosgw.service:443/loki"
    s3forcepathstyle: true

I think the port can be omitted by now, maybe even the protocol, i think it has been changed to use https by default, but it doesn't hurt to enforce it.

@mrmassis
Copy link

Tkz so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/loki good first issue These are great first issues. If you are looking for a place to start, start here! help wanted We would love help on these issues. Please come help us!
Projects
None yet
Development

No branches or pull requests

5 participants