Skip to content

Feat/mdm agent enrolment - #185

Open
benjamsf wants to merge 5 commits into
mainfrom
feat/mdm-agent-enrolment
Open

benjamsf wants to merge 5 commits into
mainfrom
feat/mdm-agent-enrolment

Conversation

@benjamsf

Copy link
Copy Markdown
Member

Description

See the MDM/SCEP support plan at https://github.com/pvarki/python-odmdmkit-poc/blob/main/docs/mvp-plan.md

Lets a named service identity complete a device enrolment an admin already planned, so an MDM can
enrol phones over SCEP without anyone holding an admin certificate.

POST /enrollment/init takes mdm=true to plan a callsign, and issues no JWT for one. The device
never uses it, and issuing it would overwrite the planning admin's session.
POST /enrollment/accept now serves two callers: an admin approving by hand, unchanged, or the
agent supplying the CSR the device generated.

The agent is mdm_agent_cns, empty by default, so the path does not exist until a deployment names
a CN. Not a product CN: those skip role checks and can have any subject signed. The CN is also
reserved as a callsign, or an invited user could have been issued one and then completed every
planned enrolment.

A callsign is spent forever once used, so: hand-approving an MDM-planned row is refused, the claim
is one conditional UPDATE so two devices cannot both win, and a repeat returns the same certificate
matched on the CSR's public key.

Anything Else You'd Like to Mention

Base is fix/verify-csr-exact-subject, which this relies on for the subject check.

CN=OTTER1X passed for OTTER1, and OU=CN=OTTER1,CN=ADMIN passed while the cert
the CA issued said ADMIN. Now compares parsed CN attributes, and checks the
signature so an unverifiable request never reaches the CA.
An admin marks a callsign with init mdm=true; the agent completes it with the
device CSR, authorised by its CN in RM_MDM_AGENT_CNS, empty by default.
Approving such a row by hand is refused: it would spend the callsign on a
keypair generated here.
Revert "chore: remove useless comments"

This reverts commit d7448d0c270a418e7add8ace1c3465c1f879efed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant