fabric

command module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

README

Fabric logo

Codifying and automating mission-critical communications with standardized and reusable templates.

Releases | Docs | Slack

GitHub Repository stars GitHub Release Join Slack

Fabric is an open-source Command-Line Interface (CLI) tool with a configuration language designed to encode and automate content generation for cyber security and compliance.

The diagram illustrates a Fabric template and the corresponding rendered document

Fabric generates documents based on modular templates written in Fabric Configuration Language (FCL). Template authors can delineate data requirements and content structures within the template, significantly reducing the manual effort associated with data consolidation and improving re-usability.

The plugin ecosystem expands Fabric's capabilities by offering integrations with various platforms, data stores, and security solutions, including JSON/CSV files, Elastic, OpenCTI, Splunk Cloud, GitHub, and more. A comprehensive list of supported plugins is available in the documentation.

To facilitate flexible content generation, Fabric content providers leverage powerful Go templates and incorporate capabilities such as generative AI/LLMs (OpenAI API, Azure OpenAI, etc).

Refer to the documentation for in-depth details about Fabric.

[!NOTE]
Fabric is currently in the early stages of development, and there may be some issues. If you have any suggestions, ideas, or bug reports, please share them in Fabric Community slack.

Installation

Installing Fabric

Fabric binaries for Windows, macOS, and Linux are available at "Releases" page in the project's GitHub.

To install Fabric:

  • download a release archive: choose and download Fabric release archive appropriate for your operating system (Windows, macOS/Darwin, or Linux) and architecture from "Releases" page;
  • unpack: extract the contents of the downloaded release archive into a preferred directory.

For example, the steps for macOS (arm64) are:

# Create a folder
mkdir fabric-bin

# Download the latest release of Fabric
wget https://github.com/blackstork-io/fabric/releases/latest/download/fabric_darwin_arm64.tar.gz \
    -O ./fabric_darwin_arm64.tar.gz

# Unpack Fabric release archive into `fabric-bin` folder
tar -xvzf ./fabric_darwin_arm64.tar.gz -C ./fabric-bin

# Verify that `fabric` runs
./fabric-bin/fabric --help

Installing Fabric plugins

Fabric relies on the plugins for implementing the integrations with various data sources, platforms, and services.

Before the plugins can be used during the template rendering, they must be installed. Fabric's sub-command install can install the plugins automatically from the registry.

To install the plugins:

  • add all necessary plugins into the global configuration: the global configuration has a list of plugins dependencies in plugin_versions map. Add the plugins you want to install in the map with a preferred version constraint.

    fabric {
      plugin_versions = {
        "blackstork/openai" = ">= 0.0.1",
        "blackstork/elastic" = ">= 0.0.1",
      }
    }
    
  • install the plugins: run install sub-command to install the plugins. For example:

    $ ./fabric install
    Mar 11 19:20:09.085 INF Searching plugin name=blackstork/elastic constraints=">=v0.0.1"
    Mar 11 19:20:09.522 INF Installing plugin name=blackstork/elastic version=0.4.0
    Mar 11 19:20:10.769 INF Searching plugin name=blackstork/openai constraints=">=v0.0.1"
    Mar 11 19:20:10.787 INF Installing plugin name=blackstork/openai version=0.4.0
    $
    

The plugins are downloaded and installed in ./fabric folder.

[!NOTE]
It's not necessary to install any plugins if you are only using built-in data sources and content providers in your templates

Usage

The command line interface to Fabric is fabric CLI tool.

The core sub-commands are:

  • install — installs all required plugins.
  • data — executes the data block and prints out prettified JSON to standard output.
  • render — renders the specified target (a document template) and prints out the result to standard output or a file.

To get more details, run fabric --help:

$ ./fabric --help
Usage:
  fabric [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  data        Execute a single data block
  help        Help about any command
  install     Install plugins
  render      Render the document

Flags:
      --color               enables colorizing the logs and diagnostics (if supported by the terminal and log format) (default true)
  -h, --help                help for fabric
      --log-format string   format of the logs (plain or json) (default "plain")
      --log-level string    logging level ('debug', 'info', 'warn', 'error') (default "info")
      --source-dir string   a path to a directory with *.fabric files (default ".")
  -v, --verbose             a shortcut to --log-level debug
      --version             version for fabric

Use "fabric [command] --help" for more information about a command.

Templates

You can find free Fabric templates in Fabric Templates repository.

Documentation

Visit https://blackstork.io/fabric/docs/ for full documentation.

Security

If you suspect any vulnerabilities within Fabric, please promptly report them using GitHub's security advisory reporting. We treat every report with the utmost seriousness and commit to conducting a thorough investigation.

We kindly request that you converse with us before making any public disclosures. This precautionary step ensures that no excessive information is divulged prematurely, allowing us to prepare a patch. Additionally, it gives users enough time to upgrade and enhance their system security.

License

Fabric is licensed under Apache-2.0 license. See the LICENSE file for the details.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL