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

[Sentinel Incidents] 401 Unauthorized error + missing Directory's path #3353

Merged
merged 5 commits into from
Feb 3, 2025

Conversation

Powlinett
Copy link
Member

@Powlinett Powlinett commented Jan 30, 2025

Proposed changes

  • get a fresh token on every run instead of on every launch
  • handle stix2 errors to avoid blocking imports
  • check if directory's path is valid before creating a Directory observable

Related issues

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality using different use cases
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Further comments

These are naive solutions to fix the issue as quickly as possible. But better solutions exist, such as:

  • add a refresh strategy when the current token is about to expire
  • perform data validation (pydantic models) for both Sentinel’s responses and OpenCTI’s objects

Copy link
Member

@helene-nguyen helene-nguyen left a comment

Choose a reason for hiding this comment

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

Everything looks good to me :)

Thanks for improving the typing, good job for adding STIX2 error handling ✨

✅ Missing Directory's path is handled properly
✅ Having an updated fresh token handled

Comment on lines +170 to +171
account_login=user_account_dict.get("accountName"),
display_name=user_account_dict.get("displayName"),
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for adding that :)

@Powlinett Powlinett merged commit 55be8a8 into master Feb 3, 2025
4 checks passed
@Powlinett Powlinett deleted the bug/3325-sentinel-incident-401-unauthorized branch February 3, 2025 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filigran team use to identify PR from the Filigran team
Projects
None yet
2 participants