Skip to content

Commit

Permalink
update mocks, examples & docks
Browse files Browse the repository at this point in the history
  • Loading branch information
dobarx committed Feb 20, 2024
1 parent 1deafb4 commit c4a3e2c
Show file tree
Hide file tree
Showing 22 changed files with 849 additions and 14 deletions.
24 changes: 24 additions & 0 deletions .goreleaser-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,27 @@ builds:
binary: "plugins/blackstork/terraform@{{ .Version }}"
ldflags: "-X main.version={{.Version}}"
no_unique_dist_dir: true

- id: hackerone
main: ./internal/hackerone/cmd
binary: "plugins/blackstork/hackerone@{{ .Version }}"
ldflags: "-X main.version={{.Version}}"
no_unique_dist_dir: true

- id: virustotal
main: ./internal/virustotal/cmd
binary: "plugins/blackstork/virustotal@{{ .Version }}"
ldflags: "-X main.version={{.Version}}"
no_unique_dist_dir: true

- id: splunk
main: ./internal/splunk/cmd
binary: "plugins/blackstork/splunk@{{ .Version }}"
ldflags: "-X main.version={{.Version}}"
no_unique_dist_dir: true

- id: stixview
main: ./internal/stixview/cmd
binary: "plugins/blackstork/stixview@{{ .Version }}"
ldflags: "-X main.version={{.Version}}"
no_unique_dist_dir: true
40 changes: 40 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,42 @@ builds:
- windows
- darwin

- id: hackerone
main: ./internal/hackerone/cmd
binary: "plugins/blackstork/hackerone@{{ .Version }}"
flags: "-trimpath"
goos:
- linux
- windows
- darwin

- id: virustotal
main: ./internal/virustotal/cmd
binary: "plugins/blackstork/virustotal@{{ .Version }}"
flags: "-trimpath"
goos:
- linux
- windows
- darwin

- id: splunk
main: ./internal/splunk/cmd
binary: "plugins/blackstork/splunk@{{ .Version }}"
flags: "-trimpath"
goos:
- linux
- windows
- darwin

- id: stixview
main: ./internal/stixview/cmd
binary: "plugins/blackstork/stixview@{{ .Version }}"
flags: "-trimpath"
goos:
- linux
- windows
- darwin

archives:
- id: fabric
format: tar.gz
Expand Down Expand Up @@ -122,6 +158,10 @@ archives:
- postgresql
- sqlite
- terraform
- hackerone
- virustotal
- splunk
- stixview
name_template: >-
plugins_
{{- .Os }}_
Expand Down
12 changes: 12 additions & 0 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ packages:
interfaces:
Client:
github.com/blackstork-io/fabric/internal/openai/client:
config:
interfaces:
Client:
github.com/blackstork-io/fabric/internal/hackerone/client:
config:
interfaces:
Client:
github.com/blackstork-io/fabric/internal/virustotal/client:
config:
interfaces:
Client:
github.com/blackstork-io/fabric/internal/splunk/client:
config:
interfaces:
Client:
91 changes: 91 additions & 0 deletions docs/plugins/hackerone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
title: blackstork/hackerone
weight: 20
type: docs
---

# `blackstork/hackerone` plugin

## 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/hackerone" = "=> v0.0.0-dev"
}
}
```

## Data sources

The plugin has the following data sources available:

### `hackerone_reports`

#### Configuration

The data source supports the following configuration parameters:

```hcl
config data hackerone_reports {
api_token = <string> # required
api_username = <string> # required
}
```

#### Usage

The data source supports the following parameters in the data blocks:

```hcl
data hackerone_reports {
assignee = <list of string> # optional
bounty_awarded_at__gt = <string> # optional
bounty_awarded_at__lt = <string> # optional
bounty_awarded_at__null = <bool> # optional
closed_at__gt = <string> # optional
closed_at__lt = <string> # optional
closed_at__null = <bool> # optional
created_at__gt = <string> # optional
created_at__lt = <string> # optional
custom_fields = <map of string> # optional
disclosed_at__gt = <string> # optional
disclosed_at__lt = <string> # optional
disclosed_at__null = <bool> # optional
first_program_activity_at__gt = <string> # optional
first_program_activity_at__lt = <string> # optional
first_program_activity_at__null = <bool> # optional
hacker_published = <bool> # optional
id = <list of number> # optional
inbox_ids = <list of number> # optional
keyword = <string> # optional
last_activity_at__gt = <string> # optional
last_activity_at__lt = <string> # optional
last_program_activity_at__gt = <string> # optional
last_program_activity_at__lt = <string> # optional
last_program_activity_at__null = <bool> # optional
last_public_activity_at__gt = <string> # optional
last_public_activity_at__lt = <string> # optional
last_report_activity_at__gt = <string> # optional
last_report_activity_at__lt = <string> # optional
page_number = <number> # optional
program = <list of string> # optional
reporter = <list of string> # optional
reporter_agreed_on_going_public = <bool> # optional
severity = <list of string> # optional
size = <number> # optional
sort = <string> # optional
state = <list of string> # optional
submitted_at__gt = <string> # optional
submitted_at__lt = <string> # optional
swag_awarded_at__gt = <string> # optional
swag_awarded_at__lt = <string> # optional
swag_awarded_at__null = <bool> # optional
triaged_at__gt = <string> # optional
triaged_at__lt = <string> # optional
triaged_at__null = <bool> # optional
weakness_id = <list of number> # optional
}
```
52 changes: 52 additions & 0 deletions docs/plugins/splunk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: blackstork/splunk
weight: 20
type: docs
---

# `blackstork/splunk` plugin

## 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/splunk" = "=> v0.0.0-dev"
}
}
```

## Data sources

The plugin has the following data sources available:

### `splunk_search`

#### Configuration

The data source supports the following configuration parameters:

```hcl
config data splunk_search {
auth_token = <string> # required
deployment_name = <string> # optional
host = <string> # optional
}
```

#### Usage

The data source supports the following parameters in the data blocks:

```hcl
data splunk_search {
earliest_time = <string> # optional
latest_time = <string> # optional
max_count = <number> # optional
rf = <list of string> # optional
search_query = <string> # required
status_buckets = <number> # optional
}
```
50 changes: 50 additions & 0 deletions docs/plugins/stixview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: blackstork/stixview
weight: 20
type: docs
---

# `blackstork/stixview` plugin

## 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/stixview" = "=> v0.0.0-dev"
}
}
```



## Content providers
The plugin has the following content providers available:

### `stixview`

#### Configuration

The content provider doesn't support configuration.

#### Usage

The content source supports the following parameters in the content blocks:

```hcl
content stixview {
caption = <string> # optional
gist_id = <string> # optional
height = <number> # optional
show_footer = <bool> # optional
show_idrefs = <bool> # optional
show_labels = <bool> # optional
show_marking_nodes = <bool> # optional
show_sidebar = <bool> # optional
show_tlp_as_tags = <bool> # optional
stix_url = <string> # optional
width = <number> # optional
}
```
48 changes: 48 additions & 0 deletions docs/plugins/virustotal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: blackstork/virustotal
weight: 20
type: docs
---

# `blackstork/virustotal` plugin

## 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/virustotal" = "=> v0.0.0-dev"
}
}
```

## Data sources

The plugin has the following data sources available:

### `virustotal_api_usage`

#### Configuration

The data source supports the following configuration parameters:

```hcl
config data virustotal_api_usage {
api_key = <string> # required
}
```

#### Usage

The data source supports the following parameters in the data blocks:

```hcl
data virustotal_api_usage {
end_date = <string> # optional
group_id = <string> # optional
start_date = <string> # optional
user_id = <string> # optional
}
```
2 changes: 1 addition & 1 deletion examples/plugins/basic/content_greeting.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func makeGreetingContentProvider() *plugin.ContentProvider {
return &plugin.ContentProvider{
// Config is optional, in this case we don't need it
// We only define the schema for the arguments
Args: &hcldec.ObjectSpec{
Args: hcldec.ObjectSpec{
"name": &hcldec.AttrSpec{
Name: "name",
Required: true,
Expand Down
4 changes: 2 additions & 2 deletions examples/plugins/basic/data_random_numbers.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (
func makeRandomNumbersDataSource() *plugin.DataSource {
return &plugin.DataSource{
// Config is optional, we can define the schema for the config that is reusable for this data source
Config: &hcldec.ObjectSpec{
Config: hcldec.ObjectSpec{
"min": &hcldec.AttrSpec{
Name: "min",
Required: false,
Expand All @@ -35,7 +35,7 @@ func makeRandomNumbersDataSource() *plugin.DataSource {
},
},
// We define the schema for the arguments
Args: &hcldec.ObjectSpec{
Args: hcldec.ObjectSpec{
"length": &hcldec.AttrSpec{
Name: "length",
Required: true,
Expand Down
4 changes: 4 additions & 0 deletions examples/templates/stixview/data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
id,active,name,age,height
b8fa4bb0-6dd4-45ba-96e0-9a182b2b932e,true,Stacey,26,1.98
b0086c49-bcd8-4aae-9f88-4f46b128e709,false,Myriam,33,1.81
a12d2a8c-eebc-42b3-be52-1ab0a2969a81,true,Oralee,31,2.23
Loading

0 comments on commit c4a3e2c

Please sign in to comment.