Skip to content

fix(intel471_v2): catch UnauthorizedException for unentitled report streams (#6778)#6786

Open
muhamedfazalps wants to merge 2 commits into
OpenCTI-Platform:masterfrom
muhamedfazalps:fix/intel471-v2-handle-unauthorized-exception
Open

fix(intel471_v2): catch UnauthorizedException for unentitled report streams (#6778)#6786
muhamedfazalps wants to merge 2 commits into
OpenCTI-Platform:masterfrom
muhamedfazalps:fix/intel471-v2-handle-unauthorized-exception

Conversation

@muhamedfazalps

Copy link
Copy Markdown

Problem

With the verity471 backend and reports enabled, a report-type stream whose account lacks entitlement to that type logs a full ERROR stack trace every interval.

Fix

  • Catch UnauthorizedException in the streams main loop
  • Log a warning instead of letting it propagate
  • Added unauthorized_exception field to ClientWrapper

Fixes #6778


If this helps, consider buying me a coffee! https://buymeacoffee.com/muhamedfazalps

…treams

When a verity471 account lacks entitlement to a report type (e.g.
geopol_report), the API returns a 401 UnauthorizedException that
was not caught, causing an ERROR traceback every interval.

Now catches the exception in the stream's main loop and logs a
warning instead, allowing other report types to continue working.

Fixes OpenCTI-Platform#6778
Copilot AI review requested due to automatic review settings June 20, 2026 16:54
@filigran-cla-bot

Copy link
Copy Markdown

Contributor License Agreement

Hey @muhamedfazalps!

Thank you for your contribution to Filigran! Before we can merge this pull request, we need you to sign our Contributor License Agreement (CLA).

Why do we need a CLA?

The CLA helps protect both you and Filigran. It ensures that:

  • You have the right to make this contribution
  • Filigran can use and distribute your contribution
  • Your contribution remains open source

How to sign

You can sign the CLA using either of these methods:

  1. 🔗 Sign directlyClick here to review and sign the CLA
  2. 📧 Via email — Check your inbox (and spam folder) for a signing invitation from Concord

Once signed, this comment will be automatically updated.


CLA not signed yet

This is an automated message from the Filigran CLA Bot. If you have questions, please contact the maintainers.

@filigran-cla-bot filigran-cla-bot Bot added the cla:pending CLA signature required. label Jun 20, 2026
@Filigran-Automation Filigran-Automation added the community Contribution from the community. label Jun 20, 2026
@Filigran-Automation Filigran-Automation changed the title fix(intel471_v2): catch UnauthorizedException for unentitled report streams fix(intel471_v2): catch UnauthorizedException for unentitled report streams (#6778) Jun 20, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses noisy recurring ERROR tracebacks in the intel471_v2 connector when using the verity471 backend and running a report stream that the configured account is not entitled to access. It introduces a backend-specific Unauthorized exception type into the client wrapper and handles it in the stream polling loop by logging a warning instead of letting the exception propagate.

Changes:

  • Catch backend-specific unauthorized exceptions in the stream polling loop and log a warning.
  • Extend ClientWrapper to expose an unauthorized_exception type per backend (with a no-op dummy for backends without entitlement checks).
  • Add a local dummy exception type for “no unauthorized exception” backends.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
external-import/intel471_v2/src/intel471/streams/core/base.py Catches unauthorized errors during API polling and logs a warning instead of raising.
external-import/intel471_v2/src/intel471/exceptions.py Adds a dummy exception type for backends without entitlement checks.
external-import/intel471_v2/src/intel471/backend.py Adds unauthorized_exception to ClientWrapper and populates it per backend.

Comment on lines +98 to +102
except self.client_wrapper.unauthorized_exception:
self.helper.log_warning(
f"{self.__class__.__name__} is not entitled to {self.label} on "
f"{self.client_wrapper.backend_name}. Skipping."
)
@maximerafaillac maximerafaillac added partner used to identify PR from patner and removed community Contribution from the community. labels Jun 22, 2026
…rvals

Address Copilot review feedback: the previous fix logged the same
warning every scheduled interval for an unentitled stream because
nothing prevented the next run from retrying the API call.

Add a per-instance _unauthorized flag that:
- Is set to True on the first UnauthorizedException
- Short-circuits get_bundles() on subsequent runs (early return)
- Produces exactly one warning per stream lifetime instead of one
  per interval
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla:pending CLA signature required. partner used to identify PR from patner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(intel471_v2): Unentitled report type logs a recurring ERROR traceback

5 participants