EricksonLopez.Security
dotnet-security · Multi-Tenancy y Seguridad
En esta página (20 secciones)
1. Identidad, Nivel y Perfil de Madurez#
2. Propuesta de Valor y Problema que Resuelve#
High-performance, Native AOT-first cryptographic foundation, multi-version key lifecycle manager, password security engine, and Zero Trust authorization ecosystem for modern .NET.
Implementaciones criptográficas heredadas sufren modos vulnerables a padding oracle, rotación frágil de claves y ataques de canal lateral temporal al comparar secretos.
3. Instalación Rápida#
Paquete principal: EricksonLopez.Security
dotnet add package EricksonLopez.Security --version 1.0.0<PackageReference Include="EricksonLopez.Security" Version="1.0.0" /><PackageVersion Include="EricksonLopez.Security" Version="1.0.0" />4. Métricas Verificadas del Ecosistema#
Instantánea recuperada UTC: 2026-12-01
5. Cuándo Usar y Cuándo NO Usar#
Cuándo usar
- Necesitas cifrado AEAD (AES-256-GCM, ChaCha20-Poly1305), rotación de claves multi-versión, hashing Argon2/PBKDF2, Shamir Secret Sharing, MFA/FIDO2 o ABAC Zero Trust.
Cuándo NO usar
- Solo requieres middleware estándar de cookies/JWT en ASP.NET Core sin sobres cifrados, rotación KMS ni evaluación ABAC.
6. Capacidades Principales e Invariantes de Diseño#
AEAD, Ciclo de Claves y KMS
Sobres versionados SecurityEnvelope, comparaciones en tiempo constante y proveedores AWS KMS, Azure Key Vault, Google Cloud KMS y tmpfs.
ABAC Zero Trust, MFA y FIDO2
Evaluación ABAC NIST SP 800-162, defensa anti-replay TOTP, WebAuthn/FIDO2 y comportamientos de autorización para Mediator.
7. Paquetes NuGet y Adaptadores Incluidos#
| ID del Paquete | Estado | NuGet / Local | TFMs | Estado AOT | Descargas | Descripción |
|---|---|---|---|---|---|---|
| EricksonLopez.SecurityPrincipal | Publicado | v1.0.0 / v2.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 282 | Enterprise-grade security engine, AEAD authenticated encryption (AES-GCM), multi-version key management, PBKDF2/Argon2 password security, token hashing, and secrets protection for the EricksonLopez.Security framework. |
| EricksonLopez.Security.Network | Publicado | v1.0.0 / v2.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 673 | Enterprise-grade Server-Side Request Forgery (SSRF) prevention and safe HTTP client handlers for .NET. Protects against RFC 1918 private IPs, loopbacks, link-local, cloud metadata endpoints, and DNS rebinding attacks. |
| EricksonLopez.Security.Abstractions | Publicado | v1.0.0 / v2.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 384 | Core security abstractions, cryptographic ports, key lifecycle contracts, password hashing interfaces, token primitives, and secure error models for the EricksonLopez.Security ecosystem. |
| EricksonLopez.Security.Cryptography | Publicado | v1.0.0 / v2.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 238 | Core cryptography primitives for EricksonLopez.Security ecosystem, providing Native AOT-compatible and zero-allocation implementations using built-in System.Security.Cryptography APIs. |
| EricksonLopez.Security.Cryptography.XmlDSig | Publicado | v1.0.0 / v2.2.0 | net8.0, net9.0, net10.0 | AOT: Incompatible | 216 | Canonical W3C XML Digital Signature (XMLDSig) and X.509 certificate verification engine for .NET. Supports enveloped signatures, RSA-SHA256, C14N canonicalization, and fiscal compliance standards (e-CF / DGII). |
| EricksonLopez.Security.Pki | Publicado | v1.0.0 / v2.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 212 | Public Key Infrastructure (PKI) certificate validation engine for .NET. Supports CRL caching, OCSP validation, custom trust anchors, and certificate chain verification with Native AOT compatibility. |
| EricksonLopez.Security.Cryptography.Pkcs11 | Publicado | v1.0.0 / v2.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 211 | Native AOT compatible PKCS#11 integration for EricksonLopez.Security ecosystem, providing hardware security module (HSM) bridging via direct unmanaged P/Invoke bindings. |
| EricksonLopez.Security.GoogleCloud | Publicado | v1.0.0 / v2.2.0 | net8.0, net9.0, net10.0 | AOT: Incompatible | 179 | Google Cloud KMS (including Cloud HSM) and Secret Manager key store and secret store adapters for EricksonLopez.Security. |
| EricksonLopez.Security.WebAuthn.Fido2 | Publicado | v1.0.0 / v2.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 177 | Enterprise-grade W3C WebAuthn Level 2/3 and FIDO2 passkey engine with CBOR/COSE parsing, attestation/assertion verification, replay protection, and zero-allocation cryptographic checks with Native AOT compatibility. |
| EricksonLopez.Security.Aws | Publicado | v1.0.0 / v2.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 176 | AWS KMS key store and Secrets Manager secret store adapters for EricksonLopez.Security. |
| EricksonLopez.Security.Azure | Publicado | v1.0.0 / v2.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 158 | Azure Key Vault key store and secret store adapters for EricksonLopez.Security. |
| EricksonLopez.Security.HashiCorpVault | Publicado | v1.0.0 / v2.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 154 | HashiCorp Vault Transit and KV v2 key store and secret store adapters for EricksonLopez.Security. |
| EricksonLopez.Security.Saml2 | Publicado | v1.0.0 / v2.2.0 | net8.0, net9.0, net10.0 | AOT: Incompatible | 148 | Enterprise-grade SAML 2.0 Web Browser Single Sign-On (SSO) engine with comprehensive XML Signature Wrapping (XSW 1..8) defense, XMLDSig validation, assertion decryption, and ClaimsPrincipal mapping. |
| EricksonLopez.Security.Privacy.Hibp | Publicado | v1.0.0 / v2.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 145 | Enterprise-grade Have I Been Pwned (HIBP) k-Anonymity range search client with traffic padding protection (Add-Padding: true) and breached password validator for .NET. |
| EricksonLopez.Security.AspNetCore | Publicado | v1.0.0 / v2.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 144 | ASP.NET Core integration for EricksonLopez.Security providing security headers, API key middleware, token extractors, and request security context. |
| EricksonLopez.Security.OpenTelemetry | Publicado | v1.0.0 / v2.2.0 | net8.0, net9.0, net10.0 | AOT: Incompatible | 144 | Optional OpenTelemetry instrumentation satellite for EricksonLopez.Security. Provides automatic ActivitySource registration, metrics (Meter), and semantic conventions for encrypt/decrypt, password hashing, key lifecycle, and API key validation operations. |
| EricksonLopez.Security.Testing | Publicado | v1.0.0 / v2.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 135 | Testing utilities, deterministic cryptographic doubles, fake key stores, and test assertions for EricksonLopez.Security. |
| EricksonLopez.Security.Mfa | Publicado | v1.0.0 / v2.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 130 | Enterprise-grade Multi-Factor Authentication (MFA) engine implementing RFC 6238 TOTP, RFC 4226 HOTP, Base32 encoding, authenticator URI generation, and emergency recovery codes with Native AOT compatibility. |
| EricksonLopez.Security.WebAuthn.Fido2.Mds3 | Publicado | v1.0.0 / v2.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 130 | FIDO Alliance Metadata Service v3 (MDS3) integration satellite for EricksonLopez.Security.WebAuthn.Fido2. Provides authenticator manufacturer validation, AAGUID lookup, and attestation certificate chain verification against the FIDO Alliance trust anchor. |
| EricksonLopez.Security.ZeroTrust | Publicado | v1.0.0 / v2.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 130 | Enterprise-grade Zero-Trust Attribute-Based Access Control (ABAC) policy evaluation engine for .NET. High-throughput in-memory evaluation, hierarchical combining algorithms (Deny-Overrides, Permit-Overrides), and Native AOT support. |
| EricksonLopez.Security.AnalyzersAnalizador / Generador | Publicado | v1.0.0 / v2.2.0 | netstandard2.0 | AOT: N/A (Analizador/Legado) | 144 | Roslyn diagnostic analyzers for EricksonLopez.Security. Catches common security misuse patterns at compile time: non-constant-time token comparison, undisposed SecretBuffer, insecure algorithm selection, and more. |
| EricksonLopez.Security.Mediator | No publicado | — / v2.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 0 | Zero-Trust multi-plane CQRS authorization pipeline behaviors, NIST SP 800-63B AAL enforcement, and cross-tenant spoofing guards for EricksonLopez.Mediator. |
8. Ejemplo Quick Start#
Basado en APIs públicas verificadas de EricksonLopez.Security. Compila con `<ImplicitUsings>disable</ImplicitUsings>` e importaciones explícitas.
using EricksonLopez.Security.Abstractions.Randomness;
using Microsoft.Extensions.DependencyInjection;
var services = new ServiceCollection();
services.AddEricksonLopezSecurity();
using var serviceProvider = services.BuildServiceProvider();
ICryptographicRandomNumberGenerator rng =
serviceProvider.GetRequiredService<ICryptographicRandomNumberGenerator>();9. Arquitectura y Flujo de Dependencias#
Renderizando diagrama…
flowchart LR lib_security["EricksonLopez.Security (L3)"] lib_result["EricksonLopez.Result (L0)"] lib_security --> lib_result lib_mediator["EricksonLopez.Mediator (L2)"] lib_security -.-> lib_mediator lib_webhooks["EricksonLopez.Webhooks (L3)"] lib_webhooks --> lib_security
Ver descripción textual y tabla accesible
2 dependencias hacia librerías aguas arriba y 1 librerías dependientes aguas abajo verificadas en dependencies.json.
| Dirección | Librería | Nivel | Tipos de Relación |
|---|---|---|---|
| Aguas arriba | EricksonLopez.Result | L0 | Adaptador, Tiempo de compilación, Paquete NuGet |
| Aguas arriba | EricksonLopez.Mediator | L2 | Adaptador |
| Aguas abajo | EricksonLopez.Webhooks | L3 | Tiempo de compilación, Paquete NuGet |
flowchart LR
lib_security["EricksonLopez.Security (L3)"]
lib_result["EricksonLopez.Result (L0)"]
lib_security --> lib_result
lib_mediator["EricksonLopez.Mediator (L2)"]
lib_security -.-> lib_mediator
lib_webhooks["EricksonLopez.Webhooks (L3)"]
lib_webhooks --> lib_security10. Target Frameworks y Matriz Native AOT / Trimming#
Inspección MSBuild `.csproj` sobre 22 paquetes: 17 Full, 0 Partial, 4 Incompatible, 1 NotApplicable (analizadores/generadores).
| ID del Paquete | IsAotCompatible | EnableTrimAnalyzer | Estado AOT Verificado | Target Frameworks |
|---|---|---|---|---|
| EricksonLopez.Security | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Security.Network | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Security.Abstractions | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Security.Cryptography | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Security.Cryptography.XmlDSig | false | false | Incompatible | net8.0, net9.0, net10.0 |
| EricksonLopez.Security.Pki | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Security.Cryptography.Pkcs11 | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Security.GoogleCloud | false | false | Incompatible | net8.0, net9.0, net10.0 |
| EricksonLopez.Security.WebAuthn.Fido2 | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Security.Aws | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Security.Azure | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Security.HashiCorpVault | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Security.Saml2 | false | false | Incompatible | net8.0, net9.0, net10.0 |
| EricksonLopez.Security.Privacy.Hibp | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Security.AspNetCore | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Security.OpenTelemetry | false | false | Incompatible | net8.0, net9.0, net10.0 |
| EricksonLopez.Security.Testing | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Security.Mfa | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Security.WebAuthn.Fido2.Mds3 | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Security.ZeroTrust | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Security.Analyzers | false | false | NotApplicable | netstandard2.0 |
| EricksonLopez.Security.Mediator | true | true | Full | net8.0, net9.0, net10.0 |
11. Dependencias Aguas Arriba y Dependientes Aguas Abajo#
Dependencias Aguas Arriba (2)
Dependientes Aguas Abajo (1)
12. Adaptadores Opcionales e Integraciones Externas#
Aristas de Adaptadores Internos y Paquetes de Integración
- EricksonLopez.Security.Mediator→ EricksonLopez.Mediator (EricksonLopez.Mediator)
- EricksonLopez.Security.Mediator→ EricksonLopez.Result (EricksonLopez.Result)
Dependencias NuGet Externas Verificadas (16)
13. Resumen de Configuración y Registro en DI#
Puntos de Entrada DI y Configuración Verificados
TmpfsSecretConfigurationExtensions.AddTmpfsSecretsAdds Docker/Kubernetes tmpfs RAM-backed secret files to `builder`.
KestrelDualPortExtensions.UseHardenedDualPortKestrelApplies Kestrel perimeter hardening and optional dual-port listener separation bound from `configuration`.
IdentityPasswordHasherBridge.AddEricksonLopezIdentityPasswordHasher<TUser>Registers `IdentityPasswordHasherBridge<TUser>` as the `IPasswordHasher<TUser>` implementation.
SecurityMediatorServiceCollectionExtensions.AddZeroTrustMediatorAuthorizationRegisters the open-generic `ZeroTrustAuthorizationBehavior<TRequest, TResponse>` in the service collection.
SecurityMfaServiceCollectionExtensions.AddDistributedTotpReplayStoreOverrides the default in-memory TOTP replay store with a delegate-based distributed store handler.
SecurityMfaServiceCollectionExtensions.AddDistributedTotpReplayStore<TStore>Overrides the default in-memory TOTP replay store with a custom distributed store implementation.
SecurityMfaServiceCollectionExtensions.AddSecurityMfaRegisters the `ITotpService` implementation into the service collection.
SecurityOpenTelemetryExtensions.AddEricksonLopezSecurityInstrumentationSubscribes the EricksonLopez.Security `SecurityMeter` to the OpenTelemetry metrics pipeline.
SecurityPkiServiceCollectionExtensions.AddSecurityPkiRegisters the `ICertificateChainValidator` implementation into the service collection.
HibpServiceCollectionExtensions.AddHaveIBeenPwnedRegisters the Have I Been Pwned k-Anonymity client and password validator.
ISaml2ClaimsMapper.MapToPrincipalMaps a SAML 2.0 assertion into a strongly-typed `ClaimsPrincipal`.
Saml2ClaimsMapper.MapToPrincipalMaps a SAML 2.0 assertion into a strongly-typed `ClaimsPrincipal`.
Tipos Públicos y Contratos Clave
EricksonLopez.Security.Abstractions.Authorization.IGenerationalPermissionCache (interface)Defines a two-tier (L1 in-memory + L2 distributed epoch-keyed) stampede-protected permission cache with strict fail-closed semantics (`PermissionSnapshot.Deny`) upon backing store or cache outages.
EricksonLopez.Security.Abstractions.Authorization.IPermissionSnapshotSource (interface)Defines the authoritative persistence data source used by `IGenerationalPermissionCache` on L1+L2 cache misses or live delegated session evaluations.
EricksonLopez.Security.Abstractions.Authorization.PermissionScopeKey (record)Identifies the exact multi-plane security scope for resolving and caching a `PermissionSnapshot`.
EricksonLopez.Security.Abstractions.Authorization.PermissionSnapshot (record)Represents an immutable, effective authorization snapshot for a principal within a specific security plane and scope, supporting deterministic permission hashing and fail-closed default denial.
EricksonLopez.Security.Abstractions.Cryptography.AeadAlgorithm (enum)Specifies the Authenticated Encryption with Associated Data (AEAD) algorithm.
EricksonLopez.Security.Abstractions.Cryptography.AuthenticatedContext (struct)Provides a strongly-typed cryptographic context used as Authenticated Associated Data (AAD) in Authenticated Encryption with Associated Data (AEAD) schemes.
EricksonLopez.Security.Abstractions.Cryptography.EncryptedData (record)Encapsulates the output of an AEAD encryption operation: ciphertext, authentication tag, and initialization nonce.
EricksonLopez.Security.Abstractions.Cryptography.IAuthenticatedEncryptionEngine (interface)Defines the contract for high-performance, low-allocation Authenticated Encryption with Associated Data (AEAD) engines.
EricksonLopez.Security.Abstractions.Cryptography.IBlindIndexService (interface)Defines a deterministic blind-indexing contract (HMAC-SHA256 with HKDF-derived subkey) for equality searches over encrypted Personally Identifiable Information (PII).
EricksonLopez.Security.Abstractions.Cryptography.IDigitalSignatureEngine (interface)Defines the contract for high-performance digital signature generation and verification.
EricksonLopez.Security.Abstractions.Cryptography.IEncryptionKeyProvider (interface)Defines the contract for providing cryptographic keys for encryption and decryption operations based on purpose and version.
EricksonLopez.Security.Abstractions.Cryptography.ISecurityEnvelopeSerializer (interface)Defines contracts for serializing and deserializing tamper-resistant binary `SecurityEnvelope` instances.
14. Benchmarks de Rendimiento Verificados#
Todas las mediciones verificadas provienen estrictamente de `BenchmarkDotNet.Artifacts` ejecutados sobre .NET RyuJIT (existen 0 ejecuciones NativeAOT en esta instantánea).
| Suite | Método | Runtime | Media (ns) | Asignado (B) | Estado |
|---|---|---|---|---|---|
| SecurityBenchmarks | SecurityEnvelope Serialize (Span, Zero-Alloc) | .NET 10.0.12 X64 RyuJIT x86-64-v4 | 17.5 | 0 | measured |
| SecurityBenchmarks | SecurityEnvelope Deserialize (Span) | .NET 10.0.12 X64 RyuJIT x86-64-v4 | 35.71 | 472 | measured |
| SecurityBenchmarks | SecretBuffer Allocate & Dispose (ZeroMemory) | .NET 10.0.12 X64 RyuJIT x86-64-v4 | 37.33 | 32 | measured |
| SecurityBenchmarks | ConstantTime FixedTimeEquals (32 bytes) | .NET 10.0.12 X64 RyuJIT x86-64-v4 | 89.38 | 0 | measured |
| SecurityBenchmarks | Token Generation (URL-Safe 32 bytes) | .NET 10.0.12 X64 RyuJIT x86-64-v4 | 122.31 | 388 | measured |
| SecurityBenchmarks | Token Hash (SHA-256) | .NET 10.0.12 X64 RyuJIT x86-64-v4 | 144.28 | 184 | measured |
15. Historial de Versiones y Estado NuGet vs Repositorio#
Desfase de versiones detectado: la última versión publicada en NuGet.org es v1.0.0, mientras el HEAD del repositorio local está en v2.2.0.
| Versión | Origen | Fecha de Publicación | Resumen |
|---|---|---|---|
| v1.0.0 ↗ | github | 2026-09-24 | Ecosystem Packages in this release | Package | Version | |---------|---------| | `EricksonLopez.Security.Abstractions` | `1.0.0` | | `EricksonLopez.Security` | `1.0.0` | | `EricksonLopez.Security.Analyzers` | `1.0.0` | | `EricksonLopez.Security.AspNetCore` | `1.0.0` | | `EricksonLopez.Security.Aws` | `1.0.0` | | `EricksonLopez.Security.Azure` | `1.0.0` | | `EricksonLopez.Security.Cryptography` ... |
| v1.0.0 ↗ | nuget | 2026-09-24 | Published EricksonLopez.Security 1.0.0 to NuGet.org. |
16. Librerías Complementarias y Relacionadas#
Librerías en el mismo nivel, capa arquitectónica o vinculadas directamente mediante aristas de dependencia.
17. Documentación, API Reference y Enlaces del Portal#
Documentación Conceptual (Starlight) →
Referencia de API XML Extraída →
77 namespaces · 365 tipos · 2030 miembros
Mapa de Dependencias del Ecosistema →
Centro de Aprendizaje y Manual →
Las páginas conceptuales por librería en Starlight se completan en M4; las páginas de API Reference en M3.2.
18. Repositorio Fuente, Licencia y Contribución#
Publicado bajo Licencia MIT. Todos los ensamblados cumplen los invariantes de compilación EricksonLopez.*: importaciones explícitas, firma fuerte (`EricksonLopez.snk`) y metadatos de autor en ASCII (`Erickson Lopez`).
19. Resolución de Problemas, Riesgos y Migración#
- Los paquetes criptográficos núcleo y FIDO2 son Full AOT; 4 subpaquetes (Cryptography.XmlDSig, GoogleCloud, OpenTelemetry, Saml2) declaran IsAotCompatible=false.
- Desfase de versiones detectado: la última versión publicada en NuGet.org es v1.0.0, mientras el HEAD del repositorio local está en v2.2.0.
20. Evidencia de Calidad y Verificación#
- Firma Fuerte (`EricksonLopez.snk`)
- EricksonLopez.snk
- `ImplicitUsings=disable`
- disable
- Extracción de Documentación XML
- Verificado (77 namespaces, 365 tipos, 2030 miembros)
- Atributos MSBuild AOT / Trimming
- 17 Full / 0 Partial / 4 Incompatible / 1 N/A
- Artefactos BenchmarkDotNet
- 7 total (6 measured, 1 na_error)
Límites Explícitos de Verificación y Alcance
- Todas las mediciones verificadas provienen estrictamente de `BenchmarkDotNet.Artifacts` ejecutados sobre .NET RyuJIT (existen 0 ejecuciones NativeAOT en esta instantánea).
- 1 no publicados