vishesh92 commented on code in PR #13293:
URL: https://github.com/apache/cloudstack/pull/13293#discussion_r3340418571


##########
draft-THREAT-MODEL.md:
##########
@@ -0,0 +1,1061 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+# Apache CloudStack Security Threat Model (draft)
+
+> **Document scope and PMC structural decision.** The CloudStack PMC owns
+> five repositories: `apache/cloudstack` (the management server, agent, and
+> systemvm), plus four satellite clients — `apache/cloudstack-cloudmonkey`
+> (CLI), `apache/cloudstack-go` (Go SDK), 
`apache/cloudstack-terraform-provider`,
+> `apache/cloudstack-kubernetes-provider`. This document models
+> `apache/cloudstack` as the canonical threat model; the four satellite
+> models are short *deltas* that inherit §3 / §4 / §7 from this
+> document and add only what each satellite uniquely introduces (`§4 B1`
+> reachability, the credential file shape, the wrapper-of-SDK contract,
+> etc.). The deltas live at 
`/tmp/claude/cloudstack-<repo>-threat-model-draft.md`.
+> An umbrella model was rejected because the satellites are uniformly thin
+> "HMAC-SHA1-signing HTTP client" wrappers — a single document either
+> drowns them in CloudStack-server content or, worse, drowns the
+> CloudStack-server content in satellite caveats. Each satellite is small
+> enough that a 1–2 page delta works.
+
+## §1 Header
+
+- **Project:** Apache CloudStack (`apache/cloudstack`) — IaaS orchestration
+  platform. This document does **not** cover the four satellite repos, which
+  carry their own delta models.
+- **Commit:** `7308dad1` (HEAD of `main` at draft time).
+- **Date:** 2026-05-29.
+- **Authors:** ASF Security team draft, awaiting CloudStack PMC review.
+- **Status:** Draft — under maintainer review.
+- **Version binding:** This document describes the model as of the commit
+  above. A vulnerability report against CloudStack release *N* (currently
+  the 4.20.x line) should be triaged against the model as it stood at *N*'s
+  release tag, not against HEAD.
+- **Reporting:** vulnerabilities that fall under §8 (claimed properties)
+  should be reported per the project's published policy
+  (`[email protected]` per `README.md` and
+  `https://cloudstack.apache.org/security.html`); reports that fall under
+  §3 (out of scope), §9 (properties not provided), or §11a (known
+  non-findings) will be closed by CloudStack triagers citing this document.
+- **Provenance legend** —
+  *(documented)* = paraphrased from an in-repo source or the project website
+  with citation; *(maintainer)* = stated by a CloudStack PMC member in
+  response to this draft; *(inferred)* = synthesized by the producer from
+  code structure or domain knowledge, awaiting PMC ratification (every
+  *(inferred)* tag has a matching §14 question).
+- **Draft confidence:** 36 documented / 0 maintainer / 41 inferred.
+
+**About the project.** Apache CloudStack is an open-source Infrastructure-as-a-
+Service (IaaS) orchestration platform *(documented: `README.md`,
+`https://cloudstack.apache.org/`)*. It deploys and manages large fleets of
+virtual machines across multiple hypervisors (KVM, VMware, XenServer/XCP-ng,
+Hyper-V, baremetal-bridge, OVM) and over object/block/file storage
+(NFS, Ceph/RBD, iSCSI, SMP, primary-storage plugins, S3-compatible secondary
+storage). A central **management server** (Java/Tomcat-style servlets,
+backed by MariaDB/MySQL) exposes a signed REST/JSON API to admins, end
+users, and integrations; runs system VMs (Secondary Storage VM, Console
+Proxy VM, virtual router); and orchestrates a fleet of **agents** running
+on each hypervisor host. Authorization is RBAC + multi-tenant
+domain/account/project hierarchy. The deployment shape is "operator-run
+private/public cloud control plane", not a hosted-as-a-service appliance.
+
+## §2 Scope and intended use
+
+### Intended use
+
+- A multi-tenant IaaS control plane deployed by an operator inside a
+  controlled datacenter or cloud, exposing compute / storage / network
+  orchestration to authenticated end users via a JSON API and a Vue.js Web
+  UI, with separately authenticated administrators *(documented: `README.md`,
+  `INSTALL.md`)*.
+- Used both for service-provider public clouds and for on-premises private
+  clouds; the trust model is the same in both *(documented: `README.md`)*.
+
+### Deployment shape
+
+CloudStack is **not** an in-process library, **not** a single-binary
+appliance, and **not** a hosted SaaS. It is a distributed control plane:
+one or more management-server instances (clustered behind a load balancer
+in production), a MariaDB/MySQL database, one usage server, an optional
+SecondaryStorageVM/ConsoleProxyVM/VirtualRouter set of system VMs, and a
+per-hypervisor-host `cloudstack-agent` (for KVM/Hyper-V/baremetal) or
+out-of-process resource bridges (for VMware / XenServer / XCP-ng). The
+operator owns the surrounding L2/L3 network (the **management network**,
+the **public network**, the **guest network**, the **storage network**)
+and the physical hosts. The threat model is therefore that of a clustered
+distributed service, not a library *(inferred — §14 Q1)*.
+
+### Caller roles
+
+| Role | Trust level | Notes |
+| --- | --- | --- |
+| **End-user API client / Web UI user** | untrusted but authenticated | 
Identity verified via Apache CloudStack-native (password + HMAC-SHA1 signed 
request), LDAP, SAML2, OAuth2, or pluggable `APIAuthenticator` *(documented: 
`plugins/user-authenticators/{ldap,saml2,oauth2,...}`, 
`server/src/main/java/com/cloud/api/ApiServer.java` `verifyRequest`)*. |
+| **Domain / Project admin** | partial trust within their domain | Bounded by 
RBAC (`plugins/acl/{static,dynamic,project}-role-based`) and the domain 
hierarchy; can manage users / VMs / networks within a domain. |
+| **Root admin** | trusted control plane | Global RBAC role; can change global 
configuration, upload templates/ISOs, run privileged orchestration. |
+| **Operator / cluster admin** | trusted | OS-level access to 
management-server hosts, the MariaDB database, the keystore, and the agent 
hosts. Sets `agent.properties`, manages `cloudstack-agent` packages, manages 
the JCEKS keystore used by the agent for TLS *(documented: 
`agent/conf/agent.properties`, `framework/security/.../KeystoreManager.java`)*. 
|
+| **Hypervisor agent (cloudstack-agent on KVM/Hyper-V/baremetal)** | 
trusted-once-enrolled peer | Mutually authenticated via X.509 client cert 
signed by the management server's Root CA *(documented: `framework/ca/`, 
`plugins/ca/root-ca/`, `agent/src/main/java/com/cloud/agent/Agent.java` 
`setupAgentKeystore`)*. |
+| **System VM (SSVM / CPVM / VR)** | trusted-once-enrolled peer | Same X.509 
enrolment shape as the agent; carries the agent binary inside *(inferred — §14 
Q2)*. |
+| **Hypervisor host (the underlying KVM/VMware/etc.)** | trusted by virtue of 
operator-controlled provisioning | CloudStack expects to drive the hypervisor 
via libvirt / VMware vSphere SDK / XenAPI as a privileged user *(documented: 
`plugins/hypervisors/kvm/`, `plugins/hypervisors/vmware/`, 
`plugins/hypervisors/xenserver/`)*. |
+| **Hypervisor-managed guest VM (end-user workload)** | **untrusted** | A 
guest VM is an attacker's workload; the model defends against it. |
+| **Reverse proxy / load balancer in front of management server** | trusted 
*(if `useForwardHeader=true`)* | When the operator enables forward-header 
processing, only requests from IPs in `proxy.forward.list` have their forward 
header honoured *(documented: 
`server/src/main/java/com/cloud/api/ApiServlet.java` `getClientAddress`)*. |
+| **Underlying storage (primary / secondary)** | trusted by virtue of 
operator-granted credentials | CloudStack reads/writes via NFS / RBD / iSCSI / 
S3 with operator-supplied credentials *(documented: primary/secondary storage 
plugins under `plugins/storage/`)*. |
+| **External integrations (Tungsten, NSX, Netscaler, Palo Alto, …)** | trusted 
control-plane peers | Operator-configured; CloudStack assumes truthful 
responses *(inferred — §14 Q3)*. |
+
+### Component-family table
+
+| Family | Representative entry point | Touches outside the process? | 
In-model? |
+| --- | --- | --- | --- |
+| Management server JSON API | `client/.../ApiServlet`, HTTPS on `:8080` 
(admin), `:8080/client/api` (user), HTTPS on `:8443` integration port 
*(documented: `server/src/main/java/com/cloud/api/ApiServlet.java`, `client/`)* 
| network (TCP, optionally TLS) | **yes** |
+| Management server Web UI | Vue.js SPA under `ui/`, served by the same 
servlet container *(documented: `ui/`)* | network | **yes** (auth is the API 
auth) |
+| Management server cluster RPC (peer-to-peer) | NIO + TLS between 
management-server replicas, `:9090` *(documented: `framework/cluster/`, 
`utils/.../nio/`)* | network | **yes** (peer auth via Root CA) |
+| Management server → agent RPC | NIO + TLS on `:8250` (default 
`agent.properties`) *(documented: `agent/conf/agent.properties` line 47, 
`utils/.../nio/NioServer.java`)* | network | **yes** (mutually authenticated 
via Root CA) |
+| `cloudstack-agent` (KVM/Hyper-V/baremetal) | reverse-connects to management 
server, runs commands via libvirt / hypervisor SDK *(documented: `agent/`, 
`plugins/hypervisors/kvm/`)* | network + hypervisor + OS | **yes** |
+| System VMs — SecondaryStorageVM, ConsoleProxyVM, Virtual Router | shipped 
images under `systemvm/`; agent binaries inside them *(documented: 
`systemvm/`)* | network (storage / public / guest) | **yes** |
+| Console proxy data path | browser ↔ ConsoleProxyVM ↔ hypervisor VNC/SPICE 
socket; signed token issued by management server *(documented: 
`server/src/main/java/com/cloud/servlet/ConsoleProxyServlet.java`, 
`server/src/main/java/com/cloud/servlet/ConsoleProxyPasswordBasedEncryptor.java`)*
 | network | **yes** |
