File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Server-Side Components/Background Scripts/ACL Audit Utility Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+
2+ // Description: Audits ACLs for potential misconfigurations and logs findings.
3+
4+ var grACL = new GlideRecord ( 'sys_security_acl' ) ;
5+ grACL . query ( ) ;
6+
7+ while ( grACL . next ( ) ) {
8+ var aclName = grACL . name . toString ( ) ;
9+ var type = grACL . type . toString ( ) ;
10+ var operation = grACL . operation . toString ( ) ;
11+ var active = grACL . active ;
12+
13+ // Check for ACLs that are inactive
14+ if ( ! active ) {
15+ gs . info ( '[ACL Audit] Inactive ACL found: ' + aclName + ' | Operation: ' + operation ) ;
16+ continue ;
17+ }
18+
19+ // Check for ACLs with no condition or script
20+ var hasCondition = grACL . condition && grACL . condition . toString ( ) . trim ( ) !== '' ;
21+ var hasScript = grACL . script && grACL . script . toString ( ) . trim ( ) !== '' ;
22+
23+ if ( ! hasCondition && ! hasScript ) {
24+ gs . warning ( '[ACL Audit] ACL with no condition or script: ' + aclName + ' | Operation: ' + operation ) ;
25+ }
26+
27+ // Check for ACLs granting 'read' access to 'public'
28+ if ( operation === 'read' && grACL . roles . toString ( ) === '' ) {
29+ gs . warning ( '[ACL Audit] Public read access detected: ' + aclName ) ;
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments