This guide covers different ways to install and run Global SAST Scanner.
Before installing, ensure you have:
- Python 3.9+ installed
- Docker installed and running
- Git installed
- API Tokens:
- GitHub Personal Access Token with
reposcope (Create here) - GitLab API Token with
read_apiscope (GitLab.com or your instance)
- GitHub Personal Access Token with
# Run the quick start script - it handles everything!
./scripts/quick-start.shThe script will:
- Check requirements (Docker, kubectl, etc.)
- Create environment configuration
- Let you choose deployment method (Docker Compose, Kubernetes, or Python)
- Build and start services
- Show access information
# 1. Copy environment template
cp env.example .env
# 2. Edit .env with your API tokens
vim .env
# 3. Start with the deployment script
./scripts/deploy-local.sh --build
# 4. Access the API
./scripts/deploy-local.sh --port-forwardSee Kubernetes Deployment Guide for detailed instructions.
Quick version:
./scripts/deploy-local.sh --generate # Create .env template
vim .env # Add your tokens
./scripts/deploy-local.sh --build # Deploy to Kubernetes
./scripts/deploy-local.sh --port-forward # Access the APIThe simplest local deployment option:
cp env.example .env
vim .env # Fill in API tokens and secret key
docker compose up --build -dThis starts Redis, the API server, and one worker. Visit http://localhost:5000/apidocs/.
See Local Development Guide for detailed instructions.
Quick version:
# Create and activate a virtual environment at the repo root
python3 -m venv venv
source venv/bin/activate
# Install all modules in editable mode
pip install -e gsast-core/ -e gsast-api/ -e gsast-worker/ -e gsast-cli/
# Start Redis
docker run -d -p 6379:6379 redis:7-alpine
# Configure environment
export REDIS_URL="redis://localhost:6379"
export GITHUB_API_TOKEN="your_token"
export GITLAB_API_TOKEN="your_token"
export GITLAB_URL="https://gitlab.com"
export API_SECRET_KEY="your_secret"
# Start services (each in its own terminal)
gsast-api # Terminal 1 — API server on :5000
gsast-worker # Terminal 2 — Background workerIf you only need the CLI to connect to an existing GSAST server:
pip install -e gsast-core/ -e gsast-cli/
gsast --helpCreate ~/.gsast.json configuration:
{
"api_secret_key": "your-server-api-key",
"base_url": "https://your-gsast-server.com",
"target": {
"provider": "github",
"organizations": ["your-org"]
},
"scanners": ["semgrep", "trufflehog", "dependency-confusion"]
}All deployment methods use the same environment variables. Copy env.example to .env and fill in:
# Required tokens
GITHUB_API_TOKEN=ghp_your_github_token
GITLAB_API_TOKEN=glpat_your_gitlab_token
GITLAB_URL=https://gitlab.com
API_SECRET_KEY=your_secure_random_key
# Optional configuration
FLASK_ENV=development
LOG_LEVEL=INFO
MAX_REPO_SIZE_MB=500Generate a secure API key:
openssl rand -base64 32Each module can be installed independently. See the per-module reference documentation:
- gsast-core — shared library, required by all other modules
- gsast-api — API server
- gsast-worker — background worker
- gsast-cli — CLI client
After installation, verify everything works:
-
API Documentation: Visit: http://localhost:5000/apidocs/
-
Run a Test Scan:
gsast scan rules/sg_custom/ --max-repo-mb-size 10
-
Port 5000 already in use:
lsof -i :5000 # Kill the process or set FLASK_RUN_PORT=5001 -
Redis connection failed:
docker run -d -p 6379:6379 redis:7-alpine # Or install locally brew install redis && redis-server
-
SSL certificate errors (corporate networks):
export GITHUB_DISABLE_SSL_VERIFY=true export SSL_CERT_FILE=/path/to/corporate-ca.crt
-
Permission denied for Docker:
sudo usermod -aG docker $USER # Then logout and login again
- Check logs:
docker compose logsorkubectl logs -l app=gsast - Open an issue on GitHub