Skip to main content

VerityNgn Authentication Guide

Deep dive into Google Cloud authentication options for VerityNgn.

Overview

VerityNgn requires Google Cloud authentication for:
  • Vertex AI (required): Gemini multimodal analysis
  • Google Custom Search API (optional): Evidence gathering
  • YouTube Data API v3 (optional): Enhanced counter-intelligence
  • Cloud Storage (optional): Production deployments

Authentication Methods

Method 1: Service Account (Production)

Best for:
  • Production deployments
  • Automated workflows
  • CI/CD pipelines
  • Long-running services
Advantages:
  • ✅ No browser interaction needed
  • ✅ Consistent credentials
  • ✅ Fine-grained permission control
  • ✅ Secure key management
  • ✅ Works in containers/cloud
Disadvantages:
  • ⚠️ Must manage JSON key files
  • ⚠️ Key rotation required

Setup Steps

  1. Create Service Account:
  1. Grant Permissions:
  1. Create JSON Key:
  1. Configure Environment:

Method 2: Application Default Credentials (Development)

Best for:
  • Local development
  • Interactive use
  • Quick prototyping
  • Developer workstations
Advantages:
  • ✅ Quick setup
  • ✅ No key file management
  • ✅ Uses your personal credentials
  • ✅ Easy for development
Disadvantages:
  • ⚠️ Requires browser login
  • ⚠️ May expire and need re-authentication
  • ⚠️ Not suitable for production
  • ⚠️ Doesn’t work in containers

Setup Steps

  1. Install Google Cloud SDK:
  1. Authenticate:
  1. Set Project:
  1. Verify:

Method 3: Workload Identity (Kubernetes/GKE)

Best for:
  • Kubernetes deployments
  • Google Kubernetes Engine (GKE)
  • Cloud Run
  • Cloud Functions
Advantages:
  • ✅ No key files
  • ✅ Automatic credential rotation
  • ✅ Enhanced security
  • ✅ Integrated with GCP services
Disadvantages:
  • ⚠️ Only works in GCP environments
  • ⚠️ More complex setup

Setup Steps

  1. Enable Workload Identity:
  1. Configure Service Account:
  1. Use in Pod:

Required Permissions

Minimum Required (Core Functionality)

Grants access to:
  • Vertex AI API
  • Gemini models
  • Multimodal analysis

Custom Role (Least Privilege)

Create a custom role with only necessary permissions:

API Keys (Optional Services)

Google Custom Search API

Purpose: Web evidence gathering Setup:
  1. Enable API:
  1. Create API Key:
  1. Create Custom Search Engine:
  1. Add to .env:

YouTube Data API v3

Purpose: Enhanced counter-intelligence Setup:
  1. Enable API:
  1. Create API Key:
  1. Add to .env:
Alternative: yt-dlp fallback (slower but no API key needed)

Security Best Practices

Service Account Security

  1. Principle of Least Privilege:
  1. Key Rotation:
  1. Key Storage:

API Key Security

  1. Restrict API Keys:
  1. Use Environment Variables:
  1. Rotate Keys:

Multi-Environment Setup

Development:
Production:
Load based on environment:

Troubleshooting

”Could not automatically determine credentials”

Cause: No valid credentials found Check:
Solutions:

“Permission denied” for Vertex AI

Cause: Service account lacks required role Fix:

“Reauthentication is needed”

Cause: OAuth2 credentials expired (ADC) Fix:

“API key not found”

Cause: API keys not configured (optional) Impact: Limited functionality, not critical Fix (optional):
Or accept reduced functionality:
  • Works without Search API (limited verification)
  • Works without YouTube API (uses yt-dlp fallback)

Verification

Test Authentication

Expected output:

Test Vertex AI Access

Test API Keys


Next Steps


Last Updated: October 28, 2025
Version: 2.0