Skip to content

Commit 726bcf6

Browse files
authored
Integration users shouldn't be admin (#92)
* Integration users shouldn't be admin Finds integration users that have assigned admin role - there are two types: - webapi with a flag: Web service access only | web_service_access_only - internal with a flag: Internal Integration User ! internal_integration_user * Update README.md Finds integration users that have assigned admin role - there are two types: - webapi with a flag: Web service access only | web_service_access_only - internal with a flag: Internal Integration User ! internal_integration_user
1 parent e8e3435 commit 726bcf6

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ Identify role assignments (sys_user_has_role) for users that do not exists
118118
### Check the incidents that are closed or canceled but still active
119119
This is a table check on the incidents table that verifies if there are closed or canceled incidents in the active state, which would be a sign that the close_states are not set correctly on the incident table. This check can be done on any table, especially there where the State model was changed from OOTB or for custom extended tables. The problem with this kind of records is that they can influence the reports on active records on the respective table.
120120

121+
### Integration users shouldn't be admin
122+
Finds integration users that have assigned admin role - there are two types:
123+
- webapi with a flag: Web service access only | web_service_access_only
124+
- internal with a flag: Internal Integration User ! internal_integration_user
125+
121126
## Category: Upgradability
122127

123128
### Call GlideRecord using new
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<unload unload_date="2023-10-13 23:15:24">
3+
<scan_table_check action="INSERT_OR_UPDATE">
4+
<active>true</active>
5+
<advanced>true</advanced>
6+
<category>manageability</category>
7+
<conditions table="sys_user">internal_integration_user=true^ORweb_service_access_only=true^EQ<item goto="false" or="false" field="internal_integration_user" endquery="false" value="true" operator="=" newquery="false"/>
8+
<item goto="false" or="true" field="web_service_access_only" endquery="false" value="true" operator="=" newquery="false"/>
9+
<item goto="false" or="false" field="" endquery="true" value="" operator="=" newquery="false"/>
10+
</conditions>
11+
<description/>
12+
<documentation_url/>
13+
<finding_type>scan_finding</finding_type>
14+
<name>Integration users shouldn't be admin</name>
15+
<priority>3</priority>
16+
<resolution_details/>
17+
<run_condition/>
18+
<score_max>100</score_max>
19+
<score_min>0</score_min>
20+
<score_scale>1</score_scale>
21+
<script><![CDATA[(function (finding, current) {
22+
23+
var userSysId = current.getUniqueValue();
24+
var userRoles = new GlideRecord('sys_user_has_role');
25+
userRoles.addQuery('role.name','admin');
26+
userRoles.addQuery('user', userSysId);
27+
userRoles.query();
28+
29+
if(userRoles.hasNext()){
30+
finding.increment();
31+
}
32+
33+
})(finding, current);]]></script>
34+
<short_description>Finds integration users that have assigned admin role</short_description>
35+
<sys_class_name>scan_table_check</sys_class_name>
36+
<sys_created_by>admin</sys_created_by>
37+
<sys_created_on>2023-10-13 22:59:50</sys_created_on>
38+
<sys_id>1d39dcb22ff9b110b0b62d5df699b6a2</sys_id>
39+
<sys_mod_count>5</sys_mod_count>
40+
<sys_name>Integration users shouldn't be admin</sys_name>
41+
<sys_package display_value="Global" source="global">global</sys_package>
42+
<sys_policy/>
43+
<sys_scope display_value="Global">global</sys_scope>
44+
<sys_update_name>scan_table_check_1d39dcb22ff9b110b0b62d5df699b6a2</sys_update_name>
45+
<sys_updated_by>admin</sys_updated_by>
46+
<sys_updated_on>2023-10-13 23:15:12</sys_updated_on>
47+
<table>sys_user</table>
48+
<use_manifest>false</use_manifest>
49+
</scan_table_check>
50+
</unload>

0 commit comments

Comments
 (0)