Review fixes before v0.4.0: NetBox on its own origin, pinned root refresh
From a review of everything since v0.3.0: - NetBox's UI was served on Rollcall's origin, so a script in a NetBox page (stored XSS, a custom link) could read the Rollcall UI's stored admin token and call Rollcall's API with the admin certificate. It now has a listener of its own (ipam.ui_listen, default :8444): another origin. The Rollcall UI builds its NetBox links from that port. - The proxy dropped X-Rollcall-User but not X-Rollcall_User, which a WSGI server reads as the same HTTP_X_ROLLCALL_USER; every spelling is dropped now. - Deployed machines fetched the root bundle over TLS checked against the system's trust store: a public CA's certificate for the rack's name would have done. The refresh is pinned to the Rollcall roots installed on the machine and takes only CA certificates (tried on node001 and node002). - A NetBox device type NetBox will not resize (0U while its devices have positions) no longer stops those machines' device sync; it is logged. - A NetBox cable on a device whose machine is gone here rolled back all cable and switch sync; such cables are skipped. - Switch names are looked up in NetBox 50 at a time (a large site would outgrow one URL). - rack_units: "vendor model" wins over the bare model when both are set (map order chose before); cable precedence comments match the code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6a7b158644
commit
0569ecf1cc
13 files changed
+138
-50
No files matched your search
@@ -882,14 +882,18 @@ The NetBox user needs `view/add/change/delete` on `dcim.device`,
|
||||
|
||||
When NetBox runs under a path (its `BASE_PATH`, e.g. `BASE_PATH = 'netbox/'`)
|
||||
and `ipam.url` carries it (`"url": "https://netbox.example/netbox/"`), Rollcall
|
||||
serves NetBox's web UI at that same path, `https://<rollcall>/netbox/`, for
|
||||
serves NetBox's web UI at that same path on a listener of its own,
|
||||
`https://<rollcall>:8444/netbox/` (`ipam.ui_listen`, default `:8444`), for
|
||||
admins only (the admin certificate, as for the API). NetBox keeps its own login.
|
||||
This opens NetBox wherever Rollcall opens, also when the browser cannot reach
|
||||
NetBox itself. Two settings on the NetBox side:
|
||||
NetBox itself. The separate port is on purpose: another origin than Rollcall's
|
||||
UI, so a script in a NetBox page (a custom link, an export template) can
|
||||
neither read the Rollcall UI's stored admin token nor call Rollcall's API as
|
||||
the admin. Two settings on the NetBox side:
|
||||
|
||||
```python
|
||||
BASE_PATH = 'netbox/'
|
||||
CSRF_TRUSTED_ORIGINS = ['https://rollcall.example'] # where browsers post from
|
||||
CSRF_TRUSTED_ORIGINS = ['https://rollcall.example:8444'] # where browsers post from
|
||||
```
|
||||
|
||||
**Signing in with the admin certificate.** With `"ui_login_secret_file"` in the
|
||||
@@ -918,7 +922,8 @@ request_header @notrollcall -X-Rollcall-User
|
||||
request_header -X-Rollcall-Proxy-Secret
|
||||
```
|
||||
|
||||
Rollcall drops both headers when a browser sends them. An admin with a token
|
||||
Rollcall drops both headers when a browser sends them, in any spelling a WSGI
|
||||
server would read as the same (`X-Rollcall_User`). An admin with a token
|
||||
instead of a certificate signs in to NetBox by hand. `lab/netbox/install.sh`
|
||||
sets all of this up for the lab NetBox.
|
||||
|
||||
|
||||
Reference in new issue
Block a user