-
Notifications
You must be signed in to change notification settings - Fork 630
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
Access Application resource returns an authentication error after upgrade to provider version 2.10.0 #777
Comments
Thanks for the quick response! Sorry I didn't see that open PR |
I've just merged the PR and cut |
Closing as 2.10.1 should handle this; if not, ping me and we'll reopen |
I do not believe 2.10.1 fixed this problem. 2.9.0 worked fine. Using API Tokens set in env
On init
On Plan
Debug Log
|
2.10.1 fixed this for me. I'd double check that the token you're using includes Account-level |
That did it. Thanks |
Can I request this issue be re-opened? @wolfmd Before 2.10 we could edit Access Apps using a token scoped to a specific zone. Now, post 2.10 the "fix" is to relax security and scope the the token to a specific account. This is not ideal at all! One account can have many domains, some production, some development. Not every developer should be able to edit Access apps and policies across the entire account. Or am I missing something here? |
I think you're misunderstanding the change here @abeluck. Access resources have always been an account level permission; when you would have an account member with Access permissions, it was for the entire account irrespective of zone in use. If you check your existing account members, they have always had permission to make changes on any zone using the UI or API key (well before API tokens were even around). The screenshots above are only for API token use which are intended to be limited scoped use for interactions. The change that happened here is the route that is used for the management via the remote API. It used to live under |
Thanks for the clarification @jacobbednarz It was a misunderstanding indeed. The confusion came about as we tried to move from Users with CF console access to doling out specific API keys to devs for the tasks they needed. The API Token UI allows you to create a token with "Zone -> Access: Apps and Policies -> Edit" permissions, so the assumption was we could use a token with that permission to ensure bearers of that token could only affect policies against a specific zone. You've clarified for me that authorization for Access resources are controlled at the account level, and has always been the case. I've verified using Account level "Access: Apps and Policies -> Edit" permissions works with the latest cloudflare terraform provider. (I could grumble about the fact that the Token UI lets you create a Zone scoped Access: Apps and Policies Edit permission, and I could go on about the need for orgs to allow more finely-grained control to access policies at the zone level.. but that would be rather off topic for this repo, so I won't 😉 ) |
…teams-udp-config GATE-2293 added teams udp config
After upgrading to the latest Cloudflare provider version (2.10.0), I began getting authentication errors during plan specifically on the Access Application resource. 2.9.0 continues to work as expected. I use the environment variable CLOUDFLARE_ACCESS_TOKEN scoped specifically to Cloudflare Access-related settings
I don't see any changes to the terraform access configuration in this release however the version of cloudflare-go that is being used has changed to 0.13.1. This version of cloudflare-go does include a change to how access applications are referred which may be the source of this authentication discrepancy. cloudflare/cloudflare-go@v0.12.2...v0.13.1
I will try to update this issue with more information about possible root causes, but wanted to share it before I get too far into spelunking.
Terraform Version
Terraform v0.12.24
Affected Resource(s)
Debug Output
Expected Behavior
There should be no diff between access applications 2.9.0 and 2.10.0 and authentication should be the same with either version.
Actual Behavior
Authentication error on access applications
Steps to Reproduce
Create a Cloudflare API token with the following permissions
Account: - Access: Service Tokens:Edit, Access: Organizations, Identity Providers, and Groups:Edit, Access: Apps and Policies:Edit
Zone{ Access: Apps and Policies:Edit
Using the 2.9.0 version of the provider and the API token created in step 1, run a plan against a terraform configuration containing an access application and see that the token authenticates correctly and the resource is up to date
Change the version of the provider to 2.10.0 and run
terraform init
Run a
terraform plan
without any further changes and note that it fails with an authentication error for every access application but not other access-related resources in the tfstate.See Also
cloudflare/cloudflare-go@v0.12.2...v0.13.1 is possibly relevant
cc @jacobbednarz @dhaynespls
The text was updated successfully, but these errors were encountered: