Skip to content

Commit

Permalink
Merge pull request #2 from Tools4ever-NIM/0.3
Browse files Browse the repository at this point in the history
0.3
  • Loading branch information
msheldont4e authored May 19, 2023
2 parents d434547 + 49d7e76 commit 08652f5
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 1,489 deletions.
713 changes: 1 addition & 712 deletions ProgramData/Tools4ever/NIM/config/filters/ad_nim_users_active.json

Large diffs are not rendered by default.

751 changes: 1 addition & 750 deletions ProgramData/Tools4ever/NIM/config/filters/ad_nim_users_disable.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"filter_name":"AD_Report_Users_PasswordExpiry","filter_name_parent":"","filter_items":[{"system_name":"AD","col_name":"Users","colrefname":"Users","type":"start","blocked":false,"id":"82f5d502-de3e-4ffb-b5a6-75a79a17539a","indent":0,"inherited":false,"enabled":true,"index":0,"child_count":1},{"type":"and","blocked":false,"id":"12d8edf8-b030-4a5e-8a27-728618bfa539","indent":1,"inherited":false,"enabled":true,"index":1,"parent":0,"child_count":5},{"field_name":"mail","function_name":"exists","value_vs_parameter":true,"type":"expression","blocked":false,"id":"4c7143e5-1eb9-4715-abff-af4b88d683f4","indent":2,"inherited":false,"enabled":true,"index":2,"parent":1,"child_count":0},{"field_name":"PasswordNeverExpires","function_name":"equals","value_vs_parameter":true,"operand_value":false,"type":"expression","blocked":false,"id":"ad395143-9ef1-4361-a342-f2fc46e7ebda","indent":2,"inherited":false,"enabled":true,"index":3,"parent":1,"child_count":0},{"field_name":"CannotChangePassword","function_name":"equals","value_vs_parameter":true,"operand_value":false,"type":"expression","blocked":false,"id":"6445cbdc-2573-4996-a47a-8b94124b87e0","indent":2,"inherited":false,"enabled":true,"index":4,"parent":1,"child_count":0},{"field_name":"Enabled","function_name":"equals","value_vs_parameter":true,"operand_value":true,"type":"expression","blocked":false,"id":"56d38f5a-6cdc-4ef4-98c2-b9351523bc6b","indent":2,"inherited":false,"enabled":true,"index":5,"parent":1,"child_count":0},{"field_name":"PasswordExpirationDate","function_name":"<= today + [days]","value_vs_parameter":true,"operand_value":30,"type":"expression","blocked":false,"id":"a16265fd-5a74-464c-81e7-adefdfda75a7","indent":2,"inherited":false,"enabled":true,"index":6,"parent":1,"child_count":0}],"filter_columns":[{"id":"Users.objectGUID","order":1,"name":"Users.objectGUID","display_name":"objectGUID","show":true,"field_name":"objectGUID","colrefname":"Users","source":"data"},{"id":"Users.displayName","order":2,"name":"Users.displayName","display_name":"displayName","show":true,"field_name":"displayName","colrefname":"Users","source":"data"},{"id":"Users.employeeID","order":3,"name":"Users.employeeID","display_name":"employeeID","show":true,"field_name":"employeeID","colrefname":"Users","source":"data"},{"id":"Users.employeeType","order":4,"name":"Users.employeeType","display_name":"employeeType","show":true,"field_name":"employeeType","colrefname":"Users","source":"data"},{"id":"Users.givenName","order":5,"name":"Users.givenName","display_name":"givenName","show":true,"field_name":"givenName","colrefname":"Users","source":"data"},{"id":"Users.mail","order":6,"name":"Users.mail","display_name":"mail","show":true,"field_name":"mail","colrefname":"Users","source":"data"},{"id":"Users.sAMAccountName","order":7,"name":"Users.sAMAccountName","display_name":"sAMAccountName","show":true,"field_name":"sAMAccountName","colrefname":"Users","source":"data"},{"id":"Users.sn","order":8,"name":"Users.sn","display_name":"sn","show":true,"field_name":"sn","colrefname":"Users","source":"data"},{"id":"Users.userPrincipalName","order":9,"name":"Users.userPrincipalName","display_name":"userPrincipalName","show":true,"field_name":"userPrincipalName","colrefname":"Users","source":"data"},{"id":"Users.PasswordExpirationDate","order":10,"name":"Users.PasswordExpirationDate","display_name":"PasswordExpirationDate","show":true,"field_name":"PasswordExpirationDate","colrefname":"Users","source":"data"},{"id":"calc_DaysTillExpiry","order":11,"name":"calc_DaysTillExpiry","display_name":"calc_DaysTillExpiry","show":true,"javascript":"try {\n const date1 = new Date(Users['PasswordExpirationDate']);\n const date2 = new Date();\n var Difference_In_Time = date2.getTime() - date1.getTime();\n var Difference_In_Days = Difference_In_Time / (1000 * 3600 * 24);\n return Math.floor(Math.abs(Difference_In_Days));\n} catch (e){}","source":"script"},{"id":"calc_ExpireDateString","order":12,"name":"calc_ExpireDateString","display_name":"calc_ExpireDateString","show":true,"javascript":"try\n{\n const date = new Date(Users['PasswordExpirationDate']);\n let year = date.getUTCFullYear();\n let month = date.getUTCMonth()+1;\n let day = date.getUTCDate();\n if (day < 10) { day = '0' + day; }\n if (month < 10) { month = '0' + month; }\n let formattedDate = '' + month + '-' + day + '-' + year\n return formattedDate;\n} catch(e) {}","source":"script"},{"id":"calc_Excluded","order":13,"name":"calc_Excluded","display_name":"calc_Excluded","show":true,"javascript":"try {\n const date1 = new Date(Users['PasswordExpirationDate']);\n const date2 = new Date();\n let Difference_In_Time = date2.getTime() - date1.getTime();\n // To calculate the no. of days between two dates\n let Difference_In_Days = Difference_In_Time / (1000 * 3600 * 24);\n let days = Math.floor(Math.abs(Difference_In_Days));\n if(days == 15 || day == 7 || day == 3 || day == 2 || day == 1)\n {\n return false\n }\n} catch (e){ }\n\nreturn true","source":"script"}],"sort_columns":[],"group":{"enabled":false,"count":1,"field":""},"params":[],"appends":[],"exclude":{"enabled":true,"field_name":"calc_Excluded"},"lookups":[]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"filter_name":"RoleModel_NIM_Scoping_Exclude","filter_name_parent":"","filter_items":[{"system_name":"internal","col_name":"users","colrefname":"users","type":"start","blocked":false,"indent":0,"inherited":false,"enabled":true,"index":0,"child_count":1,"id":"a7400cd2-4d00-4a59-8f20-958041bcec26"},{"type":"or","blocked":false,"id":"42177727-b41f-47de-bebc-0e817346c7fa","indent":1,"inherited":false,"enabled":true,"index":1,"parent":0,"child_count":2},{"field_name":"AuthMethod","function_name":"not exists","value_vs_parameter":true,"type":"expression","blocked":false,"id":"eee0fc5d-e35b-42cc-9dec-9989ef655591","indent":2,"inherited":false,"enabled":true,"index":2,"parent":1,"child_count":0},{"field_name":"ID","function_name":"smaller than","value_vs_parameter":true,"operand_value":3,"type":"expression","blocked":false,"id":"606281ea-f1c9-42dc-92a7-28e2884e06ad","indent":2,"inherited":false,"enabled":true,"index":3,"parent":1,"child_count":0}],"filter_columns":[{"id":"users.ID","order":1,"name":"users.ID","display_name":"ID","show":true,"field_name":"ID","colrefname":"users","source":"data"},{"id":"users.Name","order":2,"name":"users.Name","display_name":"Name","show":true,"field_name":"Name","colrefname":"users","source":"data"},{"id":"users.Email","order":3,"name":"users.Email","display_name":"Email","show":true,"field_name":"Email","colrefname":"users","source":"data"},{"id":"users.DisplayName","order":4,"name":"users.DisplayName","display_name":"DisplayName","show":true,"field_name":"DisplayName","colrefname":"users","source":"data"},{"id":"users.ExternalID","order":5,"name":"users.ExternalID","display_name":"ExternalID","show":true,"field_name":"ExternalID","colrefname":"users","source":"data"},{"id":"users.Enabled","order":6,"name":"users.Enabled","display_name":"Enabled","show":true,"field_name":"Enabled","colrefname":"users","source":"data"},{"id":"users.Description","order":7,"name":"users.Description","display_name":"Description","show":true,"field_name":"Description","colrefname":"users","source":"data"},{"id":"users.AuthMethod","order":8,"name":"users.AuthMethod","display_name":"AuthMethod","show":true,"field_name":"AuthMethod","colrefname":"users","source":"data"}],"sort_columns":[],"group":{"enabled":false,"count":1,"field":""},"params":[],"appends":[],"exclude":{"enabled":false,"field_name":""},"lookups":[]}
24 changes: 1 addition & 23 deletions ProgramData/Tools4ever/NIM/config/jobs/ad_nim_user_sync.json
Original file line number Diff line number Diff line change
@@ -1,23 +1 @@
{
"jobdef_name": "AD_NIM_User_Sync",
"tasks": [
{
"type": "crud",
"name": "AD_NIM_User_Create",
"enabled": true,
"threshold": 1
},
{
"type": "crud",
"name": "AD_NIM_User_Update",
"enabled": true,
"threshold": 1
},
{
"type": "crud",
"name": "AD_NIM_User_Disable",
"enabled": true,
"threshold": 1
}
]
}
{"jobdef_name":"AD_NIM_User_Sync","tasks":[{"type":"crud","name":"AD_NIM_User_Create","enabled":true,"threshold":1},{"type":"crud","name":"AD_NIM_User_Update","enabled":true,"threshold":1},{"type":"crud","name":"AD_NIM_User_Disable","enabled":true,"threshold":1},{"type":"groupmembership","name":"internal","enabled":true,"threshold":1}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"AD_User_PasswordExpiry","type":"Mail","event":{"event_name":"AD_User_PasswordExpiry","event_type":6},"html":"<div>\n <meta charset=\"utf-8\">\n<br></div><!-- utf-8 works for most cases -->\n<div>\n <meta name=\"viewport\" content=\"width=device-width\">\n<br></div><!-- Forcing initial-scale shouldn't be necessary -->\n<!-- Use the latest (edge) version of IE rendering engine -->\n<div>\n <title>SSRPM: Password expiry notification</title>\n</div><!-- The title tag shows in email notifications, like Android 4.4. -->\n<!-- CSS Reset -->\n<style type=\"text/css\">\n /* What it does: Remove spaces around the email design added by some email clients. */\n /* Beware: It can remove the padding / margin and add a background color to the compose a reply window. */\n html,\n body {\n Margin: 0 !important;\n padding: 0 !important;\n height: 100% !important;\n width: 100% !important;\n }\n \n /* What it does: Stops email clients resizing small text. */\n * {\n -ms-text-size-adjust: 100%;\n -webkit-text-size-adjust: 100%;\n }\n \n /* What is does: Centers email on Android 4.4 */\n div[style*=\"margin: 16px 0\"] {\n margin: 0 !important;\n }\n \n /* What it does: Stops Outlook from adding extra spacing to tables. */\n table,\n td {\n mso-table-lspace: 0pt !important;\n mso-table-rspace: 0pt !important;\n }\n \n /* What it does: Fixes webkit padding issue. Fix for Yahoo mail table alignment bug. Applies table-layout to the first 2 tables then removes for anything nested deeper. */\n table {\n border-spacing: 0 !important;\n border-collapse: collapse !important;\n table-layout: fixed !important;\n Margin: 0 auto !important;\n }\n \n table table table {\n table-layout: auto;\n }\n \n /* What it does: Uses a better rendering method when resizing images in IE. */\n img {\n -ms-interpolation-mode: bicubic;\n }\n \n /* What it does: Overrides styles added when Yahoo's auto-senses a link. */\n .yshortcuts a {\n border-bottom: none !important;\n }\n \n /* What it does: A work-around for iOS meddling in triggered links. */\n .mobile-link--footer a,\n a[x-apple-data-detectors] {\n color: inherit !important;\n text-decoration: underline !important;\n }\n</style>\n<!-- Progressive Enhancements -->\n<style>\n /* What it does: Hover styles for buttons */\n .button-td,\n .button-a {\n transition: all 100ms ease-in;\n }\n \n .button-td:hover,\n .button-a:hover {\n background: #555555 !important;\n border-color: #555555 !important;\n }\n</style>\n\n\n\n<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" height=\"100%\" width=\"100%\" bgcolor=\"#ffffff\" style=\"border-collapse:collapse;\">\n <tbody>\n <tr>\n <td valign=\"top\">\n <center style=\"width:100%;\"></center>\n <!-- Visually Hidden Preheader Text : BEGIN -->\n <div style=\"display:none;font-size:1px;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;mso-hide:all;font-family: sans-serif;\">\n <br>\n </div>\n\n <!-- Email Header : BEGIN -->\n <table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" align=\"center\" width=\"100%\" style=\"max-width: 100%\">\n <tbody>\n <tr>\n <td style=\"padding: 5px 5px 5px 0px; width: 100%; height:60px; text-align: center; background-color: #000058; color:#ffffff; font-size:24px; font-family:segoe Segoe, Segoe UI, DejaVu Sans, Trebuchet MS, Verdana, sans-serif;\">Password expiry notification\n </td>\n </tr>\n </tbody>\n </table>\n <!-- Email Header : END -->\n <!-- Email Body : BEGIN -->\n <table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\" text-align=\"center\">\n <tbody>\n <tr>\n <td style=\"padding: 40px; text-align:center; font-family: sans-serif; font-size: 15px; mso-height-rule: exactly; line-height: 20px; color: #555555; max-width: 600px;\">\n Dear {var.event.data.displayName}, <br> <br> Your password expires on&nbsp;{var.event.data.calc_ExpireDateString} ({var.event.data.calc_DaysTillExpiry} days). Please change your password by that time. <br> <br>Click <a href=\"https://reset.domain.com\">here</a> to change your password. </td>\n </tr>\n </tbody>\n </table>\n\n\n <!-- Email Body : END -->\n <!-- Email Footer : BEGIN -->\n <table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" align=\"center\" width=\"75%\" style=\"background-color:#ffffff; border-top:solid lightgrey 1px\">\n <tbody>\n <tr>\n <td style=\"padding: 20px 10px; width: 100%;font-size: 12px; font-family: sans-serif; mso-height-rule: exactly; line-height:18px; text-align: center; color: #888888;\">\n Copyright by Tools4ever\n\n\n </td>\n </tr>\n </tbody>\n </table>\n <table style=\"width:100%; background-color:#000058; color:#ffffff; text-align:center; height:60px;\">\n <tbody>\n <tr>\n <td>\n\n <br>\n </td>\n </tr>\n\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n</table>","to":"{var.event.data.mail}","cc":"","bcc":"","subject":"ACTION REQUIRED: Password expires in {var.event.data.calc_DaysTillExpiry} Days"}
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"schema": {
"crud_objects": {
"orgs": {
"resources": {
"metadata": {
"ic_address": {
"city":"string*",
"firstLine":"string*",
"state":"string*",
"zipcode":"string*"
}
}
}
},
"users": {
"resources": {
"metadata": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type":"table-notification","name":"AD_User_PasswordExpiry","enabled":false,"schedule":{"second":{"mode":1,"at":0,"n":1,"list":[]},"minute":{"mode":1,"at":15,"n":1,"list":[]},"hour":{"mode":1,"at":2,"n":1,"list":[]},"day_month":{"mode":0,"at":0,"n":1,"list":[]},"month":{"mode":0,"at":0,"n":1,"list":[]},"day_week":{"mode":0,"at":0,"n":1,"list":[]}},"config":{"table_name":"filter.AD_Report_Users_PasswordExpiry"}}
33 changes: 29 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,23 @@ The purpose of this repository to build a framework that can be used as a jump o

# Installation
- Copy files to root of installed drive
- Configure AD System
- See [Baseline Config](https://github.com/Tools4ever-NIM/NIM-System-PowerShell-Microsoft-Active-Directory/blob/main/Config.Baseline.json)
- Configure Internal System
- Check all tables
- Add Internal Mamberships Relations<br/>
![image](https://user-images.githubusercontent.com/24281600/234962252-3b746272-2c8b-47b8-9cc7-b2325e7d64ac.png)
- Setup Override Flags app
- Implement Override Flags lookup table [see here](https://github.com/Tools4ever-NIM/NIM-App-NIM-OverrideFlags/blob/main/README.md)
- Implement Override Flags lookup table [see here](https://github.com/Tools4ever-NIM/NIM-App-NIM-OverrideFlags/blob/main/README.md)
- Setup Config Locations app
- Create "ConfigLocation" lookup table by importing /Tools4ever/data/apps/ConfigLocation/LookupTable_ConfigLocation.csv
- Add to Internal Setup
- Configure Internal System
- Add "ConfigLocation" Table
- Configure Relations
- internal.users.ExternalID > AD.Users.objectGUID
- internal.OverrideFlags.ID > AD.Users.employeeID
- Configure LDAP Server



# Features
Expand Down Expand Up @@ -37,6 +49,8 @@ The purpose of this repository to build a framework that can be used as a jump o
- app_adusercreate_listusers.json
- AD User Duplicates
- app_aduserduplicates_list_users
- AD User Password Expiry
- app_report_users_passwordexpiry
- AD NIM Sync
- ad_nim_users_active
- ad_nim_users_disable
Expand Down Expand Up @@ -70,10 +84,18 @@ The purpose of this repository to build a framework that can be used as a jump o
- auditapp_deletes
- auditapp_last7days
- auditapp_updates


## Notification Templates
- AD User Password Expiry
- ad_user_passwordexpiry

## Scheduler
- AD_NIM Sync
- AD NIM Sync
- Syncs Domain Admins from AD to NIM Internal Users
- AD User Password Expiry
- Notifies user by email when password is expiring in 15, 7, 3, 2, 1 day(s)
- Retention
- Cleans up logging data

## REST Connectors
- Custom Schemas
Expand All @@ -93,6 +115,9 @@ The purpose of this repository to build a framework that can be used as a jump o
- Windows Defender
- Set_Windows_Defender_Exclusions.ps1
- Configure the Windows Defender exclusions for the NIM Service.
- AD Tools
- Install_AD_Tools.ps1
- Install Active Directory Tools


# Framework Documentation
Expand Down
1 change: 1 addition & 0 deletions Tools4ever/scripts/Install_AD_Tools.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dism /online /Enable-Feature /All /FeatureName:ActiveDirectory-PowerShell /FeatureName:DirectoryServices-AdministrativeCenter /FeatureName:DirectoryServices-ADAM-Tools /FeatureName:DirectoryServices-DomainController-Tools

0 comments on commit 08652f5

Please sign in to comment.