Skip to content

Security: MStarRobotics/Universal-AI-Governor

SECURITY.md

Security Policy

+================================================================+
|                                                                |
|                      SECURITY POLICY                          |
|                                                                |
|         How to report security issues responsibly             |
|                                                                |
+================================================================+

Supported Versions

I try to keep the security updates current for these versions:

Version Supported Notes
1.x.x Yes Current stable release
0.9.x Yes Will support until end of 2025
0.8.x No Please upgrade
< 0.8 No Definitely upgrade these

Reporting Security Issues

Please don't open public issues for security problems

I really appreciate when people find security issues, but please report them privately first. Here's why this matters and how to do it right:

The right way:

  • Email me directly at: [email protected]
  • Use the subject line: "[SECURITY] Brief description"
  • Give me a reasonable amount of time to fix it before going public
  • Work with me to verify the fix

Please don't:

  • Open a public GitHub issue for security problems
  • Post about it on social media before I can fix it
  • Try to access data that doesn't belong to you
  • Run automated scanners against production systems

What to include in your report

When you email me about a security issue, please include:

Subject: [SECURITY] Brief description of the issue

1. What's the problem?
   - Clear description of the vulnerability
   - Which part of the system is affected
   - How serious you think it is

2. How did you find it?
   - Steps to reproduce the issue
   - Any proof-of-concept code (if safe to share)
   - Screenshots or logs if helpful

3. What's the impact?
   - What could an attacker do with this?
   - What data or systems could be compromised?
   - Any ideas for how to fix it?

4. Your info (optional)
   - Name if you want credit
   - How to contact you for follow-up

What happens next

Within 24 hours: I'll acknowledge that I got your report and give you an initial assessment.

Within a week: I'll either have a fix ready or give you a realistic timeline for when I'll have one.

After the fix: We'll coordinate on when and how to disclose the issue publicly (if appropriate).

I try to be pretty responsive, but please be patient if it takes me a day or two to get back to you - I might be traveling or dealing with other urgent issues.


Security Architecture

How I think about security

This project handles sensitive AI governance decisions, so I've tried to build security in from the ground up rather than bolting it on later. Here's the basic approach:

    User Request
         |
    [Input Validation] <- First line of defense
         |
    [Authentication] <- Who are you?
         |
    [Authorization] <- What can you do?
         |
    [Policy Engine] <- Business logic security
         |
    [Hardware Security] <- TPM/HSM backing
         |
    [Audit Logging] <- Track everything

Hardware-backed security

One of the things I'm most proud of in this project is the hardware security integration. Most "enterprise" software just does software-only crypto, which is like having a really good lock on a paper door.

TPM 2.0 Integration:

  • Keys are generated and stored in hardware
  • Attestation proves the system hasn't been tampered with
  • PCR binding ensures keys only work on trusted systems

HSM Support:

  • PKCS#11 integration for enterprise hardware security modules
  • High-performance crypto operations
  • Tamper-evident key storage

Secure Enclave:

  • Apple Secure Enclave support on macOS
  • Intel SGX for Linux systems (where available)
  • ARM TrustZone integration

Cryptographic choices

I've tried to make conservative, well-tested choices for crypto:

Symmetric encryption: AES-256-GCM and ChaCha20-Poly1305 Asymmetric crypto: RSA-4096, ECDSA P-384, Ed25519 Hashing: SHA-3, BLAKE3 Key derivation: PBKDF2, Argon2, HKDF

I'm also working on post-quantum crypto support, but that's still experimental.


Common Security Questions

"Is this actually secure?"

I've tried to build this with security as a first-class concern, not an afterthought. That said, security is hard and I'm sure there are issues I haven't thought of. That's why I really appreciate security researchers who take the time to look at this stuff.

"What about supply chain attacks?"

Good question. I use cargo-audit and cargo-deny to check for known vulnerabilities in dependencies. I also try to minimize the dependency tree and stick to well-maintained crates.

"Do you have any certifications?"

Not yet, but I'm working on SOC2 compliance and have built in support for GDPR and HIPAA requirements. If you need specific certifications for your use case, let me know and I can prioritize that work.

"What about quantum computers?"

I'm working on post-quantum cryptography support, but it's not ready for production yet. The current crypto should be fine for the next several years, but I'm keeping an eye on NIST's post-quantum standards.


Security Best Practices for Users

Deployment security

Use TLS everywhere:

