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

Skip to content

Conversation

sunny-elastic
Copy link
Contributor

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

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
Copy link

elasticmachine commented Apr 3, 2022

💚 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

Pinging @elastic/integrations (Team:Integrations)

@mtojek mtojek requested a review from ruflin April 4, 2022 09:35
- name: spring_boot
type: group
fields:
- name: auditevents
Copy link
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

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
Contributor Author

Choose a reason for hiding this comment

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

Its fixed

fields:
- name: remote_address
type: keyword
description: Remote Address of the Spring Boot application
Copy link
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?

Copy link
Contributor Author

@sunny-elastic sunny-elastic Apr 14, 2022

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
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
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
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?

Copy link
Contributor Author

@sunny-elastic sunny-elastic Apr 14, 2022

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
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
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
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
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
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
Contributor Author

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

@mtojek
Copy link
Contributor

mtojek commented Apr 14, 2022

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
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: [email protected]
Copy link
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
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
Copy link
Contributor

@mtojek mtojek left a comment

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
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants