Skip to content

[stormshield] Add outcome, identity and HTTP mappings and extend the metadata allow-list - #20085

Closed
arenard wants to merge 1 commit into
elastic:mainfrom
arenard:stormshield-sns-enrichment
Closed

arenard wants to merge 1 commit into
elastic:mainfrom
arenard:stormshield-sns-enrichment

Conversation

@arenard

@arenard arenard commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Proposed commit message

Derive event.outcome on the auth, server and xvpn families from the vendor error return code (0 maps to success, other codes to failure). The official field documentation lists exactly these three families for error; on vpn logs the same key is a severity level and is left untouched. The vendor documentation pairs 0-first numeric examples with Success-first display labels without stating the convention outright, so the mapping follows the strong implication of the field tables.

Map domain to user.domain and usergroup to user.group.name, splitting the comma-separated multi-valued form that SNS 5.x emits. On web logs, map op to http.request.method and result to http.response.status_code; on other families these keys carry protocol-specific codes (FTP, Modbus) and are not promoted. Map the module name in service to process.name on the system, sandboxing and routing families only; on pvm logs the same key names the vulnerable product detected on a scanned host. Set observer.product. All mappings are copies; the vendor keys remain available under stormshield.metadata.

Extend the stormshield.metadata allow-list with the documented vendor keys that previously leaked as undeclared stormshield.* fields: host and IP reputation (srchostrep, dsthostrep, srciprep, dstiprep), alarm packet captures (pktlen, pktdump, pktdumplen), Ethernet protocol (etherproto), SSO agent (agentid), IKE peer name (peername), and the industrial-protocol plugin fields (unitid/unit_id, cipservicecode, cipclassid, requestmode, responsemode, UI, error_class, error_code, format).

The NAT reading of the pipeline was verified against the official field tables while preparing this change: origdst/origdstport are documented as the destination before translation and map to destination.ip/destination.port; dst is the translated destination and maps to destination.nat.ip when it differs. A connection sample with the documented example values now locks this in the pipeline tests, alongside new samples for the alarm reputation and packet-capture fields, a Modbus plugin line (whose result stays under metadata and does not produce http.*), a server line, a system line, and multi- and single-valued usergroup forms.

Design notes

  • Field semantics all come from the official "Description of Audit logs" guides (v3, v4 and v5 field tables were cross-checked; the v4/v5 Affected logs lists drive the family guards). The alarm class sub-categorization was deliberately left out: the documentation gives example values without an exhaustive list or definitions.
  • event.outcome is only set where the log reports a return code, never inferred from message text.
  • Like the 1.6.0 changes, everything is additive: no stormshield.* field changes location or type, so existing dashboards and saved queries are unaffected.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

Author's Checklist

  • elastic-package check, test pipeline, test static and test system pass against stack 9.4.3
  • New pipeline test samples are synthesized from the field example values published in the official audit-log documentation, with addresses in RFC 1918/5737 ranges
  • The promotions are guarded by log family wherever the vendor documents family-dependent semantics (result, service, error)

How to test this PR locally

cd packages/stormshield
elastic-package check
elastic-package test pipeline
elastic-package stack up -d
elastic-package test system

Related issues

@arenard
arenard force-pushed the stormshield-sns-enrichment branch from d7aa3c0 to 44bf0a4 Compare July 10, 2026 13:06
@github-actions

Copy link
Copy Markdown
Contributor

✅ Elastic Docs Style Checker (Vale)

No issues found on modified lines!


The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale.

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@andrewkroh andrewkroh added documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. Integration:stormshield StormShield SNS dashboard Relates to a Kibana dashboard bug, enhancement, or modification. labels Jul 10, 2026
@arenard
arenard marked this pull request as ready for review July 10, 2026 16:29
@arenard
arenard requested a review from a team as a code owner July 10, 2026 16:29
@andrewkroh andrewkroh added the Team:Integration-Experience Security Integrations Integration Experience [elastic/integration-experience] label Jul 10, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/integration-experience (Team:Integration-Experience)

Comment thread packages/stormshield/changelog.yml Resolved
Comment thread packages/stormshield/changelog.yml Resolved
Comment thread packages/stormshield/changelog.yml Resolved
Comment thread packages/stormshield/changelog.yml Resolved
Comment thread packages/stormshield/changelog.yml Resolved
Comment thread packages/stormshield/changelog.yml Resolved
Comment thread packages/stormshield/changelog.yml Resolved
@arenard
arenard force-pushed the stormshield-sns-enrichment branch from 44bf0a4 to 8dc4174 Compare July 10, 2026 21:17
Comment thread packages/stormshield/changelog.yml Resolved
Comment thread packages/stormshield/changelog.yml Resolved
Comment thread packages/stormshield/changelog.yml Resolved
Comment thread packages/stormshield/changelog.yml Resolved
Comment thread packages/stormshield/changelog.yml Resolved
Comment thread packages/stormshield/changelog.yml Resolved
Comment thread packages/stormshield/changelog.yml Resolved
@taylor-swanson

