Skip to content

fix(urlscan): honor config labels and duration_period (#6555)#7091

Open
jabesq wants to merge 2 commits into
masterfrom
fix/6555-urlscan-config-labels
Open

fix(urlscan): honor config labels and duration_period (#6555)#7091
jabesq wants to merge 2 commits into
masterfrom
fix/6555-urlscan-config-labels

Conversation

@jabesq

@jabesq jabesq commented Jul 23, 2026

Copy link
Copy Markdown
Member

Proposed changes

  • Fixed CONNECTOR_LABELS (now URLSCAN_LABELS) being silently ignored: the connector previously hardcoded default_labels=["Phishing", "phishfeed"] in connector.py instead of reading the value from configuration. Labels are now sourced from self._config.urlscan.labels.
  • Deprecated connector.interval / CONNECTOR_INTERVAL in favor of connector.duration_period / CONNECTOR_DURATION_PERIOD, aligning this connector with the standard scheduling pattern used across other connectors, and replaced the raw-seconds interval with a proper timedelta.
  • Added a DeprecatedField for interval so existing deployments that still set CONNECTOR_INTERVAL (in seconds) keep working: the old integer value is automatically converted into a duration_period timedelta under the hood.
  • Added a default connector.id value so the connector can run out-of-the-box without requiring every deployment to generate its own UUID.
  • Regenerated __metadata__/CONNECTOR_CONFIG_DOC.md and connector_config_schema.json to reflect the new CONNECTOR_DURATION_PERIOD and URLSCAN_LABELS variables and the deprecation of CONNECTOR_INTERVAL.
  • Updated docker-compose.yml and src/config.yml.sample to use duration_period/labels and commented out optional variables to match current sample conventions.
  • Simplified README.md to link to the auto-generated CONNECTOR_CONFIG_DOC.md instead of maintaining a manual, now-outdated configuration table.

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

Further comments

The connector.interval field is kept in the settings model but marked with DeprecatedField(deprecated="Use duration_period instead", new_namespaced_var="duration_period", new_value_factory=lambda x: timedelta(seconds=x)). This means: if an operator still sets CONNECTOR_INTERVAL (in seconds, as before), it is transparently converted into a timedelta and assigned to connector.duration_period, so no breaking change occurs for existing deployments. New deployments should set CONNECTOR_DURATION_PERIOD (ISO-8601 duration, e.g. P1D) directly. The connector still manages its own scheduling loop internally (it does not delegate to the SDK's built-in scheduler), it now just reads the interval from duration_period.total_seconds() instead of a raw interval int.

Copilot AI review requested due to automatic review settings July 23, 2026 13:29
@jabesq jabesq added the filigran team Item from the Filigran team. label Jul 23, 2026
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown

🔴 Connector Linter errors detected

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 updates the external-import/urlscan connector to correctly honor configurable labels and to align its scheduling configuration with the repository’s standard connector.duration_period pattern (while keeping backward compatibility via a deprecated connector.interval).

Changes:

  • Read observable labels from configuration (urlscan.labels) instead of hardcoding defaults in connector.py.
  • Deprecate connector.interval in favor of connector.duration_period (timedelta-based), with automatic migration from legacy seconds.
  • Regenerate configuration documentation/schema and update sample deployment files/README accordingly.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
external-import/urlscan/src/urlscan/settings.py Adds urlscan.labels, introduces deprecated connector.interval migration to duration_period, and sets a default connector id.
external-import/urlscan/src/urlscan/connector.py Switches scheduling to duration_period and sources default labels from config.
external-import/urlscan/src/config.yml.sample Updates sample YAML to use duration_period and labels and aligns with current sample-comment conventions.
external-import/urlscan/README.md Simplifies config documentation by linking to the generated CONNECTOR_CONFIG_DOC.md.
external-import/urlscan/docker-compose.yml Updates sample env vars to use CONNECTOR_DURATION_PERIOD and URLSCAN_LABELS.
external-import/urlscan/metadata/connector_config_schema.json Regenerated schema reflecting CONNECTOR_DURATION_PERIOD, deprecated CONNECTOR_INTERVAL, and URLSCAN_LABELS.
external-import/urlscan/metadata/CONNECTOR_CONFIG_DOC.md Regenerated config documentation including deprecation and the new labels variable.

Comment thread external-import/urlscan/src/urlscan/connector.py
Comment thread external-import/urlscan/docker-compose.yml Outdated
Comment thread external-import/urlscan/src/config.yml.sample Outdated
Comment thread external-import/urlscan/src/urlscan/settings.py Outdated
@jabesq
jabesq force-pushed the fix/6555-urlscan-config-labels branch 2 times, most recently from 9498f53 to 0b5d054 Compare July 23, 2026 14:04
@jabesq
jabesq force-pushed the fix/6555-urlscan-config-labels branch from 0b5d054 to 48218a8 Compare July 23, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

filigran team Item from the Filigran team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(urlscan): ignores some user configs

3 participants