Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check any assets assigned to any inactive user #155

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Open-Sourced community contributed and owned repository for Instance Scan Defini

## Category: Manageability

### Check any Assets Assigned to any Inactive users
This Check helps to identify and manage assets assigned to inactive users, ensuring that CMDB remains accurate and up to date.

### Avoid using javascript "document" object in Portal
Always avoid using native js "document" object for DOM manipulation in service portal. Instead we should use AngularJS equivalent capabilities to achieve the same.

Expand Down
2 changes: 1 addition & 1 deletion ca8467c41b9abc10ce0f62c3b24bcbaa/checksum.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
vdzK57T2bhYH4R3tr5_N6r8DKdLmhtc5_AMSqsrGL2lDDQtzZxnmirx38up8Jm2-CI3CDMpa7Udq0cV06a0WfIeCBFsws8y-joYHTxiD-lAbbpy7LKyBy-szR_kO4mFszdz7Kikp9bbMUwWTIPbtRQzbapfu6HH7iEFepuUdA9SOlwPJAAaBRxCUQeo8Hg9Hxb7ubHmvx87l7IwoGN2ezq07g2EMDh3wkpLdXVXdMoPd-Hf9g8X-V4ENLaGI-5wQnvXgX_w_shWoupz_WdTA3ir94Eh3Nu2jiM29wNQDNrlsTvslryId4vq8M8ME13Vi7UpuHw6Ec-ooT6OXdBMkvgsVAtCARdy79UbAgT_p9E3KL3rbJPozp-7I8wOf3n1WETwJkDsAUMzBp3LWF8_BqfxFeYFCEQV3l3xC8ic2ZQn_98i9fpgURFU9Ec2BEGbbMfpm7KehrFl0bNOVDTDEWIETdt80lvfR1i0-8Yk1vHWvLdB94dHoPw1a77oWht1HxEMkNzE1m38ANVQVZq2-pbVdIiAYCLeRBdd5i_LrNLpF7iCHBpAawuxX5BQIVKBW3WNTPhWUdV9_a1_394CDBmYswn8XiQSx0Vi0hfjuuMp9J9sQxOVVq2MFyWZiDvhIX2CJutq8xn27shQc7Y5xeZN5SVosFrv3irWYkzJuKoU
3vRCnweUcMbf_DPELcog4hdLlFlUbPwJctmg_kkm78cpLkr1l-LB51QDjkIdHC0JWSvkCYxwpZyWgyDojQiv-FLkDdCBn5m0RVPQtqTZDOJE47zCZvuiUeMhVMbmUc-odQzBuA8JDllUoKm5txGTn6wQyQvL1LOrGDH1zPaSa4djRGGVW1BPmA3cyv6UlgUQAPTT4heryzcdtZKTOwTyH-vVQ1hv1PUVlUYvFFxuq6NAyfv-Uq9kqipD_-UA5hWBPHdBAuNexFGXyjbw5AeeSXwEtkYd7cMslV3Yc90G1zU_G8WZJJVvrsfsvdit5O7wGFhA0j1vMF96XpPzIvxm7kk21hCzStPsVqOrALN4_v7N7o3JYTRj2wJVd0K-ZojWfG9PIgnx55szcP-bi2ykaIPCmKgOh9FWH8gDwi061zCtxnxu9glwRGlLd_huEcYQuft-rsxCrIgIqKvJzrGQ0ofPVZj53Uqq7Sl602QeuH5FZRa5cjJFtF12JDbNAs3ImkMVsJGdRwbEu8CSKJKp7gRgu4R-shkvBQjwL8moYIXbglmTizuzV3lBg0fdbJOcMCnQsmCGvFB7dxleArTKSr8PaHWWH5RIQQM1Kt3m0a7RJVZjr5eP7neBin2VQUEcUXu418te7PMem7KrKlAoTh8uEEdT4swGgYybwjv10cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?><record_update table="scan_script_only_check">
<scan_script_only_check action="INSERT_OR_UPDATE">
<active>true</active>
<category>upgradability</category>
<description>Use Logging Levels: Instead of gs.log(), consider using more appropriate logging levels, such as:&#13;
gs.info() for informational messages.&#13;
gs.warn() for warnings that don’t break functionality but may need attention.&#13;
gs.error() for logging errors that require investigation.</description>
<documentation_url/>
<finding_type>scan_finding</finding_type>
<name>Avoid usage of gs.log()</name>
<priority>3</priority>
<resolution_details/>
<run_condition/>
<score_max>100</score_max>
<score_min>0</score_min>
<score_scale>1</score_scale>
<script><![CDATA[(function (finding, columnValue) {
var matches = columnValue.match(/gs\.log\s*\(/g);

if (matches) {
matches.forEach(function(element) {
finding.increment();
});
}
})(finding, columnValue);]]></script>
<short_description>Avoid usage of gs.log() in prod</short_description>
<sys_class_name>scan_script_only_check</sys_class_name>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2024-10-18 02:30:31</sys_created_on>
<sys_id>6b832a7953d1d61000b51901a0490e24</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_name>Avoid usage of gs.log()</sys_name>
<sys_package display_value="Example Instance Checks" source="x_appe_exa_checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_package>
<sys_policy/>
<sys_scope display_value="Example Instance Checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_scope>
<sys_update_name>scan_script_only_check_6b832a7953d1d61000b51901a0490e24</sys_update_name>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2024-10-18 02:30:31</sys_updated_on>
</scan_script_only_check>
<sys_translated_text action="delete_multiple" query="documentkey=6b832a7953d1d61000b51901a0490e24"/>
<sys_es_latest_script action="INSERT_OR_UPDATE">
<id>6b832a7953d1d61000b51901a0490e24</id>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2024-10-18 02:30:31</sys_created_on>
<sys_id>07a5a23953d1d61000b51901a0490e95</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2024-10-18 02:30:31</sys_updated_on>
<table>scan_script_only_check</table>
<use_es_latest>true</use_es_latest>
</sys_es_latest_script>
</record_update>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?><record_update table="scan_table_check">
<scan_table_check action="INSERT_OR_UPDATE">
<active>true</active>
<advanced>false</advanced>
<category>upgradability</category>
<conditions table="sc_cat_item">owner.active=false^EQ<item endquery="false" field="owner.active" goto="false" newquery="false" operator="=" or="false" value="false"/>
<item endquery="true" field="" goto="false" newquery="false" operator="=" or="false" value=""/>
</conditions>
<description>We should ensure that inactive users are removed from being assigned as Catalog item owners.</description>
<documentation_url/>
<finding_type>scan_finding</finding_type>
<name>Inactive User Check : Catalog Iem</name>
<priority>2</priority>
<resolution_details/>
<run_condition/>
<score_max>100</score_max>
<score_min>0</score_min>
<score_scale>1</score_scale>
<script><![CDATA[(function (engine) {

// Add your code here

})(engine);]]></script>
<short_description>Check Catalog Item owner is Active user</short_description>
<sys_class_name>scan_table_check</sys_class_name>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2024-10-20 17:30:07</sys_created_on>
<sys_id>25a5c4b65311121000b51901a0490e4f</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_name>Inactive User Check : Catalog Iem</sys_name>
<sys_package display_value="Example Instance Checks" source="x_appe_exa_checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_package>
<sys_policy/>
<sys_scope display_value="Example Instance Checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_scope>
<sys_update_name>scan_table_check_25a5c4b65311121000b51901a0490e4f</sys_update_name>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2024-10-20 17:30:07</sys_updated_on>
<table>sc_cat_item</table>
<use_manifest>false</use_manifest>
</scan_table_check>
<sys_translated_text action="delete_multiple" query="documentkey=25a5c4b65311121000b51901a0490e4f"/>
</record_update>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?><record_update table="scan_table_check">
<scan_table_check action="INSERT_OR_UPDATE">
<active>true</active>
<advanced>true</advanced>
<category>manageability</category>
<conditions table="sys_properties">name=sn_atf.runner^value=false^EQ<item endquery="false" field="name" goto="false" newquery="false" operator="=" or="false" value="sn_atf.runner"/>
<item endquery="false" field="value" goto="false" newquery="false" operator="=" or="false" value="false"/>
<item endquery="true" field="" goto="false" newquery="false" operator="=" or="false" value=""/>
</conditions>
<description/>
<documentation_url/>
<finding_type>scan_finding</finding_type>
<name>ATF usage instance</name>
<priority>2</priority>
<resolution_details/>
<run_condition/>
<score_max>100</score_max>
<score_min>0</score_min>
<score_scale>1</score_scale>
<script><![CDATA[(function (finding, current) {
// Checks if we are in a non-production instance
if (gs.getProperty("glide.installation.production") === "false")
finding.increment();

})(finding, current);]]></script>
<short_description>Checking ATFs are using in Non production instances.</short_description>
<sys_class_name>scan_table_check</sys_class_name>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2024-10-16 14:19:07</sys_created_on>
<sys_id>6f14fe555359161000b51901a0490ef9</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_name>ATF usage instance</sys_name>
<sys_package display_value="Example Instance Checks" source="x_appe_exa_checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_package>
<sys_policy/>
<sys_scope display_value="Example Instance Checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_scope>
<sys_update_name>scan_table_check_6f14fe555359161000b51901a0490ef9</sys_update_name>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2024-10-16 14:19:07</sys_updated_on>
<table>sys_properties</table>
<use_manifest>false</use_manifest>
</scan_table_check>
<sys_translated_text action="delete_multiple" query="documentkey=6f14fe555359161000b51901a0490ef9"/>
<sys_es_latest_script action="INSERT_OR_UPDATE">
<id>6f14fe555359161000b51901a0490ef9</id>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2024-10-16 14:19:06</sys_created_on>
<sys_id>57a4ba915359161000b51901a0490e13</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2024-10-16 14:19:06</sys_updated_on>
<table>scan_table_check</table>
<use_es_latest>true</use_es_latest>
</sys_es_latest_script>
</record_update>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?><record_update table="scan_table_check">
<scan_table_check action="INSERT_OR_UPDATE">
<active>true</active>
<advanced>false</advanced>
<category>manageability</category>
<conditions table="cmdb_ci_service">owned_by.active=false^EQ<item endquery="false" field="owned_by.active" goto="false" newquery="false" operator="=" or="false" value="false"/>
<item endquery="true" field="" goto="false" newquery="false" operator="=" or="false" value=""/>
</conditions>
<description>We should ensure that inactive users are removed from being assigned as Service owners.</description>
<documentation_url/>
<finding_type>scan_finding</finding_type>
<name>Inactive User Check : Service Owner</name>
<priority>2</priority>
<resolution_details/>
<run_condition/>
<score_max>100</score_max>
<score_min>0</score_min>
<score_scale>1</score_scale>
<script><![CDATA[(function (engine) {

// Add your code here

})(engine);]]></script>
<short_description>Check inactive user as Service Owner</short_description>
<sys_class_name>scan_table_check</sys_class_name>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2024-10-20 17:44:06</sys_created_on>
<sys_id>8979003a5311121000b51901a0490e86</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_name>Inactive User Check : Service Owner</sys_name>
<sys_package display_value="Example Instance Checks" source="x_appe_exa_checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_package>
<sys_policy/>
<sys_scope display_value="Example Instance Checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_scope>
<sys_update_name>scan_table_check_8979003a5311121000b51901a0490e86</sys_update_name>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2024-10-20 17:44:06</sys_updated_on>
<table>cmdb_ci_service</table>
<use_manifest>false</use_manifest>
</scan_table_check>
<sys_translated_text action="delete_multiple" query="documentkey=8979003a5311121000b51901a0490e86"/>
</record_update>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?><record_update table="scan_table_check">
<scan_table_check action="INSERT_OR_UPDATE">
<active>true</active>
<advanced>false</advanced>
<category>manageability</category>
<conditions table="alm_asset">assigned_to.active=false^EQ<item endquery="false" field="assigned_to.active" goto="false" newquery="false" operator="=" or="false" value="false"/>
<item endquery="true" field="" goto="false" newquery="false" operator="=" or="false" value=""/>
</conditions>
<description>Check for inactive users in Asset Management and update the Configuration Management Database (CMDB) to reflect any changes in asset ownership.</description>
<documentation_url/>
<finding_type>scan_finding</finding_type>
<name>Inactive User Check : Asset management</name>
<priority>2</priority>
<resolution_details/>
<run_condition/>
<score_max>100</score_max>
<score_min>0</score_min>
<score_scale>1</score_scale>
<script><![CDATA[(function (engine) {

// Add your code here

})(engine);]]></script>
<short_description>Check any assets assigned to any inactive user</short_description>
<sys_class_name>scan_table_check</sys_class_name>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2024-10-20 17:52:35</sys_created_on>
<sys_id>c15bc4f65311121000b51901a0490edb</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_name>Inactive User Check : Asset management</sys_name>
<sys_package display_value="Example Instance Checks" source="x_appe_exa_checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_package>
<sys_policy/>
<sys_scope display_value="Example Instance Checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_scope>
<sys_update_name>scan_table_check_c15bc4f65311121000b51901a0490edb</sys_update_name>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2024-10-20 17:52:35</sys_updated_on>
<table>alm_asset</table>
<use_manifest>false</use_manifest>
</scan_table_check>
<sys_translated_text action="delete_multiple" query="documentkey=c15bc4f65311121000b51901a0490edb"/>
</record_update>
Loading