You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metron.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/08/04 22:55:00 UTC

[jira] [Commented] (METRON-1086) Create a Blockly-based user interface for Stellar

    [ https://issues.apache.org/jira/browse/METRON-1086?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16115066#comment-16115066 ] 

ASF GitHub Bot commented on METRON-1086:
----------------------------------------

GitHub user merrimanr opened a pull request:

    https://github.com/apache/metron/pull/684

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

    ## 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](https://user-images.githubusercontent.com/311928/28989205-8785e940-7939-11e7-87c0-957eaa959195.png)
    
    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](https://user-images.githubusercontent.com/311928/28989252-c0c9403a-7939-11e7-8ea7-b616fbd51a2e.png)
    
    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](https://user-images.githubusercontent.com/311928/28989475-1e08e8d0-793b-11e7-9115-a0b5378788ce.png)
    
    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](https://user-images.githubusercontent.com/311928/28989668-88020284-793c-11e7-9f75-db82ce28e8a7.png)
    
    
    Once you get the correct Stellar statement, save the sensor config:
    ![screen shot 2017-08-04 at 5 39 25 pm](https://user-images.githubusercontent.com/311928/28989596-f1a9b656-793b-11e7-9c21-97674b97de0f.png)
    
    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](https://user-images.githubusercontent.com/311928/28989617-22b9dcee-793c-11e7-8e29-8d629c984098.png)
    
    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](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235) for the complete guide to follow for contributions.  
    Please refer also to our [Build Verification Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview) 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:
    - [x] Is there a JIRA ticket associated with this PR? If not one needs to be created at [Metron Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel). 
    - [x] 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.
    - [x] 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](http://www.apache.org/legal/resolved.html#category-a)? 
    - [ ] 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](https://travis-ci.org) is set up for your personal repository such that your branches are built there before submitting a pull request.
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/merrimanr/incubator-metron blockly-editor

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/metron/pull/684.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #684
    
----
commit 58eff702b6e3f490d1110adcbbef087238aa3d91
Author: merrimanr <me...@gmail.com>
Date:   2017-08-01T20:10:10Z

    initial commit

commit 397a74178815ca0ffdc5ea3b5c8afe2da481f3d2
Author: merrimanr <me...@gmail.com>
Date:   2017-08-04T22:08:16Z

    fixed deployment bug

----


> Create a Blockly-based user interface for Stellar
> -------------------------------------------------
>
>                 Key: METRON-1086
>                 URL: https://issues.apache.org/jira/browse/METRON-1086
>             Project: Metron
>          Issue Type: New Feature
>            Reporter: Ryan Merriman
>            Assignee: Ryan Merriman
>
> Having a visual Stellar editor would be useful.  Blockly is a Google library for building visual programming editors:  https://developers.google.com/blockly/.  This feature will integrate the two and produce a reusable javascript widget for editing Stellar code.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)