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

Update User Audit Scripts for Pagination #240

Merged
merged 4 commits into from
Oct 3, 2024
Merged

Update User Audit Scripts for Pagination #240

merged 4 commits into from
Oct 3, 2024

Conversation

ababhis2
Copy link
Contributor

@ababhis2 ababhis2 commented Oct 2, 2024

VM-5208

The script will work for both paginated and unpaginated API.

paginated response for useraudit.py
image

for audit script
image

@ababhis2 ababhis2 requested a review from jaredkalmus October 2, 2024 21:44
base_url = "https://api.kennasecurity.com"
users_url= base_url + "/users"
# increase per_page to get more data per request
per_page = 10
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be configurable like user can adjust this number?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these scripts are sent to the client so either CX or client can customize the scripts. I have added a small README snippet about per_page but I do not see the need to make it a CLI option. I do not like the way CLI is being used in user audit script but not planning to change it

Copy link
Contributor

@jaredkalmus jaredkalmus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performed a test run for my environment and all users were returned with appropriate data

@ababhis2 ababhis2 merged commit 95fe6a7 into master Oct 3, 2024
1 check passed
@@ -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
Copy link

@macesped macesped Oct 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: this should go after # 3. Also, it should keep the same format: 4:.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants