Skip to content

[new integration] Backstage audit logs#19408

Draft
Niceplace wants to merge 15 commits into
mainfrom
feat/28055-backstage-audit-integration
Draft

[new integration] Backstage audit logs#19408
Niceplace wants to merge 15 commits into
mainfrom
feat/28055-backstage-audit-integration

Conversation

@Niceplace

Copy link
Copy Markdown
Contributor

Still WIP, opening as draft to get early feedback

What: Ingest audit logs from backstage into elastic search.
Fixes: https://github.com/elastic/enhancements/issues/28055

Proposed commit message

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

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Screenshots

@Niceplace Niceplace added the enhancement New feature or request label Jun 5, 2026
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Elastic Docs Style Checker (Vale)

Summary: 2 suggestions found

💡 Suggestions (2): Optional style improvements. Apply when helpful.
File Line Rule Message
packages/backstage/changelog.yml 1 Elastic.Versions Use 'later versions' instead of 'newer versions' when referring to versions.
packages/backstage/data_stream/audit_logs/manifest.yml 91 Elastic.WordChoice Consider using 'can, might' instead of 'may', unless the term is in the UI.

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.

@github-actions

This comment has been minimized.

@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 Jun 5, 2026
Niceplace and others added 11 commits June 22, 2026 12:52
Replace scaffold placeholder icon/screenshot with the real Backstage
icon, remove the stray package-root sample_event.json (belongs under
the data stream instead), and correct the root manifest's Kibana
version constraint from an overly narrow pinned version to the
current package standard.
Replace the placeholder link with the real pull request URL.
…ield cleanup

- Set event.kind/category/type as proper ECS arrays via append, and
  derive event.outcome from the Backstage audit status (initiated ->
  unknown, succeeded -> success, failed -> failure).
- Guard the isAuditEvent drop check with null-safe navigation so
  events without a parsed json object are dropped cleanly instead of
  throwing.
- Map the actor's IP to the primary ECS source.ip field (in addition
  to related.ip for correlation) rather than only ever appending it
  to related.ip.
- Remove processors left over from earlier refactors that no longer
  do anything: two dead `remove` steps targeting field paths that
  never exist (json.user_agent, json.message) and a third that became
  dead once the actor IP is now consumed by a rename into source.ip.
- Add ignore_missing to renames that would otherwise throw if their
  source field is ever absent on a valid audit event.
- Split fields/agent.yml into agent.yml (Elastic Agent metadata) and
  beats.yml (Filebeat-emitted fields), matching the convention used by
  other filestream-based packages.
- Add fields/ecs.yml declaring every ECS field the pipeline sets
  (event.kind/category/type/outcome/severity/action/provider/code,
  log.level, url.*, user_agent.original, user.id, related.*,
  http.request.method, source.ip) so they resolve correctly and show
  up in the generated documentation.
- Drop backstage.plugin (superseded by event.provider) and fix the
  backstage.meta description to reference the field path the pipeline
  actually populates (backstage.query.*, not backstage.audit.query.*).
… vars

- Fix a stray leading space before prospector.scanner.symlinks that
  broke the rendered YAML for every deployment (follow.symlinked_files
  defaults to true, so this key was emitted by default).
- Correct the paths variable's default from /var/logs/*.log (plural)
  to /var/log/*.log, matching standard convention and this package's
  own docker-based system test deployment.
- Add exclude_files, parsers, and follow.symlinked_files stream vars
  so the template's corresponding Handlebars blocks are backed by
  real, documented manifest variables.
Replace real-looking hostnames, internal IPs, and identifiers in the
pipeline test log with RFC 5737 documentation IPs and example.com/
example.internal placeholders. Add test-common-config.yml so every
pipeline test fixture exercises the preserve_original_event tag,
matching the retention behavior configured in the pipeline. Regenerate
the expected pipeline output to match the current pipeline and
anonymized input.
- Correct event.module -> event.provider in the doc template's plugin
  correlation guidance, matching the field the pipeline actually
  populates.
- Fix the doc template's hardcoded paths default to /var/log/*.log.
- Remove an incomplete sentence fragment left over from an earlier
  edit.
- Regenerate data_stream/audit_logs/sample_event.json and
  docs/README.md via `elastic-package build` so the exported fields
  table and sample event reflect the current pipeline and ecs.yml.
…:elastic/integrations into feat/28055-backstage-audit-integration
@infra-vault-gh-plugin-prod

infra-vault-gh-plugin-prod Bot commented Jul 6, 2026

Copy link
Copy Markdown

💔 Build Failed

Failed CI Steps

History

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

✅ All changelog entries have the correct PR link.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

TL;DR

Check go sources failed because packages/backstage/manifest.yml now declares owner.github: elastic/integration-experience, but .github/CODEOWNERS has no /packages/backstage rule that assigns that owner. Add a dedicated CODEOWNERS entry for the new package, or change the manifest owner to the owner inherited by the existing /packages/ rule.

Remediation

  • Add /packages/backstage @elastic/integration-experience`` to .github/CODEOWNERS in the sorted package-owner section, or set `packages/backstage/manifest.yml` `owner.github` to an owner already resolved for `packages/backstage`.
  • Re-run .buildkite/scripts/check_sources.sh after the ownership metadata is updated.
Investigation details

Root Cause

The CODEOWNERS validator resolves owners for each package manifest path and requires one resolved CODEOWNER to exactly equal @ + owner.github from that package's manifest. The current PR manifest sets packages/backstage/manifest.yml:30 to elastic/integration-experience, but the PR's .github/CODEOWNERS has no /packages/backstage entry. Without a package-specific rule, packages/backstage inherits the default /packages/ owner from .github/CODEOWNERS:5, which is @elastic/integrations-triaging, so the exact match fails.

Relevant validator logic: dev/codeowners/codeowners.go:209-217 compares each resolved owner to @ + manifest.Owner.Github and emits this error when none match.

Evidence

  • Build: https://buildkite.com/elastic/integrations/builds/45499
  • Job/step: :white_check_mark: Check go sources
  • Key log excerpt: error checking manifest 'packages/backstage': owner "elastic/integration-experience" defined in "packages/backstage/manifest.yml" is not in ".github/CODEOWNERS"

Verification

  • Not run locally; the investigation used the Buildkite log, PR file contents, CODEOWNERS, and the repository validator source.

What is this? | From workflow: PR Buildkite Detective

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

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 New Integration Issue or pull request for creating a new integration package.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants