Skip to content
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

[1password] Add user fields for actor_details, object_details, and aux_details. #6851

Merged
merged 11 commits into from
Aug 3, 2023

Conversation

Jin-Dhaliwal
Copy link
Contributor

@Jin-Dhaliwal Jin-Dhaliwal commented Jul 6, 2023

What does this PR do?

We've added new details fields to the data model that we want to consumed through this integration. An example of the original message would be:

                 {
			"uuid": "2CA5O6WU4VOPE225X64BMDJ6M3",
			"timestamp": "2023-06-30T18:02:23.273264Z",
			"actor_uuid": "PPQYFXGORNDIRHFJ43QNOEKZ6A",
			"actor_details": {
				"uuid": "PPQYFXGORNDIRHFJ43QNOEKZ6A",
				"name": "Insights Test",
				"email": "jin.dhaliwal+insightstest@agilebits.com"
			},
			"action": "trvlaway",
			"object_type": "user",
			"object_uuid": "X3TLF2JNIVDKJAXU67SNSHCFBU",
			"object_details": {
				"uuid": "X3TLF2JNIVDKJAXU67SNSHCFBU",
				"name": "Member 7",
				"email": "jin.dhaliwal+m7@agilebits.com"
			},
			"session": {
				"uuid": "RD4MLUQFIZDW5G6MUFFBIYUUBM",
				"login_time": "2023-06-30T18:01:42.300478Z",
				"device_uuid": "gdbhmdzsecieklx5wmgr7qy6oe",
				"ip": "172.19.0.1"
			}
		}

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.

Author's Checklist

  • Integration tests pass
  • Integration includes the new details fields in processed event data

How to test this PR locally

Follow the testing steps outlined here: https://developer.1password.com/docs/events-api/reference/#post-apiv1auditevents

  1. Get the elastic stack up and running.
  2. Follow the integration steps to set up the 1Password integration. (You will need a 1password business account)
  • You can create a test account on start.b5dev.com and use Stripe test card 4242424242424242
  • You'll need to change the URL in the integration setup to events.b5dev.com
  1. On your 1Password account add some members/groups/vaults/items. This will generate events that the integration will capture.
  2. Confirm that the audit events dashboard contains those events and the new details fields are present.

Screenshots

Screenshot 2023-07-06 at 12 40 22 PM
Screenshot 2023-07-06 at 12 40 03 PM

@Jin-Dhaliwal Jin-Dhaliwal requested a review from a team as a code owner July 6, 2023 19:24
@Jin-Dhaliwal Jin-Dhaliwal changed the title Draft: Add user detail fields for actor, object, and aux_info. Add user detail fields for actor, object, and aux_info. Jul 6, 2023
@elasticmachine
Copy link

elasticmachine commented Jul 6, 2023

💚 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: 2023-08-03T05:02:59.463+0000

  • Duration: 16 min 44 sec

Test stats 🧪

Test Results
Failed 0
Passed 22
Skipped 0
Total 22

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

@elasticmachine
Copy link

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@andrewkroh andrewkroh changed the title Add user detail fields for actor, object, and aux_info. [1password] Add user detail fields for actor, object, and aux_info. Jul 7, 2023
@efd6
Copy link
Contributor

efd6 commented Jul 10, 2023

/test

@elasticmachine
Copy link

elasticmachine commented Jul 10, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (3/3) 💚
Files 100.0% (3/3) 💚 2.842
Classes 100.0% (3/3) 💚 2.842
Methods 90.909% (30/33) 👎 -1.208
Lines 88.182% (291/330) 👎 -2.503
Conditionals 100.0% (0/0) 💚

Copy link
Contributor

@kcreddy kcreddy left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

Could you also update ingest pipeline to add User ECS mapping? For example, you could add user.name field from actor_details.name field.

More examples on User ECS field that you could map: https://www.elastic.co/guide/en/ecs/current/ecs-user-usage.html

