Skip to content

Commit

Permalink
experimenting with github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
mmguero committed Sep 23, 2022
1 parent b85fec2 commit 5029669
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 62 deletions.
8 changes: 3 additions & 5 deletions docs/api-document-lookup.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@ Parameters:
* `to` (query parameter) - the time frame ([`lte`](https://opensearch.org/docs/latest/opensearch/query-dsl/term/#range)) for the beginning of the search based on the session's `firstPacket` field value in a format supported by the [dateparser](https://github.com/scrapinghub/dateparser) library (default: "now")
* `filter` (query parameter) - field filters formatted as a JSON dictionary (see **Field Aggregations** for examples)

<details>
<summary>Example cURL command and output:</summary>
**Example cURL command and output:**

```
$ curl -k -u username -L -XPOST -H 'Content-Type: application/json' \
'https://localhost/mapi/document' \
-d '{"limit": 10, filter":{"zeek.uid":"CYeji2z7CKmPRGyga"}}'
```

```
```json
{
"filter": {
"zeek.uid": "CYeji2z7CKmPRGyga"
Expand Down Expand Up @@ -86,5 +85,4 @@ $ curl -k -u username -L -XPOST -H 'Content-Type: application/json' \
"network"
],
```
</details>
```
14 changes: 5 additions & 9 deletions docs/api-event-logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

A webhook that accepts alert data to be reindexed into OpenSearch as session records for viewing in Malcolm's [dashboards](dashboards.md#Dashboards). See [Alerting](alerting.md#Alerting) for more details and an example of how this API is used.

<details>
<summary>Example input:</summary>
**Example input:**

```
```json
{
"alert": {
"monitor": {
Expand Down Expand Up @@ -47,12 +46,10 @@ A webhook that accepts alert data to be reindexed into OpenSearch as session rec
}
}
```
</details>

<details>
<summary>Example output:</summary>
**Example output:**

```
```json
{
"_index": "arkime_sessions3-220308",
"_type": "_doc",
Expand All @@ -67,5 +64,4 @@ A webhook that accepts alert data to be reindexed into OpenSearch as session rec
"_seq_no": 9045,
"_primary_term": 1
}
```
</details>
```
62 changes: 26 additions & 36 deletions docs/api-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

Some security-related API examples:

<details>
<summary>Protocols</summary>
## Protocols

```
/mapi/agg/network.type,network.transport,network.protocol,network.protocol_version
```

```
```json
{
"fields": [
"network.type",
Expand Down Expand Up @@ -381,15 +380,14 @@ Some security-related API examples:
}
}
```
</details>
<details>
<summary>Software</summary>

## Software

```
/mapi/agg/zeek.software.name,zeek.software.unparsed_version
```

```
```json
{
"fields": [
"zeek.software.name",
Expand Down Expand Up @@ -777,15 +775,14 @@ Some security-related API examples:
}
}
```
</details>
<details>
<summary>User agent</summary>

## User agent

```
/mapi/agg/user_agent.original
```

```
```json
{
"fields": [
"user_agent.original"
Expand Down Expand Up @@ -879,17 +876,16 @@ Some security-related API examples:
}
}
```
</details>
<details>
<summary>External traffic (outbound/inbound)</summary>

## External traffic (outbound/inbound)

```
$ curl -k -u username -L -XPOST -H 'Content-Type: application/json' \
'https://localhost/mapi/agg/network.protocol' \
-d '{"filter":{"network.direction":["inbound","outbound"]}}'
```

```
```json
{
"fields": [
"network.protocol"
Expand Down Expand Up @@ -939,17 +935,16 @@ $ curl -k -u username -L -XPOST -H 'Content-Type: application/json' \
}
}
```
</details>
<details>
<summary>Cross-segment traffic</summary>

## Cross-segment traffic

```
$ curl -k -u username -L -XPOST -H 'Content-Type: application/json' \
'https://localhost/mapi/agg/source.segment,destination.segment,network.protocol' \
-d '{"filter":{"tags":"cross_segment"}}'
```

```
```json
{
"fields": [
"source.segment",
Expand Down Expand Up @@ -1122,17 +1117,16 @@ $ curl -k -u username -L -XPOST -H 'Content-Type: application/json' \
}
}
```
</details>
<details>
<summary>Plaintext password</summary>

## Plaintext password

```
$ curl -k -u username -L -XPOST -H 'Content-Type: application/json' \
'https://localhost/mapi/agg/network.protocol' \
-d '{"filter":{"!related.password":null}}'
```

```
```json
{
"fields": [
"network.protocol"
Expand All @@ -1159,17 +1153,16 @@ $ curl -k -u username -L -XPOST -H 'Content-Type: application/json' \
}
}
```
</details>
<details>
<summary>Insecure/outdated protocols</summary>

## Insecure/outdated protocols

```
$ curl -k -u username -L -XPOST -H 'Content-Type: application/json' \
'https://localhost/mapi/agg/network.protocol,network.protocol_version' \
-d '{"filter":{"event.severity_tags":"Insecure or outdated protocol"}}'
```

```
```json
{
"fields": [
"network.protocol",
Expand Down Expand Up @@ -1243,15 +1236,14 @@ $ curl -k -u username -L -XPOST -H 'Content-Type: application/json' \
}
}
```
</details>
<details>
<summary>Notice categories</summary>

## Notice categories

```
/mapi/agg/zeek.notice.category,zeek.notice.sub_category
```

```
```json
{
"fields": [
"zeek.notice.category",
Expand Down Expand Up @@ -1354,15 +1346,14 @@ $ curl -k -u username -L -XPOST -H 'Content-Type: application/json' \
}
}
```
</details>
<details>
<summary>Severity tags</summary>

## Severity tags

```
/mapi/agg/event.severity_tags
```

```
```json
{
"fields": [
"event.severity_tags"
Expand Down Expand Up @@ -1476,4 +1467,3 @@ $ curl -k -u username -L -XPOST -H 'Content-Type: application/json' \
}
}
```
</details>
6 changes: 2 additions & 4 deletions docs/api-fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

Returns the (very long) list of fields known to Malcolm, comprised of data from Arkime's [`fields` table](https://arkime.com/apiv3#fields-api), the Malcolm [OpenSearch template](./dashboards/templates/malcolm_template.json) and the OpenSearch Dashboards index pattern API.

<details>
<summary>Example output:</summary>
**Example output:**

```
```json
{
"fields": {
"@timestamp": {
Expand All @@ -25,4 +24,3 @@ Returns the (very long) list of fields known to Malcolm, comprised of data from
"total": 2005
}
```
</details>
6 changes: 2 additions & 4 deletions docs/api-indices.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

Lists [information related to the underlying OpenSearch indices](https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-indices/), similar to Arkime's [esindices](https://arkime.com/apiv3#esindices-api) API.

<details>
<summary>Example output:</summary>
**Example output:**

```
```json
{
"indices": [
Expand All @@ -27,4 +26,3 @@ Lists [information related to the underlying OpenSearch indices](https://opensea
]
}
```
</details>
6 changes: 2 additions & 4 deletions docs/api-version.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

Returns version information about Malcolm and version/[health](https://opensearch.org/docs/latest/opensearch/rest-api/cluster-health/) information about the underlying OpenSearch instance.

<details>
<summary>Example output:</summary>
**Example output:**

```
```json
{
"built": "2022-01-18T16:10:39Z",
"opensearch": {
Expand Down Expand Up @@ -48,4 +47,3 @@ Returns version information about Malcolm and version/[health](https://opensearc
"version": "5.2.0"
}
```
</details>

0 comments on commit 5029669

Please sign in to comment.