@lamalibre/create-lamaste 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +118 -0
- package/README.md +114 -0
- package/bin/create-lamaste.js +15 -0
- package/package.json +54 -0
- package/scripts/bundle-vendor.js +110 -0
- package/scripts/lamaste-cert-info +62 -0
- package/scripts/lamaste-certbot +96 -0
- package/scripts/lamaste-priv +693 -0
- package/src/index.js +646 -0
- package/src/lib/accounts.js +86 -0
- package/src/lib/binaries.js +137 -0
- package/src/lib/cert-help-page.js +160 -0
- package/src/lib/env.js +132 -0
- package/src/lib/http-redirect.js +38 -0
- package/src/lib/ownership.js +231 -0
- package/src/lib/relay-services.js +103 -0
- package/src/lib/secrets.js +19 -0
- package/src/lib/service-config.js +311 -0
- package/src/lib/summary.js +131 -0
- package/src/lib/wrappers.js +63 -0
- package/src/tasks/gatekeeper.js +233 -0
- package/src/tasks/harden.js +293 -0
- package/src/tasks/mtls.js +193 -0
- package/src/tasks/nginx.js +265 -0
- package/src/tasks/node.js +110 -0
- package/src/tasks/panel.js +408 -0
- package/src/tasks/redeploy.js +438 -0
- package/vendor/docs/00-introduction/how-it-works.md +447 -0
- package/vendor/docs/00-introduction/quickstart.md +472 -0
- package/vendor/docs/00-introduction/what-is-lamaste.md +112 -0
- package/vendor/docs/01-concepts/authentication.md +464 -0
- package/vendor/docs/01-concepts/authorization.md +242 -0
- package/vendor/docs/01-concepts/certificates.md +452 -0
- package/vendor/docs/01-concepts/dns-and-domains.md +343 -0
- package/vendor/docs/01-concepts/mtls.md +490 -0
- package/vendor/docs/01-concepts/nginx-reverse-proxy.md +540 -0
- package/vendor/docs/01-concepts/security-model.md +600 -0
- package/vendor/docs/01-concepts/tickets.md +414 -0
- package/vendor/docs/01-concepts/tunneling.md +367 -0
- package/vendor/docs/02-guides/agent-setup.md +194 -0
- package/vendor/docs/02-guides/certificate-management.md +341 -0
- package/vendor/docs/02-guides/cloud-provisioning.md +406 -0
- package/vendor/docs/02-guides/desktop-app-setup.md +226 -0
- package/vendor/docs/02-guides/disaster-recovery.md +464 -0
- package/vendor/docs/02-guides/first-tunnel.md +230 -0
- package/vendor/docs/02-guides/installation.md +393 -0
- package/vendor/docs/02-guides/managing-users.md +255 -0
- package/vendor/docs/02-guides/onboarding.md +244 -0
- package/vendor/docs/02-guides/standalone-plugin-with-tickets.md +375 -0
- package/vendor/docs/02-guides/static-sites.md +364 -0
- package/vendor/docs/03-architecture/e2e-three-vm-sequences.md +457 -0
- package/vendor/docs/03-architecture/installer-flow.md +151 -0
- package/vendor/docs/03-architecture/installer.md +445 -0
- package/vendor/docs/03-architecture/management-flow.md +288 -0
- package/vendor/docs/03-architecture/nginx-configuration.md +830 -0
- package/vendor/docs/03-architecture/onboarding-flow.md +164 -0
- package/vendor/docs/03-architecture/overview.md +541 -0
- package/vendor/docs/03-architecture/panel-client.md +416 -0
- package/vendor/docs/03-architecture/panel-server.md +695 -0
- package/vendor/docs/03-architecture/state-management.md +529 -0
- package/vendor/docs/03-architecture/system-overview.md +167 -0
- package/vendor/docs/04-api-reference/certificates.md +1141 -0
- package/vendor/docs/04-api-reference/gatekeeper.md +592 -0
- package/vendor/docs/04-api-reference/onboarding.md +473 -0
- package/vendor/docs/04-api-reference/overview.md +404 -0
- package/vendor/docs/04-api-reference/services.md +267 -0
- package/vendor/docs/04-api-reference/settings.md +343 -0
- package/vendor/docs/04-api-reference/sites.md +716 -0
- package/vendor/docs/04-api-reference/system.md +268 -0
- package/vendor/docs/04-api-reference/tickets.md +618 -0
- package/vendor/docs/04-api-reference/tunnels.md +417 -0
- package/vendor/docs/04-api-reference/users.md +333 -0
- package/vendor/docs/05-operations/backup-and-restore.md +342 -0
- package/vendor/docs/05-operations/monitoring.md +285 -0
- package/vendor/docs/05-operations/uninstalling.md +344 -0
- package/vendor/docs/05-operations/upgrades.md +270 -0
- package/vendor/docs/06-reference/config-files.md +1080 -0
- package/vendor/docs/06-reference/glossary.md +528 -0
- package/vendor/docs/06-reference/installer-flags.md +260 -0
- package/vendor/docs/06-reference/ports-and-services.md +244 -0
- package/vendor/docs/06-reference/troubleshooting.md +665 -0
- package/vendor/docs/_index.json +233 -0
- package/vendor/docs/gatekeeper-design.md +953 -0
- package/vendor/docs/package.json +15 -0
- package/vendor/docs/todo/lib-cli-desktop-refactor.md +641 -0
- package/vendor/gatekeeper/dist/boot.d.ts +1 -0
- package/vendor/gatekeeper/dist/boot.d.ts.map +1 -0
- package/vendor/gatekeeper/dist/boot.js +17 -0
- package/vendor/gatekeeper/dist/boot.js.map +1 -0
- package/vendor/gatekeeper/dist/cli/commands/access.d.ts +2 -0
- package/vendor/gatekeeper/dist/cli/commands/access.d.ts.map +1 -0
- package/vendor/gatekeeper/dist/cli/commands/access.js +33 -0
- package/vendor/gatekeeper/dist/cli/commands/access.js.map +1 -0
- package/vendor/gatekeeper/dist/cli/commands/grants.d.ts +2 -0
- package/vendor/gatekeeper/dist/cli/commands/grants.d.ts.map +1 -0
- package/vendor/gatekeeper/dist/cli/commands/grants.js +110 -0
- package/vendor/gatekeeper/dist/cli/commands/grants.js.map +1 -0
- package/vendor/gatekeeper/dist/cli/commands/groups.d.ts +2 -0
- package/vendor/gatekeeper/dist/cli/commands/groups.d.ts.map +1 -0
- package/vendor/gatekeeper/dist/cli/commands/groups.js +98 -0
- package/vendor/gatekeeper/dist/cli/commands/groups.js.map +1 -0
- package/vendor/gatekeeper/dist/cli/index.d.ts +3 -0
- package/vendor/gatekeeper/dist/cli/index.d.ts.map +1 -0
- package/vendor/gatekeeper/dist/cli/index.js +45 -0
- package/vendor/gatekeeper/dist/cli/index.js.map +1 -0
- package/vendor/gatekeeper/dist/index.d.ts +9 -0
- package/vendor/gatekeeper/dist/index.d.ts.map +1 -0
- package/vendor/gatekeeper/dist/index.js +13 -0
- package/vendor/gatekeeper/dist/index.js.map +1 -0
- package/vendor/gatekeeper/dist/lib/authz.d.ts +16 -0
- package/vendor/gatekeeper/dist/lib/authz.d.ts.map +1 -0
- package/vendor/gatekeeper/dist/lib/authz.js +42 -0
- package/vendor/gatekeeper/dist/lib/authz.js.map +1 -0
- package/vendor/gatekeeper/dist/lib/cache-bust.d.ts +15 -0
- package/vendor/gatekeeper/dist/lib/cache-bust.d.ts.map +1 -0
- package/vendor/gatekeeper/dist/lib/cache-bust.js +19 -0
- package/vendor/gatekeeper/dist/lib/cache-bust.js.map +1 -0
- package/vendor/gatekeeper/dist/lib/constants.d.ts +82 -0
- package/vendor/gatekeeper/dist/lib/constants.d.ts.map +1 -0
- package/vendor/gatekeeper/dist/lib/constants.js +79 -0
- package/vendor/gatekeeper/dist/lib/constants.js.map +1 -0
- package/vendor/gatekeeper/dist/lib/grants.d.ts +32 -0
- package/vendor/gatekeeper/dist/lib/grants.d.ts.map +1 -0
- package/vendor/gatekeeper/dist/lib/grants.js +314 -0
- package/vendor/gatekeeper/dist/lib/grants.js.map +1 -0
- package/vendor/gatekeeper/dist/lib/groups.d.ts +10 -0
- package/vendor/gatekeeper/dist/lib/groups.d.ts.map +1 -0
- package/vendor/gatekeeper/dist/lib/groups.js +247 -0
- package/vendor/gatekeeper/dist/lib/groups.js.map +1 -0
- package/vendor/gatekeeper/dist/lib/migration.d.ts +17 -0
- package/vendor/gatekeeper/dist/lib/migration.d.ts.map +1 -0
- package/vendor/gatekeeper/dist/lib/migration.js +79 -0
- package/vendor/gatekeeper/dist/lib/migration.js.map +1 -0
- package/vendor/gatekeeper/dist/lib/migrations/gatekeeper/0001_groups.sql +7 -0
- package/vendor/gatekeeper/dist/lib/migrations/gatekeeper/0002_access_grants.sql +14 -0
- package/vendor/gatekeeper/dist/lib/migrations/gatekeeper/0003_access_request_log.sql +9 -0
- package/vendor/gatekeeper/dist/lib/migrations/migrations/gatekeeper/0001_groups.sql +7 -0
- package/vendor/gatekeeper/dist/lib/migrations/migrations/gatekeeper/0002_access_grants.sql +14 -0
- package/vendor/gatekeeper/dist/lib/migrations/migrations/gatekeeper/0003_access_request_log.sql +9 -0
- package/vendor/gatekeeper/dist/lib/state-db.d.ts +16 -0
- package/vendor/gatekeeper/dist/lib/state-db.d.ts.map +1 -0
- package/vendor/gatekeeper/dist/lib/state-db.js +154 -0
- package/vendor/gatekeeper/dist/lib/state-db.js.map +1 -0
- package/vendor/gatekeeper/dist/lib/templates.d.ts +21 -0
- package/vendor/gatekeeper/dist/lib/templates.d.ts.map +1 -0
- package/vendor/gatekeeper/dist/lib/templates.js +151 -0
- package/vendor/gatekeeper/dist/lib/templates.js.map +1 -0
- package/vendor/gatekeeper/dist/lib/types.d.ts +178 -0
- package/vendor/gatekeeper/dist/lib/types.d.ts.map +1 -0
- package/vendor/gatekeeper/dist/lib/types.js +2 -0
- package/vendor/gatekeeper/dist/lib/types.js.map +1 -0
- package/vendor/gatekeeper/dist/server/index.d.ts +15 -0
- package/vendor/gatekeeper/dist/server/index.d.ts.map +1 -0
- package/vendor/gatekeeper/dist/server/index.js +251 -0
- package/vendor/gatekeeper/dist/server/index.js.map +1 -0
- package/vendor/gatekeeper/dist/server/routes/access-request.d.ts +7 -0
- package/vendor/gatekeeper/dist/server/routes/access-request.d.ts.map +1 -0
- package/vendor/gatekeeper/dist/server/routes/access-request.js +17 -0
- package/vendor/gatekeeper/dist/server/routes/access-request.js.map +1 -0
- package/vendor/gatekeeper/dist/server/routes/authz.d.ts +3 -0
- package/vendor/gatekeeper/dist/server/routes/authz.d.ts.map +1 -0
- package/vendor/gatekeeper/dist/server/routes/authz.js +279 -0
- package/vendor/gatekeeper/dist/server/routes/authz.js.map +1 -0
- package/vendor/gatekeeper/dist/server/routes/diagnostic.d.ts +13 -0
- package/vendor/gatekeeper/dist/server/routes/diagnostic.d.ts.map +1 -0
- package/vendor/gatekeeper/dist/server/routes/diagnostic.js +249 -0
- package/vendor/gatekeeper/dist/server/routes/diagnostic.js.map +1 -0
- package/vendor/gatekeeper/dist/server/routes/grants.d.ts +3 -0
- package/vendor/gatekeeper/dist/server/routes/grants.d.ts.map +1 -0
- package/vendor/gatekeeper/dist/server/routes/grants.js +112 -0
- package/vendor/gatekeeper/dist/server/routes/grants.js.map +1 -0
- package/vendor/gatekeeper/dist/server/routes/groups.d.ts +3 -0
- package/vendor/gatekeeper/dist/server/routes/groups.d.ts.map +1 -0
- package/vendor/gatekeeper/dist/server/routes/groups.js +139 -0
- package/vendor/gatekeeper/dist/server/routes/groups.js.map +1 -0
- package/vendor/gatekeeper/package.json +49 -0
- package/vendor/server/bin/lamaste-server.js +204 -0
- package/vendor/server/package.json +31 -0
- package/vendor/server/src/commands/certs.js +224 -0
- package/vendor/server/src/commands/chisel.js +132 -0
- package/vendor/server/src/commands/logs.js +49 -0
- package/vendor/server/src/commands/plugins.js +321 -0
- package/vendor/server/src/commands/reset-admin.js +478 -0
- package/vendor/server/src/commands/restart.js +94 -0
- package/vendor/server/src/commands/sites.js +257 -0
- package/vendor/server/src/commands/status.js +158 -0
- package/vendor/server/src/commands/tunnels.js +365 -0
- package/vendor/server/src/commands/uninstall.js +326 -0
- package/vendor/server/src/config.js +38 -0
- package/vendor/server/src/exec.js +26 -0
- package/vendor/server/src/logger.js +39 -0
- package/vendor/server/src/ndjson.js +56 -0
- package/vendor/server/src/panel-api.js +85 -0
- package/vendor/server/src/state.js +45 -0
- package/vendor/server-ui/dist/assets/index-B0nWuUyL.js +257 -0
- package/vendor/server-ui/dist/assets/index-BqWWFlTU.css +1 -0
- package/vendor/server-ui/dist/index.html +13 -0
- package/vendor/serverd/package.json +44 -0
- package/vendor/serverd/src/boot.js +13 -0
- package/vendor/serverd/src/index.js +191 -0
- package/vendor/serverd/src/lib/app-error.js +14 -0
- package/vendor/serverd/src/lib/authelia.js +85 -0
- package/vendor/serverd/src/lib/certbot.js +74 -0
- package/vendor/serverd/src/lib/chisel-args.js +6 -0
- package/vendor/serverd/src/lib/chisel-reconcile.js +232 -0
- package/vendor/serverd/src/lib/chisel-runtime.js +46 -0
- package/vendor/serverd/src/lib/chisel-users.js +109 -0
- package/vendor/serverd/src/lib/chisel.js +81 -0
- package/vendor/serverd/src/lib/config.js +190 -0
- package/vendor/serverd/src/lib/constants.js +8 -0
- package/vendor/serverd/src/lib/csr-signing.js +331 -0
- package/vendor/serverd/src/lib/enrollment.js +302 -0
- package/vendor/serverd/src/lib/files.js +19 -0
- package/vendor/serverd/src/lib/gatekeeper-client.js +135 -0
- package/vendor/serverd/src/lib/invite-page.js +281 -0
- package/vendor/serverd/src/lib/ip-utils.js +79 -0
- package/vendor/serverd/src/lib/migrations/state/0001_enrollment_tokens.sql +17 -0
- package/vendor/serverd/src/lib/migrations/state/0002_tickets.sql +70 -0
- package/vendor/serverd/src/lib/migrations/state/0003_plugins.sql +15 -0
- package/vendor/serverd/src/lib/migrations/state/0004_agents.sql +19 -0
- package/vendor/serverd/src/lib/mtls.js +795 -0
- package/vendor/serverd/src/lib/nginx.js +1090 -0
- package/vendor/serverd/src/lib/pki-paths.js +41 -0
- package/vendor/serverd/src/lib/pki-sign.js +103 -0
- package/vendor/serverd/src/lib/plugins.js +538 -0
- package/vendor/serverd/src/lib/push-install.js +390 -0
- package/vendor/serverd/src/lib/revocation.js +112 -0
- package/vendor/serverd/src/lib/services.js +131 -0
- package/vendor/serverd/src/lib/session.js +151 -0
- package/vendor/serverd/src/lib/state-db.js +130 -0
- package/vendor/serverd/src/lib/state.js +140 -0
- package/vendor/serverd/src/lib/storage.js +63 -0
- package/vendor/serverd/src/lib/system-stats.js +58 -0
- package/vendor/serverd/src/lib/tickets.js +1556 -0
- package/vendor/serverd/src/lib/totp.js +76 -0
- package/vendor/serverd/src/lib/tunnel-deps.js +41 -0
- package/vendor/serverd/src/lib/user-access-session.js +142 -0
- package/vendor/serverd/src/lib/user-access.js +52 -0
- package/vendor/serverd/src/middleware/errors.js +63 -0
- package/vendor/serverd/src/middleware/mtls.js +120 -0
- package/vendor/serverd/src/middleware/onboarding-guard.js +30 -0
- package/vendor/serverd/src/middleware/role-guard.js +58 -0
- package/vendor/serverd/src/middleware/twofa-session.js +65 -0
- package/vendor/serverd/src/middleware/user-access-session.js +52 -0
- package/vendor/serverd/src/routes/enrollment.js +120 -0
- package/vendor/serverd/src/routes/health.js +22 -0
- package/vendor/serverd/src/routes/invite.js +163 -0
- package/vendor/serverd/src/routes/management/agents.js +182 -0
- package/vendor/serverd/src/routes/management/certs.js +911 -0
- package/vendor/serverd/src/routes/management/gatekeeper-proxy.js +160 -0
- package/vendor/serverd/src/routes/management/identity.js +107 -0
- package/vendor/serverd/src/routes/management/invitations.js +166 -0
- package/vendor/serverd/src/routes/management/logs.js +218 -0
- package/vendor/serverd/src/routes/management/plugins.js +560 -0
- package/vendor/serverd/src/routes/management/services.js +63 -0
- package/vendor/serverd/src/routes/management/settings.js +325 -0
- package/vendor/serverd/src/routes/management/sites.js +522 -0
- package/vendor/serverd/src/routes/management/storage.js +192 -0
- package/vendor/serverd/src/routes/management/system.js +201 -0
- package/vendor/serverd/src/routes/management/tickets.js +457 -0
- package/vendor/serverd/src/routes/management/tunnels.js +709 -0
- package/vendor/serverd/src/routes/management/users.js +377 -0
- package/vendor/serverd/src/routes/management.js +36 -0
- package/vendor/serverd/src/routes/onboarding/dns.js +101 -0
- package/vendor/serverd/src/routes/onboarding/domain.js +42 -0
- package/vendor/serverd/src/routes/onboarding/index.js +18 -0
- package/vendor/serverd/src/routes/onboarding/provision.js +327 -0
- package/vendor/serverd/src/routes/onboarding/status.js +12 -0
- package/vendor/serverd/src/routes/plugin-router.js +79 -0
- package/vendor/serverd/src/routes/user-access.js +389 -0
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
# Certificate Management
|
|
2
|
+
|
|
3
|
+
> View, renew, and rotate the TLS and mTLS certificates that secure your Lamaste installation.
|
|
4
|
+
|
|
5
|
+
## In Plain English
|
|
6
|
+
|
|
7
|
+
Lamaste uses two types of certificates. The first type, Let's Encrypt certificates, encrypts the connection between visitors and your server — the padlock icon in your browser. These renew automatically. The second type, mTLS client certificates, is your digital ID card for accessing the admin panel. This guide covers how to monitor both types, force a renewal when needed, rotate the client certificate, and import a new one into your browser.
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
- A completed [Lamaste onboarding](onboarding.md)
|
|
12
|
+
- Access to the Lamaste admin panel
|
|
13
|
+
- For mTLS rotation: access to the browser where you import certificates
|
|
14
|
+
|
|
15
|
+
## Step-by-Step
|
|
16
|
+
|
|
17
|
+
### 1. Open the Certificates Page
|
|
18
|
+
|
|
19
|
+
Log in to the Lamaste admin panel at `https://panel.example.com` (or `https://<ip>:9292`).
|
|
20
|
+
|
|
21
|
+
Click **Certificates** in the sidebar navigation.
|
|
22
|
+
|
|
23
|
+
The page displays two sections: Let's Encrypt certificates and mTLS certificates. All certificates are sorted by expiry date (soonest first).
|
|
24
|
+
|
|
25
|
+
### 2. Understanding Certificate Types
|
|
26
|
+
|
|
27
|
+
**Let's Encrypt certificates** secure the HTTPS connection for your domains:
|
|
28
|
+
|
|
29
|
+
| Certificate | Domain | Purpose |
|
|
30
|
+
| ----------- | -------------------- | ------------------------------- |
|
|
31
|
+
| Panel | `panel.example.com` | Admin panel HTTPS |
|
|
32
|
+
| Auth | `auth.example.com` | Authelia login portal HTTPS |
|
|
33
|
+
| Tunnel | `tunnel.example.com` | Chisel WebSocket endpoint HTTPS |
|
|
34
|
+
| Per-tunnel | `app.example.com` | Individual tunnel HTTPS |
|
|
35
|
+
| Per-site | `blog.example.com` | Static site HTTPS |
|
|
36
|
+
|
|
37
|
+
These are issued during onboarding and when you create tunnels or static sites. They have a 90-day validity and renew automatically via the certbot timer.
|
|
38
|
+
|
|
39
|
+
**mTLS certificates** authenticate access to the panel:
|
|
40
|
+
|
|
41
|
+
| Certificate | Subject | Purpose |
|
|
42
|
+
| ------------------ | ------------------ | ------------------------------------------------------ |
|
|
43
|
+
| CA certificate | `CN=Lamaste CA` | Signs all client certificates (10-year validity) |
|
|
44
|
+
| Admin certificate | `CN=admin` | Full panel access via browser (2-year validity) |
|
|
45
|
+
| Agent certificates | `CN=agent:<label>` | Scoped access for Mac tunnel clients (2-year validity) |
|
|
46
|
+
| Self-signed TLS | `CN=<server-ip>` | IP-based panel HTTPS (10-year validity) |
|
|
47
|
+
|
|
48
|
+
The admin certificate is generated during installation. Agent certificates are created on demand through the panel. Neither type auto-renews — you rotate them manually when needed.
|
|
49
|
+
|
|
50
|
+
### 3. Check Certificate Status
|
|
51
|
+
|
|
52
|
+
Each certificate in the list shows:
|
|
53
|
+
|
|
54
|
+
- **Domain or subject** — Which domain the cert covers
|
|
55
|
+
- **Type** — `letsencrypt`, `mtls-ca`, or `mtls-client`
|
|
56
|
+
- **Expires** — The expiry date
|
|
57
|
+
- **Days remaining** — How many days until expiry
|
|
58
|
+
- **Status indicator** — Green (healthy), yellow (expiring within 30 days), red (expired)
|
|
59
|
+
|
|
60
|
+
The **auto-renewal status** section at the top shows whether the certbot timer is active:
|
|
61
|
+
|
|
62
|
+
- **Active** — The certbot timer is running and checks for renewals twice daily
|
|
63
|
+
- **Next run** — When the next renewal check is scheduled
|
|
64
|
+
- **Last run** — When the last renewal check occurred
|
|
65
|
+
|
|
66
|
+
### 4. Renew a Let's Encrypt Certificate
|
|
67
|
+
|
|
68
|
+
Let's Encrypt certificates renew automatically. You only need to force a renewal if:
|
|
69
|
+
|
|
70
|
+
- Auto-renewal failed (check the dashboard for certbot timer status)
|
|
71
|
+
- You want to renew immediately rather than waiting
|
|
72
|
+
- A certificate expired and needs reissuing
|
|
73
|
+
|
|
74
|
+
To force-renew a certificate:
|
|
75
|
+
|
|
76
|
+
1. Find the certificate in the list.
|
|
77
|
+
2. Click the **Renew** button next to it.
|
|
78
|
+
3. The panel runs `certbot renew --cert-name <domain> --force-renewal --no-random-sleep-on-renew` (through its root-owned `lamaste-certbot` wrapper). The renewal starts immediately — certbot's usual random delay before a non-interactive renewal is skipped.
|
|
79
|
+
4. After renewal, nginx is reloaded to use the new certificate.
|
|
80
|
+
|
|
81
|
+
**Expected duration:** 10-30 seconds. Certbot contacts Let's Encrypt to verify domain ownership and issue a new certificate.
|
|
82
|
+
|
|
83
|
+
**If renewal fails:**
|
|
84
|
+
|
|
85
|
+
- **DNS issue:** The domain must still resolve to your server. Verify with `dig <domain>`.
|
|
86
|
+
- **Rate limit:** Let's Encrypt has rate limits (50 certificates per registered domain per week). If you hit a limit, wait and try again later.
|
|
87
|
+
- **Port 80 blocked:** Certbot's nginx plugin validates with HTTP-01 challenges on port 80, for renewals as well as first issuance. Lamaste's UFW rules allow port 80; check that no provider-level firewall blocks it. The port-80 redirect site Lamaste installs does not interfere — certbot answers its challenges ahead of the redirect.
|
|
88
|
+
|
|
89
|
+
### 5. Rotate the mTLS Client Certificate
|
|
90
|
+
|
|
91
|
+
The client certificate has a 2-year validity. When it approaches expiry, or if you want to revoke access from a previously exported certificate, rotate it.
|
|
92
|
+
|
|
93
|
+
**Before rotating:** Understand that rotation generates a new client certificate. The old certificate stops working immediately after you rotate. Make sure you are prepared to import the new certificate into your browser right away.
|
|
94
|
+
|
|
95
|
+
The panel does not issue admin certificates: it runs unprivileged and signs only agent certificates, so a compromised panel cannot mint an admin credential. **Rotate Client Certificate** in the panel (`POST /api/certs/mtls/rotate`) answers `503` with this instruction. Rotate on the server console instead:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
sudo lamaste-server reset-admin
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**What happens during rotation:**
|
|
102
|
+
|
|
103
|
+
1. A new 4096-bit RSA key and a CSR for `/CN=admin/O=Lamaste` are generated, and the CA signs the new certificate (2-year validity). These `openssl` steps run as the `lamaste` user, which owns the PKI directory.
|
|
104
|
+
2. A new PKCS12 bundle is created with a new random password.
|
|
105
|
+
3. The current key, certificate and `.p12` are backed up (`.bak` suffix) and replaced.
|
|
106
|
+
4. The old admin certificate is revoked, panel 2FA is cleared and the IP vhost re-enabled if 2FA had disabled it, and `adminAuthMode` is set back to `p12`.
|
|
107
|
+
5. The panel is restarted, nginx is reloaded, and the new `.p12` password and an `scp` command are printed.
|
|
108
|
+
|
|
109
|
+
### 6. Download the New Certificate
|
|
110
|
+
|
|
111
|
+
After rotation, download the new `.p12` file:
|
|
112
|
+
|
|
113
|
+
1. Click the **Download** button on the Certificates page.
|
|
114
|
+
2. Save the `client.p12` file.
|
|
115
|
+
|
|
116
|
+
Alternatively, use SCP from the command line (requires SSH access):
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
scp root@203.0.113.42:/etc/lamalibre/lamaste/pki/client.p12 .
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
The new `.p12` password is printed by `lamaste-server reset-admin`. Save it.
|
|
123
|
+
|
|
124
|
+
### 7. Import the New Certificate into Your Browser
|
|
125
|
+
|
|
126
|
+
Remove the old certificate first, then import the new one.
|
|
127
|
+
|
|
128
|
+
**macOS:**
|
|
129
|
+
|
|
130
|
+
1. Open **Keychain Access** (Applications, Utilities, Keychain Access).
|
|
131
|
+
2. Select the **System** keychain.
|
|
132
|
+
3. Find the old "admin" certificate under "My Certificates".
|
|
133
|
+
4. Right-click and delete it.
|
|
134
|
+
5. Double-click the new `client.p12` file.
|
|
135
|
+
6. Select the **System** keychain.
|
|
136
|
+
7. Enter the new certificate password.
|
|
137
|
+
8. Find the new certificate, double-click it, expand Trust, set to **Always Trust**.
|
|
138
|
+
|
|
139
|
+
**Chrome on Linux:**
|
|
140
|
+
|
|
141
|
+
1. Navigate to `chrome://settings/certificates`.
|
|
142
|
+
2. Under "Your Certificates", find and delete the old Lamaste certificate.
|
|
143
|
+
3. Click **Import** and select the new `client.p12` file.
|
|
144
|
+
4. Enter the password.
|
|
145
|
+
|
|
146
|
+
**Windows:**
|
|
147
|
+
|
|
148
|
+
1. Open the Certificate Manager (`certmgr.msc`).
|
|
149
|
+
2. Navigate to Personal, Certificates.
|
|
150
|
+
3. Find and delete the old admin certificate.
|
|
151
|
+
4. Double-click the new `client.p12` file.
|
|
152
|
+
5. Follow the Certificate Import Wizard.
|
|
153
|
+
|
|
154
|
+
After importing, refresh the panel page. Your browser presents the new certificate automatically.
|
|
155
|
+
|
|
156
|
+
### 8. Verify the New Certificate
|
|
157
|
+
|
|
158
|
+
After importing:
|
|
159
|
+
|
|
160
|
+
1. Close and reopen your browser (recommended for macOS).
|
|
161
|
+
2. Navigate to `https://panel.example.com` or `https://<ip>:9292`.
|
|
162
|
+
3. Your browser prompts you to select a certificate — choose the new "admin" certificate.
|
|
163
|
+
4. The panel loads normally.
|
|
164
|
+
|
|
165
|
+
If the panel does not load, the most likely cause is that the old certificate is still being presented. Clear the SSL state in your browser:
|
|
166
|
+
|
|
167
|
+
- **Chrome:** Settings, Privacy and Security, Security, Manage Certificates
|
|
168
|
+
- **Firefox:** Preferences, Privacy & Security, View Certificates
|
|
169
|
+
- **Safari:** Restart Safari (it picks up Keychain changes automatically)
|
|
170
|
+
|
|
171
|
+
## Agent Certificates
|
|
172
|
+
|
|
173
|
+
Agent certificates provide scoped access for Mac tunnel clients. Instead of sharing the admin certificate (which grants full panel access), generate a dedicated agent certificate with only the capabilities the agent needs.
|
|
174
|
+
|
|
175
|
+
### Why Agent Certificates?
|
|
176
|
+
|
|
177
|
+
The admin certificate (`CN=admin`) has unrestricted access to all panel endpoints. Giving it to a Mac running the Chisel tunnel client is a security risk — if the Mac is compromised, the attacker has full admin access. Agent certificates solve this by limiting what each client can do.
|
|
178
|
+
|
|
179
|
+
### Generate an Agent Certificate
|
|
180
|
+
|
|
181
|
+
1. Go to the **Certificates** page in the panel.
|
|
182
|
+
2. Scroll to the **Agent Certificates** section.
|
|
183
|
+
3. Click **Generate**.
|
|
184
|
+
4. Enter a label (e.g., `macbook-pro`, `office-imac`). Labels must be lowercase letters, numbers, and hyphens only.
|
|
185
|
+
5. Select capabilities:
|
|
186
|
+
- **tunnels:read** — always enabled, cannot be removed. Allows listing the agent's own tunnels and fetching its Chisel configuration.
|
|
187
|
+
- **tunnels:write** — create, update and delete tunnels the agent carries (restricted access mode only; moving a tunnel between agents stays admin-only).
|
|
188
|
+
- **services:read** — view service status.
|
|
189
|
+
- **services:write** — start, stop, and restart services.
|
|
190
|
+
- **system:read** — view system stats (CPU, RAM, disk).
|
|
191
|
+
- **sites:read** — list sites and browse files.
|
|
192
|
+
- **sites:write** — upload and delete files on assigned sites.
|
|
193
|
+
6. Click **Generate**.
|
|
194
|
+
7. **Save the P12 password immediately** — it is only shown once and cannot be retrieved later.
|
|
195
|
+
8. Click **Download** to save the `.p12` file.
|
|
196
|
+
|
|
197
|
+
### Distribute to the Agent Machine
|
|
198
|
+
|
|
199
|
+
Send the `.p12` file and password to the agent machine (macOS or Linux) securely, and install the agent there with `npm install -g @lamalibre/lamaste-agent@4.0.0` and run `lamaste-agent setup --label <label>` — or import it into the Desktop App. An enrollment token is preferable where possible, because the private key is then generated on the agent and never travels. See [Agent Setup](agent-setup.md) for details.
|
|
200
|
+
|
|
201
|
+
### Update Capabilities
|
|
202
|
+
|
|
203
|
+
Capabilities are stored server-side, not in the certificate. You can change what an agent is allowed to do without reissuing the certificate:
|
|
204
|
+
|
|
205
|
+
1. Find the agent in the **Agent Certificates** table.
|
|
206
|
+
2. Click the **Edit** (pencil) icon.
|
|
207
|
+
3. Check or uncheck capabilities.
|
|
208
|
+
4. Click **Save**.
|
|
209
|
+
|
|
210
|
+
The change takes effect on the agent's next API request.
|
|
211
|
+
|
|
212
|
+
### Revoke an Agent Certificate
|
|
213
|
+
|
|
214
|
+
If a Mac is lost, stolen, or no longer needs access:
|
|
215
|
+
|
|
216
|
+
1. Find the agent in the **Agent Certificates** table.
|
|
217
|
+
2. Click the **Revoke** (trash) icon.
|
|
218
|
+
3. Confirm the revocation.
|
|
219
|
+
|
|
220
|
+
Revocation is immediate — the certificate serial is added to a revocation list checked on every request. The agent's P12 files are deleted from the server.
|
|
221
|
+
|
|
222
|
+
## For Developers
|
|
223
|
+
|
|
224
|
+
### Certificate File Locations
|
|
225
|
+
|
|
226
|
+
| File | Path | Permission |
|
|
227
|
+
| ------------------- | ------------------------------------------------------ | --------------- |
|
|
228
|
+
| CA key | `/etc/lamalibre/lamaste/pki/ca.key` | 600 |
|
|
229
|
+
| CA certificate | `/etc/lamalibre/lamaste/pki/ca.crt` | 644 |
|
|
230
|
+
| Client key | `/etc/lamalibre/lamaste/pki/client.key` | 600 |
|
|
231
|
+
| Client certificate | `/etc/lamalibre/lamaste/pki/client.crt` | 644 |
|
|
232
|
+
| PKCS12 bundle | `/etc/lamalibre/lamaste/pki/client.p12` | 600 |
|
|
233
|
+
| P12 password | `/etc/lamalibre/lamaste/pki/.p12-password` | 600 |
|
|
234
|
+
| Self-signed key | `/etc/lamalibre/lamaste/pki/self-signed-key.pem` | 600 |
|
|
235
|
+
| Self-signed cert | `/etc/lamalibre/lamaste/pki/self-signed.pem` | 644 |
|
|
236
|
+
| Let's Encrypt certs | `/etc/letsencrypt/live/<domain>/` | certbot-managed |
|
|
237
|
+
| Revocation list | `/etc/lamalibre/lamaste/pki/revoked.json` | 600 |
|
|
238
|
+
| Agent registry | `/etc/lamalibre/lamaste/pki/agents/registry.json` | 600 |
|
|
239
|
+
| Agent certs | `/etc/lamalibre/lamaste/pki/agents/<label>/client.p12` | 600 |
|
|
240
|
+
|
|
241
|
+
### API Endpoints
|
|
242
|
+
|
|
243
|
+
| Method | Path | Purpose |
|
|
244
|
+
| -------- | -------------------------------------------- | ---------------------------------- |
|
|
245
|
+
| `GET` | `/api/certs` | List all certificates (LE + mTLS) |
|
|
246
|
+
| `GET` | `/api/certs/auto-renew-status` | Certbot timer status |
|
|
247
|
+
| `POST` | `/api/certs/:domain/renew` | Force-renew a Let's Encrypt cert |
|
|
248
|
+
| `POST` | `/api/certs/mtls/rotate` | Rotate the mTLS client certificate |
|
|
249
|
+
| `GET` | `/api/certs/mtls/download` | Download client.p12 |
|
|
250
|
+
| `POST` | `/api/certs/agent` | Generate agent certificate |
|
|
251
|
+
| `GET` | `/api/certs/agent` | List agent certificates |
|
|
252
|
+
| `GET` | `/api/certs/agent/:label/download` | Download agent .p12 |
|
|
253
|
+
| `PATCH` | `/api/certs/agent/:label/capabilities` | Update agent capabilities |
|
|
254
|
+
| `PATCH` | `/api/certs/agent/:label/allowed-sites` | Update agent site access |
|
|
255
|
+
| `DELETE` | `/api/certs/agent/:label` | Revoke agent certificate |
|
|
256
|
+
| `POST` | `/api/certs/agent/enroll` | Generate enrollment token (admin) |
|
|
257
|
+
| `POST` | `/api/enroll` | Enroll agent with token (public) |
|
|
258
|
+
| `POST` | `/api/certs/admin/upgrade-to-hardware-bound` | Upgrade admin auth (admin) |
|
|
259
|
+
| `GET` | `/api/certs/admin/auth-mode` | Get admin auth mode (admin) |
|
|
260
|
+
|
|
261
|
+
### Certificate Response Format
|
|
262
|
+
|
|
263
|
+
```json
|
|
264
|
+
{
|
|
265
|
+
"certs": [
|
|
266
|
+
{
|
|
267
|
+
"type": "letsencrypt",
|
|
268
|
+
"domain": "panel.example.com",
|
|
269
|
+
"expiresAt": "2024-04-15T00:00:00.000Z",
|
|
270
|
+
"daysUntilExpiry": 75,
|
|
271
|
+
"path": "/etc/letsencrypt/live/panel.example.com/fullchain.pem",
|
|
272
|
+
"expiringSoon": false
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"type": "mtls-ca",
|
|
276
|
+
"domain": null,
|
|
277
|
+
"expiresAt": "2034-01-15T00:00:00.000Z",
|
|
278
|
+
"daysUntilExpiry": 3650,
|
|
279
|
+
"path": "/etc/lamalibre/lamaste/pki/ca.crt",
|
|
280
|
+
"expiringSoon": false
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"type": "mtls-client",
|
|
284
|
+
"domain": null,
|
|
285
|
+
"expiresAt": "2028-01-15T00:00:00.000Z",
|
|
286
|
+
"daysUntilExpiry": 730,
|
|
287
|
+
"path": "/etc/lamalibre/lamaste/pki/client.crt",
|
|
288
|
+
"expiringSoon": false
|
|
289
|
+
}
|
|
290
|
+
]
|
|
291
|
+
}
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### mTLS Rotation Internals
|
|
295
|
+
|
|
296
|
+
Admin certificate rotation lives only in `lamaste-server reset-admin` (`packages/server/cli/src/commands/reset-admin.js`), run as root on the server. The panel's `rotateClientCert()` in `lib/mtls.js` is a stub that returns `503` with that instruction; `@lamalibre/lamaste@4.0.0/server` no longer exports a rotation function. The PKI directory belongs to `lamaste`, so `reset-admin` runs every file operation inside it (`openssl genrsa`/`req`/`x509 -req`/`pkcs12`, `cp`, `chmod`) as `lamaste`, and writes `panel.json` and `revoked.json` as fresh files renamed into place — root never writes through a path the panel could have replaced with a symlink.
|
|
297
|
+
|
|
298
|
+
The PKCS12 bundle uses legacy encryption settings (`-keypbe PBE-SHA1-3DES -certpbe PBE-SHA1-3DES -macalg sha1`) because newer OpenSSL defaults produce files that macOS Keychain Access cannot import.
|
|
299
|
+
|
|
300
|
+
### Auto-Renewal Architecture
|
|
301
|
+
|
|
302
|
+
Certbot auto-renewal uses a systemd timer (`certbot.timer` or `certbot-renew.timer`, depending on the distribution). The timer runs twice daily and checks all managed certificates. Certificates within 30 days of expiry are renewed. After renewal, the certbot deploy hook reloads nginx to use the new certificate.
|
|
303
|
+
|
|
304
|
+
### nginx mTLS Snippet
|
|
305
|
+
|
|
306
|
+
The mTLS configuration is in `/etc/nginx/snippets/lamalibre-lamaste-mtls.conf`:
|
|
307
|
+
|
|
308
|
+
```nginx
|
|
309
|
+
ssl_client_certificate /etc/lamalibre/lamaste/pki/ca.crt;
|
|
310
|
+
ssl_verify_client on;
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
This tells nginx to require a client certificate signed by the Lamaste CA. No certificate means the TLS handshake is rejected before HTTP — the browser never reaches the panel server.
|
|
314
|
+
|
|
315
|
+
## Quick Reference
|
|
316
|
+
|
|
317
|
+
| Certificate Type | Validity | Renewal |
|
|
318
|
+
| ----------------- | -------- | ----------------------------------------- |
|
|
319
|
+
| Let's Encrypt | 90 days | Automatic (certbot timer) |
|
|
320
|
+
| mTLS CA | 10 years | Manual (rarely needed) |
|
|
321
|
+
| Admin client cert | 2 years | Manual: `sudo lamaste-server reset-admin` |
|
|
322
|
+
| Agent certs | 2 years | Generate new, revoke old |
|
|
323
|
+
| Self-signed TLS | 10 years | Manual (rarely needed) |
|
|
324
|
+
|
|
325
|
+
| Action | How |
|
|
326
|
+
| ----------------------- | -------------------------------------------------- |
|
|
327
|
+
| **View all certs** | Certificates page in panel |
|
|
328
|
+
| **Force renew LE cert** | Click "Renew" next to the certificate |
|
|
329
|
+
| **Rotate mTLS cert** | `sudo lamaste-server reset-admin` on the server |
|
|
330
|
+
| **Download new .p12** | Click "Download" after rotation |
|
|
331
|
+
| **Check auto-renewal** | View "Auto-Renewal Status" section |
|
|
332
|
+
| **Generate agent cert** | Agent Certificates section, click "Generate" |
|
|
333
|
+
| **Update agent caps** | Click edit icon next to agent, toggle capabilities |
|
|
334
|
+
| **Revoke agent cert** | Click revoke icon next to agent, confirm |
|
|
335
|
+
|
|
336
|
+
| Warning Sign | Action |
|
|
337
|
+
| ------------------------ | --------------------------------------- |
|
|
338
|
+
| Yellow badge (< 30 days) | Monitor — auto-renewal should handle it |
|
|
339
|
+
| Red badge (expired) | Force-renew immediately |
|
|
340
|
+
| Auto-renewal inactive | Check certbot timer with Services page |
|
|
341
|
+
| mTLS < 90 days | Plan rotation, download new cert |
|