Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

DO NOT MERGE: METRON-1086: Create a Blockly-based user interface for Stellar #684

Closed
wants to merge 2 commits into from

Conversation

merrimanr
Copy link
Contributor

Contributor Comments

This PR is a first look at the Blockly/Stellar integration with a working example. This is POC quality code and has a long way to go. This is just an initial preview to kick off the discussion, gather requirements, and work out a design.

To take it for a test drive, spin up full dev and bring up the Management UI. Open the threat triage panel on the bro (or any) sensor and add the rule EXISTS(ip_src_addr):
screen shot 2017-08-04 at 5 21 51 pm

Click the Save button and then click on the block icon for the newly created rule. This will open the Stellar Blockly editor:
screen shot 2017-08-04 at 5 24 10 pm

You will notice the rule that was just created is now represented as a series of connected blocks with the rule displayed in a text box just below. You can edit the rule by dragging, dropping and interacting with various blocks that represent Stellar operators and functions. Try changing the rule to EXISTS(ip_src_addr) && IS_DOMAIN(host) like this:
screen shot 2017-08-04 at 5 33 57 pm

The && operator is under the Boolean category in the toolbox to the left. The IS_DOMAIN function is under Stellar -> Domain. The purple block with the value set to host represents a list of fields parsed from the json in the SAMPLE widget at the top. This block is in the Fields category. If the host field doesn't appear in the dropdown try getting new samples (right arrow) until you get a message that contains that field:
screen shot 2017-08-04 at 5 43 59 pm

Once you get the correct Stellar statement, save the sensor config:
screen shot 2017-08-04 at 5 39 25 pm

Open that rule again with the Blockly editor and you should see the block statement you just created:
screen shot 2017-08-04 at 5 41 12 pm

This preview contains only a subset of Stellar features and is very much incomplete. There is much more work to do. For this demo it is shown in context of the threat triage editor but could be used anywhere Stellar is exposed. For now I will leave you with this and let you form your own opinions about what it should evolve to. After people have had a chance to see it, we can continue the discussion on where this should go next.

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:

  • Is there a JIRA ticket associated with this PR? If not one needs to be created at Metron Jira.
  • Does your PR title start with METRON-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
  • Has your PR been rebased against the latest commit within the target branch (typically master)?

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:

    mvn -q clean integration-test install && build_utils/verify_licenses.sh 
    
  • 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:

    cd site-book
    mvn site
    

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.

@JonZeolla
Copy link
Member

Is this ready for initial testing? I would be happy to take this for a ride, but it seems to be having some travis (RAT only?) issues, and has a conflicted package.json.

@ottobackwards
Copy link
Contributor

We should make this a feature branch

@ottobackwards
Copy link
Contributor

I will repeat that this should be a feature branch. What are we going to do here? This is just sitting here getting more and more out of date.

@merrimanr
Copy link
Contributor Author

Sorry for ignoring this for so long. This is going to be a fairly complex module to maintain and it is VERY tightly coupled with Stellar. This means that if we want to officially add this feature it will place an additional and substantial burden on people making changes to Stellar.

I am happy to lead this but it should be something that is overwhelmingly supported by the community. It will take a lot of effort from multiple people to make this comprehensive and robust. I would need volunteers to help me.

Might make sense to revive this once we are confident Stellar is very stable and won't change much. Not sure if that will ever happen since it's so flexible and has already evolved so much :)

@ottobackwards
Copy link
Contributor

I would be happy to help, I think I have a decent handle with the stellar side, and could get up to speed on the ui stuff with your help.

Think about how we can go about it.
I think I would need to understand better how this works, what tightly coupled means etc. Maybe we can slice this up between ui and backend?

@lvets
Copy link

lvets commented Apr 10, 2018

I can help out with testing wherever possible. This is a very cool feature...

@mmiklavc
Copy link
Contributor

What's the state of this?

@ottobackwards
Copy link
Contributor

I don't think anything has been done with this. The feature branch wasn't made....

@ottobackwards
Copy link
Contributor

We should close this until we are ready for a feature branch

@merrimanr merrimanr closed this Oct 24, 2018
@ottobackwards
Copy link
Contributor

I actually think in the future this should be a stellar project / feature, then integrated after with metron. So that any ui can do stellar blockly

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants