IF Commons GitHub

workloadIdentity

concept

What a platform vouches for about a workload, so that a machine proves itself by it instead of by a secret

Model identityMachine. Written in commons/data/models/identity-machine/mod.ts:37. Identified by workloadIdentityId.

Governance: attributes

audiencetextoptional

The audience the proof must be for

Becomes the column audience of workload_identity.

Written at commons/data/models/identity-machine/mod.ts:45

bindingKeytextrequired

A hash of the issuer and the subject, unique

Becomes the column binding_key of workload_identity.

Written at commons/data/models/identity-machine/mod.ts:48

issuertextrequired

The issuer

Becomes the column issuer of workload_identity.

Written at commons/data/models/identity-machine/mod.ts:42

issuerKindcode of issuerKindrequired

What vouches for it

Becomes the column issuer_kind of workload_identity.

Written at commons/data/models/identity-machine/mod.ts:41

selectorstextmany

What must all match, as SPIRE's selectors do

Becomes the column selectors of workload_identity.

Written at commons/data/models/identity-machine/mod.ts:46

statuscode of useStatusrequired

Whether the binding is applied

Becomes the column status of workload_identity.

Written at commons/data/models/identity-machine/mod.ts:47

subjecttextrequired

The workload's name for the issuer: a SPIFFE ID, a service account, a subject, a thumbprint

Becomes the column subject of workload_identity.

Written at commons/data/models/identity-machine/mod.ts:43

trustDomaintextoptional

The trust domain

Becomes the column trust_domain of workload_identity.

Written at commons/data/models/identity-machine/mod.ts:44

workloadIdentityIdidentifierrequired

What identifies the binding, made by the application

Becomes the column workload_identity_id of workload_identity.

Written at commons/data/models/identity-machine/mod.ts:40

Governance: relationships

machineone

The machine the workload is To machine. Written at commons/data/models/identity-machine/mod.ts:37

Logical: the table

Projects to the table workload_identity with the primary key workload_identity_id.

ColumnTypeNullRoleFrom
audiencetexttrueattributeworkloadIdentity.audience
binding_keytextfalseattributeworkloadIdentity.bindingKey
issuertextfalseattributeworkloadIdentity.issuer
issuer_kindtextfalseattributeworkloadIdentity.issuerKind
machine_principal_idtextfalsereferenceworkloadIdentity.machine
statustextfalseattributeworkloadIdentity.status
subjecttextfalseattributeworkloadIdentity.subject
trust_domaintexttrueattributeworkloadIdentity.trustDomain
workload_identity_idtextfalseattributeworkloadIdentity.workloadIdentityId

Physical: SQL

CREATE TABLE IF NOT EXISTS "workload_identity" (
    "workload_identity_id" VARCHAR NOT NULL PRIMARY KEY,
    "issuer_kind" VARCHAR NOT NULL,
    "issuer" VARCHAR NOT NULL,
    "subject" VARCHAR NOT NULL,
    "trust_domain" VARCHAR,
    "audience" VARCHAR,
    "status" VARCHAR NOT NULL,
    "binding_key" VARCHAR NOT NULL,
    "machine_principal_id" VARCHAR NOT NULL,
    CONSTRAINT "workload_identity_machine_principal_id_fk" FOREIGN KEY ("machine_principal_id") REFERENCES "machine" ("principal_id"),
    CONSTRAINT "workload_identity_binding_key_uq" UNIQUE ("binding_key"),
    CONSTRAINT "workload_identity_issuer_kind_ck" CHECK ("issuer_kind" IN ('spiffe', 'kubernetes', 'oidc', 'cloud', 'mtls')),
    CONSTRAINT "workload_identity_status_ck" CHECK ("status" IN ('active', 'retired'))
);

Physical: the typed table

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

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

const rows = await from(workloadIdentity).select((s) => ({ workloadIdentityId: s.workloadIdentity.workloadIdentityId, issuerKind: s.workloadIdentity.issuerKind })).run(runner);

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