IBM/watson-discovery-analyze-data-breaches

Name: watson-discovery-analyze-data-breaches

Owner: International Business Machines

Description: A Node.js application that demonstrates how to Import, Enrich, and see Insights about data using Watson Discovery.

Created: 2017-06-21 14:16:31.0

Updated: 2018-05-10 18:55:18.0

Pushed: 2018-05-10 18:55:20.0

Homepage: https://developer.ibm.com/code/patterns/import-enrich-and-gain-insight-from-data/

Size: 15902

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status

Use the Watson Discovery Service to analyze cyber security breaches

In this Code Pattern you will upload your own data into the Watson Discovery Service. Then you'll configure a web application so that it can query the data collection you created. The web app allows you to explore that data.

Once you have completed this Code Pattern, you will know how to:

Flow
  1. The cyber breach json files are added to the Discovery collection.
  2. The user interacts with the backend server via the app UI. The frontend app UI uses React to render search results and can reuse all of the views that are used by the backend for server side rendering. The frontend is using watson-react-components and is responsive.
  3. User input is processed and routed to the backend server, which is responsible for server side rendering of the views to be displayed on the browser. The backend server is written using express and uses express-react-views engine to render views written using React.
  4. The backend server sends user requests to the Watson Discovery Service. It acts as a proxy server, forwarding queries from the frontend to the Watson Discovery Service API while keeping sensitive API keys concealed from the user.

Included components

Featured technologies

Watch the Video

Steps

Use the Deploy to IBM Cloud button OR create the services and run locally.

Deploy to IBM Cloud

Deploy to IBM Cloud

  1. Press the above Deploy to IBM Cloud button and then click on Deploy.

  2. In Toolchains, click on Delivery Pipeline to watch while the app is deployed. Once deployed, the app can be viewed by clicking View app.

  1. To see the app and services created and configured for this Code Pattern, use the IBM Cloud dashboard. The app is named watson-data-breaches with a unique suffix. The following services are created:

    • breaches-discovery-service
Run locally

NOTE: These steps are only needed when running locally instead of using the Deploy to IBM Cloud button.

  1. Clone the repo
  2. Create IBM Cloud services
  3. Load the Discovery files
  4. Configure credentials
  5. Run the application
1. Clone the repo

Clone the watson-discovery-analyze-data-breaches repo locally. In a terminal, run:

t clone https://github.com/ibm/watson-discovery-analyze-data-breaches

We'll be using the folder data/breaches/

2. Create IBM Cloud services

Create the following services:

3. Load the Discovery files

Launch the Watson Discovery tool. Create a new data collection and give the data collection a unique name.

Save the environment_id and collection_id for your .env file in the next step.

Under Add data to this collection use Drag and drop your documents here or browse from computer to seed the content with the json files in data/breaches/.

Upload data to collection

4. Configure credentials

The credentials for the IBM Cloud Discovery service can be found in the Services menu in IBM Cloud, by selecting the Service Credentials option for the service.

The other settings for Conversation and Discovery were collected during the earlier setup steps (DISCOVERY_COLLECTION_ID, DISCOVERY_ENVIRONMENT_ID and WORKSPACE_ID).

Copy the env.sample to .env.

 env.sample .env

Edit the .env file with the necessary settings.

env.sample:
place the credentials here with your own.
name this file to .env before starting the app.

tson Discovery
OVERY_USERNAME=<add_discovery_username>
OVERY_PASSWORD=<add_discovery_password>
OVERY_ENVIRONMENT_ID=<add_discovery_environment>
OVERY_COLLECTION_ID=<add_discovery_collection>

n locally on a non-default port (default is 3000)
RT=3000
5. Run the application
  1. Install Node.js runtime or NPM.
  2. Start the app by running npm install, followed by npm start.
  3. Use the chatbot at localhost:3000.

    Note: server host can be changed as required in server.js and PORT can be set in .env.

Sample output

Troubleshooting

Links

Learn more

License

Apache 2.0


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.