louislam / uptime-kuma

A fancy self-hosted monitoring tool
https://uptime.kuma.pet
MIT License
55.39k stars 4.98k forks source link

Cloudflare service token authentication #4951

Open jonathon2nd opened 1 month ago

jonathon2nd commented 1 month ago

⚠️ Please verify that this question has NOT been raised before.

🛡️ Security Policy

📝 Describe your problem

I would like to use service token to connect to websites protected by cloudflare zero trust https://developers.cloudflare.com/cloudflare-one/identity/service-tokens/ I can get it working with header

{
    "CF-Access-Client-Id": "",
    "CF-Access-Client-Secret": ""
}

It would be nice to not have CF-Access-Client-Secret in plain text.

Wondering if there is a way to do this already that I am missing.

I thought something like this might work, but not sure what to do about the URL image

📝 Error Message(s) or Log

No response

🐻 Uptime-Kuma Version

Helm uptime-kuma:2.19.1

💻 Operating System and Arch

k8s

🌐 Browser

n/a

🖥️ Deployment Environment

Helm deployment: uptime-kuma:2.19.1

CommanderStorm commented 1 month ago

would be nice to not have CF-Access-Client-Secret in plain text.

The headers field you noted is plain text.. am I missing something?

jonathon2nd commented 1 month ago

I was wondering if there was some way to have CF-Access-Client-Secret protected as a secret, and not have it in plain text.

evelynmatson commented 1 week ago

Can you share the whole config you used to get this working? i put in my access token to the headers field with the syntax you suggested, but it's still not working (always showing "up" even if the service is down, beause it's hitting the login page i believe)

jonathon2nd commented 1 week ago

Added the following to the headers section

{
    "CF-Access-Client-Id": "eee",
    "CF-Access-Client-Secret": "eee"
}

which sucks cause as I have stated, CF-Access-Client-Secret needs to be protected, and not stored in plain text here.

image