What is my website's static IP address? (so I can create an API Token?)

What is the name of the domain?

What is the error number?

NA

What is the issue you’re encountering

Cannot create KV Worker API Token

What steps have you taken to resolve the issue?

I tried to create a static IP address for the website (don’t know how). I went to account home, “dashboard”, clicked on my website and went to “DNS Records” There are 3 CNAMES, two TXTs and 4 MX records, 2 NS records - but no A records for a static IP address. Is this something I am supposed to bring from somewhere else? I think I need a static IP to create an API key - is this because I’m on the free plan that my website has no static ip address for an API key?

Am I supposet to one by one put in the cloudflare ip addresses?
listed here?
https://www.cloudflare.com/ips-v4/#

so that any website hosted by cloudflare could use my api key (instead of just my website?)

What are the steps to reproduce the issue?

go to https://dash.cloudflare.com/profile/api-tokens

permissions > Account > Workers KV > Edit

Screenshot of the error

That IP address would have to be for the device making the API Request with that token.

If you have a script that runs on your server that makes this API call, you can get your server’s IP address by logging into your server, and running curl -4 icanhazip.com from the command line.

I do not have a server or a full stack. I am just using static HTML pages. So also this token would be publicly available to anyone that would want to exploit it. I’m aware of. I might also create a web assembly application and hardcoat the coking inside to give me some kind of security later on. But I was hoping I could just do this in a server less kind of way.

Security by obscurity will not work. Anyone can just pull up their browser’s devtools and open the network tab to see the API requests that are being made.
The only way to do this securely would be by having some kind of backend that handles validation and makes the API reqs to Cloudflare.
You could for example make use of Cloudflare Workers, which has a generous free tier that allows 100k invocations/requests per day.

There are plenty of learning resources and examples for how to get started with Cloudflare Workers at Overview · Cloudflare Workers docs

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.