Commit c40c0f48 authored by Floyd Hightower's avatar Floyd Hightower

Moving things around

parent 9a4cab1e
......@@ -7,7 +7,7 @@
/out-tsc
# dependencies
/node_modules
*/node_modules
# IDEs and editors
/.idea
......
# Playbook Multimeter
Spaces app and playbook component to manage tests and view data across multiple playbooks.
Spaces app and playbook component to view data across multiple playbooks. This gives you one place to view any data from different points taken from multiple playbooks.
## Getting Started
![You can use this system to view data from multiple points in playbooks in one place.](playbook_multimeter.gif)
1. Setup your environment for testing:
## Installation
```
make setup
```
There are two parts to this system:
2. Run the app to get started:
1. A playbook multimeter component
2. A spaces app
```
make run
```
### Playbook Multimeter Component
This is using the [ng serve](https://github.com/angular/angular-cli/wiki/serve) command to run the app. You can leave this running and it will refresh to serve the most up to date version of the app as you make changes. Let's leave it running an open a new tab in your command line.
The spaces app is in the `playbook_component/` directory of this repository (it is called `[utility] Multimeter Component.pbx`). You can download it and import it into your instance.
3. Let's get familiar with the app by removing the pop-up that says "This is the start of something great!":
### Spaces App
- Open `src/app/main.component.ts`
- Remove the line that says:
The spaces app is in the `spaces_app/` directory of this repository. The `README.md` file in that directory has instructions for packaging and installing the app.
```typescript
this.messages.showSuccess('Success Message', 'This is the start of something great!');
```
Now check the app and you will see that the pop-up is no longer shown. The `main.component.ts` file can be considered the quarter-back for the app. The routes are defined in `src/app/app-routing.module.ts` and you can change a route by calling the `goTo` function in `main.component.ts`.
4. To add a new [component](https://angular.io/guide/architecture-components) to the app, run:
```
cd src/app/
mkdir components # only have to do this the first time you create a component
cd components
ng generate component <COMPONENT_NAME>
```
## Build App For Release
```
make pack
```
This will package the app as `target/TCS_-_Playbook_Multimeter.tcx`.
## Build App in Development Mode (does not minify or uglify code, so it can be debugged in browser)
```
make pack-dev
```
## Deploy
In the ThreatConnect UI install the App (the `.tcx` file) created in the [Build App for Release](#build-app-for-release) section.
## Credits
This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and [Floyd Hightower's Spaces App Template](https://github.com/fhightower-templates/threatconnect-angular-spaces-template).
Enjoy!
{
"allowOnDemand": true,
"languageVersion": "7",
"params": [{
"encrypt": false,
"label": "Api User",
"name": "api_user",
"sequence": 1,
"type": "String",
"validValues": ["${USER:TEXT}", "${ORGANIZATION:TEXT}"]
}, {
"encrypt": true,
"label": "API Token",
"name": "api_token",
"sequence": 2,
"type": "String",
"validValues": ["${USER:KEYCHAIN}", "${ORGANIZATION:KEYCHAIN}"]
}, {
"default": "info",
"encrypt": false,
"label": "Logging Level",
"name": "logging",
"sequence": 3,
"type": "Choice",
"validValues": [
"debug",
"info",
"warn",
"error",
"critical"
]
}],
"programLanguage": "NONE",
"programVersion": "0.1.0",
"runtimeContext": [],
"runtimeLevel": "SpaceOrganization"
}
{
"definitionVersion" : "1.0.0",
"name" : "[utility] Multimeter Component",
"type" : "Pipe",
"panX" : 496.0,
"panY" : 67.0,
"logLevel" : "WARN",
"description" : "",
"jobList" : [ {
"id" : 20018,
"appCatalogItem" : {
"programName" : "DataStore",
"displayName" : "DataStore",
"programVersion" : "1.0.0"
},
"name" : "DataStore 1",
"scheduleType" : "Daily",
"scheduleLOM" : false,
"notifyOnFailure" : true,
"notifyOnPartialFailure" : false,
"notifyOnComplete" : false,
"notifyIncludeLogFiles" : false,
"enableNotifications" : false,
"publishAuth" : false,
"publishUsername" : "tB1XAa8XOGdTiDEh",
"publishPassword" : "Trf6i5DE1DqBczcW",
"jobParameterList" : [ {
"appCatalogItemParameter" : {
"paramName" : "request_entity"
},
"value" : "{\n\"date\": \"#Global:0:gbl.timestamp.epoch!String\",\n\"name\": \"#Trigger:1969:name!String\",\n\"message\": \"#App:20388:escapedArray!String\"\n}"
}, {
"appCatalogItemParameter" : {
"paramName" : "type_name"
},
"value" : "#App:20019:datastoreName!String"
}, {
"appCatalogItemParameter" : {
"paramName" : "organization_name"
},
"value" : ""
}, {
"appCatalogItemParameter" : {
"paramName" : "path"
},
"value" : ""
}, {
"appCatalogItemParameter" : {
"paramName" : "db_method"
},
"value" : "POST"
}, {
"appCatalogItemParameter" : {
"paramName" : "domain_type"
},
"value" : "Organization"
} ],
"locationLeft" : 390.0,
"locationTop" : 290.0,
"playbookRetryEnabled" : false
}, {
"id" : 20019,
"appCatalogItem" : {
"programName" : "TCPB - SetVariable v1.0",
"displayName" : "Set Variable",
"programVersion" : "1.0.5"
},
"name" : "Set Variable 1",
"scheduleType" : "Daily",
"scheduleLOM" : false,
"notifyOnFailure" : true,
"notifyOnPartialFailure" : false,
"notifyOnComplete" : false,
"notifyIncludeLogFiles" : false,
"enableNotifications" : false,
"publishAuth" : false,
"publishUsername" : "6iaVwpyoK1idP9zL",
"publishPassword" : "MVO1tB7NLYkFNVnI",
"jobParameterList" : [ {
"appCatalogItemParameter" : {
"paramName" : "variable_mapping"
},
"value" : "[{\"key\":\"datastoreName\",\"value\":\"playbookMultimeter\"}]"
} ],
"locationLeft" : 180.0,
"locationTop" : 180.0,
"outputVariables" : "[{\"name\":\"datastoreName\",\"type\":\"String\"}]",
"playbookRetryEnabled" : false
}, {
"id" : 20388,
"appCatalogItem" : {
"programName" : "49ce1564bcdf748988c624a5659a0451",
"displayName" : "[utility] Escape Quotes for Datastore",
"programVersion" : "1.0.0",
"pipeRunLevel" : true
},
"name" : "[utility] Escape Quotes for Datastore 1",
"scheduleType" : "Daily",
"scheduleLOM" : false,
"notifyOnFailure" : true,
"notifyOnPartialFailure" : false,
"notifyOnComplete" : false,
"notifyIncludeLogFiles" : false,
"enableNotifications" : false,
"publishAuth" : false,
"publishUsername" : "fn4qnWnwJdQOOcR5",
"publishPassword" : "MeLYpWeehNEdW8EF",
"jobParameterList" : [ {
"appCatalogItemParameter" : {
"paramName" : "array"
},
"value" : "#Trigger:1969:message!String"
} ],
"locationLeft" : 180.0,
"locationTop" : 290.0,
"outputVariables" : "[{\"name\":\"escapedArray\",\"type\":\"String\"}]",
"playbookRetryEnabled" : false
} ],
"playbookConnectionList" : [ {
"type" : "Pass",
"isCircularOnTarget" : false,
"targetJobId" : 20019,
"sourceTriggerId" : 1969
}, {
"type" : "Pass",
"isCircularOnTarget" : false,
"sourceJobId" : 20019,
"targetJobId" : 20388
}, {
"type" : "Pass",
"isCircularOnTarget" : false,
"sourceJobId" : 20388,
"targetJobId" : 20018
} ],
"playbookTriggerList" : [ {
"id" : 1969,
"name" : "Component Trigger",
"type" : "PipeConfig",
"eventType" : "External",
"locationLeft" : -50.0,
"locationTop" : 180.0,
"httpBasicAuthEnable" : false,
"anyOrg" : true,
"orFilters" : false,
"fireOnDuplicate" : false,
"renderBodyAsTip" : false,
"outputVariables" : "[{\"name\":\"message\",\"type\":\"String\"},{\"name\":\"name\",\"type\":\"String\"}]",
"pipeInputParams" : "[{\"label\":\"Name\",\"dataType\":\"String\",\"playbookDataType\":\"String\",\"required\":true,\"name\":\"name\",\"encrypted\":false,\"hidden\":false,\"hasDollarVariables\":false,\"playbookVariable\":false,\"validValuesList\":[\"${TEXT}\"]},{\"label\":\"Message\",\"dataType\":\"String\",\"playbookDataType\":\"String\",\"required\":true,\"name\":\"message\",\"encrypted\":false,\"hidden\":false,\"hasDollarVariables\":false,\"playbookVariable\":false,\"validValuesList\":[\"${TEXT}\"]}]",
"pipeOutputParams" : "[]"
} ],
"exportablePipes" : [ {
"definitionVersion" : "49ce1564bcdf748988c624a5659a0451",
"name" : "[utility] Escape Quotes for Datastore",
"type" : "Pipe",
"panX" : 20.0,
"panY" : 20.0,
"logLevel" : "WARN",
"description" : "",
"jobList" : [ {
"id" : 19923,
"appCatalogItem" : {
"programName" : "Find / Replace",
"displayName" : "Find and Replace",
"programVersion" : "1.0.0"
},
"name" : "Find and Replace 1",
"scheduleType" : "Daily",
"scheduleLOM" : false,
"notifyOnFailure" : true,
"notifyOnPartialFailure" : false,
"notifyOnComplete" : false,
"notifyIncludeLogFiles" : false,
"enableNotifications" : false,
"publishAuth" : false,
"publishUsername" : "PYZxuF3bPSN5HUis",
"publishPassword" : "M0lSF9bAWXI5JvZJ",
"jobParameterList" : [ {
"appCatalogItemParameter" : {
"paramName" : "input_text"
},
"value" : "#Trigger:1950:array!String"
}, {
"appCatalogItemParameter" : {
"paramName" : "match_case"
},
"value" : "false"
}, {
"appCatalogItemParameter" : {
"paramName" : "replace_regex"
},
"value" : "\\\\\\\\\\\\\""
}, {
"appCatalogItemParameter" : {
"paramName" : "find_regex"
},
"value" : "\""
}, {
"appCatalogItemParameter" : {
"paramName" : "as_regex"
},
"value" : "false"
} ],
"locationLeft" : 440.0,
"locationTop" : 280.0,
"outputVariables" : "[{\"name\":\"find_replace.output\",\"type\":\"String\"}]",
"playbookRetryEnabled" : false
} ],
"playbookConnectionList" : [ {
"type" : "Pass",
"isCircularOnTarget" : false,
"targetJobId" : 19923,
"sourceTriggerId" : 1950
}, {
"type" : "Pass",
"isCircularOnTarget" : true,
"sourceJobId" : 19923,
"targetTriggerId" : 1950
} ],
"playbookTriggerList" : [ {
"id" : 1950,
"name" : "Component Trigger",
"type" : "PipeConfig",
"eventType" : "External",
"locationLeft" : 210.0,
"locationTop" : 170.0,
"httpBasicAuthEnable" : false,
"anyOrg" : true,
"orFilters" : false,
"fireOnDuplicate" : false,
"renderBodyAsTip" : false,
"outputVariables" : "[{\"name\":\"array\",\"type\":\"String\"}]",
"pipeInputParams" : "[{\"label\":\"Array (as a string)\",\"dataType\":\"String\",\"playbookDataType\":\"String\",\"required\":true,\"name\":\"array\",\"encrypted\":false,\"hidden\":false,\"hasDollarVariables\":false,\"playbookVariable\":false,\"validValuesList\":[\"${TEXT}\"]}]",
"pipeOutputParams" : "[{\"key\":\"escapedArray\",\"value\":\"#App:19923:find_replace.output!String \",\"displayValue\":\"#App:19923:find_replace.output!String \"}]"
} ],
"dateExported" : "6/27/18 5:18 PM"
} ],
"dateExported" : "6/27/18 5:18 PM"
}
\ No newline at end of file
This diff is collapsed.
# Playbook Multimeter
Spaces app and playbook component to view data across multiple playbooks.
## Getting Started
1. Setup your environment for testing:
```
make setup
```
2. Run the app to get started:
```
make run
```
This is using the [ng serve](https://github.com/angular/angular-cli/wiki/serve) command to run the app. You can leave this running and it will refresh to serve the most up to date version of the app as you make changes. Let's leave it running an open a new tab in your command line.
3. Let's get familiar with the app by removing the pop-up that says "This is the start of something great!":
- Open `src/app/main.component.ts`
- Remove the line that says:
```typescript
this.messages.showSuccess('Success Message', 'This is the start of something great!');
```
Now check the app and you will see that the pop-up is no longer shown. The `main.component.ts` file can be considered the quarter-back for the app. The routes are defined in `src/app/app-routing.module.ts` and you can change a route by calling the `goTo` function in `main.component.ts`.
4. To add a new [component](https://angular.io/guide/architecture-components) to the app, run:
```
cd src/app/
mkdir components # only have to do this the first time you create a component
cd components
ng generate component <COMPONENT_NAME>
```
## Build App For Release
```
make pack
```
This will package the app as `target/TCS_-_Playbook_Multimeter.tcx`.
## Build App in Development Mode (does not minify or uglify code, so it can be debugged in browser)
```
make pack-dev
```
## Deploy
In the ThreatConnect UI install the App (the `.tcx` file) created in the [Build App for Release](#build-app-for-release) section.
## Credits
This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and [Floyd Hightower's Spaces App Template](https://github.com/fhightower-templates/threatconnect-angular-spaces-template).
{
"allowOnDemand": true,
"languageVersion": "7",
"params": [],
"programLanguage": "NONE",
"programVersion": "0.1.0",
"runtimeContext": [],
"runtimeLevel": "SpaceOrganization"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment