oxigdal-security
Enterprise-grade security features for OxiGDAL geospatial data processing. Provides comprehensive encryption, access control, compliance management, audit logging, and data protection capabilities for handling sensitive geospatial information.
Features
- End-to-End Encryption: AES-256-GCM and ChaCha20-Poly1305 encryption for data at rest and in transit
- Key Management: Secure key derivation using Argon2id and PBKDF2 with OWASP-recommended settings
- Access Control: RBAC (Role-Based Access Control) and ABAC (Attribute-Based Access Control) frameworks
- Audit Logging: Comprehensive audit trail with queryable storage and event tracking
- Data Lineage: Track data provenance and transformations with graph-based lineage tracking
- Multi-Tenancy: Complete tenant isolation with quota management and multi-tenant security policies
- Data Anonymization: Differential privacy, data masking, and value generalization techniques
- Compliance Reporting: Support for GDPR, HIPAA, and FedRAMP compliance frameworks
- Security Scanning: Detect secrets, vulnerabilities, and potential malware in data
- Pure Rust: 100% Pure Rust implementation with no C/Fortran dependencies
- No Unwrap Policy: All fallible operations properly return
Result<T, E>with descriptive error types - Async-First: Built on tokio for high-performance async operations
Installation
Add to your Cargo.toml:
[]
= "0.1.3"
Quick Start
Configure security settings for your geospatial data:
use ;
Usage
Basic Encryption
use ;
Key Derivation
use ;
Access Control with RBAC
use ;
Audit Logging
use ;
Data Anonymization
use *;
Multi-Tenancy with Isolation
use ;
API Overview
Core Modules
| Module | Description |
|---|---|
encryption |
Encryption infrastructure (at-rest, in-transit, key management, envelope encryption) |
access_control |
Access control framework (RBAC, ABAC, permissions, policies) |
audit |
Audit logging system (event logging, storage, querying) |
lineage |
Data lineage tracking (metadata, graph-based provenance) |
multitenancy |
Multi-tenant support (tenant isolation, quotas) |
anonymization |
Data anonymization (masking, generalization, differential privacy) |
compliance |
Compliance reporting (GDPR, HIPAA, FedRAMP) |
scanning |
Security scanning (vulnerability detection, secrets detection, malware scanning) |
Key Types
Encryption Types
EncryptionAlgorithm: AES-256-GCM (default) or ChaCha20-Poly1305KeyDerivationFunction: PBKDF2-SHA256 or Argon2idAtRestEncryptor: Encrypt/decrypt data at restEnvelopeEncryptor: Asymmetric key wrappingTlsConfigBuilder: Configure TLS for in-transit encryption
Access Control Types
Subject: Identifies user, service, or API keyResource: Identifies geospatial resource (dataset, layer, feature)Action: Eight standard actions (Read, Write, Delete, Execute, List, Create, Update, Admin)AccessRequest: Request evaluation with contextAccessDecision: Allow or Deny decision
Audit Types
AuditLogEntry: Complete audit log record with metadataAuditEventType: Authentication, authorization, data access, modifications, etc.AuditResult: Success, Failure, or DeniedAuditSeverity: Info, Warning, Error, Critical
Error Handling
All operations return Result<T> with comprehensive error types:
Security Considerations
Encryption Best Practices
- AES-256-GCM is recommended for most use cases
- ChaCha20-Poly1305 is faster on systems without AES hardware acceleration
- All encryption keys should be at least 32 bytes (256 bits)
- Always use random, unique nonces/IVs for each encryption operation
Key Derivation
- Argon2id is the recommended key derivation function (memory-hard, resistant to side-channels)
- Default settings: 19456 KiB memory, 2 time cost, 1 parallelism (suitable for production)
- PBKDF2-SHA256 uses OWASP-recommended 600,000 iterations
- Minimum recommended salt: 16 bytes of cryptographically secure random data
Access Control
- RBAC is suitable for role-based permission models
- ABAC provides fine-grained control based on attributes
- Combine with audit logging for complete accountability
- Always validate both subject identity and resource classification
Compliance
- GDPR: Data minimization, right to be forgotten, data portability
- HIPAA: Protected health information handling and access controls
- FedRAMP: Federal information security requirements
- Enable audit logging for compliance proof
Performance
The library is optimized for high-performance secure operations:
- Ring-based cryptographic primitives for optimal performance
- Async-first design with tokio for non-blocking I/O
- Efficient memory handling with pre-allocated buffers
- Optimized key derivation with hardware acceleration support
For benchmarks, run:
Examples
See the examples directory for complete working examples:
- Basic encryption and decryption
- Key derivation from passwords
- RBAC and ABAC implementations
- Audit logging and querying
- Multi-tenant isolation
- Data anonymization techniques
- Compliance reporting
Integration with OxiGDAL
OxiGDAL-Security integrates seamlessly with other OxiGDAL crates:
use GeoDataFrame;
use AtRestEncryptor;
use *;
async
Documentation
Full documentation is available at docs.rs/oxigdal-security.
Generate local documentation with:
Testing
Run the test suite:
With logging:
RUST_LOG=debug
Contributing
Contributions are welcome! Please ensure:
- No
unwrap()usage (use?operator or explicit error handling) - All public APIs are documented
- Tests are included for new functionality
- Code follows COOLJAPAN policies (Pure Rust, no C/Fortran dependencies by default)
See CONTRIBUTING.md for detailed guidelines.
License
This project is licensed under Apache-2.0.
Compliance
This crate is designed to help meet security compliance requirements:
- GDPR: Personal data protection and privacy regulations
- HIPAA: Health information security requirements
- FedRAMP: Federal information security standards
- SOC 2: Security and privacy controls
- ISO 27001: Information security management
Related Projects
- OxiGDAL - Geospatial data processing
- OxiBLAS - Pure Rust linear algebra
- SciRS2 - Scientific computing ecosystem
- Oxicode - Pure Rust serialization (bincode replacement)
Support
For issues, questions, or security concerns:
- Open an issue on GitHub
- Email: security@cool-japan.org
- Security vulnerabilities should be reported responsibly per SECURITY.md
Part of the COOLJAPAN ecosystem - Enterprise-grade Rust libraries for geospatial computing.