| name | security-principles |
|---|---|
| description | Use this skill when handling provider API keys, external geocoding responses, request construction, logging safety, or other security-sensitive code in Geocoding.net. Apply when reviewing secrets handling, input validation, secure transport, or safety risks around external provider integrations and sample/test configuration. |
Provider credentials belong in local override files or environment variables and must never be committed to the repository.
- Tracked placeholders —
test/Geocoding.Tests/settings.jsonis versioned and should contain placeholders only; do not put real keys there - Test credentials — Keep provider API keys in
test/Geocoding.Tests/settings-override.jsonor viaGEOCODING_environment variables - Sample configuration — Use placeholder values only in
samples/Example.Web/appsettings.json - Environment variables — Use environment variables for CI or local overrides when needed
public sealed class ProviderOptions
{
public string? ApiKey { get; set; }
}- Check bounds and formats before processing
- Use
ArgumentNullException.ThrowIfNull()and similar guards - Validate early, fail fast
- Validate coordinates, address fragments, and batch sizes before sending requests
- Never trust data from geocoding providers, user input, or sample configuration
- Validate against expected schema
- Handle missing or malformed response fields without assuming provider correctness
- Never log passwords, tokens, API keys, or raw provider payloads
- Log identifiers and prefixes, not full values
- Use structured logging with safe placeholders
- Default to HTTPS provider endpoints
- Avoid disabling certificate or transport validation
- Require explicit opt-out for any non-secure development-only behavior
Use modern cryptographic algorithms:
- ❌
MD5,SHA1— Cryptographically broken - ✅
SHA256,SHA512— Current standards
- ❌
BinaryFormatter— Insecure deserialization vulnerability - ✅
System.Text.Json,Newtonsoft.Json— Safe serialization
- Enforce minimum/maximum values on pagination or batch parameters
- Limit batch sizes to prevent resource exhaustion
- Validate string lengths before request construction
- URL-encode user-supplied address fragments and query parameters
- Do not concatenate secrets or untrusted input into URLs without escaping
- Preserve provider-specific signing or authentication requirements without leaking secrets into logs
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