Example Tool Configuration and Import
trickest.yaml
The trickest.yaml
file is a structured configuration that defines how a tool will be integrated and function within the Trickest platform.
This file includes essential details like the tool's name, description, category, and technical specifics such as the Docker image URL and command execution parameters. It serves as a blueprint for the Trickest system to recognize and properly handle the tool, ensuring it operates seamlessly within your workflows.
name: tool-name
description: Tool short description
category: Recon
source_url: https://github.com/author/tool-name
docker_image: quay.io/trickest/tool-name:latest
command: "/bin/tool-name"
output_parameter: "-o"
output_type: file
inputs:
parameter-1:
command: -d
description: string-input for tool
order: 0
visible: true
type: string
parameter-2:
command: -file
description: file-input for tool
order: 0
visible: true
type: string
license_info:
name: MIT
url: https://github.com/author/tool-name/blob/1234567890123456789/LICENSE
Dockerfile
For Trickest private tools, a Dockerfile is essential for defining the environment in which your tool will run. It specifies the base image, necessary dependencies, build instructions, and how the tool should be executed. The Dockerfile ensures that your tool can be consistently deployed and run within the Trickest platform, regardless of the underlying infrastructure.
FROM golang:1.17.3-alpine AS build-env
RUN apk add --no-cache git
RUN go install -v github.com/author/tool-name@latest
FROM alpine:3.15.0
RUN apk -U upgrade --no-cache \
&& apk add --no-cache bind-tools ca-certificates
COPY --from=build-env /go/bin/tool-name /usr/local/bin/
ENTRYPOINT ["tool-name"]
Once your Dockerfile is ready, the following steps involve building and pushing the Docker image to a registry. This process is critical for making the tool available for integration into Trickest workflows.
Here's how you can do it:
Log in to Docker Registry
Use the docker login command to authenticate with the Docker registry where you intend to push your image.
docker login quay.io # or any other registry
Enter your username and password when prompted.
Build the Docker Image
Navigate to the directory containing your Dockerfile and build the image using the docker build command:
docker build -t quay.io/username/tool-name:tag .
Replace username, tool-name, and tag with your Docker registry username, your tool's name, and the image's version or tag.
Push the Image to the Registry
After successfully building the image, push it to the Docker registry using docker push:
docker push quay.io/username/tool-name:tag
Ensure the tag used matches the one specified in the build step.
By completing these steps, your custom tool image will be available in your Docker registry, ready to be integrated into Trickest as a private tool. This process is essential for maintaining version control and ensuring consistent deployment of your tools across various environments.
Adding a Private Tool Through trickest-cli
Adding a new private tool to the Trickest platform using the trickest-cli
is straightforward. This method allows you to integrate custom tools into your Trickest workflows efficiently.
Steps to Add a New Tool
-
Navigate to the Directory
- Use the
cd
command to navigate to the directory where yourtrickest.yaml
file is located.
- Use the
-
Run the Create Command
- Execute the following command to create a new private tool integration in Trickest:
trickest tools create --file tool.yaml
- Replace
tool.yaml
with the path to your YAML file.
- Execute the following command to create a new private tool integration in Trickest:
-
Confirmation and Testing
-
After running the command, you should receive a confirmation that your tool has been successfully created.
-
It’s a good practice to test the tool in a workflow to ensure it has been configured correctly.
-
Managing Your Tool
Once your tool is added, you can manage it using various commands in the Trickest-CLI:
-
Update Tool: To update the tool, modify your
trickest.yaml
file and then runtrickest tools update --file tool.yaml
. -
List Tools: To list all your private tools, use
trickest tools list
. Add--json
to display the output in JSON format. -
Delete Tool: If you need to delete a tool, use
trickest tools delete
and specify the tool by its--name
or--id
.
By following these steps, you can efficiently manage the lifecycle of your private tools within the Trickest platform, enhancing the capabilities and customizability of your workflows.