Skip to content

Commit

Permalink
feat: Add iris plugin (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
dobarx authored Nov 8, 2024
1 parent 00ee188 commit a106f7e
Show file tree
Hide file tree
Showing 21 changed files with 1,950 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .goreleaser-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,12 @@ builds:
# no_unique_dist_dir: true
# tags:
# - fabricplugin

# - id: iris
# main: ./internal/iris/cmd
# binary: "plugins/blackstork/iris@{{ .Version }}"
# ldflags: "-X main.version={{.Version}}"
# gcflags: all=-N -l
# no_unique_dist_dir: true
# tags:
# - fabricplugin
25 changes: 25 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,20 @@ builds:
tags:
- fabricplugin

- id: plugin_iris
main: ./internal/iris/cmd
binary: "iris@{{ .Version }}"
flags: "-trimpath"
hooks:
post:
- go run ./tools/pluginmeta --namespace blackstork --version {{.Version}} patch --plugin {{.Path}} --os {{.Os}} --arch {{.Arch}}
goos:
- linux
- windows
- darwin
tags:
- fabricplugin

archives:
- id: fabric
format: tar.gz
Expand Down Expand Up @@ -443,6 +457,17 @@ archives:
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
- id: plugin_iris
format: tar.gz
builds:
- plugin_iris
name_template: >-
plugin_iris_
{{- .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
dockers:
- use: buildx
Expand Down
4 changes: 4 additions & 0 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ packages:
config:
interfaces:
Client:
github.com/blackstork-io/fabric/internal/iris/client:
config:
interfaces:
Client:
github.com/blackstork-io/fabric/internal/elastic/kbclient:
config:
interfaces:
Expand Down
34 changes: 34 additions & 0 deletions docs/plugins/iris/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: blackstork/iris
weight: 20
plugin:
name: blackstork/iris
description: "The `iris` plugin for Iris Incident Response platform."
tags: []
version: "v0.4.2"
source_github: "https://github.com/blackstork-io/fabric/tree/main/internal/iris/"
type: docs
hideInMenu: true
---

{{< plugin-header "blackstork/iris" "iris" "v0.4.2" >}}

## Description
The `iris` plugin for Iris Incident Response platform.

## Installation

To install the plugin, add it to `plugin_versions` map in the Fabric global configuration block (see [Global configuration]({{< ref "configs.md#global-configuration" >}}) for more details), with a version constraint restricting which available versions of the plugin the codebase is compatible with:

```hcl
fabric {
plugin_versions = {
"blackstork/iris" = ">= v0.4.2"
}
}
```


## Data sources

{{< plugin-resources "iris" "data-source" >}}
151 changes: 151 additions & 0 deletions docs/plugins/iris/data-sources/iris_alerts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
---
title: "`iris_alerts` data source"
plugin:
name: blackstork/iris
description: "Retrieve alerts from Iris API"
tags: []
version: "v0.4.2"
source_github: "https://github.com/blackstork-io/fabric/tree/main/internal/iris/"
resource:
type: data-source
type: docs
---

{{< breadcrumbs 2 >}}

{{< plugin-resource-header "blackstork/iris" "iris" "v0.4.2" "iris_alerts" "data source" >}}

## Description
Retrieve alerts from Iris API

## Installation

To use `iris_alerts` data source, you must install the plugin `blackstork/iris`.

To install the plugin, add the full plugin name to the `plugin_versions` map in the Fabric global configuration block (see [Global configuration]({{< ref "configs.md#global-configuration" >}}) for more details), as shown below:

```hcl
fabric {
plugin_versions = {
"blackstork/iris" = ">= v0.4.2"
}
}
```

Note the version constraint set for the plugin.

## Configuration

The data source supports the following configuration arguments:

```hcl
config data iris_alerts {
# Iris API url
#
# Required string.
# Must be non-empty
# For example:
api_url = "some string"
# Iris API Key
#
# Required string.
# Must be non-empty
# For example:
api_key = "some string"
# Enable/disable insecure TLS
#
# Optional bool.
# Default value:
insecure = false
}
```

## Usage

The data source supports the following execution arguments:

```hcl
data iris_alerts {
# List of Alert IDs
#
# Optional list of number.
# Default value:
alert_ids = null
# Alert Source
#
# Optional string.
# Default value:
alert_source = null
# List of tags
#
# Optional list of string.
# Default value:
tags = null
# Case ID
#
# Optional number.
# Default value:
case_id = null
# Alert Customer ID
#
# Optional number.
# Default value:
customer_id = null
# Alert Owner ID
#
# Optional number.
# Default value:
owner_id = null
# Alert Severity ID
#
# Optional number.
# Default value:
severity_id = null
# Alert Classification ID
#
# Optional number.
# Default value:
classification_id = null
# Alert State ID
#
# Optional number.
# Default value:
status_id = null
# Alert Date - lower boundary
#
# Optional string.
# Default value:
alert_start_date = null
# Alert Date - higher boundary
#
# Optional string.
# Default value:
alert_end_date = null
# Sort order
#
# Optional string.
# Must be one of: "desc", "asc"
# Default value:
sort = "desc"
# Size limit to retrieve
#
# Optional number.
# Must be >= 0
# Default value:
size = 0
}
```
133 changes: 133 additions & 0 deletions docs/plugins/iris/data-sources/iris_cases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
---
title: "`iris_cases` data source"
plugin:
name: blackstork/iris
description: "Retrieve cases from Iris API"
tags: []
version: "v0.4.2"
source_github: "https://github.com/blackstork-io/fabric/tree/main/internal/iris/"
resource:
type: data-source
type: docs
---

{{< breadcrumbs 2 >}}

{{< plugin-resource-header "blackstork/iris" "iris" "v0.4.2" "iris_cases" "data source" >}}

## Description
Retrieve cases from Iris API

## Installation

To use `iris_cases` data source, you must install the plugin `blackstork/iris`.

To install the plugin, add the full plugin name to the `plugin_versions` map in the Fabric global configuration block (see [Global configuration]({{< ref "configs.md#global-configuration" >}}) for more details), as shown below:

```hcl
fabric {
plugin_versions = {
"blackstork/iris" = ">= v0.4.2"
}
}
```

Note the version constraint set for the plugin.

## Configuration

The data source supports the following configuration arguments:

```hcl
config data iris_cases {
# Iris API url
#
# Required string.
# Must be non-empty
# For example:
api_url = "some string"
# Iris API Key
#
# Required string.
# Must be non-empty
# For example:
api_key = "some string"
# Enable/disable insecure TLS
#
# Optional bool.
# Default value:
insecure = false
}
```

## Usage

The data source supports the following execution arguments:

```hcl
data iris_cases {
# List of Case IDs
#
# Optional list of number.
# Default value:
case_ids = null
# Case Customer ID
#
# Optional number.
# Default value:
customer_id = null
# Case Owner ID
#
# Optional number.
# Default value:
owner_id = null
# Case Severity ID
#
# Optional number.
# Default value:
severity_id = null
# Case State ID
#
# Optional number.
# Default value:
state_id = null
# Case SOC ID
#
# Optional string.
# Default value:
soc_id = null
# Case opening date - lower boundary
#
# Optional string.
# Default value:
start_open_date = null
# Case opening date - higher boundary
#
# Optional string.
# Default value:
end_open_date = null
# Sort order
#
# Optional string.
# Must be one of: "desc", "asc"
# Default value:
sort = "desc"
# Size limit to retrieve
#
# Optional number.
# Must be >= 0
# Default value:
size = 0
}
```
Loading

0 comments on commit a106f7e

Please sign in to comment.