Skip to content

Commit f34bf51

Browse files
committed
Add reducer configuration, test data, increment patch version, and add details.json
1 parent ed8568d commit f34bf51

File tree

5 files changed

+242
-5
lines changed

5 files changed

+242
-5
lines changed

config/config.json

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,19 @@
33
"name": "urlscan",
44
"acronym": "URLS",
55
"description": "Searches the urlscan.io API and returns results from the most recent, relevant scan",
6-
"entityTypes": ["IPv4", "IPv6", "IPv4CIDR", "domain", "url", "SHA256"],
6+
"entityTypes": [
7+
"IPv4",
8+
"IPv6",
9+
"IPv4CIDR",
10+
"domain",
11+
"url",
12+
"SHA256"
13+
],
714
"defaultColor": "light-pink",
815
"onDemandOnly": true,
9-
"styles": ["./styles/us.less"],
16+
"styles": [
17+
"./styles/us.less"
18+
],
1019
"block": {
1120
"component": {
1221
"file": "./components/us-block.js"
@@ -124,5 +133,10 @@
124133
"userCanEdit": false,
125134
"adminOnly": true
126135
}
127-
]
136+
],
137+
"reducer": {
138+
"details": {
139+
"file": "./reducers/details.json"
140+
}
141+
}
128142
}

