Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Security: Zykairotis/Void-basic

Security

SECURITY.md

Security Documentation

Overview

This document outlines the security measures implemented in the Void-basic project, particularly focusing on API key management and protection against accidental credential exposure.

πŸ”’ Security Features

Git Protection

  • βœ… Automatic .env exclusion: All .env files are automatically ignored by git
  • βœ… GitHub secret scanning: Push protection prevents accidental key exposure
  • βœ… Environment templates: .env.example provides safe configuration templates
  • βœ… Pre-commit hooks: Additional validation before commits

API Key Management

  • πŸ” Multiple provider support: xAI, OpenAI, Anthropic integration
  • πŸ” Key rotation: Support for multiple API keys with fallback mechanisms
  • πŸ” Environment isolation: Development and production key separation
  • πŸ” Usage monitoring: Built-in tracking and alerting capabilities

🚨 Security Incident Response

If API Keys Are Exposed

Immediate Actions

  1. Remove from Git History:

    git filter-branch --force --index-filter \
      'git rm --cached --ignore-unmatch .env' \
      --prune-empty --tag-name-filter cat -- --all
  2. Regenerate Exposed Keys:

  3. Update Local Environment:

    # Update your .env file with new keys
    nano .env
  4. Force Push (if necessary):

    git push origin --force

Verification Steps

# Verify no secrets in git history
git log --all --full-history -- .env

# Check current git status
git status

# Verify .env is ignored
grep .env .gitignore

πŸ›‘οΈ Security Best Practices

For Developers

  • βœ… Never commit .env files - Use .env.example as template
  • βœ… Use different keys for development and production
  • βœ… Rotate keys regularly - Especially after team changes
  • βœ… Monitor API usage - Check provider dashboards regularly
  • βœ… Use environment variables - For production deployments

For Contributors

  • βœ… Test with placeholder keys before using real keys
  • βœ… Check git status before committing
  • βœ… Use pre-commit hooks for additional validation
  • βœ… Report security issues immediately to maintainers

For Deployment

  • βœ… Use environment variables instead of .env files
  • βœ… Implement key rotation in CI/CD pipelines
  • βœ… Monitor for unusual usage patterns
  • βœ… Use least privilege - Only grant necessary permissions

πŸ”§ Security Configuration

Environment Setup

# 1. Copy template
cp .env.example .env

# 2. Add your keys (replace with actual values)
XAI_API_KEY=xai-your-actual-key-here
OPENAI_API_KEY=sk-your-actual-key-here
ANTHROPIC_API_KEY=sk-ant-your-actual-key-here

# 3. Verify configuration
grep .env .gitignore
git status  # Should not show .env

Git Configuration

The project includes these security measures in .gitignore:

.env
.env.local
.env.*.local

GitHub Protection

  • Secret Scanning: Automatically detects API keys in commits
  • Push Protection: Blocks pushes containing detected secrets
  • Branch Protection: Prevents force pushes to main branch
  • Code Review: Requires review for security-sensitive changes

πŸ§ͺ Security Testing

Verification Commands

# Test environment setup
python test_model_integration.py

# Check for exposed secrets
git log --all --full-history -- .env

# Verify gitignore configuration
grep .env .gitignore

# Test API connectivity
python -c "
import os
keys = ['XAI_API_KEY', 'OPENAI_API_KEY', 'ANTHROPIC_API_KEY']
for key in keys:
    value = os.getenv(key)
    print(f'{key}: {\"SET\" if value else \"NOT SET\"}')
"

Security Checklist

  • .env file exists locally but is not tracked by git
  • .env.example contains all required variables with placeholders
  • API keys are valid and functional
  • No secrets in git history
  • GitHub secret scanning is enabled
  • Pre-commit hooks are installed and working

πŸ“ž Security Contacts

Reporting Security Issues

  • GitHub Issues: Use the Issues page
  • Security Labels: Tag issues with security label
  • Private Reports: For sensitive issues, contact maintainers directly

Emergency Contacts

  • Repository Owner: Zykairotis
  • Security Team: Contact through GitHub issues with [SECURITY] prefix

πŸ“‹ Security Compliance

Standards Adherence

  • βœ… OWASP Guidelines: Follows web application security best practices
  • βœ… GitHub Security: Implements GitHub's recommended security measures
  • βœ… API Security: Proper key management and rotation procedures
  • βœ… Environment Security: Secure handling of configuration and secrets

Audit Trail

  • πŸ“ Commit History: All changes tracked and auditable
  • πŸ“ Issue Tracking: Security issues documented and resolved
  • πŸ“ Key Rotation: Log of key changes and rotations
  • πŸ“ Access Control: Repository permissions and access logs

πŸ”„ Security Updates

This document is updated whenever:

  • New security features are implemented
  • Security incidents occur and lessons are learned
  • Best practices evolve
  • New API providers are integrated

Last Updated: January 5, 2025
Security Status: βœ… ACTIVE AND MONITORED
Next Review: Monthly security audit

There aren't any published security advisories