# @vorionsys/security

Enterprise security modules for the Vorion platform. Provides 23 security modules covering authentication, cryptography, detection, governance, and compliance.

## Install

```bash
npm install @vorionsys/security
```

## Modules

### Authentication & Access

| Module | Import | Description |
|--------|--------|-------------|
| **WebAuthn** | `@vorionsys/security/webauthn` | FIDO2 passwordless authentication |
| **MFA** | `@vorionsys/security/mfa` | Multi-factor authentication (TOTP) |
| **SSO** | `@vorionsys/security/sso` | Single Sign-On (OIDC) |
| **PAM** | `@vorionsys/security/pam` | Privileged Access Management (JIT, break-glass) |
| **Service Auth** | `@vorionsys/security/service-auth` | Service-to-service authentication |

### Cryptography

| Module | Import | Description |
|--------|--------|-------------|
| **Crypto** | `@vorionsys/security/crypto` | FIPS 140-2 compliant crypto operations |
| **HSM** | `@vorionsys/security/hsm` | Hardware Security Module integration (AWS CloudHSM) |
| **KMS** | `@vorionsys/security/kms` | Key Management Service (AWS KMS, Azure Key Vault, GCP KMS) |
| **Encryption** | `@vorionsys/security/encryption` | Field-level encryption |
| **ZKP** | `@vorionsys/security/zkp` | Zero-knowledge proofs |

### Detection & Monitoring

| Module | Import | Description |
|--------|--------|-------------|
| **SIEM** | `@vorionsys/security/siem` | SIEM integration (Splunk, Elastic, Loki, Datadog) |
| **Anomaly** | `@vorionsys/security/anomaly` | Anomaly detection (impossible travel, volume spikes) |
| **Threat Intel** | `@vorionsys/security/threat-intel` | Threat intelligence (bot detection, IP reputation) |
| **Alerting** | `@vorionsys/security/alerting` | Multi-channel alerting |

### Governance & Policy

| Module | Import | Description |
|--------|--------|-------------|
| **Policy Engine** | `@vorionsys/security/policy-engine` | OPA-style policy evaluation |
| **Trust Oracle** | `@vorionsys/security/trust-oracle` | Vendor risk scoring |
| **AI Governance** | `@vorionsys/security/ai-governance` | AI governance controls |

### Response & Compliance

| Module | Import | Description |
|--------|--------|-------------|
| **Incident** | `@vorionsys/security/incident` | Incident response with automated playbooks |
| **DLP** | `@vorionsys/security/dlp` | Data loss prevention |
| **Headers** | `@vorionsys/security/headers` | Security headers middleware |
| **API Keys** | `@vorionsys/security/api-keys` | API key management |
| **Audit** | `@vorionsys/security/audit` | Audit logging |

## Usage

```typescript
// Import specific modules via subpath
import { webauthn } from '@vorionsys/security/webauthn';
import { mfa } from '@vorionsys/security/mfa';
import { siem } from '@vorionsys/security/siem';

// Or import everything via barrel
import { webauthn, mfa, siem, crypto } from '@vorionsys/security';
```

## Dependencies

- **Required**: `@simplewebauthn/server`, `jose`, `zod`, `argon2`, `ioredis`, `otplib`, `qrcode`
- **Optional Peer**: `@aws-sdk/client-kms`, `@aws-sdk/client-cloudhsm-v2`, `@azure/keyvault-keys`, `@google-cloud/kms`

## License

MIT
