Repository navigation
Expand file tree
/
Copy pathconfig.yml.example
More file actions
431 lines (383 loc) · 14.5 KB
/
Copy pathconfig.yml.example
File metadata and controls
431 lines (383 loc) · 14.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
metadata:
name: "my-rbac-config"
version: "1.0.0"
description: "RBAC configuration for my application"
# HOW TO USE THIS FILE
#
# Roles, permissions and resources below are the real vocabulary the deployed
# tenants run on: `sync sync` reconciles a Logto tenant against exactly this,
# and backend/authz/routes.yml states each endpoint's intent in the same terms.
# Keep them in step — a permission that exists only here, or only there, is a
# permission nobody enforces.
#
# What is NOT real here is everything from `third_party_apps` down: tenant ids,
# application URLs, SMTP credentials and branding are per-environment, and the
# files that hold them (config.yml, config.qa.yml, config.production.yml) are
# gitignored. Copy this file, fill those sections in, and keep the vocabulary
# identical across environments. The branding assets those sections point at do
# live in git: `configs/sign-in/` for the tenant, `configs/apps/` for the
# per-application icons.
# Business hierarchy: owner -> distributor -> reseller -> customer.
# Each role sees only what sits below it in the commercial chain.
organization_roles:
- id: owner
name: "Owner"
priority: 1
type: org
permissions:
# Complete control over the commercial hierarchy, shared by every member
# of the Owner organization (Owner and Staff users). The destroy:* of the
# TECHNICAL resources (systems, users) are NOT here: they live on the
# "Owner" user role only, so Staff never inherits them.
- id: read:distributors
- id: manage:distributors
- id: destroy:distributors
- id: read:resellers
- id: manage:resellers
- id: destroy:resellers
- id: read:customers
- id: manage:customers
- id: destroy:customers
- id: distributor
name: "Distributor"
priority: 2
type: org
permissions:
# Can manage downstream in hierarchy resellers and customers
- id: read:resellers
- id: manage:resellers
- id: read:customers
- id: manage:customers
- id: reseller
name: "Reseller"
priority: 3
type: org
permissions:
# Can only manage customers
- id: read:customers
- id: manage:customers
- id: customer
name: "Customer"
priority: 4
type: org
permissions:
# Read-only access to own organization data
# User roles define TECHNICAL CAPABILITIES
# Independent of business hierarchy - define what technical operations a user can perform
user_roles:
- id: admin
name: "Admin"
priority: 1
type: user
permissions:
# Full technical control including dangerous operations
- id: read:systems # Simple read operation
- id: manage:systems # Standard system management
- id: read:users # Simple read operation
- id: manage:users # Standard account management
- id: read:applications # Simple read operation
- id: manage:applications # Standard applications management
- id: read:alerts # View alerting configuration (own + inherited)
- id: manage:alerts # Manage alerting configuration policy (recipients, language, severity/system overrides)
- id: read:entitlements # See add-on licenses and expirations
- id: manage:entitlements # Buy/cancel add-on subscriptions on the shop
- id: read:rebranding # See the branding of own organization
- id: manage:rebranding # Configure logos, favicon and brand name
- id: support
name: "Support"
priority: 2
type: user
permissions:
# Standard technical operations (no dangerous operations)
- id: read:systems # Simple read operation
- id: manage:systems # Standard system management
- id: read:applications # Simple read operation
- id: manage:applications # Standard applications management
- id: read:alerts # View alerting configuration (own + inherited)
- id: manage:alerts # Manage alerting configuration policy (recipients, language, severity/system overrides)
- id: read:entitlements # See add-on licenses and expirations
- id: read:rebranding # See the branding of own organization
- id: backoffice
name: "Backoffice"
priority: 2
type: user
permissions:
# Standard technical operations (no dangerous operations)
- id: read:users # Simple read operation
- id: manage:users # Standard user management
- id: read:systems # Simple read systems
- id: read:applications # Simple read operation
- id: manage:applications # Standard applications management
- id: read:entitlements # See add-on licenses and expirations
- id: manage:entitlements # Grant/revoke add-on licenses (backoffice duty)
- id: read:rebranding # See the branding of own organization
- id: reader
name: "Reader"
priority: 2
type: user
permissions:
# Only readable resources
- id: read:systems
- id: read:users
- id: read:applications
- id: read:entitlements
- id: read:rebranding
- id: staff
name: "Staff"
priority: 0
type: user
permissions:
# Everything non-destructive: the technical role of the Nethesis
# cross-cutting employees. Assignable only to users of the Owner
# organization; every destroy:* stays on the "Owner" user role.
- id: read:systems
- id: manage:systems
- id: read:users
- id: manage:users
- id: impersonate:users
- id: connect:systems
- id: read:applications
- id: manage:applications
- id: read:alerts
- id: manage:alerts
- id: config:alerts
- id: read:entitlements
- id: manage:entitlements
- id: read:rebranding
- id: manage:rebranding
# Access control: only Owner users can assign this role
access_control:
organization_roles:
- "owner"
- id: owner
name: "Owner"
priority: 0
type: user
permissions:
# Complete control: everything Staff has, plus the destroy:* of the
# technical resources (systems, users). The hierarchy destroys come from
# the Owner ORGANIZATION role. This is the technical role of the
# break-glass owner user, seeded by `sync init`: it is never offered by
# the API and never assignable — the access_control below is defense in
# depth, the backend refuses the assignment outright.
- id: read:systems
- id: manage:systems
- id: destroy:systems
- id: read:users
- id: manage:users
- id: destroy:users
- id: impersonate:users
- id: connect:systems
- id: read:applications
- id: manage:applications
- id: read:alerts
- id: manage:alerts
- id: config:alerts
- id: read:entitlements
- id: manage:entitlements
- id: read:rebranding
- id: manage:rebranding
# Access control: only Owner users can assign this role
access_control:
organization_roles:
- "owner"
# Resources and their available actions.
#
# Scope names are always "{action}:{name}", which is what roles and the backend
# match on. "container" says which Logto API resource hosts those scopes: Logto
# bills per API resource and includes 3 in the Pro plan, so everything shares a
# single container. Omitting it creates one Logto resource per entry.
resources:
- name: "distributors"
actions: ["read", "manage", "destroy"]
container: "permissions"
- name: "resellers"
actions: ["read", "manage", "destroy"]
container: "permissions"
- name: "customers"
actions: ["read", "manage", "destroy"]
container: "permissions"
- name: "systems"
actions: ["read", "manage", "destroy", "connect"]
container: "permissions"
- name: "entitlements"
actions: ["read", "manage"]
container: "permissions"
- name: "users"
actions: ["read", "manage", "destroy", "impersonate"]
container: "permissions"
- name: "applications"
actions: ["read", "manage"]
container: "permissions"
- name: "alerts"
actions: ["read", "manage", "config"]
container: "permissions"
- name: "rebranding"
actions: ["read", "manage"]
container: "permissions"
- name: "role-access-control"
actions: ["owner", "distributor", "reseller"]
container: "permissions"
# Third-party applications
#
# access_control below is the role filter each application declares. On top of
# it, the Owner organization decides per distributor which portals its
# resellers and customers may use (distributors.third_party_apps, set from the
# distributor drawer): a reseller or customer user sees an application only
# when both admit it, while distributors are bound by the role filter only. That
# per-distributor list lives in the backend database, not here, and only
# applications admitting a partner organization role (distributor, reseller,
# customer) without an organization_ids pin can be granted.
third_party_apps:
# Example: Management app - only accessible by specific organizations and roles
- name: "management.company.com"
description: "Management interface for system administrators"
display_name: "Management Console"
# Icons Logto shows on the consent page, uploaded on every sync. Paths
# are relative to this file's directory, like the sign-in assets, and the
# files are tracked in git (see configs/apps/README.md). Omit the block to
# leave the icons already uploaded untouched; use "branding: {}" to clear
# them.
branding:
logo_path: "apps/management.svg"
logo_dark_path: "apps/management-dark.svg"
info_url: "https://management.company.com/info"
redirect_uris:
- "https://management.company.com/callback"
- "https://management.company.com/auth/callback"
post_logout_redirect_uris:
- "https://management.company.com"
- "https://management.company.com/logout"
access_control:
organization_ids: # Only specific organization IDs can access (optional)
- "org-headquarters"
- "org-main-branch"
organization_roles: # Only specific organization roles can access
- "owner"
user_roles: # Only specific user roles can access
- "support"
# idp_enforced: the backend mirrors the ORGANIZATION dimension above
# (organization_ids, or organization_roles combined with each
# distributor's portal list) into Logto app-level access control, so a
# user outside those organizations is refused at sign-in, not just
# hidden the tile. true = enforce; false = make sure Logto enforces
# nothing; omitted = Logto is left alone. User roles stay a portal
# filter: Logto combines its rules with OR and cannot express
# "organization AND role".
idp_enforced: true
# Example: Support portal - accessible by multiple roles
- name: "support.company.com"
description: "Support portal for customer assistance"
display_name: "Support Portal"
branding:
# One icon is enough: Logto uses it for both themes
logo_path: "apps/support.svg"
info_url: "https://support.company.com/info"
redirect_uris:
- "https://support.company.com/callback"
post_logout_redirect_uris:
- "https://support.company.com"
access_control:
idp_enforced: true
organization_roles: # Multiple organization roles can access
- "owner"
- "distributor"
user_roles: # Multiple user roles can access
- "support"
# Example: Customer portal - accessible by all organization roles
- name: "portal.company.com"
description: "Customer portal for all users"
display_name: "Customer Portal"
info_url: "https://portal.company.com/info"
redirect_uris:
- "https://portal.company.com/callback"
post_logout_redirect_uris:
- "https://portal.company.com"
access_control:
idp_enforced: true
organization_roles: # All organization roles can access
- "reseller"
user_roles: # All user roles can access
- "support"
# Example with custom scopes and access control
- name: "api.example.com"
description: "API service application"
display_name: "API Service"
info_url: "https://api.example.com/info"
redirect_uris:
- "https://api.example.com/auth/callback"
access_control:
idp_enforced: true
organization_roles:
- "distributor"
user_roles:
- "support"
scopes:
- "profile"
- "email"
- "api:read"
- "api:write"
# Sign-in experience configuration (optional)
sign_in_experience:
# Brand colors (hex format)
colors:
primary_color: "#0069A8"
primary_color_dark: "#0087DB"
dark_mode_enabled: true
# Branding assets (relative paths from config file directory)
branding:
logo_path: "sign-in/logo.png"
logo_dark_path: "sign-in/logo-dark.png"
favicon_path: "sign-in/favicon.ico"
favicon_dark_path: "sign-in/favicon-dark.ico"
# Custom CSS (relative path from config file directory)
custom_css_path: "sign-in/default.css"
# Language configuration
language:
auto_detect: true
fallback_language: "en"
# Sign-in methods configuration
sign_in:
methods:
- identifier: "email"
password: true
verification_code: false
is_password_primary: true
# Sign-up configuration (disabled by default)
sign_up:
identifiers: []
password: false
verify: false
secondary_identifiers: []
# Social sign-in configuration (empty by default)
social_sign_in: {}
# Multi-factor authentication (omit to leave the Logto console untouched)
mfa:
policy: "Mandatory"
factors: ["Totp", "WebAuthn", "BackupCode"]
trusted_device:
enabled: true
duration_days: 30
# Connectors configuration (optional)
connectors:
# SMTP email connector for password reset and verification emails
smtp:
# SMTP server configuration
host: "smtp.your-provider.com"
port: 587
username: "your-smtp-username"
password: "your-smtp-password"
from_email: "no-reply@your-company.com"
from_name: "Your Company Name"
tls: true
secure: false
debug: false
logger: true
disable_file_access: true
disable_url_access: true
# Template variable settings
template_settings:
company_name: "Your Company Name"
support_email: "support@your-company.com"
# Custom headers (optional)
custom_headers: {}