Skip to content

gcp: remove never-successful violation field renames #13777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 21, 2025

Conversation

efd6
Copy link
Contributor

@efd6 efd6 commented May 4, 2025

Proposed commit message

The rename refers to fields that do not exist in the type, and appears to
have been incorrectly added to the block handling PolicyViolationInfo.

The alternative would have been to add the following, but we already
document the current behaviour, so leaving this as is as unfortunate.

  - foreach:
      field: gcp.audit.policy_violation_info.violations
      ignore_missing: true
      ignore_failure: true
      processor:
        rename:
          field: _ingest._value.errorMessage
          target_field: _ingest._value.error_message
      if: ctx.gcp?.audit?.policy_violation_info?.violations instanceof List
  - foreach:
      field: gcp.audit.policy_violation_info.violations
      ignore_missing: true
      ignore_failure: true
      processor:
        rename:
          field: _ingest._value.checkedValue
          target_field: _ingest._value.checked_value
      if: ctx.gcp?.audit?.policy_violation_info?.violations instanceof List
  - foreach:
      field: gcp.audit.policy_violation_info.violations
      ignore_missing: true
      ignore_failure: true
      processor:
        rename:
          field: _ingest._value.policyType
          target_field: _ingest._value.policy_type
      if: ctx.gcp?.audit?.policy_violation_info?.violations instanceof List

[1]https://cloud.google.com/logging/docs/reference/audit/auditlog/rest/Shared.Types/AuditLog#ViolationInfo

Thanks to @ishleenk17 for identifying this.

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

@efd6 efd6 added Integration:gcp Google Cloud Platform bugfix Pull request that fixes a bug issue Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] labels May 4, 2025
@efd6 efd6 self-assigned this May 4, 2025
@efd6 efd6 force-pushed the gcp_audit_renames branch from 7ab7e6c to 2050049 Compare May 4, 2025 21:45
@elastic-vault-github-plugin-prod

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@efd6 efd6 marked this pull request as ready for review May 4, 2025 22:11
@efd6 efd6 requested review from a team as code owners May 4, 2025 22:11
@elasticmachine
Copy link

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

Copy link
Contributor

@chrisberkhout chrisberkhout left a comment

Choose a reason for hiding this comment

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

Not renames absent fields seems fine.

Not adding renames to change the case of actual fields seems fine since they're already provided and documented in the current form.

efd6 added 2 commits May 22, 2025 06:44
The rename refers to fields that do not exist in the type, and appears to
have been incorrectly added to the block handling PolicyViolationInfo.

The alternative would have been to add the following, but we already
document the current behaviour, so leaving this as is as unfortunate.

  - foreach:
      field: gcp.audit.policy_violation_info.violations
      ignore_missing: true
      ignore_failure: true
      processor:
        rename:
          field: _ingest._value.errorMessage
          target_field: _ingest._value.error_message
      if: ctx.gcp?.audit?.policy_violation_info?.violations instanceof List
  - foreach:
      field: gcp.audit.policy_violation_info.violations
      ignore_missing: true
      ignore_failure: true
      processor:
        rename:
          field: _ingest._value.checkedValue
          target_field: _ingest._value.checked_value
      if: ctx.gcp?.audit?.policy_violation_info?.violations instanceof List
  - foreach:
      field: gcp.audit.policy_violation_info.violations
      ignore_missing: true
      ignore_failure: true
      processor:
        rename:
          field: _ingest._value.policyType
          target_field: _ingest._value.policy_type
      if: ctx.gcp?.audit?.policy_violation_info?.violations instanceof List

[1]https://cloud.google.com/logging/docs/reference/audit/auditlog/rest/Shared.Types/AuditLog#ViolationInfo
@efd6 efd6 force-pushed the gcp_audit_renames branch from 2050049 to 3d74c6f Compare May 21, 2025 21:15
@efd6 efd6 enabled auto-merge (squash) May 21, 2025 21:15
@elasticmachine
Copy link

💚 Build Succeeded

History

cc @efd6

@efd6 efd6 merged commit 739cf21 into elastic:main May 21, 2025
6 checks passed
Copy link

@elastic-vault-github-plugin-prod

Package gcp - 2.42.1 containing this change is available at https://epr.elastic.co/package/gcp/2.42.1/

anupratharamachandran pushed a commit to anupratharamachandran/integrations that referenced this pull request Jun 2, 2025
The rename refers to fields that do not exist in the type, and appears to
have been incorrectly added to the block handling PolicyViolationInfo.

The alternative would have been to add the following, but we already
document the current behaviour, so leaving this as is as unfortunate.

  - foreach:
      field: gcp.audit.policy_violation_info.violations
      ignore_missing: true
      ignore_failure: true
      processor:
        rename:
          field: _ingest._value.errorMessage
          target_field: _ingest._value.error_message
      if: ctx.gcp?.audit?.policy_violation_info?.violations instanceof List
  - foreach:
      field: gcp.audit.policy_violation_info.violations
      ignore_missing: true
      ignore_failure: true
      processor:
        rename:
          field: _ingest._value.checkedValue
          target_field: _ingest._value.checked_value
      if: ctx.gcp?.audit?.policy_violation_info?.violations instanceof List
  - foreach:
      field: gcp.audit.policy_violation_info.violations
      ignore_missing: true
      ignore_failure: true
      processor:
        rename:
          field: _ingest._value.policyType
          target_field: _ingest._value.policy_type
      if: ctx.gcp?.audit?.policy_violation_info?.violations instanceof List

[1]https://cloud.google.com/logging/docs/reference/audit/auditlog/rest/Shared.Types/AuditLog#ViolationInfo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Pull request that fixes a bug issue Integration:gcp Google Cloud Platform 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.

3 participants