Skip to content

Commit 553bba6

Browse files
authored
Merge branch 'master' into Check_Inactive_user_task
2 parents ddefd56 + 1099c05 commit 553bba6

5 files changed

+194
-4
lines changed

README.md

+19-4
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,25 @@ Open-Sourced community contributed and owned repository for Instance Scan Defini
1212

1313
## Category: Manageability
1414

15+
### Inactive user check: Approvals
16+
Check any approvals waiting in inactive users queue
17+
18+
### Inactive user check: Catalog task Assigned To
19+
Check any Catalog Tasks Assigned to Inactive user
20+
1521
### Check any assets assigned to inactive user
1622
Check if any asset is assigned to inactive users.
1723

1824
### Check if any incidents are assigned to inactive users.
1925
Check if any incidents are assigned to inactive user.
2026

21-
### Inactive User Check : Catalog Item
27+
### Inactive User Check: Catalog Item
2228
We should ensure that inactive users are removed from being assigned as Catalog item owners.
2329

24-
###Avoid gs.log()Statement
30+
### Check problem ticket assigned to inactive user
31+
Make sure that a problem ticket is not assigned to an inactive user.
32+
33+
### Avoid gs.log() Statement
2534
Use Logging Levels: Instead of gs.log(), consider using more appropriate logging levels, such as:
2635
gs.info() for informative messages.
2736
gs.warn() for warnings that don’t break functionality but may need attention.
@@ -173,6 +182,11 @@ Tickets from tables such as Incident, Change Request, Problem, and other task-re
173182
### Check Inactive Business Rules over 90 days
174183
Inactive Business Rules which are not updated for more than 90 days and not created by glide.maint and not updated by admin should be identified to remove unnecessary overhead.
175184

185+
### Update set In Progress/Completed previously Ignored
186+
Usually, developers mark an updatesets as Ignore if the work done is not required to be promoted or incorrect or irrelavent or due to any other reasons.
187+
However, at times, some of the developers may use the ignored set for any active work instead of creating new one by updating the state from Ignore to In-Progress. It is not a good practice to do the same. It may case the deployment issues and also makes the troubleshooting process cumbersome.
188+
It may also impact the deployment and cause issues in case if the state is changed to In-Progress/Completed for the potential ignored sets.
189+
176190
## Category: Upgradability
177191

178192
### Call GlideRecord using new
@@ -277,7 +291,8 @@ Select the check box to ignore flushing some server-side caches, thus flushing o
277291
Avoid using gs.sleep() in any script because it does not release session and will cause delays, and add logs to the script whenever gs.sleep() has to be used.
278292

279293
## Category: Security
280-
##Check Mandatory fields on incident
294+
295+
### Check Mandatory fields on incident
281296
This check is used to find mandatory fields on incident
282297

283298
### Avoid using setBasicAuth for REST messages
@@ -346,7 +361,7 @@ Scripts in ACLs ARE executed regardless of whether or not the Advanced checked b
346361
### Added a Number Prefix which already exists
347362
Creating new number records does not require uniqueness. Though having duplicate number records causes some ServiceNow core functionality not to behave as expected. For example, the search might return a record from another table the number prefix is also used on.
348363

349-
## List Inactive users from active group
364+
### List Inactive users from active group
350365
List inactive users that still belongs to activate groups
351366