+| Secondary-storage HTTP (templates, ISO downloads, snapshot copies) | SSVM 
serves HTTPS *(inferred — §14 Q4)* | network | **yes** |
+| Hypervisor plugins 
(`plugins/hypervisors/{kvm,vmware,xenserver,hyperv,ovm,ovm3,baremetal,ucs,simulator}`)
 | invoked by agent or by management server *(documented: 
`plugins/hypervisors/`)* | hypervisor APIs | **yes** for the call shape; 
**out-of-model** for the upstream hypervisor's own bugs |
+| Network plugins 
(`plugins/network-elements/{netscaler,nsx,palo-alto,tungsten,nicira-nvp,...}`) 
| management server outbound | external SDN/firewall APIs | **yes** for 
credential handling and request construction; **out-of-model** for the external 
endpoint |
+| Storage plugins (`plugins/storage/{volume,image,object}`) | management 
server / agent | NFS, RBD, iSCSI, S3 endpoints | **yes** for credential 
handling; **out-of-model** for the storage endpoint |
+| User authenticator plugins 
(`plugins/user-authenticators/{md5,sha256salted,pbkdf2,plain-text,ldap,saml2,oauth2}`)
 | management server | LDAP / SAML2 IdP / OAuth2 IdP | **yes** for the local 
