Proxy authentication credentials using proxy_connect_header not working
246 views
Skip to first unread message
Kesavanand Chavali
unread,
Feb 25, 2023, 3:37:49 AM2/25/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Prometheus Users
Hello,
we have a proxy that requires authentication using username and password. we upgraded to 2.42 version of prometheus and tried to use proxy_connect_header.
Basically we need to send Authorization header as "Basic base64_encoded(user:password)"
as given in below links we tried to pass header without "Basic" word.
we tried passing as plain string, base64 and secret (bcrypt encrypted string) and nothing works. we also tried with and without Basic keyword. But no luck
Any help is highly appreciated
Thanks in advance
Here is our prometheus.yml, running on windows 2016 server as a windows service
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Prometheus Users
The base64 one you've shown looks correct (user1:password1). You definitely *don't* send a hash of the password; the plaintext is sent to the proxy, and the proxy hashes that value and compares it with its stored hash.
If you use tcpdump or wireshark, you can look at the raw request going to 1.2.3.4 port 8080 and confirm that it includes
Authorization: Basic dXNlcjE6cGFzc3dvcmQx
If it does, then the problem is with your proxy (e.g. it doesn't accept basic auth, or it doesn't like the username/password you have provided) and you'll need to look at the logs there to see why it was rejected. Also, check the text of the HTTP response which may give you more clues.
If it doesn't, then please show what you see instead.
Kesavanand Chavali
unread,
Mar 2, 2023, 1:32:07 AM3/2/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Prometheus Users
we did a wireshark capture and found that below works. This we figured out from other already working clients with other software; e.g. some clients working with same proxy.
Could you please update the Prometheus documentation?
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Prometheus Users
On Thursday, 2 March 2023 at 06:32:07 UTC Kesavanand Chavali wrote:
we did a wireshark capture and found that below works. This we figured out from other already working clients with other software; e.g. some clients working with same proxy.
Could you please update the Prometheus documentation?
Can you identify the part of the documentation which needs updating, and propose a change?
# Specifies headers to send to proxies during CONNECT requests.
[ proxy_connect_header:
[ <string>: [<secret>, ...] ] ]
i.e. "send whatever headers you need to".
Ticket 11626 indeed seems to have a bad example, but you can comment on the ticket.
That specific comment was "generated with the help of chatgpt" which probably explains why it's wrong. ChatGPT generating authoritative-sounding but wrong information is the new plague on our world :-(
Julien Pivotto
unread,
Mar 7, 2023, 4:38:13 PM3/7/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Brian Candler, Prometheus Users
On 02 Mar 02:28, Brian Candler wrote:
> On Thursday, 2 March 2023 at 06:32:07 UTC Kesavanand Chavali wrote:
>
> we did a wireshark capture and found that below works. This we figured out
> from other already working clients with other software; e.g. some clients
> working with same proxy.
> Could you please update the Prometheus documentation?
>
>
> Can you identify the part of the documentation which needs updating, and
> propose a change?
>
> There is
> https://prometheus.io/docs/prometheus/latest/configuration/configuration/ > but it is generic. It just shows
>
> # Specifies headers to send to proxies during CONNECT requests. [
> proxy_connect_header: [ <string>
> seems to have a bad example, but you can comment on the ticket.
>
> That specific comment was "*generated with the help of chatgpt*" which
> probably explains why it's wrong. ChatGPT generating
> authoritative-sounding but wrong information is the new plague on our world
ChatGPT only reviewed the grammar here (the feature is too young, it
does not know it). The mistake was purely my human mistake, I have fixed
the issue now :)