Private
Public Access
1
0

docs: add self-enrollment client workflow to API documentation
All checks were successful
CI/CD Pipeline / Code Format (push) Successful in 4s
CI/CD Pipeline / Clippy Lints (push) Successful in 41s
CI/CD Pipeline / Unit Tests (push) Successful in 54s
CI/CD Pipeline / Security Audit (push) Successful in 5s
CI/CD Pipeline / Build Debian Package (Ubuntu 22.04) (push) Successful in 2m16s
CI/CD Pipeline / Build Debian Package (push) Successful in 2m17s
CI/CD Pipeline / Build Arch Package (push) Successful in 2m30s
CI/CD Pipeline / Build Alpine Package (push) Successful in 3m29s
CI/CD Pipeline / Build RPM Package (push) Successful in 3m53s

This commit is contained in:
2026-05-16 19:18:25 +00:00
parent abcc5c5e40
commit d297c8d3b1
7 changed files with 450 additions and 5 deletions

View File

@ -882,6 +882,48 @@ def wait_for_job(job_id, base_url, certs, poll_interval=2):
---
## Self-Enrollment Client Workflow
The Linux Patch API daemon supports automated self-enrollment to a Patch Manager instance without manual certificate distribution.
### 1. Trigger Enrollment
Run the daemon with the `--enroll` flag pointing to the manager's public API endpoint:
```bash
linux_patch_api --enroll https://<manager-host>/api/v1
```
### 2. Registration Request (Unauthenticated)
The daemon extracts `/etc/machine-id`, FQDN, IP, and OS details, then submits:
```http
POST /api/v1/enroll HTTP/1.1
Content-Type: application/json
```
**Response:** Returns a temporary `polling_token`.
### 3. Status Polling
The daemon enters a polling loop (default: every 60s):
```http
GET /api/v1/enroll/status/{polling_token} HTTP/1.1
```
- `202 Accepted`: Still pending admin approval.
- `403/404 Forbidden`: Request denied or expired (daemon aborts).
- `200 OK`: Approved. Response body contains the PKI bundle (`ca.crt`, `server.crt`, `server.key`).
### 4. Provisioning & Transition
Upon receiving HTTP 200:
1. Writes certificates to configured mTLS storage paths.
2. Appends manager IP to `/etc/linux_patch_api/whitelist.yaml`.
3. Smoothly transitions to standard mTLS listening mode without service restart.
---
## Support
- **Documentation:** [README.md](./README.md)
- **Deployment:** [DEPLOYMENT_GUIDE.md](./DEPLOYMENT_GUIDE.md)
- **Security:** [DEPLOYMENT_SECURITY_GUIDE.md](./DEPLOYMENT_SECURITY_GUIDE.md)
## Support
- **Documentation:** [README.md](./README.md)