FluentAzure takes security seriously and implements multiple layers of protection for handling sensitive configuration data, especially Azure Key Vault secrets.
- Memory Clearing: Secret values are securely overwritten in memory when cache entries are disposed
- Secure Disposal:
KeyVaultSecretCacheandKeyVaultSourceimplement secure disposal patterns - Minimal Memory Exposure: Secrets are only kept in memory as long as necessary
- ConfigureAwait(false): All async operations use
ConfigureAwait(false)to prevent deadlocks - Proper Exception Handling: Comprehensive error handling without exposing sensitive information
- Polly Integration: Uses Polly for retry policies with exponential backoff
- Secure Failure Modes: Fails securely without exposing sensitive data in error messages
- Static Analysis: Comprehensive static code analysis rules enabled
- Security Rules: Specific security-focused analyzers activated
- Continuous Monitoring: CI/CD pipeline includes security scanning
- Never log secret values - The library is designed to prevent accidental logging of secrets
- Use secure disposal - Always dispose of configuration sources when done
- ConfigureAwait usage - The library uses
ConfigureAwait(false)internally for better performance
- Managed Identity: Use Azure Managed Identity for Key Vault authentication
- Network Security: Configure Key Vault network access rules appropriately
- Audit Logging: Enable Key Vault audit logging for compliance
- Secret Rotation: Implement regular secret rotation policies
If you discover a security vulnerability, please report it to the maintainers privately:
- Do not create a public GitHub issue
- Contact the maintainers directly via email
- Provide detailed reproduction steps if possible
// ✅ Good - Secure configuration
var config = await FluentConfig
.Create()
.FromEnvironment()
.FromKeyVault("https://myvault.vault.azure.net")
.Required("DatabaseConnectionString")
.BuildAsync();
// Use configuration
var connectionString = config.Match(
success => success["DatabaseConnectionString"],
errors => throw new SecurityException("Configuration failed")
);// ✅ Good - Proper disposal
using var keyVaultSource = new KeyVaultSource(vaultUrl);
var result = await keyVaultSource.LoadAsync();
// Disposal automatically clears sensitive data- SOC 2: Security controls align with SOC 2 Type II requirements
- PCI DSS: Suitable for PCI DSS environments when properly configured
- GDPR: Implements data minimization and secure deletion principles
Last Updated: 2024-12-19 Security Review: Complete