[server.tls]
enabled = true
cert_file = "/path/to/your/cert.pem"
key_file = "/path/to/your/key.pem"
min_version = "1.3"  # Don't use older TLS versions

Enable hardware security if you have it:

[security]
tpm_required = true  # If you have TPM 2.0
hardware_backed_auth = true

Set up proper monitoring:

[audit]
enabled = true
level = "comprehensive"  # Log everything important
retention_days = 365     # Keep logs for compliance

Operational security

Keep it updated: I try to release security updates quickly, so please keep your installation current.

Monitor the logs: The audit logs will show you if something weird is happening.

Use strong authentication: Enable multi-factor auth if your environment supports it.

Network security: Run this behind a firewall and use network segmentation.


Security Testing

What I test

I run several types of security tests on every release:

Static analysis: cargo clippy with security-focused lints Dependency scanning: cargo audit for known vulnerabilities Fuzzing: I fuzz the policy parser and crypto operations Integration testing: End-to-end security scenarios

What you can test

If you want to do your own security testing:

Allowed:

  • Testing against your own installations
  • Automated scanning of public interfaces (within reason)
  • Code review and static analysis
  • Responsible disclosure of issues you find

Please don't:

  • Attack other people's installations
  • Try to access data that doesn't belong to you
  • Run intensive scans that could impact service availability
  • Social engineer me or other contributors

Incident Response

If something bad happens

Step 1: Don't panic. Document what you're seeing and contact me immediately.

Step 2: If it's an active attack, isolate the affected systems if you can do so safely.

Step 3: Preserve logs and evidence, but don't spend too much time on forensics if the attack is ongoing.

Step 4: We'll work together to understand what happened and make sure it doesn't happen again.

What I'll do

  • Acknowledge the incident within a few hours
  • Work with you to understand the scope and impact
  • Develop and test a fix
  • Coordinate on disclosure and communication
  • Do a post-incident review to improve our security

Contact Information

For security issues: [email protected]

For general questions: Open a GitHub issue or discussion

Response time: I try to respond to security issues within 24 hours, other questions within a few days.


+================================================================+
|                                                                |
|                    SECURITY IS A TEAM SPORT                   |
|                                                                |
|         Thanks for helping keep this project secure           |
|                                                                |
+================================================================+

P.S. - If you find a security issue and report it responsibly, I'm happy to give you credit in the release notes (if you want it). Security researchers make all of our software better.

Version Supported End of Life
1.x.x βœ… TBD
0.9.x βœ… 2025-12-31
0.8.x ❌ 2024-12-31
< 0.8 ❌ Ended

Reporting a Vulnerability

Responsible Disclosure

We take security seriously and appreciate responsible disclosure of security vulnerabilities. Please follow these guidelines:

DO:

  • Report vulnerabilities privately before public disclosure
  • Provide detailed information about the vulnerability
  • Allow reasonable time for fixes before public disclosure
  • Work with us to verify and address the issue

DON'T:

  • Publicly disclose vulnerabilities before they're fixed
  • Access or modify data that doesn't belong to you
  • Perform attacks that could harm system availability
  • Social engineer our team members

Reporting Process

Step 1: Initial Report

Send vulnerability reports to: [email protected]

Include the following information:

Subject: [SECURITY] Vulnerability Report - [Brief Description]

1. VULNERABILITY SUMMARY
   - Brief description of the vulnerability
   - Affected component(s)
   - Severity assessment (Critical/High/Medium/Low)

2. TECHNICAL DETAILS
   - Detailed description of the vulnerability
   - Steps to reproduce
   - Proof of concept (if applicable)
   - Affected versions

3. IMPACT ASSESSMENT
   - Potential impact on confidentiality
   - Potential impact on integrity
   - Potential impact on availability
   - Potential for privilege escalation

4. SUGGESTED MITIGATION
   - Recommended fixes or workarounds
   - Timeline considerations

5. REPORTER INFORMATION
   - Your name (if you want credit)
   - Contact information
   - PGP key (if available)

Step 2: Acknowledgment

We will acknowledge receipt within 24 hours and provide:

  • Confirmation of vulnerability receipt
  • Initial severity assessment
  • Expected timeline for investigation
  • Point of contact for follow-up

Step 3: Investigation

Our security team will:

  • Verify the vulnerability
  • Assess the impact and severity
  • Develop a fix or mitigation
  • Test the solution thoroughly

Step 4: Resolution

We will:

  • Notify you when the fix is ready
  • Coordinate disclosure timeline
  • Release security updates
  • Publish security advisory (if appropriate)

Response Timeline

Severity Initial Response Fix Timeline Disclosure
Critical 4 hours 7 days 14 days
High 24 hours 14 days 30 days
Medium 48 hours 30 days 60 days
Low 1 week 60 days 90 days

Security Architecture

Defense in Depth

The Universal AI Governor implements multiple layers of security:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    APPLICATION SECURITY                         β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Input Validation β”‚ Output Encoding β”‚ Session Management       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                    BUSINESS LOGIC SECURITY                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Authorization β”‚ Policy Enforcement β”‚ Audit Logging            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                    CRYPTOGRAPHIC SECURITY                       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Encryption β”‚ Digital Signatures β”‚ Key Management              β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                    HARDWARE SECURITY                            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  TPM 2.0 β”‚ Secure Enclave β”‚ HSM β”‚ Hardware Root of Trust      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Security Features

Hardware-Backed Security

  • TPM 2.0 Integration: Hardware-based key storage and attestation
  • Secure Enclave Support: Apple Secure Enclave and Intel SGX
  • HSM Integration: PKCS#11 support for enterprise HSMs
  • Hardware Root of Trust: Tamper-evident security foundation

Cryptographic Security

  • Post-Quantum Cryptography: Future-proof encryption algorithms
  • Perfect Forward Secrecy: Session keys that can't be compromised retroactively
  • Authenticated Encryption: AES-GCM and ChaCha20-Poly1305
  • Secure Key Derivation: PBKDF2, Argon2, and HKDF

Application Security

  • Memory Safety: Rust's ownership system prevents buffer overflows
  • Input Validation: Comprehensive validation of all inputs
  • Output Encoding: Proper encoding to prevent injection attacks
  • Secure Defaults: Security-first configuration defaults

Security Best Practices

For Users

Deployment Security

Network Security:

# Use TLS for all communications
server:
  tls:
    cert_file: "/path/to/cert.pem"
    key_file: "/path/to/key.pem"
    min_version: "1.3"

# Restrict network access
firewall:
  allow_ports: [8080, 8443]
  allow_ips: ["10.0.0.0/8", "192.168.0.0/16"]

Authentication:

# Enable strong authentication
auth:
  method: "hardware_backed_jwt"
  tpm_required: true
  session_timeout: 3600
  max_failed_attempts: 3

Configuration Security:

# Secure configuration practices
- Use environment variables for secrets
- Enable audit logging
- Set appropriate file permissions (600 for config files)
- Regular security updates

Operational Security

Monitoring:

  • Enable comprehensive audit logging
  • Monitor for suspicious activities
  • Set up alerting for security events
  • Regular security assessments

Backup and Recovery:

  • Encrypt backups
  • Test recovery procedures
  • Secure backup storage
  • Document incident response procedures

For Developers

Secure Coding Practices

Input Validation:

use validator::Validate;

#[derive(Validate)]
struct PolicyRequest {
    #[validate(length(min = 1, max = 10000))]
    policy_content: String,
    
    #[validate(regex = "^[a-zA-Z0-9_-]+$")]
    policy_name: String,
}

pub fn create_policy(request: PolicyRequest) -> Result<Policy, ValidationError> {
    request.validate()?;
    // Process validated input
}

Error Handling:

// Don't leak sensitive information in errors
pub enum PublicError {
    InvalidInput,
    Unauthorized,
    InternalError,
}

impl From<InternalError> for PublicError {
    fn from(err: InternalError) -> Self {
        // Log detailed error internally
        log::error!("Internal error: {:?}", err);
        // Return generic error to user
        PublicError::InternalError
    }
}

Cryptographic Operations:

use ring::aead;
use zeroize::Zeroize;

#[derive(Zeroize)]
struct SecretData {
    data: Vec<u8>,
}

impl Drop for SecretData {
    fn drop(&mut self) {
        self.zeroize();
    }
}

// Use constant-time operations for sensitive comparisons
use subtle::ConstantTimeEq;

fn verify_token(provided: &[u8], expected: &[u8]) -> bool {
    provided.ct_eq(expected).into()
}

Security Testing

Automated Security Testing

Static Analysis:

# Security-focused linting
cargo clippy -- -W clippy::all -W clippy::pedantic -W clippy::security

# Dependency vulnerability scanning
cargo audit

# License and security policy checking
cargo deny check

Dynamic Analysis:

