Skip to content

[island_browser] Add siem_event Dataset and Deprecate admin_actions and audit - #20908

Open
mohitjha-elastic wants to merge 2 commits into
elastic:mainfrom
mohitjha-elastic:island_browser-1.3.0
Open

[island_browser] Add siem_event Dataset and Deprecate admin_actions and audit#20908
mohitjha-elastic wants to merge 2 commits into
elastic:mainfrom
mohitjha-elastic:island_browser-1.3.0

Conversation

@mohitjha-elastic

Copy link
Copy Markdown
Contributor

Proposed commit message

island_browser: Add siem_event dataset and deprecate admin_actions and audit.

This adds a siem_event data stream that collects audit and admin-action events from the Island
Browser SIEM API v1. Incoming events are routed to the existing audit and admin_actions datasets 
based on source (BrowserAudit and AdminAction). The original audit and admin_actions collectors 
are marked deprecated; new deployments should use SIEM Events instead. The datasets themselves 
remain so routed events keep the same mappings, pipelines, and dashboards. 

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.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

How to test this PR locally

  • Clone integrations repo.
  • Install the elastic package locally.
  • Start the elastic stack using the elastic package.
  • Move to integrations/packages/island_browser directory.
  • Run the following command to run tests.

elastic-package test -v

Related Issues

@mohitjha-elastic mohitjha-elastic self-assigned this Aug 26, 2026
@mohitjha-elastic
mohitjha-elastic requested review from a team as code owners August 26, 2026 06:53
@mohitjha-elastic mohitjha-elastic added documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. enhancement New feature or request Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] Team:SDE-Crest Crest developers on the Security Integrations team [elastic/sit-crest-contractors] Integration:island_browser Island Browser labels Aug 26, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown
Contributor

Elastic Docs Style Checker (Vale)

Summary: 4 warnings found

⚠️ Warnings (4): Fix when the suggestion improves clarity or correctness.
File Line Rule Message
packages/island_browser/_dev/build/docs/README.md 72 Elastic.MenuArrowsBold Use '→' to separate menu items, not '' or '='. Example: Select Manage index → Add lifecycle policy.
packages/island_browser/_dev/build/docs/README.md 72 Elastic.MenuArrows Use '→' to separate menu items, not '' or '='. Example: Select Manage index → Add lifecycle policy.
packages/island_browser/_dev/build/docs/README.md 72 Elastic.MenuArrows Use '→' to separate menu items, not '' or '='. Example: Select Manage index → Add lifecycle policy.
packages/island_browser/_dev/build/docs/README.md 72 Elastic.MenuArrows Use '→' to separate menu items, not '' or '='. Example: Select Manage index → Add lifecycle policy.

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

✅ All changelog entries have the correct PR link.

}).do_request().as(post_resp,
(post_resp.StatusCode == 204 || post_resp.StatusCode == 200) ?
// Events are only emitted after a successful acknowledgment.
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: 🟠 High confidence: high path: packages/island_browser/data_stream/siem_event/agent/stream/cel.yml.hbs:85

The SIEM acknowledgement branch returns a fresh state map that omits api_key and audit_id, so after the first batch of events the agent loses its credentials and every later poll fails. Wrap the returned maps in state.with(...) so existing state keys persist.

Details

The Filebeat CEL input sets the next evaluation's state to exactly the value the program returns (minus events); only cursor survives an input restart, and state.url is re-seeded here from resource.url. Any other custom key that is not in the returned map is dropped on the next iteration (confirmed against the Filebeat input-cel docs: "the input will populate the state variable with the return value of the previous execution" and "The state.url field must be present in the returned value to ensure that it is available in the next evaluation").

The outer state.with(...) (line 26) correctly merges the GET result into state, and the idle/no-ack branch returns the full state (line 113), so those paths keep api_key/audit_id. But the two POST (acknowledgement) branches return brand-new object literals: the success branch at lines 85-92 ({ "events": ..., "page_id": null, "audits": null, "want_more": ... }) and the POST-error branch at lines 94-110. Neither includes api_key or audit_id. Because the success branch is the normal path taken whenever count != 0 (i.e., whenever events are actually collected), the very first poll that returns data corrupts the state: on the next evaluation state.audit_id is absent, so the GET URL construction ... + state.audit_id raises a no-such-key error and the Authorization: Bearer + state.api_key header can no longer be built. Collection permanently breaks after the first batch (and again one batch after any restart). The provided system test does not catch this because it only asserts that the first two documents arrive, which happens during the first evaluation before the state is lost.

Recommendation:

Return the acknowledgement branches through state.with(...) so api_key, audit_id and any other state keys are preserved (same as the outer merge and the idle path). Apply the same wrapping to the POST-error branch (lines 94-110).

      ).do_request().as(post_resp,
        (post_resp.StatusCode == 204 || post_resp.StatusCode == 200) ?
          // Events are only emitted after a successful acknowledgment.
          state.with({
            "events": state.audits.split("\n").filter(line, line != "").map(line, {
              "message": line,
            }),
            "page_id": null,
            "audits": null,
            "want_more": state.want_more,
          })
        :
          state.with({
            "events": {
              "error": {
                "code": string(post_resp.StatusCode),
                "id": string(post_resp.Status),
                "message": "POST ...",
              },
            },
            "page_id": null,
            "audits": null,
            "want_more": false,
          })
      )

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

