Skip to content

Conversation

@fspms
Copy link

@fspms fspms commented Sep 23, 2025

README.md

  • Complete setup instructions
  • Configuration parameters
  • Data collection details
  • ECS field mapping reference

Changelog

  • Version 1.0.0 with initial features
  • OAuth2 authentication support
  • ECS field mapping implementation

Configuration

Required Parameters

  • url: WithSecure Elements API URL
  • client_id: OAuth2 Client ID
  • client_secret: OAuth2 Client Secret
  • organization_id: Organization identifier

Optional Parameters

  • interval: Collection frequency (default: 5m)
  • preserve_original_event: Keep raw event data
  • preserve_duplicate_custom_fields: Keep WithSecure fields

Use Cases

Security Operations

  • Threat Detection: Monitor BCDs and security events
  • Incident Response: Analyze incident details and detections
  • Compliance: Track security actions and events

Analytics & Dashboards

  • Security Metrics: Risk scores, severity distributions
  • Trend Analysis: Security event patterns over time
  • Device Monitoring: Endpoint security status

Deployment

Prerequisites

  • WithSecure Elements API access
  • OAuth2 credentials
  • Organization ID
  • Elastic Agent 8.18.0+ or 9.0.0+

Installation

  1. Add integration to Elastic Agent
  2. Configure OAuth2 credentials
  3. Set organization ID
  4. Enable desired data streams
  5. Deploy and monitor

Checklist

  • Code Quality: Linting passed, no errors
  • Documentation: Complete README and changelog
  • Testing: All pipelines tested with sample data
  • ECS Compliance: Full field mapping implementation
  • Security: OAuth2 authentication implemented
  • Performance: Optimized for production use

Review Notes

Key Files to Review

  • manifest.yml - Main integration configuration
  • data_stream/*/agent/stream/httpjson.yml.hbs - API templates
  • data_stream/*/elasticsearch/ingest_pipeline/default.yml - Data processing
  • data_stream/*/fields/*.yml - Field definitions

Testing

  • All test files are in _dev/test/pipeline/
  • Sample data reflects real WithSecure API responses
  • Expected outputs validate ECS mapping

Screenshots

Capture d'écran 2025-10-25 095907 Capture d'écran 2025-10-25 100647 Capture d'écran 2025-10-25 101929

Ready for Production

This integration is production-ready and follows all Elastic integration standards. It provides comprehensive WithSecure Elements data collection with full ECS compliance and robust error handling.

Perfect for security teams looking to integrate WithSecure Elements data into their Elastic SIEM!

@fspms fspms requested a review from a team as a code owner September 23, 2025 19:08
@cla-checker-service
Copy link

cla-checker-service bot commented Sep 23, 2025

💚 CLA has been signed

@fspms
Copy link
Author

fspms commented Sep 23, 2025

I have signed the Contributor Agreement as requested.
Please let me know if any additional steps are required to proceed with the review process.

@andrewkroh andrewkroh added New Integration Issue or pull request for creating a new integration package. documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. labels Sep 23, 2025
@fspms fspms changed the title Added the WithSecure Elements integration for collecting security incident and events [WithSecure] Added the WithSecure Elements integration for collecting security incident and events Sep 30, 2025
fspms and others added 5 commits October 17, 2025 21:27
- Fix API request limits (200 -> 50) for incidents and incident_detections
- Fix security_events collection by switching from POST to GET method
- Add cursor-based deduplication for incidents (updatedTimestampStart)
- Add cursor-based deduplication for security_events (persistenceTimestampStart)
- Add pagination support with nextAnchor for all data streams
- Fix pagination errors with conditional nextAnchor check
- Add all engine groups (epp, edr, ecp, xm) to security_events
- Increase initial lookback to 30 days for security_events
- Simplify security_events ingest pipeline with error handling
- Add enable_request_tracer option for debugging
- Disable incident_detections by default (requires incident_id)
- Add archived=false filter to incidents data stream
…eams (v1.0.3)

This release fixes critical issues with field extraction in both security_events
and incidents data streams, and adjusts the initial data collection window.

Major fixes:
- Fixed security_events ingest pipeline to properly decode JSON from message field
- Fixed incidents ingest pipeline to properly decode JSON from message field
- Resolved issue where message field contained entire JSON instead of individual fields
- All event fields are now properly extracted and mapped to withsecure namespace

Security Events improvements:
- Added JSON decoding processor to extract fields from event.original
- Proper extraction of id, action, severity, engine, details, device, organization
- Added event_transaction_id field mapping
- Added timestamp fields: server_timestamp, persistence_timestamp, client_timestamp
- Changed initial lookback window from 30 days to 7 days

Incidents improvements:
- Added JSON decoding processor to extract fields from event.original
- Proper extraction of incidentId, status, severity, categories, sources, etc.
- Added withsecure.incident.id field mapping
- Changed initial lookback window from 24 hours to 7 days

Technical details:
- Pipeline now copies message to event.original when preserve_original_event is enabled
- JSON is decoded and fields are extracted to root context using Painless script
- Temporary fields are cleaned up after extraction
- Both data streams now have consistent 7-day initial collection period

Version: 1.0.3
@fspms
Copy link
Author

fspms commented Oct 25, 2025

Hi @andrewkroh, could you please take a look on this integration ?
Thank you

@andrewkroh andrewkroh requested a review from a team October 28, 2025 13:58
@andrewkroh andrewkroh added the Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] label Oct 28, 2025
@elasticmachine
Copy link

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

Copy link
Contributor

Choose a reason for hiding this comment

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

This is not a valid configuration. The documentation for this file is here.

Copy link
Author

Choose a reason for hiding this comment

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

I've fixed the test configuration in commit 9429cc3.

Changes made:

  • Simplified test-common-config.yml to minimal valid configuration
  • Converted all test input files to proper array format with events structure
  • Added corresponding -expected.json files with expected array structure
  • All test files now comply with elastic-package validation requirements

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest making this an array of events as described here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest using the CEL input instead of HTTP JSON.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for the suggestion

You're absolutely right that CEL is the better choice for new integrations. I initially went with httpjson because I was more familiar with it, but I understand that CEL is now the recommended approach and offers several advantages

I suggest doing the initial integration with httpjson and planning a migration to CEL in a future version. It is a significant amount of work.
Would that work for you?

Could you point me to good reference integrations that use CEL with OAuth2 and pagination that I could learn from?

Copy link
Contributor

Choose a reason for hiding this comment

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

The ingest pipeline will need improved error handling. Please take a look at some examples of ingest pipelines elsewhere in the repository. This document is also worth reading.

Copy link
Author

Choose a reason for hiding this comment

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

I've significantly improved the ingest pipelines in commit 94b30b7.

Enhancements made for all data streams (incidents, security_events, incident_detections):

  1. JSON Decoding:

    • Decode JSON from message field or event.original
    • Use intermediate _temp field to avoid conflicts
    • Proper ignore_failure: true flags
  2. Processor Tags & Descriptions:

    • Added unique tags (json_decode, move_json_fields, set_timestamp)
    • Descriptive comments for debugging
  3. Error Handling (on_failure block):

    on_failure:
      - set:
          field: event.kind
          value: pipeline_error
      - append:
          field: error.message
          value: 'Processor {{{_ingest.on_failure_processor_type}}} with tag {{{_ingest.on_failure_processor_tag}}} in pipeline {{{_ingest.on_failure_pipeline}}} failed with message: {{{_ingest.on_failure_message}}}'
    

fspms and others added 5 commits October 30, 2025 12:26
Simplified changelog as requested in review feedback from @efd6. Changed to single version 0.1.0 with description 'Initial release.' and link to PR elastic#15442.
Fixed test configuration files to comply with elastic-package validation. Converted test files to proper format with 'events' and 'expected' structure. Simplified test-common-config.yml to minimal valid configuration.

Addresses review comment from @efd6 about invalid test configuration.
Enhanced all ingest pipelines with JSON decoding from message field, proper on_failure handler setting event.kind=pipeline_error, tags and descriptions on processors, conditional field checks, and fixed @timestamp for incidents to use createdTimestamp instead of ingestion time.

Addresses review comment from @efd6 about improved error handling.
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. New Integration Issue or pull request for creating a new integration package. Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants