Skip to content

Commit ab034e5

Browse files
committed
Initial sandbox integration development for review.
1 parent 573e949 commit ab034e5

File tree

11 files changed

+892
-0
lines changed

11 files changed

+892
-0
lines changed

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Ignore Maven Compiled Project Files
2+
*/target/
3+
4+
# Ignore IntelliJ Project Information
5+
*.iml
6+
.idea/
7+
8+
# Ignore Sublime Text Project Files
9+
*.sublime-project
10+
*.sublime-workspace
11+
12+
13+
# Ignore Eclipse Project Information
14+
*.settings
15+
*.project
16+
*.classpath
17+
dependency-reduced-pom.xml
18+
19+
20+
# Ignore Excel Files
21+
*.xlsx
22+
23+
# Ignore local log files
24+
*.log
25+
26+
# Ignore Generated HTML README Files
27+
README.html
28+
29+
# Ignored installed NPM modules
30+
node_modules/
31+
32+
# Ignore private keys
33+
key/
34+
35+
#Ignore VSCode
36+
*.history
37+
.histoy
38+
*.vscode
39+
.vscode

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License
2+
3+
Copyright (c) 2021 Polarity.io, Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Polarity Sandbox Integration
2+
3+
The Polarity Sandbox integrations uses the Google search API to search malware on different internet hosted sandboxes, to provide more information on the malware hashes.
4+
5+
6+
|![image](assets/overlay.png)
7+
|---|---|
8+
|*Sandbox example* |
9+
10+
## Sandbox Integration Options
11+
12+
### API Key
13+
14+
Valid Google CSE API Key
15+
16+
### Sandboxes to Search
17+
Specify which Sandboxes you want the integration to search.
18+
19+
## Installation Instructions
20+
21+
Generate a new CSE API key on the following page:
22+
23+
https://developers.google.com/custom-search/v1/overview
24+
25+
A free account allows for up to 100 search queries per day.
26+
27+
Once the API key has been generated, input the information into the API Key field in the integration and start searching for exploits.
28+
29+
30+
## Polarity
31+
32+
Polarity is a memory-augmentation platform that improves and accelerates analyst decision making. For more information about the Polarity platform please see:
33+
34+
https://polarity.io/

assets/overlay.png

170 KB
Loading

components/block.js

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
polarity.export = PolarityComponent.extend({
2+
// Hides the filter menu by default
3+
viewFilters: false,
4+
// This is the initial view limit. The user can view up to 10 by clicking on a "view more" action link
5+
viewLimit: 5,
6+
// Stores any error messages from our onMessage hook
7+
errorMessage: '',
8+
infoMessage: '',
9+
details: Ember.computed.alias('block.data.details'),
10+
searchResults: Ember.computed.alias('details.searchResults'),
11+
searchInformation: Ember.computed.alias('searchResults.searchInformation'),
12+
icons: Ember.computed.alias('details.icons'),
13+
searchFilters: Ember.computed.alias('block.storage.searchFilters'),
14+
numSourcesToSearch: Ember.computed.alias('block.storage.numSourcesToSearch'),
15+
init: function () {
16+
this._super(...arguments);
17+
if (!this.get('block.storage.searchFilters')) {
18+
this.set('block.storage', {});
19+
this.set('block.storage.searchFilters', [
20+
{
21+
displayValue: 'app.any.run',
22+
filterValue: 'app.any.run',
23+
id: 'app-checkbox',
24+
value: true
25+
},
26+
{
27+
displayValue: 'any.run',
28+
filterValue: 'any.run',
29+
id: 'any-checkbox',
30+
value: true
31+
},
32+
{
33+
displayValue: 'VirusTotal',
34+
filterValue: 'virustotal.com',
35+
id: 'vt-checkbox',
36+
value: true
37+
},
38+
{
39+
displayValue: 'Joe Sandbox',
40+
filterValue: 'joesandbox.com',
41+
id: 'js-checkbox',
42+
value: true
43+
},
44+
{
45+
displayValue: 'Intezer',
46+
filterValue: 'analyze.intezer.com',
47+
id: 'intezer-checkbox',
48+
value: true
49+
},
50+
{
51+
displayValue: 'Hybrid Analysis',
52+
filterValue: 'hybrid-analysis.com',
53+
id: 'ha-checkbox',
54+
value: true
55+
},
56+
{
57+
displayValue: 'Valkyrie Comodo',
58+
filterValue: 'valkyrie.comodo.com',
59+
id: 'comodo-checkbox',
60+
value: true
61+
},
62+
{
63+
displayValue: 'IRIS-H',
64+
filterValue: 'iris-h.services',
65+
id: 'irish-checkbox',
66+
value: true
67+
},
68+
{
69+
displayValue: 'Labs.Inquest',
70+
filterValue: 'labs.inquest.net',
71+
id: 'inquest-checkbox',
72+
value: true
73+
},
74+
{
75+
displayValue: 'Manalyzer',
76+
filterValue: 'manalyzer.org',
77+
id: 'manalyzer-checkbox',
78+
value: true
79+
},
80+
{
81+
displayValue: 'Sandbox Pikker',
82+
filterValue: 'sandbox.pikker.ee',
83+
id: 'pikker-checkbox',
84+
value: true
85+
},
86+
{
87+
displayValue: 'Yomi Yoroi',
88+
filterValue: 'yomi.yoroi.company',
89+
id: 'yomi-checkbox',
90+
value: true
91+
}
92+
]);
93+
this.set('block.storage.numSourcesToSearch', this.get('block.storage.searchFilters.length'));
94+
}
95+
},
96+
actions: {
97+
toggleFilter: function () {
98+
this.toggleProperty('viewFilters');
99+
},
100+
applyFilter: function () {
101+
this.set('errorMessage', '');
102+
this.set('infoMessage', '');
103+
104+
const numSourcesToSearch = this.getNumSourcesSearched();
105+
if (numSourcesToSearch === 0) {
106+
this.set('infoMessage', 'Select at least one source to search');
107+
return;
108+
}
109+
this.set('filtering', true);
110+
const payload = {
111+
entity: this.block.entity,
112+
searchFilters: this.searchFilters
113+
};
114+
115+
this.sendIntegrationMessage(payload)
116+
.then((searchResults) => {
117+
this.set('block.data.details.searchResults', searchResults);
118+
})
119+
.catch((err) => {
120+
console.error(err);
121+
if (typeof err.meta === 'string') {
122+
this.set('errorMessage', err.meta);
123+
} else if (typeof err.meta === 'object' && typeof err.meta.error === 'string') {
124+
this.set('errorMessage', err.meta.error);
125+
} else if (typeof err.meta === 'object' && typeof err.meta.detail === 'string') {
126+
this.set('errorMessage', err.meta.detail);
127+
} else {
128+
this.set('errorMessage', JSON.stringify(err.meta));
129+
}
130+
})
131+
.finally(() => {
132+
this.set('numSourcesToSearch', numSourcesToSearch);
133+
this.set('filtering', false);
134+
});
135+
},
136+
selectAll: function () {
137+
for (let i = 0; i < this.searchFilters.length; i++) {
138+
this.set(`searchFilters.${i}.value`, true);
139+
}
140+
},
141+
clearAll: function () {
142+
for (let i = 0; i < this.searchFilters.length; i++) {
143+
this.set(`searchFilters.${i}.value`, false);
144+
}
145+
},
146+
viewMore: function () {
147+
this.set('viewLimit', 10);
148+
}
149+
},
150+
getNumSourcesSearched() {
151+
let numSourcesToSearch = 0;
152+
for (let i = 0; i < this.searchFilters.length; i++) {
153+
if (this.searchFilters[i].value === true) {
154+
++numSourcesToSearch;
155+
}
156+
}
157+
return numSourcesToSearch;
158+
}
159+
});

0 commit comments

Comments
 (0)