security principles
30
总安装量
0
周安装量
#12440
全站排名
安装命令
npx skills add https://github.com/exceptionless/exceptionless --skill 'Security Principles'
Skill 文档
Security Principles
Secrets Management
Secrets are injected via Kubernetes ConfigMaps and environment variables â never commit secrets to the repository.
- Configuration files â Use
appsettings.ymlfor non-secret config - Environment variables â Secrets injected at runtime via
EX_*prefix - Kubernetes â ConfigMaps mount configuration, Secrets mount credentials
// AppOptions binds to configuration (including env vars)
public class AppOptions
{
public string? StripeApiKey { get; set; }
public AuthOptions Auth { get; set; } = new();
}
Validate All Inputs
- Check bounds and formats before processing
- Use
ArgumentNullException.ThrowIfNull()and similar guards - Validate early, fail fast
Sanitize External Data
- Never trust data from queues, caches, user input, or external sources
- Validate against expected schema
- Sanitize HTML/script content before storage or display
No Sensitive Data in Logs
- Never log passwords, tokens, API keys, or PII
- Log identifiers and prefixes, not full values
- Use structured logging with safe placeholders
Use Secure Defaults
- Default to encrypted connections (SSL/TLS enabled)
- Default to restrictive permissions
- Require explicit opt-out for security features
Avoid Deprecated Cryptographic Algorithms
Use modern cryptographic algorithms:
- â
MD5,SHA1â Cryptographically broken - â
SHA256,SHA512â Current standards
Avoid Insecure Serialization
- â
BinaryFormatterâ Insecure deserialization vulnerability - â
System.Text.Json,Newtonsoft.Jsonâ Safe serialization
Input Bounds Checking
- Enforce minimum/maximum values on pagination parameters
- Limit batch sizes to prevent resource exhaustion
- Validate string lengths before storage
OWASP Reference
Review OWASP Top 10 regularly:
- Broken Access Control
- Cryptographic Failures
- Injection
- Insecure Design
- Security Misconfiguration
- Vulnerable and Outdated Components
- Identification and Authentication Failures
- Software and Data Integrity Failures
- Security Logging and Monitoring Failures
- Server-Side Request Forgery