1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-08 19:26:48 +00:00
webvirtcloud/instances
catborise 4d34d9d07c fix: add an authorization matrix test and close the endpoints it finds
Add webvirtcloud/test_authorization_matrix.py, which walks every named URL
and checks that a user without any VM/compute relation only reaches an
explicit allowlist, and that the global view_instances permission does not
open consoles. It found:

- /computes/<id>/... views without any check (compute_graph,
  get_compute_*, get_dom_capabilities, storages.get_volumes): the whole
  computes URL namespace is now wrapped with superuser_only, so a view
  added there later cannot be exposed by a missing decorator.
- guess_mac_address (leaks dhcpd.conf host/MAC pairs), random_mac_address
  and guess_clone_name: superuser-only, like the buttons that use them.
- check_instance: cross-tenant VM name lookup with no caller; removed.
- getvvfile and get_vdi_url: reachable with only view_instances, and the
  .vv file contains the VNC password.

Console access now follows one rule, instances.utils.can_open_console:
an active superuser or an active owner of the VM. The global
view_instances permission is read-only. It is used by the console page,
novncd, getvvfile and get_vdi_url (getvvfile and the VDI tab are kept for
virt-viewer users). The console page answers 403 instead of 500 when
access is denied, with the same answer for a missing VM.
2026-10-02 20:33:12 +03:00
..
api fix(reconciliation): serialize compute sync and enforce UUID identity 2026-09-28 14:55:49 +03:00
fixtures Instances overhaul 2020-07-13 15:33:09 +06:00
migrations fix(reconciliation): serialize compute sync and enforce UUID identity 2026-09-28 14:55:49 +03:00
templates fix(instances): guard mutations and refresh lists after sync 2026-09-28 14:56:19 +03:00
templatetags lint with black python. convert f style strings to old one. some small fixes 2020-11-05 12:34:31 +03:00
__init__.py Fixe migrations for new deployments 2020-05-28 18:19:25 +06:00
apps.py format python code with black 2022-11-02 08:54:35 +03:00
forms.py Corrected untranslated items 2023-12-13 14:00:02 +08:00
models.py fix(reconciliation): serialize compute sync and enforce UUID identity 2026-09-28 14:55:49 +03:00
test_console_rule.py fix: add an authorization matrix test and close the endpoints it finds 2026-10-02 20:33:12 +03:00
test_create_instance.py fix(instances): guard mutations and refresh lists after sync 2026-09-28 14:56:19 +03:00
test_index.py fix(instances): guard mutations and refresh lists after sync 2026-09-28 14:56:19 +03:00
test_root_pass.py fix(instances): guard mutations and refresh lists after sync 2026-09-28 14:56:19 +03:00
test_security_mutations.py fix(instances): guard mutations and refresh lists after sync 2026-09-28 14:56:19 +03:00
tests.py fix: add an authorization matrix test and close the endpoints it finds 2026-10-02 20:33:12 +03:00
urls.py fix: add an authorization matrix test and close the endpoints it finds 2026-10-02 20:33:12 +03:00
utils.py fix: add an authorization matrix test and close the endpoints it finds 2026-10-02 20:33:12 +03:00
views.py fix: add an authorization matrix test and close the endpoints it finds 2026-10-02 20:33:12 +03:00