<h2>Deny-Unless ACL</h2><br/><div style="overflow-x:auto"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta content="text/html; charset=UTF-8" /><meta name="copyright" content="(C) Copyright 2024" /><meta name="DC.rights.owner" content="(C) Copyright 2024" /><meta name="generator" content="DITA-OT" /><meta name="DC.type" content="task" /><meta name="DC.title" content="Configuring an ACL rule" /><meta name="abstract" content="Configure a custom ACL rule to secure access to new objects or to change the default security behavior." /><meta name="description" content="Configure a custom ACL rule to secure access to new objects or to change the default security behavior." /><meta name="DC.subject" content="ACLs, creating ACL rules, embedded lists, securing records" /><meta name="keywords" content="ACLs, creating ACL rules, embedded lists, securing records" /><meta name="DC.creator" content="Claire Rawlins" /><meta name="DC.creator" content="Phil Salzman" /><meta name="DC.creator" content="ServiceNow" /><meta name="DC.date.created" content="2023-08-03" /><meta name="DC.date.modified" content="2024-08-01" /><meta name="DC.format" content="XHTML" /><meta name="DC.identifier" content="t_CreateAnACLRule" /><link rel="stylesheet" type="text/css" href="../../../CSS/commonltr.css" /><title>Configuring an ACL rule</title></head><body> <div class="nested0" id="t_CreateAnACLRule"> <h1 class="title topictitle1" id="ariaid-title1">Configuring an ACL rule</h1> <div class="body taskbody"><p class="shortdesc">Configure a custom ACL rule to secure access to new objects or to change the default security behavior.</p> <div class="section prereq p"> <p class="p">Role required: security_admin</p> </div> <div class="section context"> <p class="p">To create ACL rules, you must elevate privileges to the security_admin role.</p> <p class="p">For tables that are in a different scope from the ACL rule record, the types of rules are limited. For Scope Master tables to derive scope and execute scoped ACLS, set the <span class="keyword parmname">glide.enforce_security_scope.<scope_name></span> property to <span class="ph uicontrol">true</span>. This ensures ACLs in the global scope do not match when there are scope specific ACLs created on the relevant table. Examples are when securing data within shared application tables in the Global scope, such as sys_attachment or sys_question_answer tables.</p> </div> <ol class="ol steps"><li class="li step stepexpand"> <span class="ph cmd"><a class="xref" href="../../security/concept/c_ElevatedPrivilege.html" title="Elevated privilege roles require you to manually accept the responsibility of using the role before you can access the features of the role.">Elevated privilege roles</a> to the security_admin role.</span> </li><li class="li step stepexpand"> <span class="ph cmd">Navigate to <span class="ph menucascade"><span class="ph uicontrol">System Security</span> > <span class="ph uicontrol">Access Control (ACL)</span></span>.</span> </li><li class="li step stepexpand"> <div class="note tip"><span class="tiptitle">Tip:</span> When creating a new ACL it is helpful to review the <a class="xref" href="t_CreateAnACLRule.html#acl-denial-behavior" title="Learn details about Deny-Unless ACLs.">Deny-Unless ACL</a>.</div> <span class="ph cmd">Click <span class="ph uicontrol">New</span>.</span> </li><li class="li step stepexpand"> <span class="ph cmd">Complete the form.</span> <div class="itemgroup info"> <div class="p"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="t_CreateAnACLRule__table_uyy_41b_vx" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 1. </span>Access control fields</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d135479e145">Field</th><th class="entry cellrowborder" style="vertical-align:top;" id="d135479e148">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e145 ">Type</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e148 ">Select what kind of object this ACL rule secures. The type of object determines how the object is named and what operations are available. This field becomes read only after the ACL rule is created. If you want to change the type, you must delete the ACL and create a new one with the correct type.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e145 ">Operation</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e148 ">Select the operation this ACL rule secures. Each object type has its own list of operations. An ACL rule can only secure one operation. To secure multiple operations, create a separate ACL rule for each.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e145 ">Admin overrides</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e148 "><p class="p">Select this check box to have users with the admin role automatically pass the permissions check for this ACL rule. Admin users pass regardless of what script or role restrictions apply. However, the <span class="ph uicontrol">nobody</span> role, which only <span class="ph">ServiceNow</span> personnel can assign, takes precedence over the admin override option. If an ACL is assigned the <span class="ph uicontrol">nobody</span> role, admin users cannot access the resource even when <span class="ph uicontrol">Admin overrides</span> is selected. See <a class="xref" href="../administer/roles/reference/r_BaseSystemRoles.dita/r_BaseSystemRoles.html" target="_blank" rel="noopener noreferrer">Base system roles</a>.</p> <p class="p">Clear this check box if administrators must meet the permissions defined in this ACL rule to gain access to the secured object. Since administrators always pass role checks (see the description of the <span class="ph uicontrol">Requires role</span> field), use the condition builder or <span class="ph uicontrol">Script</span> field to create a permissions check that administrators must pass.</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e145 ">Active</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e148 ">Select this check box to enforce this ACL rule.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e145 ">Advanced</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e148 ">Select this check box to display the <span class="ph uicontrol">Script</span> field. <div class="note important"><span class="importanttitle">Important:</span> If there is script in the <span class="ph uicontrol">Script</span> field. This script executes even if the field is not displayed on the form.</div> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e145 ">Name</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e148 ">Enter the name of the object being secured, either the record name or the table and field names. The more specific the name, the more specific the ACL rule. You can use the wildcard character asterisk (*) in place of a record, table, or field name to select all objects that match a record type, all tables, or all fields. You cannot combine a wildcard character and a text search. For example, inc* is not a valid ACL rule name, but incident.* and *.number are valid ACL rule names.<div class="p"><div class="note"><span class="notetitle">Note:</span> Click the blue triangle to manually enter the record name or the table and field names of the object being secured. Use this option to secure an object that does not appear in the dropdown.</div> </div> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e145 ">Description</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e148 ">Enter a description of the object or permissions this ACL rule secures.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e145 ">Requires role</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e148 ">Use this list to specify the roles a user must have to access the object. If you list multiple roles, a user with any one of the listed roles can access the object. The <span class="keyword option">Requires role</span> list appears as a related list.<div class="note"><span class="notetitle">Note:</span> Users with the admin role always pass this permissions check because the admin role automatically grants users all other roles.</div> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e145 ">Condition</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e148 ">Use this <a class="xref" href="../use/common-ui-elements/concept/c_ConditionBuilder.dita/c_ConditionBuilder.html" target="_blank" rel="noopener noreferrer">condition builder</a> to select the fields and values that must be true for users to access the object.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e145 ">Script</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e148 ">Enter a custom script describing the permissions required to access the object. The script can use the values of the <span class="keyword option">current</span> and <span class="keyword option">previous</span> <a class="xref" href="script/business-rules/concept/c_BusinessRules.html#c_UsingPredefinedGlobalVariables" target="_blank" rel="noopener noreferrer">Global variables in business rules</a> as well as system properties. The script must generate a true or false response in one of two ways:<ul class="ul" id="t_CreateAnACLRule__ul_vyy_41b_vx"><li class="li">return an <span class="keyword option">answer</span> variable set to a value of true or false</li><li class="li">evaluate to true or false</li></ul> <p class="p">In either case, users only gain access to the object when the script evaluates to true and the user meets any conditions the ACL rule has. Both the conditions and the script must evaluate to true for a user to access the object.</p> <div class="note"><span class="notetitle">Note:</span> If the evaluated item is in a related list, <span class="ph uicontrol">current</span> points to the item the related list is on, not to the current item the ACL is for. However, If the item you are evaluating the ACL for is not in a related list, <span class="ph uicontrol">current</span> points to the actual item.</div> </td></tr></tbody></table> </div> </div> </div> </li><li class="li step stepexpand"> <span class="ph cmd">Right-click the form header and select <span class="ph uicontrol">Save</span>.</span> </li></ol> </div> <div class="topic task nested1" id="t_SecuringRecordsInAnEmbeddedList"> <h2 class="title topictitle2" id="ariaid-title2">Secure records in an embedded list</h2> <div class="body taskbody"><p class="shortdesc">To apply security to the records in embedded lists, limit editing and deleting records in embedded lists to specific roles.</p> <div class="section prereq p"> Role required: security_admin</div> <ol class="ol steps"><li class="li step stepexpand"> <span class="ph cmd">Navigate to <span class="ph menucascade"><span class="ph uicontrol">All</span> > <span class="ph uicontrol">System Security</span> > <span class="ph uicontrol">Access Control (ACL)</span></span>.</span> </li><li class="li step stepexpand"> <span class="ph cmd">Open the <span class="ph uicontrol">Write</span> or <span class="ph uicontrol">Delete</span> record for the appropriate table.</span> </li><li class="li step stepexpand"> <span class="ph cmd">In the Requires Role section of the form, add the roles that have write or delete permission for that table.</span> </li><li class="li step stepexpand"> <span class="ph cmd">Save the changes.</span> <div class="itemgroup stepresult">When records from the associated table appear in an embedded list, the edit and delete options are available only to users with the specified roles.</div> </li></ol> </div> </div> <div class="topic concept nested1" id="acl-denial-behavior"> <h2 class="title topictitle2" id="ariaid-title3">Deny-Unless ACL</h2> <div class="body conbody"><p class="shortdesc">Learn details about Deny-Unless ACLs.</p> <div class="section" id="acl-denial-behavior__section_qnd_snl_zbc"> <p class="p">Deny-Unless ACLs are evaluated with a "deny-unless" approach. The ACL defines the users that will NOT be denied. Said another way, the user will be denied access <span class="ph uicontrol">unless</span> the role, condition, and script requirements are met.</p> <div class="note important"><span class="importanttitle">Important:</span> Deny-Unless ACLs will take priority against Allow-If ACLs in ACL Evaluation as it will be evaluated first.</div> <div class="p">A Deny-Unless ACL produces 2 outcomes <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="acl-denial-behavior__table_jnn_5pl_zbc" class="table" frame="border" border="1" rules="all"><colgroup><col style="width:50%" /><col style="width:50%" /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d135479e505">Evaluation outcome</th><th class="entry cellrowborder" style="vertical-align:top;" id="d135479e508">Result</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e505 ">Pass</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e508 ">The defined roles, data conditions, security attributes, and script requirements are met. The ACL proceeds to further evaluation <div class="note important"><span class="importanttitle">Important:</span> Allow-If ACLs must still grant access for the subject to be able to access the resource.</div> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e505 ">Fail</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d135479e508 ">The Deny-Unless ACL is marked as failing and access will be denied.</td></tr></tbody></table> </div> </div> <div class="p">The following is an explained example of a Deny-Unless ACL:<ul class="ul" id="acl-denial-behavior__ul_t3l_tql_zbc"><li class="li">ACL has roles <samp class="ph systemoutput">sn_hr_core.manager</samp> and <samp class="ph systemoutput">itil</samp></li><li class="li">Condition has active = <samp class="ph systemoutput">true</samp></li><li class="li">script has answer = <samp class="ph systemoutput">gs.isLoggedIn();</samp></li></ul> The user is denied access unless all 3 requirements for this ACL are satisfied. In order for this Deny-Unless ACL to pass, a users needs either the <samp class="ph systemoutput">sn_hr_core.manager</samp> or <samp class="ph systemoutput">itil</samp> roles, be accessing a record that has active field = <samp class="ph systemoutput">true</samp>, and be logged in. The Deny-Unless ACL will fail if any of the three requirements isn't met.</div> </div> </div> </div> </div> </body></html></div>