openapi: 3.1.0 info: title: Dexwize compliance service version: 1.0.0 description: > UAE IA endpoint control evidence (E22, ADR-0034). Device posture telemetry is evaluated against a versioned control mapping (content/compliance) with pass, fail or unknown per device and control. Evidence packs (results CSV plus a signed manifest) are stored immutably by report-service as report type ia_evidence. Control identifiers in the mapping are pending GRC review; every response states the mapping review status. servers: - url: https://api.dexwize.example security: - bearer: [] paths: /v1/compliance/mapping: get: summary: The control mapping in force (AuditRead) operationId: getComplianceMapping responses: '200': description: Mapping content: application/json: schema: { $ref: '#/components/schemas/ControlMapping' } '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/compliance/summary: get: summary: Per-control results for a calendar month (AuditRead; auditors and tenant admins) operationId: getComplianceSummary parameters: - { name: period, in: query, description: 'YYYY-MM; defaults to the previous month', schema: { type: string, pattern: '^[0-9]{4}-[0-9]{2}$' } } responses: '200': description: Summary content: application/json: schema: { $ref: '#/components/schemas/ComplianceSummary' } '400': { description: Invalid or future period } '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/compliance/devices/{deviceId}: get: summary: Results for one device (AuditRead) operationId: getDeviceCompliance parameters: - { name: deviceId, in: path, required: true, schema: { type: string, format: uuid } } - { name: period, in: query, schema: { type: string } } responses: '200': description: Device results content: application/json: schema: type: object required: [deviceId, period, results] properties: deviceId: { type: string, format: uuid } period: { type: string } results: { type: array, items: { $ref: '#/components/schemas/ControlResult' } } '404': { description: Unknown device or no data for this tenant } '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/compliance/evidence-packs: post: summary: Generate and store a signed evidence pack for a month (ReportsGenerate) operationId: generateEvidencePack requestBody: required: true content: application/json: schema: type: object properties: period: { type: string, description: 'YYYY-MM; defaults to the previous month' } responses: '201': description: The stored ia_evidence report (see report-service) content: application/json: schema: { type: object, additionalProperties: true } '400': { description: Invalid period or storage refused } '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/compliance/evidence-packs/schedule: get: summary: Whether the previous month's pack is generated automatically (AuditRead) operationId: getEvidencePackSchedule responses: '200': description: Schedule content: application/json: schema: { $ref: '#/components/schemas/MonthlySchedule' } '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } put: summary: > Turn the monthly evidence pack on or off for the caller's tenant (ReportsGenerate). Packs are then stored by the schedule with a tenant-scoped service token, so the tenant must also grant compliance-service the report-service audience. operationId: setEvidencePackSchedule requestBody: required: true content: application/json: schema: type: object required: [enabled] properties: enabled: { type: boolean } responses: '200': description: Schedule after the change content: application/json: schema: { $ref: '#/components/schemas/MonthlySchedule' } '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } components: securitySchemes: bearer: { type: http, scheme: bearer, bearerFormat: JWT } responses: FeatureNotEntitled: description: The caller lacks the permission (empty body), or the tenant's plan, add-ons, licence and overrides do not include the feature (error feature_not_entitled, ADR-0053). content: { application/json: { schema: { $ref: '#/components/schemas/EntitlementRefusal' } } } EntitlementsUnavailable: description: The tenant's entitlements could not be confirmed and nothing usable was cached, so the paid feature is refused (fail closed, ADR-0053). Retry-After is set. content: { application/json: { schema: { $ref: '#/components/schemas/EntitlementRefusal' } } } schemas: EntitlementRefusal: description: Module licensing refusal (ADR-0053). type: object required: [error, feature] properties: error: { type: string, enum: [feature_not_entitled, entitlements_unavailable] } feature: { type: string, description: Catalogue feature code, for example query } LocalizedText: type: object required: [en, ar] properties: en: { type: string } ar: { type: string } MonthlySchedule: type: object required: [enabled, nextPeriod] properties: enabled: { type: boolean } enabledBy: { type: [string, 'null'] } enabledAt: { type: [string, 'null'], format: date-time } nextPeriod: { type: string, description: 'YYYY-MM the next scheduled run generates (the previous full month)' } ControlMapping: type: object required: [schema, id, version, framework, reviewStatus, controls] properties: schema: { type: string } id: { type: string } version: { type: integer } framework: { type: string } reviewStatus: { type: string } notes: { type: string } controls: type: array items: type: object properties: id: { type: string } check: { type: string } title: { $ref: '#/components/schemas/LocalizedText' } frameworkReference: type: object properties: control_area: { type: string } control_id: { type: [string, 'null'] } status: { type: string } mappingNote: { type: string } ControlSummary: type: object properties: controlId: { type: string } title: { $ref: '#/components/schemas/LocalizedText' } controlArea: { type: string } frameworkControlId: { type: [string, 'null'] } referenceStatus: { type: string } pass: { type: integer } fail: { type: integer } unknown: { type: integer } passRate: { type: [number, 'null'], description: 'pass / (pass + fail); unknown is excluded' } ComplianceSummary: type: object required: [period, deviceCount, controls] properties: period: { type: string } from: { type: string, format: date-time } to: { type: string, format: date-time } deviceCount: { type: integer } truncated: { type: boolean } mappingId: { type: string } mappingVersion: { type: integer } mappingSha256: { type: string } reviewStatus: { type: string } controls: { type: array, items: { $ref: '#/components/schemas/ControlSummary' } } ControlResult: type: object properties: deviceId: { type: string, format: uuid } controlId: { type: string } outcome: { type: string, enum: [Pass, Fail, Unknown] } reason: { type: string } evidence: type: [object, 'null'] properties: deviceId: { type: string, format: uuid } batchId: { type: string, format: uuid } recordIndex: { type: integer } observedAt: { type: string, format: date-time }