Trying to figure out how to set policies in Zero Trust Tunnels

I want to make three sets of rules/policies, that i can choose, depending on what part of my network it is - Level 1, Personal - Only Germany can access that Page, and only with a Password - Level 2, Restricted - German- and English-Speaking Countries allowed, Password Protected - Level 3, Public - German- and English-Speaking Countries allowed, no Password I dont wanna use One Time Password. Just a regular Password or even Credentials
27 Replies
Chaika
Chaika4mo ago
ZT doesn't support that passwords or credentials directly. Can only use OTP or login/auth providers like google/Github/etc Also it has no idea what languages countries speak/can't filter on that Every successful login is a user as well (and you only have 50). For 3, you probably would want to use normal WAF and not Zero Trust
Luna
Luna4mo ago
So i cant just setup credentials?
Chaika
Chaika4mo ago
Correct sorry my first message was vague, edited
Luna
Luna4mo ago
is there something simpler so that i can login without requiring google and stuff?
Chaika
Chaika4mo ago
Potentially with a Worker or something else but nothing in Zero Trust itself
Luna
Luna4mo ago
Can oyu help me figure this out? I got a few services online that i want only accessible to me, but some like game servers, accessible to all except chinese, and the likes, to avoid data crawlers
Chaika
Chaika4mo ago
You can do Github or Google logins for free (https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/google/), https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/github/, it just takes a bit of setup, but is super secure and you can use 2fa/etc if enabled in them
Luna
Luna4mo ago
can i decide that only my google works?
Chaika
Chaika4mo ago
Personally I use Google/Github login for anything secure. Don't need to worry about country restrictions/wouldn't help in that case. It gets more complex if you want to share access easily with other people since you can't just do a password or anything Yep! Just your email/google acct
Luna
Luna4mo ago
okay, so lets start with google. What do i fill out in these things?
Chaika
Chaika4mo ago
That's what makes it so nice. Zero Trust handles it all for you, and the only requests that get to your origin are authorized through your policy
Luna
Luna4mo ago
email claim and stuff
Chaika
Chaika4mo ago
If you want to use Google follow this guide here: https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/google/ and with a policy you would just do "Emails" selector
Cloudflare Docs
Google · Cloudflare Zero Trust docs
You can integrate Google authentication with Cloudflare Access without a Google Workspace account. The integration allows any user with a Google …
Luna
Luna4mo ago
thing is, in access policy for my tunnels, i had options like include, exclude and stuff and it talked about pwd authorization applications
Chaika
Chaika4mo ago
Anything you see in an access policy is just forcing specific things on the Identity Providers, like Google, that you configure
Chaika
Chaika4mo ago
No description
Luna
Luna4mo ago
oooh.
Luna
Luna4mo ago
so this is valid?
No description
Luna
Luna4mo ago
what does this do?
Chaika
Chaika4mo ago
It would require the identity provider to pass that check
When users authenticate with their identity provider, the identity provider then shares their username with Cloudflare Access. Cloudflare Access then writes that value into the JSON Web Token (JWT) generated for the user. Certain identity providers can also share the multifactor authentication (MFA) method presented by the user to login. Cloudflare Access can add these values into the JWT and force. For example, if the user authenticated with their password and a physical hard key, the identity provider can send a confirmation to Cloudflare Access. Cloudflare Access then stores that method into the same JWT issued to the user. Cloudflare Access follows RFC 8176 , Authentication Method Reference Values, to define authentication methods.
https://developers.cloudflare.com/cloudflare-one/policies/access/mfa-requirements/#adding-authentication-methods-into-the-jwt
Luna
Luna4mo ago
im so confused. im so new to all of this, and i barely figured out how to do tunnels why doesnt cloudflare just have a login screen? like a username and passwor thing?
Chaika
Chaika4mo ago
It's just not how ZT works. The point is to connect and secure things, not be its own auth provider It is a bit confusing. Basically all those selectors do is act on the responses from Identity Provider. So with that auth method set under require, they would only pass the policy if the Identity Provider (like Google) responds saying they auth'd with a password. This could be used to force security keys and such
Luna
Luna4mo ago
how do i get the app id?
Chaika
Chaika4mo ago
In your case it's just overcomplicating things. You could replace that policy with just Include: Emails youremail, and that would work with OTP and Google (and under Auth of the application you can configure the specific ones supported) iirc it's the oauth client id you get when you follow the guide if you follow it, shouldn't have any issues
Luna
Luna4mo ago
Can i give you my anydesk, and you help me set this up?
Chaika
Chaika4mo ago
No, if you want an easier way you could just continue to use the OTP/one time tokens emailed
Luna
Luna4mo ago
So i create an oauth client id? Headaches, i hate it cloudflare is complicated. All i want is a simple login screen. I cant even figure google out i decided to just go with otp its 2fa in a sense, so eh.