@kcreddy kcreddy changed the title [1password] Add user detail fields for actor, object, and aux_info. [1password] Add user fields for actor_details, object_details, and aux_details. Jul 12, 2023
@kcreddy kcreddy added the enhancement New feature or request label Jul 12, 2023
Jin-Dhaliwal and others added 4 commits July 12, 2023 11:27
Co-authored-by: Krishna Chaitanya Reddy Burri <krish.reddy91@gmail.com>
Co-authored-by: Krishna Chaitanya Reddy Burri <krish.reddy91@gmail.com>
Co-authored-by: Krishna Chaitanya Reddy Burri <krish.reddy91@gmail.com>
@Jin-Dhaliwal
Copy link
Contributor Author

Anything left on this one? Would like to get this out asap because we've released the new version of the API and customers will want to start ingesting the new fields.

@Jin-Dhaliwal
Copy link
Contributor Author

@kcreddy is there any other changes needed here or is this ready for merge now?

@kcreddy
Copy link
Contributor

kcreddy commented Jul 27, 2023

/test

1 similar comment
@kcreddy
Copy link
Contributor

kcreddy commented Jul 27, 2023

/test

@kcreddy
Copy link
Contributor

kcreddy commented Jul 27, 2023

Hey @Jin-Dhaliwal
Sincere apologies for the delay 🙏🏼 .
Looks like the CI is failing due to README being not updated. Could you please run below command and commit ?

elastic-package build && elastic-package format && elastic-package lint && elastic-package check && elastic-package build

@Jin-Dhaliwal
Copy link
Contributor Author

@kcreddy done!

@kcreddy
Copy link
Contributor

kcreddy commented Jul 27, 2023

/test

@kcreddy
Copy link
Contributor

kcreddy commented Jul 28, 2023

@Jin-Dhaliwal
Thanks for fixing the README. Now the CI is failing on pipeline tests. Looks like after the user ECS fields are added, the pipeline tests are not updated.

Can you run pipeline tests after bringing the stack up?
eval "$(elastic-package stack shellinit)" && elastic-package test pipeline --generate and then commit.

@Jin-Dhaliwal
Copy link
Contributor Author

@kcreddy thanks for the help. done

@kcreddy
Copy link
Contributor

kcreddy commented Jul 29, 2023

/test

1 similar comment
@kcreddy
Copy link
Contributor

kcreddy commented Jul 31, 2023

/test

@kcreddy
Copy link
Contributor

kcreddy commented Jul 31, 2023

@Jin-Dhaliwal can you please fix the merge conflicts? The CI wouldn't run otherwise. Thanks!

@Jin-Dhaliwal
Copy link
Contributor Author

/test

@Jin-Dhaliwal
Copy link
Contributor Author

@kcreddy OK conflicts resolved

@kcreddy
Copy link
Contributor

kcreddy commented Aug 2, 2023

/test

@Jin-Dhaliwal
Copy link
Contributor Author

Jin-Dhaliwal commented Aug 2, 2023

How can I fix those failures in CI? I'm not sure what happened. Reading at face value seems like service that the test step needed failed to start?

Is there a way to restart those?

elastic-package test passes locally

@kcreddy
Copy link
Contributor

kcreddy commented Aug 3, 2023

/test

Copy link
Contributor

@kcreddy kcreddy left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏼

@kcreddy
Copy link
Contributor

kcreddy commented Aug 3, 2023

How can I fix those failures in CI? I'm not sure what happened. Reading at face value seems like service that the test step needed failed to start?
Is there a way to restart those?

Hey, @Jin-Dhaliwal the issue was with the CI system, your changes are good.
Once again thanks so much for the contribution 😄

@kcreddy kcreddy merged commit f3200ea into elastic:main Aug 3, 2023
1 check passed
@elasticmachine
Copy link

Package 1password - 1.18.0 containing this change is available at https://epr.elastic.co/search?package=1password

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:1password 1Password
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants