Skip to content

Add direct Microsoft Sentinel STIX publishing - #950

Open
adulau wants to merge 1 commit into
mainfrom
codex/sentinel-direct-publish
Open

adulau wants to merge 1 commit into
mainfrom
codex/sentinel-direct-publish

Conversation

@adulau

@adulau adulau commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Existing export_sentinel workflows require a local MISP2Sentinel/MISP2Defender installation and return only a boolean result. This adds native Microsoft Sentinel publishing through the STIX objects upload API, available as mode=direct in export_sentinel and as a dedicated blocking sentinel_publish action. Wrapper mode remains the default.

Direct publishing uses the public misp-stix MISPtoSTIX21Parser.parse_misp_attribute API and validates the resulting STIX 2.1 pattern. This reuses the mappings already used by the STIX pattern modules, preserves domain/IP and filename/hash conjunctions and IP/email direction, and replaces handwritten pattern paths and escaping. Only normalized type/value and to_ids=true enter the converter; only the indicator pattern is retained. Converter warnings, errors, ambiguous composites and invalid output are skipped. misp-stix is already included in the all extra; the legacy wrapper remains available without it.

The publisher processes supplied IDS-marked event and object attributes, authenticates with server-side Entra client credentials, and sends batches of up to 100 indicators to an explicit workspace. It supports credential-free dry runs, confidence, expiry, deterministic source-revision identities, provenance and TLP markings. Local-only tags are excluded from both labels and markings, including association flags. HTTP 200 indexed validation errors map to individual indicators; uncertain batch outcomes stop later uploads without automatic retries. TLS verification, redirect rejection and fixed commercial-cloud endpoints remain enforced.

Wrapper failures return a workflow error, empty parameters use existing defaults, and subprocess output is not copied to service logs. Both actions reject filtered/extracted payloads because those filters are not applied. The usage guide covers supported inputs, partial publication, API limits, optional dependencies and lifecycle behavior. Patterns changed by the converter produce new IDs; older revisions are not automatically revoked.

Validation:

  • Rebased onto main at 65b4b71b and resolved documentation conflicts while preserving the current module catalog.
  • 169 Sentinel tests passed, including converter failures, composite semantics, escaping, local-tag exclusion, optional dependency handling, STIX validation, mocked OAuth/upload contracts, batching, partial errors, workflow discovery/query endpoints and wrapper compatibility.
  • 785 related tests passed across Sentinel, SentinelOne, CrowdStrike, QRadar, Elastic, Splunk and the STIX pattern generator/export modules.
  • Black, isort, flake8 and git diff --check passed.

No live Azure workspace was used. The target API remains 2024-02-01-preview; deployment requires valid Entra credentials, workspace permissions and preview API availability.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T19:48:25.148968Z 176b25b PR opened
🔒 Security Review ✅ Completed 2026-10-18T19:50:06.122121Z 176b25b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 176b25bcfb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +142 to +147
for tag in _records(container, key):
tag = tag.get("Tag", tag)
if isinstance(tag, dict) and isinstance(tag.get("name"), str):
tag["name"].encode("utf-8")
if tag["name"]:
names.add(tag["name"])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Exclude local tags from outbound STIX objects

When an EventTag or AttributeTag record has local=true, this code unwraps the nested Tag and adds its name without checking the association flag, after which the name is sent to Azure as a STIX label or TLP marking. MISP defines local tags as instance-only and states that they are never exported or synchronized (MISP User Guide), so publishing a tagged event can disclose private routing or classification labels; filter local tag associations before aggregating names.

Useful? React with 👍 / 👎.

Use the public misp-stix converter for validated indicator patterns,
preserving composite constraints and IP/email direction. Exclude local
tag associations from exported labels and markings, and retain the
legacy wrapper when the optional converter is unavailable.
@adulau
adulau force-pushed the codex/sentinel-direct-publish branch from 176b25b to c039405 Compare November 13, 2026 08:29

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant