Entity-Referenz¶
TCM365 verwendet 35 TypeORM Entities, die auf PostgreSQL Tabellen abgebildet werden. Alle Entities erweitern BaseEntity, die UUID Primary Keys und Timestamp-Spalten bereitstellt. Diese Seite dokumentiert jede Entity, organisiert nach funktionaler Kategorie.
BaseEntity Pattern¶
Alle Entities erben von BaseEntity, die folgende Felder bereitstellt:
// common/entities/base.entity.ts
@PrimaryGeneratedColumn('uuid')
id: string;
@CreateDateColumn({ name: 'created_at' })
createdAt: Date;
@UpdateDateColumn({ name: 'updated_at' })
updatedAt: Date;
UUID Primary Keys
TCM365 verwendet UUID v4 Primary Keys im gesamten Datenbank-Schema. Auto-Increment Integer IDs werden nicht verwendet.
Kern-Entities¶
User¶
| Spalte | Typ | Beschreibung |
|---|---|---|
id |
UUID | Primary Key |
email |
varchar | Eindeutige E-Mail-Adresse |
name |
varchar | Anzeigename |
password |
varchar | Bcrypt-gehashtes Passwort |
role |
enum | UserRole (SUPER_ADMIN, TENANT_ADMIN, WORKFLOW_MANAGER, VIEWER) |
azure_ad_id |
varchar | Azure AD Object ID (für SSO Benutzer) |
internal_tenant_id |
UUID | Organisationszuordnung |
is_active |
boolean | Account-Status |
created_at |
timestamp | Erstellungszeitpunkt |
updated_at |
timestamp | Letzter Aktualisierungszeitpunkt |
Tabelle: users
Beziehungen: Gehoert zu InternalTenant, hat viele AuditLog Einträge.
Group¶
| Spalte | Typ | Beschreibung |
|---|---|---|
id |
UUID | Primary Key |
name |
varchar | Gruppenname |
description |
varchar | Gruppenbeschreibung |
internal_tenant_id |
UUID | Organisationszuordnung |
created_at |
timestamp | Erstellungszeitpunkt |
updated_at |
timestamp | Letzter Aktualisierungszeitpunkt |
Tabelle: groups
Beziehungen: Gehoert zu InternalTenant, Many-to-Many mit User.
InternalTenant¶
| Spalte | Typ | Beschreibung |
|---|---|---|
id |
UUID | Primary Key (verwendet als org_id für RLS) |
name |
varchar | Organisationsname |
domain |
varchar | Organisationsdomain |
settings |
jsonb | Org-Level Einstellungen und Feature Flags |
created_at |
timestamp | Erstellungszeitpunkt |
updated_at |
timestamp | Letzter Aktualisierungszeitpunkt |
Tabelle: internal_tenants
Beziehungen: Hat viele User, VendorTenant, M365Tenant.
Legacy Cleanup (v2.4.0)
Die M365Tenant-Entity und die zugehörige m365_tenants-Tabelle wurden in v2.4.0 vollständig entfernt. Alle Tenant-Daten werden nun über die VendorTenant STI-Hierarchie verwaltet.
Vendor Tenant Hierarchie (STI)¶
TCM365 verwendet Single Table Inheritance für Vendor Tenants mit einer vendor Discriminator-Spalte.
VendorTenant (Basis)¶
| Spalte | Typ | Beschreibung |
|---|---|---|
id |
UUID | Primary Key |
vendor |
varchar | Discriminator: microsoft, zscaler oder atlassian |
name |
varchar | Tenant Anzeigename |
internal_tenant_id |
UUID | Organisationszuordnung |
is_active |
boolean | Verbindungsstatus |
metadata |
jsonb | Vendor-spezifische Metadaten |
created_at |
timestamp | Erstellungszeitpunkt |
updated_at |
timestamp | Letzter Aktualisierungszeitpunkt |
Tabelle: vendor_tenants
M365VendorTenant¶
Erweitert VendorTenant mit @ChildEntity('microsoft'):
| Spalte | Typ | Beschreibung |
|---|---|---|
tenant_id |
varchar | Azure AD Tenant ID |
domain |
varchar | Primäre Domain |
connection_type |
varchar | Verbindungstyp (app_registration) |
enabled_workloads |
jsonb | Aktivierte M365 Workloads |
write_credentials |
jsonb | Verschluesselte Write App Credentials |
granted_permissions |
jsonb | Verifizierte Graph API Permissions |
ZscalerVendorTenant¶
Erweitert VendorTenant mit @ChildEntity('zscaler'):
| Spalte | Typ | Beschreibung |
|---|---|---|
zia_cloud |
varchar | ZIA Cloud Instanz (z.B. zscaler.net) |
zia_api_key |
varchar | Verschluesselter ZIA API Key |
zia_admin_username |
varchar | ZIA Admin Benutzername |
zia_admin_password |
varchar | Verschluesseltes ZIA Admin Passwort |
zpa_customer_id |
varchar | ZPA Customer ID |
zpa_client_id |
varchar | ZPA OAuth Client ID |
zpa_client_secret |
varchar | Verschluesseltes ZPA Client Secret |
zpa_cloud |
varchar | ZPA Cloud Instanz |
AtlassianVendorTenant (v2.5.0)¶
Erweitert VendorTenant mit @ChildEntity('atlassian'):
| Spalte | Typ | Beschreibung |
|---|---|---|
oauth_access_token |
text | Verschluesseltes OAuth 2LO Access Token |
oauth_refresh_token |
text | Verschluesseltes OAuth 2LO Refresh Token |
oauth_token_expires_at |
timestamp | Token-Ablaufzeitpunkt |
site_id |
varchar | Atlassian Cloud Site ID |
site_url |
varchar | Site URL (z.B. contoso.atlassian.net) |
site_name |
varchar | Anzeigename der Site |
guard_tier |
varchar | Atlassian Guard Tier (free, standard, premium) |
Konfigurationsmanagement Entities¶
Snapshot¶
| Spalte | Typ | Beschreibung |
|---|---|---|
id |
UUID | Primary Key |
name |
varchar | Snapshot Anzeigename |
status |
varchar | Status (in_progress, completed, failed, partially_completed) |
vendor_tenant_id |
UUID | FK zu VendorTenant |
data |
jsonb | Komprimierte Konfigurationsdaten |
resource_types |
jsonb | Liste erfasster Resource Types |
item_count |
integer | Gesamtanzahl erfasster Konfigurationselemente |
internal_tenant_id |
UUID | Organisationszuordnung |
created_at |
timestamp | Erfassungszeitpunkt |
Tabelle: snapshots (tenant-bezogen, per-tenant Schema)
Legacy Cleanup (v2.4.0)
Ab v2.4.0 verwenden alle Entities ausschliesslich vendor_tenant_id. Die früheren dualen FK-Spalten (m365_tenant_id) wurden entfernt.
Blueprint¶
| Spalte | Typ | Beschreibung |
|---|---|---|
id |
UUID | Primary Key |
name |
varchar | Blueprint Name |
description |
text | Blueprint Beschreibung |
vendor_tenant_id |
UUID | FK zu VendorTenant |
template_id |
varchar | Baseline Template Identifier |
settings |
jsonb | Blueprint Konfigurationseinstellungen |
internal_tenant_id |
UUID | Organisationszuordnung |
Tabelle: blueprints
BlueprintAnalysis¶
| Spalte | Typ | Beschreibung |
|---|---|---|
id |
UUID | Primary Key |
blueprint_id |
UUID | FK zu Blueprint |
analysis |
jsonb | KI-generierte Analyseergebnisse |
model |
varchar | Verwendetes KI-Modell (z.B. gpt-4) |
Tabelle: blueprint_analyses
ConfigurationDrift¶
| Spalte | Typ | Beschreibung |
|---|---|---|
id |
UUID | Primary Key |
resource_type |
varchar | Betroffener Resource Type (vendor-prefixed) |
resource_id |
varchar | Spezifische Ressourcen-Instanz-ID |
drift_details |
jsonb | Detaillierte Drift-Informationen |
severity |
varchar | Schweregrad (low, medium, high, critical) |
status |
varchar | Status (open, acknowledged, resolved) |
vendor_tenant_id |
UUID | FK zu VendorTenant |
monitor_id |
UUID | FK zu ConfigurationMonitor |
internal_tenant_id |
UUID | Organisationszuordnung |
Tabelle: configuration_drifts (tenant-bezogen)
ConfigurationMonitor¶
| Spalte | Typ | Beschreibung |
|---|---|---|
id |
UUID | Primary Key |
name |
varchar | Monitor Anzeigename |
resource_types |
jsonb | Ueberwachte Resource Types |
schedule |
varchar | Cron-Ausdruck für Prueffrequenz |
status |
varchar | Monitor Status (active, paused, stopped) |
baseline_data |
jsonb | Soll-Zustand Konfiguration |
vendor_tenant_id |
UUID | FK zu VendorTenant |
internal_tenant_id |
UUID | Organisationszuordnung |
Tabelle: configuration_monitors (tenant-bezogen)
SeveritySuggestion (v2.4.0)¶
| Spalte | Typ | Beschreibung |
|---|---|---|
id |
UUID | Primary Key |
rule_id |
varchar | Referenz zur Baseline-Regel |
suggested_severity |
varchar | KI-empfohlener Schweregrad |
reasoning |
text | Begründung der KI-Empfehlung |
model |
varchar | Verwendetes KI-Modell |
accepted |
boolean | Ob die Empfehlung akzeptiert wurde |
Tabelle: severity_suggestions
Operations Entities¶
Workflow¶
| Spalte | Typ | Beschreibung |
|---|---|---|
id |
UUID | Primary Key |
name |
varchar | Workflow Name |
type |
varchar | Workflow Typ |
schedule |
varchar | Cron-Ausdruck |
config |
jsonb | Workflow Konfiguration |
is_active |
boolean | Ob der Workflow aktiviert ist |
vendor_tenant_id |
UUID | FK zu VendorTenant |
internal_tenant_id |
UUID | Organisationszuordnung |
Tabelle: workflows (tenant-bezogen)
WorkflowExecution¶
| Spalte | Typ | Beschreibung |
|---|---|---|
id |
UUID | Primary Key |
workflow_id |
UUID | FK zu Workflow |
status |
varchar | Ausfuehrungsstatus |
result |
jsonb | Ausfuehrungsergebnisse |
started_at |
timestamp | Startzeitpunkt der Ausführung |
completed_at |
timestamp | Abschlusszeitpunkt der Ausführung |
Tabelle: workflow_executions
RollbackHistory¶
| Spalte | Typ | Beschreibung |
|---|---|---|
id |
UUID | Primary Key |
resource_type |
varchar | Zurueckgesetzter Resource Type |
resource_id |
varchar | Spezifische Ressourcen-Instanz-ID |
snapshot_id |
UUID | FK zum Quell-Snapshot |
status |
varchar | Rollback Status (success, failed) |
details |
jsonb | Rollback-Ausfuehrungsdetails |
vendor_tenant_id |
UUID | FK zu VendorTenant |
internal_tenant_id |
UUID | Organisationszuordnung |
Tabelle: rollback_history
Anomaly Detection Entities¶
AnomalyBaseline¶
| Spalte | Typ | Beschreibung |
|---|---|---|
id |
UUID | Primary Key |
resource_type |
varchar | Resource Type für Baseline |
baseline_data |
jsonb | Gelernte Baseline-Metriken |
vendor_tenant_id |
UUID | FK zu VendorTenant |
learning_period |
integer | Tage der Daten für Baseline-Berechnung |
Tabelle: anomaly_baselines
AnomalyEvent¶
| Spalte | Typ | Beschreibung |
|---|---|---|
id |
UUID | Primary Key |
baseline_id |
UUID | FK zu AnomalyBaseline |
event_type |
varchar | Typ der erkannten Anomalie |
severity |
varchar | Anomalie-Schweregrad |
details |
jsonb | Anomalie-Details und Kontext |
correlated_events |
jsonb | Korrelierte Events |
Tabelle: anomaly_events
AnomalyMetric, CustomProbe, CustomProbeExecution¶
- AnomalyMetric -- Einzelne Metrik-Messwerte für Anomaly Baselines
- CustomProbe -- Benutzerdefinierte Monitoring-Probes mit Cron Schedule
- CustomProbeExecution -- Ausfuehrungsergebnisse von Custom Probes
Tabellen: anomaly_metrics, custom_probes, custom_probe_executions
KRITIS/NIS2 Compliance Entities¶
Incident¶
| Spalte | Typ | Beschreibung |
|---|---|---|
id |
UUID | Primary Key |
title |
varchar | Incident Titel |
description |
text | Incident Beschreibung |
severity |
varchar | Schweregrad |
status |
varchar | Status (open, investigating, resolved) |
nis2_category |
varchar | NIS2 Incident-Kategorie |
reporting_deadline |
timestamp | NIS2 Meldefrist |
internal_tenant_id |
UUID | Organisationszuordnung |
Tabelle: incidents
RiskAssessment¶
| Spalte | Typ | Beschreibung |
|---|---|---|
id |
UUID | Primary Key |
name |
varchar | Bewertungsname |
likelihood |
integer | Eintrittswahrscheinlichkeit (1-5) |
impact |
integer | Auswirkung (1-5) |
risk_score |
integer | Berechneter Risikowert |
mitigation |
text | Mitigationsstrategie |
internal_tenant_id |
UUID | Organisationszuordnung |
Tabelle: risk_assessments
Weitere KRITIS Entities¶
- ChangeRequest -- Änderungsanträge mit Approval Workflows
- ChangeApproval -- Einzelne Genehmigungsentscheidungen in der Approval Chain
- ComplianceCheck -- Compliance-Evaluierungsergebnisse (Frameworks: NIS2, ISO27001, CIS, NIST, GDPR, Maester, EIDSCA, COPILOT_READINESS, Custom)
- BcdrTest -- BC/DR Test-Datensaetze mit RTO/RPO Tracking
- AuditEvidence -- Audit-Evidenz-Artefakte
- ReadinessAssessment -- Copilot Readiness Assessment Ergebnisse (44 Checks)
Tabellen: change_requests, change_approvals, compliance_checks, bcdr_tests, audit_evidence, readiness_assessments
Infrastruktur Entities¶
AuditLog¶
| Spalte | Typ | Beschreibung |
|---|---|---|
id |
UUID | Primary Key |
action |
varchar | Ausgefuehrte Aktion |
entity_type |
varchar | Ziel-Entity-Typ |
entity_id |
varchar | Ziel-Entity-ID |
user_id |
UUID | FK zu User |
details |
jsonb | Aktionsdetails und Kontext |
ip_address |
varchar | Client IP-Adresse |
created_at |
timestamp | Unveraenderlicher Event-Zeitstempel |
Tabelle: audit_logs
Unveraenderlich
Audit Log Einträge sind Append-Only. Sie können über die Applikation weder aktualisiert noch gelöscht werden.
Weitere Infrastruktur Entities¶
- NotificationConfig -- Benachrichtigungskanal-Konfigurationen (E-Mail, Teams, Slack, Webhook)
- NotificationLog -- Benachrichtigungszustellungsversuche und -status
- Report -- Generierte Reports (Typen: Drift, Compliance, Security Assessment, Tenant Overview, Dashboard)
- SystemSetting -- Systemweite Konfigurationseinstellungen (Key-Value)
- UTCMQuotaUsage -- UTCM API Quota-Tracking pro Tenant
Tabellen: notification_configs, notification_logs, reports, system_settings, utcm_quota_usage
Entity-Beziehungen¶
InternalTenant (Organisation)
|-- hat viele --> User
|-- hat viele --> Group
|-- hat viele --> VendorTenant
| |-- M365VendorTenant (STI Kind)
| |-- ZscalerVendorTenant (STI Kind)
| |-- AtlassianVendorTenant (STI Kind, v2.5.0)
| |-- hat viele --> Snapshot
| |-- hat viele --> ConfigurationDrift
| |-- hat viele --> ConfigurationMonitor
| |-- hat viele --> Workflow
| |-- hat viele --> RollbackHistory
| |-- hat viele --> ComplianceCheck
|
|-- hat viele --> Incident
|-- hat viele --> RiskAssessment
|-- hat viele --> ChangeRequest
|-- hat viele --> AuditEvidence
|-- hat viele --> AuditLog
Schema-Isolation¶
Entities fallen in zwei Kategorien:
Control Plane (Public Schema)¶
Applikationsweit geteilt: users, groups, internal_tenants, vendor_tenants, system_settings, audit_logs, utcm_quota_usage.
Data Plane (Per-Tenant Schema)¶
Isoliert pro Tenant in tenant_{uuid} Schemas: snapshots, workflows, workflow_executions, configuration_drifts, configuration_monitors, blueprints, rollback_history, anomaly_baselines, anomaly_events, anomaly_metrics, custom_probes, custom_probe_executions, compliance_checks, readiness_assessments und weitere (23 Tabellen insgesamt).
Schema-Erstellung
Neue Tenant Schemas werden automatisch durch den TenantSchemaManager erstellt, wenn ein neuer InternalTenant angelegt wird. Der Manager erstellt alle 23 Data-Plane Tabellen im neuen tenant_{uuid} Schema.