IF Commons GitHub

devicePosture

concept

How a device was doing when it last reported; after its time is up it reads as unknown, never as compliant

Model identityDevice. Written in commons/data/models/identity-device/mod.ts:69. Identified by devicePostureId.

Governance: attributes

compliancecode of compliancerequired

Whether the device meets what is asked of it

Becomes the column compliance of device_posture.

Written at commons/data/models/identity-device/mod.ts:74

detailsstructuredoptional

What else was reported

Becomes the column details of device_posture.

Written at commons/data/models/identity-device/mod.ts:83

devicePostureIdidentifierrequired

What identifies the report, made by the application

Becomes the column device_posture_id of device_posture.

Written at commons/data/models/identity-device/mod.ts:72

diskEncryptedbooleanoptional

Whether its storage is encrypted

Becomes the column disk_encrypted of device_posture.

Written at commons/data/models/identity-device/mod.ts:76

edrActivebooleanoptional

Whether endpoint detection is running

Becomes the column edr_active of device_posture.

Written at commons/data/models/identity-device/mod.ts:80

firewallbooleanoptional

Whether its firewall is on

Becomes the column firewall of device_posture.

Written at commons/data/models/identity-device/mod.ts:78

jailbrokenbooleanoptional

Whether it has been broken out of its platform's protections

Becomes the column jailbroken of device_posture.

Written at commons/data/models/identity-device/mod.ts:79

osVersiontextoptional

The version of what it runs

Becomes the column os_version of device_posture.

Written at commons/data/models/identity-device/mod.ts:75

patchAgeDaysintegeroptional

How many days old its latest patch is

Becomes the column patch_age_days of device_posture.

Written at commons/data/models/identity-device/mod.ts:81

reportedAtinstantrequired

When it was reported

Becomes the column reported_at of device_posture.

Written at commons/data/models/identity-device/mod.ts:84

riskScoreintegeroptional

A score from its reporter

Becomes the column risk_score of device_posture.

Written at commons/data/models/identity-device/mod.ts:82

screenLockbooleanoptional

Whether it locks its screen

Becomes the column screen_lock of device_posture.

Written at commons/data/models/identity-device/mod.ts:77

sourcecode of postureSourcerequired

What reported it

Becomes the column source of device_posture.

Written at commons/data/models/identity-device/mod.ts:73

validUntilinstantrequired

When the report stops counting

Becomes the column valid_until of device_posture.

Written at commons/data/models/identity-device/mod.ts:85

Governance: relationships

deviceone

The device To device. Written at commons/data/models/identity-device/mod.ts:69

Logical: the table

Projects to the table device_posture with the primary key device_posture_id.

ColumnTypeNullRoleFrom
compliancetextfalseattributedevicePosture.compliance
detailsjsontrueattributedevicePosture.details
device_posture_idtextfalseattributedevicePosture.devicePostureId
device_principal_idtextfalsereferencedevicePosture.device
disk_encryptedbooleantrueattributedevicePosture.diskEncrypted
edr_activebooleantrueattributedevicePosture.edrActive
firewallbooleantrueattributedevicePosture.firewall
jailbrokenbooleantrueattributedevicePosture.jailbroken
os_versiontexttrueattributedevicePosture.osVersion
patch_age_daysintegertrueattributedevicePosture.patchAgeDays
reported_attimestampfalseattributedevicePosture.reportedAt
risk_scoreintegertrueattributedevicePosture.riskScore
screen_lockbooleantrueattributedevicePosture.screenLock
sourcetextfalseattributedevicePosture.source
valid_untiltimestampfalseattributedevicePosture.validUntil

Physical: SQL

CREATE TABLE IF NOT EXISTS "device_posture" (
    "device_posture_id" VARCHAR NOT NULL PRIMARY KEY,
    "source" VARCHAR NOT NULL,
    "compliance" VARCHAR NOT NULL,
    "os_version" VARCHAR,
    "disk_encrypted" BOOLEAN,
    "screen_lock" BOOLEAN,
    "firewall" BOOLEAN,
    "jailbroken" BOOLEAN,
    "edr_active" BOOLEAN,
    "patch_age_days" INTEGER,
    "risk_score" INTEGER,
    "details" JSON,
    "reported_at" TIMESTAMPTZ NOT NULL,
    "valid_until" TIMESTAMPTZ NOT NULL,
    "device_principal_id" VARCHAR NOT NULL,
    CONSTRAINT "device_posture_device_principal_id_fk" FOREIGN KEY ("device_principal_id") REFERENCES "device" ("principal_id"),
    CONSTRAINT "device_posture_source_ck" CHECK ("source" IN ('mdm', 'edr', 'agent', 'manual')),
    CONSTRAINT "device_posture_compliance_ck" CHECK ("compliance" IN ('compliant', 'noncompliant', 'unknown'))
);

Physical: the typed table

Read and written from TypeScript with the types the model gives: import { devicePosture } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/identity-device.auto.ts: do not edit.

import { from } from "@intellectual-frontiers/data/sql/typed";
import { devicePosture } from "@intellectual-frontiers/data/sql/typed/models";

const rows = await from(devicePosture).select((s) => ({ devicePostureId: s.devicePosture.devicePostureId, source: s.devicePosture.source })).run(runner);

Titles, headings, exports, tables, columns and requirements. Esc closes.