code; **out-of-model** for the IdP |
+| RootCA provider (`plugins/ca/root-ca/`) | self-signed CA generated by 
management server at first boot, issues certs to agents *(documented: 
`plugins/ca/root-ca/.../RootCAProvider.java`)* | none directly | **yes** |
+| Two-factor authenticators 
(`plugins/user-two-factor-authenticators/{static-pin,totp}`) | management 
server | none | **yes** |
+| Backup providers (`plugins/backup/`) | management server outbound | external 
backup endpoints | **yes** for credential handling |
+| Quota / metrics / DRS / HA planners | internal | none | **yes** as 
orchestration only; not a security boundary |
+| Database layer (MariaDB/MySQL, Jasypt-encrypted secrets) | management server 
| network to DB | **yes** for credential handling; DB itself is trusted 
*(documented: `README.md` "Notice of Cryptographic Software" — JaSypt, native 
DB encryption)* |
+| `cloud-cli`, `tools/marvin`, `test/`, `developer/`, `quickcloud/` | 
integration / test tooling | varies | **out of model** *(§3)* |
+| `systemvm/agent/noVNC/vendor/pako`, other vendored JS / shell scripts | 
vendored upstream | n/a | in-model only at the wrapper boundary; upstream bugs 
go upstream *(inferred — §14 Q5)* |
+
+## §3 Out of scope (explicit non-goals)
+
+CloudStack is not, and does not aim to be, the following — reports
+requiring any of these will be closed with the cited disposition:
+
+1. **A defender against the operator.** Anyone with `root` on a
+   management-server host, `root` on a hypervisor host, raw MariaDB
+   credentials, the JCEKS keystore + `security.encryption.key` /
+   `security.encryption.iv` *(documented:
+   `framework/security/.../KeysManager.java`)*, or the Root CA private key
+   already has unbounded power. "The operator misconfigured X" is not a
+   vulnerability *(inferred — §14 Q6)*. → `OUT-OF-MODEL:
+   adversary-not-in-scope`.
+2. **A defender against a malicious external service the operator
+   configured.** A hostile LDAP server, SAML IdP, OAuth IdP, Tungsten /
+   NSX / Netscaler controller, S3 endpoint, Ceph cluster, or backup
+   provider is treated as a trusted control-plane peer. If the report
+   requires that peer to be hostile, it is out of model *(inferred —
+   §14 Q3)*. → `OUT-OF-MODEL: trusted-input`.
+3. **A defender against the hypervisor.** CloudStack drives KVM / VMware /
+   XenServer / XCP-ng / Hyper-V via their own admin APIs. A hypervisor
+   bug that allows guest escape, a vSphere SDK vulnerability, a libvirt
+   privilege escalation — all are upstream to the hypervisor project, not
+   to CloudStack *(inferred — §14 Q7)*. → `OUT-OF-MODEL:
+   unsupported-component` (upstream pointer).
+4. **An isolation boundary between an authorized administrator's API
+   call and the management server process.** Root admin can change global
+   configuration, upload templates and scripts to system VMs, register
+   arbitrary network/storage plugins, and run `runCustomAction`-style
+   commands. A new way for a root admin to do something they are already
+   authorized to do is not a vulnerability *(inferred — §14 Q8)*. →
+   `OUT-OF-MODEL: equivalent-harm`.
+5. **A defender against a guest VM doing things the hypervisor allows it
+   to do.** A guest VM consuming CPU, memory, or disk up to its allocated
+   limit, sending arbitrary IP traffic within its assigned VLAN / VXLAN /
+   security group, or exploiting another VM via the hypervisor's own
+   shared surfaces (sidechannel, RowHammer, GPU passthrough leak) is out
+   of model. CloudStack is responsible only for the orchestration that
+   *places* the guest, not for hypervisor-level isolation *(inferred —
+   §14 Q9)*. → `OUT-OF-MODEL: adversary-not-in-scope` for the
+   side-channel case, `BY-DESIGN: property-disclaimed` for the
+   resource-limit case.
+6. **A sandbox for templates, ISO images, or user-data scripts.** A
+   user-uploaded template (via `registerTemplate`) is run by the
+   hypervisor with the privileges the offering grants. cloud-init /
+   user-data / metadata is passed through to the guest; CloudStack does
+   not parse or sanitize its semantics *(documented: kubernetes-service
+   plugin `userdata` references; inferred — §14 Q10)*. →
+   `BY-DESIGN: property-disclaimed`.
+7. **Code that ships but is not part of the supported product:**
+   `tools/marvin/`, `test/`, `developer/`, `quickcloud/`, `cloud-cli/`,
+   `tools/devcloud4/`, `tools/devcloud-kvm/`, `tools/appliance/`,
+   `tools/checkstyle/`, `tools/transifex/`, `services/`-side simulators,
+   `simulator` hypervisor plugin, and IDE / build helpers under `tools/`.
+   *(inferred — §14 Q11)*. → `OUT-OF-MODEL: unsupported-component`.
+8. **Bundled / vendored upstream libraries** — JaSypt, Bouncy Castle,
+   JSch, OpenSwan, noVNC + `pako`, MariaDB Connector/J, Spring,
+   Apache Commons, log4j, etc. *(documented: `README.md` Cryptographic
+   Software notice)*. Where CloudStack vendors source, the vendored code
+   is modeled at the wrapper boundary; vulnerabilities intrinsic to the
+   upstream project should be reported upstream *(inferred — §14 Q5)*.
+   → `OUT-OF-MODEL: unsupported-component` (with an upstream pointer).
+9. **The four satellite repos** (`apache/cloudstack-cloudmonkey`,
+   `apache/cloudstack-go`, `apache/cloudstack-terraform-provider`,
+   `apache/cloudstack-kubernetes-provider`) — covered by their own delta
+   threat models which inherit §3 / §4 / §7 from this document.
+10. **The CloudStack documentation site, Confluence wiki, downloads
+    mirrors, Docker Hub images outside `apache/cloudstack-*`, gem /
+    npm / PyPI packages with similar names, and other non-product
+    surfaces.** Out of scope.
+
+## §4 Trust boundaries and data flow
+
+CloudStack has at least nine distinct trust transitions; a finding is
+in-model only when it cleanly maps to one of them.
+
+| # | Transition | Authentication | Authorization |
+| --- | --- | --- | --- |
+| B1 | API client → management server JSON API (`:8080`/`:8443`) | per-user 
API key + HMAC-SHA1 signature over query string, or session login + 2FA 
*(documented: `server/src/main/java/com/cloud/api/ApiServer.java` 
`verifyRequest`)*; signature version 3 has expiration enforcement *(documented: 
same file line ~1053)* | RBAC (dynamic-role-based / static-role-based / 
project-role-based) on the called API command name + domain/account ownership 
of named resources |
+| B2 | Web UI → management server (`:8080`) | same as B1 plus session cookie | 
same as B1 |
+| B3 | Browser → ConsoleProxyVM → hypervisor VNC socket | signed token issued 
by management server, embedded in URL; encrypted with 
`ConsoleProxyPasswordBasedEncryptor` *(documented: 
`server/src/main/java/com/cloud/servlet/ConsoleProxyServlet.java`, 
`ConsoleProxyPasswordBasedEncryptor.java`)* | implicit (signed-token 
possession) |
+| B4 | Management server ↔ management server (cluster peers) | NIO + TLS, Root 
CA-issued certs *(documented: `framework/cluster/`, `framework/ca/`)* | 
peer-trust by valid cert |
+| B5 | Management server → `cloudstack-agent` (KVM/Hyper-V/baremetal) | NIO + 
TLS on `:8250`; agent uses X.509 client cert issued by Root CA on first 
connect; cert provisioning is the `SetupKeyStoreCommand` shape *(documented: 
`agent/src/main/java/com/cloud/agent/Agent.java` `setupAgentKeystore`, 
`framework/ca/.../CAService.java`, 
`plugins/ca/root-ca/.../RootCAProvider.java`)*; trust strictness governed by 
`ca.plugin.root.auth.strictness` (**default `false`** — see §5a) and 
`ca.plugin.root.allow.expired.cert` (**default `true`** — see §5a) | peer-trust 
by valid cert |
+| B6 | Management server → external services (LDAP / SAML2 / OAuth2 IdP, NSX, 
Netscaler, Tungsten, S3, backup providers) | per-provider (service account, 
OAuth token, etc.) | external-service-side |
+| B7 | Agent → hypervisor (libvirt / vSphere SDK / XenAPI) | local Unix socket 
(libvirt) or operator-supplied SDK credentials | hypervisor-side |
+| B8 | Management server / agent → primary/secondary storage (NFS, RBD, iSCSI, 
S3) | OS-level (NFS), Ceph cephx, iSCSI CHAP, IAM key / static credential (S3) 
| storage-side |
+| B9 | Operator → management server config (`db.properties`, 
`server.properties`, JCEKS keystore, global config table) | filesystem 
permissions on the host + DB access | OS-level + DB-level |
+
+### Reachability preconditions per family
+
+For each family in §2, a finding is in-model only if it is reachable as
+follows:
+
+- **Management server JSON API**: reachable from an *unauthenticated* network
+  peer who can reach `:8080` / `:8443`. Findings that require an
+  authenticated peer collapse to "authenticated user with RBAC privilege
+  X", and must additionally either clear RBAC for the harmful command or
+  bypass it.
+- **Web UI**: same shape as the JSON API; the Vue.js SPA is a presentation
+  layer over the API.
+- **Cluster RPC (B4)**: reachable from a peer that has cleared the Root CA
+  trust check. A flat "cluster RPC has no auth" finding is `OUT-OF-MODEL:
+  adversary-not-in-scope` because the model *requires* the Root CA to be
+  enrolled across peers; a *cleartext* cluster RPC finding is gated by the
+  `ca.plugin.root.auth.strictness` default (see §5a, §14 Q12).
+- **Management ↔ agent (B5)**: reachable from a peer that presents a
+  Root-CA-signed certificate the management server accepts. Crucially, the
+  default of `ca.plugin.root.auth.strictness = false` means the management
+  server *does not require* a client certificate from the connecting agent
+  by default *(documented: `plugins/ca/root-ca/.../RootCAProvider.java`
+  line 132–135; `RootCACustomTrustManager.java`)*; this is the highest-
+  leverage configuration default in the model.
+- **Console proxy (B3)**: reachable by anyone who holds a valid signed
+  token. The token is the entire authorization gate.
+- **Agent → hypervisor (B7)**: reachable only on the agent host, by code
+  the agent runs.
+- **External integrations (B6)**: reachable from the management server's
+  outbound posture; a hostile external service is `OUT-OF-MODEL:
+  trusted-input` (§3 item 2).
+
+## §5 Assumptions about the environment
+
+- **Operating system (management server / usage server)**: RHEL 8/9/10,
+  CentOS 8/9, Rocky 9/10, Ubuntu 22.04/24.04, SUSE 15, openSUSE Leap 15;
+  Java 17 (`README.md`, `INSTALL.md`, 
`packaging/{el8,el9,el10,debian,suse15}`).
+- **Operating system (agent)**: same family on KVM/Hyper-V/baremetal hosts;
+  agent ships as `cloudstack-agent` package *(documented: `debian/`,
+  `packaging/`)*.
+- **Database**: MariaDB or MySQL-compatible, accessible from each
+  management-server instance; CloudStack uses native DB encryption +
+  JaSypt for application-level secrets *(documented: `README.md`
+  "Notice of Cryptographic Software")*.
+- **Cryptography**: JaSypt (application-secret encryption), Bouncy Castle
+  (general-purpose crypto, X.509 issuance in the Root CA provider), JSch
+  (SSH client to system VMs), OpenSwan (optional VPN endpoint termination)
+  *(documented: `README.md` Cryptographic Software notice)*.
+- **Network**: operator-controlled L2/L3 with at least the management
+  network, public network, guest network, and storage network as logical
+  fabrics *(documented: CloudStack admin documentation; inferred —
+  §14 Q13)*. The management network is the trusted control-plane
+  network; the guest network carries untrusted guest VM traffic.
+- **Time**: signature version 3 enforces an `expires` parameter on signed
+  API requests *(documented: `ApiServer.java` line ~1054)*; this assumes
+  loosely-synchronized clocks between client and management server
+  *(inferred — §14 Q14)*.
+- **Filesystem**: the JCEKS keystore, `db.properties`, `server.properties`,
+  and Root CA private key are stored under `/etc/cloudstack/management/`
+  with OS-level permissions restricted to the `cloudstack` user
+  *(inferred — §14 Q15)*.
+- **Hypervisor**: each supported hypervisor is assumed to provide its own
+  guest isolation (memory, vCPU, disk, network) and to expose a stable
+  admin API (libvirt for KVM, vSphere SDK for VMware, XenAPI for
+  XenServer/XCP-ng, WinRM/Hyper-V API for Hyper-V).
+- **What CloudStack does to its host** (negative claims, awaiting
+  maintainer ratification):
+  - **does** open listening sockets on documented ports
+    (`:8080`/`:8443`/`:8250`/`:8096`/`:9090`/console-proxy ports) 
*(documented)*;
+  - **does** maintain MariaDB connections from the management server;
+  - **does** issue X.509 certificates from its self-signed Root CA 
*(documented:
+    `plugins/ca/root-ca/.../RootCAProvider.java`)*;
+  - **does** spawn child processes from the agent (`Script` invocations
+    against `/usr/share/cloudstack-common/scripts/`) *(documented:
+    `agent/src/main/java/com/cloud/agent/Agent.java` `keystoreSetupSetupPath`,
+    `keystoreCertImportScriptPath`)*;
+  - **does** write logs under operator-configured locations;
+  - **does** read a documented set of environment variables and the
+    `db.properties` file at startup *(inferred — §14 Q16)*;
+  - **does** install signal handlers / shutdown hooks only as
+    Tomcat/Jetty servlet container default *(inferred — §14 Q16)*.
+
+## §5a Build-time and configuration variants
+
+CloudStack ships as a family of `cloudstack-management`, `cloudstack-agent`,
+`cloudstack-usage`, `cloudstack-cli`, `cloudstack-ui` packages
+*(documented: `debian/`, `packaging/`)*. A sizable number of runtime
+configuration knobs materially change the security envelope. The
+security-relevant subset:
+
+| Knob | Default | Maintainer stance | Effect |
+| --- | --- | --- | --- |
+| `ca.plugin.root.auth.strictness` | **`false`** *(documented: 
`RootCAProvider.java` line 132)* | **maintainer ruling required**: is the 
default a supported production posture or a dev-mode setting operators must 
flip per §10? *(inferred — §14 Q12)* | When `false`, the management server's 
`RootCACustomTrustManager` does **not** require a client certificate from a 
peer attempting to connect on `:8250` (agent port) or cluster ports. A peer 
without a cert is allowed in. |
+| `ca.plugin.root.allow.expired.cert` | **`true`** *(documented: 
`RootCAProvider.java` line 138)* | **maintainer ruling required** *(inferred — 
§14 Q12)* | When `true`, an expired client cert is accepted during SSL 
handshake. |
+| `ca.plugin.root.issuer.dn` | `CN=ca.cloudstack.apache.org` *(documented: 
same file line 128)* | configured at first management-server boot | Subject DN 
of the auto-generated self-signed Root CA. |
+| `useforwardheader` (`use.forward.header`) | `false` *(inferred — §14 Q17)* | 
When `true`, the operator must restrict `proxy.forward.list` to the trusted 
reverse-proxy CIDR | When set, `ApiServlet.getClientAddress` honours 
`X-Forwarded-For` / configured headers *only* for source IPs in 
`proxy.forward.list` *(documented: 
`server/src/main/java/com/cloud/api/ApiServlet.java` lines 700–725)*. |
+| `proxy.forward.list` | unset *(inferred — §14 Q17)* | required when 
`useforwardheader=true` | CIDR list of trusted reverse proxies. |
+| `enable.2fa.for.users` / `enable.2fa.for.api` | per-domain toggle 
*(documented: `plugins/user-two-factor-authenticators/`)* | dev-test default 
off; production posture depends on PMC ruling *(inferred — §14 Q18)* | When on, 
users must complete static-pin or TOTP 2FA after login. |
+| `security.encryption.key`, `security.encryption.iv` | auto-generated at 
first boot *(documented: `framework/security/.../KeysManager.java`)* | trusted 
secret | Base64-encoded JaSypt master key + IV used to encrypt 
application-level secrets in the DB. |
+| `auth.password.algorithm` (`hash.user.password`) | bcrypt / pbkdf2 / 
sha256salted *(documented: 
`plugins/user-authenticators/{pbkdf2,sha256salted}`)* | **maintainer ruling 
required**: which is the supported default for new deployments? `md5` and 
`plain-text` plugins still ship *(documented: 
`plugins/user-authenticators/{md5,plain-text}`)* — are these legacy-compat-only 
or in supported production? *(inferred — §14 Q19)* | governs how user passwords 
are stored |

Review Comment:
   No mention of either `auth.password.algorithm` or `hash.user.password` in 
code.
   
   Order is defined by `user.password.encoders.order`. Default is 
`PBKDF2,SHA256SALT,MD5,LDAP,SAML2,PLAINTEXT`.  And to exclude 
`user.password.encoders.exclude` which has the default value - 
`MD5,LDAP,PLAINTEXT`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to