Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

neu7ron2
Copy link
Contributor

@neu7ron2 neu7ron2 commented Jan 4, 2025

  • Enhancement

Proposed commit message

Added the data type for the 'audit-violation' field as type TEXT in the Kubernetes Audit logs ingest mapping. This will allow users to search for and do alerts on this field. In Kubernetes, this field is generated in the audit logs when a user tries to deploy a deployment/pod into a namespace that has security restrictions applied to it. Alerts for this sort of violation are important.

Kubernetes documentation regarding the audit logs annotation pod-security.kubernetes.io/audit-violations: https://kubernetes.io/docs/reference/labels-annotations-taints/audit-annotations/#pod-security-kubernetes-io-audit-violations

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.
  • [>=8.16.0 ] I have verified that Kibana version constraints are current according to guidelines.
  • [n/a ] I have verified that any added dashboard complies with Kibana's Dashboard good practices

Author's Checklist

  • [ ]

How to test this PR locally

Add a Kubernetes Pod Security standard of type audit=restricted to the namespace. Try to deploy a pod or deployment and a new field will be generated in the Kubernetes Audit log file which will be picked up by elastic and ingested with the correct datatype.

Related issues

Screenshots

@neu7ron2 neu7ron2 requested a review from a team as a code owner January 4, 2025 07:39
Copy link

cla-checker-service bot commented Jan 4, 2025

💚 CLA has been signed

@andrewkroh andrewkroh added Integration:kubernetes Kubernetes needs CLA User must sign the Elastic Contributor License before review. Team:Cloudnative-Monitoring Cloud Native Monitoring team [elastic/obs-cloudnative-monitoring] labels Jan 4, 2025
@MichaelKatsoulis
Copy link
Contributor

MichaelKatsoulis commented Jan 7, 2025

hey @neu7ron2 . Can you sign a CLA ?

Also as part of your PR, you should update the manifest.yml

and the changelog.yml

You can set the version of the kubernetes integration to 1.68.2

@andrewkroh andrewkroh added enhancement New feature or request and removed needs CLA User must sign the Elastic Contributor License before review. labels Jan 8, 2025
@neu7ron2
Copy link
Contributor Author

neu7ron2 commented Jan 8, 2025

HI @MichaelKatsoulis, the CLA has been signed (not sure why it didn't pick it up previously). I've updated the Manifest and changelog.
Thanks

@MichaelKatsoulis
Copy link
Contributor

@tetianakravchenko could you also take a look at this PR ?

Copy link
Contributor

@tetianakravchenko tetianakravchenko Jan 8, 2025

Choose a reason for hiding this comment

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

Suggested change
- version: 1.68.2
- version: 1.69.0

since it is an enhancement (not a bugfix), it should be 1.69.0
otherwise PR looks good to me, I've also added a doc link regarding well-known annotations https://kubernetes.io/docs/reference/labels-annotations-taints/audit-annotations/#pod-security-kubernetes-io-audit-violations to description

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated the manifest.yaml and the changelog.yaml to version 1.69.0

@tetianakravchenko
Copy link
Contributor

/test

@elastic-vault-github-plugin-prod

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@elasticmachine
Copy link

💚 Build Succeeded

Copy link

@tetianakravchenko tetianakravchenko merged commit 6c8fd62 into elastic:main Jan 9, 2025
5 checks passed
@elastic-vault-github-plugin-prod

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

harnish-crest-data pushed a commit to chavdaharnish/integrations that referenced this pull request Feb 4, 2025
…rity_kubernetes_io/audit-violation (elastic#12227)

* Added a table entry for: kubernetes.audit.annotations.pod-security_kubernetes_io/audit-violations

Added an table entry for the new kubernetes.audit.annotations.pod-security_kubernetes_io/audit-violations

* Added the data type for field pod-security_kubernetes_io/audit-violations

Added the data type for field pod-security_kubernetes_io/audit-violations.
This is defined in the offical kubernetes documentation here: https://kubernetes.io/docs/reference/labels-annotations-taints/audit-annotations/#pod-security-kubernetes-io-enforce-policy

* Updated version to 1.68.2

* Update changelog.yml

* Update packages/kubernetes/manifest.yml

Co-authored-by: Tetiana Kravchenko <[email protected]>

* Update change number to 1.69.0

* Update version to 1.69.0

---------

Co-authored-by: Tetiana Kravchenko <[email protected]>
harnish-crest-data pushed a commit to chavdaharnish/integrations that referenced this pull request Feb 5, 2025
…rity_kubernetes_io/audit-violation (elastic#12227)

* Added a table entry for: kubernetes.audit.annotations.pod-security_kubernetes_io/audit-violations

Added an table entry for the new kubernetes.audit.annotations.pod-security_kubernetes_io/audit-violations

* Added the data type for field pod-security_kubernetes_io/audit-violations

Added the data type for field pod-security_kubernetes_io/audit-violations.
This is defined in the offical kubernetes documentation here: https://kubernetes.io/docs/reference/labels-annotations-taints/audit-annotations/#pod-security-kubernetes-io-enforce-policy

* Updated version to 1.68.2

* Update changelog.yml

* Update packages/kubernetes/manifest.yml

Co-authored-by: Tetiana Kravchenko <[email protected]>

* Update change number to 1.69.0

* Update version to 1.69.0

---------

Co-authored-by: Tetiana Kravchenko <[email protected]>
@neu7ron2 neu7ron2 deleted the audit-datatype-fix branch February 7, 2025 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Integration:kubernetes Kubernetes Team:Cloudnative-Monitoring Cloud Native Monitoring team [elastic/obs-cloudnative-monitoring]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants