sync Cloudshell groups with AD Groups
Project description
cloudshell-user-sync
A CLI tool to Sync LDAP / Active Directory Groups with Cloudshell groups. This package will pull LDAP data, compare state of cloudshell group, and add/remove users to sync the groups.
Important Notes
- This package does NOT import users from LDAP. Only Syncs already imported Users.
- Users must be first manually imported or auto-imported on login.
- Non-imported cloudshell users will NOT be evicted from groups if they aren't present in the mapped LDAP group.
- This tool only aims to manage ldap users from designated groups.
- This tool can be configured to manage only a subset of cloudshell groups, doesn't have to be globallly configured.
- To improve performance of LDAP search, place the target ldap groups to sync close together in LDAP Tree
- This will allow to set a lower base_dn to search for users in and quicker ldap searches.
Installation
pip install cloudshell-user-sync
Commands
Commands:
config View or Set Config - Pass no params to view config
credential Set Credentials For Cloudshell and LDAP
mapping Set LDAP group --> Cloudshell Groups Mapping
run Pull LDAP Data and sync to Cloudshell
runscheduler Run sync on infinite scheduler
service Install Windows service to run job automatically
version Display CLI version
Basic Usage
- configure credentials (stored in OS specific credential manager)
- set config values for target cloudshell server
- Set config values for target LDAP server
- set LDAP -> Cloudshell Group Mappings
- Do manual sync run to test
- Configure service to run job automatically
Configure Credentials
Set Cloudshell Credential
usersync credential admin admin --target cloudshell
Set LDAP Credential
usersync credential CN=Administrator,CN=Users,DC=samplecorp,DC=example,DC=com LDAP_DN_Password --target ldap
- User is the full distinguished name (DN) as seen in AD explorer
Set Config Values
Credentials must be set through CLI to be stored in credential manager. The other values can be set directly in file or optionally in CLI
Default Config Path:
- Windows: C:\ProgramData\QualiSystems\CloudshellUserSync\ldap_config.json
- Linux: /opt/CloudshellUserSync/ldap_config.json
view current config state
usersync config
CLI Set config actions follows the pattern:
usersync config <target> <key> <value>
Set cloudshell server sample
usersync config cloudshell server localhost
Set ldap server sample
usersync config ldap server 10.0.0.7
Set LDAP mappings
Can map one LDAP source group to multiple cloudshell groups (ie a list)
View only mapping config:
usersync mapping
Set mapping follows pattern:
usersync mapping <LDAP_GROUP> --csgroups <CSGROUP1>,<CSGROUP2>,<CSGROUP3>
Configure Windows Service
Install and run job as managed windows service.
Install service
usersync service install
Start Service
usersync service start
Notes:
- After installation, must set service to run as same Logon user that ran install
- This is so it can access windows credential manager.
- Set startup type to auto if desired
- Check log to ensure no errors are occuring.
- The service will not crash on errors due to lost connectivity to target servers.
Linux Service
No linux service generation command included. The following options are possible.
- Schedule the "run" command to a cron job
- Wrap the "runscheduler" command into a systemd service
Logs
Both manual runs and scheduled runs log to the same rotating log file.
- Windows:
C:\ProgramData\QualiSystems\CloudshellUserSync\Logs\UserSync.log
- Linux:
/opt/CloudshellUserSync/Logs/UserSync.log
Dependencies
- LDAP3 for pulling source LDAP/AD data
- Schedule as cross-platform cron-like scheduler
- Keyring to store credentials in OS
- Pywin32 - windows service installer
cloudshell-automation-api
to update cloudshell groups
License
Free Software: MIT License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for cloudshell-user-sync-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 743efb6e5325d6cff6bf2a86fd3497756f95f7cb58a32cd11c628840ce9ca2e4 |
|
MD5 | 9e78beb19dca8d4589efe28382ec021d |
|
BLAKE2b-256 | 99f5b9fb6a82bfd158cc5ef9fa95ed5bea15433d1113559d2ac49b30f932466a |
Hashes for cloudshell_user_sync-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f17476e1eb9fe9147a6db3f903d1b77d1eed7a8f61321c186fc94ebe41887929 |
|
MD5 | 828bcc7bdb76e632f2303d7d54301df5 |
|
BLAKE2b-256 | 5f398b65a07786b2ac6dd7e8466c3aa41c0a427838868919a1e8bd5815575356 |