Copy link
Copy Markdown
Contributor

#20030 has been merged, could you rebase?

@arenard
arenard force-pushed the stormshield-sns-enrichment branch from 8dc4174 to 1bff832 Compare July 14, 2026 14:13
@arenard

arenard commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks @taylor-swanson. Rebased on main following the #20030 and #20031 merge, #20085 and #20088 draft were re-stacked accordingly.

@arenard
arenard force-pushed the stormshield-sns-enrichment branch from 1bff832 to f99deb3 Compare July 14, 2026 14:30
Comment thread packages/stormshield/changelog.yml Resolved
Comment thread packages/stormshield/changelog.yml Resolved
Comment thread packages/stormshield/changelog.yml Resolved
Comment thread packages/stormshield/changelog.yml Resolved
Comment thread packages/stormshield/changelog.yml Resolved
Comment thread packages/stormshield/changelog.yml Resolved
Comment thread packages/stormshield/changelog.yml Resolved
Comment thread packages/stormshield/changelog.yml Resolved
Comment thread packages/stormshield/changelog.yml Resolved
Comment thread packages/stormshield/changelog.yml Resolved
@vera-review-bot

Copy link
Copy Markdown
Contributor

Review summary

Issues found across the latest commits 7109bf4…f99deb3 (3 commits) — 5 medium
  • 🟡 Changelog links a different PR number (link) (Unresolved)
  • 🟡 Changelog links a different PR number (link) (Unresolved)
  • 🟡 Changelog links a different PR number (link) (Unresolved)
  • 🟡 Changelog links a different PR number (link) (Unresolved)
  • 🟡 Changelog links a different PR number (link) (Unresolved)
Issues found across earlier commits 3ccf9e6…1bff832 (28 commits) — 5 medium
  • 🟡 Changelog links a different PR number (link) (Resolved)
  • 🟡 Changelog links a different PR number (link) (Resolved)
  • 🟡 Changelog links a different PR number (link) (Resolved)
  • 🟡 Changelog links a different PR number (link) (Resolved)
  • 🟡 Changelog links a different PR number (link) (Unresolved)
Issues found across earlier commits 4ce4236, 8dc4174 — 7 medium
  • 🟡 Changelog links a different PR number (link) (Resolved)
  • 🟡 Changelog links a different PR number (link) (Resolved)
  • 🟡 Changelog links a different PR number (link) (Resolved)
  • 🟡 Changelog links a different PR number (link) (Resolved)
  • 🟡 Changelog links a different PR number (link) (Resolved)
  • 🟡 Changelog links a different PR number (link) (Resolved)
  • 🟡 Changelog links a different PR number (link) (Resolved)
Issues found across earlier commits 44bf0a4 — 7 medium, 1 low
  • 🔵 The categorization table lists event.category network for dmrouting/routing, but the pipeline sets network, host (link) (Unresolved)
  • 🟡 Changelog links a different PR number (link) (Resolved)
  • 🟡 Changelog links a different PR number (link) (Resolved)
  • 🟡 Changelog links a different PR number (link) (Resolved)
  • 🟡 Changelog links a different PR number (link) (Resolved)
  • 🟡 Changelog links a different PR number (link) (Resolved)
  • 🟡 Changelog links a different PR number (link) (Resolved)
  • 🟡 Changelog links a different PR number (link) (Resolved)

A new commit triggers another review — at most once every 15 minutes. I skip the PR while it's approved or has merge conflicts.

🤖 AI-Generated Review | Vera Review Bot | 📚 Knowledge base: integration-skills

⚠️ Automated review — verify suggestions before applying.

@arenard
arenard force-pushed the stormshield-sns-enrichment branch 2 times, most recently from 7f67a83 to 4ed0f60 Compare July 17, 2026 15:38
…metadata allow-list

Derive `event.outcome` on the auth, server and xvpn families from the vendor `error` return code (`0` maps to success, other codes to failure). The official field documentation lists exactly these three families for `error`; on vpn logs the same key is a severity level and is left untouched. The vendor documentation pairs `0`-first numeric examples with `Success`-first display labels without stating the convention outright, so the mapping follows the strong implication of the field tables.