mocks/details.json

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
{
2+
"results": [
3+
{
4+
"task": {
5+
"uuid": "a7b3c9d1-2e4f-5a6b-7c8d-9e0f1a2b3c4d",
6+
"time": "2024-01-15T10:30:45.123Z",
7+
"url": "https://example.com",
8+
"visibility": "public",
9+
"method": "api",
10+
"source": "api",
11+
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
12+
"domain": "example.com"
13+
},
14+
"stats": {
15+
"uniqIPs": 3,
16+
"uniqCountries": 2,
17+
"dataLength": 458923,
18+
"encodedDataLength": 156832,
19+
"requests": 42,
20+
"IPv6Percentage": 0,
21+
"malicious": 0,
22+
"adBlocked": 5,
23+
"totalLinks": 28,
24+
"secureRequests": 38,
25+
"securePercentage": 90
26+
},
27+
"page": {
28+
"url": "https://example.com",
29+
"domain": "example.com",
30+
"ip": "93.184.216.34",
31+
"country": "US",
32+
"city": "Norwell",
33+
"server": "ECS (sec/97A6)",
34+
"asn": "AS15133",
35+
"asnname": "EDGECAST, US",
36+
"ptr": ""
37+
},
38+
"verdicts": {
39+
"overall": {
40+
"score": 0,
41+
"malicious": false,
42+
"categories": [],
43+
"tags": [],
44+
"brands": []
45+
},
46+
"urlscan": {
47+
"score": 0,
48+
"malicious": false,
49+
"categories": []
50+
},
51+
"engines": {
52+
"score": 0,
53+
"malicious": 0,
54+
"categories": [],
55+
"verdicts": []
56+
},
57+
"community": {
58+
"score": 0,
59+
"votes": []
60+
}
61+
},
62+
"_id": "507f1f77bcf86cd799439011",
63+
"result": "https://urlscan.io/result/a7b3c9d1-2e4f-5a6b-7c8d-9e0f1a2b3c4d/",
64+
"screenshot": "https://urlscan.io/screenshots/a7b3c9d1-2e4f-5a6b-7c8d-9e0f1a2b3c4d.png",
65+
"sort": [
66+
1705317045123,
67+
"example.com"
68+
]
69+
},
70+
{
71+
"task": {
72+
"uuid": "b8c4d0e2-3f5g-6b7c-8d9e-0f1g2h3i4j5k",
73+
"time": "2024-01-14T15:22:10.456Z",
74+
"url": "http://malicious-example.net",
75+
"visibility": "public",
76+
"method": "automatic",
77+
"source": "certstream",
78+
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36",
79+
"domain": "malicious-example.net"
80+
},
81+
"stats": {
82+
"uniqIPs": 15,
83+
"uniqCountries": 8,
84+
"dataLength": 2458923,
85+
"encodedDataLength": 856832,
86+
"requests": 128,
87+
"IPv6Percentage": 12,
88+
"malicious": 8,
89+
"adBlocked": 0,
90+
"totalLinks": 87,
91+
"secureRequests": 12,
92+
"securePercentage": 9
93+
},
94+
"page": {
95+
"url": "http://malicious-example.net",
96+
"domain": "malicious-example.net",
97+
"ip": "185.220.101.45",
98+
"country": "RU",
99+
"city": "Moscow",
100+
"server": "nginx/1.14.0",
101+
"asn": "AS44050",
102+
"asnname": "PIN-AS, RU",
103+
"ptr": "tor-exit-node.example.ru"
104+
},
105+
"verdicts": {
106+
"overall": {
107+
"score": 85,
108+
"malicious": true,
109+
"categories": [
110+
"phishing",
111+
"malware"
112+
],
113+
"tags": [
114+
"phishing",
115+
"credential-theft",
116+
"suspicious-content"
117+
],
118+
"brands": [
119+
"Microsoft",
120+
"Office365"
121+
]
122+
},
123+
"urlscan": {
124+
"score": 90,
125+
"malicious": true,
126+
"categories": [
127+
"phishing"
128+
]
129+
},
130+
"engines": {
131+
"score": 80,
132+
"malicious": 7,
133+
"categories": [
134+
"phishing",
135+
"malware"
136+
],
137+
"verdicts": [
138+
{
139+
"engine": "Google Safe Browsing",
140+
"category": "phishing",
141+
"malicious": true
142+
},
143+
{
144+
"engine": "PhishTank",
145+
"category": "phishing",
146+
"malicious": true
147+
}
148+
]
149+
},
150+
"community": {
151+
"score": 75,
152+
"votes": [
153+
{
154+
"vote": "malicious"
155+
},
156+
{
157+
"vote": "malicious"
158+
},
159+
{
160+
"vote": "suspicious"
161+
}
162+
]
163+
}
164+
},
165+
"_id": "507f1f77bcf86cd799439012",
166+
"result": "https://urlscan.io/result/b8c4d0e2-3f5g-6b7c-8d9e-0f1g2h3i4j5k/",
167+
"screenshot": "https://urlscan.io/screenshots/b8c4d0e2-3f5g-6b7c-8d9e-0f1g2h3i4j5k.png",
168+
"sort": [
169+
1705245730456,
170+
"malicious-example.net"
171+
]
172+
}
173+
],
174+
"total": 2,
175+
"took": 127,
176+
"has_more": false
177+
}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "urlscan",
3-
"version": "3.7.0",
3+
"version": "3.7.1",
44
"main": "./integration.js",
55
"private": true,
66
"scripts": {

reducers/details.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"root": {
3+
"path": "",
4+
"on_null": "return_empty"
5+
},
6+
"pipeline": [
7+
{
8+
"op": "copy",
9+
"from": "results",
10+
"to": "reduced_results.results"
11+
},
12+
{
13+
"op": "copy",
14+
"from": "total",
15+
"to": "reduced_results.total"
16+
},
17+
{
18+
"op": "copy",
19+
"from": "has_more",
20+
"to": "reduced_results.has_more"
21+
},
22+
{
23+
"op": "drop",
24+
"paths": [
25+
"reduced_results.results[].task.method",
26+
"reduced_results.results[].task.uuid",
27+
"reduced_results.results[].task.url",
28+
"reduced_results.results[].stats.dataLength",
29+
"reduced_results.results[].stats.encodedDataLength",
30+
"reduced_results.results[].stats.requests",
31+
"reduced_results.results[].page.url",
32+
"reduced_results.results[]._id",
33+
"reduced_results.results[].result",
34+
"reduced_results.results[].screenshot"
35+
]
36+
},
37+
{
38+
"op": "prune",
39+
"strategy": "empty_values",
40+
"target": "reduced_results"
41+
}
42+
],
43+
"output": {
44+
"result": "$working.reduced_results"
45+
}
46+
}

0 commit comments

Comments
 (0)