Simplify DB to six tables and load credentials via Always Encrypted SonicCredential.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
# Datenbank EsbZertifikatManager
|
||||
|
||||
Schlankes Schema (6 Tabellen) für den ESB Certificate Manager.
|
||||
|
||||
## Hierarchie
|
||||
|
||||
- **Company** — DE / PL / AT
|
||||
- **Environment** — TEST2 / TEST / PROD (an `SonicConnection`)
|
||||
- **SonicConnection** — Management-Host/Port/Domain
|
||||
- **SonicCredential** — Always-Encrypted-Zugangsdaten (einziger Credential-Speicher)
|
||||
- **SonicContainer** — Container je Company + Connection
|
||||
- **CertificateTarget** — Deploy-Pfad/Dateiname (+ lokales File-Backup)
|
||||
|
||||
## Deployment (bestehende befüllte DB ersetzen)
|
||||
|
||||
Alles wird gelöscht — keine Migration.
|
||||
|
||||
1. **Always-Encrypted-Zertifikat** prüfen (Thumbprint aus `appsettings.json` → `AlwaysEncrypted:CertificateThumbprint`) unter `CurrentUser\My` inkl. privatem Schlüssel.
|
||||
2. Skripte **in dieser Reihenfolge** in SSMS ausführen:
|
||||
1. `00_DropExisting.sql` — droppt `EsbZertifkatManager` (Alt) und `EsbZertifikatManager` inkl. CMK/CEK
|
||||
2. `01_CreateDatabase.sql` — leere Ziel-DB
|
||||
3. `02_CreateSchema.sql` — Always Encrypted (CMK/CEK) + 6 Tabellen
|
||||
4. `03_Seed.sql` — Company + Environment
|
||||
3. Connection String: `Database=EsbZertifikatManager` und `Column Encryption Setting=Enabled`.
|
||||
4. Connections / Container / Targets manuell anlegen; Credentials **nur** über Setup-Wizard (`SonicCredential`, Always Encrypted).
|
||||
5. App neu starten.
|
||||
|
||||
## Always Encrypted
|
||||
|
||||
| Objekt | Name |
|
||||
|---|---|
|
||||
| Column Master Key | `CMK_ESB_ZertifikatManager` |
|
||||
| Column Encryption Key | `CEK_ESB_ZertifikatManager` |
|
||||
| Verschlüsselte Spalten | `SonicCredential.CredentialUserName`, `SonicCredential.CredentialSecret` |
|
||||
|
||||
CMK zeigt auf `CurrentUser/My/<Thumbprint>`. Der `ENCRYPTED_VALUE` der CEK gilt nur für dieses Zertifikat — bei neuem Cert CEK in SSMS neu erzeugen und in `02_CreateSchema.sql` ersetzen.
|
||||
Reference in New Issue
Block a user