Skip to content

Spring boot package [Audit events - data stream] - #2977

Merged
sunny-elastic merged 10 commits into
elastic:mainfrom
sunny-elastic:package_spring_boot_audit_events
Apr 14, 2022
Merged

Spring boot package [Audit events - data stream]#2977
sunny-elastic merged 10 commits into
elastic:mainfrom
sunny-elastic:package_spring_boot_audit_events

Conversation

@sunny-elastic

@sunny-elastic sunny-elastic commented Apr 3, 2022

Copy link
Copy Markdown
Contributor

What does this PR do?

  • Generated the skeleton of Spring Boot integration package.
  • Added Audit events data stream
  • Added data collection logic.
  • Added the ingest pipelines.
  • Mapped fields according to the ECS schema and added Fields metadata in the appropriate yml files.
  • Added system test cases.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that Audit events data stream collect logs.
  • I have added an entry to my package's changelog.yml file.
  • If I'm introducing a new feature, I have modified the Kibana version constraint in my package's manifest.yml file to point to the latest Elastic stack release (e.g. ^8.0.0).

How to test this PR locally

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

elastic-package test

Note: We have covered dashboards and the visualisations for all data streams of spring boot into separate PR. Also Kibana version will be updated to 8.1.0 in manifest.yml after testing this integration on 8.1.0.

@sunny-elastic
sunny-elastic requested a review from a team as a code owner April 3, 2022 07:43
@elasticmachine

elasticmachine commented Apr 3, 2022

Copy link
Copy Markdown

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-04-14T14:03:05.891+0000

  • Duration: 15 min 10 sec

Test stats 🧪

Test Results
Failed 0
Passed 5
Skipped 0
Total 5

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.
@sunny-elastic
sunny-elastic requested a review from mtojek April 3, 2022 07:58
@sunny-elastic sunny-elastic self-assigned this Apr 3, 2022
@sunny-elastic sunny-elastic added enhancement New feature or request Team:Integrations Label for the Integrations team New Integration Issue or pull request for creating a new integration package. labels Apr 3, 2022
@elasticmachine

Copy link
Copy Markdown

Pinging @elastic/integrations (Team:Integrations)

@mtojek
mtojek requested a review from ruflin April 4, 2022 09:35
Comment thread .github/CODEOWNERS
- name: spring_boot
type: group
fields:
- name: auditevents

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is inconsistent with the data_stream name.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@sunny-elastic can you use the data stream name here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Its fixed

Comment thread packages/spring_boot/data_stream/audit_events/fields/fields.yml
fields:
- name: remote_address
type: keyword
description: Remote Address of the Spring Boot application

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remote address of the application or user?

@sunny-elastic sunny-elastic Apr 14, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As this field got extracted from event.original as we addressed in previous comment. And this looks remote address of user.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just to be sure, could you please double-check it with Spring docs or source code? Usually, you don't collect server IP address, but user IP, hence I'm confused.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes its user ip address and not the server ip address.

description: Remote Address of the Spring Boot application
- name: session_id
type: keyword
description: Session ID of the Spring Boot application

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Session ID of user or application?

@sunny-elastic sunny-elastic Apr 14, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As this field got extracted from event.original as we addressed in previous comment. And this looks session id of user

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If this field concerns the user, let's rephrase the description accordingly.

description: Session ID of the Spring Boot application
- name: principal
type: keyword
description: Restricts the events to those with the given principal

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you please rephrase it? I'm not sure that I understand what is this field about.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So here this principal is basically referring to the user. and those remote address and session id fields for that specific principal that is user.

"spring_boot": {
"audit_events": {
"data": {
"session_id": "192.168.32.6"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why session ID is IP address? Did you dump this event or prepared manually?

fields:
- name: remote_address
type: keyword
description: Remote Address of the Spring Boot application

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just to be sure, could you please double-check it with Spring docs or source code? Usually, you don't collect server IP address, but user IP, hence I'm confused.

@sunny-elastic

Copy link
Copy Markdown
Contributor Author

@mtojek yes remote_address refer to the user ip address and not the server ip address.

@mtojek

mtojek commented Apr 14, 2022

Copy link
Copy Markdown
Contributor

Thanks for checking this. Could you please post a link to the documentation or Spring Boot source, in case somebody in the future will have similar concerns?

@sunny-elastic
sunny-elastic requested a review from mtojek April 14, 2022 13:32
@sunny-elastic

Copy link
Copy Markdown
Contributor Author

Thanks for checking this. Could you please post a link to the documentation or Spring Boot source, in case somebody in the future will have similar concerns?

yeah sure. so here are few links for spring boot documentation for audit events
https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/actuate/audit/AuditEvent.html
https://docs.spring.io/spring-boot/docs/2.6.3/actuator-api/htmlsingle/#audit-events

@@ -0,0 +1,3 @@
dependencies:
ecs:
reference: git@8.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you can update it to 8.1, as you're setting the ecs.version in the pipeline to 8.1.0.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. fixed. Thanks!

@mtojek
mtojek self-requested a review April 14, 2022 14:11

@mtojek mtojek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Feel free to merge it if CI is happy.

@sunny-elastic
sunny-elastic merged commit f0dda6d into elastic:main Apr 14, 2022
orestisfl pushed a commit to orestisfl/integrations that referenced this pull request May 15, 2026
* Spring boot package [Audit events - data stream]

* Update as per review comments

* update README.md

* update CODEOWNERS and manifest

* updated code according to review comments

* updated README.md

* update git ecs version

Co-authored-by: yug-elastic <96041884+yug-elastic@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request New Integration Issue or pull request for creating a new integration package. Team:Integrations Label for the Integrations team

5 participants