⚠️ Automated review — verify suggestions before applying.

}
)
).as(state,
has(state.page_id) ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: 🟡 Medium confidence: medium path: packages/island_browser/data_stream/siem_event/agent/stream/cel.yml.hbs:72

has(state.page_id) is true when the empty/error branches set page_id to null (a present-but-null map key), so idle polls enter the ack POST and then run state.audits.split() on a null audits, erroring on every empty poll. Gate the POST on state.page_id != null instead.

Details

The empty-response branch (lines 43-50) and the GET-error branch (lines 53-69) set page_id and audits to null, expecting has(state.page_id) at line 72 to be false so control falls through to state at line 113. In CEL a map key that is explicitly present with a null value still satisfies has() (it tests key presence, not non-nullness), so has(state.page_id) evaluates to true on those branches. The program then takes the POST branch and evaluates state.audits.split("\n") (line 86) with state.audits == null, which has no matching overload and fails the evaluation — meaning every idle poll (count == 0) and every GET error would error instead of quietly retrying. Using an explicit non-null check makes the gate correct regardless of has()/null semantics.

Recommendation:

Gate the acknowledgement POST on an explicit non-null check (or omit page_id entirely in the empty/error branches so the key is absent):

  ).as(state,
    state.page_id != null ?
      post_request(
        state.url.trim_right("/") + "/services/siem/api/v1/Audits/" + state.audit_id,
        "application/json",
        {"pageId": state.page_id}.encode_json()
      )
      // ... unchanged ...
    :
      state
  )

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

⚠️ Automated review — verify suggestions before applying.

@vera-review-bot

Copy link
Copy Markdown

🟢 No issues across the latest commits a5c09e7.

Review summary

Issues found across earlier commits f3acafb — 1 high, 1 medium
  • 🟠 The SIEM acknowledgement branch returns a fresh state map that omits api_key and audit_id, so after the first batch of events the agent loses its credentials and every later poll fails. Wrap the returned maps in state.with(...) so existing state keys persist. (link) (Unresolved)
  • 🟡 has(state.page_id) is true when the empty/error branches set page_id to null (a present-but-null map key), so idle polls enter the ack POST and then run state.audits.split() on a null audits, erroring on every empty poll. Gate the POST on state.page_id != null instead. (link) (Unresolved)

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 - v0.2.7 | 📚 Knowledge base: integration-skills

⚠️ Automated review — verify suggestions before applying.

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

cc @mohitjha-elastic

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. enhancement New feature or request Integration:island_browser Island Browser Team:SDE-Crest Crest developers on the Security Integrations team [elastic/sit-crest-contractors] 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.

[island_browser] Migrate audit events from deprecated "timeline" endpoint to new /siem/api/v3 endpoint

1 participant