Set up the TrendAI Security Scanner - configure API key, region, and install TMAS CLI.
Configure the TrendAI Security Scanner with API credentials and install required tools.
First, detect the OS to use appropriate commands:
uname -s 2>/dev/null || echo "Windows"
Use AskUserQuestion to ask the user for their Vision One API token:
Question: "Enter your Vision One API Key" Header: "API Key" Options:
If they need to create one, tell them:
Use AskUserQuestion to ask which region they use:
Question: "Which Vision One region are you using?" Header: "Region" Options:
Tell the user to add these to their shell profile (~/.zshrc or ~/.bashrc):
# TrendAI Security Scanner Configuration
export TMAS_API_KEY="<their-api-key>"
export V1_REGION="<their-region-endpoint>"
Then run:
source ~/.zshrc # or ~/.bashrc
On Windows, use setx for persistence AND export for current session:
# Set for future sessions (persistent)
setx TMAS_API_KEY "<their-api-key>"
setx V1_REGION "<their-region-endpoint>"
# Set for current session
export TMAS_API_KEY="<their-api-key>"
export V1_REGION="<their-region-endpoint>"
Note: setx saves for future sessions but does NOT update the current session. The export commands are needed for immediate use.
macOS/Linux:
~/.local/bin/tmas version 2>/dev/null || echo "NOT_INSTALLED"
Windows (Git Bash):
"$HOME/.local/bin/tmas.exe" version 2>/dev/null || echo "NOT_INSTALLED"
macOS/Linux:
OS=$(uname -s)
ARCH=$(uname -m)
mkdir -p ~/.local/bin
if [ "$OS" = "Darwin" ] && [ "$ARCH" = "arm64" ]; then
curl -L https://cli.artifactscan.cloudone.trendmicro.com/tmas-cli/latest/tmas-cli_Darwin_arm64.zip -o /tmp/tmas.zip
unzip -o /tmp/tmas.zip -d ~/.local/bin
elif [ "$OS" = "Darwin" ] && [ "$ARCH" = "x86_64" ]; then
curl -L https://cli.artifactscan.cloudone.trendmicro.com/tmas-cli/latest/tmas-cli_Darwin_x86_64.zip -o /tmp/tmas.zip
unzip -o /tmp/tmas.zip -d ~/.local/bin
elif [ "$OS" = "Linux" ] && [ "$ARCH" = "x86_64" ]; then
curl -L https://cli.artifactscan.cloudone.trendmicro.com/tmas-cli/latest/tmas-cli_Linux_x86_64.tar.gz -o /tmp/tmas.tar.gz
tar -xzf /tmp/tmas.tar.gz -C ~/.local/bin
elif [ "$OS" = "Linux" ]; then
curl -L https://cli.artifactscan.cloudone.trendmicro.com/tmas-cli/latest/tmas-cli_Linux_arm64.tar.gz -o /tmp/tmas.tar.gz
tar -xzf /tmp/tmas.tar.gz -C ~/.local/bin
fi
chmod +x ~/.local/bin/tmas
~/.local/bin/tmas version
Windows (Git Bash):
# Create install directory
mkdir -p "$HOME/.local/bin"
# Download TMAS CLI for Windows
curl -L https://cli.artifactscan.cloudone.trendmicro.com/tmas-cli/latest/tmas-cli_Windows_x86_64.zip -o "$HOME/tmas.zip"
# Extract using PowerShell (with execution policy bypass)
powershell -ExecutionPolicy Bypass -Command "Expand-Archive -Force -Path '$HOME/tmas.zip' -DestinationPath '$HOME/.local/bin'"
# Verify installation (use forward slashes and quotes)
"$HOME/.local/bin/tmas.exe" version
# Clean up
rm "$HOME/tmas.zip"
Important Windows notes:
$HOME instead of %USERPROFILE% (Git Bash doesn't expand Windows env vars)/) not backslashes (\) for paths-ExecutionPolicy Bypass with PowerShell commandsmacOS/Linux:
echo "=== TrendAI Setup Verification ==="
echo ""
echo "TMAS CLI:"
~/.local/bin/tmas version 2>/dev/null && echo "OK" || echo "NOT INSTALLED"
echo ""
echo "API Key:"
[ -n "$TMAS_API_KEY" ] && echo "Configured (${#TMAS_API_KEY} chars)" || echo "NOT SET"
echo ""
echo "Region:"
echo "${V1_REGION:-api.xdr.trendmicro.com (default)}"
Windows (Git Bash):
echo "=== TrendAI Setup Verification ==="
echo ""
echo "TMAS CLI:"
"$HOME/.local/bin/tmas.exe" version 2>/dev/null && echo "OK" || echo "NOT INSTALLED"
echo ""
echo "API Key:"
[ -n "$TMAS_API_KEY" ] && echo "Configured (${#TMAS_API_KEY} chars)" || echo "NOT SET"
echo ""
echo "Region:"
echo "${V1_REGION:-api.xdr.trendmicro.com (default)}"
When setup is complete, tell the user:
Setup Complete! You can now use these commands:
/trendai-scan-tmas - Scan for vulnerabilities and secrets/trendai-scan-iac - Scan Terraform/CloudFormation for misconfigs/trendai-scan-llm - Test LLM endpoints for prompt injectionIf the user plans to use /trendai-scan-llm, they also need to set TARGET_API_KEY:
# The API key for the LLM endpoint being scanned (separate from TMAS_API_KEY)
export TARGET_API_KEY="your-llm-endpoint-api-key"
On Windows, also run:
setx TARGET_API_KEY "your-llm-endpoint-api-key"