Skip to content

Commit

Permalink
Address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ababhis2 committed Oct 3, 2024
1 parent 8a2cd03 commit 82ae43b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions User Audit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,8 @@ You can set an environment variable in Windows using the setx command in the com
In macOS or Linux, you can set an environment variable in the terminal using the export command:
*export API_KEY=your-api-key*

### 4. Pagination Size
List Users endpoint is paginated. Pagination size is set to 500 in both the scripts. If you want a higher or lower pagination size please change `per_page` variable's value in the script.

### 3: Fetch Audit Logs
Update the start_date (Line #70) and end_date (Line #71) in the script as per the time period you want to pull the logs for. Based on this time period, the script will check which user used their API keys in that time frame.
2 changes: 1 addition & 1 deletion User Audit/audit_test_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def flatten(x, name='', exclude=exclude):

token = os.environ.get('API_KEY')
base_url = "https://api.kennasecurity.com"
per_page = 10
per_page = 500
users_url= base_url + "/users?per_page=" + str(per_page)
roles_url = base_url + "/roles"
audit_logs_url = base_url + "/audit_logs/"
Expand Down
3 changes: 1 addition & 2 deletions User Audit/useraudit.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ def flatten(x, name='', exclude=exclude):
return out

token = sys.argv[1]
# increase per_page to get more data per request
per_page = 10
per_page = 500
base_url = "http://api.kennasecurity.com"
users_url= base_url + "/users?per_page=" + str(per_page)
roles_url = base_url + "/roles"
Expand Down

0 comments on commit 82ae43b

Please sign in to comment.