# Fuzzing critical components
cargo fuzz run policy_parser
cargo fuzz run crypto_operations

# Memory safety testing
cargo test --features=sanitizer

Manual Security Testing

Penetration Testing Checklist:

  • Authentication bypass attempts
  • Authorization escalation tests
  • Input validation testing
  • Cryptographic implementation review
  • Hardware security validation
  • Side-channel attack resistance
  • Timing attack prevention
  • Memory safety verification

Security Test Cases:

#[cfg(test)]
mod security_tests {
    use super::*;

    #[test]
    fn test_sql_injection_prevention() {
        let malicious_input = "'; DROP TABLE users; --";
        let result = process_user_input(malicious_input);
        assert!(result.is_err());
    }

    #[test]
    fn test_timing_attack_resistance() {
        let start = std::time::Instant::now();
        let _ = verify_password("correct_password", "stored_hash");
        let correct_time = start.elapsed();

        let start = std::time::Instant::now();
        let _ = verify_password("wrong_password", "stored_hash");
        let wrong_time = start.elapsed();

        // Timing should be similar (within reasonable variance)
        let time_diff = (correct_time.as_nanos() as i64 - wrong_time.as_nanos() as i64).abs();
        assert!(time_diff < 1_000_000); // 1ms variance
    }
}

Incident Response

Security Incident Classification

Critical (P0):

  • Remote code execution
  • Authentication bypass
  • Data breach or exposure
  • Hardware security compromise

High (P1):

  • Privilege escalation
  • Denial of service
  • Cryptographic weakness
  • Significant data integrity issues

Medium (P2):

  • Information disclosure
  • Session management issues
  • Configuration vulnerabilities
  • Non-critical component compromise

Low (P3):

  • Minor information leakage
  • Logging issues
  • Documentation security gaps
  • Non-exploitable vulnerabilities

Response Procedures

Immediate Response (0-4 hours)

  1. Assess and contain the incident
  2. Notify the security team
  3. Document initial findings
  4. Implement emergency mitigations

Short-term Response (4-24 hours)

  1. Investigate the root cause
  2. Develop comprehensive fix
  3. Test the solution
  4. Prepare security advisory

Long-term Response (1-7 days)

  1. Deploy the fix
  2. Monitor for additional issues
  3. Conduct post-incident review
  4. Update security procedures

Security Contacts

Primary Contacts

Security Team Lead:

Backup Contact:

External Security Resources

Bug Bounty Program:

  • Currently in planning phase
  • Will be announced when available

Security Advisories:

  • GitHub Security Advisories
  • Project mailing list
  • Security blog posts

Compliance and Certifications

Regulatory Compliance

GDPR (General Data Protection Regulation):

  • Data minimization principles
  • Right to erasure implementation
  • Privacy by design architecture
  • Consent management systems

HIPAA (Health Insurance Portability and Accountability Act):

  • Administrative safeguards
  • Physical safeguards
  • Technical safeguards
  • Audit controls

SOC 2 (Service Organization Control 2):

  • Security controls
  • Availability controls
  • Processing integrity
  • Confidentiality measures

Security Standards

NIST Cybersecurity Framework:

  • Identify: Asset management and risk assessment
  • Protect: Access control and data security
  • Detect: Continuous monitoring and detection
  • Respond: Incident response procedures
  • Recover: Recovery planning and improvements

ISO 27001:

  • Information security management system
  • Risk management processes
  • Security control implementation
  • Continuous improvement

Security Roadmap

Current Security Features (v1.0)

  • Hardware-backed authentication
  • End-to-end encryption
  • Comprehensive audit logging
  • Multi-factor authentication
  • Role-based access control

Planned Security Enhancements (v1.1)

  • Zero-trust architecture
  • Advanced threat detection
  • Behavioral analysis
  • Enhanced hardware security

Future Security Goals (v2.0)

  • Quantum-resistant cryptography
  • Homomorphic encryption
  • Secure multi-party computation
  • Advanced privacy-preserving techniques

╔══════════════════════════════════════════════════════════════════╗
β•‘                                                                  β•‘
β•‘                    SECURITY IS EVERYONE'S RESPONSIBILITY         β•‘
β•‘                                                                  β•‘
β•‘         Thank you for helping keep Universal AI Governor         β•‘
β•‘                        secure for everyone                       β•‘
β•‘                                                                  β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

For questions about this security policy, please contact: [email protected]

There aren’t any published security advisories