Map `domain` to `user.domain` and `usergroup` to `user.group.name`, splitting the comma-separated multi-valued form that SNS 5.x emits. On web logs, map `op` to `http.request.method` and `result` to `http.response.status_code`; on other families these keys carry protocol-specific codes (FTP, Modbus) and are not promoted. Map the module name in `service` to `process.name` on the system, sandboxing and routing families only — on pvm logs the same key names the vulnerable product detected on a scanned host. Set `observer.product`. All mappings are copies; the vendor keys remain available under `stormshield.metadata`.

Extend the `stormshield.metadata` allow-list with the documented vendor keys that previously leaked as undeclared `stormshield.*` fields: host and IP reputation (`srchostrep`, `dsthostrep`, `srciprep`, `dstiprep`), alarm packet captures (`pktlen`, `pktdump`, `pktdumplen`), Ethernet protocol (`etherproto`), SSO agent (`agentid`), IKE peer name (`peername`), and the industrial-protocol plugin fields (`unitid`/`unit_id`, `cipservicecode`, `cipclassid`, `requestmode`, `responsemode`, `UI`, `error_class`, `error_code`, `format`).

The NAT reading of the pipeline was verified against the official field tables while preparing this change: `origdst`/`origdstport` are documented as the destination before translation and map to `destination.ip`/`destination.port`; `dst` is the translated destination and maps to `destination.nat.ip` when it differs. A connection sample with the documented example values now locks this in the pipeline tests, alongside new samples for the alarm reputation and packet-capture fields, a Modbus plugin line (whose `result` stays under metadata and does not produce `http.*`), a server line, a system line, and multi- and single-valued `usergroup` forms.
@arenard
arenard force-pushed the stormshield-sns-enrichment branch from 78bfed9 to cb25778 Compare July 20, 2026 08:03
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

✅ All changelog entries have the correct PR link.

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@vera-review-bot

Copy link
Copy Markdown
Contributor

⚠️ @arenard I couldn't complete the review for commits 2807630…cb25778 (21 commits) after several attempts. A maintainer can re-run it with @vera-review-bot review.

@andrewkroh andrewkroh removed the dashboard Relates to a Kibana dashboard bug, enhancement, or modification. label Jul 20, 2026

@taylor-swanson taylor-swanson 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.

A few minor comments, otherwise it's looking good to me.

Comment on lines +563 to +564
ignore_empty_value: true
if: ctx.stormshield?.domain != null

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.

These two lines do the same thing (the if statement and ignore_empty_value), so only one of them is needed.

I don't have a strong preference on which one to keep. ignore_empty_value shows the intent better than an if statement, but the if statement tends to be more performant.

Comment on lines +569 to +570
ignore_empty_value: true
if: ctx.stormshield?.usergroup != null

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.

These two lines do the same thing, so only one of them is needed.

Comment on lines +584 to +585
ignore_empty_value: true
if: ctx.stormshield?.service != null && ['system', 'sandboxing', 'routing'].contains(ctx.stormshield.logtype)

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.

In this case, we can get rid of ignore_empty_value: true, since the if statement already does this (and does an additional check).

Suggested change
ignore_empty_value: true
if: ctx.stormshield?.service != null && ['system', 'sandboxing', 'routing'].contains(ctx.stormshield.logtype)
if: ctx.stormshield?.service != null && ['system', 'sandboxing', 'routing'].contains(ctx.stormshield.logtype)

@botelastic

botelastic Bot commented Aug 19, 2026

Copy link
Copy Markdown

Hi! We just realized that we haven't looked into this PR in a while. We're sorry! We're labeling this issue as Stale to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1. Thank you for your contribution!

@botelastic botelastic Bot added the Stalled label Aug 19, 2026
@vera-review-bot

Copy link
Copy Markdown
Contributor

@arenard - This PR has merge conflicts with the base branch. Please resolve them.

@botelastic

botelastic Bot commented Sep 18, 2026

Copy link
Copy Markdown

Hi! This PR has been stale for a while and we're going to close it as part of our cleanup procedure. We appreciate your contribution and would like to apologize if we have not been able to review it, due to the current heavy load of the team. Feel free to re-open this PR if you think it should stay open and is worth rebasing. Thank you for your contribution!

@botelastic botelastic Bot closed this Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. Integration:stormshield StormShield SNS Stalled Team:Integration-Experience Security Integrations Integration Experience [elastic/integration-experience]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants