File: //opt/alt/python37/lib/python3.7/site-packages/orphanedaccountscanner-1.1.3.dist-info/METADATA
Metadata-Version: 2.4
Name: orphanedaccountscanner
Version: 1.1.3
Author-email: Ethan Jordan <[email protected]>, James Stephens <[email protected]>
Requires-Python: >=3
Description-Content-Type: text/markdown
Requires-Dist: requests
# orphanedaccountscanner
## Ranking System
relevance_score = f(x)
x = (q, d)
where q = query and d = document
### Ranks
0. Bad
1. Fair
2. Good
3. Excellent
4. Perfect
On the scale, the closer we get to perfect the more sure we are that the data
can be remove
## Setup on app server, for example phx3plcpnlads01.cloud.phx3.gdg
* git clone [email protected]:gdcorp-hosting/orphanedaccountscanner.git
* cd orphanedaccountscanner
* python3.9 -m venv env
* . env/bin/activate
* pip install --upgrade pip
* pip install -r requirements.txt
* python -m build
## Running the scanner
In order to call provapi the following keys and certs are required (available in the 'SRE-cPanel Certificates' PCP project) =>
~/.ssl/diablo.api.sreh.int.godaddy.com.crt
~/.ssl/diablo.api.sreh.int.godaddy.com.key
~/.ssl/diablo.api.sreh.int.test-godaddy.com.crt
~/.ssl/diablo.api.sreh.int.test-godaddy.com.key
Add the servers you want to run the scanner against to the hosts file using the FQDN, for example =>
orphanedaccountscanner]$ cat hosts
[hosts]
bom1plzcpnl504230.prod.bom1.secureserver.net
Before proceeding move/delete any old log files from ~/orphanscanner_logs/ to ensure an accurate report of what the scanner will or has cleaned up.
### 1. Run the scanner in debug mode to identify what accounts require cleaning up
ansible-playbook -i hosts deploy.yaml --extra-vars "mode=debug" -e 'ansible_python_interpreter=/usr/bin/python3'
./oas_log_parser.py --mode=debug --analyze
./oas_log_parser.py --mode=debug --generate-co-data
cat ~/orphanscanner_logs/oas-debug-20250919.csv
./oas_log_parser.py --mode=debug --generate-inventory
### 2. Run the scanner in live mode
Use the inventory provided by oas_log_parser.py during debug mode
Create change order
ansible-playbook -i hosts deploy.yaml --extra-vars "mode=live" -e 'ansible_python_interpreter=/usr/bin/python3'
./oas_log_parser.py --mode=live --analyze
cat ~/orphanscanner_logs/oas-live-20250919.csv
## Override number of accounts to clean up
By default the scanner will clean up 10 accounts however this can be increased up to 150 by providing the accounts_to_clean extra variable;
ansible-playbook -i hosts deploy.yaml --extra-vars "mode=live accounts_to_clean=18" -e 'ansible_python_interpreter=/usr/bin/python3'
## Logs
Once the scanner has ran logs can be found on the app deploy server in the ~/orphanscanner_logs/ directory.
### Analyze logs
oas_log_parser.py can be used to analyze logs generated by the orphaned account scanner;
```
./oas_log_parser.py --mode live --analyze
```
For more options see ./oas_log_parser.py --help
### Confluence
Additional troubleshooting can be found in the confluence document: https://godaddy-corp.atlassian.net/wiki/spaces/HOC/pages/3657144476/Orphaned+Account+Scanner