352367
### HTTP connection records not excluded on clones from Prod
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?><record_update table="scan_table_check">
2+
<scan_table_check action="INSERT_OR_UPDATE">
3+
<active>true</active>
4+
<advanced>true</advanced>
5+
<category>manageability</category>
6+
<conditions table="sys_update_set">state=in progress^ORstate=complete^EQ<item display_value="In progress" endquery="false" field="state" goto="false" newquery="false" operator="=" or="false" value="in progress"/>
7+
<item display_value="Complete" endquery="false" field="state" goto="false" newquery="false" operator="=" or="true" value="complete"/>
8+
<item endquery="true" field="" goto="false" newquery="false" operator="=" or="false" value=""/>
9+
</conditions>
10+
<description>Usually, developers mark an updatesets as Ignore if the work done is not required to be promoted or incorrect or irrelavent or due to any other reasons.
11+
However, at times, some of the developers may use the ignored set for any active work instead of creating new one by updating the state from Ignore to In-Progress. It is not a good practice to do the same. It may case the deployment issues and also makes the troubleshooting process cumbersome.
12+
It may also impact the deployment and cause issues in case if the state is changed to In-Progress/Completed for the potential ignored sets.</description>
13+
<documentation_url/>
14+
<finding_type>scan_finding</finding_type>
15+
<name>Update set In Progress/Completed previously Ignored</name>
16+
<priority>3</priority>
17+
<resolution_details>It is always good and recommended to create a new updateset instead of using already Ignored updatesets by changing the state from Ignore to In-Progress/Completed.</resolution_details>
18+
<run_condition/>
19+
<score_max>100</score_max>
20+
<score_min>0</score_min>
21+
<score_scale>1</score_scale>
22+
<script><![CDATA[(function (finding, current) {
23+
24+
var usSysId = current.getUniqueValue();
25+
var audit = new GlideRecord('sys_audit');
26+
audit.addEncodedQuery('fieldname=state^tablename=sys_update_set^oldvalue=ignore^newvalue=in progress^ORnewvalue=complete');
27+
audit.addQuery('documentkey', usSysId);
28+
audit.setLimit(1);
29+
audit.query();
30+
31+
if(audit.hasNext()){
32+
finding.increment();
33+
}
34+
35+
})(finding, current);]]></script>
36+
<short_description>Already Ignored Update Set shouldn't be set back to In Pogress/Completed.</short_description>
37+
<sys_class_name>scan_table_check</sys_class_name>
38+
<sys_created_by>admin</sys_created_by>
39+
<sys_created_on>2024-10-30 19:28:34</sys_created_on>
40+
<sys_id>01c1c08ec3a19610afa6fc84e401310d</sys_id>
41+
<sys_mod_count>0</sys_mod_count>
42+
<sys_name>Update set In Progress/Completed previously Ignored</sys_name>
43+
<sys_package display_value="Example Instance Checks" source="x_appe_exa_checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_package>
44+
<sys_policy/>
45+
<sys_scope display_value="Example Instance Checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_scope>
46+
<sys_update_name>scan_table_check_01c1c08ec3a19610afa6fc84e401310d</sys_update_name>
47+
<sys_updated_by>admin</sys_updated_by>
48+
<sys_updated_on>2024-10-30 19:28:34</sys_updated_on>
49+
<table>sys_update_set</table>
50+
<use_manifest>false</use_manifest>
51+
</scan_table_check>
52+
</record_update>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?><record_update table="scan_table_check">
2+
<scan_table_check action="INSERT_OR_UPDATE">
3+
<active>true</active>
4+
<advanced>false</advanced>
5+
<category>manageability</category>
6+
<conditions table="sc_task">assigned_to.active=false^EQ<item endquery="false" field="assigned_to.active" goto="false" newquery="false" operator="=" or="false" value="false"/>
7+
<item endquery="true" field="" goto="false" newquery="false" operator="=" or="false" value=""/>
8+
</conditions>
9+
<description>Check any Catalog Tasks Assigned to Inactive user</description>
10+
<documentation_url/>
11+
<finding_type>scan_finding</finding_type>
12+
<name>Inactive user : Cat task Assignment</name>
13+
<priority>2</priority>
14+
<resolution_details/>
15+
<run_condition/>
16+
<score_max>100</score_max>
17+
<score_min>0</score_min>
18+
<score_scale>1</score_scale>
19+
<script><![CDATA[(function (engine) {
20+
21+
// Add your code here
22+
23+
})(engine);]]></script>
24+
<short_description>Check any Catalog Tasks Assigned to Inactive user</short_description>
25+
<sys_class_name>scan_table_check</sys_class_name>
26+
<sys_created_by>admin</sys_created_by>
27+
<sys_created_on>2024-10-31 14:50:50</sys_created_on>
28+
<sys_id>589b8c9283251210a765fecfeeaad37a</sys_id>
29+
<sys_mod_count>0</sys_mod_count>
30+
<sys_name>Inactive user : Cat task Assignment</sys_name>
31+
<sys_package display_value="Example Instance Checks" source="x_appe_exa_checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_package>
32+
<sys_policy/>
33+
<sys_scope display_value="Example Instance Checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_scope>
34+
<sys_update_name>scan_table_check_589b8c9283251210a765fecfeeaad37a</sys_update_name>
35+
<sys_updated_by>admin</sys_updated_by>
36+
<sys_updated_on>2024-10-31 14:50:50</sys_updated_on>
37+
<table>sc_task</table>
38+
<use_manifest>false</use_manifest>
39+
</scan_table_check>
40+
<sys_translated_text action="delete_multiple" query="documentkey=589b8c9283251210a765fecfeeaad37a"/>
41+
</record_update>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?><record_update table="scan_table_check">
2+
<scan_table_check action="INSERT_OR_UPDATE">
3+
<active>true</active>
4+
<advanced>false</advanced>
5+
<category>manageability</category>
6+
<conditions table="problem">assigned_to.active=false^EQ<item endquery="false" field="assigned_to.active" goto="false" newquery="false" operator="=" or="false" value="false"/>
7+
<item endquery="true" field="" goto="false" newquery="false" operator="=" or="false" value=""/>
8+
</conditions>
9+
<description>Make sure that a problem ticket is not assigned to an inactive user</description>
10+
<documentation_url/>
11+
<finding_type>scan_finding</finding_type>
12+
<name>Check problem assigned to inactive user</name>
13+
<priority>2</priority>
14+
<resolution_details/>
15+
<run_condition/>
16+
<score_max>100</score_max>
17+
<score_min>0</score_min>
18+
<score_scale>1</score_scale>
19+
<script><![CDATA[(function (engine) {
20+
21+
// Add your code here
22+
23+
})(engine);]]></script>
24+
<short_description>Check problem assigned to inactive user</short_description>
25+
<sys_class_name>scan_table_check</sys_class_name>
26+
<sys_created_by>admin</sys_created_by>
27+
<sys_created_on>2024-11-01 01:46:12</sys_created_on>
28+
<sys_id>7741e65ac3291210766bb3edd40131e6</sys_id>
29+
<sys_mod_count>1</sys_mod_count>
30+
<sys_name>Check problem assigned to inactive user</sys_name>
31+
<sys_package display_value="Example Instance Checks" source="x_appe_exa_checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_package>
32+
<sys_policy/>
33+
<sys_scope display_value="Example Instance Checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_scope>
34+
<sys_update_name>scan_table_check_7741e65ac3291210766bb3edd40131e6</sys_update_name>
35+
<sys_updated_by>admin</sys_updated_by>
36+
<sys_updated_on>2024-11-01 01:48:09</sys_updated_on>
37+
<table>problem</table>
38+
<use_manifest>false</use_manifest>
39+
</scan_table_check>
40+
<sys_translated_text action="delete_multiple" query="documentkey=7741e65ac3291210766bb3edd40131e6"/>
41+
</record_update>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?><record_update table="scan_table_check">
2+
<scan_table_check action="INSERT_OR_UPDATE">
3+
<active>true</active>
4+
<advanced>false</advanced>
5+
<category>manageability</category>
6+
<conditions table="sysapproval_approver">approver.active=false^EQ<item endquery="false" field="approver.active" goto="false" newquery="false" operator="=" or="false" value="false"/>
7+
<item endquery="true" field="" goto="false" newquery="false" operator="=" or="false" value=""/>
8+
</conditions>
9+
<description>Check any approvals waitin on inactive users queue</description>
10+
<documentation_url/>
11+
<finding_type>scan_finding</finding_type>
12+
<name>Inactive user check : Approval</name>
13+
<priority>1</priority>
14+
<resolution_details/>
15+
<run_condition/>
16+
<score_max>100</score_max>
17+
<score_min>0</score_min>
18+
<score_scale>1</score_scale>
19+
<script><![CDATA[(function (engine) {
20+
21+
// Add your code here
22+
23+
})(engine);]]></script>
24+
<short_description>Check any approvals waitin on inactive users queue</short_description>
25+
<sys_class_name>scan_table_check</sys_class_name>
26+
<sys_created_by>admin</sys_created_by>
27+
<sys_created_on>2024-10-31 15:26:29</sys_created_on>
28+
<sys_id>8de1905683e512103d6c98c6feaad3b9</sys_id>
29+
<sys_mod_count>0</sys_mod_count>
30+
<sys_name>Inactive user check : Approval</sys_name>
31+
<sys_package display_value="Example Instance Checks" source="x_appe_exa_checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_package>
32+
<sys_policy/>
33+
<sys_scope display_value="Example Instance Checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_scope>
34+
<sys_update_name>scan_table_check_8de1905683e512103d6c98c6feaad3b9</sys_update_name>
35+
<sys_updated_by>admin</sys_updated_by>
36+
<sys_updated_on>2024-10-31 15:26:29</sys_updated_on>
37+
<table>sysapproval_approver</table>
38+
<use_manifest>false</use_manifest>
39+
</scan_table_check>
40+
<sys_translated_text action="delete_multiple" query="documentkey=8de1905683e512103d6c98c6feaad3b9"/>
41+
</record_update>

0 commit comments

Comments
 (0)