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

CIAC-11546/OktaASA #38448

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open

CIAC-11546/OktaASA #38448

wants to merge 30 commits into from

Conversation

sapirshuker
Copy link
Contributor

Contributing to Cortex XSOAR Content

Make sure to register your contribution by filling the contribution registration form

The Pull Request will be reviewed only after the contribution registration form is filled.

Status

  • In Progress
  • Ready
  • In Hold - (Reason for hold)

Related Issues

fixes: https://jira-dc.paloaltonetworks.com/browse/CIAC-11546

Description

New collector for XSIAM OktaASA.

Must have

  • Tests
  • Documentation

Copy link

github-actions bot commented Feb 2, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
Packs/OktaASA/Integrations/OktaASA
   OktaASA.py931979%43, 48, 51–52, 64, 66, 188–190, 216–218, 220, 260–262, 267, 269–270
TOTAL931979% 

Tests Skipped Failures Errors Time
16 0 💤 0 ❌ 0 🔥 3.270s ⏱️

@sapirshuker sapirshuker requested a review from eyalpalo February 6, 2025 09:53
@YuvHayun YuvHayun self-requested a review as a code owner February 6, 2025 11:03
@ShirleyDenkberg
Copy link
Contributor

@eyalpalo @YuvHayun Doc review completed.
@sapirshuker Need content in the Pack README.

Copy link
Contributor

@eyalpalo eyalpalo left a comment

Choose a reason for hiding this comment

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

Very nice!

token_response: dict = self._http_request('POST', '/service_token', json_data=body,
headers={"Content-Type": "application/json"})
# We don't need to save the team name
token_response.pop("team_name", None)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this is problematic in a way we need to pop it?

Copy link
Contributor Author

@sapirshuker sapirshuker Feb 12, 2025

Choose a reason for hiding this comment

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

It's not a problem for me, but I prefer not to save what is not needed.

Comment on lines 90 to 93
if e.res is not None and e.res.status_code == 401 and "Authentication token expired" in e.res.text:
self.is_token_refresh_required(hard=True)
demisto.debug(f"{INTEGRATION_NAME}: Hard refresh token")
events_response = self.get_audit_events_request(params)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is nice, but it is not needed if the is_token_refresh_required is working as expected.

Copy link
Contributor Author

@sapirshuker sapirshuker Feb 12, 2025

Choose a reason for hiding this comment

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

It's an edge case where if someone regenerates a token through Postman or any other third application.
Did not change it.

Packs/OktaASA/Integrations/OktaASA/OktaASA.py Outdated Show resolved Hide resolved
else integration_context)
else:
token_response = self.get_token_request()
demisto.setIntegrationContext(token_response)
Copy link
Contributor

Choose a reason for hiding this comment

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

all the info returned from the response (which is stored here in the last run object) is being used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What repeats is the expiration date and token, so we need to save both, what is not needed is not saved, like the name of the group I removed in the get_token_request method.

Packs/OktaASA/Integrations/OktaASA/OktaASA.py Outdated Show resolved Hide resolved
Packs/OktaASA/Integrations/OktaASA/OktaASA.py Outdated Show resolved Hide resolved
Packs/OktaASA/Integrations/OktaASA/OktaASA.py Outdated Show resolved Hide resolved
Packs/OktaASA/Integrations/OktaASA/OktaASA.py Outdated Show resolved Hide resolved
Packs/OktaASA/Integrations/OktaASA/OktaASA.yml Outdated Show resolved Hide resolved
Packs/OktaASA/pack_metadata.json Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants