Authorization
After authentication verifies who the user is, authorization determines what they can access. Squid implements a multi-layered authorization model that provides fine-grained access control.
How Authorization Works
Squid Roles
Squid roles fall into two categories based on where they are evaluated.
† Database Views are not visible to non-sys_admin users. While ServiceNow technically allows granting read access through explicit ACLs on each view, this requires a separate ACL entry per view and does not scale. Details.API Access Roles (evaluated by Squid)
These roles control programmatic access from server-side integrations. Squid evaluates them at runtime.
| Role | Purpose | Grants |
|---|---|---|
x_a46gh_squidx.rest | API Gateway | Required for any API calls |
x_a46gh_squidx.defaultAccess | Predefined Configs | Access to all predefined configurations |
| (custom roles) | Specific Configs | Access to configurations with matching role |
The rest role alone does not grant access to any data. It only opens the door to the API—configuration access is controlled by defaultAccess or custom roles.
UI Access Roles (evaluated by ServiceNow)
These roles control human access to the Squid configuration interface. ServiceNow enforces them through standard ACLs. They have no effect on API access.
| Role | Purpose | Grants |
|---|---|---|
x_a46gh_squidx.admin | Config Authors | Create/edit custom configs, read all configs |
x_a46gh_squidx.read | Config Viewers | Read-only access to view configuration definitions |
The read role is useful for developers of peripheral systems who need to understand what fields are exposed, what filters apply, and what relations are available—without the ability to modify configurations.
Why defaultAccess Exists
Consider a service account squid_accounting that should only access a few specific configurations. Without defaultAccess:
- This account would have access to ALL configurations that have no role restrictions
- You would need to manually add role restrictions to every configuration
With defaultAccess:
- All predefined configurations require this role by default
- Simply don't assign
defaultAccessto accounts that need restricted access - Then selectively grant access to specific configurations
Configuration-Level Authorization
Each configuration can require specific roles for access. This is the second authorization layer after the rest role check.
A user must have at least one of the roles configured on a configuration to access it.
Configuration Role Settings
| Setting | Description |
|---|---|
| Roles | List of roles, any of which grants access |
| Empty Roles | Accessible to anyone with the rest role |
Predefined vs Custom Configurations
| Aspect | Predefined | Custom |
|---|---|---|
| Default Role | defaultAccess | defaultAccess (configurable) |
| Editable | No | Yes |
| Role Changeable | No (create copy) | Yes |
To modify role requirements on a predefined configuration, create a custom configuration with the same name. Your custom configuration takes precedence.
Referenced Configurations
When Squid resolves references, authorization works differently:
- Root Configuration - Full authorization checks (roles required)
- Referenced Configurations - Accessed implicitly, no separate role check
This means if a user can access cmdb_ci_server, they can see referenced entities (like core_company for manufacturer) even if they couldn't directly access core_company as a root configuration.
This behavior is intentional. References are part of the data defined in the root configuration. Requiring separate authorization for each reference would make the system overly complex and difficult to configure correctly.
Relations Restriction
Beyond configuration access, Squid provides control over which relations can be requested.
The Problem
A user with access to cmdb_ci_server could potentially request relations like ci_to_user_group that reveal information they shouldn't see—even if they lack access to the sys_user_group configuration directly.
The Solution
Each configuration has two security settings for relations:
| Setting | Description |
|---|---|
| Relations Restricted | When checked, only explicitly allowed relations can be requested |
| Allowed Relations | Comma-separated list of permitted relations |
Example
Configuration: cmdb_ci_server
- Relations Restricted: ✓ (checked)
- Allowed Relations:
ci_to_network_adapter, ci_to_ip_address
With this configuration:
- ✅
?relations=ci_to_network_adapter- Allowed - ✅
?relations=ci_to_ip_address- Allowed - ❌
?relations=ci_to_user_group- Blocked (not in allowed list)
When to Use Relations Restriction
Enable relations restriction when:
- Certain relations expose sensitive data
- You want explicit control over data exposure
- Different user groups need different relation access
Practical Examples
Example 1: Full Access Service Account
For a monitoring system that needs broad access:
User: squid_monitoring_full
Roles:
- x_a46gh_squidx.rest → API access
- x_a46gh_squidx.defaultAccess → All predefined configs
Example 2: Restricted Service Account
For an accounting system that only needs asset data:
User: squid_accounting_assets
Roles:
- x_a46gh_squidx.rest → API access
Configurations Modified:
- alm_asset: Add role "accounting_data_access"
- alm_consumable: Add role "accounting_data_access"
User Additional Roles:
- accounting_data_access
Example 3: Multiple Teams with Different Access
Team A (Infrastructure):
User: squid_team_a
Roles: rest, infra_data_access
Team B (Application):
User: squid_team_b
Roles: rest, app_data_access
Configurations:
- cmdb_ci_server: Roles = infra_data_access
- cmdb_ci_appl: Roles = app_data_access
- cmdb_ci (all CIs): Roles = infra_data_access, app_data_access
Notes
† Database Views Limitation
Users with the read role can view Squid configuration records but cannot access the underlying Database View definitions in ServiceNow. The view may not appear in form references or dropdowns—its existence is effectively hidden from non-admin users.
This occurs because ServiceNow requires explicit Read ACLs on each Database View; table-level ACLs do not inherit to views. While granting access is technically possible, it requires:
- A separate Read ACL for each Database View
- Read ACLs on all underlying tables joined in the view
- Manual maintenance as views are added or changed
There is no bulk ACL mechanism. For environments with many Database Views, this approach does not scale. In practice, Database View visibility remains limited to sys_admin users.
For official documentation, see ServiceNow KB0535471.
Related Topics
- Authentication - How users are authenticated
- Data Access Controls - What data is available
- Best Practices - Role configuration recommendations