@censys/platform-sdk 0.4.3 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FUNCTIONS.md +0 -1
- package/README.md +17 -2
- package/docs/sdks/collections/README.md +12 -6
- package/docs/sdks/globaldata/README.md +260 -6
- package/docs/sdks/threathunting/README.md +335 -0
- package/examples/globalDataSearch.example.ts +0 -1
- package/examples/package-lock.json +5 -6
- package/funcs/globalDataCreateTrackedScan.d.ts +18 -0
- package/funcs/globalDataCreateTrackedScan.d.ts.map +1 -0
- package/funcs/globalDataCreateTrackedScan.js +132 -0
- package/funcs/globalDataCreateTrackedScan.js.map +1 -0
- package/funcs/globalDataGetTrackedScan.d.ts +19 -0
- package/funcs/globalDataGetTrackedScan.d.ts.map +1 -0
- package/funcs/globalDataGetTrackedScan.js +137 -0
- package/funcs/globalDataGetTrackedScan.js.map +1 -0
- package/funcs/globalDataGetTrackedScanThreatHunting.d.ts +19 -0
- package/funcs/globalDataGetTrackedScanThreatHunting.d.ts.map +1 -0
- package/funcs/globalDataGetTrackedScanThreatHunting.js +137 -0
- package/funcs/globalDataGetTrackedScanThreatHunting.js.map +1 -0
- package/funcs/threatHuntingCreateTrackedScan.d.ts +18 -0
- package/funcs/threatHuntingCreateTrackedScan.d.ts.map +1 -0
- package/funcs/threatHuntingCreateTrackedScan.js +129 -0
- package/funcs/threatHuntingCreateTrackedScan.js.map +1 -0
- package/funcs/threatHuntingGetHostObservationsWithCertificate.d.ts +18 -0
- package/funcs/threatHuntingGetHostObservationsWithCertificate.d.ts.map +1 -0
- package/funcs/threatHuntingGetHostObservationsWithCertificate.js +141 -0
- package/funcs/threatHuntingGetHostObservationsWithCertificate.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +4 -4
- package/lib/config.js +4 -4
- package/models/components/elasticsearch.d.ts +3 -0
- package/models/components/elasticsearch.d.ts.map +1 -1
- package/models/components/elasticsearch.js +5 -0
- package/models/components/elasticsearch.js.map +1 -1
- package/models/components/elasticsearcherrormessage.d.ts +33 -0
- package/models/components/elasticsearcherrormessage.d.ts.map +1 -0
- package/models/components/elasticsearcherrormessage.js +73 -0
- package/models/components/elasticsearcherrormessage.js.map +1 -0
- package/models/components/hostobservationrange.d.ts +39 -0
- package/models/components/hostobservationrange.d.ts.map +1 -0
- package/models/components/hostobservationrange.js +92 -0
- package/models/components/hostobservationrange.js.map +1 -0
- package/models/components/hostobservationresponse.d.ts +34 -0
- package/models/components/hostobservationresponse.d.ts.map +1 -0
- package/models/components/hostobservationresponse.js +85 -0
- package/models/components/hostobservationresponse.js.map +1 -0
- package/models/components/httpfavicon.d.ts +5 -0
- package/models/components/httpfavicon.d.ts.map +1 -1
- package/models/components/httpfavicon.js +4 -0
- package/models/components/httpfavicon.js.map +1 -1
- package/models/components/index.d.ts +14 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +14 -0
- package/models/components/index.js.map +1 -1
- package/models/components/responseenvelopehostobservationresponse.d.ts +30 -0
- package/models/components/responseenvelopehostobservationresponse.d.ts.map +1 -0
- package/models/components/responseenvelopehostobservationresponse.js +70 -0
- package/models/components/responseenvelopehostobservationresponse.js.map +1 -0
- package/models/components/responseenvelopetrackedscan.d.ts +30 -0
- package/models/components/responseenvelopetrackedscan.d.ts.map +1 -0
- package/models/components/responseenvelopetrackedscan.js +70 -0
- package/models/components/responseenvelopetrackedscan.js.map +1 -0
- package/models/components/scansdiscoveryinputbody.d.ts +172 -0
- package/models/components/scansdiscoveryinputbody.d.ts.map +1 -0
- package/models/components/scansdiscoveryinputbody.js +233 -0
- package/models/components/scansdiscoveryinputbody.js.map +1 -0
- package/models/components/scansrescaninputbody.d.ts +214 -0
- package/models/components/scansrescaninputbody.d.ts.map +1 -0
- package/models/components/scansrescaninputbody.js +268 -0
- package/models/components/scansrescaninputbody.js.map +1 -0
- package/models/components/screenshot.d.ts +2 -0
- package/models/components/screenshot.d.ts.map +1 -1
- package/models/components/screenshot.js +11 -0
- package/models/components/screenshot.js.map +1 -1
- package/models/components/searchaggregateinputbody.d.ts +5 -0
- package/models/components/searchaggregateinputbody.d.ts.map +1 -1
- package/models/components/searchaggregateinputbody.js +4 -0
- package/models/components/searchaggregateinputbody.js.map +1 -1
- package/models/components/searchvaluecountsinputbody.d.ts +5 -0
- package/models/components/searchvaluecountsinputbody.d.ts.map +1 -1
- package/models/components/searchvaluecountsinputbody.js +2 -0
- package/models/components/searchvaluecountsinputbody.js.map +1 -1
- package/models/components/serviceid.d.ts +70 -0
- package/models/components/serviceid.d.ts.map +1 -0
- package/models/components/serviceid.js +106 -0
- package/models/components/serviceid.js.map +1 -0
- package/models/components/trackedscan.d.ts +39 -0
- package/models/components/trackedscan.d.ts.map +1 -0
- package/models/components/trackedscan.js +90 -0
- package/models/components/trackedscan.js.map +1 -0
- package/models/components/trackedscanscantarget.d.ts +39 -0
- package/models/components/trackedscanscantarget.d.ts.map +1 -0
- package/models/components/trackedscanscantarget.js +94 -0
- package/models/components/trackedscanscantarget.js.map +1 -0
- package/models/components/trackedscanscantargethostnameport.d.ts +31 -0
- package/models/components/trackedscanscantargethostnameport.d.ts.map +1 -0
- package/models/components/trackedscanscantargethostnameport.js +71 -0
- package/models/components/trackedscanscantargethostnameport.js.map +1 -0
- package/models/components/trackedscanscantargethostport.d.ts +31 -0
- package/models/components/trackedscanscantargethostport.d.ts.map +1 -0
- package/models/components/trackedscanscantargethostport.js +71 -0
- package/models/components/trackedscanscantargethostport.js.map +1 -0
- package/models/components/trackedscantask.d.ts +74 -0
- package/models/components/trackedscantask.d.ts.map +1 -0
- package/models/components/trackedscantask.js +106 -0
- package/models/components/trackedscantask.js.map +1 -0
- package/models/components/weborigin.d.ts +31 -0
- package/models/components/weborigin.d.ts.map +1 -0
- package/models/components/weborigin.js +71 -0
- package/models/components/weborigin.js.map +1 -0
- package/models/operations/index.d.ts +5 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +5 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/v3globaldatascansget.d.ts +94 -0
- package/models/operations/v3globaldatascansget.d.ts.map +1 -0
- package/models/operations/v3globaldatascansget.js +157 -0
- package/models/operations/v3globaldatascansget.js.map +1 -0
- package/models/operations/v3globaldatascansrescan.d.ts +91 -0
- package/models/operations/v3globaldatascansrescan.d.ts.map +1 -0
- package/models/operations/v3globaldatascansrescan.js +157 -0
- package/models/operations/v3globaldatascansrescan.js.map +1 -0
- package/models/operations/v3threathuntinggethostobservationswithcertificate.d.ts +124 -0
- package/models/operations/v3threathuntinggethostobservationswithcertificate.d.ts.map +1 -0
- package/models/operations/v3threathuntinggethostobservationswithcertificate.js +183 -0
- package/models/operations/v3threathuntinggethostobservationswithcertificate.js.map +1 -0
- package/models/operations/v3threathuntingscansdiscovery.d.ts +91 -0
- package/models/operations/v3threathuntingscansdiscovery.d.ts.map +1 -0
- package/models/operations/v3threathuntingscansdiscovery.js +157 -0
- package/models/operations/v3threathuntingscansdiscovery.js.map +1 -0
- package/models/operations/v3threathuntingscansget.d.ts +94 -0
- package/models/operations/v3threathuntingscansget.d.ts.map +1 -0
- package/models/operations/v3threathuntingscansget.js +157 -0
- package/models/operations/v3threathuntingscansget.js.map +1 -0
- package/package.json +4 -5
- package/sdk/globaldata.d.ts +23 -0
- package/sdk/globaldata.d.ts.map +1 -1
- package/sdk/globaldata.js +32 -0
- package/sdk/globaldata.js.map +1 -1
- package/sdk/threathunting.d.ts +30 -0
- package/sdk/threathunting.d.ts.map +1 -1
- package/sdk/threathunting.js +42 -0
- package/sdk/threathunting.js.map +1 -1
- package/src/funcs/globalDataCreateTrackedScan.ts +185 -0
- package/src/funcs/globalDataGetTrackedScan.ts +191 -0
- package/src/funcs/globalDataGetTrackedScanThreatHunting.ts +191 -0
- package/src/funcs/threatHuntingCreateTrackedScan.ts +188 -0
- package/src/funcs/threatHuntingGetHostObservationsWithCertificate.ts +201 -0
- package/src/lib/config.ts +4 -4
- package/src/models/components/elasticsearch.ts +12 -0
- package/src/models/components/elasticsearcherrormessage.ts +74 -0
- package/src/models/components/hostobservationrange.ts +99 -0
- package/src/models/components/hostobservationresponse.ts +91 -0
- package/src/models/components/httpfavicon.ts +9 -0
- package/src/models/components/index.ts +14 -0
- package/src/models/components/responseenvelopehostobservationresponse.ts +83 -0
- package/src/models/components/responseenvelopetrackedscan.ts +74 -0
- package/src/models/components/scansdiscoveryinputbody.ts +385 -0
- package/src/models/components/scansrescaninputbody.ts +428 -0
- package/src/models/components/screenshot.ts +13 -0
- package/src/models/components/searchaggregateinputbody.ts +9 -0
- package/src/models/components/searchvaluecountsinputbody.ts +7 -0
- package/src/models/components/serviceid.ts +116 -0
- package/src/models/components/trackedscan.ts +101 -0
- package/src/models/components/trackedscanscantarget.ts +117 -0
- package/src/models/components/trackedscanscantargethostnameport.ts +73 -0
- package/src/models/components/trackedscanscantargethostport.ts +72 -0
- package/src/models/components/trackedscantask.ts +114 -0
- package/src/models/components/weborigin.ts +66 -0
- package/src/models/operations/index.ts +5 -0
- package/src/models/operations/v3globaldatascansget.ts +232 -0
- package/src/models/operations/v3globaldatascansrescan.ts +229 -0
- package/src/models/operations/v3threathuntinggethostobservationswithcertificate.ts +315 -0
- package/src/models/operations/v3threathuntingscansdiscovery.ts +238 -0
- package/src/models/operations/v3threathuntingscansget.ts +232 -0
- package/src/sdk/globaldata.ts +56 -0
- package/src/sdk/threathunting.ts +77 -0
package/FUNCTIONS.md
CHANGED
package/README.md
CHANGED
|
@@ -96,7 +96,6 @@ async function run() {
|
|
|
96
96
|
"host.ip",
|
|
97
97
|
],
|
|
98
98
|
pageSize: 1,
|
|
99
|
-
pageToken: "<next_page_token>",
|
|
100
99
|
query: "host.services: (protocol=SSH and not port: 22)",
|
|
101
100
|
},
|
|
102
101
|
});
|
|
@@ -135,12 +134,19 @@ run();
|
|
|
135
134
|
* [getHostTimeline](docs/sdks/globaldata/README.md#gethosttimeline) - Get host event history
|
|
136
135
|
* [getWebProperties](docs/sdks/globaldata/README.md#getwebproperties) - Get multiple web properties
|
|
137
136
|
* [getWebProperty](docs/sdks/globaldata/README.md#getwebproperty) - Get a web property
|
|
137
|
+
* [createTrackedScan](docs/sdks/globaldata/README.md#createtrackedscan) - Create a tracked rescan
|
|
138
|
+
* [getTrackedScan](docs/sdks/globaldata/README.md#gettrackedscan) - Get tracked scan details
|
|
138
139
|
* [aggregate](docs/sdks/globaldata/README.md#aggregate) - Aggregate results for a search query
|
|
139
140
|
* [search](docs/sdks/globaldata/README.md#search) - Run a search query
|
|
141
|
+
* [getTrackedScanThreatHunting](docs/sdks/globaldata/README.md#gettrackedscanthreathunting) - Get tracked scan details
|
|
140
142
|
|
|
141
143
|
|
|
142
144
|
### [threatHunting](docs/sdks/threathunting/README.md)
|
|
143
145
|
|
|
146
|
+
* [getTrackedScan](docs/sdks/threathunting/README.md#gettrackedscan) - Get tracked scan details
|
|
147
|
+
* [getHostObservationsWithCertificate](docs/sdks/threathunting/README.md#gethostobservationswithcertificate) - Get Host Observations With Certificate
|
|
148
|
+
* [createTrackedScan](docs/sdks/threathunting/README.md#createtrackedscan) - Create a tracked discovery scan
|
|
149
|
+
* [getTrackedScanThreatHunting](docs/sdks/threathunting/README.md#gettrackedscanthreathunting) - Get tracked scan details
|
|
144
150
|
* [valueCounts](docs/sdks/threathunting/README.md#valuecounts) - CensEye: Retrieve value counts to discover pivots
|
|
145
151
|
|
|
146
152
|
</details>
|
|
@@ -170,14 +176,21 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
|
|
|
170
176
|
- [`collectionsSearch`](docs/sdks/collections/README.md#search) - Run a search query within a collection
|
|
171
177
|
- [`collectionsUpdate`](docs/sdks/collections/README.md#update) - Update a collection
|
|
172
178
|
- [`globalDataAggregate`](docs/sdks/globaldata/README.md#aggregate) - Aggregate results for a search query
|
|
179
|
+
- [`globalDataCreateTrackedScan`](docs/sdks/globaldata/README.md#createtrackedscan) - Create a tracked rescan
|
|
173
180
|
- [`globalDataGetCertificate`](docs/sdks/globaldata/README.md#getcertificate) - Get a certificate
|
|
174
181
|
- [`globalDataGetCertificates`](docs/sdks/globaldata/README.md#getcertificates) - Get multiple certificates
|
|
175
182
|
- [`globalDataGetHost`](docs/sdks/globaldata/README.md#gethost) - Get a host
|
|
176
183
|
- [`globalDataGetHosts`](docs/sdks/globaldata/README.md#gethosts) - Get multiple hosts
|
|
177
184
|
- [`globalDataGetHostTimeline`](docs/sdks/globaldata/README.md#gethosttimeline) - Get host event history
|
|
185
|
+
- [`globalDataGetTrackedScan`](docs/sdks/globaldata/README.md#gettrackedscan) - Get tracked scan details
|
|
186
|
+
- [`globalDataGetTrackedScan`](docs/sdks/threathunting/README.md#gettrackedscan) - Get tracked scan details
|
|
187
|
+
- [`globalDataGetTrackedScanThreatHunting`](docs/sdks/globaldata/README.md#gettrackedscanthreathunting) - Get tracked scan details
|
|
188
|
+
- [`globalDataGetTrackedScanThreatHunting`](docs/sdks/threathunting/README.md#gettrackedscanthreathunting) - Get tracked scan details
|
|
178
189
|
- [`globalDataGetWebProperties`](docs/sdks/globaldata/README.md#getwebproperties) - Get multiple web properties
|
|
179
190
|
- [`globalDataGetWebProperty`](docs/sdks/globaldata/README.md#getwebproperty) - Get a web property
|
|
180
191
|
- [`globalDataSearch`](docs/sdks/globaldata/README.md#search) - Run a search query
|
|
192
|
+
- [`threatHuntingCreateTrackedScan`](docs/sdks/threathunting/README.md#createtrackedscan) - Create a tracked discovery scan
|
|
193
|
+
- [`threatHuntingGetHostObservationsWithCertificate`](docs/sdks/threathunting/README.md#gethostobservationswithcertificate) - Get Host Observations With Certificate
|
|
181
194
|
- [`threatHuntingValueCounts`](docs/sdks/threathunting/README.md#valuecounts) - CensEye: Retrieve value counts to discover pivots
|
|
182
195
|
|
|
183
196
|
</details>
|
|
@@ -353,7 +366,7 @@ run();
|
|
|
353
366
|
### Error Classes
|
|
354
367
|
**Primary errors:**
|
|
355
368
|
* [`SDKBaseError`](./src/models/errors/sdkbaseerror.ts): The base class for HTTP error responses.
|
|
356
|
-
* [`ErrorModel`](./src/models/errors/errormodel.ts): Request does not contain a valid Authorization token.
|
|
369
|
+
* [`ErrorModel`](./src/models/errors/errormodel.ts): Request does not contain a valid Authorization token. *
|
|
357
370
|
|
|
358
371
|
<details><summary>Less common errors (6)</summary>
|
|
359
372
|
|
|
@@ -371,6 +384,8 @@ run();
|
|
|
371
384
|
* [`ResponseValidationError`](./src/models/errors/responsevalidationerror.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.
|
|
372
385
|
|
|
373
386
|
</details>
|
|
387
|
+
|
|
388
|
+
\* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable.
|
|
374
389
|
<!-- End Error Handling [errors] -->
|
|
375
390
|
|
|
376
391
|
<!-- Start Server Selection [server] -->
|
|
@@ -22,6 +22,7 @@ List all collections for an organization. Retrieved information includes collect
|
|
|
22
22
|
|
|
23
23
|
### Example Usage
|
|
24
24
|
|
|
25
|
+
<!-- UsageSnippet language="typescript" operationID="v3-collections-crud-list" method="get" path="/v3/collections" -->
|
|
25
26
|
```typescript
|
|
26
27
|
import { SDK } from "@censys/platform-sdk";
|
|
27
28
|
|
|
@@ -99,6 +100,7 @@ Create a new collection.
|
|
|
99
100
|
|
|
100
101
|
### Example Usage
|
|
101
102
|
|
|
103
|
+
<!-- UsageSnippet language="typescript" operationID="v3-collections-crud-create" method="post" path="/v3/collections" -->
|
|
102
104
|
```typescript
|
|
103
105
|
import { SDK } from "@censys/platform-sdk";
|
|
104
106
|
|
|
@@ -182,6 +184,7 @@ Delete a collection.
|
|
|
182
184
|
|
|
183
185
|
### Example Usage
|
|
184
186
|
|
|
187
|
+
<!-- UsageSnippet language="typescript" operationID="v3-collections-crud-delete" method="delete" path="/v3/collections/{collection_uid}" -->
|
|
185
188
|
```typescript
|
|
186
189
|
import { SDK } from "@censys/platform-sdk";
|
|
187
190
|
|
|
@@ -257,6 +260,7 @@ Retrieve information about a collection. Retrieved information includes its name
|
|
|
257
260
|
|
|
258
261
|
### Example Usage
|
|
259
262
|
|
|
263
|
+
<!-- UsageSnippet language="typescript" operationID="v3-collections-crud-get" method="get" path="/v3/collections/{collection_uid}" -->
|
|
260
264
|
```typescript
|
|
261
265
|
import { SDK } from "@censys/platform-sdk";
|
|
262
266
|
|
|
@@ -332,6 +336,7 @@ Update a collection's name, description, and/or query.
|
|
|
332
336
|
|
|
333
337
|
### Example Usage
|
|
334
338
|
|
|
339
|
+
<!-- UsageSnippet language="typescript" operationID="v3-collections-crud-update" method="put" path="/v3/collections/{collection_uid}" -->
|
|
335
340
|
```typescript
|
|
336
341
|
import { SDK } from "@censys/platform-sdk";
|
|
337
342
|
|
|
@@ -417,6 +422,7 @@ Retrieve the event history for a collection. This includes the addition or remov
|
|
|
417
422
|
|
|
418
423
|
### Example Usage
|
|
419
424
|
|
|
425
|
+
<!-- UsageSnippet language="typescript" operationID="v3-collections-list-events" method="get" path="/v3/collections/{collection_uid}/events" -->
|
|
420
426
|
```typescript
|
|
421
427
|
import { SDK } from "@censys/platform-sdk";
|
|
422
428
|
|
|
@@ -500,6 +506,7 @@ Aggregate results for a Platform search query that targets a collection's assets
|
|
|
500
506
|
|
|
501
507
|
### Example Usage
|
|
502
508
|
|
|
509
|
+
<!-- UsageSnippet language="typescript" operationID="v3-collections-search-aggregate" method="post" path="/v3/collections/{collection_uid}/search/aggregate" -->
|
|
503
510
|
```typescript
|
|
504
511
|
import { SDK } from "@censys/platform-sdk";
|
|
505
512
|
|
|
@@ -512,9 +519,9 @@ async function run() {
|
|
|
512
519
|
const result = await sdk.collections.aggregate({
|
|
513
520
|
collectionUid: "11111111-2222-3333-4444-555555555555",
|
|
514
521
|
searchAggregateInputBody: {
|
|
515
|
-
field: "
|
|
522
|
+
field: "host.services.port",
|
|
516
523
|
numberOfBuckets: 100,
|
|
517
|
-
query: "
|
|
524
|
+
query: "host.services.protocol=SSH",
|
|
518
525
|
},
|
|
519
526
|
});
|
|
520
527
|
|
|
@@ -543,9 +550,9 @@ async function run() {
|
|
|
543
550
|
const res = await collectionsAggregate(sdk, {
|
|
544
551
|
collectionUid: "11111111-2222-3333-4444-555555555555",
|
|
545
552
|
searchAggregateInputBody: {
|
|
546
|
-
field: "
|
|
553
|
+
field: "host.services.port",
|
|
547
554
|
numberOfBuckets: 100,
|
|
548
|
-
query: "
|
|
555
|
+
query: "host.services.protocol=SSH",
|
|
549
556
|
},
|
|
550
557
|
});
|
|
551
558
|
if (res.ok) {
|
|
@@ -585,6 +592,7 @@ Run a search query across a collection's assets. Reference the [documentation on
|
|
|
585
592
|
|
|
586
593
|
### Example Usage
|
|
587
594
|
|
|
595
|
+
<!-- UsageSnippet language="typescript" operationID="v3-collections-search-query" method="post" path="/v3/collections/{collection_uid}/search/query" -->
|
|
588
596
|
```typescript
|
|
589
597
|
import { SDK } from "@censys/platform-sdk";
|
|
590
598
|
|
|
@@ -601,7 +609,6 @@ async function run() {
|
|
|
601
609
|
"host.ip",
|
|
602
610
|
],
|
|
603
611
|
pageSize: 1,
|
|
604
|
-
pageToken: "<next_page_token>",
|
|
605
612
|
query: "host.services: (protocol=SSH and not port: 22)",
|
|
606
613
|
},
|
|
607
614
|
});
|
|
@@ -635,7 +642,6 @@ async function run() {
|
|
|
635
642
|
"host.ip",
|
|
636
643
|
],
|
|
637
644
|
pageSize: 1,
|
|
638
|
-
pageToken: "<next_page_token>",
|
|
639
645
|
query: "host.services: (protocol=SSH and not port: 22)",
|
|
640
646
|
},
|
|
641
647
|
});
|
|
@@ -14,8 +14,11 @@ Endpoints related to the Global Data product
|
|
|
14
14
|
* [getHostTimeline](#gethosttimeline) - Get host event history
|
|
15
15
|
* [getWebProperties](#getwebproperties) - Get multiple web properties
|
|
16
16
|
* [getWebProperty](#getwebproperty) - Get a web property
|
|
17
|
+
* [createTrackedScan](#createtrackedscan) - Create a tracked rescan
|
|
18
|
+
* [getTrackedScan](#gettrackedscan) - Get tracked scan details
|
|
17
19
|
* [aggregate](#aggregate) - Aggregate results for a search query
|
|
18
20
|
* [search](#search) - Run a search query
|
|
21
|
+
* [getTrackedScanThreatHunting](#gettrackedscanthreathunting) - Get tracked scan details
|
|
19
22
|
|
|
20
23
|
## getCertificates
|
|
21
24
|
|
|
@@ -23,6 +26,7 @@ Retrieve information about multiple certificates. A certificate ID is its SHA-25
|
|
|
23
26
|
|
|
24
27
|
### Example Usage
|
|
25
28
|
|
|
29
|
+
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-asset-certificate-list" method="get" path="/v3/global/asset/certificate" -->
|
|
26
30
|
```typescript
|
|
27
31
|
import { SDK } from "@censys/platform-sdk";
|
|
28
32
|
|
|
@@ -102,6 +106,7 @@ Retrieve information about a single certificate. A certificate ID is its SHA-256
|
|
|
102
106
|
|
|
103
107
|
### Example Usage
|
|
104
108
|
|
|
109
|
+
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-asset-certificate" method="get" path="/v3/global/asset/certificate/{certificate_id}" -->
|
|
105
110
|
```typescript
|
|
106
111
|
import { SDK } from "@censys/platform-sdk";
|
|
107
112
|
|
|
@@ -177,6 +182,7 @@ Retrieve information about multiple hosts. A host ID is its IP address.
|
|
|
177
182
|
|
|
178
183
|
### Example Usage
|
|
179
184
|
|
|
185
|
+
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-asset-host-list" method="get" path="/v3/global/asset/host" -->
|
|
180
186
|
```typescript
|
|
181
187
|
import { SDK } from "@censys/platform-sdk";
|
|
182
188
|
|
|
@@ -256,6 +262,7 @@ Retrieve information about a single host. A host ID is its IP address.
|
|
|
256
262
|
|
|
257
263
|
### Example Usage
|
|
258
264
|
|
|
265
|
+
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-asset-host" method="get" path="/v3/global/asset/host/{host_id}" -->
|
|
259
266
|
```typescript
|
|
260
267
|
import { SDK } from "@censys/platform-sdk";
|
|
261
268
|
|
|
@@ -333,6 +340,7 @@ Retrieve event history for a host. A host ID is its IP address.
|
|
|
333
340
|
|
|
334
341
|
### Example Usage
|
|
335
342
|
|
|
343
|
+
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-asset-host-timeline" method="get" path="/v3/global/asset/host/{host_id}/timeline" -->
|
|
336
344
|
```typescript
|
|
337
345
|
import { SDK } from "@censys/platform-sdk";
|
|
338
346
|
|
|
@@ -412,6 +420,7 @@ Retrieve information about multiple web properties. Web properties are identifie
|
|
|
412
420
|
|
|
413
421
|
### Example Usage
|
|
414
422
|
|
|
423
|
+
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-asset-webproperty-list" method="get" path="/v3/global/asset/webproperty" -->
|
|
415
424
|
```typescript
|
|
416
425
|
import { SDK } from "@censys/platform-sdk";
|
|
417
426
|
|
|
@@ -491,6 +500,7 @@ Retrieve information about a single web property. Web properties are identified
|
|
|
491
500
|
|
|
492
501
|
### Example Usage
|
|
493
502
|
|
|
503
|
+
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-asset-webproperty" method="get" path="/v3/global/asset/webproperty/{webproperty_id}" -->
|
|
494
504
|
```typescript
|
|
495
505
|
import { SDK } from "@censys/platform-sdk";
|
|
496
506
|
|
|
@@ -562,12 +572,180 @@ run();
|
|
|
562
572
|
| errors.ErrorModel | 401, 403 | application/problem+json |
|
|
563
573
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
564
574
|
|
|
575
|
+
## createTrackedScan
|
|
576
|
+
|
|
577
|
+
Create a new tracked rescan for a known service or web property. Rescans are used to update information for previously discovered targets. The scan will be queued. The response will contain a scan ID that you can use with the [get tracked scan details endpoint](https://docs.censys.com/reference/v3-globaldata-scans-get#/) to monitor its status and results.<br><br>This endpoint is available to all Enterprise customers.
|
|
578
|
+
|
|
579
|
+
### Example Usage
|
|
580
|
+
|
|
581
|
+
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-scans-rescan" method="post" path="/v3/global/scans/rescan" -->
|
|
582
|
+
```typescript
|
|
583
|
+
import { SDK } from "@censys/platform-sdk";
|
|
584
|
+
|
|
585
|
+
const sdk = new SDK({
|
|
586
|
+
organizationId: "11111111-2222-3333-4444-555555555555",
|
|
587
|
+
personalAccessToken: "<YOUR_BEARER_TOKEN_HERE>",
|
|
588
|
+
});
|
|
589
|
+
|
|
590
|
+
async function run() {
|
|
591
|
+
const result = await sdk.globalData.createTrackedScan({
|
|
592
|
+
scansRescanInputBody: {
|
|
593
|
+
target: {
|
|
594
|
+
webOrigin: {
|
|
595
|
+
hostname: "censys.io",
|
|
596
|
+
port: 443,
|
|
597
|
+
},
|
|
598
|
+
},
|
|
599
|
+
},
|
|
600
|
+
});
|
|
601
|
+
|
|
602
|
+
console.log(result);
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
run();
|
|
606
|
+
```
|
|
607
|
+
|
|
608
|
+
### Standalone function
|
|
609
|
+
|
|
610
|
+
The standalone function version of this method:
|
|
611
|
+
|
|
612
|
+
```typescript
|
|
613
|
+
import { SDKCore } from "@censys/platform-sdk/core.js";
|
|
614
|
+
import { globalDataCreateTrackedScan } from "@censys/platform-sdk/funcs/globalDataCreateTrackedScan.js";
|
|
615
|
+
|
|
616
|
+
// Use `SDKCore` for best tree-shaking performance.
|
|
617
|
+
// You can create one instance of it to use across an application.
|
|
618
|
+
const sdk = new SDKCore({
|
|
619
|
+
organizationId: "11111111-2222-3333-4444-555555555555",
|
|
620
|
+
personalAccessToken: "<YOUR_BEARER_TOKEN_HERE>",
|
|
621
|
+
});
|
|
622
|
+
|
|
623
|
+
async function run() {
|
|
624
|
+
const res = await globalDataCreateTrackedScan(sdk, {
|
|
625
|
+
scansRescanInputBody: {
|
|
626
|
+
target: {
|
|
627
|
+
webOrigin: {
|
|
628
|
+
hostname: "censys.io",
|
|
629
|
+
port: 443,
|
|
630
|
+
},
|
|
631
|
+
},
|
|
632
|
+
},
|
|
633
|
+
});
|
|
634
|
+
if (res.ok) {
|
|
635
|
+
const { value: result } = res;
|
|
636
|
+
console.log(result);
|
|
637
|
+
} else {
|
|
638
|
+
console.log("globalDataCreateTrackedScan failed:", res.error);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
run();
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
### Parameters
|
|
646
|
+
|
|
647
|
+
| Parameter | Type | Required | Description |
|
|
648
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
649
|
+
| `request` | [operations.V3GlobaldataScansRescanRequest](../../models/operations/v3globaldatascansrescanrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
650
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
651
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
652
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
653
|
+
|
|
654
|
+
### Response
|
|
655
|
+
|
|
656
|
+
**Promise\<[operations.V3GlobaldataScansRescanResponse](../../models/operations/v3globaldatascansrescanresponse.md)\>**
|
|
657
|
+
|
|
658
|
+
### Errors
|
|
659
|
+
|
|
660
|
+
| Error Type | Status Code | Content Type |
|
|
661
|
+
| ------------------------ | ------------------------ | ------------------------ |
|
|
662
|
+
| errors.ErrorModel | 401, 403 | application/problem+json |
|
|
663
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
664
|
+
|
|
665
|
+
## getTrackedScan
|
|
666
|
+
|
|
667
|
+
Retrieve the current status and results of a tracked scan by its ID.
|
|
668
|
+
This endpoint works for both discovery scans and rescans.
|
|
669
|
+
|
|
670
|
+
### Example Usage
|
|
671
|
+
|
|
672
|
+
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-scans-get" method="get" path="/v3/global/scans/{scan_id}" -->
|
|
673
|
+
```typescript
|
|
674
|
+
import { SDK } from "@censys/platform-sdk";
|
|
675
|
+
|
|
676
|
+
const sdk = new SDK({
|
|
677
|
+
organizationId: "11111111-2222-3333-4444-555555555555",
|
|
678
|
+
personalAccessToken: "<YOUR_BEARER_TOKEN_HERE>",
|
|
679
|
+
});
|
|
680
|
+
|
|
681
|
+
async function run() {
|
|
682
|
+
const result = await sdk.globalData.getTrackedScan({
|
|
683
|
+
scanId: "5f39588f-d4c5-48e5-8894-0bb5918c28fa",
|
|
684
|
+
});
|
|
685
|
+
|
|
686
|
+
console.log(result);
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
run();
|
|
690
|
+
```
|
|
691
|
+
|
|
692
|
+
### Standalone function
|
|
693
|
+
|
|
694
|
+
The standalone function version of this method:
|
|
695
|
+
|
|
696
|
+
```typescript
|
|
697
|
+
import { SDKCore } from "@censys/platform-sdk/core.js";
|
|
698
|
+
import { globalDataGetTrackedScan } from "@censys/platform-sdk/funcs/globalDataGetTrackedScan.js";
|
|
699
|
+
|
|
700
|
+
// Use `SDKCore` for best tree-shaking performance.
|
|
701
|
+
// You can create one instance of it to use across an application.
|
|
702
|
+
const sdk = new SDKCore({
|
|
703
|
+
organizationId: "11111111-2222-3333-4444-555555555555",
|
|
704
|
+
personalAccessToken: "<YOUR_BEARER_TOKEN_HERE>",
|
|
705
|
+
});
|
|
706
|
+
|
|
707
|
+
async function run() {
|
|
708
|
+
const res = await globalDataGetTrackedScan(sdk, {
|
|
709
|
+
scanId: "5f39588f-d4c5-48e5-8894-0bb5918c28fa",
|
|
710
|
+
});
|
|
711
|
+
if (res.ok) {
|
|
712
|
+
const { value: result } = res;
|
|
713
|
+
console.log(result);
|
|
714
|
+
} else {
|
|
715
|
+
console.log("globalDataGetTrackedScan failed:", res.error);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
run();
|
|
720
|
+
```
|
|
721
|
+
|
|
722
|
+
### Parameters
|
|
723
|
+
|
|
724
|
+
| Parameter | Type | Required | Description |
|
|
725
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
726
|
+
| `request` | [operations.V3GlobaldataScansGetRequest](../../models/operations/v3globaldatascansgetrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
727
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
728
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
729
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
730
|
+
|
|
731
|
+
### Response
|
|
732
|
+
|
|
733
|
+
**Promise\<[operations.V3GlobaldataScansGetResponse](../../models/operations/v3globaldatascansgetresponse.md)\>**
|
|
734
|
+
|
|
735
|
+
### Errors
|
|
736
|
+
|
|
737
|
+
| Error Type | Status Code | Content Type |
|
|
738
|
+
| ------------------------ | ------------------------ | ------------------------ |
|
|
739
|
+
| errors.ErrorModel | 401, 403 | application/problem+json |
|
|
740
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
741
|
+
|
|
565
742
|
## aggregate
|
|
566
743
|
|
|
567
744
|
Aggregate results for a Platform search query. This functionality is equivalent to the [Report Builder](https://docs.censys.com/docs/platform-report-builder#/) in the Platform web UI.
|
|
568
745
|
|
|
569
746
|
### Example Usage
|
|
570
747
|
|
|
748
|
+
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-search-aggregate" method="post" path="/v3/global/search/aggregate" -->
|
|
571
749
|
```typescript
|
|
572
750
|
import { SDK } from "@censys/platform-sdk";
|
|
573
751
|
|
|
@@ -579,9 +757,9 @@ const sdk = new SDK({
|
|
|
579
757
|
async function run() {
|
|
580
758
|
const result = await sdk.globalData.aggregate({
|
|
581
759
|
searchAggregateInputBody: {
|
|
582
|
-
field: "
|
|
760
|
+
field: "host.services.port",
|
|
583
761
|
numberOfBuckets: 100,
|
|
584
|
-
query: "
|
|
762
|
+
query: "host.services.protocol=SSH",
|
|
585
763
|
},
|
|
586
764
|
});
|
|
587
765
|
|
|
@@ -609,9 +787,9 @@ const sdk = new SDKCore({
|
|
|
609
787
|
async function run() {
|
|
610
788
|
const res = await globalDataAggregate(sdk, {
|
|
611
789
|
searchAggregateInputBody: {
|
|
612
|
-
field: "
|
|
790
|
+
field: "host.services.port",
|
|
613
791
|
numberOfBuckets: 100,
|
|
614
|
-
query: "
|
|
792
|
+
query: "host.services.protocol=SSH",
|
|
615
793
|
},
|
|
616
794
|
});
|
|
617
795
|
if (res.ok) {
|
|
@@ -651,6 +829,7 @@ Run a search query across Censys data. Reference the [documentation on Censys Qu
|
|
|
651
829
|
|
|
652
830
|
### Example Usage
|
|
653
831
|
|
|
832
|
+
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-search-query" method="post" path="/v3/global/search/query" -->
|
|
654
833
|
```typescript
|
|
655
834
|
import { SDK } from "@censys/platform-sdk";
|
|
656
835
|
|
|
@@ -666,7 +845,6 @@ async function run() {
|
|
|
666
845
|
"host.ip",
|
|
667
846
|
],
|
|
668
847
|
pageSize: 1,
|
|
669
|
-
pageToken: "<next_page_token>",
|
|
670
848
|
query: "host.services: (protocol=SSH and not port: 22)",
|
|
671
849
|
},
|
|
672
850
|
});
|
|
@@ -699,7 +877,6 @@ async function run() {
|
|
|
699
877
|
"host.ip",
|
|
700
878
|
],
|
|
701
879
|
pageSize: 1,
|
|
702
|
-
pageToken: "<next_page_token>",
|
|
703
880
|
query: "host.services: (protocol=SSH and not port: 22)",
|
|
704
881
|
},
|
|
705
882
|
});
|
|
@@ -729,6 +906,83 @@ run();
|
|
|
729
906
|
|
|
730
907
|
### Errors
|
|
731
908
|
|
|
909
|
+
| Error Type | Status Code | Content Type |
|
|
910
|
+
| ------------------------ | ------------------------ | ------------------------ |
|
|
911
|
+
| errors.ErrorModel | 401, 403 | application/problem+json |
|
|
912
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
913
|
+
|
|
914
|
+
## getTrackedScanThreatHunting
|
|
915
|
+
|
|
916
|
+
Retrieve the current status and results of a tracked scan by its ID.
|
|
917
|
+
This endpoint works for both discovery scans and rescans.
|
|
918
|
+
|
|
919
|
+
### Example Usage
|
|
920
|
+
|
|
921
|
+
<!-- UsageSnippet language="typescript" operationID="v3-threathunting-scans-get" method="get" path="/v3/threat-hunting/scans/{scan_id}" -->
|
|
922
|
+
```typescript
|
|
923
|
+
import { SDK } from "@censys/platform-sdk";
|
|
924
|
+
|
|
925
|
+
const sdk = new SDK({
|
|
926
|
+
organizationId: "11111111-2222-3333-4444-555555555555",
|
|
927
|
+
personalAccessToken: "<YOUR_BEARER_TOKEN_HERE>",
|
|
928
|
+
});
|
|
929
|
+
|
|
930
|
+
async function run() {
|
|
931
|
+
const result = await sdk.globalData.getTrackedScanThreatHunting({
|
|
932
|
+
scanId: "cd62e794-9f12-4c2f-b5b3-153853aaf8d9",
|
|
933
|
+
});
|
|
934
|
+
|
|
935
|
+
console.log(result);
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
run();
|
|
939
|
+
```
|
|
940
|
+
|
|
941
|
+
### Standalone function
|
|
942
|
+
|
|
943
|
+
The standalone function version of this method:
|
|
944
|
+
|
|
945
|
+
```typescript
|
|
946
|
+
import { SDKCore } from "@censys/platform-sdk/core.js";
|
|
947
|
+
import { globalDataGetTrackedScanThreatHunting } from "@censys/platform-sdk/funcs/globalDataGetTrackedScanThreatHunting.js";
|
|
948
|
+
|
|
949
|
+
// Use `SDKCore` for best tree-shaking performance.
|
|
950
|
+
// You can create one instance of it to use across an application.
|
|
951
|
+
const sdk = new SDKCore({
|
|
952
|
+
organizationId: "11111111-2222-3333-4444-555555555555",
|
|
953
|
+
personalAccessToken: "<YOUR_BEARER_TOKEN_HERE>",
|
|
954
|
+
});
|
|
955
|
+
|
|
956
|
+
async function run() {
|
|
957
|
+
const res = await globalDataGetTrackedScanThreatHunting(sdk, {
|
|
958
|
+
scanId: "cd62e794-9f12-4c2f-b5b3-153853aaf8d9",
|
|
959
|
+
});
|
|
960
|
+
if (res.ok) {
|
|
961
|
+
const { value: result } = res;
|
|
962
|
+
console.log(result);
|
|
963
|
+
} else {
|
|
964
|
+
console.log("globalDataGetTrackedScanThreatHunting failed:", res.error);
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
run();
|
|
969
|
+
```
|
|
970
|
+
|
|
971
|
+
### Parameters
|
|
972
|
+
|
|
973
|
+
| Parameter | Type | Required | Description |
|
|
974
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
975
|
+
| `request` | [operations.V3ThreathuntingScansGetRequest](../../models/operations/v3threathuntingscansgetrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
976
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
977
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
978
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
979
|
+
|
|
980
|
+
### Response
|
|
981
|
+
|
|
982
|
+
**Promise\<[operations.V3ThreathuntingScansGetResponse](../../models/operations/v3threathuntingscansgetresponse.md)\>**
|
|
983
|
+
|
|
984
|
+
### Errors
|
|
985
|
+
|
|
732
986
|
| Error Type | Status Code | Content Type |
|
|
733
987
|
| ------------------------ | ------------------------ | ------------------------ |
|
|
734
988
|
| errors.ErrorModel | 401, 403 | application/problem+json |
|