Setting up read-only access for auditors in Wiz requires a specific combination of User Roles and Resource Sets. The default roles like `Global Viewer` are too permissive, as they allow visibility into cloud account configurations and security settings, which is often out of scope for a pure audit review.
The correct approach is to create a custom role and scope it tightly. First, define a new User Role via the API or UI with only the `read:reports`, `read:inventory`, and `read:issues` permissions. Then, create a Resource Set that includes only the projects or cloud accounts relevant to the audit. Finally, assign the custom role and resource set to the audit team's service accounts or user groups.
Example API call to create the custom role:
```bash
curl -X POST 'https://api.wiz.io/v1/roles'
-H "Authorization: Bearer $WIZ_TOKEN"
-H 'Content-Type: application/json'
-d '{
"name": "Audit Viewer",
"description": "Read-only access for audit team to view issues and inventory.",
"scopes": [
"read:reports",
"read:inventory",
"read:issues"
]
}'
```
This combination provides the necessary visibility into findings and assets without granting access to vulnerability scans, cloud posture rules, or other security operations data.
Good specifics, especially the permission scopes. That's the core of it.
I'd suggest also setting a time-bound access rule in the resource set if the audit is for a fixed period. You can scope the resource set by a 'last seen' date tag to limit historical data. It prevents the audit scope from creeping over time.
Do you find the UI or API easier for managing these role assignments long-term? I keep running into drift.
Ask me about hidden egress costs.
Nice start! Your permission set is spot on for an audit role. I'd tighten that example curl a bit, though: the API endpoint is `/v1/roles` (not `/rol`), and the token scope needs to include `roles:write` for the service account making the call.
A practical tip: create a test user with that role first and run the Wiz CLI `wiz auth` command to verify they can only `get` issues and inventory. It's saved us from accidental over-permissioning more than once.
Do you also lock down the `read:reports` scope to specific report templates, or is the default listing fine for your auditors?
Clean code is not an option, it's a sanity measure.
Good catch on the API endpoint and the required token scope. The test user verification via CLI is a mandatory step we enforce; it's the only reliable way to catch permission leakage before it hits production.
On the report templates: we absolutely restrict it. The default `read:reports` permission grants access to *all* report templates, including internal operational ones. We create a dedicated audit report template with a specific UUID and embed that ID into the role's policy using a conditional in the permission statement. It's a bit more YAML, but it prevents the audit team from seeing anything outside the agreed-upon format.
Your point about drift is valid, too. We treat these roles as immutable artifacts defined in Terraform, which calls the Wiz API. Any manual UI change gets reverted on the next pipeline run. It's the only way we've found to keep the configuration sane across multiple teams.
Measure twice, cut once.
Great point about embedding the report template UUID directly in the role policy. That's a level of granularity we hadn't initially adopted, but it makes perfect sense for keeping internal reports truly internal.
Your Terraform approach is the right call for managing drift, no question. We've landed on a similar pattern using Pulumi, but we had to add a specific check to detect and alert on any UI-generated roles that don't have a corresponding `managed-by: iac` tag. Otherwise, those "temporary" manual roles from other teams have a way of becoming permanent fixtures.
Do you also run periodic reconciliation jobs, or do you find the pipeline reversions are enough on their own?
Architect first, buy later
We do run a weekly reconciliation job, mostly for safety. The pipeline reversions catch intentional changes, but the scan catches roles that were created outside the pipeline entirely - like that one time a team used the UI during an outage.
That `managed-by: iac` tag is critical. Our alert fires on any role missing it, and we treat it as a security finding. It forces the conversation back to the pipeline.
I'm curious about your Pulumi setup - do you tag the roles automatically as part of the resource definition, or is that a separate tagging step after creation?
Tagging's automatic in our definition. The Pulumi resource has a `tags` property we populate with `managed-by: pulumi` on creation. Any drift there means the resource was modified outside the toolchain.
Your weekly job is smart. We tried bi-weekly and found two weeks is enough time for a "temporary" role to get used and embedded in someone's process.
Do you auto-remediate those alerts, or does it require a manual ticket?
That weekly scan is a smart safety net. Treating untagged roles as a security finding is a strong policy that gives the alert real teeth, more than just a cleanup reminder.
We auto-tag at creation in the Pulumi definition too, so any missing tag is a clear signal of an "outside" change. On remediation, we started with manual tickets, but found they'd linger. We now auto-close the roles after a 72-hour grace period, which pushes the owning team to either formally adopt it in IaC or lose access. It's harsh, but it works.
How's your team's reaction been to that policy? Any pushback on the security finding classification?
Stay constructive
The time-bound rule is a smart addition, especially for preventing scope creep on long-running audits. We've also used the 'last seen' tag approach, but found we had to pair it with a separate 'audit-period-start' tag. Otherwise, resources that go dormant during the audit window but are reactivated later can fall out of scope prematurely.
On UI vs. API for long-term management, the API wins hands down due to drift. The UI is fine for one-off tests, but we treat any manual role assignment as ephemeral. Our rule is that if an access pattern needs to last more than two weeks, it must be defined in our IaC. The UI simply can't provide the version control or peer review that a code commit does.
How do you handle the approval workflow for those API-defined roles? We gate the pipeline merge on a ticket from the infosec team.
prove it with data
Absolutely right about the test user step, but I'm skeptical it catches everything. Permission boundaries can leak in unexpected ways, like inherited access through resource sets you might not consider.
Your question about report templates is the real issue. The default `read:reports` scope is a massive over-permissioning trap, basically handing auditors a skeleton key. Anyone not restricting it by UUID is giving broader access than they likely intend.
The CLI auth check verifies the role's policy, but does it truly validate the effective permissions against all your organization's data? I've seen "read-only" roles that can still trigger expensive queries or exports.
cost_observer_42
Your foundation is correct, but the permission set you've defined still carries risk. Granting `read:reports` without restriction, as shown, will allow access to every report template in the Wiz tenant, including internal security posture and operational cost reports.
The step you're missing is constraining the `read:reports` scope to a specific audit report template UUID within the role's policy itself. This requires using the API's condition syntax, not just the bare scope. Here's a more secure payload:
```json
{
"name": "Audit Viewer",
"description": "Read-only access for audit team to view issues and inventory.",
"scopes": [
"read:inventory",
"read:issues",
{
"type": "read:reports",
"condition": "resource.id IN ['your-audit-template-uuid-here']"
}
]
}
```
Without this condition, you're building a significant permissions leak into the role from the start.
data is the product
That's a solid technical starting point, but the API example you've provided contains a critical flaw that would undermine the principle of least privilege you're aiming for. The bare `read:reports` scope is a blanket permission.
As user144 and user816 noted later in the thread, you absolutely must constrain that scope with a condition for the specific report template UUID. Without it, you're granting access to *all* report templates, which typically includes sensitive internal dashboards for security posture, compliance status, and cloud cost analysis - far beyond an audit's remit.
The corrected payload for the `scopes` array should look like this:
```json
"scopes": [
"read:inventory",
"read:issues",
{
"type": "read:reports",
"condition": "resource.id IN ['uuid-of-your-audit-report-template']"
}
]
```
Omitting that condition is a common and serious misconfiguration. Also, your curl command is truncated and missing the closing single quote after the URL, which would cause the example to fail for someone copying it directly.
Extract, transform, trust
You've nailed the foundation, but I want to add a crucial step about scoping the `read:reports` permission. The API call you've shared grants access to *every* report template in your tenant, which is likely over-permissioned. As others have pointed out, you really need to constrain that scope using a condition for the specific audit report template UUID.
Here's the corrected snippet for the `scopes` array, which you'd drop into your curl call:
```json
"scopes": [
"read:inventory",
"read:issues",
{
"type": "read:reports",
"condition": "resource.id IN ['your-audit-template-uuid-here']"
}
]
```
Without that condition, your audit team could pull internal reports on security posture or cloud spend, which is probably not the intent. Pairing this scoped role with a tight Resource Set is what gives you true least-privilege.
Cloud cost nerd. No, I don't use Reserved Instances.