Skip to content

[Flashpoint] Import CCM Alerts as Incidents #4025

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

Merged
merged 24 commits into from
Jun 4, 2025

Conversation

Powlinett
Copy link
Member

@Powlinett Powlinett commented May 23, 2025

Proposed changes

  • add FLASHPOINT_IMPORT_CCM_ALERTS and FLASHPOINT_FRESH_CCM_ALERTS_ONLY env/config vars
  • handle import_start_date or connector's state last import
  • create CompromisedCredentialSighting model and its submodels
  • fetch objects of type credential-sighting from Flashpoint (aka CCM Alerts) since defined date
  • map CompromisedCredentialSighting to stix2.Incident and its related SCOs/SDOs
  • send bundles in a work dedicated to CCM alerts
  • add unit tests for flashpoint_client module and converter_to_stix.py
  • split last_run datetimes by type of imports in connector's state
  • update README
  • minor clean up / typing for the rest of the code

Related issues

Checklist

  • I consider the submitted work as finished
  • I have signed my commits using GPG key.
  • 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

@Powlinett Powlinett self-assigned this May 23, 2025
@Powlinett Powlinett added filigran team use to identify PR from the Filigran team do not merge Do not merge this PR until this tag will be removed labels May 23, 2025
@Powlinett Powlinett linked an issue May 23, 2025 that may be closed by this pull request
from pydantic import AliasPath, BaseModel, ConfigDict, Field


class FrozenBaseModel(BaseModel):
Copy link
Contributor

Choose a reason for hiding this comment

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

This works fine but I think there is no need to freeze you model here. Feel free to correct me otherwise !

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought it was better to freeze Flashpoint's objects to avoid modifying the data returned by their API, WDYT?

):
compromised_credential_sighting = CompromisedCredentialSighting.model_validate(
# Typical Compromised Credential Sighting in response to /search endpoint call
{
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is a duplication of your data sample

Copy link
Member Author

@Powlinett Powlinett Jun 2, 2025

Choose a reason for hiding this comment

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

Not quite sure if I understood correctly your comment, but I pushed a commit where I re-use the data sample in test_converter_to_stix.py. Let me know if it's not the expected fix ^^

Copy link
Contributor

@flavienSindou flavienSindou left a comment

Choose a reason for hiding this comment

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

Thank you for this work @Powlinett !
The implemented features are clear, and the refactoring you did makes the code more robust and easier to read/maintain. The additional improvements, including the unit tests, the refactoring of the connector states management, and the various explanatory comments you added are very welcome !

Powlinett added 4 commits June 3, 2025 16:52
…ates

do not split import start dates by data types
if an error occurs while fetching data, the whole data batch is skipped (same behavior as Alerts import)
@Powlinett Powlinett requested a review from flavienSindou June 3, 2025 15:56
@Powlinett Powlinett removed the do not merge Do not merge this PR until this tag will be removed label Jun 4, 2025
@Powlinett Powlinett merged commit 86078df into master Jun 4, 2025
5 checks passed
@Powlinett Powlinett deleted the feat/2933-flashpoint-add-ccm-alerts-feature branch June 4, 2025 09:22
@Powlinett Powlinett added this to the Release 6.6.15 milestone Jun 4, 2025
@labo-flg labo-flg removed this from the Release 6.6.15 milestone Jun 5, 2025
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
Development

Successfully merging this pull request may close these issues.

[FlashPoint]: Support for Compromised Credentials Monitoring (CCM)
3 participants