Vantage Plugin Authentication
Note: The Vantage plugin is currently in development and not yet available for installation. This documentation is provided for reference and will be updated when the plugin is released.
This guide explains how to securely configure authentication for the Vantage plugin, including API key management, credential storage, and security best practices.
Table of Contents
Section titled “Table of Contents”- Overview
- Obtaining API Tokens
- Configuration Setup
- Environment Variables
- Secrets Management
- Token Types
- Security Best Practices
- Credential Rotation
- Troubleshooting Authentication
Overview
Section titled “Overview”The Vantage plugin requires API authentication to access cost data from Vantage’s REST API. Authentication uses bearer tokens that must be provided via environment variables or configuration files.
Authentication Flow
Section titled “Authentication Flow”1. Plugin loads configuration (config.yaml)2. Reads API token from environment variable3. Attaches bearer token to all API requests4. Vantage validates token and returns cost dataSecurity Principles
Section titled “Security Principles”- Never hardcode tokens in configuration files
- Use environment variables or secrets management systems
- Rotate credentials regularly (every 90 days recommended)
- Use least-privilege tokens (Cost Report tokens over Workspace tokens)
- Monitor token usage for suspicious activity
Obtaining API Tokens
Section titled “Obtaining API Tokens”Step 1: Log into Vantage Console
Section titled “Step 1: Log into Vantage Console”- Navigate to https://console.vantage.sh
- Sign in with your Vantage account credentials
- Navigate to Settings → API Tokens
Step 2: Generate New API Token
Section titled “Step 2: Generate New API Token”Option A: Create Cost Report Token (Recommended)
Section titled “Option A: Create Cost Report Token (Recommended)”- Go to Cost Reports in Vantage console
- Select the report you want to use
- Click API Access → Generate Token
- Name the token (e.g.,
finfocus-production) - Copy the generated token (starts with
cr_) - Store securely (you won’t be able to see it again)
Option B: Create Workspace Token (Fallback)
Section titled “Option B: Create Workspace Token (Fallback)”- Go to Settings → API Tokens
- Click Generate New Token
- Name the token (e.g.,
finfocus-workspace) - Select permissions: Read-only cost access
- Copy the generated token (starts with
ws_) - Store securely
Step 3: Verify Token Permissions
Section titled “Step 3: Verify Token Permissions”Test the token has correct permissions:
# Set tokenexport FINFOCUS_VANTAGE_TOKEN="your_token_here"
# Test API accesscurl -H "Authorization: Bearer $FINFOCUS_VANTAGE_TOKEN" \ https://api.vantage.sh/costs
# Expected: 200 OK or 400 (bad request params)# NOT 401 (unauthorized) or 403 (forbidden)Configuration Setup
Section titled “Configuration Setup”Method 1: Environment Variable (Recommended)
Section titled “Method 1: Environment Variable (Recommended)”Configure the token via environment variable reference in config.yaml:
version: 0.1source: vantage
credentials: token: ${FINFOCUS_VANTAGE_TOKEN} # Reference env var
params: cost_report_token: 'cr_abc123def456' granularity: 'day'Set the environment variable:
export FINFOCUS_VANTAGE_TOKEN="your_actual_token_value"Method 2: Direct Configuration (Development Only)
Section titled “Method 2: Direct Configuration (Development Only)”WARNING: Only use for local development. Never commit tokens to version control.
version: 0.1source: vantage
credentials: token: 'vantage_token_value_here' # Direct value (NOT RECOMMENDED)
params: cost_report_token: 'cr_abc123def456' granularity: 'day'Method 3: Multiple Environment Variables
Section titled “Method 3: Multiple Environment Variables”Configure different token types:
version: 0.1source: vantage
credentials: token: ${FINFOCUS_VANTAGE_TOKEN}
params: # Use env var for cost report token too cost_report_token: ${FINFOCUS_VANTAGE_COST_REPORT_TOKEN} granularity: 'day'Set both variables:
export FINFOCUS_VANTAGE_TOKEN="vantage_api_token"export FINFOCUS_VANTAGE_COST_REPORT_TOKEN="cr_abc123def456"Environment Variables
Section titled “Environment Variables”Standard Environment Variables
Section titled “Standard Environment Variables”The plugin supports these environment variables:
| Variable | Purpose | Format | Example |
|---|---|---|---|
FINFOCUS_VANTAGE_TOKEN | Main API token | String | vantage_3f4g... |
FINFOCUS_VANTAGE_COST_REPORT_TOKEN | Cost Report | cr_* | cr_abc123 |
FINFOCUS_VANTAGE_WORKSPACE_TOKEN | Workspace | ws_* | ws_xyz789 |
Setting Environment Variables
Section titled “Setting Environment Variables”Bash/Zsh:
export FINFOCUS_VANTAGE_TOKEN="your_token"
# Persist in shell profileecho 'export FINFOCUS_VANTAGE_TOKEN="your_token"' >> ~/.bashrcsource ~/.bashrcFish Shell:
set -Ux FINFOCUS_VANTAGE_TOKEN "your_token"Windows PowerShell:
$env:FINFOCUS_VANTAGE_TOKEN="your_token"
# Persist for user[Environment]::SetEnvironmentVariable("FINFOCUS_VANTAGE_TOKEN", "your_token", "User")Verifying Environment Variables
Section titled “Verifying Environment Variables”# Check if setecho $FINFOCUS_VANTAGE_TOKEN
# Should output your token (not empty)# If empty, token not setSecrets Management
Section titled “Secrets Management”AWS Secrets Manager
Section titled “AWS Secrets Manager”Store Vantage tokens in AWS Secrets Manager:
# Store secretaws secretsmanager create-secret \ --name finfocus/vantage/token \ --secret-string "your_vantage_token"
# Retrieve and useexport FINFOCUS_VANTAGE_TOKEN=$(aws secretsmanager get-secret-value \ --secret-id finfocus/vantage/token \ --query SecretString \ --output text)
# Run pluginfinfocus-vantage pull --config config.yamlHashiCorp Vault
Section titled “HashiCorp Vault”Store tokens in Vault:
# Store secretvault kv put secret/finfocus/vantage token="your_vantage_token"
# Retrieve and useexport FINFOCUS_VANTAGE_TOKEN=$(vault kv get -field=token secret/finfocus/vantage)
# Run pluginfinfocus-vantage pull --config config.yamlKubernetes Secrets
Section titled “Kubernetes Secrets”Store as Kubernetes secret for containerized deployments:
apiVersion: v1kind: Secretmetadata: name: finfocus-vantage namespace: defaulttype: OpaquestringData: token: 'your_vantage_token' cost_report_token: 'cr_abc123def456'Reference in pod:
apiVersion: batch/v1kind: CronJobmetadata: name: finfocus-vantage-syncspec: schedule: '0 2 * * *' jobTemplate: spec: template: spec: containers: - name: vantage-sync image: finfocus-vantage:latest env: - name: FINFOCUS_VANTAGE_TOKEN valueFrom: secretKeyRef: name: finfocus-vantage key: token - name: FINFOCUS_VANTAGE_COST_REPORT_TOKEN valueFrom: secretKeyRef: name: finfocus-vantage key: cost_report_tokenDocker Secrets
Section titled “Docker Secrets”For Docker Swarm deployments:
# Create secretecho "your_vantage_token" | docker secret create vantage_token -
# Use in servicedocker service create \ --name finfocus-vantage \ --secret vantage_token \ --env FINFOCUS_VANTAGE_TOKEN_FILE=/run/secrets/vantage_token \ finfocus-vantage:latestToken Types
Section titled “Token Types”Cost Report Token (Preferred)
Section titled “Cost Report Token (Preferred)”Format: cr_ followed by alphanumeric characters
Characteristics:
- Scoped to specific cost report
- Predefined filters and grouping
- Better performance (smaller dataset)
- More secure (narrower scope)
- Recommended for production
Use Cases:
- Production deployments
- Automated scheduled syncs
- Team-specific cost reports
- Compliance-sensitive environments
Example Configuration:
credentials: token: ${FINFOCUS_VANTAGE_TOKEN}
params: cost_report_token: 'cr_abc123def456' # Preferred granularity: 'day'Workspace Token (Fallback)
Section titled “Workspace Token (Fallback)”Format: ws_ followed by alphanumeric characters
Characteristics:
- Broad access to all workspace data
- Requires additional filtering
- Less performant (larger dataset)
- Use when Cost Report tokens unavailable
Use Cases:
- Initial testing and evaluation
- Ad-hoc queries across multiple reports
- Development environments
- Exploratory analysis
Example Configuration:
credentials: token: ${FINFOCUS_VANTAGE_TOKEN}
params: workspace_token: 'ws_xyz789ghi012' # Fallback granularity: 'day'Security Best Practices
Section titled “Security Best Practices”Do’s ✅
Section titled “Do’s ✅”-
Use Environment Variables
Terminal window export FINFOCUS_VANTAGE_TOKEN="your_token" -
Prefer Cost Report Tokens
- Narrowest scope principle
- Better security posture
-
Rotate Tokens Regularly
- Every 90 days recommended
- Immediately upon suspected compromise
-
Use Secrets Management Systems
- AWS Secrets Manager
- HashiCorp Vault
- Kubernetes Secrets
-
Restrict Token Permissions
- Read-only cost access
- No write or admin permissions
-
Monitor Token Usage
- Review API access logs
- Alert on suspicious patterns
- Track token activity
-
Use Different Tokens Per Environment
Terminal window # Productionexport FINFOCUS_VANTAGE_TOKEN="$PROD_TOKEN"# Stagingexport FINFOCUS_VANTAGE_TOKEN="$STAGING_TOKEN"# Developmentexport FINFOCUS_VANTAGE_TOKEN="$DEV_TOKEN"
Don’ts ❌
Section titled “Don’ts ❌”-
Never Hardcode Tokens
# BAD - Don't do thiscredentials:token: 'vantage_actual_token_value' -
Never Commit Tokens to Git
Terminal window # Add to .gitignoreecho "*.token" >> .gitignoreecho "*.secret" >> .gitignoreecho "config.yaml" >> .gitignore # If contains tokens -
Never Log Token Values
Terminal window # BAD - Tokens may leak in logsecho "Token: $FINFOCUS_VANTAGE_TOKEN" -
Never Share Tokens via Email/Chat
- Use secrets management systems
- Share securely via 1Password/LastPass
- Generate new token for recipient
-
Never Use Workspace Tokens When Cost Report Available
- Prefer narrower scope
- Better security and performance
-
Never Reuse Tokens Across Environments
- Separate tokens for dev/staging/prod
- Limits blast radius of compromise
Credential Rotation
Section titled “Credential Rotation”Rotation Schedule
Section titled “Rotation Schedule”Recommended Frequency:
- Production: Every 90 days
- Staging: Every 180 days
- Development: Every 365 days or on team member departure
Rotation Procedure
Section titled “Rotation Procedure”Step 1: Generate New Token
Section titled “Step 1: Generate New Token”- Log into Vantage console
- Navigate to Settings → API Tokens
- Generate new token with same permissions
- Name it with rotation date (e.g.,
finfocus-2024-Q1)
Step 2: Update Secrets Management
Section titled “Step 2: Update Secrets Management”# AWS Secrets Manageraws secretsmanager update-secret \ --secret-id finfocus/vantage/token \ --secret-string "new_token_value"
# HashiCorp Vaultvault kv put secret/finfocus/vantage token="new_token_value"
# Kuberneteskubectl create secret generic finfocus-vantage \ --from-literal=token="new_token_value" \ --dry-run=client -o yaml | kubectl apply -f -Step 3: Verify New Token
Section titled “Step 3: Verify New Token”# Test new tokenexport FINFOCUS_VANTAGE_TOKEN="new_token_value"curl -H "Authorization: Bearer $FINFOCUS_VANTAGE_TOKEN" \ https://api.vantage.sh/costs
# Expected: 200 OKStep 4: Deploy Updated Configuration
Section titled “Step 4: Deploy Updated Configuration”# Restart services using the tokensystemctl restart finfocus-vantage
# Or for Kuberneteskubectl rollout restart deployment/finfocus-vantageStep 5: Revoke Old Token
Section titled “Step 5: Revoke Old Token”- Log into Vantage console
- Navigate to Settings → API Tokens
- Find old token
- Click Revoke
- Confirm revocation
Step 6: Verify Services Still Working
Section titled “Step 6: Verify Services Still Working”# Check logs for auth errorsjournalctl -u finfocus-vantage -n 50
# Or for Kuberneteskubectl logs -l app=finfocus-vantage --tail=50Emergency Rotation
Section titled “Emergency Rotation”If token compromised, rotate immediately:
- Generate new token (Step 1 above)
- Update secrets (Step 2 above)
- Revoke compromised token immediately
- Deploy updated configuration
- Review access logs for unauthorized access
- Notify security team if breach detected
Troubleshooting Authentication
Section titled “Troubleshooting Authentication”Error: 401 Unauthorized
Section titled “Error: 401 Unauthorized”Symptoms:
Error: 401 UnauthorizedFailed to authenticate with Vantage APICauses:
- Token not set or empty
- Token expired or revoked
- Token lacks required permissions
Solutions:
-
Verify token is set:
Terminal window echo $FINFOCUS_VANTAGE_TOKEN -
Test token validity:
Terminal window curl -H "Authorization: Bearer $FINFOCUS_VANTAGE_TOKEN" \https://api.vantage.sh/costs -
Regenerate token in Vantage console
Error: 403 Forbidden
Section titled “Error: 403 Forbidden”Symptoms:
Error: 403 ForbiddenInsufficient permissions to access cost dataCauses:
- Token has wrong permissions
- Cost Report Token doesn’t have access to specified report
- Workspace Token doesn’t have cost access
Solutions:
- Verify token permissions in Vantage console
- Ensure token has Read-only cost access
- For Cost Report Token, verify report access
- Generate new token with correct permissions
Error: Token Not Found in Environment
Section titled “Error: Token Not Found in Environment”Symptoms:
Error: FINFOCUS_VANTAGE_TOKEN environment variable not setSolutions:
-
Set environment variable:
Terminal window export FINFOCUS_VANTAGE_TOKEN="your_token" -
Verify it’s set:
Terminal window echo $FINFOCUS_VANTAGE_TOKEN -
Ensure it persists across sessions:
Terminal window echo 'export FINFOCUS_VANTAGE_TOKEN="your_token"' >> ~/.bashrcsource ~/.bashrc
Error: Invalid Token Format
Section titled “Error: Invalid Token Format”Symptoms:
Error: Invalid token formatCauses:
- Token contains whitespace or newlines
- Token truncated or incomplete
- Wrong token type provided
Solutions:
-
Verify token format:
Terminal window # Cost Report Token should start with cr_echo $FINFOCUS_VANTAGE_TOKEN | grep "^cr_"# Workspace Token should start with ws_echo $FINFOCUS_VANTAGE_TOKEN | grep "^ws_" -
Ensure no whitespace:
Terminal window export FINFOCUS_VANTAGE_TOKEN=$(echo "your_token" | tr -d '[:space:]')
Additional Resources
Section titled “Additional Resources”- Vantage API Documentation
- Vantage Security Best Practices
- Setup Guide - Installation and configuration
- Features Guide - Supported capabilities
- Troubleshooting Guide - Common issues