Attachment Utils
Attachment Utils provides core utilities for converting, extracting, and manipulating file attachments and encoded data.
Attachment Utils is a native Swimlane Turbine connector designed to streamline file attachment handling within security automation workflows. It enables users to easily convert Base64-encoded data into Turbine file attachments and extract UTF-8 text content from supported attachments, all without relying on external services or credentials. By integrating Attachment Utils, Swimlane Turbine users can automate file processing, enhance data extraction, and simplify the management of attachments in playbooks. This connector empowers security teams to efficiently handle file-based data, accelerating response times and reducing manual effort.
Prerequisites
Capabilities
The Attachment Utils connector has the following capabilities:
- Convert a base64 string to an attachment type
- Convert an attachment to text
Actions
Attachment to Text
Read the first supplied attachment and return its file name and UTF-8 text content for supported text files; fails if no attachment is provided.
Endpoint
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
attachments | array | Required | List of Turbine file attachments to read, for example a file from a record attachment field or the file output of another action. Only the first attachment in the list is processed; any further items are ignored. |
attachments.file | string | Optional | Turbine file ID of the attachment; the platform downloads the file content from this reference before the action runs. |
attachments.file_name | string | Optional | Name of the attachment file, e.g. report.txt. Returned in the output filename field; if empty, the name of the downloaded file is used. |
attachments.description | string | Optional | Optional free-text note about the attachment. It is not used by the action. |
Input Example
{"attachments":[{"file":"string","file_name":"Example Name","description":"string"}]}
Output
Parameter | Type | Description |
|---|---|---|
filename | string | Name of the attachment that was read, taken from the first attachment's file_name input or the downloaded file name. |
text | string | Full content of the first attachment decoded as UTF-8 text. Bytes that are not valid UTF-8 appear as the replacement character, so binary files yield mostly unreadable text. The content is not truncated. |
Output Example
{"filename":"string","text":"string"}
Base64 to Attachment
Decode a Base64 string into a new Turbine file attachment for storage, upload, or analysis, and receive a reference to the created file. Runs locally with no external calls.
Endpoint
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
filename | string | Optional | Name to give the created file, including its extension, e.g. invoice.pdf. If omitted or empty, the file is named with the SHA-256 hex digest of the decoded content and has no extension. |
base64 | string | Required | File content as a standard Base64-encoded string (RFC 4648 alphabet with = padding), without a data: URI prefix. Whitespace and line breaks are ignored. Required: the action fails if this is empty, missing, or contains characters outside the Base64 alphabet. |
Input Example
{"filename":"Example Name","base64":"string"}
Output
Parameter | Type | Description |
|---|---|---|
file | object | The created Turbine file attachment. Pass this object to an attachment field or to another action's attachment input. |
file.file | string | Turbine file ID of the created attachment, used to reference or download the file in later steps. |
file.file_name | string | Name of the created file: the filename input, or the SHA-256 hex digest of the decoded content when no filename was given. |
Output Example
{"file":{"file":"string","file_name":"Example Name"}}
Response Headers
Header | Description | Example |
|---|---|---|
Content-Type | The media type of the resource | application/json |
Date | The date and time at which the message was originated | Thu, 01 Jan 2024 00:00:00 GMT |