-
Notifications
You must be signed in to change notification settings - Fork 505
METRON-1380: Create a typosquatting use-case (commit after METRON-1379, METRON-1377, METRON-1378) #882
Conversation
…o typosquat_merge
…etron into typosquat_merge
| @@ -0,0 +1,431 @@ | |||
| # Problem Statement | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add the license header to this? #884 is close to going in and enforcing this, so I'm hoping to avoid impact to master.
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
| we have to adjust the mappings for the indices we just created to add the `alert` nested property. You can | ||
| do that via the following: | ||
| ``` | ||
| curl -XPUT "http://$ES_HOST/squid*/_mapping/squid_doc" -d '{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should just be able to do:
curl -XPUT "http://$ES_HOST/squid*/_mapping/squid_doc" -d '
{
"properties" : {
"alert" : {
"type" : "nested"
}
}
}
'
Adding a mapping should be able to be done without having the whole template, iirc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this whole segment is 2.x format right (e.g. string types)? If it is necessary in full, it'll have to migrate to 5.x.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good catch. I adjusted it and tried it and it worked. IF you still have vagrant up, would you mind updating and using the new mapping?
|
I ran through the instructions. The new data flowing automatically into the default ES mapping causes the problem that fielddata isn't true, so grouping queries don't match on the squid index and it doesn't show up in the UI. The data does show up as expected in ES via direct query, while on full dev. This seems primarily like a matter of updating the instructions appropriately. |
|
@justinleet Instructions updated, good catch. |
|
I ran this up and was able to complete the example and see the data flow through to the alerts UI. Everything worked really well, and the instructions were very clear. I think once the PRs this depends on are in, this is good to go in my mind. I would like to see those merged (and this appropriately merged from master) before I'm +1. |
|
+1, thanks for the hard work in getting everything cleaned up! |
Contributor Comments
This is a documented use-case on how to use the following JIRAs (PRs) to detect typosquatting in-stream using bloom filters:
The code here is a merger of the PRs above to allow reviewers to test the entire feature together. The manual testing plan is to execute the typosquatting use-case instructions.
Pull Request Checklist
Thank you for submitting a contribution to Apache Metron.
Please refer to our Development Guidelines for the complete guide to follow for contributions.
Please refer also to our Build Verification Guidelines for complete smoke testing guides.
In order to streamline the review of the contribution we ask you follow these guidelines and ask you to double check the following:
For all changes:
For code changes:
Have you included steps to reproduce the behavior or problem that is being changed or addressed?
Have you included steps or a guide to how the change may be verified and tested manually?
Have you ensured that the full suite of tests and checks have been executed in the root metron folder via:
Have you written or updated unit tests and or integration tests to verify your changes?
If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent?
For documentation related changes:
Have you ensured that format looks appropriate for the output in which it is rendered by building and verifying the site-book? If not then run the following commands and the verify changes via
site-book/target/site/index.html:Note:
Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.
It is also recommended that travis-ci is set up for your personal repository such that your branches are built there before submitting a pull request.