diff --git a/api/cmd/main.go b/api/cmd/main.go index db9f53c83..1e4b28251 100644 --- a/api/cmd/main.go +++ b/api/cmd/main.go @@ -233,6 +233,9 @@ func main() { logger.Warn("oidc disabled", "err", err) } credentialsNS, moduleConfigMapNS := cfg.managementNamespaces() + // The security settings ConfigMap of the home cluster lives here (the + // operator's control-plane namespace). Remote clusters use their own. + reg.SetControlPlaneNamespace(moduleConfigMapNS) authRegistry := auth.NewRegistry(store, auth.NewK8sSecretReader(k8s, credentialsNS), oidcAuth, cfg.oidcDisplayName, helmPolicy) @@ -406,12 +409,12 @@ func main() { p.Use(sessions.RevalidateStreams(isStreamingRequest, 5*time.Second, rbac.StreamGrantValidator(reg))) } - handlers.MountResources(p, reg, store) + handlers.MountResources(p, reg, store, auditor) handlers.MountFleet(p, reg, store) handlers.MountNamespaces(p, reg) handlers.MountPodEvents(p, reg) handlers.MountPods(p, reg, cfg.namespace) - handlers.MountLifecycle(p, reg) + handlers.MountLifecycle(p, reg, auditor) handlers.MountShareLinks(p, reg, store) handlers.MountOwnership(p, reg, store) handlers.MountUsers(p, store, sessions, reg) @@ -420,6 +423,7 @@ func main() { telemetrySettings := handlers.TelemetrySettings{Dest: telemetryDest, Interval: cfg.telemetryInterval, Deps: telemetryDeps} handlers.MountConfigWithTelemetry(p, store, auditor, oidcAuth != nil, cfg.gameDataStorageClass, helmPolicy, telemetrySettings) handlers.MountTelemetry(p, store, telemetrySettings) + handlers.MountSecuritySettings(p, reg, auditor) handlers.MountNotifications(p, notifier, k8s, credentialsNS) handlers.MountAuthProviderSecrets(p, k8s, credentialsNS) handlers.MountCluster(p, reg, store, Version, cfg.clusterOps, cfg.updateChannel) diff --git a/api/internal/handlers/clusters.go b/api/internal/handlers/clusters.go index 7b7cc6369..79052d347 100644 --- a/api/internal/handlers/clusters.go +++ b/api/internal/handlers/clusters.go @@ -101,14 +101,22 @@ type clusterRegistryView struct { Message string `json:"message,omitempty"` ServerVersion string `json:"serverVersion,omitempty"` LastCheckTime string `json:"lastCheckTime,omitempty"` + // ControlPlaneNamespace is the operator control-plane namespace of the + // remote install, where its security settings ConfigMap lives (spec 030, OD-10 A). + ControlPlaneNamespace string `json:"controlPlaneNamespace,omitempty"` } type clusterCreateReq struct { - Name string `json:"name"` - DisplayName string `json:"displayName"` - Kubeconfig string `json:"kubeconfig"` + Name string `json:"name"` + DisplayName string `json:"displayName"` + Kubeconfig string `json:"kubeconfig"` + ControlPlaneNamespace string `json:"controlPlaneNamespace,omitempty"` } +// defaultClusterControlPlaneNamespace is recorded when a registration names no +// control-plane namespace. +const defaultClusterControlPlaneNamespace = "gameplane" + type clustersListResp struct { Items []clusterRegistryView `json:"items"` } @@ -153,6 +161,10 @@ func (h clustersHandler) list(w http.ResponseWriter, req *http.Request) { } item := clusterRegistryView{Name: id, CanViewInventory: u.Can("cluster:read", true, id, "")} item.DisplayName, _, _ = unstructured.NestedString(registration.Object, "spec", "displayName") + item.ControlPlaneNamespace, _, _ = unstructured.NestedString(registration.Object, "spec", "controlPlaneNamespace") + if item.ControlPlaneNamespace == "" { + item.ControlPlaneNamespace = defaultClusterControlPlaneNamespace + } item.Phase, _, _ = unstructured.NestedString(registration.Object, "status", "phase") if item.CanViewInventory { item.Message, _, _ = unstructured.NestedString(registration.Object, "status", "message") @@ -188,6 +200,18 @@ func (h clustersHandler) create(w http.ResponseWriter, req *http.Request) { return } + // The control-plane namespace is a Kubernetes namespace name, so it must be + // a DNS label. Empty means the default install namespace. + controlPlaneNS := in.ControlPlaneNamespace + if controlPlaneNS == "" { + controlPlaneNS = defaultClusterControlPlaneNamespace + } + if !dnsLabelRE.MatchString(controlPlaneNS) { + httperr.WriteCode(w, req, http.StatusBadRequest, + errors.New("controlPlaneNamespace must be a DNS label (lowercase, digits, hyphens)")) + return + } + // Validate kubeconfig. if in.Kubeconfig == "" { httperr.WriteCode(w, req, http.StatusBadRequest, @@ -235,6 +259,13 @@ func (h clustersHandler) create(w http.ResponseWriter, req *http.Request) { }, }, } + // Only an explicit value is written; the CRD default supplies "gameplane" + // otherwise, so a registration without the field keeps its old shape. + if in.ControlPlaneNamespace != "" { + if spec, ok := clusterCR.Object["spec"].(map[string]any); ok { + spec["controlPlaneNamespace"] = in.ControlPlaneNamespace + } + } if h.k.RegisterCluster != nil { _, err = h.k.RegisterCluster(req.Context(), h.namespace, secret, clusterCR) } else if h.k.IsStandalone() { @@ -252,9 +283,10 @@ func (h clustersHandler) create(w http.ResponseWriter, req *http.Request) { } writeJSONCreated(w, clusterRegistryView{ - Name: in.Name, - DisplayName: in.DisplayName, - Phase: "", // Will be populated by the operator + Name: in.Name, + DisplayName: in.DisplayName, + Phase: "", // Will be populated by the operator + ControlPlaneNamespace: controlPlaneNS, }) } diff --git a/api/internal/handlers/lifecycle.go b/api/internal/handlers/lifecycle.go index 4fa81825f..8476ed509 100644 --- a/api/internal/handlers/lifecycle.go +++ b/api/internal/handlers/lifecycle.go @@ -11,6 +11,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "github.com/GameplanePanel/gameplane/api/internal/audit" "github.com/GameplanePanel/gameplane/api/internal/httperr" "github.com/GameplanePanel/gameplane/api/internal/kube" "github.com/GameplanePanel/gameplane/api/internal/messages" @@ -37,12 +38,15 @@ const idleWakeRequestedAnnotation = "gameplane.local/idle-wake-requested" // reconciles the rest). Restart and wake are single stamped annotations the // operator acks: it owns the whole transition, so the request can't be // lost the way a client-issued suspend/resume patch pair can (rule 10). -func MountLifecycle(r chi.Router, reg *kube.Registry) { +// +// auditor is optional: clone writes the security row of a copied spec.security +// when it is set (contracts/audit-events.md). +func MountLifecycle(r chi.Router, reg *kube.Registry, auditor ...*audit.Auditor) { r.Post("/servers/{name}:start", patchSuspend(reg, false)) r.Post("/servers/{name}:stop", patchSuspend(reg, true)) r.Post("/servers/{name}:restart", restartHandler(reg)) r.Post("/servers/{name}:wake", wakeHandler(reg)) - r.Post("/servers/{name}:clone", cloneHandler(reg)) + r.Post("/servers/{name}:clone", cloneHandler(reg, firstAuditor(auditor))) r.Post("/servers/{name}:wipe-data", wipeDataHandler(reg)) } @@ -193,7 +197,7 @@ type cloneReq struct { NewName string `json:"newName"` } -func cloneHandler(reg *kube.Registry) http.HandlerFunc { +func cloneHandler(reg *kube.Registry, auditor *audit.Auditor) http.HandlerFunc { return func(w http.ResponseWriter, req *http.Request) { k, ok := resolveCluster(w, req, reg) if !ok { @@ -245,14 +249,28 @@ func cloneHandler(reg *kube.Registry) http.HandlerFunc { cl := scope.RequestedCluster(req) if err := validateAndProtectGameServer(req.Context(), k, cl, ns, body.NewName, clone, nil); err != nil { + writeSecurityRefusal(req, auditor, body.NewName, err) + writeServerValidationError(w, req, err) + return + } + if err := validateSecurityRootRule(req.Context(), reg, cl, clone, nil); err != nil { + writeSecurityRefusal(req, auditor, body.NewName, err) writeServerValidationError(w, req, err) return } + // A clone reads as a create: its security row has an empty before. + changeReason := securityChangeReason(req.Context(), k, clone, nil) + if !writeSecurityChange(w, req, auditor, body.NewName, changeReason, http.StatusOK) { + return + } created, err := k.Dynamic.Resource(kube.GVRs["servers"]). Namespace(ns). Create(req.Context(), clone, metav1.CreateOptions{}) if err != nil { + if changeReason != "" { + writeSecuritySaveFailed(req, auditor, body.NewName, err) + } httperr.Write(w, req, err) return } diff --git a/api/internal/handlers/resources.go b/api/internal/handlers/resources.go index 9804c13b9..f4b14782e 100644 --- a/api/internal/handlers/resources.go +++ b/api/internal/handlers/resources.go @@ -23,6 +23,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" + "github.com/GameplanePanel/gameplane/api/internal/audit" "github.com/GameplanePanel/gameplane/api/internal/auth" "github.com/GameplanePanel/gameplane/api/internal/db" "github.com/GameplanePanel/gameplane/api/internal/httperr" @@ -48,21 +49,25 @@ const heartbeatStaleTTL = 60 * time.Second // handler resolves its target cluster per request from reg via the // `?cluster=` selector (resolveCluster) — a request with no selector // resolves to scope.DefaultCluster, preserving single-cluster behavior. -func MountResources(r chi.Router, reg *kube.Registry, store *db.Store) { +// +// auditor is optional: when set, saves that change spec.security write their +// security rows (contracts/audit-events.md). A nil or absent auditor writes none. +func MountResources(r chi.Router, reg *kube.Registry, store *db.Store, auditor ...*audit.Auditor) { + a := firstAuditor(auditor) for path, gvr := range kube.GVRs { - mountOne(r, reg, store, path, gvr) + mountOne(r, reg, store, a, path, gvr) } } -func mountOne(r chi.Router, reg *kube.Registry, store *db.Store, path string, gvr schema.GroupVersionResource) { +func mountOne(r chi.Router, reg *kube.Registry, store *db.Store, auditor *audit.Auditor, path string, gvr schema.GroupVersionResource) { r.Route("/"+path, func(r chi.Router) { r.Get("/", listHandler(reg, gvr)) - r.Post("/", createHandler(reg, gvr)) + r.Post("/", createHandler(reg, gvr, auditor)) r.Get("/{name}", getHandler(reg, gvr)) if path == "servers" { r.Get("/{name}/template", effectiveTemplateHandler(reg)) } - r.Put("/{name}", updateHandler(reg, gvr)) + r.Put("/{name}", updateHandler(reg, gvr, auditor)) r.Delete("/{name}", deleteHandler(reg, store, gvr)) }) } @@ -219,7 +224,7 @@ func getHandler(reg *kube.Registry, gvr schema.GroupVersionResource) http.Handle } } -func createHandler(reg *kube.Registry, gvr schema.GroupVersionResource) http.HandlerFunc { +func createHandler(reg *kube.Registry, gvr schema.GroupVersionResource, auditor *audit.Auditor) http.HandlerFunc { return func(w http.ResponseWriter, req *http.Request) { k, ok := resolveCluster(w, req, reg) if !ok { @@ -249,9 +254,16 @@ func createHandler(reg *kube.Registry, gvr schema.GroupVersionResource) http.Han return } obj.SetNamespace(ns) + var changeReason string if gvr.Resource == "gameservers" { cl := scope.RequestedCluster(req) if err := validateAndProtectGameServer(req.Context(), k, cl, ns, obj.GetName(), obj, nil); err != nil { + writeSecurityRefusal(req, auditor, obj.GetName(), err) + writeServerValidationError(w, req, err) + return + } + if err := validateSecurityRootRule(req.Context(), reg, cl, obj, nil); err != nil { + writeSecurityRefusal(req, auditor, obj.GetName(), err) writeServerValidationError(w, req, err) return } @@ -259,8 +271,15 @@ func createHandler(reg *kube.Registry, gvr schema.GroupVersionResource) http.Han writeServerValidationError(w, req, err) return } + changeReason = securityChangeReason(req.Context(), k, obj, nil) + } + if !writeSecurityChange(w, req, auditor, obj.GetName(), changeReason, http.StatusCreated) { + return } created, err = k.Dynamic.Resource(gvr).Namespace(ns).Create(req.Context(), obj, metav1.CreateOptions{}) + if err != nil && changeReason != "" { + writeSecuritySaveFailed(req, auditor, obj.GetName(), err) + } } if err != nil { httperr.Write(w, req, err) @@ -276,7 +295,7 @@ func createHandler(reg *kube.Registry, gvr schema.GroupVersionResource) http.Han } } -func updateHandler(reg *kube.Registry, gvr schema.GroupVersionResource) http.HandlerFunc { +func updateHandler(reg *kube.Registry, gvr schema.GroupVersionResource, auditor *audit.Auditor) http.HandlerFunc { return func(w http.ResponseWriter, req *http.Request) { k, ok := resolveCluster(w, req, reg) if !ok { @@ -305,6 +324,7 @@ func updateHandler(reg *kube.Registry, gvr schema.GroupVersionResource) http.Han // provider's credential — so it is declared outside this block. var live *unstructured.Unstructured var cfgRules *configRuleCache + var changeReason string if gvr.Resource == "gameservers" { ns, ok := resolveNS(w, req) if !ok { @@ -324,6 +344,12 @@ func updateHandler(reg *kube.Registry, gvr schema.GroupVersionResource) http.Han writeRules := restoreRedactedConfig(req.Context(), cfgRules, obj, live) cl := scope.RequestedCluster(req) if err := validateAndProtectGameServer(req.Context(), k, cl, ns, name, obj, live); err != nil { + writeSecurityRefusal(req, auditor, name, err) + writeServerValidationError(w, req, err) + return + } + if err := validateSecurityRootRule(req.Context(), reg, cl, obj, live); err != nil { + writeSecurityRefusal(req, auditor, name, err) writeServerValidationError(w, req, err) return } @@ -331,6 +357,7 @@ func updateHandler(reg *kube.Registry, gvr schema.GroupVersionResource) http.Han writeServerValidationError(w, req, err) return } + changeReason = securityChangeReason(req.Context(), k, obj, live) } var updated *unstructured.Unstructured if cluster(gvr) { @@ -341,7 +368,13 @@ func updateHandler(reg *kube.Registry, gvr schema.GroupVersionResource) http.Han return } obj.SetNamespace(ns) + if !writeSecurityChange(w, req, auditor, name, changeReason, http.StatusOK) { + return + } updated, err = k.Dynamic.Resource(gvr).Namespace(ns).Update(req.Context(), obj, metav1.UpdateOptions{}) + if err != nil && changeReason != "" { + writeSecuritySaveFailed(req, auditor, name, err) + } if err == nil && gvr.Resource == "gameservers" { pruneTunnelProviderOnSpecChange(req.Context(), k, ns, name, live, updated) updated = updated.DeepCopy() @@ -629,6 +662,11 @@ func validateAndProtectGameServer( } } + // 1b. Validate spec.security field by field (see security_overrides.go). + if err := validateSecurityOverride(ctx, cl, ns, desired, live); err != nil { + return err + } + // 2. Validate spec.serviceAccountName // A host-capable diagnostic exception must be a separate, synchronously // audited administrator action. Generic edits may preserve an existing diff --git a/api/internal/handlers/resources_snapshot.go b/api/internal/handlers/resources_snapshot.go index 97a0b582b..7d8ba2d73 100644 --- a/api/internal/handlers/resources_snapshot.go +++ b/api/internal/handlers/resources_snapshot.go @@ -22,6 +22,14 @@ var volumeSnapshotGVR = schema.GroupVersionResource{Group: "snapshot.storage.k8s var errSnapshotSourceUnavailable = errors.New("snapshot data source verification unavailable") func writeServerValidationError(w http.ResponseWriter, req *http.Request, err error) { + // A localizable message carries its own status (for example 403 for + // server.security.forbidden or 422 for server.security.invalid), so it is + // written as is. Plain errors keep the code chosen below. + var m *httperr.Message + if errors.As(err, &m) { + httperr.WriteMessage(w, req, m) + return + } code := http.StatusForbidden if errors.Is(err, errTemplateRefImmutable) { code = http.StatusConflict diff --git a/api/internal/handlers/security_audit.go b/api/internal/handlers/security_audit.go new file mode 100644 index 000000000..0fc846235 --- /dev/null +++ b/api/internal/handlers/security_audit.go @@ -0,0 +1,256 @@ +package handlers + +import ( + "context" + "encoding/json" + "errors" + "log/slog" + "net/http" + + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + + "github.com/GameplanePanel/gameplane/api/internal/audit" + "github.com/GameplanePanel/gameplane/api/internal/httperr" + "github.com/GameplanePanel/gameplane/api/internal/kube" +) + +// securityAuditSettings are the spec.security members a change row can name, +// in the order the reason lists them (contracts/audit-events.md). +var securityAuditSettings = []string{"runAsUser", "runAsGroup", "fsGroup", "volumeOwnershipCheck"} + +// firstAuditor returns the optional auditor of a variadic parameter, or nil. +// A nil auditor means the handler writes no security rows (test routers). +func firstAuditor(auditors []*audit.Auditor) *audit.Auditor { + if len(auditors) == 0 { + return nil + } + return auditors[0] +} + +// securityRefusalReason maps a security refusal to its audit reason and the +// status it is returned with. ok is false for any other error. The reason +// carries only the setting name, never the message text. +func securityRefusalReason(err error) (reason string, status int, ok bool) { + var m *httperr.Message + if !errors.As(err, &m) { + return "", 0, false + } + setting, _ := m.Args["setting"].(string) + switch m.ID { + case "server.security.forbidden": + return "security_forbidden", m.Status, true + case "server.security.root_disabled": + return "security_root_disabled:" + setting, m.Status, true + case "server.security.invalid": + return "security_invalid:" + setting, m.Status, true + } + return "", 0, false +} + +// writeSecurityRefusal records a security refusal as the request's own row. A +// refusal that is not a security one writes nothing. If the row cannot be +// written, MarkRecorded stays unset, so the middleware row stands in; the +// caller still returns the refusal. +func writeSecurityRefusal(req *http.Request, auditor *audit.Auditor, target string, err error) { + if auditor == nil { + return + } + reason, status, ok := securityRefusalReason(err) + if !ok { + return + } + if werr := auditor.WriteSync(req.Context(), req.Method, req.URL.Path, target, reason, status); werr != nil { + slog.Warn("security refusal audit row not written", "target", target, "reason", reason, "err", werr) + return + } + audit.MarkRecorded(req.Context()) +} + +// writeSecurityChange writes the change row before the Kubernetes write. An +// empty reason means spec.security does not change, so no row is written. It +// returns false, after writing a 500 that saves nothing, when the row cannot +// be written. +func writeSecurityChange(w http.ResponseWriter, req *http.Request, auditor *audit.Auditor, target, reason string, status int) bool { + if auditor == nil || reason == "" { + return true + } + if err := auditor.WriteSync(req.Context(), req.Method, req.URL.Path, target, reason, status); err != nil { + httperr.WriteCode(w, req, http.StatusInternalServerError, errors.New("audit write failed")) + return false + } + audit.MarkRecorded(req.Context()) + return true +} + +// writeSecuritySaveFailed records, after a change row was written, that the +// change was attempted and not stored. Its status is the error status of the +// failed write. A failed row write is only logged: the first row stands. +func writeSecuritySaveFailed(req *http.Request, auditor *audit.Auditor, target string, err error) { + if auditor == nil { + return + } + status := http.StatusInternalServerError + var apiErr apierrors.APIStatus + if errors.As(err, &apiErr) { + if code := int(apiErr.Status().Code); code >= 400 { + status = code + } + } + if werr := auditor.WriteSync(req.Context(), req.Method, req.URL.Path, target, "security_save_failed", status); werr != nil { + slog.Warn("security_save_failed audit row not written", "target", target, "err", werr) + } +} + +// securityBlock returns spec.security of obj as a map, or nil when absent. +func securityBlock(obj *unstructured.Unstructured) map[string]any { + val, ok := securityOverrideValue(obj) + if !ok { + return nil + } + block, _ := val.(map[string]any) + return block +} + +// securityAuditValue renders one setting in the notation of +// contracts/audit-events.md: not set is null, a number is the number, the +// image default is "image", and volumeOwnershipCheck is its string. +func securityAuditValue(v any) any { + switch t := v.(type) { + case nil: + return nil + case map[string]any: + if val, ok := t["value"]; ok && val != nil { + return val + } + if def, _ := t["useImageDefault"].(bool); def { + return "image" + } + return nil + default: + return v + } +} + +// buildSecurityReason builds the reason of a change row: +// security:{"before":{...},"after":{...}[,"risky":[...]]}. Only the changed +// settings appear. On a create (create true) before is empty. risky names the +// changed settings the pinned template marks risky; the key is omitted when +// none is. It returns "" when no setting changed. +func buildSecurityReason(before, after map[string]any, create bool, risky map[string]bool) string { + beforeOut := map[string]any{} + afterOut := map[string]any{} + riskyOut := []string{} + changed := false + for _, name := range securityAuditSettings { + b, a := before[name], after[name] + if securityValuesEqual(b, a) { + continue + } + changed = true + if !create { + beforeOut[name] = securityAuditValue(b) + } + afterOut[name] = securityAuditValue(a) + if risky[name] { + riskyOut = append(riskyOut, name) + } + } + if !changed { + return "" + } + out := map[string]any{"before": beforeOut, "after": afterOut} + if len(riskyOut) > 0 { + out["risky"] = riskyOut + } + raw, err := json.Marshal(out) + if err != nil { + // Every value here is JSON-native; a failure cannot be produced by the input. + return "" + } + return "security:" + string(raw) +} + +// securityRiskyNames reads the template named by templateName and returns the +// security settings it marks risky (spec.security.risky. present). A +// template that cannot be read marks nothing; the row is still written. +func securityRiskyNames(ctx context.Context, k *kube.Client, templateName string) map[string]bool { + out := map[string]bool{} + if k == nil || k.Dynamic == nil || templateName == "" { + return out + } + tmpl, err := k.Dynamic.Resource(kube.GVRs["templates"]).Get(ctx, templateName, metav1.GetOptions{}) + if err != nil { + if !apierrors.IsNotFound(err) { + slog.Warn("security audit: read template for risky marks", "template", templateName, "err", err) + } + return out + } + return securityRiskyFromTemplate(tmpl) +} + +// securityRiskyFromTemplate returns the security settings tmpl marks risky +// (spec.security.risky. present). +func securityRiskyFromTemplate(tmpl *unstructured.Unstructured) map[string]bool { + out := map[string]bool{} + if tmpl == nil { + return out + } + risky, found, _ := unstructured.NestedMap(tmpl.Object, "spec", "security", "risky") + if !found { + return out + } + for _, name := range securityAuditSettings { + if v, ok := risky[name]; ok && v != nil { + out[name] = true + } + } + return out +} + +// securityPinnedRiskyNames returns the risky marks of the template revision +// live is pinned to (the effective-template-revision snapshot, or the catalog +// template when no revision is pinned). A template that cannot be read marks +// nothing; the row is still written. +func securityPinnedRiskyNames(ctx context.Context, k *kube.Client, live *unstructured.Unstructured) map[string]bool { + if k == nil { + return map[string]bool{} + } + tmpl, err := k.EffectiveGameTemplate(ctx, live) + if err != nil { + if !apierrors.IsNotFound(err) { + slog.Warn("security audit: read pinned template for risky marks", "server", live.GetName(), "err", err) + } + return map[string]bool{} + } + return securityRiskyFromTemplate(tmpl) +} + +// securityChangeReason returns the change-row reason for saving desired over +// live (live is nil on create and clone), or "" when spec.security does not +// change. The template is read only when a setting changed: on an update +// that keeps the server's template, the revision the server is pinned to; on +// create, clone or a template change, the catalog template. +func securityChangeReason(ctx context.Context, k *kube.Client, desired, live *unstructured.Unstructured) string { + before := securityBlock(live) + after := securityBlock(desired) + changed := false + for _, name := range securityAuditSettings { + if !securityValuesEqual(before[name], after[name]) { + changed = true + break + } + } + if !changed { + return "" + } + templateName, _, _ := unstructured.NestedString(desired.Object, "spec", "templateRef", "name") + if live != nil { + liveName, _, _ := unstructured.NestedString(live.Object, "spec", "templateRef", "name") + if templateName == "" || templateName == liveName { + return buildSecurityReason(before, after, false, securityPinnedRiskyNames(ctx, k, live)) + } + } + return buildSecurityReason(before, after, live == nil, securityRiskyNames(ctx, k, templateName)) +} diff --git a/api/internal/handlers/security_audit_pinned_test.go b/api/internal/handlers/security_audit_pinned_test.go new file mode 100644 index 000000000..cd428e08e --- /dev/null +++ b/api/internal/handlers/security_audit_pinned_test.go @@ -0,0 +1,78 @@ +package handlers + +import ( + "context" + "testing" + + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" +) + +// secAuditTemplate returns a minecraft template marking the given settings risky. +func secAuditTemplate(risky ...string) *unstructured.Unstructured { + marks := map[string]any{} + for _, name := range risky { + marks[name] = map[string]any{"reason": "module reason"} + } + return &unstructured.Unstructured{Object: map[string]any{ + "apiVersion": "gameplane.local/v1alpha1", + "kind": "GameTemplate", + "metadata": map[string]any{"name": "minecraft"}, + "spec": map[string]any{"security": map[string]any{"risky": marks}}, + }} +} + +// On an update, the risky marker follows the template revision the server is +// pinned to, not the current catalog template (contracts/audit-events.md). +func TestSecurityAuditChangeReason_UpdateUsesPinnedRevision(t *testing.T) { + // The catalog has moved on and marks only fsGroup; the pinned revision + // marks only runAsUser. + k := fakeKubeClient(secAuditTemplate("fsGroup")) + live := secRootObj(map[string]any{"runAsUser": secAuditVal(2000), "fsGroup": secAuditVal(2000)}) + pinRedactionTemplate(t, k, live, secAuditTemplate("runAsUser")) + + desired := secRootObj(map[string]any{"runAsUser": secAuditVal(0), "fsGroup": secAuditVal(3000)}) + got := secAuditReasonMap(t, securityChangeReason(context.Background(), k, desired, live)) + if risky, _ := got["risky"].([]any); len(risky) != 1 || risky[0] != "runAsUser" { + t.Fatalf("update risky = %#v, want [runAsUser] from the pinned revision", got["risky"]) + } +} + +// Without a pinned revision, an update reads the catalog template. +func TestSecurityAuditChangeReason_UpdateWithoutPinUsesCatalog(t *testing.T) { + k := fakeKubeClient(secAuditTemplate("fsGroup")) + live := secRootObj(map[string]any{"fsGroup": secAuditVal(2000)}) + desired := secRootObj(map[string]any{"fsGroup": secAuditVal(3000)}) + got := secAuditReasonMap(t, securityChangeReason(context.Background(), k, desired, live)) + if risky, _ := got["risky"].([]any); len(risky) != 1 || risky[0] != "fsGroup" { + t.Fatalf("update risky = %#v, want [fsGroup] from the catalog", got["risky"]) + } +} + +// A pinned snapshot that cannot be read marks nothing; the row is still written. +func TestSecurityAuditChangeReason_UnreadablePinMarksNothing(t *testing.T) { + k := fakeKubeClient(secAuditTemplate("runAsUser")) + live := secRootObj(map[string]any{"runAsUser": secAuditVal(2000)}) + live.SetUID("uid-unreadable") + live.SetAnnotations(map[string]string{"gameplane.local/effective-template-revision": "0000000000000000000000000000000000000000000000000000000000000000"}) + desired := secRootObj(map[string]any{"runAsUser": secAuditVal(0)}) + reason := securityChangeReason(context.Background(), k, desired, live) + got := secAuditReasonMap(t, reason) + if _, ok := got["risky"]; ok { + t.Fatalf("risky = %#v, want no marker when the pinned snapshot is missing", got["risky"]) + } +} + +// Moving the server to another template reads the new catalog template. +func TestSecurityAuditChangeReason_TemplateChangeUsesNewCatalog(t *testing.T) { + other := secAuditTemplate("runAsGroup") + other.SetName("other") + k := fakeKubeClient(secAuditTemplate("runAsUser"), other) + live := secRootObj(map[string]any{"runAsGroup": secAuditVal(2000)}) + pinRedactionTemplate(t, k, live, secAuditTemplate("runAsUser")) + desired := secRootObj(map[string]any{"runAsGroup": secAuditVal(0)}) + desired.Object["spec"].(map[string]any)["templateRef"] = map[string]any{"name": "other"} + got := secAuditReasonMap(t, securityChangeReason(context.Background(), k, desired, live)) + if risky, _ := got["risky"].([]any); len(risky) != 1 || risky[0] != "runAsGroup" { + t.Fatalf("risky = %#v, want [runAsGroup] from the new template", got["risky"]) + } +} diff --git a/api/internal/handlers/security_overrides.go b/api/internal/handlers/security_overrides.go new file mode 100644 index 000000000..cbd5c616d --- /dev/null +++ b/api/internal/handlers/security_overrides.go @@ -0,0 +1,291 @@ +package handlers + +import ( + "context" + "encoding/json" + "fmt" + "math" + "reflect" + "sort" + + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + + "github.com/GameplanePanel/gameplane/api/internal/auth" + "github.com/GameplanePanel/gameplane/api/internal/kube" + "github.com/GameplanePanel/gameplane/api/internal/messages" +) + +// canSetSecurityOverrides reports whether the caller may change spec.security +// of a GameServer in cluster cl, namespace ns. It follows the captures:manage +// precedent: admins and holders of servers:security. A nil user holds nothing. +func canSetSecurityOverrides(ctx context.Context, cl, ns string) bool { + u := auth.UserFromContext(ctx) + if u == nil { + return false + } + return u.Role == "admin" || u.Can("*", false, cl, ns) || u.Can("servers:security", true, cl, ns) +} + +// securityOverrideValue returns spec.security of obj. A JSON null counts as absent. +func securityOverrideValue(obj *unstructured.Unstructured) (any, bool) { + if obj == nil { + return nil, false + } + raw, found, _ := unstructured.NestedFieldNoCopy(obj.Object, "spec", "security") + if !found || raw == nil { + return nil, false + } + return raw, true +} + +// securityValuesEqual compares two spec.security values by their JSON value. +// Request bodies decode integers as float64 while the dynamic client returns +// int64, so a plain reflect.DeepEqual would report an unchanged value as changed. +// If either side cannot be normalized, the values count as different. +func securityValuesEqual(a, b any) bool { + na, errA := normalizeJSONValue(a) + nb, errB := normalizeJSONValue(b) + if errA != nil || errB != nil { + return false + } + return reflect.DeepEqual(na, nb) +} + +func normalizeJSONValue(v any) (any, error) { + raw, err := json.Marshal(v) + if err != nil { + return nil, fmt.Errorf("encode spec.security: %w", err) + } + var out any + if err := json.Unmarshal(raw, &out); err != nil { + return nil, fmt.Errorf("decode spec.security: %w", err) + } + return out, nil +} + +// validateSecurityOverride is the field-level step for spec.security. It runs +// on create, update and clone (live == nil), from validateAndProtectGameServer. +// +// Cases, in order (contracts/api-server-security.md): +// 1. Unchanged, or absent on both sides: accepted without the permission. +// 2. Absent in the request, present in the stored object, no permission: +// the stored value is copied back into the request. +// 3. Any other difference without servers:security: 403 server.security.forbidden. +// 4. A changed or new block with an invalid shape: 422 server.security.invalid +// (validateSecurityShape). +// +// Case 5, the root rule, is validateSecurityRootRule. The handlers call it +// after this function, because it needs the registry. +func validateSecurityOverride(ctx context.Context, cl, ns string, desired, live *unstructured.Unstructured) error { + desiredVal, hasDesired := securityOverrideValue(desired) + liveVal, hasLive := securityOverrideValue(live) + + if !hasDesired && !hasLive { + return nil + } + if hasDesired && hasLive && securityValuesEqual(desiredVal, liveVal) { + return nil + } + + canSet := canSetSecurityOverrides(ctx, cl, ns) + if !hasDesired { + if canSet { + // Removing the override is a change the caller may make. + return nil + } + // Case 2: a client that drops the field must not wipe the stored value. + if err := unstructured.SetNestedField(desired.Object, liveVal, "spec", "security"); err != nil { + return fmt.Errorf("restore spec.security: %w", err) + } + return nil + } + + if !canSet { + return messages.New("server.security.forbidden", nil) + } + // Case 4: shape. Runs only for a changed or new block, after the permission + // check (case 3), so a caller without servers:security gets 403 first. + if err := validateSecurityShape(desiredVal); err != nil { + return err + } + return nil +} + +// securityIDMax is the largest UID or GID a spec.security id may carry. +const securityIDMax = 4294967295 + +// securityIDNames are the three whole-number settings of spec.security. +var securityIDNames = []string{"runAsUser", "runAsGroup", "fsGroup"} + +// securityVolumeOwnershipChecks are the accepted volumeOwnershipCheck values. +var securityVolumeOwnershipChecks = map[string]bool{"EveryStart": true, "OnlyWhenWrong": true} + +// validateSecurityShape is case 4 of contracts/api-server-security.md. raw is +// the request's spec.security. It checks, in a fixed order, the object form, +// unknown members, each id (exactly one of value or useImageDefault, a whole +// number 0 to 4294967295 for value, true for useImageDefault) and the enum of +// volumeOwnershipCheck. The first failure decides. The returned error is a +// server.security.invalid message (422) whose args name the setting. +func validateSecurityShape(raw any) error { + block, ok := raw.(map[string]any) + if !ok { + return invalidSecurity("security", "must be an object") + } + for _, key := range sortedKeys(block) { + switch key { + case "runAsUser", "runAsGroup", "fsGroup", "volumeOwnershipCheck": + default: + return invalidSecurity(key, "unknown member") + } + } + for _, name := range securityIDNames { + v, present := block[name] + if !present || v == nil { + continue + } + if err := validateSecurityIDShape(name, v); err != nil { + return err + } + } + if v, present := block["volumeOwnershipCheck"]; present && v != nil { + s, isString := v.(string) + if !isString || !securityVolumeOwnershipChecks[s] { + return invalidSecurity("volumeOwnershipCheck", "must be EveryStart or OnlyWhenWrong") + } + } + return nil +} + +// validateSecurityIDShape checks one of runAsUser, runAsGroup or fsGroup. +// A null member counts as absent, as it does for the CRD. +func validateSecurityIDShape(name string, v any) error { + obj, ok := v.(map[string]any) + if !ok { + return invalidSecurity(name, "must be an object with value or useImageDefault") + } + for _, key := range sortedKeys(obj) { + if key != "value" && key != "useImageDefault" { + return invalidSecurity(name, "unknown member "+key) + } + } + value, hasValue := obj["value"] + hasValue = hasValue && value != nil + useDefault, hasUseDefault := obj["useImageDefault"] + hasUseDefault = hasUseDefault && useDefault != nil + + if hasValue == hasUseDefault { + return invalidSecurity(name, "set exactly one of value or useImageDefault") + } + if hasUseDefault { + if b, isBool := useDefault.(bool); !isBool || !b { + return invalidSecurity(name, "useImageDefault must be true when set") + } + return nil + } + n, isNumber := securityNumber(value) + if !isNumber || n != math.Trunc(n) || n < 0 || n > securityIDMax { + return invalidSecurity(name, "must be a whole number between 0 and 4294967295") + } + return nil +} + +// securityNumber reads a JSON number. Request bodies decode numbers as float64, +// the dynamic client returns int64; both are accepted. +func securityNumber(v any) (float64, bool) { + switch n := v.(type) { + case float64: + return n, true + case int64: + return float64(n), true + case int: + return float64(n), true + case int32: + return float64(n), true + case json.Number: + f, err := n.Float64() + return f, err == nil + } + return 0, false +} + +// invalidSecurity builds the 422 server.security.invalid refusal. +func invalidSecurity(setting, detail string) error { + return messages.New("server.security.invalid", map[string]any{"setting": setting, "detail": detail}) +} + +// securityRootMembers are the settings that can hold a root value, in the +// order a refusal names them. +var securityRootMembers = []string{"runAsUser", "runAsGroup", "fsGroup"} + +// isRootSecuritySetting reports whether one spec.security member carries a root +// value (contracts/api-server-security.md, "A root value"). The member has +// already passed the shape check. fsGroup counts only value 0: an image default +// for the filesystem group is not root. +func isRootSecuritySetting(name string, v any) bool { + block, ok := v.(map[string]any) + if !ok { + return false + } + if val, present := block["value"]; present && val != nil { + n, isNumber := securityNumber(val) + return isNumber && n == 0 + } + if name == "fsGroup" { + return false + } + useDefault, _ := block["useImageDefault"].(bool) + return useDefault +} + +// validateSecurityRootRule is case 5 of contracts/api-server-security.md. It runs +// after validateAndProtectGameServer on create, update and clone. A new or +// changed root value is refused with 403 server.security.root_disabled unless +// the request's cluster allows root overrides (exactly "true" in its settings +// ConfigMap). Any read error counts as off. The ConfigMap is read only when +// such a value is present. The reported setting is the first offending one. +func validateSecurityRootRule(ctx context.Context, reg *kube.Registry, cl string, desired, live *unstructured.Unstructured) error { + desiredVal, hasDesired := securityOverrideValue(desired) + if !hasDesired { + return nil + } + block, ok := desiredVal.(map[string]any) + if !ok { + return nil + } + var liveBlock map[string]any + if liveVal, hasLive := securityOverrideValue(live); hasLive { + liveBlock, _ = liveVal.(map[string]any) + } + + offending := "" + for _, name := range securityRootMembers { + v, present := block[name] + if !present || !isRootSecuritySetting(name, v) { + continue + } + if lv, stored := liveBlock[name]; stored && securityValuesEqual(v, lv) { + // A stored root value that is unchanged does not count. + continue + } + offending = name + break + } + if offending == "" { + return nil + } + allowed, err := securityRootAllowed(ctx, reg, cl) + if err == nil && allowed { + return nil + } + return messages.New("server.security.root_disabled", map[string]any{"setting": offending}) +} + +// sortedKeys returns the keys of m in order, so the first refusal is stable. +func sortedKeys(m map[string]any) []string { + keys := make([]string, 0, len(m)) + for k := range m { + keys = append(keys, k) + } + sort.Strings(keys) + return keys +} diff --git a/api/internal/handlers/security_overrides_audit_envtest_test.go b/api/internal/handlers/security_overrides_audit_envtest_test.go new file mode 100644 index 000000000..3b1f3c08e --- /dev/null +++ b/api/internal/handlers/security_overrides_audit_envtest_test.go @@ -0,0 +1,508 @@ +//go:build envtest + +package handlers + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "net/http" + "strings" + "testing" + + "github.com/go-chi/chi/v5" + + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/client-go/dynamic" + "k8s.io/client-go/kubernetes" + typedcorev1 "k8s.io/client-go/kubernetes/typed/core/v1" + + "github.com/GameplanePanel/gameplane/api/internal/audit" + "github.com/GameplanePanel/gameplane/api/internal/db" + "github.com/GameplanePanel/gameplane/api/internal/kube" + "github.com/GameplanePanel/gameplane/api/internal/rbac" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// T049 (envtest): audit rows for security overrides and the allow-root switch, +// plus the failure fallbacks of contracts/audit-events.md "Write order". +// +// The shared harness below (secAuditSetup and the failing client wrappers) is +// also used by security_settings_envtest_test.go and +// security_overrides_root_envtest_test.go. Failures are injected with SQLite +// triggers on audit_events, which fail only the rows whose reason matches, so +// the generic middleware row still lands and can be told apart. + +// secAuditEnv is one router with the audit middleware, rbac and every handler +// that writes security rows, backed by its own audit store and a home +// registry on client. The control-plane namespace holds the switch ConfigMap. +type secAuditEnv struct { + r *chi.Mux + store *db.Store + client *kube.Client + ns string +} + +// secAuditStore opens a private in-memory audit store for one test. +func secAuditStore(t *testing.T) *db.Store { + t.Helper() + dsn := "file:" + uniqueResourceName("secaudit") + "?mode=memory&cache=shared&_pragma=journal_mode(WAL)" + store, err := db.Open(t.Context(), "sqlite", dsn) + if err != nil { + t.Fatalf("open audit store: %v", err) + } + if err := store.Migrate(t.Context()); err != nil { + _ = store.Close() + t.Fatalf("migrate audit store: %v", err) + } + t.Cleanup(func() { _ = store.Close() }) + return store +} + +// secAuditSetup builds the router. It creates a control-plane namespace +// through client but no ConfigMap; tests add one with putConfigMap. +func secAuditSetup(t *testing.T, client *kube.Client) *secAuditEnv { + t.Helper() + store := secAuditStore(t) + auditor := audit.New(store) + + ns := uniqueResourceName("sec-cfg") + if _, err := client.Typed.CoreV1().Namespaces().Create(t.Context(), + &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: ns}}, metav1.CreateOptions{}); err != nil { + t.Fatalf("create control-plane namespace %s: %v", ns, err) + } + + reg := kube.NewRegistry(scope.DefaultCluster) + reg.Set(scope.DefaultCluster, client) + reg.SetControlPlaneNamespace(ns) + + r := chi.NewRouter() + r.Use(audit.Middleware(auditor)) + r.Use(rbac.Middleware(reg)) + MountResources(r, reg, nil, auditor) + MountLifecycle(r, reg, auditor) + MountSecuritySettings(r, reg, auditor) + MountAudit(r, auditor) + return &secAuditEnv{r: r, store: store, client: client, ns: ns} +} + +// putConfigMap creates the switch ConfigMap with value in the env namespace. +func (e *secAuditEnv) putConfigMap(t *testing.T, value string) { + t.Helper() + cm := &corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{Name: securitySettingsConfigMap, Namespace: e.ns}, + Data: map[string]string{securitySettingsKey: value}, + } + if _, err := e.client.Typed.CoreV1().ConfigMaps(e.ns).Create(t.Context(), cm, metav1.CreateOptions{}); err != nil { + t.Fatalf("create switch ConfigMap: %v", err) + } +} + +// configMapValue reads the switch value straight from the apiserver. +func (e *secAuditEnv) configMapValue(t *testing.T) string { + t.Helper() + cm, err := kubeC.Typed.CoreV1().ConfigMaps(e.ns).Get(t.Context(), securitySettingsConfigMap, metav1.GetOptions{}) + if err != nil { + t.Fatalf("get switch ConfigMap: %v", err) + } + return cm.Data[securitySettingsKey] +} + +// secAuditRow is one audit_events row, the columns the tests compare. +type secAuditRow struct { + Method string + Path string + Target string + Reason string + Status int +} + +// secAuditRows returns the rows matching where (SQL over the audit columns), in +// insertion order. +func secAuditRows(t *testing.T, store *db.Store, where string, args ...any) []secAuditRow { + t.Helper() + q := "SELECT method, path, COALESCE(target, ''), COALESCE(reason, ''), status FROM audit_events WHERE " + + where + " ORDER BY id" + rows, err := store.DB.QueryContext(t.Context(), q, args...) + if err != nil { + t.Fatalf("query audit rows: %v", err) + } + defer func() { _ = rows.Close() }() + var out []secAuditRow + for rows.Next() { + var row secAuditRow + if err := rows.Scan(&row.Method, &row.Path, &row.Target, &row.Reason, &row.Status); err != nil { + t.Fatalf("scan audit row: %v", err) + } + out = append(out, row) + } + if err := rows.Err(); err != nil { + t.Fatalf("iterate audit rows: %v", err) + } + return out +} + +// secAuditFailOn makes every audit insert whose reason matches pattern (a SQL +// LIKE pattern without quotes) fail, so that the synchronous row cannot be +// written. Other rows, including the middleware row, are unaffected. +func secAuditFailOn(t *testing.T, store *db.Store, pattern string) { + t.Helper() + stmt := fmt.Sprintf( + "CREATE TRIGGER sec_audit_fail BEFORE INSERT ON audit_events WHEN NEW.reason LIKE '%s' "+ + "BEGIN SELECT RAISE(ABORT, 'injected audit failure'); END", pattern) + if _, err := store.DB.ExecContext(t.Context(), stmt); err != nil { + t.Fatalf("create failure trigger: %v", err) + } +} + +// secAuditChange is the parsed reason of a change row. +type secAuditChange struct { + Before map[string]any `json:"before"` + After map[string]any `json:"after"` + Risky []string `json:"risky"` +} + +// secAuditParseChange parses a security:{...} reason and fails on anything else. +func secAuditParseChange(t *testing.T, reason string) secAuditChange { + t.Helper() + raw, ok := strings.CutPrefix(reason, "security:") + if !ok { + t.Fatalf("reason %q does not start with security:", reason) + } + var c secAuditChange + if err := json.Unmarshal([]byte(raw), &c); err != nil { + t.Fatalf("parse change reason %q: %v", reason, err) + } + return c +} + +// secAuditChangeRows returns the rows for target whose reason is a change row. +func secAuditChangeRows(t *testing.T, store *db.Store, target string) []secAuditRow { + t.Helper() + return secAuditRows(t, store, "target = ? AND reason LIKE 'security:%'", target) +} + +// secAuditSaveError is the Kubernetes error an injected failing write returns. +func secAuditSaveError(name string) error { + return apierrors.NewConflict(gvrServers().GroupResource(), name, errors.New("injected save failure")) +} + +// secAuditFailDynamic fails every create and update of a namespaced resource +// after the handler has written its change row. Reads pass through. +type secAuditFailDynamic struct{ dynamic.Interface } + +func (d secAuditFailDynamic) Resource(g schema.GroupVersionResource) dynamic.NamespaceableResourceInterface { + return secAuditFailNamespaceable{d.Interface.Resource(g)} +} + +type secAuditFailNamespaceable struct { + dynamic.NamespaceableResourceInterface +} + +func (n secAuditFailNamespaceable) Namespace(ns string) dynamic.ResourceInterface { + return secAuditFailResource{n.NamespaceableResourceInterface.Namespace(ns)} +} + +type secAuditFailResource struct{ dynamic.ResourceInterface } + +func (secAuditFailResource) Create(_ context.Context, obj *unstructured.Unstructured, _ metav1.CreateOptions, _ ...string) (*unstructured.Unstructured, error) { + return nil, secAuditSaveError(obj.GetName()) +} + +func (secAuditFailResource) Update(_ context.Context, obj *unstructured.Unstructured, _ metav1.UpdateOptions, _ ...string) (*unstructured.Unstructured, error) { + return nil, secAuditSaveError(obj.GetName()) +} + +// secAuditFailUpdateTyped fails every ConfigMap update. Reads and creates pass through. +type secAuditFailUpdateTyped struct{ kubernetes.Interface } + +func (c secAuditFailUpdateTyped) CoreV1() typedcorev1.CoreV1Interface { + return secAuditFailUpdateCoreV1{c.Interface.CoreV1()} +} + +type secAuditFailUpdateCoreV1 struct{ typedcorev1.CoreV1Interface } + +func (c secAuditFailUpdateCoreV1) ConfigMaps(ns string) typedcorev1.ConfigMapInterface { + return secAuditFailUpdateConfigMaps{c.CoreV1Interface.ConfigMaps(ns)} +} + +type secAuditFailUpdateConfigMaps struct{ typedcorev1.ConfigMapInterface } + +func (secAuditFailUpdateConfigMaps) Update(_ context.Context, cm *corev1.ConfigMap, _ metav1.UpdateOptions) (*corev1.ConfigMap, error) { + return nil, apierrors.NewInternalError(errors.New("injected update failure for " + cm.GetName())) +} + +// secAuditDeleteServer removes a server fixture at cleanup, ignoring NotFound. +func secAuditDeleteServer(t *testing.T, name string) { + t.Cleanup(func() { + _ = kubeC.Dynamic.Resource(gvrServers()). + Namespace(scope.DefaultNamespace). + Delete(context.Background(), name, metav1.DeleteOptions{}) + }) +} + +func TestSecurityAuditEnv_CreateWritesOneChangeRow(t *testing.T) { + env := secAuditSetup(t, kubeC) + name := uniqueResourceName("sec-aud-create") + secAuditDeleteServer(t, name) + + rr := secOvDo(t, env.r, adminUser(), http.MethodPost, "/servers", secOvPutBody(name, secOvStored(), nil)) + if rr.Code != http.StatusCreated { + t.Fatalf("admin create = %d, want 201; body=%s", rr.Code, rr.Body.String()) + } + rows := secAuditChangeRows(t, env.store, name) + if len(rows) != 1 { + t.Fatalf("change rows for %s = %d, want exactly 1: %+v", name, len(rows), rows) + } + row := rows[0] + if row.Method != http.MethodPost || row.Path != "/servers" || row.Status != http.StatusCreated { + t.Errorf("row = %+v, want POST /servers status 201", row) + } + change := secAuditParseChange(t, row.Reason) + if len(change.Before) != 0 { + t.Errorf("create before = %#v, want empty", change.Before) + } + if got := change.After["runAsUser"]; got != float64(2000) { + t.Errorf("create after.runAsUser = %#v, want 2000", got) + } +} + +func TestSecurityAuditEnv_UpdateChangeRowAndNoRowWhenUnchanged(t *testing.T) { + env := secAuditSetup(t, kubeC) + name := uniqueResourceName("sec-aud-upd") + secOvFixture(t, name, secOvStored()) + + rr := secOvDo(t, env.r, adminUser(), http.MethodPut, "/servers/"+name, + secOvPutBody(name, map[string]any{"runAsUser": map[string]any{"value": int64(3000)}}, nil)) + if rr.Code != http.StatusOK { + t.Fatalf("admin update = %d, want 200; body=%s", rr.Code, rr.Body.String()) + } + rows := secAuditChangeRows(t, env.store, name) + if len(rows) != 1 { + t.Fatalf("change rows after update = %d, want 1: %+v", len(rows), rows) + } + change := secAuditParseChange(t, rows[0].Reason) + if change.Before["runAsUser"] != float64(2000) || change.After["runAsUser"] != float64(3000) { + t.Errorf("update reason = %s, want before 2000 and after 3000", rows[0].Reason) + } + if rows[0].Status != http.StatusOK { + t.Errorf("update row status = %d, want 200", rows[0].Status) + } + + // An unrelated edit that sends the same block back writes no security row. + rr = secOvDo(t, env.r, adminUser(), http.MethodPut, "/servers/"+name, + secOvPutBody(name, map[string]any{"runAsUser": map[string]any{"value": int64(3000)}}, + map[string]any{"sec-test": "same-block"})) + if rr.Code != http.StatusOK { + t.Fatalf("unrelated edit = %d, want 200; body=%s", rr.Code, rr.Body.String()) + } + if n := len(secAuditChangeRows(t, env.store, name)); n != 1 { + t.Errorf("security rows after unrelated edit = %d, want still 1", n) + } +} + +func TestSecurityAuditEnv_CloneChangeRow(t *testing.T) { + env := secAuditSetup(t, kubeC) + src := uniqueResourceName("sec-aud-csrc") + clone := uniqueResourceName("sec-aud-cdst") + secOvFixture(t, src, secOvStored()) + secAuditDeleteServer(t, clone) + + rr := secOvDo(t, env.r, adminUser(), http.MethodPost, "/servers/"+src+":clone", map[string]any{"newName": clone}) + if rr.Code/100 != 2 { + t.Fatalf("admin clone = %d, want 2xx; body=%s", rr.Code, rr.Body.String()) + } + rows := secAuditChangeRows(t, env.store, clone) + if len(rows) != 1 { + t.Fatalf("clone change rows = %d, want exactly 1: %+v", len(rows), rows) + } + if rows[0].Status != rr.Code { + t.Errorf("clone row status = %d, want the response status %d", rows[0].Status, rr.Code) + } + change := secAuditParseChange(t, rows[0].Reason) + if len(change.Before) != 0 || change.After["runAsUser"] != float64(2000) { + t.Errorf("clone reason = %s, want empty before and after runAsUser 2000", rows[0].Reason) + } +} + +func TestSecurityAuditEnv_PermissionRefusalRow(t *testing.T) { + env := secAuditSetup(t, kubeC) + name := uniqueResourceName("sec-aud-forbid") + secOvFixture(t, name, secOvStored()) + + rr := secOvDo(t, env.r, secOvWriter(), http.MethodPut, "/servers/"+name, + secOvPutBody(name, secOvChanged(), nil)) + if rr.Code != http.StatusForbidden { + t.Fatalf("writer changed block = %d, want 403; body=%s", rr.Code, rr.Body.String()) + } + rows := secAuditRows(t, env.store, "target = ?", name) + if len(rows) != 1 || rows[0].Reason != "security_forbidden" || rows[0].Status != http.StatusForbidden { + t.Fatalf("rows = %+v, want one security_forbidden row with status 403", rows) + } +} + +func TestSecurityAuditEnv_RootRefusalRows(t *testing.T) { + env := secAuditSetup(t, kubeC) + env.putConfigMap(t, "false") + + t.Run("update", func(t *testing.T) { + name := uniqueResourceName("sec-aud-root-upd") + secOvFixture(t, name, secOvStored()) + rr := secOvDo(t, env.r, secOvHolder(), http.MethodPut, "/servers/"+name, + secOvPutBody(name, map[string]any{"runAsUser": map[string]any{"value": int64(0)}}, nil)) + if rr.Code != http.StatusForbidden { + t.Fatalf("root update while off = %d, want 403; body=%s", rr.Code, rr.Body.String()) + } + rows := secAuditRows(t, env.store, "target = ?", name) + if len(rows) != 1 || rows[0].Reason != "security_root_disabled:runAsUser" || rows[0].Status != http.StatusForbidden { + t.Fatalf("rows = %+v, want one security_root_disabled:runAsUser row with status 403", rows) + } + }) + + t.Run("create", func(t *testing.T) { + name := uniqueResourceName("sec-aud-root-create") + secAuditDeleteServer(t, name) + rr := secOvDo(t, env.r, secOvHolder(), http.MethodPost, "/servers", + secOvPutBody(name, map[string]any{"fsGroup": map[string]any{"value": int64(0)}}, nil)) + if rr.Code != http.StatusForbidden { + t.Fatalf("root create while off = %d, want 403; body=%s", rr.Code, rr.Body.String()) + } + rows := secAuditRows(t, env.store, "target = ?", name) + if len(rows) != 1 || rows[0].Reason != "security_root_disabled:fsGroup" { + t.Fatalf("rows = %+v, want one security_root_disabled:fsGroup row", rows) + } + }) +} + +func TestSecurityAuditEnv_InvalidRefusalRow(t *testing.T) { + env := secAuditSetup(t, kubeC) + name := uniqueResourceName("sec-aud-invalid") + secAuditDeleteServer(t, name) + + rr := secOvDo(t, env.r, secOvHolder(), http.MethodPost, "/servers", + secOvPutBody(name, map[string]any{"fsGroup": map[string]any{"value": int64(-1)}}, nil)) + if rr.Code != http.StatusUnprocessableEntity { + t.Fatalf("invalid fsGroup = %d, want 422; body=%s", rr.Code, rr.Body.String()) + } + rows := secAuditRows(t, env.store, "target = ?", name) + if len(rows) != 1 || rows[0].Reason != "security_invalid:fsGroup" || rows[0].Status != http.StatusUnprocessableEntity { + t.Fatalf("rows = %+v, want one security_invalid:fsGroup row with status 422", rows) + } +} + +// A failed synchronous change row refuses the save: 500, nothing stored, and +// the middleware row records the failed request as the fallback. +func TestSecurityAuditEnv_ChangeRowFailureStopsSave(t *testing.T) { + env := secAuditSetup(t, kubeC) + secAuditFailOn(t, env.store, "security:%") + name := uniqueResourceName("sec-aud-wfail") + secAuditDeleteServer(t, name) + + rr := secOvDo(t, env.r, secOvHolder(), http.MethodPost, "/servers", secOvPutBody(name, secOvStored(), nil)) + if rr.Code != http.StatusInternalServerError { + t.Fatalf("create with failing audit = %d, want 500; body=%s", rr.Code, rr.Body.String()) + } + if _, err := kubeC.Dynamic.Resource(gvrServers()).Namespace(scope.DefaultNamespace). + Get(t.Context(), name, metav1.GetOptions{}); !apierrors.IsNotFound(err) { + t.Errorf("server after failed audit write: err = %v, want NotFound (nothing saved)", err) + } + fallback := secAuditRows(t, env.store, "path = ? AND method = ?", "/servers", http.MethodPost) + if len(fallback) != 1 || fallback[0].Reason != "" || fallback[0].Status != http.StatusInternalServerError { + t.Errorf("fallback rows = %+v, want one generic row with status 500", fallback) + } +} + +// A change row followed by a failed Kubernetes write adds security_save_failed. +func TestSecurityAuditEnv_SaveFailedRows(t *testing.T) { + failing := &kube.Client{Dynamic: secAuditFailDynamic{kubeC.Dynamic}, Typed: kubeC.Typed} + + t.Run("create", func(t *testing.T) { + env := secAuditSetup(t, failing) + name := uniqueResourceName("sec-aud-sfc") + rr := secOvDo(t, env.r, adminUser(), http.MethodPost, "/servers", secOvPutBody(name, secOvStored(), nil)) + if rr.Code != http.StatusConflict { + t.Fatalf("create with failing save = %d, want 409; body=%s", rr.Code, rr.Body.String()) + } + rows := secAuditRows(t, env.store, "target = ?", name) + if len(rows) != 2 || !strings.HasPrefix(rows[0].Reason, "security:") || rows[0].Status != http.StatusCreated || + rows[1].Reason != "security_save_failed" || rows[1].Status != http.StatusConflict { + t.Fatalf("rows = %+v, want change row (201) then security_save_failed (409)", rows) + } + }) + + t.Run("update", func(t *testing.T) { + env := secAuditSetup(t, failing) + name := uniqueResourceName("sec-aud-sfu") + secOvFixture(t, name, secOvStored()) + rr := secOvDo(t, env.r, adminUser(), http.MethodPut, "/servers/"+name, + secOvPutBody(name, secOvChanged(), nil)) + if rr.Code != http.StatusConflict { + t.Fatalf("update with failing save = %d, want 409; body=%s", rr.Code, rr.Body.String()) + } + rows := secAuditRows(t, env.store, "target = ?", name) + if len(rows) != 2 || !strings.HasPrefix(rows[0].Reason, "security:") || rows[0].Status != http.StatusOK || + rows[1].Reason != "security_save_failed" || rows[1].Status != http.StatusConflict { + t.Fatalf("rows = %+v, want change row (200) then security_save_failed (409)", rows) + } + }) +} + +// A refusal whose row cannot be written keeps the response and leaves the +// generic middleware row as the record of the request. +func TestSecurityAuditEnv_RefusalRowFailureFallsBackToMiddleware(t *testing.T) { + env := secAuditSetup(t, kubeC) + secAuditFailOn(t, env.store, "security_forbidden") + name := uniqueResourceName("sec-aud-rfall") + secOvFixture(t, name, secOvStored()) + + rr := secOvDo(t, env.r, secOvWriter(), http.MethodPut, "/servers/"+name, + secOvPutBody(name, secOvChanged(), nil)) + if rr.Code != http.StatusForbidden { + t.Fatalf("refusal with failing audit = %d, want 403; body=%s", rr.Code, rr.Body.String()) + } + fallback := secAuditRows(t, env.store, "path = ? AND method = ?", "/servers/"+name, http.MethodPut) + if len(fallback) != 1 || fallback[0].Reason != "" || fallback[0].Status != http.StatusForbidden { + t.Fatalf("fallback rows = %+v, want one generic row with status 403", fallback) + } +} + +// The flip row is written once per changed value, and the hash chain still verifies. +func TestSecurityAuditEnv_FlipRowAndChainVerifies(t *testing.T) { + env := secAuditSetup(t, kubeC) + env.putConfigMap(t, "false") + + rr := secOvDo(t, env.r, adminUser(), http.MethodPut, "/security-settings?cluster="+scope.DefaultCluster, + map[string]any{"allowRootOverrides": true}) + if rr.Code != http.StatusOK { + t.Fatalf("flip on = %d, want 200; body=%s", rr.Code, rr.Body.String()) + } + flips := secAuditRows(t, env.store, "target = ?", "security/"+scope.DefaultCluster) + if len(flips) != 1 || flips[0].Method != http.MethodPut || flips[0].Path != "/security-settings" || + flips[0].Reason != "allowRootOverrides:false->true" || flips[0].Status != http.StatusOK { + t.Fatalf("flip rows = %+v, want one allowRootOverrides:false->true row", flips) + } + + name := uniqueResourceName("sec-aud-chain") + secAuditDeleteServer(t, name) + if rr := secOvDo(t, env.r, adminUser(), http.MethodPost, "/servers", + secOvPutBody(name, secOvStored(), nil)); rr.Code != http.StatusCreated { + t.Fatalf("create for chain = %d, want 201; body=%s", rr.Code, rr.Body.String()) + } + + rr = secOvDo(t, env.r, adminUser(), http.MethodGet, "/admin/audit/verify", nil) + if rr.Code != http.StatusOK { + t.Fatalf("verify = %d, want 200; body=%s", rr.Code, rr.Body.String()) + } + var res audit.VerifyResult + if err := json.Unmarshal(rr.Body.Bytes(), &res); err != nil { + t.Fatalf("decode verify: %v", err) + } + if !res.OK { + t.Errorf("verify OK = false: %+v", res) + } +} diff --git a/api/internal/handlers/security_overrides_audit_test.go b/api/internal/handlers/security_overrides_audit_test.go new file mode 100644 index 000000000..adf526149 --- /dev/null +++ b/api/internal/handlers/security_overrides_audit_test.go @@ -0,0 +1,270 @@ +package handlers + +import ( + "context" + "encoding/json" + "errors" + "net/http" + "strings" + "testing" + + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + dynamicfake "k8s.io/client-go/dynamic/fake" + + "github.com/GameplanePanel/gameplane/api/internal/kube" + "github.com/GameplanePanel/gameplane/api/internal/messages" +) + +// T049 (unit): the reason builder of a change row, the template's risky +// names, and the refusal reasons (contracts/audit-events.md). The envtest half +// is in security_overrides_audit_envtest_test.go. + +// secAuditReasonMap parses a security:{...} reason into a map. It fails the test +// when the prefix or the JSON is wrong. +func secAuditReasonMap(t *testing.T, reason string) map[string]any { + t.Helper() + raw, ok := strings.CutPrefix(reason, "security:") + if !ok { + t.Fatalf("reason %q does not start with security:", reason) + } + var out map[string]any + if err := json.Unmarshal([]byte(raw), &out); err != nil { + t.Fatalf("reason %q is not JSON: %v", reason, err) + } + return out +} + +func secAuditBlock(members map[string]any) map[string]any { return members } + +func secAuditVal(v int64) map[string]any { return map[string]any{"value": v} } + +func TestSecurityAuditReason_CreateHasEmptyBefore(t *testing.T) { + after := secAuditBlock(map[string]any{"runAsUser": secAuditVal(2000)}) + reason := buildSecurityReason(nil, after, true, nil) + got := secAuditReasonMap(t, reason) + if before, ok := got["before"].(map[string]any); !ok || len(before) != 0 { + t.Errorf("create before = %#v, want {}; reason=%s", got["before"], reason) + } + if a := got["after"].(map[string]any); a["runAsUser"] != float64(2000) { + t.Errorf("create after = %#v, want runAsUser 2000", a) + } + if _, has := got["risky"]; has { + t.Errorf("risky key present without risky settings: %s", reason) + } +} + +func TestSecurityAuditReason_ValueNotationPerSetting(t *testing.T) { + cases := []struct { + name string + before map[string]any + after map[string]any + wantBefore map[string]any + wantAfter map[string]any + }{ + { + name: "not set is null", + before: nil, + after: map[string]any{"runAsUser": secAuditVal(2000)}, + wantBefore: map[string]any{"runAsUser": nil}, + wantAfter: map[string]any{"runAsUser": float64(2000)}, + }, + { + name: "number to number", + before: map[string]any{"runAsUser": secAuditVal(1000)}, + after: map[string]any{"runAsUser": secAuditVal(2000)}, + wantBefore: map[string]any{"runAsUser": float64(1000)}, + wantAfter: map[string]any{"runAsUser": float64(2000)}, + }, + { + name: "image default is the word image", + before: map[string]any{"runAsGroup": secAuditVal(1000)}, + after: map[string]any{"runAsGroup": map[string]any{"useImageDefault": true}}, + wantBefore: map[string]any{"runAsGroup": float64(1000)}, + wantAfter: map[string]any{"runAsGroup": "image"}, + }, + { + name: "ownership check is its string", + before: nil, + after: map[string]any{"volumeOwnershipCheck": "OnlyWhenWrong"}, + wantBefore: map[string]any{"volumeOwnershipCheck": nil}, + wantAfter: map[string]any{"volumeOwnershipCheck": "OnlyWhenWrong"}, + }, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + reason := buildSecurityReason(tc.before, tc.after, false, nil) + got := secAuditReasonMap(t, reason) + wb := got["before"].(map[string]any) + wa := got["after"].(map[string]any) + for k, v := range tc.wantBefore { + if wb[k] != v { + t.Errorf("before[%s] = %#v, want %#v; reason=%s", k, wb[k], v, reason) + } + } + for k, v := range tc.wantAfter { + if wa[k] != v { + t.Errorf("after[%s] = %#v, want %#v; reason=%s", k, wa[k], v, reason) + } + } + }) + } +} + +func TestSecurityAuditReason_OnlyChangedSettingsAppear(t *testing.T) { + before := map[string]any{"runAsUser": secAuditVal(2000), "fsGroup": secAuditVal(1000)} + after := map[string]any{"runAsUser": secAuditVal(2000), "fsGroup": secAuditVal(3000)} + got := secAuditReasonMap(t, buildSecurityReason(before, after, false, nil)) + wb := got["before"].(map[string]any) + wa := got["after"].(map[string]any) + if _, has := wb["runAsUser"]; has { + t.Errorf("unchanged runAsUser appears in before: %#v", wb) + } + if _, has := wa["runAsUser"]; has { + t.Errorf("unchanged runAsUser appears in after: %#v", wa) + } + if wb["fsGroup"] != float64(1000) || wa["fsGroup"] != float64(3000) { + t.Errorf("fsGroup change = %#v -> %#v, want 1000 -> 3000", wb, wa) + } +} + +func TestSecurityAuditReason_RiskyListNamesOnly(t *testing.T) { + before := map[string]any{"runAsUser": secAuditVal(2000), "runAsGroup": secAuditVal(1000)} + after := map[string]any{"runAsUser": secAuditVal(0), "runAsGroup": secAuditVal(2000)} + + t.Run("risky changed setting is listed, non-risky is not", func(t *testing.T) { + got := secAuditReasonMap(t, buildSecurityReason(before, after, false, map[string]bool{"runAsUser": true})) + risky, ok := got["risky"].([]any) + if !ok || len(risky) != 1 || risky[0] != "runAsUser" { + t.Errorf("risky = %#v, want [runAsUser]", got["risky"]) + } + }) + + t.Run("risky but unchanged setting is not listed", func(t *testing.T) { + b := map[string]any{"runAsUser": secAuditVal(2000), "fsGroup": secAuditVal(1000)} + a := map[string]any{"runAsUser": secAuditVal(2000), "fsGroup": secAuditVal(3000)} + got := secAuditReasonMap(t, buildSecurityReason(b, a, false, map[string]bool{"runAsUser": true})) + if _, has := got["risky"]; has { + t.Errorf("unchanged risky setting listed: %s", buildSecurityReason(b, a, false, map[string]bool{"runAsUser": true})) + } + }) + + t.Run("absent risky map adds no key", func(t *testing.T) { + reason := buildSecurityReason(before, after, false, nil) + if strings.Contains(reason, "risky") { + t.Errorf("reason has a risky key with no risky map: %s", reason) + } + }) + + t.Run("no change gives no reason", func(t *testing.T) { + if reason := buildSecurityReason(before, before, false, map[string]bool{"runAsUser": true}); reason != "" { + t.Errorf("unchanged block reason = %q, want empty", reason) + } + }) +} + +// The template's risky reason text is read by securityRiskyNames as names only, +// and never reaches the row. +func TestSecurityAuditRiskyNames_ReasonTextNeverCopied(t *testing.T) { + const secretText = "SECRET-RISK-TEXT-DO-NOT-COPY" + tmpl := &unstructured.Unstructured{Object: map[string]any{ + "apiVersion": "gameplane.local/v1alpha1", + "kind": "GameTemplate", + "metadata": map[string]any{"name": "risky-tmpl"}, + "spec": map[string]any{"security": map[string]any{"risky": map[string]any{ + "runAsUser": map[string]any{"reason": secretText}, + }}}, + }} + dyn := dynamicfake.NewSimpleDynamicClientWithCustomListKinds(runtime.NewScheme(), + map[schema.GroupVersionResource]string{kube.GVRs["templates"]: "GameTemplateList"}, tmpl) + k := &kube.Client{Dynamic: dyn} + + risky := securityRiskyNames(context.Background(), k, "risky-tmpl") + if !risky["runAsUser"] || risky["fsGroup"] || risky["runAsGroup"] { + t.Fatalf("risky names = %v, want only runAsUser", risky) + } + reason := buildSecurityReason( + map[string]any{"runAsUser": secAuditVal(2000)}, + map[string]any{"runAsUser": secAuditVal(0)}, + false, risky) + if strings.Contains(reason, secretText) { + t.Errorf("module reason text leaked into the row: %s", reason) + } + if !strings.Contains(reason, `"risky":["runAsUser"]`) { + t.Errorf("reason lacks the risky name: %s", reason) + } +} + +func TestSecurityAuditRiskyNames_UnreadableTemplateMarksNothing(t *testing.T) { + dyn := dynamicfake.NewSimpleDynamicClientWithCustomListKinds(runtime.NewScheme(), + map[schema.GroupVersionResource]string{kube.GVRs["templates"]: "GameTemplateList"}) + if got := securityRiskyNames(context.Background(), &kube.Client{Dynamic: dyn}, "absent"); len(got) != 0 { + t.Errorf("risky names for a missing template = %v, want none", got) + } + if got := securityRiskyNames(context.Background(), nil, "absent"); len(got) != 0 { + t.Errorf("risky names without a client = %v, want none", got) + } +} + +func TestSecurityAuditChangeReason_CreateAndNoChange(t *testing.T) { + tmpl := &unstructured.Unstructured{Object: map[string]any{ + "apiVersion": "gameplane.local/v1alpha1", + "kind": "GameTemplate", + "metadata": map[string]any{"name": "minecraft"}, + "spec": map[string]any{"security": map[string]any{"risky": map[string]any{ + "runAsUser": map[string]any{"reason": "ignored"}, + }}}, + }} + dyn := dynamicfake.NewSimpleDynamicClientWithCustomListKinds(runtime.NewScheme(), + map[schema.GroupVersionResource]string{kube.GVRs["templates"]: "GameTemplateList"}, tmpl) + k := &kube.Client{Dynamic: dyn} + + desired := secRootObj(map[string]any{"runAsUser": secAuditVal(0)}) + reason := securityChangeReason(context.Background(), k, desired, nil) + got := secAuditReasonMap(t, reason) + if before := got["before"].(map[string]any); len(before) != 0 { + t.Errorf("create before = %#v, want {}", before) + } + if risky, _ := got["risky"].([]any); len(risky) != 1 || risky[0] != "runAsUser" { + t.Errorf("create risky = %#v, want [runAsUser]", got["risky"]) + } + + same := secRootObj(map[string]any{"runAsUser": secAuditVal(2000)}) + if reason := securityChangeReason(context.Background(), k, same, same); reason != "" { + t.Errorf("unchanged save reason = %q, want empty", reason) + } +} + +// Refusal reasons carry the setting name only, never the message text. +func TestSecurityAuditRefusalReason(t *testing.T) { + cases := []struct { + name string + err error + wantReason string + wantStatus int + wantOK bool + }{ + {"permission", messages.New("server.security.forbidden", nil), "security_forbidden", http.StatusForbidden, true}, + { + "root", + messages.New("server.security.root_disabled", map[string]any{"setting": "runAsUser"}), + "security_root_disabled:runAsUser", http.StatusForbidden, true, + }, + { + "invalid", + messages.New("server.security.invalid", map[string]any{"setting": "fsGroup", "detail": "must be a whole number"}), + "security_invalid:fsGroup", http.StatusUnprocessableEntity, true, + }, + {"not a security refusal", errors.New("boom"), "", 0, false}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + reason, status, ok := securityRefusalReason(tc.err) + if ok != tc.wantOK || reason != tc.wantReason || status != tc.wantStatus { + t.Errorf("securityRefusalReason = (%q, %d, %v), want (%q, %d, %v)", + reason, status, ok, tc.wantReason, tc.wantStatus, tc.wantOK) + } + }) + } +} diff --git a/api/internal/handlers/security_overrides_envtest_test.go b/api/internal/handlers/security_overrides_envtest_test.go new file mode 100644 index 000000000..9a3160423 --- /dev/null +++ b/api/internal/handlers/security_overrides_envtest_test.go @@ -0,0 +1,339 @@ +//go:build envtest + +package handlers + +import ( + "bytes" + "context" + "encoding/json" + "io" + "net/http" + "net/http/httptest" + "testing" + + "github.com/go-chi/chi/v5" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + + "github.com/GameplanePanel/gameplane/api/internal/auth" + "github.com/GameplanePanel/gameplane/api/internal/kube" + "github.com/GameplanePanel/gameplane/api/internal/rbac" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// T014: envtest for the spec.security permission behavior on create, +// update and clone (contracts/api-server-security.md cases 1 to 3). +// +// Like capture_rbac_envtest_test.go, this file builds its own router with +// rbac.Middleware in front of the handlers. It never uses the shared +// mountedR, which has no RBAC middleware. It reuses the envtest apiserver +// (kubeC) that suite_envtest_test.go starts. + +// secOvRouter builds a dedicated router with rbac.Middleware wired in front +// of the resources and lifecycle handlers, backed by kubeC. +func secOvRouter(t *testing.T) *chi.Mux { + t.Helper() + reg := kube.NewRegistry(scope.DefaultCluster) + reg.Set(scope.DefaultCluster, kubeC) + + r := chi.NewRouter() + r.Use(rbac.Middleware(reg)) + MountResources(r, reg, nil) + MountLifecycle(r, reg) + return r +} + +// secOvWriter holds servers:write and deliberately not servers:security. +func secOvWriter() *auth.User { + return &auth.User{ + ID: 301, + Username: "sec-op", + Role: rbac.RoleOperator, + Perms: map[string]map[string]map[string]struct{}{ + "*": {"*": { + "servers:read": {}, + "servers:write": {}, + }}, + }, + } +} + +// secOvHolder holds servers:write and servers:security. +func secOvHolder() *auth.User { + return &auth.User{ + ID: 302, + Username: "sec-holder", + Role: rbac.RoleOperator, + Perms: map[string]map[string]map[string]struct{}{ + "*": {"*": { + "servers:read": {}, + "servers:write": {}, + "servers:security": {}, + }}, + }, + } +} + +// secOvDo sends one request as u through h. It asks for an RFC 9457 problem +// document so a refusal carries its messageId. +func secOvDo(t *testing.T, h http.Handler, u *auth.User, method, path string, body any) *httptest.ResponseRecorder { + t.Helper() + var buf io.Reader + if body != nil { + b, err := json.Marshal(body) + if err != nil { + t.Fatalf("marshal body: %v", err) + } + buf = bytes.NewReader(b) + } + ctx := t.Context() + if u != nil { + ctx = auth.WithUser(ctx, u) + } + req := httptest.NewRequestWithContext(ctx, method, path, buf) + req.Header.Set("Accept", "application/problem+json") + rr := httptest.NewRecorder() + h.ServeHTTP(rr, req) + return rr +} + +// secOvFixture creates a GameServer in scope.DefaultNamespace whose +// spec.security is security (nil leaves the field absent) and removes it at +// cleanup. +func secOvFixture(t *testing.T, name string, security map[string]any) { + t.Helper() + spec := map[string]any{"templateRef": map[string]any{"name": "minecraft"}} + if security != nil { + spec["security"] = security + } + gs := &unstructured.Unstructured{Object: map[string]any{ + "apiVersion": "gameplane.local/v1alpha1", + "kind": "GameServer", + "metadata": map[string]any{"name": name, "namespace": scope.DefaultNamespace}, + "spec": spec, + }} + if _, err := kubeC.Dynamic.Resource(gvrServers()). + Namespace(scope.DefaultNamespace). + Create(t.Context(), gs, metav1.CreateOptions{}); err != nil { + t.Fatalf("create server fixture %s: %v", name, err) + } + t.Cleanup(func() { + _ = kubeC.Dynamic.Resource(gvrServers()). + Namespace(scope.DefaultNamespace). + Delete(context.Background(), name, metav1.DeleteOptions{}) + }) +} + +// secOvStoredSecurity reads spec.security of the stored server name. +func secOvStoredSecurity(t *testing.T, name string) (map[string]any, bool) { + t.Helper() + got, err := kubeC.Dynamic.Resource(gvrServers()). + Namespace(scope.DefaultNamespace). + Get(t.Context(), name, metav1.GetOptions{}) + if err != nil { + t.Fatalf("get server %s: %v", name, err) + } + sec, found, err := unstructured.NestedMap(got.Object, "spec", "security") + if err != nil { + t.Fatalf("read spec.security of %s: %v", name, err) + } + return sec, found +} + +// secOvPutBody is a full GameServer body for PUT /servers/{name}. security +// nil omits the block; labels adds an unrelated metadata change. +func secOvPutBody(name string, security map[string]any, labels map[string]any) map[string]any { + spec := map[string]any{"templateRef": map[string]any{"name": "minecraft"}} + if security != nil { + spec["security"] = security + } + meta := map[string]any{"name": name, "namespace": scope.DefaultNamespace} + // PUT is an optimistic update, so the body carries the stored version. + if live, err := kubeC.Dynamic.Resource(gvrServers()).Namespace(scope.DefaultNamespace). + Get(context.Background(), name, metav1.GetOptions{}); err == nil { + meta["resourceVersion"] = live.GetResourceVersion() + } + if labels != nil { + meta["labels"] = labels + } + return map[string]any{ + "apiVersion": "gameplane.local/v1alpha1", + "kind": "GameServer", + "metadata": meta, + "spec": spec, + } +} + +// secOvProblemID decodes the messageId of an RFC 9457 refusal. +func secOvProblemID(t *testing.T, rr *httptest.ResponseRecorder) string { + t.Helper() + var doc struct { + MessageID string `json:"messageId"` + } + if err := json.Unmarshal(rr.Body.Bytes(), &doc); err != nil { + t.Fatalf("decode problem body %q: %v", rr.Body.String(), err) + } + return doc.MessageID +} + +func secOvChanged() map[string]any { + return map[string]any{"runAsUser": map[string]any{"value": float64(3000)}} +} + +func secOvStored() map[string]any { + return map[string]any{"runAsUser": map[string]any{"value": int64(2000)}} +} + +// TestSecurityOverride_Update_PermissionMatrix covers update behavior for a +// caller with servers:write only, and for an admin. +func TestSecurityOverride_Update_PermissionMatrix(t *testing.T) { + r := secOvRouter(t) + writer := secOvWriter() + + t.Run("changed block without servers:security is 403", func(t *testing.T) { + name := uniqueResourceName("sec-ov-chg") + secOvFixture(t, name, secOvStored()) + + rr := secOvDo(t, r, writer, http.MethodPut, "/servers/"+name, + secOvPutBody(name, secOvChanged(), nil)) + if rr.Code != http.StatusForbidden { + t.Fatalf("PUT changed block = %d, want 403; body=%s", rr.Code, rr.Body.String()) + } + if id := secOvProblemID(t, rr); id != "server.security.forbidden" { + t.Errorf("messageId = %q, want server.security.forbidden", id) + } + if sec, _ := secOvStoredSecurity(t, name); !securityValuesEqual(sec, secOvStored()) { + t.Errorf("refused write changed the stored block: %#v", sec) + } + }) + + t.Run("unrelated edit sending the same block back is 200", func(t *testing.T) { + name := uniqueResourceName("sec-ov-same") + secOvFixture(t, name, secOvStored()) + + rr := secOvDo(t, r, writer, http.MethodPut, "/servers/"+name, + secOvPutBody(name, secOvStored(), map[string]any{"sec-test": "unrelated"})) + if rr.Code != http.StatusOK { + t.Fatalf("PUT unchanged block = %d, want 200; body=%s", rr.Code, rr.Body.String()) + } + if sec, _ := secOvStoredSecurity(t, name); !securityValuesEqual(sec, secOvStored()) { + t.Errorf("stored block after unrelated edit = %#v, want %#v", sec, secOvStored()) + } + }) + + t.Run("block omitted keeps the stored override", func(t *testing.T) { + name := uniqueResourceName("sec-ov-omit") + secOvFixture(t, name, secOvStored()) + + rr := secOvDo(t, r, writer, http.MethodPut, "/servers/"+name, + secOvPutBody(name, nil, map[string]any{"sec-test": "omitted"})) + if rr.Code != http.StatusOK { + t.Fatalf("PUT without block = %d, want 200; body=%s", rr.Code, rr.Body.String()) + } + sec, found := secOvStoredSecurity(t, name) + if !found { + t.Fatal("omitted block wiped the stored override") + } + if !securityValuesEqual(sec, secOvStored()) { + t.Errorf("stored block = %#v, want %#v", sec, secOvStored()) + } + }) + + t.Run("admin changed block is 200", func(t *testing.T) { + name := uniqueResourceName("sec-ov-admin") + secOvFixture(t, name, secOvStored()) + + rr := secOvDo(t, r, adminUser(), http.MethodPut, "/servers/"+name, + secOvPutBody(name, secOvChanged(), nil)) + if rr.Code != http.StatusOK { + t.Fatalf("admin PUT changed block = %d, want 200; body=%s", rr.Code, rr.Body.String()) + } + if sec, _ := secOvStoredSecurity(t, name); !securityValuesEqual(sec, secOvChanged()) { + t.Errorf("stored block = %#v, want %#v", sec, secOvChanged()) + } + }) + + t.Run("servers:security holder changed block is 200", func(t *testing.T) { + name := uniqueResourceName("sec-ov-holder") + secOvFixture(t, name, secOvStored()) + + rr := secOvDo(t, r, secOvHolder(), http.MethodPut, "/servers/"+name, + secOvPutBody(name, secOvChanged(), nil)) + if rr.Code != http.StatusOK { + t.Fatalf("holder PUT changed block = %d, want 200; body=%s", rr.Code, rr.Body.String()) + } + }) +} + +// TestSecurityOverride_Create_ForbiddenWithoutPermission covers create: a +// caller with servers:write only cannot create a server with an override. +func TestSecurityOverride_Create_ForbiddenWithoutPermission(t *testing.T) { + r := secOvRouter(t) + name := uniqueResourceName("sec-ov-create") + t.Cleanup(func() { + _ = kubeC.Dynamic.Resource(gvrServers()). + Namespace(scope.DefaultNamespace). + Delete(context.Background(), name, metav1.DeleteOptions{}) + }) + + rr := secOvDo(t, r, secOvWriter(), http.MethodPost, "/servers", + secOvPutBody(name, secOvStored(), nil)) + if rr.Code != http.StatusForbidden { + t.Fatalf("POST with override = %d, want 403; body=%s", rr.Code, rr.Body.String()) + } + if id := secOvProblemID(t, rr); id != "server.security.forbidden" { + t.Errorf("messageId = %q, want server.security.forbidden", id) + } + if _, err := kubeC.Dynamic.Resource(gvrServers()). + Namespace(scope.DefaultNamespace). + Get(t.Context(), name, metav1.GetOptions{}); err == nil { + t.Error("refused create left a server behind") + } +} + +// TestSecurityOverride_Clone_PermissionMatrix covers clone: a caller without +// servers:security cannot clone a server that has an override; admin can. +func TestSecurityOverride_Clone_PermissionMatrix(t *testing.T) { + r := secOvRouter(t) + + t.Run("clone of a server with override without permission is 403", func(t *testing.T) { + src := uniqueResourceName("sec-ov-csrc") + secOvFixture(t, src, secOvStored()) + clone := uniqueResourceName("sec-ov-cdst") + + rr := secOvDo(t, r, secOvWriter(), http.MethodPost, "/servers/"+src+":clone", + map[string]any{"newName": clone}) + t.Cleanup(func() { + _ = kubeC.Dynamic.Resource(gvrServers()). + Namespace(scope.DefaultNamespace). + Delete(context.Background(), clone, metav1.DeleteOptions{}) + }) + if rr.Code != http.StatusForbidden { + t.Fatalf("clone with override = %d, want 403; body=%s", rr.Code, rr.Body.String()) + } + if id := secOvProblemID(t, rr); id != "server.security.forbidden" { + t.Errorf("messageId = %q, want server.security.forbidden", id) + } + }) + + t.Run("admin clone of a server with override succeeds", func(t *testing.T) { + src := uniqueResourceName("sec-ov-asrc") + secOvFixture(t, src, secOvStored()) + clone := uniqueResourceName("sec-ov-adst") + t.Cleanup(func() { + _ = kubeC.Dynamic.Resource(gvrServers()). + Namespace(scope.DefaultNamespace). + Delete(context.Background(), clone, metav1.DeleteOptions{}) + }) + + rr := secOvDo(t, r, adminUser(), http.MethodPost, "/servers/"+src+":clone", + map[string]any{"newName": clone}) + if rr.Code/100 != 2 { + t.Fatalf("admin clone = %d, want 2xx; body=%s", rr.Code, rr.Body.String()) + } + if sec, found := secOvStoredSecurity(t, clone); !found || !securityValuesEqual(sec, secOvStored()) { + t.Errorf("clone block = %#v (found %v), want %#v", sec, found, secOvStored()) + } + }) +} diff --git a/api/internal/handlers/security_overrides_root_envtest_test.go b/api/internal/handlers/security_overrides_root_envtest_test.go new file mode 100644 index 000000000..2a982ff83 --- /dev/null +++ b/api/internal/handlers/security_overrides_root_envtest_test.go @@ -0,0 +1,194 @@ +//go:build envtest + +package handlers + +import ( + "context" + "encoding/json" + "net/http" + "testing" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// T048 (envtest): the root rule (case 5) through the create, update and clone +// handlers, against the envtest apiserver. The router is the dedicated one from +// secAuditSetup (rbac middleware, the real switch ConfigMap). Holders of +// servers:security are used, so the permission check passes and only the root +// rule decides. + +// secRootSwitch sets the switch ConfigMap value through the apiserver. +func secRootSwitch(t *testing.T, env *secAuditEnv, value string) { + t.Helper() + cm, err := kubeC.Typed.CoreV1().ConfigMaps(env.ns).Get(context.Background(), securitySettingsConfigMap, metav1.GetOptions{}) + if err != nil { + t.Fatalf("get switch ConfigMap: %v", err) + } + cm = cm.DeepCopy() + cm.Data[securitySettingsKey] = value + if _, err := kubeC.Typed.CoreV1().ConfigMaps(env.ns).Update(context.Background(), cm, metav1.UpdateOptions{}); err != nil { + t.Fatalf("update switch ConfigMap to %q: %v", value, err) + } +} + +// secRootProblem decodes the messageId and the setting argument of a refusal. +func secRootProblem(t *testing.T, rr interface{ Bytes() []byte }) (string, string) { + t.Helper() + var doc struct { + MessageID string `json:"messageId"` + Args map[string]any `json:"args"` + } + if err := json.Unmarshal(rr.Bytes(), &doc); err != nil { + t.Fatalf("decode problem body: %v", err) + } + setting, _ := doc.Args["setting"].(string) + return doc.MessageID, setting +} + +func secRootBlock(members map[string]any) map[string]any { return members } + +func secRootValue(v int64) map[string]any { return map[string]any{"value": v} } + +func TestSecurityRootEnv_CreateRefusedWhileOffAcceptedWhenOn(t *testing.T) { + env := secAuditSetup(t, kubeC) + env.putConfigMap(t, "false") + + refused := uniqueResourceName("sec-root-create-off") + secAuditDeleteServer(t, refused) + rr := secOvDo(t, env.r, secOvHolder(), http.MethodPost, "/servers", + secOvPutBody(refused, secRootBlock(map[string]any{"runAsUser": secRootValue(0)}), nil)) + if rr.Code != http.StatusForbidden { + t.Fatalf("root create while off = %d, want 403; body=%s", rr.Code, rr.Body.String()) + } + if id, setting := secRootProblem(t, rr.Body); id != "server.security.root_disabled" || setting != "runAsUser" { + t.Errorf("refusal = %s setting %q, want server.security.root_disabled runAsUser", id, setting) + } + if _, err := kubeC.Dynamic.Resource(gvrServers()).Namespace(scope.DefaultNamespace). + Get(t.Context(), refused, metav1.GetOptions{}); err == nil { + t.Error("refused create left a server behind") + } + + secRootSwitch(t, env, "true") + accepted := uniqueResourceName("sec-root-create-on") + secAuditDeleteServer(t, accepted) + rr = secOvDo(t, env.r, secOvHolder(), http.MethodPost, "/servers", + secOvPutBody(accepted, secRootBlock(map[string]any{"runAsUser": secRootValue(0)}), nil)) + if rr.Code != http.StatusCreated { + t.Fatalf("root create while on = %d, want 201; body=%s", rr.Code, rr.Body.String()) + } +} + +func TestSecurityRootEnv_FSGroupRootAndImageDefault(t *testing.T) { + env := secAuditSetup(t, kubeC) + env.putConfigMap(t, "false") + + rootFS := uniqueResourceName("sec-root-fs0") + secAuditDeleteServer(t, rootFS) + rr := secOvDo(t, env.r, secOvHolder(), http.MethodPost, "/servers", + secOvPutBody(rootFS, secRootBlock(map[string]any{"fsGroup": secRootValue(0)}), nil)) + if rr.Code != http.StatusForbidden { + t.Fatalf("fsGroup 0 while off = %d, want 403; body=%s", rr.Code, rr.Body.String()) + } + if _, setting := secRootProblem(t, rr.Body); setting != "fsGroup" { + t.Errorf("refused setting = %q, want fsGroup", setting) + } + + imageFS := uniqueResourceName("sec-root-fsimg") + secAuditDeleteServer(t, imageFS) + rr = secOvDo(t, env.r, secOvHolder(), http.MethodPost, "/servers", + secOvPutBody(imageFS, secRootBlock(map[string]any{"fsGroup": map[string]any{"useImageDefault": true}}), nil)) + if rr.Code != http.StatusCreated { + t.Fatalf("fsGroup image default while off = %d, want 201; body=%s", rr.Code, rr.Body.String()) + } +} + +func TestSecurityRootEnv_UpdateRefusedWhileOff(t *testing.T) { + env := secAuditSetup(t, kubeC) + env.putConfigMap(t, "false") + name := uniqueResourceName("sec-root-upd") + secOvFixture(t, name, secOvStored()) + + rr := secOvDo(t, env.r, secOvHolder(), http.MethodPut, "/servers/"+name, + secOvPutBody(name, secRootBlock(map[string]any{"runAsGroup": map[string]any{"useImageDefault": true}}), nil)) + if rr.Code != http.StatusForbidden { + t.Fatalf("root group update while off = %d, want 403; body=%s", rr.Code, rr.Body.String()) + } + if sec, _ := secOvStoredSecurity(t, name); !securityValuesEqual(sec, secOvStored()) { + t.Errorf("refused update changed the stored block: %#v", sec) + } + + secRootSwitch(t, env, "true") + rr = secOvDo(t, env.r, secOvHolder(), http.MethodPut, "/servers/"+name, + secOvPutBody(name, secRootBlock(map[string]any{"runAsGroup": map[string]any{"useImageDefault": true}}), nil)) + if rr.Code != http.StatusOK { + t.Fatalf("root group update while on = %d, want 200; body=%s", rr.Code, rr.Body.String()) + } +} + +// A stored root override survives unrelated saves while the setting is off, +// and removing or replacing it is always allowed. +func TestSecurityRootEnv_StoredRootUnrelatedSaveRemovalAndReplacement(t *testing.T) { + env := secAuditSetup(t, kubeC) + env.putConfigMap(t, "false") + + t.Run("unrelated save passes", func(t *testing.T) { + name := uniqueResourceName("sec-root-keep") + secOvFixture(t, name, secRootBlock(map[string]any{"runAsUser": secRootValue(0)})) + rr := secOvDo(t, env.r, secOvHolder(), http.MethodPut, "/servers/"+name, + secOvPutBody(name, secRootBlock(map[string]any{"runAsUser": secRootValue(0)}), + map[string]any{"sec-test": "unrelated"})) + if rr.Code != http.StatusOK { + t.Fatalf("unrelated save with stored root while off = %d, want 200; body=%s", rr.Code, rr.Body.String()) + } + }) + + t.Run("replacement with non-root passes", func(t *testing.T) { + name := uniqueResourceName("sec-root-repl") + secOvFixture(t, name, secRootBlock(map[string]any{"runAsUser": secRootValue(0)})) + rr := secOvDo(t, env.r, secOvHolder(), http.MethodPut, "/servers/"+name, + secOvPutBody(name, secRootBlock(map[string]any{"runAsUser": secRootValue(2000)}), nil)) + if rr.Code != http.StatusOK { + t.Fatalf("replacement while off = %d, want 200; body=%s", rr.Code, rr.Body.String()) + } + }) + + t.Run("removal passes", func(t *testing.T) { + name := uniqueResourceName("sec-root-rm") + secOvFixture(t, name, secRootBlock(map[string]any{"runAsUser": secRootValue(0)})) + rr := secOvDo(t, env.r, secOvHolder(), http.MethodPut, "/servers/"+name, + secOvPutBody(name, nil, nil)) + if rr.Code != http.StatusOK { + t.Fatalf("removal while off = %d, want 200; body=%s", rr.Code, rr.Body.String()) + } + if _, found := secOvStoredSecurity(t, name); found { + t.Error("removal did not clear spec.security") + } + }) +} + +// Cloning a server that holds a root override is a new root value, so it is +// refused while off and accepted once on. +func TestSecurityRootEnv_CloneRefusedWhileOff(t *testing.T) { + env := secAuditSetup(t, kubeC) + env.putConfigMap(t, "false") + src := uniqueResourceName("sec-root-csrc") + secOvFixture(t, src, secRootBlock(map[string]any{"runAsUser": secRootValue(0)})) + + clone := uniqueResourceName("sec-root-cdst") + secAuditDeleteServer(t, clone) + rr := secOvDo(t, env.r, secOvHolder(), http.MethodPost, "/servers/"+src+":clone", map[string]any{"newName": clone}) + if rr.Code != http.StatusForbidden { + t.Fatalf("clone with root while off = %d, want 403; body=%s", rr.Code, rr.Body.String()) + } + if id, _ := secRootProblem(t, rr.Body); id != "server.security.root_disabled" { + t.Errorf("messageId = %q, want server.security.root_disabled", id) + } + + secRootSwitch(t, env, "true") + rr = secOvDo(t, env.r, secOvHolder(), http.MethodPost, "/servers/"+src+":clone", map[string]any{"newName": clone}) + if rr.Code/100 != 2 { + t.Fatalf("clone with root while on = %d, want 2xx; body=%s", rr.Code, rr.Body.String()) + } +} diff --git a/api/internal/handlers/security_overrides_root_test.go b/api/internal/handlers/security_overrides_root_test.go new file mode 100644 index 000000000..77b472506 --- /dev/null +++ b/api/internal/handlers/security_overrides_root_test.go @@ -0,0 +1,185 @@ +package handlers + +import ( + "context" + "errors" + "testing" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + k8sfake "k8s.io/client-go/kubernetes/fake" + + "github.com/GameplanePanel/gameplane/api/internal/httperr" + "github.com/GameplanePanel/gameplane/api/internal/kube" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// T048 (unit): the root rule (case 5) of contracts/api-server-security.md, +// validateSecurityRootRule, against a fake clientset holding the switch +// ConfigMap. The envtest half is in security_overrides_root_envtest_test.go. + +const secRootNamespace = "gameplane-credentials" + +// secRootObj builds a GameServer whose spec.security is security (nil omits it). +func secRootObj(security map[string]any) *unstructured.Unstructured { + spec := map[string]any{"templateRef": map[string]any{"name": "minecraft"}} + if security != nil { + spec["security"] = security + } + return &unstructured.Unstructured{Object: map[string]any{ + "apiVersion": "gameplane.local/v1alpha1", + "kind": "GameServer", + "metadata": map[string]any{"name": "root-case", "namespace": scope.DefaultNamespace}, + "spec": spec, + }} +} + +// secRootRegistry builds a home registry. cmValue "" means no ConfigMap at +// all; "-" means the ConfigMap exists without the key. A registry with no +// client at all is built when noClient is true. +func secRootRegistry(cmValue string, noClient bool) *kube.Registry { + reg := kube.NewRegistry(scope.DefaultCluster) + reg.SetControlPlaneNamespace(secRootNamespace) + if noClient { + return reg + } + var objs []*corev1.ConfigMap + if cmValue != "" { + cm := &corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Name: securitySettingsConfigMap, Namespace: secRootNamespace}} + if cmValue != "-" { + cm.Data = map[string]string{securitySettingsKey: cmValue} + } + objs = append(objs, cm) + } + cs := k8sfake.NewSimpleClientset() + for _, cm := range objs { + if _, err := cs.CoreV1().ConfigMaps(secRootNamespace).Create(context.Background(), cm, metav1.CreateOptions{}); err != nil { + panic(err) + } + } + reg.Set(scope.DefaultCluster, &kube.Client{Typed: cs}) + return reg +} + +// secRootRefusedSetting returns the setting named by a root refusal, or "" when err is nil. +// It fails the test when err is some other error. +func secRootRefusedSetting(t *testing.T, err error) string { + t.Helper() + if err == nil { + return "" + } + var m *httperr.Message + if !errors.As(err, &m) || m.ID != "server.security.root_disabled" { + t.Fatalf("err = %v, want server.security.root_disabled", err) + } + setting, _ := m.Args["setting"].(string) + return setting +} + +func TestSecurityRootRule_Cases(t *testing.T) { + root := func(v int64) map[string]any { return map[string]any{"value": v} } + imageDefault := map[string]any{"useImageDefault": true} + + cases := []struct { + name string + cm string // "" no ConfigMap, "-" key missing, else the stored value + noClient bool + desired map[string]any + live map[string]any + wantBlock string // the setting refused, "" when accepted + }{ + {name: "new root user refused while ConfigMap absent", desired: map[string]any{"runAsUser": root(0)}, wantBlock: "runAsUser"}, + {name: "new root user refused when false", cm: "false", desired: map[string]any{"runAsUser": root(0)}, wantBlock: "runAsUser"}, + {name: "new root user accepted when true", cm: "true", desired: map[string]any{"runAsUser": root(0)}}, + {name: "only exact true is on", cm: "TRUE", desired: map[string]any{"runAsUser": root(0)}, wantBlock: "runAsUser"}, + {name: "yes is off", cm: "yes", desired: map[string]any{"runAsUser": root(0)}, wantBlock: "runAsUser"}, + {name: "key missing is off", cm: "-", desired: map[string]any{"runAsUser": root(0)}, wantBlock: "runAsUser"}, + {name: "no client is off (read error)", noClient: true, desired: map[string]any{"runAsUser": root(0)}, wantBlock: "runAsUser"}, + {name: "root group by image default refused", cm: "false", desired: map[string]any{"runAsGroup": imageDefault}, wantBlock: "runAsGroup"}, + {name: "root user by image default refused", cm: "false", desired: map[string]any{"runAsUser": imageDefault}, wantBlock: "runAsUser"}, + {name: "fsGroup value 0 refused", cm: "false", desired: map[string]any{"fsGroup": root(0)}, wantBlock: "fsGroup"}, + {name: "fsGroup image default is not root", cm: "false", desired: map[string]any{"fsGroup": imageDefault}}, + {name: "non-root user accepted while off", cm: "false", desired: map[string]any{"runAsUser": root(1000)}}, + {name: "non-root accepted without reading the ConfigMap", noClient: true, desired: map[string]any{"runAsUser": root(1000)}}, + { + name: "unchanged stored root passes while off", + cm: "false", + live: map[string]any{"runAsUser": root(0)}, desired: map[string]any{"runAsUser": root(0), "fsGroup": root(2000)}, + }, + { + name: "replacing a stored root with non-root passes while off", + cm: "false", + live: map[string]any{"runAsUser": root(0)}, desired: map[string]any{"runAsUser": root(2000)}, + }, + { + name: "removing a stored root passes while off", + cm: "false", + live: map[string]any{"runAsUser": root(0)}, desired: nil, + }, + { + name: "same root written as image default is a change and refused", + cm: "false", + live: map[string]any{"runAsUser": root(0)}, desired: map[string]any{"runAsUser": imageDefault}, + wantBlock: "runAsUser", + }, + { + name: "first offending setting in refusal order", + cm: "false", + desired: map[string]any{"fsGroup": root(0), "runAsUser": root(0)}, + wantBlock: "runAsUser", + }, + { + name: "a new root in fsGroup is refused beside an unchanged stored root", + cm: "false", + live: map[string]any{"runAsUser": root(0)}, desired: map[string]any{"runAsUser": root(0), "fsGroup": root(0)}, + wantBlock: "fsGroup", + }, + {name: "accepted once on", cm: "true", desired: map[string]any{"fsGroup": root(0), "runAsGroup": root(0)}}, + } + + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + reg := secRootRegistry(tc.cm, tc.noClient) + var live *unstructured.Unstructured + if tc.live != nil { + live = secRootObj(tc.live) + } + desired := secRootObj(tc.desired) + if tc.desired == nil { + desired = secRootObj(nil) + } + err := validateSecurityRootRule(context.Background(), reg, scope.DefaultCluster, desired, live) + if got := secRootRefusedSetting(t, err); got != tc.wantBlock { + t.Errorf("refused setting = %q, want %q (err=%v)", got, tc.wantBlock, err) + } + }) + } +} + +// A saved override with the setting off is not refused by an unrelated +// whole-spec save: the rule looks only at a new or changed root value. +func TestSecurityRootRule_UnrelatedSaveWithStoredRootPasses(t *testing.T) { + reg := secRootRegistry("false", false) + live := secRootObj(map[string]any{"runAsUser": map[string]any{"value": int64(0)}}) + desired := secRootObj(map[string]any{"runAsUser": map[string]any{"value": int64(0)}}) + desired.SetLabels(map[string]string{"sec-test": "unrelated"}) + if err := validateSecurityRootRule(context.Background(), reg, scope.DefaultCluster, desired, live); err != nil { + t.Fatalf("unrelated save with stored root = %v, want accepted", err) + } +} + +// A request in a cluster with no home control-plane namespace fails closed. +func TestSecurityRootRule_UnsetNamespaceFailsClosed(t *testing.T) { + cs := k8sfake.NewSimpleClientset(&corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{Name: securitySettingsConfigMap, Namespace: secRootNamespace}, + Data: map[string]string{securitySettingsKey: "true"}, + }) + reg := kube.NewRegistry(scope.DefaultCluster) + reg.Set(scope.DefaultCluster, &kube.Client{Typed: cs}) + desired := secRootObj(map[string]any{"runAsUser": map[string]any{"value": int64(0)}}) + err := validateSecurityRootRule(context.Background(), reg, scope.DefaultCluster, desired, nil) + if got := secRootRefusedSetting(t, err); got != "runAsUser" { + t.Errorf("unset namespace refused setting = %q, want runAsUser", got) + } +} diff --git a/api/internal/handlers/security_overrides_shape_envtest_test.go b/api/internal/handlers/security_overrides_shape_envtest_test.go new file mode 100644 index 000000000..1c4670db5 --- /dev/null +++ b/api/internal/handlers/security_overrides_shape_envtest_test.go @@ -0,0 +1,133 @@ +//go:build envtest + +package handlers + +import ( + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "testing" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// T028 envtest for the shape step (case 4) of spec.security +// (contracts/api-server-security.md). It reuses the dedicated RBAC router of +// security_overrides_envtest_test.go (secOvRouter) and the case list of +// security_overrides_shape_test.go. Each bad shape must be refused with 422 +// server.security.invalid, name the setting in args, and create nothing. + +// shapeProblemArgs decodes the args of an RFC 9457 refusal. +func shapeProblemArgs(t *testing.T, rr *httptest.ResponseRecorder) map[string]any { + t.Helper() + var doc struct { + Args map[string]any `json:"args"` + } + if err := json.Unmarshal(rr.Body.Bytes(), &doc); err != nil { + t.Fatalf("decode problem body: %v", err) + } + return doc.Args +} + +// TestSecurityOverrideShape_CreateInvalidRefused posts each bad shape as an +// admin and checks the 422, the args and that no server was created. +func TestSecurityOverrideShape_CreateInvalidRefused(t *testing.T) { + r := secOvRouter(t) + for _, tc := range shapeInvalidCases() { + t.Run(tc.name, func(t *testing.T) { + name := uniqueResourceName("sec-shape") + t.Cleanup(func() { + _ = kubeC.Dynamic.Resource(gvrServers()). + Namespace(scope.DefaultNamespace). + Delete(context.Background(), name, metav1.DeleteOptions{}) + }) + + rr := secOvDo(t, r, adminUser(), http.MethodPost, "/servers", + secOvPutBody(name, tc.block, nil)) + if rr.Code != http.StatusUnprocessableEntity { + t.Fatalf("POST %v = %d, want 422; body=%s", tc.block, rr.Code, rr.Body.String()) + } + if id := secOvProblemID(t, rr); id != "server.security.invalid" { + t.Errorf("messageId = %q, want server.security.invalid", id) + } + if got := shapeProblemArgs(t, rr)["setting"]; got != tc.setting { + t.Errorf("args.setting = %v, want %q", got, tc.setting) + } + if _, err := kubeC.Dynamic.Resource(gvrServers()). + Namespace(scope.DefaultNamespace). + Get(t.Context(), name, metav1.GetOptions{}); err == nil { + t.Error("refused create left a server behind") + } + }) + } +} + +// TestSecurityOverrideShape_UpdateInvalidRefused puts a bad shape over an +// existing server as an admin. The refusal must leave the stored object as it +// was (no override). +func TestSecurityOverrideShape_UpdateInvalidRefused(t *testing.T) { + r := secOvRouter(t) + name := uniqueResourceName("sec-shape-upd") + secOvFixture(t, name, nil) + + bad := map[string]any{"runAsUser": map[string]any{"value": float64(4294967296)}} + rr := secOvDo(t, r, adminUser(), http.MethodPut, "/servers/"+name, + secOvPutBody(name, bad, nil)) + if rr.Code != http.StatusUnprocessableEntity { + t.Fatalf("PUT bad shape = %d, want 422; body=%s", rr.Code, rr.Body.String()) + } + if id := secOvProblemID(t, rr); id != "server.security.invalid" { + t.Errorf("messageId = %q, want server.security.invalid", id) + } + if got := shapeProblemArgs(t, rr)["setting"]; got != "runAsUser" { + t.Errorf("args.setting = %v, want runAsUser", got) + } + if _, found := secOvStoredSecurity(t, name); found { + t.Error("refused update changed the stored spec.security") + } +} + +// TestSecurityOverrideShape_ValidStored creates a server with a valid override +// as an admin, checks the 201 response carries it, and reads it back from the +// cluster. +func TestSecurityOverrideShape_ValidStored(t *testing.T) { + r := secOvRouter(t) + name := uniqueResourceName("sec-shape-ok") + t.Cleanup(func() { + _ = kubeC.Dynamic.Resource(gvrServers()). + Namespace(scope.DefaultNamespace). + Delete(context.Background(), name, metav1.DeleteOptions{}) + }) + + valid := map[string]any{"runAsUser": map[string]any{"value": float64(2000)}} + rr := secOvDo(t, r, adminUser(), http.MethodPost, "/servers", + secOvPutBody(name, valid, nil)) + if rr.Code != http.StatusCreated { + t.Fatalf("POST valid override = %d, want 201; body=%s", rr.Code, rr.Body.String()) + } + + var got struct { + Spec struct { + Security map[string]any `json:"security"` + } `json:"spec"` + } + if err := json.Unmarshal(rr.Body.Bytes(), &got); err != nil { + t.Fatalf("decode response: %v", err) + } + ru, _ := got.Spec.Security["runAsUser"].(map[string]any) + if ru["value"] != float64(2000) { + t.Errorf("response runAsUser = %v, want value 2000", got.Spec.Security["runAsUser"]) + } + + stored, found := secOvStoredSecurity(t, name) + if !found { + t.Fatal("valid override was not stored") + } + sru, _ := stored["runAsUser"].(map[string]any) + if sru["value"] != int64(2000) { + t.Errorf("stored runAsUser = %v, want value 2000", stored["runAsUser"]) + } +} diff --git a/api/internal/handlers/security_overrides_shape_test.go b/api/internal/handlers/security_overrides_shape_test.go new file mode 100644 index 000000000..0aa21dd70 --- /dev/null +++ b/api/internal/handlers/security_overrides_shape_test.go @@ -0,0 +1,166 @@ +package handlers + +import ( + "errors" + "testing" + + "github.com/GameplanePanel/gameplane/api/internal/httperr" +) + +// T028 unit tests for the shape step (case 4) of validateSecurityOverride +// (contracts/api-server-security.md). Like security_overrides_test.go, no +// cluster is involved: the function is called directly with an admin context +// and plain unstructured maps. Requests decode numbers as float64. + +// shapeInvalidCase is one request block that must be refused with 422. +type shapeInvalidCase struct { + name string + block map[string]any + setting string +} + +func shapeInvalidCases() []shapeInvalidCase { + return []shapeInvalidCase{ + { + name: "value above range", + block: map[string]any{"fsGroup": map[string]any{"value": float64(4294967296)}}, + setting: "fsGroup", + }, + { + name: "negative value", + block: map[string]any{"runAsUser": map[string]any{"value": float64(-1)}}, + setting: "runAsUser", + }, + { + name: "non-integer value", + block: map[string]any{"runAsGroup": map[string]any{"value": float64(1.5)}}, + setting: "runAsGroup", + }, + { + name: "string value", + block: map[string]any{"runAsUser": map[string]any{"value": "2000"}}, + setting: "runAsUser", + }, + { + name: "both value and useImageDefault", + block: map[string]any{"runAsUser": map[string]any{ + "value": float64(2000), + "useImageDefault": true, + }}, + setting: "runAsUser", + }, + { + name: "neither value nor useImageDefault", + block: map[string]any{"runAsGroup": map[string]any{}}, + setting: "runAsGroup", + }, + { + name: "useImageDefault false", + block: map[string]any{"fsGroup": map[string]any{"useImageDefault": false}}, + setting: "fsGroup", + }, + { + name: "unknown member inside an id", + block: map[string]any{"runAsUser": map[string]any{ + "value": float64(2000), + "extra": true, + }}, + setting: "runAsUser", + }, + { + name: "unknown top-level member", + block: map[string]any{"bogus": map[string]any{"value": float64(1)}}, + setting: "bogus", + }, + { + name: "bad volumeOwnershipCheck enum", + block: map[string]any{"volumeOwnershipCheck": "Sometimes"}, + setting: "volumeOwnershipCheck", + }, + } +} + +// TestSecurityOverrideShape_InvalidRefusedWith422 checks that each bad shape +// is refused with server.security.invalid, status 422 and the offending +// setting in args, for an admin (so case 3 cannot hide the shape error). +func TestSecurityOverrideShape_InvalidRefusedWith422(t *testing.T) { + for _, tc := range shapeInvalidCases() { + t.Run(tc.name, func(t *testing.T) { + desired := secOverrideObj(tc.block) + err := validateSecurityOverride(secOverrideCtx(secOverrideAdmin()), "cl", "gameplane", desired, nil) + if err == nil { + t.Fatalf("shape %v accepted, want refusal", tc.block) + } + var m *httperr.Message + if !errors.As(err, &m) { + t.Fatalf("error %T is not an httperr.Message: %v", err, err) + } + if m.ID != "server.security.invalid" { + t.Errorf("ID = %q, want server.security.invalid", m.ID) + } + if m.Status != 422 { + t.Errorf("Status = %d, want 422", m.Status) + } + if got := m.Args["setting"]; got != tc.setting { + t.Errorf("args.setting = %v, want %q", got, tc.setting) + } + if detail, ok := m.Args["detail"].(string); !ok || detail == "" { + t.Errorf("args.detail = %v, want a non-empty string", m.Args["detail"]) + } + }) + } +} + +// TestSecurityOverrideShape_ValidAccepted checks shapes that must pass, +// including the int64 numbers the dynamic client returns and the range bounds. +func TestSecurityOverrideShape_ValidAccepted(t *testing.T) { + valid := map[string]map[string]any{ + "value 2000": {"runAsUser": map[string]any{"value": float64(2000)}}, + "value 0 is root but a valid shape": { + "runAsUser": map[string]any{"value": float64(0)}, + }, + "upper bound": {"fsGroup": map[string]any{"value": float64(4294967295)}}, + "int64 value": {"runAsGroup": map[string]any{"value": int64(1000)}}, + "use image default": { + "runAsGroup": map[string]any{"useImageDefault": true}, + }, + "ownership check": { + "runAsUser": map[string]any{"value": float64(2000)}, + "volumeOwnershipCheck": "OnlyWhenWrong", + }, + "null id counts as absent": { + "fsGroup": nil, + }, + } + for name, block := range valid { + t.Run(name, func(t *testing.T) { + desired := secOverrideObj(block) + if err := validateSecurityOverride(secOverrideCtx(secOverrideAdmin()), "cl", "gameplane", desired, nil); err != nil { + t.Fatalf("shape %v refused: %v", block, err) + } + }) + } +} + +// TestSecurityOverrideShape_ForbiddenBeforeShape checks the order: a caller +// without servers:security gets 403 for a bad shape, not 422. +func TestSecurityOverrideShape_ForbiddenBeforeShape(t *testing.T) { + desired := secOverrideObj(map[string]any{"runAsUser": map[string]any{"value": float64(-1)}}) + err := validateSecurityOverride(secOverrideCtx(secOverrideWriter()), "cl", "gameplane", desired, nil) + var m *httperr.Message + if !errors.As(err, &m) || m.ID != "server.security.forbidden" { + t.Fatalf("error = %v, want server.security.forbidden", err) + } +} + +// TestSecurityOverrideShape_UnchangedNotChecked checks that an unchanged stored +// block is accepted without a shape check (case 1 runs first). +func TestSecurityOverrideShape_UnchangedNotChecked(t *testing.T) { + block := map[string]any{"runAsUser": map[string]any{"value": float64(-1)}} + stored := map[string]any{"runAsUser": map[string]any{"value": int64(-1)}} + desired := secOverrideObj(block) + live := secOverrideObj(stored) + if err := validateSecurityOverride(secOverrideCtx(secOverrideAdmin()), "cl", "gameplane", desired, live); err != nil { + t.Fatalf("unchanged block refused: %v", err) + } +} diff --git a/api/internal/handlers/security_overrides_test.go b/api/internal/handlers/security_overrides_test.go new file mode 100644 index 000000000..df05bebe4 --- /dev/null +++ b/api/internal/handlers/security_overrides_test.go @@ -0,0 +1,214 @@ +package handlers + +import ( + "context" + "errors" + "testing" + + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + + "github.com/GameplanePanel/gameplane/api/internal/auth" + "github.com/GameplanePanel/gameplane/api/internal/httperr" +) + +// Unit tests for validateSecurityOverride (T012 cases 1 to 3, T013). +// No cluster is involved: the function is called directly with a context +// that carries the test user, and the objects are plain unstructured maps. + +// secOverrideObj builds a GameServer-shaped object whose spec.security is +// security. A nil security leaves the field absent. +func secOverrideObj(security map[string]any) *unstructured.Unstructured { + spec := map[string]any{"templateRef": map[string]any{"name": "minecraft"}} + if security != nil { + spec["security"] = security + } + return &unstructured.Unstructured{Object: map[string]any{ + "apiVersion": "gameplane.local/v1alpha1", + "kind": "GameServer", + "metadata": map[string]any{"name": "sec-unit", "namespace": "gameplane"}, + "spec": spec, + }} +} + +// secOverrideCtx returns a context carrying u (nil means no user). +func secOverrideCtx(u *auth.User) context.Context { + ctx := context.Background() + if u == nil { + return ctx + } + return auth.WithUser(ctx, u) +} + +// secOverrideWriter holds servers:write only. +func secOverrideWriter() *auth.User { + return &auth.User{ + ID: 201, + Username: "sec-writer", + Role: "operator", + Perms: map[string]map[string]map[string]struct{}{ + "*": {"*": {"servers:write": {}}}, + }, + } +} + +// secOverrideSecurityHolder holds servers:write and servers:security. +func secOverrideSecurityHolder() *auth.User { + return &auth.User{ + ID: 202, + Username: "sec-holder", + Role: "operator", + Perms: map[string]map[string]map[string]struct{}{ + "*": {"*": {"servers:write": {}, "servers:security": {}}}, + }, + } +} + +// secOverrideAdmin is the built-in admin wildcard. +func secOverrideAdmin() *auth.User { + return &auth.User{ + ID: 203, + Username: "sec-admin", + Role: "admin", + Perms: map[string]map[string]map[string]struct{}{ + "*": {"*": {"*": {}}}, + }, + } +} + +// secOverrideStored is a non-root override as stored by the dynamic +// client (int64 numbers). +func secOverrideStored() map[string]any { + return map[string]any{ + "runAsUser": map[string]any{"value": int64(2000)}, + "volumeOwnershipCheck": "EveryStart", + } +} + +// secOverrideRequested is the same override as a request body decodes it +// (float64 numbers). +func secOverrideRequested() map[string]any { + return map[string]any{ + "runAsUser": map[string]any{"value": float64(2000)}, + "volumeOwnershipCheck": "EveryStart", + } +} + +func TestSecurityOverride_Case1_UnchangedAcceptedWithoutPermission(t *testing.T) { + ctx := secOverrideCtx(secOverrideWriter()) + + t.Run("both absent", func(t *testing.T) { + desired := secOverrideObj(nil) + live := secOverrideObj(nil) + if err := validateSecurityOverride(ctx, "", "gameplane", desired, live); err != nil { + t.Fatalf("both absent: unexpected error %v", err) + } + }) + + t.Run("equal with int64 live and float64 request", func(t *testing.T) { + desired := secOverrideObj(secOverrideRequested()) + live := secOverrideObj(secOverrideStored()) + if err := validateSecurityOverride(ctx, "", "gameplane", desired, live); err != nil { + t.Fatalf("equal values: unexpected error %v", err) + } + // The request value must not have been rewritten. + got, _, _ := unstructured.NestedFieldNoCopy(desired.Object, "spec", "security", "runAsUser", "value") + if got != float64(2000) { + t.Errorf("request value rewritten: got %#v", got) + } + }) + + t.Run("numeric equality is not a change", func(t *testing.T) { + if !securityValuesEqual(map[string]any{"value": float64(2000)}, map[string]any{"value": int64(2000)}) { + t.Error("float64 2000 and int64 2000 compared unequal") + } + if securityValuesEqual(map[string]any{"value": float64(2001)}, map[string]any{"value": int64(2000)}) { + t.Error("float64 2001 and int64 2000 compared equal") + } + }) +} + +func TestSecurityOverride_Case2_AbsentInRequestIsRestored(t *testing.T) { + ctx := secOverrideCtx(secOverrideWriter()) + desired := secOverrideObj(nil) + live := secOverrideObj(secOverrideStored()) + + if err := validateSecurityOverride(ctx, "", "gameplane", desired, live); err != nil { + t.Fatalf("restore: unexpected error %v", err) + } + got, found, err := unstructured.NestedMap(desired.Object, "spec", "security") + if err != nil { + t.Fatalf("read restored spec.security: %v", err) + } + if !found { + t.Fatal("spec.security not restored into the request") + } + if got["volumeOwnershipCheck"] != "EveryStart" { + t.Errorf("restored volumeOwnershipCheck = %#v, want EveryStart", got["volumeOwnershipCheck"]) + } + if !securityValuesEqual(got, secOverrideStored()) { + t.Errorf("restored value %#v differs from stored %#v", got, secOverrideStored()) + } +} + +func TestSecurityOverride_Case2_HolderMayRemove(t *testing.T) { + ctx := secOverrideCtx(secOverrideSecurityHolder()) + desired := secOverrideObj(nil) + live := secOverrideObj(secOverrideStored()) + + if err := validateSecurityOverride(ctx, "", "gameplane", desired, live); err != nil { + t.Fatalf("holder removing override: unexpected error %v", err) + } + if _, found, _ := unstructured.NestedFieldNoCopy(desired.Object, "spec", "security"); found { + t.Error("holder removal was overwritten by the restore step") + } +} + +func TestSecurityOverride_Case3_ForbiddenWithoutPermission(t *testing.T) { + stored := secOverrideStored() + changed := map[string]any{"runAsUser": map[string]any{"value": float64(3000)}} + + cases := []struct { + name string + user *auth.User + desired *unstructured.Unstructured + live *unstructured.Unstructured + }{ + {"create with override", secOverrideWriter(), secOverrideObj(secOverrideRequested()), nil}, + {"update changed override", secOverrideWriter(), secOverrideObj(changed), secOverrideObj(stored)}, + {"clone with override (live nil)", secOverrideWriter(), secOverrideObj(secOverrideRequested()), nil}, + {"no user at all", nil, secOverrideObj(secOverrideRequested()), nil}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + err := validateSecurityOverride(secOverrideCtx(tc.user), "", "gameplane", tc.desired, tc.live) + if err == nil { + t.Fatal("expected server.security.forbidden, got nil") + } + var msg *httperr.Message + if !errors.As(err, &msg) { + t.Fatalf("error %T is not *httperr.Message: %v", err, err) + } + if msg.ID != "server.security.forbidden" { + t.Errorf("message id = %q, want server.security.forbidden", msg.ID) + } + if msg.Status != 403 { + t.Errorf("status = %d, want 403", msg.Status) + } + }) + } +} + +func TestSecurityOverride_Case3_AdminAndHolderAllowed(t *testing.T) { + stored := secOverrideStored() + changed := map[string]any{"runAsUser": map[string]any{"value": float64(3000)}} + + for _, u := range []*auth.User{secOverrideAdmin(), secOverrideSecurityHolder()} { + ctx := secOverrideCtx(u) + if err := validateSecurityOverride(ctx, "", "gameplane", secOverrideObj(changed), secOverrideObj(stored)); err != nil { + t.Errorf("user %s update: unexpected error %v", u.Username, err) + } + if err := validateSecurityOverride(ctx, "", "gameplane", secOverrideObj(secOverrideRequested()), nil); err != nil { + t.Errorf("user %s create: unexpected error %v", u.Username, err) + } + } +} diff --git a/api/internal/handlers/security_settings.go b/api/internal/handlers/security_settings.go new file mode 100644 index 000000000..eedd5ffd1 --- /dev/null +++ b/api/internal/handlers/security_settings.go @@ -0,0 +1,263 @@ +package handlers + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io" + "log/slog" + "net/http" + + "github.com/go-chi/chi/v5" + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + + "github.com/GameplanePanel/gameplane/api/internal/audit" + "github.com/GameplanePanel/gameplane/api/internal/httperr" + "github.com/GameplanePanel/gameplane/api/internal/kube" + "github.com/GameplanePanel/gameplane/api/internal/messages" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// The per-cluster "allow root overrides" switch (spec 030, OD-7 C). Its only +// store is one ConfigMap in the cluster's operator control-plane namespace. +// The API reads it and updates it by name; it never creates it (Helm does). +const ( + securitySettingsConfigMap = "gameplane-security-settings" + securitySettingsKey = "allowRootOverrides" + // defaultRemoteControlPlaneNamespace is used for a remote cluster whose + // registration carries no spec.controlPlaneNamespace (OD-10 A). + defaultRemoteControlPlaneNamespace = "gameplane" +) + +// securitySettingsNamespace returns the namespace of cluster cl's switch +// ConfigMap. The home cluster uses the registry's control-plane namespace; a +// remote cluster uses the namespace on its Cluster registration. +func securitySettingsNamespace(ctx context.Context, reg *kube.Registry, cl string) (string, error) { + if cl == reg.DefaultID() { + ns := reg.ControlPlaneNamespace() + if ns == "" { + return "", errors.New("home control-plane namespace is not configured") + } + return ns, nil + } + // Clusters() is nil-safe; a nil store means registrations cannot be read. + store := reg.Management().Clusters() + if store == nil { + return "", errors.New("cluster registrations are unavailable") + } + registration, err := store.Get(ctx, cl, metav1.GetOptions{}) + if err != nil { + return "", fmt.Errorf("read cluster %s registration: %w", cl, err) + } + ns, _, _ := unstructured.NestedString(registration.Object, "spec", "controlPlaneNamespace") + if ns == "" { + ns = defaultRemoteControlPlaneNamespace + } + return ns, nil +} + +// securitySettingsClient returns the client of cluster cl. +func securitySettingsClient(reg *kube.Registry, cl string) (*kube.Client, error) { + c, ok := reg.Get(cl) + if !ok || c == nil || c.Typed == nil { + return nil, fmt.Errorf("cluster %s has no client", cl) + } + return c, nil +} + +// getSecuritySettingsConfigMap reads the switch ConfigMap of cluster cl. It +// returns a nil ConfigMap (and no error) when the ConfigMap is not found. +func getSecuritySettingsConfigMap(ctx context.Context, reg *kube.Registry, cl string) (*corev1.ConfigMap, string, error) { + ns, err := securitySettingsNamespace(ctx, reg, cl) + if err != nil { + return nil, "", err + } + c, err := securitySettingsClient(reg, cl) + if err != nil { + return nil, ns, err + } + cm, err := c.Typed.CoreV1().ConfigMaps(ns).Get(ctx, securitySettingsConfigMap, metav1.GetOptions{}) + if apierrors.IsNotFound(err) { + return nil, ns, nil + } + if err != nil { + return nil, ns, fmt.Errorf("read %s/%s: %w", ns, securitySettingsConfigMap, err) + } + return cm, ns, nil +} + +// securityRootAllowed reports whether cluster cl allows root overrides. Only +// the exact value "true" is on. A missing ConfigMap, a missing key, any other +// value and any read error all read as off, with the error returned so the +// caller can refuse the request. +func securityRootAllowed(ctx context.Context, reg *kube.Registry, cl string) (bool, error) { + cm, _, err := getSecuritySettingsConfigMap(ctx, reg, cl) + if err != nil { + return false, err + } + if cm == nil { + return false, nil + } + return cm.Data[securitySettingsKey] == "true", nil +} + +// securitySettingsBody is the GET and PUT response (contracts/cluster-setting.md). +type securitySettingsBody struct { + Cluster string `json:"cluster"` + AllowRootOverrides bool `json:"allowRootOverrides"` + Present bool `json:"present"` +} + +// securitySettingsHandler serves GET and PUT /security-settings?cluster=. +type securitySettingsHandler struct { + reg *kube.Registry + auditor *audit.Auditor +} + +// MountSecuritySettings wires the per-cluster allow-root-overrides switch: +// GET /security-settings (config:read) and PUT /security-settings +// (config:manage). The cluster is chosen with ?cluster= as for +// /backup-destinations. +func MountSecuritySettings(r chi.Router, reg *kube.Registry, auditor *audit.Auditor) { + h := securitySettingsHandler{reg: reg, auditor: auditor} + r.Route("/security-settings", func(r chi.Router) { + r.Get("/", h.get) + r.Put("/", h.put) + }) +} + +// securitySettingsCluster resolves ?cluster= and writes the refusal when the +// cluster is not known to the caller's registry. +func securitySettingsCluster(w http.ResponseWriter, req *http.Request, reg *kube.Registry) (string, bool) { + if _, ok := resolveCluster(w, req, reg); !ok { + return "", false + } + return scope.RequestedCluster(req), true +} + +func (h securitySettingsHandler) get(w http.ResponseWriter, req *http.Request) { + cl, ok := securitySettingsCluster(w, req, h.reg) + if !ok { + return + } + cm, _, err := getSecuritySettingsConfigMap(req.Context(), h.reg, cl) + if err != nil { + httperr.WriteCode(w, req, http.StatusBadGateway, err) + return + } + if cm == nil { + writeJSON(w, securitySettingsBody{Cluster: cl}) + return + } + writeJSON(w, securitySettingsBody{ + Cluster: cl, + AllowRootOverrides: cm.Data[securitySettingsKey] == "true", + Present: true, + }) +} + +// decodeAllowRootOverrides reads {"allowRootOverrides": bool}. Other members +// are ignored. A missing or non-boolean value is an error. +func decodeAllowRootOverrides(body []byte) (bool, error) { + var raw map[string]any + if err := json.Unmarshal(body, &raw); err != nil { + return false, fmt.Errorf("body must be a JSON object: %w", err) + } + v, ok := raw[securitySettingsKey].(bool) + if !ok { + return false, errors.New("allowRootOverrides must be true or false") + } + return v, nil +} + +// writeSecurityAudit writes one security row with WriteSync. The caller decides +// what a failure means. A nil auditor skips auditing (test routers). +func (h securitySettingsHandler) writeSecurityAudit(ctx context.Context, target, reason string, status int) error { + if h.auditor == nil { + return nil + } + return h.auditor.WriteSync(ctx, http.MethodPut, "/security-settings", target, reason, status) +} + +func onOff(v bool) string { + if v { + return "true" + } + return "false" +} + +// put follows the order in contracts/cluster-setting.md: the ConfigMap must +// exist, an unchanged value writes nothing, a change writes the audit row +// first, then updates the ConfigMap. +func (h securitySettingsHandler) put(w http.ResponseWriter, req *http.Request) { + cl, ok := securitySettingsCluster(w, req, h.reg) + if !ok { + return + } + body, err := io.ReadAll(req.Body) + if err != nil { + httperr.WriteMessage(w, req, messages.New("server.config.read_body", nil)) + return + } + if len(body) == 0 { + httperr.WriteMessage(w, req, messages.New("server.empty_body", nil)) + return + } + want, err := decodeAllowRootOverrides(body) + if err != nil { + httperr.WriteCode(w, req, http.StatusUnprocessableEntity, err) + return + } + + cm, ns, err := getSecuritySettingsConfigMap(req.Context(), h.reg, cl) + if err != nil { + httperr.WriteCode(w, req, http.StatusBadGateway, err) + return + } + if cm == nil { + httperr.WriteMessage(w, req, messages.New("server.cluster.security_settings_missing", nil)) + return + } + current := cm.Data[securitySettingsKey] == "true" + if current == want { + writeJSON(w, securitySettingsBody{Cluster: cl, AllowRootOverrides: current, Present: true}) + return + } + + // Resolve the client before the flip row, so a row is never written for a + // change that cannot even be attempted. + c, err := securitySettingsClient(h.reg, cl) + if err != nil { + httperr.WriteCode(w, req, http.StatusBadGateway, err) + return + } + + target := "security/" + cl + reason := fmt.Sprintf("%s:%s->%s", securitySettingsKey, onOff(current), onOff(want)) + if err := h.writeSecurityAudit(req.Context(), target, reason, http.StatusOK); err != nil { + httperr.WriteCode(w, req, http.StatusInternalServerError, errors.New("audit write failed")) + return + } + audit.MarkRecorded(req.Context()) + + updated := cm.DeepCopy() + if updated.Data == nil { + updated.Data = map[string]string{} + } + updated.Data[securitySettingsKey] = onOff(want) + if _, err := c.Typed.CoreV1().ConfigMaps(ns).Update(req.Context(), updated, metav1.UpdateOptions{}); err != nil { + // The change was attempted and not stored: record that too. If this row + // cannot be written the first row stands, the error is logged, and the + // reply does not change (contracts/audit-events.md, write order). + if werr := h.writeSecurityAudit(req.Context(), target, "security_save_failed", http.StatusBadGateway); werr != nil { + slog.Warn("security_save_failed audit row not written", "target", target, "err", werr) + } + httperr.WriteCode(w, req, http.StatusBadGateway, fmt.Errorf("update %s/%s: %w", ns, securitySettingsConfigMap, err)) + return + } + writeJSON(w, securitySettingsBody{Cluster: cl, AllowRootOverrides: want, Present: true}) +} diff --git a/api/internal/handlers/security_settings_envtest_test.go b/api/internal/handlers/security_settings_envtest_test.go new file mode 100644 index 000000000..028035a94 --- /dev/null +++ b/api/internal/handlers/security_settings_envtest_test.go @@ -0,0 +1,168 @@ +//go:build envtest + +package handlers + +import ( + "context" + "net/http" + "net/http/httptest" + "strings" + "testing" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/GameplanePanel/gameplane/api/internal/auth" + "github.com/GameplanePanel/gameplane/api/internal/kube" + "github.com/GameplanePanel/gameplane/api/internal/rbac" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// T047 (envtest): GET and PUT /security-settings against the envtest +// apiserver. The router is dedicated and carries rbac.Middleware and the audit +// middleware (secAuditSetup in security_overrides_audit_envtest_test.go), never +// the shared mountedR. The ConfigMap writes are real. + +// secSetViewer holds config:read and deliberately not config:manage. +func secSetViewer() *auth.User { + return &auth.User{ + ID: 401, + Username: "sec-setting-viewer", + Role: rbac.RoleViewer, + Perms: map[string]map[string]map[string]struct{}{ + "*": {"*": {"config:read": {}}}, + }, + } +} + +// secSetEnvDo sends method with a raw body to /security-settings?cluster= +// as u (nil for no user). +func secSetEnvDo(t *testing.T, h http.Handler, u *auth.User, method, body string) *httptest.ResponseRecorder { + t.Helper() + ctx := t.Context() + if u != nil { + ctx = auth.WithUser(ctx, u) + } + req := httptest.NewRequestWithContext(ctx, method, + "/security-settings?cluster="+scope.DefaultCluster, strings.NewReader(body)) + req.Header.Set("Accept", "application/problem+json") + rr := httptest.NewRecorder() + h.ServeHTTP(rr, req) + return rr +} + +// secSetFlipRows returns the rows of the switch's own target. +func secSetFlipRows(t *testing.T, env *secAuditEnv) []secAuditRow { + t.Helper() + return secAuditRows(t, env.store, "target = ?", "security/"+scope.DefaultCluster) +} + +func TestSecuritySettingsEnv_RoundTripAndFlipRow(t *testing.T) { + env := secAuditSetup(t, kubeC) + env.putConfigMap(t, "false") + + rr := secSetEnvDo(t, env.r, secSetViewer(), http.MethodGet, "") + if rr.Code != http.StatusOK || !strings.Contains(rr.Body.String(), `"present":true`) || + !strings.Contains(rr.Body.String(), `"allowRootOverrides":false`) { + t.Fatalf("GET = %d %s, want allowRootOverrides false and present true", rr.Code, rr.Body.String()) + } + + rr = secSetEnvDo(t, env.r, adminUser(), http.MethodPut, `{"allowRootOverrides":true}`) + if rr.Code != http.StatusOK { + t.Fatalf("admin PUT true = %d, want 200; body=%s", rr.Code, rr.Body.String()) + } + if got := env.configMapValue(t); got != "true" { + t.Errorf("ConfigMap after flip = %q, want \"true\"", got) + } + rows := secSetFlipRows(t, env) + if len(rows) != 1 || rows[0].Method != http.MethodPut || rows[0].Path != "/security-settings" || + rows[0].Reason != "allowRootOverrides:false->true" || rows[0].Status != http.StatusOK { + t.Fatalf("flip rows = %+v, want one allowRootOverrides:false->true row", rows) + } + + rr = secSetEnvDo(t, env.r, secSetViewer(), http.MethodGet, "") + if !strings.Contains(rr.Body.String(), `"allowRootOverrides":true`) { + t.Errorf("GET after flip = %s, want allowRootOverrides true", rr.Body.String()) + } + + // An unchanged value writes nothing and adds no row. + rr = secSetEnvDo(t, env.r, adminUser(), http.MethodPut, `{"allowRootOverrides":true}`) + if rr.Code != http.StatusOK { + t.Fatalf("unchanged PUT = %d, want 200", rr.Code) + } + if n := len(secSetFlipRows(t, env)); n != 1 { + t.Errorf("flip rows after unchanged PUT = %d, want 1", n) + } +} + +func TestSecuritySettingsEnv_GETMissingReportsNotPresent(t *testing.T) { + env := secAuditSetup(t, kubeC) + rr := secSetEnvDo(t, env.r, secSetViewer(), http.MethodGet, "") + if rr.Code != http.StatusOK || !strings.Contains(rr.Body.String(), `"present":false`) { + t.Fatalf("GET missing = %d %s, want present false", rr.Code, rr.Body.String()) + } +} + +func TestSecuritySettingsEnv_ViewerPUTForbidden(t *testing.T) { + env := secAuditSetup(t, kubeC) + env.putConfigMap(t, "false") + + rr := secSetEnvDo(t, env.r, secSetViewer(), http.MethodPut, `{"allowRootOverrides":true}`) + if rr.Code != http.StatusForbidden { + t.Fatalf("viewer PUT = %d, want 403; body=%s", rr.Code, rr.Body.String()) + } + if got := env.configMapValue(t); got != "false" { + t.Errorf("ConfigMap after refused PUT = %q, want \"false\"", got) + } + if n := len(secSetFlipRows(t, env)); n != 0 { + t.Errorf("flip rows after refused PUT = %d, want 0", n) + } +} + +func TestSecuritySettingsEnv_MissingConfigMap409NoRowNoCreate(t *testing.T) { + env := secAuditSetup(t, kubeC) + + rr := secSetEnvDo(t, env.r, adminUser(), http.MethodPut, `{"allowRootOverrides":true}`) + if rr.Code != http.StatusConflict { + t.Fatalf("PUT with missing ConfigMap = %d, want 409; body=%s", rr.Code, rr.Body.String()) + } + if n := len(secSetFlipRows(t, env)); n != 0 { + t.Errorf("flip rows with missing ConfigMap = %d, want 0", n) + } + if _, err := kubeC.Typed.CoreV1().ConfigMaps(env.ns).Get(context.Background(), + securitySettingsConfigMap, metav1.GetOptions{}); err == nil { + t.Error("PUT created the switch ConfigMap; nothing may create it") + } +} + +func TestSecuritySettingsEnv_AuditFailureLeavesValue(t *testing.T) { + env := secAuditSetup(t, kubeC) + env.putConfigMap(t, "false") + secAuditFailOn(t, env.store, "allowRootOverrides:%") + + rr := secSetEnvDo(t, env.r, adminUser(), http.MethodPut, `{"allowRootOverrides":true}`) + if rr.Code != http.StatusInternalServerError { + t.Fatalf("PUT with failing audit = %d, want 500; body=%s", rr.Code, rr.Body.String()) + } + if got := env.configMapValue(t); got != "false" { + t.Errorf("ConfigMap after failed audit = %q, want \"false\"", got) + } +} + +func TestSecuritySettingsEnv_UpdateFailureWritesSaveFailed(t *testing.T) { + failing := &kube.Client{Dynamic: kubeC.Dynamic, Typed: secAuditFailUpdateTyped{kubeC.Typed}} + env := secAuditSetup(t, failing) + env.putConfigMap(t, "false") + + rr := secSetEnvDo(t, env.r, adminUser(), http.MethodPut, `{"allowRootOverrides":true}`) + if rr.Code != http.StatusBadGateway { + t.Fatalf("PUT with failing update = %d, want 502; body=%s", rr.Code, rr.Body.String()) + } + if got := env.configMapValue(t); got != "false" { + t.Errorf("ConfigMap after failed update = %q, want \"false\"", got) + } + rows := secSetFlipRows(t, env) + if len(rows) != 2 || rows[0].Reason != "allowRootOverrides:false->true" || rows[0].Status != http.StatusOK || + rows[1].Reason != "security_save_failed" || rows[1].Status != http.StatusBadGateway { + t.Fatalf("flip rows = %+v, want the flip row then security_save_failed (502)", rows) + } +} diff --git a/api/internal/handlers/security_settings_test.go b/api/internal/handlers/security_settings_test.go new file mode 100644 index 000000000..0f6e88820 --- /dev/null +++ b/api/internal/handlers/security_settings_test.go @@ -0,0 +1,295 @@ +package handlers + +import ( + "context" + "encoding/json" + "errors" + "net/http" + "net/http/httptest" + "strings" + "testing" + + "github.com/go-chi/chi/v5" + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + k8sfake "k8s.io/client-go/kubernetes/fake" + k8stesting "k8s.io/client-go/testing" + + "github.com/GameplanePanel/gameplane/api/internal/kube" + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// T047 (unit): the per-cluster allow-root-overrides switch, GET and PUT +// /security-settings, against a fake clientset. No rbac middleware here; the +// permission matrix is in security_settings_envtest_test.go. + +const secSetNamespace = "gameplane-credentials" + +// secSetRegistry builds a registry whose home cluster is backed by a fake +// clientset seeded with objs, with the home control-plane namespace set. +func secSetRegistry(objs ...runtime.Object) (*kube.Registry, *k8sfake.Clientset) { + cs := k8sfake.NewSimpleClientset(objs...) + reg := kube.NewRegistry(scope.DefaultCluster) + reg.Set(scope.DefaultCluster, &kube.Client{Typed: cs}) + reg.SetControlPlaneNamespace(secSetNamespace) + return reg, cs +} + +// secSetConfigMap is the switch ConfigMap with the given value. +func secSetConfigMap(value string) *corev1.ConfigMap { + return &corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{Name: securitySettingsConfigMap, Namespace: secSetNamespace}, + Data: map[string]string{securitySettingsKey: value}, + } +} + +// secSetRouter mounts the handler on a bare router without auditor. +func secSetRouter(reg *kube.Registry) http.Handler { + r := chi.NewRouter() + MountSecuritySettings(r, reg, nil) + return r +} + +// secSetDo sends method with body to /security-settings and returns the response. +func secSetDo(h http.Handler, method, body string) *httptest.ResponseRecorder { + req := httptest.NewRequestWithContext(context.Background(), method, "/security-settings", strings.NewReader(body)) + req.Header.Set("Accept", "application/problem+json") + rr := httptest.NewRecorder() + h.ServeHTTP(rr, req) + return rr +} + +// secSetMessageID decodes the messageId of an RFC 9457 response. +func secSetMessageID(t *testing.T, rr *httptest.ResponseRecorder) string { + t.Helper() + var doc struct { + MessageID string `json:"messageId"` + } + if err := json.Unmarshal(rr.Body.Bytes(), &doc); err != nil { + t.Fatalf("decode problem body %q: %v", rr.Body.String(), err) + } + return doc.MessageID +} + +// secSetStoredValue reads the switch value stored in the fake clientset. +func secSetStoredValue(t *testing.T, cs *k8sfake.Clientset) string { + t.Helper() + cm, err := cs.CoreV1().ConfigMaps(secSetNamespace).Get(context.Background(), securitySettingsConfigMap, metav1.GetOptions{}) + if err != nil { + t.Fatalf("get switch ConfigMap: %v", err) + } + return cm.Data[securitySettingsKey] +} + +// secSetWrites reports whether cs recorded any write verb on ConfigMaps. +func secSetWrites(cs *k8sfake.Clientset) bool { + for _, a := range cs.Actions() { + switch a.GetVerb() { + case "create", "update", "patch", "delete": + if a.GetResource().Resource == "configmaps" { + return true + } + } + } + return false +} + +func TestSecuritySettingsDecode(t *testing.T) { + ok := []struct { + name string + body string + want bool + }{ + {"true", `{"allowRootOverrides":true}`, true}, + {"false", `{"allowRootOverrides":false}`, false}, + {"unknown members dropped", `{"allowRootOverrides":true,"other":1}`, true}, + } + for _, tc := range ok { + t.Run(tc.name, func(t *testing.T) { + got, err := decodeAllowRootOverrides([]byte(tc.body)) + if err != nil { + t.Fatalf("decode %s: %v", tc.body, err) + } + if got != tc.want { + t.Errorf("decode %s = %v, want %v", tc.body, got, tc.want) + } + }) + } + + bad := []string{ + `{"allowRootOverrides":"true"}`, + `{"allowRootOverrides":1}`, + `{"allowRootOverrides":null}`, + `{}`, + `[]`, + `not json`, + } + for _, body := range bad { + if _, err := decodeAllowRootOverrides([]byte(body)); err == nil { + t.Errorf("decode %s: want error, got none", body) + } + } +} + +func TestSecuritySettingsPUT_EmptyBody400(t *testing.T) { + reg, _ := secSetRegistry(secSetConfigMap("false")) + rr := secSetDo(secSetRouter(reg), http.MethodPut, "") + if rr.Code != http.StatusBadRequest { + t.Fatalf("empty PUT = %d, want 400; body=%s", rr.Code, rr.Body.String()) + } + if id := secSetMessageID(t, rr); id != "server.empty_body" { + t.Errorf("messageId = %q, want server.empty_body", id) + } +} + +func TestSecuritySettingsPUT_InvalidBody422(t *testing.T) { + for _, body := range []string{`{"allowRootOverrides":"yes"}`, `{}`, `not json`} { + reg, cs := secSetRegistry(secSetConfigMap("false")) + rr := secSetDo(secSetRouter(reg), http.MethodPut, body) + if rr.Code != http.StatusUnprocessableEntity { + t.Errorf("PUT %s = %d, want 422", body, rr.Code) + } + if secSetWrites(cs) { + t.Errorf("PUT %s wrote the ConfigMap", body) + } + } +} + +func TestSecuritySettingsGET_Missing(t *testing.T) { + reg, _ := secSetRegistry() + rr := secSetDo(secSetRouter(reg), http.MethodGet, "") + if rr.Code != http.StatusOK { + t.Fatalf("GET missing = %d, want 200; body=%s", rr.Code, rr.Body.String()) + } + var body securitySettingsBody + if err := json.Unmarshal(rr.Body.Bytes(), &body); err != nil { + t.Fatalf("decode: %v", err) + } + if body.AllowRootOverrides || body.Present { + t.Errorf("GET missing = %+v, want allowRootOverrides false and present false", body) + } +} + +func TestSecuritySettingsGET_Values(t *testing.T) { + cases := []struct { + value string + want bool + }{ + {"true", true}, + {"false", false}, + {"TRUE", false}, // only the exact value is on + {"yes", false}, + } + for _, tc := range cases { + reg, _ := secSetRegistry(secSetConfigMap(tc.value)) + rr := secSetDo(secSetRouter(reg), http.MethodGet, "") + if rr.Code != http.StatusOK { + t.Fatalf("GET %q = %d, want 200", tc.value, rr.Code) + } + var body securitySettingsBody + if err := json.Unmarshal(rr.Body.Bytes(), &body); err != nil { + t.Fatalf("decode: %v", err) + } + if body.AllowRootOverrides != tc.want || !body.Present || body.Cluster != scope.DefaultCluster { + t.Errorf("GET %q = %+v, want allowRootOverrides %v, present true, cluster %s", + tc.value, body, tc.want, scope.DefaultCluster) + } + } +} + +func TestSecuritySettingsGET_ReadErrorIs502(t *testing.T) { + reg, cs := secSetRegistry(secSetConfigMap("true")) + cs.PrependReactor("get", "configmaps", func(k8stesting.Action) (bool, runtime.Object, error) { + return true, nil, apierrors.NewInternalError(errors.New("injected read failure")) + }) + rr := secSetDo(secSetRouter(reg), http.MethodGet, "") + if rr.Code != http.StatusBadGateway { + t.Fatalf("GET with read error = %d, want 502", rr.Code) + } +} + +func TestSecuritySettingsGET_UnsetNamespaceIs502(t *testing.T) { + cs := k8sfake.NewSimpleClientset(secSetConfigMap("true")) + reg := kube.NewRegistry(scope.DefaultCluster) + reg.Set(scope.DefaultCluster, &kube.Client{Typed: cs}) + rr := secSetDo(secSetRouter(reg), http.MethodGet, "") + if rr.Code != http.StatusBadGateway { + t.Fatalf("GET without home namespace = %d, want 502 (fail closed)", rr.Code) + } +} + +func TestSecuritySettingsPUT_MissingConfigMap409AndNeverCreates(t *testing.T) { + reg, cs := secSetRegistry() + rr := secSetDo(secSetRouter(reg), http.MethodPut, `{"allowRootOverrides":true}`) + if rr.Code != http.StatusConflict { + t.Fatalf("PUT missing = %d, want 409; body=%s", rr.Code, rr.Body.String()) + } + if id := secSetMessageID(t, rr); id != "server.cluster.security_settings_missing" { + t.Errorf("messageId = %q, want server.cluster.security_settings_missing", id) + } + if secSetWrites(cs) { + t.Error("PUT with a missing ConfigMap wrote to the cluster; it must never create one") + } + if _, err := cs.CoreV1().ConfigMaps(secSetNamespace).Get(context.Background(), securitySettingsConfigMap, metav1.GetOptions{}); !apierrors.IsNotFound(err) { + t.Errorf("ConfigMap after refused PUT: err = %v, want NotFound", err) + } +} + +func TestSecuritySettingsPUT_UnchangedWritesNothing(t *testing.T) { + reg, cs := secSetRegistry(secSetConfigMap("false")) + rr := secSetDo(secSetRouter(reg), http.MethodPut, `{"allowRootOverrides":false}`) + if rr.Code != http.StatusOK { + t.Fatalf("PUT unchanged = %d, want 200; body=%s", rr.Code, rr.Body.String()) + } + if secSetWrites(cs) { + t.Error("unchanged PUT wrote the ConfigMap") + } + var body securitySettingsBody + if err := json.Unmarshal(rr.Body.Bytes(), &body); err != nil { + t.Fatalf("decode: %v", err) + } + if body.AllowRootOverrides || !body.Present { + t.Errorf("PUT body = %+v, want allowRootOverrides false, present true", body) + } +} + +func TestSecuritySettingsPUT_FlipBothWays(t *testing.T) { + reg, cs := secSetRegistry(secSetConfigMap("false")) + h := secSetRouter(reg) + + rr := secSetDo(h, http.MethodPut, `{"allowRootOverrides":true}`) + if rr.Code != http.StatusOK { + t.Fatalf("PUT true = %d, want 200; body=%s", rr.Code, rr.Body.String()) + } + if got := secSetStoredValue(t, cs); got != "true" { + t.Errorf("stored after PUT true = %q, want \"true\"", got) + } + var on securitySettingsBody + if err := json.Unmarshal(rr.Body.Bytes(), &on); err != nil || !on.AllowRootOverrides || !on.Present { + t.Errorf("PUT true body = %s, want allowRootOverrides true, present true", rr.Body.String()) + } + + rr = secSetDo(h, http.MethodPut, `{"allowRootOverrides":false}`) + if rr.Code != http.StatusOK { + t.Fatalf("PUT false = %d, want 200; body=%s", rr.Code, rr.Body.String()) + } + if got := secSetStoredValue(t, cs); got != "false" { + t.Errorf("stored after PUT false = %q, want \"false\"", got) + } +} + +func TestSecuritySettingsPUT_UpdateFailureIs502(t *testing.T) { + reg, cs := secSetRegistry(secSetConfigMap("false")) + cs.PrependReactor("update", "configmaps", func(k8stesting.Action) (bool, runtime.Object, error) { + return true, nil, apierrors.NewInternalError(errors.New("injected update failure")) + }) + rr := secSetDo(secSetRouter(reg), http.MethodPut, `{"allowRootOverrides":true}`) + if rr.Code != http.StatusBadGateway { + t.Fatalf("PUT with update failure = %d, want 502; body=%s", rr.Code, rr.Body.String()) + } + if got := secSetStoredValue(t, cs); got != "false" { + t.Errorf("stored after failed update = %q, want \"false\"", got) + } +} diff --git a/api/internal/kube/control_plane_namespace.go b/api/internal/kube/control_plane_namespace.go new file mode 100644 index 000000000..d8416e148 --- /dev/null +++ b/api/internal/kube/control_plane_namespace.go @@ -0,0 +1,19 @@ +package kube + +// SetControlPlaneNamespace records the namespace of the default (home) +// cluster's operator control plane. The security settings ConfigMap of the +// home cluster lives there. Remote clusters use the namespace on their own +// registration instead, so this value never applies to them. +func (r *Registry) SetControlPlaneNamespace(ns string) { + r.mu.Lock() + defer r.mu.Unlock() + r.controlPlaneNamespace = ns +} + +// ControlPlaneNamespace returns the home cluster's control-plane namespace, or +// "" when it was never set. Callers treat "" as not configured. +func (r *Registry) ControlPlaneNamespace() string { + r.mu.RLock() + defer r.mu.RUnlock() + return r.controlPlaneNamespace +} diff --git a/api/internal/kube/registry.go b/api/internal/kube/registry.go index 0abae57e4..4fcf4a1cf 100644 --- a/api/internal/kube/registry.go +++ b/api/internal/kube/registry.go @@ -21,8 +21,11 @@ type Registry struct { uids map[string]types.UID defaultID string management *Client - operations map[string]*registrationSequence - identities map[string]credentialIdentity + // controlPlaneNamespace is the namespace of the default cluster's + // security settings ConfigMap (set by SetControlPlaneNamespace). + controlPlaneNamespace string + operations map[string]*registrationSequence + identities map[string]credentialIdentity } // Sequence credential loads per name, while the global lock protects only diff --git a/api/internal/messages/entries_server.go b/api/internal/messages/entries_server.go index 2c6fbcf93..06d8e1f1a 100644 --- a/api/internal/messages/entries_server.go +++ b/api/internal/messages/entries_server.go @@ -209,6 +209,24 @@ var serverEntries = []Entry{ Description: "API error from the roles API (roles.go:del, roles.go:update).", Status: http.StatusNotFound, }, + { + ID: "server.security.forbidden", + English: "changing security settings requires the servers:security permission", + Description: "API error from the GameServer save path (security_overrides.go) when a caller without servers:security changes spec.security.", + Status: http.StatusForbidden, + }, + { + ID: "server.security.root_disabled", + English: "root values (user 0, group 0, filesystem group 0, or the image default for user or group) are not allowed on this cluster until an administrator allows root overrides in that cluster's Configuration", + Description: "API error from the GameServer save path when a new or changed root value is saved while the cluster's allow-root-overrides setting is off. Argument setting names the first offending setting.", + Status: http.StatusForbidden, + }, + { + ID: "server.security.invalid", + English: "invalid security override: {detail}", + Description: "API error from the GameServer save path when spec.security has an invalid shape. Argument setting names the offending setting; argument detail says what is wrong.", + Status: http.StatusUnprocessableEntity, + }, { ID: "server.shares.expires_at_in_past", English: "expiresAt must be in the future", diff --git a/api/internal/messages/messages.go b/api/internal/messages/messages.go index 0ee0c0ad5..2b47d5d74 100644 --- a/api/internal/messages/messages.go +++ b/api/internal/messages/messages.go @@ -138,6 +138,12 @@ var entries = []Entry{ Description: "API response for a home-cluster-only route called with a ?cluster= value that names another cluster. No cross-cluster agent exists yet.", Status: http.StatusNotImplemented, }, + { + ID: "server.cluster.security_settings_missing", + English: "the security settings ConfigMap is missing on this cluster; run helm upgrade to recreate it", + Description: "API error from the cluster security settings API (security_settings.go) when the gameplane-security-settings ConfigMap is not found on the cluster. Nothing is written.", + Status: http.StatusConflict, + }, { ID: "server.auth.invalid_credentials", English: "invalid credentials", diff --git a/api/internal/rbac/catalog.go b/api/internal/rbac/catalog.go index 13c2fe1ef..68595bd20 100644 --- a/api/internal/rbac/catalog.go +++ b/api/internal/rbac/catalog.go @@ -26,6 +26,7 @@ var Catalog = []PermGroup{ {Key: "servers:read", Label: "View servers, logs, players, and files", Namespaced: true}, {Key: "servers:write", Label: "Create, edit, and control servers (owner-only actions need the server's owner or an admin)", Namespaced: true}, {Key: "servers:console", Label: "Use the live console (RCON / PTY)", Namespaced: true}, + {Key: "servers:security", Label: "Set or change a server's security overrides (run-as user and group, filesystem group, volume ownership check)", Namespaced: true}, }}, {Resource: "backups", Label: "Backups", Permissions: []Permission{ {Key: "backups:read", Label: "View backups and restores", Namespaced: true}, diff --git a/api/internal/rbac/catalog_security_test.go b/api/internal/rbac/catalog_security_test.go new file mode 100644 index 000000000..54d7ad722 --- /dev/null +++ b/api/internal/rbac/catalog_security_test.go @@ -0,0 +1,37 @@ +package rbac + +import ( + "testing" + + "github.com/GameplanePanel/gameplane/api/internal/scope" +) + +// TestCatalog_ServersSecurityPermission pins the servers:security catalog +// entry: it exists, it is namespaced, the built-in admin role holds it +// (through "*"), and no other built-in role holds it. The privileged-grant +// guard (privilegedPermissions in handlers/privileged_grants.go) is +// unexported in another package and is not checked here. +func TestCatalog_ServersSecurityPermission(t *testing.T) { + const perm = "servers:security" + + if !ValidPermission(perm) { + t.Fatalf("ValidPermission(%q) = false, want true", perm) + } + if !Namespaced(perm) { + t.Fatalf("Namespaced(%q) = false, want true", perm) + } + + store := migratedStore(t) + builtin := []string{RoleAdmin, RoleOperator, RoleViewer} + for _, role := range builtin { + u := userForRole(t, store, role) + got := u.Can(perm, true, scope.DefaultCluster, scope.DefaultNamespace) + want := role == RoleAdmin + if got != want { + t.Errorf("role %q: Can(%q) = %v, want %v", role, perm, got, want) + } + if _, seeded := loadRolePerms(t, store, role)[perm]; seeded && role != RoleAdmin { + t.Errorf("role %q: seeded permission %q, want it held only by admin", role, perm) + } + } +} diff --git a/api/internal/rbac/rbac.go b/api/internal/rbac/rbac.go index b7c9fef47..ea0c5f2c5 100644 --- a/api/internal/rbac/rbac.go +++ b/api/internal/rbac/rbac.go @@ -249,6 +249,10 @@ var rules = []rule{ // to callers without config:manage. {method: "GET", segment: "admin", prefix: "/admin/telemetry", perm: "config:read"}, {segment: "admin", prefix: "/admin/telemetry", perm: "config:manage"}, + // Allow root overrides (spec 030) is a per-cluster switch next to the + // config rules: reads need config:read, the flip needs config:manage. + {method: "GET", segment: "security-settings", perm: "config:read"}, + {segment: "security-settings", perm: "config:manage"}, {segment: "admin", perm: "*"}, // Network capture (feature 003-network-capture-sidecar): admin-only via diff --git a/api/specs.md b/api/specs.md index 6691691dd..9999cf52f 100644 --- a/api/specs.md +++ b/api/specs.md @@ -550,6 +550,15 @@ audit:read, config:read, config:manage (cluster-scoped) - Tests: `TestMiddleware_OwnerOnlyOperationsNeedOwnerOrAdmin`, `TestMiddleware_ServerWithoutOwnerIsAdminOnlyForOwnerOnlyOperations`, `TestMiddleware_OtherServerWritesUnchangedForServersWriteHolders`, `TestMiddleware_OwnerOnlyOperationOnMissingServer`, `TestMiddleware_OwnerOnlyOperationWithoutFetcherFailsClosed` (`rbac/owner_only_test.go`); `TestOwnership_TransferRequiresOwnerOrAdmin`, `TestOwnership_SetCollaboratorsRequiresOwnerOrAdmin`, `TestLifecycle_WipeDataRequiresOwnerOrAdmin` (`handlers/owner_only_ops_test.go`); e2e `TestAPI_OwnerOnlyServerOperations_RequireOwnerOrAdmin` (bucket `api-mods`) - Fetch GameServer from `?cluster=` (cluster-gated in middleware) +### Security overrides and security settings + +- **Routes:** `GET /security-settings?cluster=` (needs `config:read`) and `PUT /security-settings?cluster=` (needs `config:manage`), in `handlers/security_settings.go`, mounted with `MountSecuritySettings(r, reg, auditor)`. The cluster is resolved with `resolveCluster`, as `/backup-destinations` does. Rule-table entries sit next to the `/admin/config` rules in `rbac/rbac.go`. +- **Setting store:** `allowRootOverrides` lives only in the ConfigMap `gameplane-security-settings` in the cluster's control-plane namespace. The home cluster uses `moduleConfigMapNS`. A remote cluster uses `Cluster.spec.controlPlaneNamespace` (default `gameplane`). The API reads and updates the ConfigMap by name through that cluster's registry client and never creates it. There is no config-table row and no start-up sync. +- **GET body:** `{"cluster", "allowRootOverrides", "present"}`. A missing ConfigMap reads as `allowRootOverrides: false, present: false`. Any other read error is 502. +- **PUT body:** `{"allowRootOverrides": bool}`. Empty body is 400 `server.empty_body`. Invalid JSON or a non-boolean value is 422. A missing ConfigMap is 409 `server.cluster.security_settings_missing` with no audit row. An unchanged value is 200 with no write and no audit row. A change writes the flip audit row (`target` `security/`, `reason` `allowRootOverrides:false->true` or the reverse) with `WriteSync` before the ConfigMap update. If the update fails, the API writes a `security_save_failed` row and returns 502. The PUT returns the GET body with `present: true`. +- **Override checks:** `handlers/security_overrides.go` (replacing `resources_security.go`) checks the `servers:security` permission field by field on `spec.security` for create, update and clone, and applies the root rule. A new or changed root value is refused with 403 `server.security.root_disabled` unless the request's own cluster ConfigMap reads exactly `"true"`. Any read error or other value is off. The rule reads no config store, so `MountResources` needs no `*db.Store`. Clone writes the override audit row through the optional variadic auditor of `MountLifecycle`. +- **Helm grant:** the API identity gets `get`, `update` and `patch` on that one ConfigMap by `resourceNames`. There is no `create` verb, because Kubernetes does not apply `resourceNames` to `create`. Remote chart grants use the same verbs in the registered namespace. + ## Key invariants 1. **Operator-authoritative:** every mutating request goes through K8s API (Create/Patch/Delete on CRDs); API waits for operator to reconcile status diff --git a/assets/design-export/fig/1163467012-1553.fig b/assets/design-export/fig/1163467012-1553.fig new file mode 100644 index 000000000..bab75197d Binary files /dev/null and b/assets/design-export/fig/1163467012-1553.fig differ diff --git a/assets/design-export/fig/1163467012-2214.fig b/assets/design-export/fig/1163467012-2214.fig new file mode 100644 index 000000000..ff18d8ba0 Binary files /dev/null and b/assets/design-export/fig/1163467012-2214.fig differ diff --git a/assets/design-export/fig/1163467012-2492.fig b/assets/design-export/fig/1163467012-2492.fig new file mode 100644 index 000000000..c5c152765 Binary files /dev/null and b/assets/design-export/fig/1163467012-2492.fig differ diff --git a/assets/design-export/fig/1163467012-259.fig b/assets/design-export/fig/1163467012-259.fig new file mode 100644 index 000000000..6030aaf4a Binary files /dev/null and b/assets/design-export/fig/1163467012-259.fig differ diff --git a/assets/design-export/fig/1163467012-2680.fig b/assets/design-export/fig/1163467012-2680.fig new file mode 100644 index 000000000..b43de4b2a Binary files /dev/null and b/assets/design-export/fig/1163467012-2680.fig differ diff --git a/assets/design-export/fig/1163467012-2868.fig b/assets/design-export/fig/1163467012-2868.fig new file mode 100644 index 000000000..6a0e9e375 Binary files /dev/null and b/assets/design-export/fig/1163467012-2868.fig differ diff --git a/assets/design-export/fig/1163467012-3056.fig b/assets/design-export/fig/1163467012-3056.fig new file mode 100644 index 000000000..795acf0db Binary files /dev/null and b/assets/design-export/fig/1163467012-3056.fig differ diff --git a/assets/design-export/fig/1163467012-3228.fig b/assets/design-export/fig/1163467012-3228.fig new file mode 100644 index 000000000..cf7cb4c0e Binary files /dev/null and b/assets/design-export/fig/1163467012-3228.fig differ diff --git a/assets/design-export/fig/1163467012-906.fig b/assets/design-export/fig/1163467012-906.fig new file mode 100644 index 000000000..eceeef9c4 Binary files /dev/null and b/assets/design-export/fig/1163467012-906.fig differ diff --git a/assets/design-export/fig/1274632774-1258.fig b/assets/design-export/fig/1274632774-1258.fig index acc34bb48..bf09d52d9 100644 Binary files a/assets/design-export/fig/1274632774-1258.fig and b/assets/design-export/fig/1274632774-1258.fig differ diff --git a/assets/design-export/fig/1274632774-130.fig b/assets/design-export/fig/1274632774-130.fig index 3f8413e3e..35178a8c0 100644 Binary files a/assets/design-export/fig/1274632774-130.fig and b/assets/design-export/fig/1274632774-130.fig differ diff --git a/assets/design-export/fig/1274632774-1722.fig b/assets/design-export/fig/1274632774-1722.fig index 117570a4b..8e1096001 100644 Binary files a/assets/design-export/fig/1274632774-1722.fig and b/assets/design-export/fig/1274632774-1722.fig differ diff --git a/assets/design-export/fig/1274632774-2112.fig b/assets/design-export/fig/1274632774-2112.fig index 98060a318..b4b6992b2 100644 Binary files a/assets/design-export/fig/1274632774-2112.fig and b/assets/design-export/fig/1274632774-2112.fig differ diff --git a/assets/design-export/fig/1274632774-2492.fig b/assets/design-export/fig/1274632774-2492.fig index 60f2016f1..de5368de9 100644 Binary files a/assets/design-export/fig/1274632774-2492.fig and b/assets/design-export/fig/1274632774-2492.fig differ diff --git a/assets/design-export/fig/1274632774-2877.fig b/assets/design-export/fig/1274632774-2877.fig index 29932a7a5..81923f05d 100644 Binary files a/assets/design-export/fig/1274632774-2877.fig and b/assets/design-export/fig/1274632774-2877.fig differ diff --git a/assets/design-export/fig/1274632774-3217.fig b/assets/design-export/fig/1274632774-3217.fig index adb653d13..1ab6f005d 100644 Binary files a/assets/design-export/fig/1274632774-3217.fig and b/assets/design-export/fig/1274632774-3217.fig differ diff --git a/assets/design-export/fig/1274632774-3559.fig b/assets/design-export/fig/1274632774-3559.fig index 77f68165a..85182c908 100644 Binary files a/assets/design-export/fig/1274632774-3559.fig and b/assets/design-export/fig/1274632774-3559.fig differ diff --git a/assets/design-export/fig/1274632774-3890.fig b/assets/design-export/fig/1274632774-3890.fig index c48d141f5..833ae653e 100644 Binary files a/assets/design-export/fig/1274632774-3890.fig and b/assets/design-export/fig/1274632774-3890.fig differ diff --git a/assets/design-export/fig/1274632774-4001.fig b/assets/design-export/fig/1274632774-4001.fig index 0949072e1..c8cc7c852 100644 Binary files a/assets/design-export/fig/1274632774-4001.fig and b/assets/design-export/fig/1274632774-4001.fig differ diff --git a/assets/design-export/fig/1274632774-4260.fig b/assets/design-export/fig/1274632774-4260.fig index 260b96ad5..d907eff88 100644 Binary files a/assets/design-export/fig/1274632774-4260.fig and b/assets/design-export/fig/1274632774-4260.fig differ diff --git a/assets/design-export/fig/1274632774-470.fig b/assets/design-export/fig/1274632774-470.fig index fa2519d66..cc0557b08 100644 Binary files a/assets/design-export/fig/1274632774-470.fig and b/assets/design-export/fig/1274632774-470.fig differ diff --git a/assets/design-export/fig/1274632774-907.fig b/assets/design-export/fig/1274632774-907.fig index 23c0d859f..b929955b1 100644 Binary files a/assets/design-export/fig/1274632774-907.fig and b/assets/design-export/fig/1274632774-907.fig differ diff --git a/assets/design-export/fig/1494270493-26.fig b/assets/design-export/fig/1494270493-26.fig index ed7bdc18f..d087e0976 100644 Binary files a/assets/design-export/fig/1494270493-26.fig and b/assets/design-export/fig/1494270493-26.fig differ diff --git a/assets/design-export/fig/2044649516-1099.fig b/assets/design-export/fig/2044649516-1099.fig index 2b4e02491..6b52f0368 100644 Binary files a/assets/design-export/fig/2044649516-1099.fig and b/assets/design-export/fig/2044649516-1099.fig differ diff --git a/assets/design-export/fig/2044649516-13.fig b/assets/design-export/fig/2044649516-13.fig index 5468ff761..d0b03a623 100644 Binary files a/assets/design-export/fig/2044649516-13.fig and b/assets/design-export/fig/2044649516-13.fig differ diff --git a/assets/design-export/fig/2044649516-1687.fig b/assets/design-export/fig/2044649516-1687.fig index 0bad8c6c0..2f5156253 100644 Binary files a/assets/design-export/fig/2044649516-1687.fig and b/assets/design-export/fig/2044649516-1687.fig differ diff --git a/assets/design-export/fig/2044649516-2282.fig b/assets/design-export/fig/2044649516-2282.fig index 96ce8c4c4..de4247fc3 100644 Binary files a/assets/design-export/fig/2044649516-2282.fig and b/assets/design-export/fig/2044649516-2282.fig differ diff --git a/assets/design-export/fig/2044649516-2862.fig b/assets/design-export/fig/2044649516-2862.fig index 039011978..d882e5a48 100644 Binary files a/assets/design-export/fig/2044649516-2862.fig and b/assets/design-export/fig/2044649516-2862.fig differ diff --git a/assets/design-export/fig/2044649516-2982.fig b/assets/design-export/fig/2044649516-2982.fig index c0a6482b8..2c317a836 100644 Binary files a/assets/design-export/fig/2044649516-2982.fig and b/assets/design-export/fig/2044649516-2982.fig differ diff --git a/assets/design-export/fig/2044649516-579.fig b/assets/design-export/fig/2044649516-579.fig index 2c922eb36..2e13a3ec0 100644 Binary files a/assets/design-export/fig/2044649516-579.fig and b/assets/design-export/fig/2044649516-579.fig differ diff --git a/assets/design-export/fig/46479436-2.fig b/assets/design-export/fig/46479436-2.fig index 26a289449..308483651 100644 Binary files a/assets/design-export/fig/46479436-2.fig and b/assets/design-export/fig/46479436-2.fig differ diff --git a/assets/design-export/fig/901437436-1.fig b/assets/design-export/fig/901437436-1.fig new file mode 100644 index 000000000..ef2222b69 Binary files /dev/null and b/assets/design-export/fig/901437436-1.fig differ diff --git a/assets/design-export/fig/901437436-1393.fig b/assets/design-export/fig/901437436-1393.fig new file mode 100644 index 000000000..6c4058f2b Binary files /dev/null and b/assets/design-export/fig/901437436-1393.fig differ diff --git a/assets/design-export/fig/901437436-1857.fig b/assets/design-export/fig/901437436-1857.fig new file mode 100644 index 000000000..067d662d4 Binary files /dev/null and b/assets/design-export/fig/901437436-1857.fig differ diff --git a/assets/design-export/fig/901437436-2321.fig b/assets/design-export/fig/901437436-2321.fig new file mode 100644 index 000000000..d5141c728 Binary files /dev/null and b/assets/design-export/fig/901437436-2321.fig differ diff --git a/assets/design-export/fig/901437436-2785.fig b/assets/design-export/fig/901437436-2785.fig new file mode 100644 index 000000000..d706873a9 Binary files /dev/null and b/assets/design-export/fig/901437436-2785.fig differ diff --git a/assets/design-export/fig/901437436-3249.fig b/assets/design-export/fig/901437436-3249.fig new file mode 100644 index 000000000..a09a0b5d9 Binary files /dev/null and b/assets/design-export/fig/901437436-3249.fig differ diff --git a/assets/design-export/fig/901437436-3713.fig b/assets/design-export/fig/901437436-3713.fig new file mode 100644 index 000000000..04540ac38 Binary files /dev/null and b/assets/design-export/fig/901437436-3713.fig differ diff --git a/assets/design-export/fig/901437436-465.fig b/assets/design-export/fig/901437436-465.fig new file mode 100644 index 000000000..430057c67 Binary files /dev/null and b/assets/design-export/fig/901437436-465.fig differ diff --git a/assets/design-export/fig/901437436-929.fig b/assets/design-export/fig/901437436-929.fig new file mode 100644 index 000000000..60e846bb5 Binary files /dev/null and b/assets/design-export/fig/901437436-929.fig differ diff --git a/assets/design-export/fig/9dBXM.fig b/assets/design-export/fig/9dBXM.fig index 214265804..f745cf3a2 100644 Binary files a/assets/design-export/fig/9dBXM.fig and b/assets/design-export/fig/9dBXM.fig differ diff --git a/assets/design-export/fig/A8vGwM.fig b/assets/design-export/fig/A8vGwM.fig index bd75459de..8e4030fe2 100644 Binary files a/assets/design-export/fig/A8vGwM.fig and b/assets/design-export/fig/A8vGwM.fig differ diff --git a/assets/design-export/fig/B57dG.fig b/assets/design-export/fig/B57dG.fig index f498e2281..e12d2082a 100644 Binary files a/assets/design-export/fig/B57dG.fig and b/assets/design-export/fig/B57dG.fig differ diff --git a/assets/design-export/fig/BV5ei.fig b/assets/design-export/fig/BV5ei.fig index 415edc1c5..cd72d50c8 100644 Binary files a/assets/design-export/fig/BV5ei.fig and b/assets/design-export/fig/BV5ei.fig differ diff --git a/assets/design-export/fig/Bbnga.fig b/assets/design-export/fig/Bbnga.fig index e18a85908..f383a37c4 100644 Binary files a/assets/design-export/fig/Bbnga.fig and b/assets/design-export/fig/Bbnga.fig differ diff --git a/assets/design-export/fig/BdmAW.fig b/assets/design-export/fig/BdmAW.fig index be77206be..bb5011610 100644 Binary files a/assets/design-export/fig/BdmAW.fig and b/assets/design-export/fig/BdmAW.fig differ diff --git a/assets/design-export/fig/Be7ZW.fig b/assets/design-export/fig/Be7ZW.fig index bf45b5991..20808c491 100644 Binary files a/assets/design-export/fig/Be7ZW.fig and b/assets/design-export/fig/Be7ZW.fig differ diff --git a/assets/design-export/fig/BguST.fig b/assets/design-export/fig/BguST.fig index 7bc7d84ea..292b445bf 100644 Binary files a/assets/design-export/fig/BguST.fig and b/assets/design-export/fig/BguST.fig differ diff --git a/assets/design-export/fig/Bq2Yg.fig b/assets/design-export/fig/Bq2Yg.fig index 56a921da0..c482ca1e8 100644 Binary files a/assets/design-export/fig/Bq2Yg.fig and b/assets/design-export/fig/Bq2Yg.fig differ diff --git a/assets/design-export/fig/Burtr.fig b/assets/design-export/fig/Burtr.fig index d9bb9ad56..1776c2a8b 100644 Binary files a/assets/design-export/fig/Burtr.fig and b/assets/design-export/fig/Burtr.fig differ diff --git a/assets/design-export/fig/C2LQE4.fig b/assets/design-export/fig/C2LQE4.fig index 4ead6fcb7..2ad875762 100644 Binary files a/assets/design-export/fig/C2LQE4.fig and b/assets/design-export/fig/C2LQE4.fig differ diff --git a/assets/design-export/fig/C5Aoe.fig b/assets/design-export/fig/C5Aoe.fig index 791db87e6..7d77e400b 100644 Binary files a/assets/design-export/fig/C5Aoe.fig and b/assets/design-export/fig/C5Aoe.fig differ diff --git a/assets/design-export/fig/C9bR6.fig b/assets/design-export/fig/C9bR6.fig index b68642c9e..0d0d01cd6 100644 Binary files a/assets/design-export/fig/C9bR6.fig and b/assets/design-export/fig/C9bR6.fig differ diff --git a/assets/design-export/fig/Cb3eC.fig b/assets/design-export/fig/Cb3eC.fig index 9329a3d8c..ac876e9e1 100644 Binary files a/assets/design-export/fig/Cb3eC.fig and b/assets/design-export/fig/Cb3eC.fig differ diff --git a/assets/design-export/fig/CqaSq.fig b/assets/design-export/fig/CqaSq.fig index d6487ec6f..a274b3beb 100644 Binary files a/assets/design-export/fig/CqaSq.fig and b/assets/design-export/fig/CqaSq.fig differ diff --git a/assets/design-export/fig/D9QYZ.fig b/assets/design-export/fig/D9QYZ.fig index e5824d030..c2de3eaff 100644 Binary files a/assets/design-export/fig/D9QYZ.fig and b/assets/design-export/fig/D9QYZ.fig differ diff --git a/assets/design-export/fig/DBQyF.fig b/assets/design-export/fig/DBQyF.fig index 494f276dd..3ecfb051b 100644 Binary files a/assets/design-export/fig/DBQyF.fig and b/assets/design-export/fig/DBQyF.fig differ diff --git a/assets/design-export/fig/DMnEi.fig b/assets/design-export/fig/DMnEi.fig index f254dcd4b..05d33aa11 100644 Binary files a/assets/design-export/fig/DMnEi.fig and b/assets/design-export/fig/DMnEi.fig differ diff --git a/assets/design-export/fig/DPrYX.fig b/assets/design-export/fig/DPrYX.fig index 29f8f37c0..89b5c6b5b 100644 Binary files a/assets/design-export/fig/DPrYX.fig and b/assets/design-export/fig/DPrYX.fig differ diff --git a/assets/design-export/fig/DWztv.fig b/assets/design-export/fig/DWztv.fig index 05b6af353..cfb2debba 100644 Binary files a/assets/design-export/fig/DWztv.fig and b/assets/design-export/fig/DWztv.fig differ diff --git a/assets/design-export/fig/Dpb9f.fig b/assets/design-export/fig/Dpb9f.fig index fa0c3a086..498fb467e 100644 Binary files a/assets/design-export/fig/Dpb9f.fig and b/assets/design-export/fig/Dpb9f.fig differ diff --git a/assets/design-export/fig/DxKOh.fig b/assets/design-export/fig/DxKOh.fig index 694f04d1a..5e6f83b47 100644 Binary files a/assets/design-export/fig/DxKOh.fig and b/assets/design-export/fig/DxKOh.fig differ diff --git a/assets/design-export/fig/E0ypH.fig b/assets/design-export/fig/E0ypH.fig index 9ffcc44ec..869cb0b6d 100644 Binary files a/assets/design-export/fig/E0ypH.fig and b/assets/design-export/fig/E0ypH.fig differ diff --git a/assets/design-export/fig/E9EEv0.fig b/assets/design-export/fig/E9EEv0.fig index cb52191a2..9355fa4f0 100644 Binary files a/assets/design-export/fig/E9EEv0.fig and b/assets/design-export/fig/E9EEv0.fig differ diff --git a/assets/design-export/fig/EKJyM.fig b/assets/design-export/fig/EKJyM.fig index 2b0e49176..c7379fcc7 100644 Binary files a/assets/design-export/fig/EKJyM.fig and b/assets/design-export/fig/EKJyM.fig differ diff --git a/assets/design-export/fig/EWrn0.fig b/assets/design-export/fig/EWrn0.fig index 9b3cbfc3c..76a55eb52 100644 Binary files a/assets/design-export/fig/EWrn0.fig and b/assets/design-export/fig/EWrn0.fig differ diff --git a/assets/design-export/fig/EZFW0.fig b/assets/design-export/fig/EZFW0.fig index 910c646c0..900bb32e6 100644 Binary files a/assets/design-export/fig/EZFW0.fig and b/assets/design-export/fig/EZFW0.fig differ diff --git a/assets/design-export/fig/EcoGD.fig b/assets/design-export/fig/EcoGD.fig index 22647ffd5..131af5dda 100644 Binary files a/assets/design-export/fig/EcoGD.fig and b/assets/design-export/fig/EcoGD.fig differ diff --git a/assets/design-export/fig/F9pUrx.fig b/assets/design-export/fig/F9pUrx.fig index 27efa9d41..fa137a0af 100644 Binary files a/assets/design-export/fig/F9pUrx.fig and b/assets/design-export/fig/F9pUrx.fig differ diff --git a/assets/design-export/fig/FBiMN.fig b/assets/design-export/fig/FBiMN.fig index d1693575c..2d3aed1cc 100644 Binary files a/assets/design-export/fig/FBiMN.fig and b/assets/design-export/fig/FBiMN.fig differ diff --git a/assets/design-export/fig/FOVMf.fig b/assets/design-export/fig/FOVMf.fig index 1035ffb33..f9fae57b4 100644 Binary files a/assets/design-export/fig/FOVMf.fig and b/assets/design-export/fig/FOVMf.fig differ diff --git a/assets/design-export/fig/FtdkI.fig b/assets/design-export/fig/FtdkI.fig index e93dd1c07..5e3b381f0 100644 Binary files a/assets/design-export/fig/FtdkI.fig and b/assets/design-export/fig/FtdkI.fig differ diff --git a/assets/design-export/fig/GR1G9.fig b/assets/design-export/fig/GR1G9.fig index a1c4d48bc..28ba7c0fb 100644 Binary files a/assets/design-export/fig/GR1G9.fig and b/assets/design-export/fig/GR1G9.fig differ diff --git a/assets/design-export/fig/GayoL.fig b/assets/design-export/fig/GayoL.fig index 585fd145d..e859c4ba3 100644 Binary files a/assets/design-export/fig/GayoL.fig and b/assets/design-export/fig/GayoL.fig differ diff --git a/assets/design-export/fig/GsofJ.fig b/assets/design-export/fig/GsofJ.fig index d53cf07aa..8b7abc35c 100644 Binary files a/assets/design-export/fig/GsofJ.fig and b/assets/design-export/fig/GsofJ.fig differ diff --git a/assets/design-export/fig/HVhmb.fig b/assets/design-export/fig/HVhmb.fig index e11f8499e..71365df1e 100644 Binary files a/assets/design-export/fig/HVhmb.fig and b/assets/design-export/fig/HVhmb.fig differ diff --git a/assets/design-export/fig/Hy9r0.fig b/assets/design-export/fig/Hy9r0.fig index e9b5dd7a6..a24003077 100644 Binary files a/assets/design-export/fig/Hy9r0.fig and b/assets/design-export/fig/Hy9r0.fig differ diff --git a/assets/design-export/fig/IBUqJ.fig b/assets/design-export/fig/IBUqJ.fig index 62acfc562..2e38ca603 100644 Binary files a/assets/design-export/fig/IBUqJ.fig and b/assets/design-export/fig/IBUqJ.fig differ diff --git a/assets/design-export/fig/IMSD5.fig b/assets/design-export/fig/IMSD5.fig index 2462d169d..81e5fa61a 100644 Binary files a/assets/design-export/fig/IMSD5.fig and b/assets/design-export/fig/IMSD5.fig differ diff --git a/assets/design-export/fig/IdbiB.fig b/assets/design-export/fig/IdbiB.fig index afa3e6717..92af25db0 100644 Binary files a/assets/design-export/fig/IdbiB.fig and b/assets/design-export/fig/IdbiB.fig differ diff --git a/assets/design-export/fig/IyMFM.fig b/assets/design-export/fig/IyMFM.fig index 8684d07b6..f2b9f42c7 100644 Binary files a/assets/design-export/fig/IyMFM.fig and b/assets/design-export/fig/IyMFM.fig differ diff --git a/assets/design-export/fig/IzuY2.fig b/assets/design-export/fig/IzuY2.fig index a146fd06e..530fdb92d 100644 Binary files a/assets/design-export/fig/IzuY2.fig and b/assets/design-export/fig/IzuY2.fig differ diff --git a/assets/design-export/fig/J5pjJ3.fig b/assets/design-export/fig/J5pjJ3.fig index 827f55875..1d4023618 100644 Binary files a/assets/design-export/fig/J5pjJ3.fig and b/assets/design-export/fig/J5pjJ3.fig differ diff --git a/assets/design-export/fig/J8GzM9.fig b/assets/design-export/fig/J8GzM9.fig index 4a9b452eb..ee1411e2d 100644 Binary files a/assets/design-export/fig/J8GzM9.fig and b/assets/design-export/fig/J8GzM9.fig differ diff --git a/assets/design-export/fig/K5XinZ.fig b/assets/design-export/fig/K5XinZ.fig index f399ced9e..c60dc0b84 100644 Binary files a/assets/design-export/fig/K5XinZ.fig and b/assets/design-export/fig/K5XinZ.fig differ diff --git a/assets/design-export/fig/KJdxg.fig b/assets/design-export/fig/KJdxg.fig index b4171cdbd..27a4a19dc 100644 Binary files a/assets/design-export/fig/KJdxg.fig and b/assets/design-export/fig/KJdxg.fig differ diff --git a/assets/design-export/fig/KaRFX.fig b/assets/design-export/fig/KaRFX.fig index 7f9d7f128..d59d1a28a 100644 Binary files a/assets/design-export/fig/KaRFX.fig and b/assets/design-export/fig/KaRFX.fig differ diff --git a/assets/design-export/fig/KhYNc.fig b/assets/design-export/fig/KhYNc.fig index 35351d15f..454d57278 100644 Binary files a/assets/design-export/fig/KhYNc.fig and b/assets/design-export/fig/KhYNc.fig differ diff --git a/assets/design-export/fig/Kp48V.fig b/assets/design-export/fig/Kp48V.fig index 0dc0ee57f..e0cff0232 100644 Binary files a/assets/design-export/fig/Kp48V.fig and b/assets/design-export/fig/Kp48V.fig differ diff --git a/assets/design-export/fig/LYPXU.fig b/assets/design-export/fig/LYPXU.fig index 3f76a0927..4a4ccbd49 100644 Binary files a/assets/design-export/fig/LYPXU.fig and b/assets/design-export/fig/LYPXU.fig differ diff --git a/assets/design-export/fig/M2sA4u.fig b/assets/design-export/fig/M2sA4u.fig index 840d87ff6..f7dce3d77 100644 Binary files a/assets/design-export/fig/M2sA4u.fig and b/assets/design-export/fig/M2sA4u.fig differ diff --git a/assets/design-export/fig/MaoHP.fig b/assets/design-export/fig/MaoHP.fig index 77348455c..203fcf233 100644 Binary files a/assets/design-export/fig/MaoHP.fig and b/assets/design-export/fig/MaoHP.fig differ diff --git a/assets/design-export/fig/N13Xud.fig b/assets/design-export/fig/N13Xud.fig index 5f30be5e7..220a40c1f 100644 Binary files a/assets/design-export/fig/N13Xud.fig and b/assets/design-export/fig/N13Xud.fig differ diff --git a/assets/design-export/fig/N1GkB.fig b/assets/design-export/fig/N1GkB.fig index d69c3a4c5..1ebca3dc4 100644 Binary files a/assets/design-export/fig/N1GkB.fig and b/assets/design-export/fig/N1GkB.fig differ diff --git a/assets/design-export/fig/N2nTf.fig b/assets/design-export/fig/N2nTf.fig index 6b1b74a45..e4e57d38f 100644 Binary files a/assets/design-export/fig/N2nTf.fig and b/assets/design-export/fig/N2nTf.fig differ diff --git a/assets/design-export/fig/NKiqf.fig b/assets/design-export/fig/NKiqf.fig index 55895a8be..97f56af3f 100644 Binary files a/assets/design-export/fig/NKiqf.fig and b/assets/design-export/fig/NKiqf.fig differ diff --git a/assets/design-export/fig/NLDDv.fig b/assets/design-export/fig/NLDDv.fig index bbb094bbf..15517e67f 100644 Binary files a/assets/design-export/fig/NLDDv.fig and b/assets/design-export/fig/NLDDv.fig differ diff --git a/assets/design-export/fig/NLu2I.fig b/assets/design-export/fig/NLu2I.fig index d18c0baf4..c94e69b47 100644 Binary files a/assets/design-export/fig/NLu2I.fig and b/assets/design-export/fig/NLu2I.fig differ diff --git a/assets/design-export/fig/Ne5TA.fig b/assets/design-export/fig/Ne5TA.fig index 4d3e06239..4028d4c91 100644 Binary files a/assets/design-export/fig/Ne5TA.fig and b/assets/design-export/fig/Ne5TA.fig differ diff --git a/assets/design-export/fig/NqaaU.fig b/assets/design-export/fig/NqaaU.fig index 99d6364fc..948c8c19e 100644 Binary files a/assets/design-export/fig/NqaaU.fig and b/assets/design-export/fig/NqaaU.fig differ diff --git a/assets/design-export/fig/O08uaD.fig b/assets/design-export/fig/O08uaD.fig index 257a79485..623797651 100644 Binary files a/assets/design-export/fig/O08uaD.fig and b/assets/design-export/fig/O08uaD.fig differ diff --git a/assets/design-export/fig/O5kaV.fig b/assets/design-export/fig/O5kaV.fig index 04c2547c6..081ae9d04 100644 Binary files a/assets/design-export/fig/O5kaV.fig and b/assets/design-export/fig/O5kaV.fig differ diff --git a/assets/design-export/fig/OC804.fig b/assets/design-export/fig/OC804.fig index 2dccfc8b9..dc4c55758 100644 Binary files a/assets/design-export/fig/OC804.fig and b/assets/design-export/fig/OC804.fig differ diff --git a/assets/design-export/fig/OecJ5.fig b/assets/design-export/fig/OecJ5.fig index 56a318a5b..ad79fdc5c 100644 Binary files a/assets/design-export/fig/OecJ5.fig and b/assets/design-export/fig/OecJ5.fig differ diff --git a/assets/design-export/fig/P08Uw.fig b/assets/design-export/fig/P08Uw.fig index cd9dff661..13cd5ad84 100644 Binary files a/assets/design-export/fig/P08Uw.fig and b/assets/design-export/fig/P08Uw.fig differ diff --git a/assets/design-export/fig/QFEg9.fig b/assets/design-export/fig/QFEg9.fig index a00f5c93e..6d6d43ffc 100644 Binary files a/assets/design-export/fig/QFEg9.fig and b/assets/design-export/fig/QFEg9.fig differ diff --git a/assets/design-export/fig/QQtUD.fig b/assets/design-export/fig/QQtUD.fig index 0bc8c7248..a633489d8 100644 Binary files a/assets/design-export/fig/QQtUD.fig and b/assets/design-export/fig/QQtUD.fig differ diff --git a/assets/design-export/fig/QgW58.fig b/assets/design-export/fig/QgW58.fig index 6d08b44b8..bb2c97839 100644 Binary files a/assets/design-export/fig/QgW58.fig and b/assets/design-export/fig/QgW58.fig differ diff --git a/assets/design-export/fig/QpEvu.fig b/assets/design-export/fig/QpEvu.fig index 98fc44c5b..cb1038944 100644 Binary files a/assets/design-export/fig/QpEvu.fig and b/assets/design-export/fig/QpEvu.fig differ diff --git a/assets/design-export/fig/R65Xyx.fig b/assets/design-export/fig/R65Xyx.fig index 378746e68..e4bc75b5b 100644 Binary files a/assets/design-export/fig/R65Xyx.fig and b/assets/design-export/fig/R65Xyx.fig differ diff --git a/assets/design-export/fig/RC3Kf.fig b/assets/design-export/fig/RC3Kf.fig index a93e39866..dfeeeef9b 100644 Binary files a/assets/design-export/fig/RC3Kf.fig and b/assets/design-export/fig/RC3Kf.fig differ diff --git a/assets/design-export/fig/RS0KZ.fig b/assets/design-export/fig/RS0KZ.fig index 28069e049..cbb42dea6 100644 Binary files a/assets/design-export/fig/RS0KZ.fig and b/assets/design-export/fig/RS0KZ.fig differ diff --git a/assets/design-export/fig/RodrS.fig b/assets/design-export/fig/RodrS.fig index af2574bb6..d0f76cc36 100644 Binary files a/assets/design-export/fig/RodrS.fig and b/assets/design-export/fig/RodrS.fig differ diff --git a/assets/design-export/fig/RpHBg.fig b/assets/design-export/fig/RpHBg.fig index 7958ee353..98d1ad7e3 100644 Binary files a/assets/design-export/fig/RpHBg.fig and b/assets/design-export/fig/RpHBg.fig differ diff --git a/assets/design-export/fig/Rwnu3.fig b/assets/design-export/fig/Rwnu3.fig index d898999ff..4c665a3ab 100644 Binary files a/assets/design-export/fig/Rwnu3.fig and b/assets/design-export/fig/Rwnu3.fig differ diff --git a/assets/design-export/fig/S7SCDc.fig b/assets/design-export/fig/S7SCDc.fig index 7d528d728..90ff6f384 100644 Binary files a/assets/design-export/fig/S7SCDc.fig and b/assets/design-export/fig/S7SCDc.fig differ diff --git a/assets/design-export/fig/SUcad.fig b/assets/design-export/fig/SUcad.fig index 181777aff..be3c1ee7c 100644 Binary files a/assets/design-export/fig/SUcad.fig and b/assets/design-export/fig/SUcad.fig differ diff --git a/assets/design-export/fig/SUtGZ.fig b/assets/design-export/fig/SUtGZ.fig index a87259015..86a3474b3 100644 Binary files a/assets/design-export/fig/SUtGZ.fig and b/assets/design-export/fig/SUtGZ.fig differ diff --git a/assets/design-export/fig/SeizD.fig b/assets/design-export/fig/SeizD.fig index 83e053242..f8b80fa8b 100644 Binary files a/assets/design-export/fig/SeizD.fig and b/assets/design-export/fig/SeizD.fig differ diff --git a/assets/design-export/fig/Ss0Yr.fig b/assets/design-export/fig/Ss0Yr.fig index 3406faa4d..45522d3f2 100644 Binary files a/assets/design-export/fig/Ss0Yr.fig and b/assets/design-export/fig/Ss0Yr.fig differ diff --git a/assets/design-export/fig/T1wkiT.fig b/assets/design-export/fig/T1wkiT.fig index 07e948771..542b5efd3 100644 Binary files a/assets/design-export/fig/T1wkiT.fig and b/assets/design-export/fig/T1wkiT.fig differ diff --git a/assets/design-export/fig/T70dJ.fig b/assets/design-export/fig/T70dJ.fig index da1d924df..436290205 100644 Binary files a/assets/design-export/fig/T70dJ.fig and b/assets/design-export/fig/T70dJ.fig differ diff --git a/assets/design-export/fig/TBvTC.fig b/assets/design-export/fig/TBvTC.fig index 8db931537..5b734f3cb 100644 Binary files a/assets/design-export/fig/TBvTC.fig and b/assets/design-export/fig/TBvTC.fig differ diff --git a/assets/design-export/fig/TE2jI.fig b/assets/design-export/fig/TE2jI.fig index 297b28881..25d654392 100644 Binary files a/assets/design-export/fig/TE2jI.fig and b/assets/design-export/fig/TE2jI.fig differ diff --git a/assets/design-export/fig/U9xSg.fig b/assets/design-export/fig/U9xSg.fig index 097dcf5f6..6586eb400 100644 Binary files a/assets/design-export/fig/U9xSg.fig and b/assets/design-export/fig/U9xSg.fig differ diff --git a/assets/design-export/fig/UCNBm.fig b/assets/design-export/fig/UCNBm.fig index ca4e51c3c..7f69ce882 100644 Binary files a/assets/design-export/fig/UCNBm.fig and b/assets/design-export/fig/UCNBm.fig differ diff --git a/assets/design-export/fig/UMJli.fig b/assets/design-export/fig/UMJli.fig index 5e84652f9..9204c37d0 100644 Binary files a/assets/design-export/fig/UMJli.fig and b/assets/design-export/fig/UMJli.fig differ diff --git a/assets/design-export/fig/UdnBT.fig b/assets/design-export/fig/UdnBT.fig index 64c92815a..04ad2d60e 100644 Binary files a/assets/design-export/fig/UdnBT.fig and b/assets/design-export/fig/UdnBT.fig differ diff --git a/assets/design-export/fig/UserMenu.fig b/assets/design-export/fig/UserMenu.fig index a304175a5..256a570aa 100644 Binary files a/assets/design-export/fig/UserMenu.fig and b/assets/design-export/fig/UserMenu.fig differ diff --git a/assets/design-export/fig/Uzzje.fig b/assets/design-export/fig/Uzzje.fig index 549df34f5..1c121f7f0 100644 Binary files a/assets/design-export/fig/Uzzje.fig and b/assets/design-export/fig/Uzzje.fig differ diff --git a/assets/design-export/fig/V1VhGE.fig b/assets/design-export/fig/V1VhGE.fig index b55c681c5..36885daa7 100644 Binary files a/assets/design-export/fig/V1VhGE.fig and b/assets/design-export/fig/V1VhGE.fig differ diff --git a/assets/design-export/fig/VM7ro.fig b/assets/design-export/fig/VM7ro.fig index 6659a3da5..8d4880677 100644 Binary files a/assets/design-export/fig/VM7ro.fig and b/assets/design-export/fig/VM7ro.fig differ diff --git a/assets/design-export/fig/VctzT.fig b/assets/design-export/fig/VctzT.fig index 2a2004aba..286bf4bad 100644 Binary files a/assets/design-export/fig/VctzT.fig and b/assets/design-export/fig/VctzT.fig differ diff --git a/assets/design-export/fig/VfB0Y.fig b/assets/design-export/fig/VfB0Y.fig index 74cae81ce..68384c263 100644 Binary files a/assets/design-export/fig/VfB0Y.fig and b/assets/design-export/fig/VfB0Y.fig differ diff --git a/assets/design-export/fig/W8idqY.fig b/assets/design-export/fig/W8idqY.fig index 56e1f055d..8a61ee3e3 100644 Binary files a/assets/design-export/fig/W8idqY.fig and b/assets/design-export/fig/W8idqY.fig differ diff --git a/assets/design-export/fig/WZdnw.fig b/assets/design-export/fig/WZdnw.fig index 90d4426a9..0997524e6 100644 Binary files a/assets/design-export/fig/WZdnw.fig and b/assets/design-export/fig/WZdnw.fig differ diff --git a/assets/design-export/fig/Wj0V4.fig b/assets/design-export/fig/Wj0V4.fig index fb981d9c1..92103ca42 100644 Binary files a/assets/design-export/fig/Wj0V4.fig and b/assets/design-export/fig/Wj0V4.fig differ diff --git a/assets/design-export/fig/WrmU5.fig b/assets/design-export/fig/WrmU5.fig index 01351e0c8..adf6bd607 100644 Binary files a/assets/design-export/fig/WrmU5.fig and b/assets/design-export/fig/WrmU5.fig differ diff --git a/assets/design-export/fig/X405l.fig b/assets/design-export/fig/X405l.fig index c02782f1e..89959c8d4 100644 Binary files a/assets/design-export/fig/X405l.fig and b/assets/design-export/fig/X405l.fig differ diff --git a/assets/design-export/fig/XL5ZU.fig b/assets/design-export/fig/XL5ZU.fig index 427b7dddd..c7838456f 100644 Binary files a/assets/design-export/fig/XL5ZU.fig and b/assets/design-export/fig/XL5ZU.fig differ diff --git a/assets/design-export/fig/XR0f9.fig b/assets/design-export/fig/XR0f9.fig index 9e91f71d8..e9d9fa5ba 100644 Binary files a/assets/design-export/fig/XR0f9.fig and b/assets/design-export/fig/XR0f9.fig differ diff --git a/assets/design-export/fig/Xn5ns.fig b/assets/design-export/fig/Xn5ns.fig index c48b1660a..9528c90e6 100644 Binary files a/assets/design-export/fig/Xn5ns.fig and b/assets/design-export/fig/Xn5ns.fig differ diff --git a/assets/design-export/fig/Y5cmvI.fig b/assets/design-export/fig/Y5cmvI.fig index 3ceb7a945..46a06882e 100644 Binary files a/assets/design-export/fig/Y5cmvI.fig and b/assets/design-export/fig/Y5cmvI.fig differ diff --git a/assets/design-export/fig/YN8cE.fig b/assets/design-export/fig/YN8cE.fig index 37c75d640..9569fd1f6 100644 Binary files a/assets/design-export/fig/YN8cE.fig and b/assets/design-export/fig/YN8cE.fig differ diff --git a/assets/design-export/fig/YPKbV.fig b/assets/design-export/fig/YPKbV.fig index 51a34c802..b5b0f6cd7 100644 Binary files a/assets/design-export/fig/YPKbV.fig and b/assets/design-export/fig/YPKbV.fig differ diff --git a/assets/design-export/fig/Z0oyh.fig b/assets/design-export/fig/Z0oyh.fig index 5c13152bf..c9bf4ad75 100644 Binary files a/assets/design-export/fig/Z0oyh.fig and b/assets/design-export/fig/Z0oyh.fig differ diff --git a/assets/design-export/fig/ZU1BG.fig b/assets/design-export/fig/ZU1BG.fig index 9992af95b..8c27c99a6 100644 Binary files a/assets/design-export/fig/ZU1BG.fig and b/assets/design-export/fig/ZU1BG.fig differ diff --git a/assets/design-export/fig/ZUAq1.fig b/assets/design-export/fig/ZUAq1.fig index 450daf779..2074881fd 100644 Binary files a/assets/design-export/fig/ZUAq1.fig and b/assets/design-export/fig/ZUAq1.fig differ diff --git a/assets/design-export/fig/ZlLf0.fig b/assets/design-export/fig/ZlLf0.fig index b0b3e97c7..852a8cb88 100644 Binary files a/assets/design-export/fig/ZlLf0.fig and b/assets/design-export/fig/ZlLf0.fig differ diff --git a/assets/design-export/fig/a7o9C.fig b/assets/design-export/fig/a7o9C.fig index 0782eb4c8..aecf4cc24 100644 Binary files a/assets/design-export/fig/a7o9C.fig and b/assets/design-export/fig/a7o9C.fig differ diff --git a/assets/design-export/fig/aMU7O.fig b/assets/design-export/fig/aMU7O.fig index 228330a5c..07f2497f9 100644 Binary files a/assets/design-export/fig/aMU7O.fig and b/assets/design-export/fig/aMU7O.fig differ diff --git a/assets/design-export/fig/akr4I.fig b/assets/design-export/fig/akr4I.fig index 82300e1fc..d585b775e 100644 Binary files a/assets/design-export/fig/akr4I.fig and b/assets/design-export/fig/akr4I.fig differ diff --git a/assets/design-export/fig/atqRh.fig b/assets/design-export/fig/atqRh.fig index b57c2a4d1..b48b6f904 100644 Binary files a/assets/design-export/fig/atqRh.fig and b/assets/design-export/fig/atqRh.fig differ diff --git a/assets/design-export/fig/b4eaUf.fig b/assets/design-export/fig/b4eaUf.fig index 4b67d9c7d..3af69306f 100644 Binary files a/assets/design-export/fig/b4eaUf.fig and b/assets/design-export/fig/b4eaUf.fig differ diff --git a/assets/design-export/fig/bHJy6.fig b/assets/design-export/fig/bHJy6.fig index 8569148c0..09896a8e3 100644 Binary files a/assets/design-export/fig/bHJy6.fig and b/assets/design-export/fig/bHJy6.fig differ diff --git a/assets/design-export/fig/bYDHC.fig b/assets/design-export/fig/bYDHC.fig index cc94cb676..53540f022 100644 Binary files a/assets/design-export/fig/bYDHC.fig and b/assets/design-export/fig/bYDHC.fig differ diff --git a/assets/design-export/fig/cDiNb.fig b/assets/design-export/fig/cDiNb.fig index 92d2d8e60..d08ba8831 100644 Binary files a/assets/design-export/fig/cDiNb.fig and b/assets/design-export/fig/cDiNb.fig differ diff --git a/assets/design-export/fig/cluster-security-panel.fig b/assets/design-export/fig/cluster-security-panel.fig new file mode 100644 index 000000000..8fd0f31a1 Binary files /dev/null and b/assets/design-export/fig/cluster-security-panel.fig differ diff --git a/assets/design-export/fig/dBILX.fig b/assets/design-export/fig/dBILX.fig index be182e0f6..9b2662de2 100644 Binary files a/assets/design-export/fig/dBILX.fig and b/assets/design-export/fig/dBILX.fig differ diff --git a/assets/design-export/fig/dPP50.fig b/assets/design-export/fig/dPP50.fig index 663490f59..45ccfe7a1 100644 Binary files a/assets/design-export/fig/dPP50.fig and b/assets/design-export/fig/dPP50.fig differ diff --git a/assets/design-export/fig/dQV9N.fig b/assets/design-export/fig/dQV9N.fig index e2cf425cc..11cb0367f 100644 Binary files a/assets/design-export/fig/dQV9N.fig and b/assets/design-export/fig/dQV9N.fig differ diff --git a/assets/design-export/fig/dhPtX.fig b/assets/design-export/fig/dhPtX.fig index 64910f592..0c373093f 100644 Binary files a/assets/design-export/fig/dhPtX.fig and b/assets/design-export/fig/dhPtX.fig differ diff --git a/assets/design-export/fig/dialog-risky-security-value.fig b/assets/design-export/fig/dialog-risky-security-value.fig new file mode 100644 index 000000000..5d8922472 Binary files /dev/null and b/assets/design-export/fig/dialog-risky-security-value.fig differ diff --git a/assets/design-export/fig/dialog-security-file-access.fig b/assets/design-export/fig/dialog-security-file-access.fig new file mode 100644 index 000000000..205769a87 Binary files /dev/null and b/assets/design-export/fig/dialog-security-file-access.fig differ diff --git a/assets/design-export/fig/dxdEi.fig b/assets/design-export/fig/dxdEi.fig index 9908bcc64..00c350f47 100644 Binary files a/assets/design-export/fig/dxdEi.fig and b/assets/design-export/fig/dxdEi.fig differ diff --git a/assets/design-export/fig/e9FnC.fig b/assets/design-export/fig/e9FnC.fig index 0eee5f952..9ae31ec7c 100644 Binary files a/assets/design-export/fig/e9FnC.fig and b/assets/design-export/fig/e9FnC.fig differ diff --git a/assets/design-export/fig/e9lV4.fig b/assets/design-export/fig/e9lV4.fig index 5ef6bddda..147171608 100644 Binary files a/assets/design-export/fig/e9lV4.fig and b/assets/design-export/fig/e9lV4.fig differ diff --git a/assets/design-export/fig/eGbsg.fig b/assets/design-export/fig/eGbsg.fig index 518c903d6..dfb7305f5 100644 Binary files a/assets/design-export/fig/eGbsg.fig and b/assets/design-export/fig/eGbsg.fig differ diff --git a/assets/design-export/fig/epZO2.fig b/assets/design-export/fig/epZO2.fig index d944d1805..7057c8c76 100644 Binary files a/assets/design-export/fig/epZO2.fig and b/assets/design-export/fig/epZO2.fig differ diff --git a/assets/design-export/fig/f1Vga.fig b/assets/design-export/fig/f1Vga.fig index a992f9d58..023fd03d6 100644 Binary files a/assets/design-export/fig/f1Vga.fig and b/assets/design-export/fig/f1Vga.fig differ diff --git a/assets/design-export/fig/fK8Bi.fig b/assets/design-export/fig/fK8Bi.fig index 04b1f79f7..18a3b3ada 100644 Binary files a/assets/design-export/fig/fK8Bi.fig and b/assets/design-export/fig/fK8Bi.fig differ diff --git a/assets/design-export/fig/fbBqA.fig b/assets/design-export/fig/fbBqA.fig index 1a044ed15..f2be8cb1b 100644 Binary files a/assets/design-export/fig/fbBqA.fig and b/assets/design-export/fig/fbBqA.fig differ diff --git a/assets/design-export/fig/g5mEpx.fig b/assets/design-export/fig/g5mEpx.fig index 7ade7c3b0..1382cabf5 100644 Binary files a/assets/design-export/fig/g5mEpx.fig and b/assets/design-export/fig/g5mEpx.fig differ diff --git a/assets/design-export/fig/gWqMD.fig b/assets/design-export/fig/gWqMD.fig index e3034dcc1..e4daf5331 100644 Binary files a/assets/design-export/fig/gWqMD.fig and b/assets/design-export/fig/gWqMD.fig differ diff --git a/assets/design-export/fig/gX7um.fig b/assets/design-export/fig/gX7um.fig index c88b971a2..e95983ab0 100644 Binary files a/assets/design-export/fig/gX7um.fig and b/assets/design-export/fig/gX7um.fig differ diff --git a/assets/design-export/fig/hLB9Z.fig b/assets/design-export/fig/hLB9Z.fig index 5a2762667..210932937 100644 Binary files a/assets/design-export/fig/hLB9Z.fig and b/assets/design-export/fig/hLB9Z.fig differ diff --git a/assets/design-export/fig/hlwx3.fig b/assets/design-export/fig/hlwx3.fig index b31381c0d..fdc77461f 100644 Binary files a/assets/design-export/fig/hlwx3.fig and b/assets/design-export/fig/hlwx3.fig differ diff --git a/assets/design-export/fig/hmPL7.fig b/assets/design-export/fig/hmPL7.fig index 9aa32b865..55ad2c916 100644 Binary files a/assets/design-export/fig/hmPL7.fig and b/assets/design-export/fig/hmPL7.fig differ diff --git a/assets/design-export/fig/i1bLR.fig b/assets/design-export/fig/i1bLR.fig index 6bdd69655..2eb7c0e24 100644 Binary files a/assets/design-export/fig/i1bLR.fig and b/assets/design-export/fig/i1bLR.fig differ diff --git a/assets/design-export/fig/i4L0M.fig b/assets/design-export/fig/i4L0M.fig index 252287166..a10cb3740 100644 Binary files a/assets/design-export/fig/i4L0M.fig and b/assets/design-export/fig/i4L0M.fig differ diff --git a/assets/design-export/fig/i8wib.fig b/assets/design-export/fig/i8wib.fig index a95e6fe06..b90fee2de 100644 Binary files a/assets/design-export/fig/i8wib.fig and b/assets/design-export/fig/i8wib.fig differ diff --git a/assets/design-export/fig/iLm38.fig b/assets/design-export/fig/iLm38.fig index 01e1a2f81..b591c4544 100644 Binary files a/assets/design-export/fig/iLm38.fig and b/assets/design-export/fig/iLm38.fig differ diff --git a/assets/design-export/fig/iSA6R.fig b/assets/design-export/fig/iSA6R.fig index fc34a971d..a51483005 100644 Binary files a/assets/design-export/fig/iSA6R.fig and b/assets/design-export/fig/iSA6R.fig differ diff --git a/assets/design-export/fig/iYUWc.fig b/assets/design-export/fig/iYUWc.fig index aa8f5d3ec..9bf7dd758 100644 Binary files a/assets/design-export/fig/iYUWc.fig and b/assets/design-export/fig/iYUWc.fig differ diff --git a/assets/design-export/fig/j24cXg.fig b/assets/design-export/fig/j24cXg.fig index 49c3cc648..86152b3b5 100644 Binary files a/assets/design-export/fig/j24cXg.fig and b/assets/design-export/fig/j24cXg.fig differ diff --git a/assets/design-export/fig/j88bl0.fig b/assets/design-export/fig/j88bl0.fig index 8a20bc211..6ab389ab8 100644 Binary files a/assets/design-export/fig/j88bl0.fig and b/assets/design-export/fig/j88bl0.fig differ diff --git a/assets/design-export/fig/j9W8A.fig b/assets/design-export/fig/j9W8A.fig index c97f854e5..8f568a12e 100644 Binary files a/assets/design-export/fig/j9W8A.fig and b/assets/design-export/fig/j9W8A.fig differ diff --git a/assets/design-export/fig/jXykV.fig b/assets/design-export/fig/jXykV.fig index bdf22575a..5ec31ce4f 100644 Binary files a/assets/design-export/fig/jXykV.fig and b/assets/design-export/fig/jXykV.fig differ diff --git a/assets/design-export/fig/jmoi3.fig b/assets/design-export/fig/jmoi3.fig index 2b25399a3..a047bbff1 100644 Binary files a/assets/design-export/fig/jmoi3.fig and b/assets/design-export/fig/jmoi3.fig differ diff --git a/assets/design-export/fig/kK8Ji.fig b/assets/design-export/fig/kK8Ji.fig index 404d6e1eb..62bb461f4 100644 Binary files a/assets/design-export/fig/kK8Ji.fig and b/assets/design-export/fig/kK8Ji.fig differ diff --git a/assets/design-export/fig/kPmoo.fig b/assets/design-export/fig/kPmoo.fig index 7cf88fca0..dd051e281 100644 Binary files a/assets/design-export/fig/kPmoo.fig and b/assets/design-export/fig/kPmoo.fig differ diff --git a/assets/design-export/fig/l64bd.fig b/assets/design-export/fig/l64bd.fig index da930b021..2e81403d0 100644 Binary files a/assets/design-export/fig/l64bd.fig and b/assets/design-export/fig/l64bd.fig differ diff --git a/assets/design-export/fig/l7TRz9.fig b/assets/design-export/fig/l7TRz9.fig index 303eabc4f..14e6e8c22 100644 Binary files a/assets/design-export/fig/l7TRz9.fig and b/assets/design-export/fig/l7TRz9.fig differ diff --git a/assets/design-export/fig/lCTci.fig b/assets/design-export/fig/lCTci.fig index 56b18f4cb..aa456fa12 100644 Binary files a/assets/design-export/fig/lCTci.fig and b/assets/design-export/fig/lCTci.fig differ diff --git a/assets/design-export/fig/lWvcv.fig b/assets/design-export/fig/lWvcv.fig index e9bb8e984..2109e86a5 100644 Binary files a/assets/design-export/fig/lWvcv.fig and b/assets/design-export/fig/lWvcv.fig differ diff --git a/assets/design-export/fig/lhKzN.fig b/assets/design-export/fig/lhKzN.fig index 10e94a91c..61ae42ac7 100644 Binary files a/assets/design-export/fig/lhKzN.fig and b/assets/design-export/fig/lhKzN.fig differ diff --git a/assets/design-export/fig/ljdA5.fig b/assets/design-export/fig/ljdA5.fig index 56fcf80be..5b9ac8dca 100644 Binary files a/assets/design-export/fig/ljdA5.fig and b/assets/design-export/fig/ljdA5.fig differ diff --git a/assets/design-export/fig/m1hP1j.fig b/assets/design-export/fig/m1hP1j.fig index 2e36fdc2c..e79981893 100644 Binary files a/assets/design-export/fig/m1hP1j.fig and b/assets/design-export/fig/m1hP1j.fig differ diff --git a/assets/design-export/fig/m5kOm4.fig b/assets/design-export/fig/m5kOm4.fig index 4fe74869a..8dcc35b70 100644 Binary files a/assets/design-export/fig/m5kOm4.fig and b/assets/design-export/fig/m5kOm4.fig differ diff --git a/assets/design-export/fig/mrF6f.fig b/assets/design-export/fig/mrF6f.fig index f051d9dbb..6e91592b3 100644 Binary files a/assets/design-export/fig/mrF6f.fig and b/assets/design-export/fig/mrF6f.fig differ diff --git a/assets/design-export/fig/n2qdi.fig b/assets/design-export/fig/n2qdi.fig index 5c51eb338..39570a0b8 100644 Binary files a/assets/design-export/fig/n2qdi.fig and b/assets/design-export/fig/n2qdi.fig differ diff --git a/assets/design-export/fig/n6Xlo.fig b/assets/design-export/fig/n6Xlo.fig index 095e58601..a3ec87f16 100644 Binary files a/assets/design-export/fig/n6Xlo.fig and b/assets/design-export/fig/n6Xlo.fig differ diff --git a/assets/design-export/fig/nGJE1.fig b/assets/design-export/fig/nGJE1.fig index 62cc76c16..2810ce789 100644 Binary files a/assets/design-export/fig/nGJE1.fig and b/assets/design-export/fig/nGJE1.fig differ diff --git a/assets/design-export/fig/nNGDX.fig b/assets/design-export/fig/nNGDX.fig index 9fd66b8ab..84e6a44b5 100644 Binary files a/assets/design-export/fig/nNGDX.fig and b/assets/design-export/fig/nNGDX.fig differ diff --git a/assets/design-export/fig/nNL3E.fig b/assets/design-export/fig/nNL3E.fig index 90cf1474f..91725bbdc 100644 Binary files a/assets/design-export/fig/nNL3E.fig and b/assets/design-export/fig/nNL3E.fig differ diff --git a/assets/design-export/fig/nfMMj.fig b/assets/design-export/fig/nfMMj.fig index e9d1eb7bb..0a5e75ec0 100644 Binary files a/assets/design-export/fig/nfMMj.fig and b/assets/design-export/fig/nfMMj.fig differ diff --git a/assets/design-export/fig/o1uEP.fig b/assets/design-export/fig/o1uEP.fig index b082ab0dd..28a6ae399 100644 Binary files a/assets/design-export/fig/o1uEP.fig and b/assets/design-export/fig/o1uEP.fig differ diff --git a/assets/design-export/fig/o4LH8W.fig b/assets/design-export/fig/o4LH8W.fig index a97c9325f..64f11396c 100644 Binary files a/assets/design-export/fig/o4LH8W.fig and b/assets/design-export/fig/o4LH8W.fig differ diff --git a/assets/design-export/fig/oMuyw.fig b/assets/design-export/fig/oMuyw.fig index 4a1fcd594..cdf8fd502 100644 Binary files a/assets/design-export/fig/oMuyw.fig and b/assets/design-export/fig/oMuyw.fig differ diff --git a/assets/design-export/fig/oPF1n.fig b/assets/design-export/fig/oPF1n.fig index 3c2ede106..3020184c5 100644 Binary files a/assets/design-export/fig/oPF1n.fig and b/assets/design-export/fig/oPF1n.fig differ diff --git a/assets/design-export/fig/oyoTs.fig b/assets/design-export/fig/oyoTs.fig index f2f3afaca..99e195e20 100644 Binary files a/assets/design-export/fig/oyoTs.fig and b/assets/design-export/fig/oyoTs.fig differ diff --git a/assets/design-export/fig/p8QSPq.fig b/assets/design-export/fig/p8QSPq.fig index 06bc530be..3c21b1fad 100644 Binary files a/assets/design-export/fig/p8QSPq.fig and b/assets/design-export/fig/p8QSPq.fig differ diff --git a/assets/design-export/fig/pnAbF.fig b/assets/design-export/fig/pnAbF.fig index f5fafea2a..2c40b595b 100644 Binary files a/assets/design-export/fig/pnAbF.fig and b/assets/design-export/fig/pnAbF.fig differ diff --git a/assets/design-export/fig/pssCT.fig b/assets/design-export/fig/pssCT.fig index d811b7c0b..64887ba94 100644 Binary files a/assets/design-export/fig/pssCT.fig and b/assets/design-export/fig/pssCT.fig differ diff --git a/assets/design-export/fig/pszxE.fig b/assets/design-export/fig/pszxE.fig index 2f091f305..3cb4ef2e9 100644 Binary files a/assets/design-export/fig/pszxE.fig and b/assets/design-export/fig/pszxE.fig differ diff --git a/assets/design-export/fig/q31B6w.fig b/assets/design-export/fig/q31B6w.fig index 749ebf652..e82932247 100644 Binary files a/assets/design-export/fig/q31B6w.fig and b/assets/design-export/fig/q31B6w.fig differ diff --git a/assets/design-export/fig/qFLfB.fig b/assets/design-export/fig/qFLfB.fig index 1b0aabcb0..18f3ad8c7 100644 Binary files a/assets/design-export/fig/qFLfB.fig and b/assets/design-export/fig/qFLfB.fig differ diff --git a/assets/design-export/fig/r0heh.fig b/assets/design-export/fig/r0heh.fig index d9c7ca626..0624dccef 100644 Binary files a/assets/design-export/fig/r0heh.fig and b/assets/design-export/fig/r0heh.fig differ diff --git a/assets/design-export/fig/r139UP.fig b/assets/design-export/fig/r139UP.fig index e81bb2cfd..d1865327d 100644 Binary files a/assets/design-export/fig/r139UP.fig and b/assets/design-export/fig/r139UP.fig differ diff --git a/assets/design-export/fig/rJt1I.fig b/assets/design-export/fig/rJt1I.fig index 538b4f233..c7d6b8a93 100644 Binary files a/assets/design-export/fig/rJt1I.fig and b/assets/design-export/fig/rJt1I.fig differ diff --git a/assets/design-export/fig/sSISK.fig b/assets/design-export/fig/sSISK.fig index a6fea3276..a778dfa90 100644 Binary files a/assets/design-export/fig/sSISK.fig and b/assets/design-export/fig/sSISK.fig differ diff --git a/assets/design-export/fig/sZtDi.fig b/assets/design-export/fig/sZtDi.fig index 98705a983..ab9d747db 100644 Binary files a/assets/design-export/fig/sZtDi.fig and b/assets/design-export/fig/sZtDi.fig differ diff --git a/assets/design-export/fig/security-advanced-mobile.fig b/assets/design-export/fig/security-advanced-mobile.fig new file mode 100644 index 000000000..cb69b36f5 Binary files /dev/null and b/assets/design-export/fig/security-advanced-mobile.fig differ diff --git a/assets/design-export/fig/security-advanced.fig b/assets/design-export/fig/security-advanced.fig new file mode 100644 index 000000000..9bcc4ea35 Binary files /dev/null and b/assets/design-export/fig/security-advanced.fig differ diff --git a/assets/design-export/fig/swxkJ.fig b/assets/design-export/fig/swxkJ.fig index 109468557..76c66543c 100644 Binary files a/assets/design-export/fig/swxkJ.fig and b/assets/design-export/fig/swxkJ.fig differ diff --git a/assets/design-export/fig/t3IY3u.fig b/assets/design-export/fig/t3IY3u.fig index c4a631aec..ed917cfda 100644 Binary files a/assets/design-export/fig/t3IY3u.fig and b/assets/design-export/fig/t3IY3u.fig differ diff --git a/assets/design-export/fig/t56aLu.fig b/assets/design-export/fig/t56aLu.fig index 2194e97b8..67faf8516 100644 Binary files a/assets/design-export/fig/t56aLu.fig and b/assets/design-export/fig/t56aLu.fig differ diff --git a/assets/design-export/fig/tSOeI.fig b/assets/design-export/fig/tSOeI.fig index 7021a5deb..447cf1509 100644 Binary files a/assets/design-export/fig/tSOeI.fig and b/assets/design-export/fig/tSOeI.fig differ diff --git a/assets/design-export/fig/tTSdi.fig b/assets/design-export/fig/tTSdi.fig index e8bfcec9a..7f51d6cf1 100644 Binary files a/assets/design-export/fig/tTSdi.fig and b/assets/design-export/fig/tTSdi.fig differ diff --git a/assets/design-export/fig/tY6RD.fig b/assets/design-export/fig/tY6RD.fig index 3b53467b6..3e8722d35 100644 Binary files a/assets/design-export/fig/tY6RD.fig and b/assets/design-export/fig/tY6RD.fig differ diff --git a/assets/design-export/fig/tooKB.fig b/assets/design-export/fig/tooKB.fig index 80878b5c6..78eb3b92b 100644 Binary files a/assets/design-export/fig/tooKB.fig and b/assets/design-export/fig/tooKB.fig differ diff --git a/assets/design-export/fig/tr6cE.fig b/assets/design-export/fig/tr6cE.fig index 279c697fa..f3fe92807 100644 Binary files a/assets/design-export/fig/tr6cE.fig and b/assets/design-export/fig/tr6cE.fig differ diff --git a/assets/design-export/fig/uCA23.fig b/assets/design-export/fig/uCA23.fig index ea1bb7ba4..113a2ff10 100644 Binary files a/assets/design-export/fig/uCA23.fig and b/assets/design-export/fig/uCA23.fig differ diff --git a/assets/design-export/fig/uMiwd.fig b/assets/design-export/fig/uMiwd.fig index 1f9d8c3e0..05d59d4ca 100644 Binary files a/assets/design-export/fig/uMiwd.fig and b/assets/design-export/fig/uMiwd.fig differ diff --git a/assets/design-export/fig/ugDSa.fig b/assets/design-export/fig/ugDSa.fig index 9c05c1c7e..f0bf27335 100644 Binary files a/assets/design-export/fig/ugDSa.fig and b/assets/design-export/fig/ugDSa.fig differ diff --git a/assets/design-export/fig/uoxQW.fig b/assets/design-export/fig/uoxQW.fig index f19863882..bf319d2fc 100644 Binary files a/assets/design-export/fig/uoxQW.fig and b/assets/design-export/fig/uoxQW.fig differ diff --git a/assets/design-export/fig/uw0dB.fig b/assets/design-export/fig/uw0dB.fig index 589da76a3..2313f8c94 100644 Binary files a/assets/design-export/fig/uw0dB.fig and b/assets/design-export/fig/uw0dB.fig differ diff --git a/assets/design-export/fig/vStkb.fig b/assets/design-export/fig/vStkb.fig index b8646d50f..1589c824b 100644 Binary files a/assets/design-export/fig/vStkb.fig and b/assets/design-export/fig/vStkb.fig differ diff --git a/assets/design-export/fig/vUqMl.fig b/assets/design-export/fig/vUqMl.fig index d667a1960..9f63c03ba 100644 Binary files a/assets/design-export/fig/vUqMl.fig and b/assets/design-export/fig/vUqMl.fig differ diff --git a/assets/design-export/fig/vtExV.fig b/assets/design-export/fig/vtExV.fig index eebf5b45d..6705f1ea6 100644 Binary files a/assets/design-export/fig/vtExV.fig and b/assets/design-export/fig/vtExV.fig differ diff --git a/assets/design-export/fig/w1QYmf.fig b/assets/design-export/fig/w1QYmf.fig index 77751c4aa..0f9bde077 100644 Binary files a/assets/design-export/fig/w1QYmf.fig and b/assets/design-export/fig/w1QYmf.fig differ diff --git a/assets/design-export/fig/w34N9.fig b/assets/design-export/fig/w34N9.fig index 2d9062e46..94c4f9d7f 100644 Binary files a/assets/design-export/fig/w34N9.fig and b/assets/design-export/fig/w34N9.fig differ diff --git a/assets/design-export/fig/wqnM9.fig b/assets/design-export/fig/wqnM9.fig index f29d0ccde..8c471b214 100644 Binary files a/assets/design-export/fig/wqnM9.fig and b/assets/design-export/fig/wqnM9.fig differ diff --git a/assets/design-export/fig/wxINm.fig b/assets/design-export/fig/wxINm.fig index 4769f03fb..34c0f3088 100644 Binary files a/assets/design-export/fig/wxINm.fig and b/assets/design-export/fig/wxINm.fig differ diff --git a/assets/design-export/fig/x7MJI.fig b/assets/design-export/fig/x7MJI.fig index f5d83b831..3bd7cc368 100644 Binary files a/assets/design-export/fig/x7MJI.fig and b/assets/design-export/fig/x7MJI.fig differ diff --git a/assets/design-export/fig/xCJlu.fig b/assets/design-export/fig/xCJlu.fig index ef538fdb5..cf1b267c0 100644 Binary files a/assets/design-export/fig/xCJlu.fig and b/assets/design-export/fig/xCJlu.fig differ diff --git a/assets/design-export/fig/xvlB6.fig b/assets/design-export/fig/xvlB6.fig index 132e159af..9d0f4ae2d 100644 Binary files a/assets/design-export/fig/xvlB6.fig and b/assets/design-export/fig/xvlB6.fig differ diff --git a/assets/design-export/fig/y3YcQ.fig b/assets/design-export/fig/y3YcQ.fig index 5202cdc5c..11685fa4a 100644 Binary files a/assets/design-export/fig/y3YcQ.fig and b/assets/design-export/fig/y3YcQ.fig differ diff --git a/assets/design-export/fig/yrxK2.fig b/assets/design-export/fig/yrxK2.fig index af09804d2..c710113ce 100644 Binary files a/assets/design-export/fig/yrxK2.fig and b/assets/design-export/fig/yrxK2.fig differ diff --git a/assets/design-export/fig/zFiOW.fig b/assets/design-export/fig/zFiOW.fig index 333c7629a..a9d0c5572 100644 Binary files a/assets/design-export/fig/zFiOW.fig and b/assets/design-export/fig/zFiOW.fig differ diff --git a/assets/design-export/fig/zM0VF.fig b/assets/design-export/fig/zM0VF.fig index ae3778d5d..8350dc94f 100644 Binary files a/assets/design-export/fig/zM0VF.fig and b/assets/design-export/fig/zM0VF.fig differ diff --git a/assets/design-export/fig/zhLZN.fig b/assets/design-export/fig/zhLZN.fig index c06311c00..60fb98873 100644 Binary files a/assets/design-export/fig/zhLZN.fig and b/assets/design-export/fig/zhLZN.fig differ diff --git a/assets/design-export/fig/zj5a3.fig b/assets/design-export/fig/zj5a3.fig index ae036a160..509233a61 100644 Binary files a/assets/design-export/fig/zj5a3.fig and b/assets/design-export/fig/zj5a3.fig differ diff --git a/assets/design-export/fig/zqzr4.fig b/assets/design-export/fig/zqzr4.fig index 41d2f9fa8..f916b96d8 100644 Binary files a/assets/design-export/fig/zqzr4.fig and b/assets/design-export/fig/zqzr4.fig differ diff --git a/assets/design-export/json/1163467012-1553.json b/assets/design-export/json/1163467012-1553.json new file mode 100644 index 000000000..53e82f788 --- /dev/null +++ b/assets/design-export/json/1163467012-1553.json @@ -0,0 +1,1768 @@ +{ + "file": "1163467012-1553", + "id": "1:39959", + "name": "Screen/Create Server — Step 3 Configure (Risky value confirmation)", + "type": "FRAME", + "x": 6560, + "y": 20454, + "width": 1440, + "height": 2461, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 2461, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:39983", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 2461, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "TopBar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "New", "Search servers…", "AD"] + } + ] + }, + { + "id": "1:39984", + "name": "ModalContainer", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1440, + "height": 2461, + "fills": [{"type": "SOLID", "color": "#000000B3", "opacity": 0.7}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "absolute": true, + "children": [ + { + "id": "1:40010", + "name": "Modal", + "type": "FRAME", + "x": 240, + "y": 77, + "width": 960, + "height": 2307, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 60, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "name": "Header", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 960, + "height": 83, + "component": "Gameplane/Wizard Modal Header", + "componentId": "1:1889", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [20, 28, 20, 28], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "texts": ["New game server", "Step 3 of 5 · Configure"] + }, + { + "id": "1:40037", + "name": "Location placement", + "type": "FRAME", + "x": 0, + "y": 83, + "width": 960, + "height": 102, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 5, + "padding": [12, 24, 12, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:40087", + "name": "Location label", + "type": "TEXT", + "x": 24, + "y": 12, + "width": 40, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Cluster", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Creation location", + "type": "INSTANCE", + "x": 24, + "y": 33, + "width": 912, + "height": 36, + "component": "Gameplane/Select", + "componentId": "1:311", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 2, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 12, 8, 12], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["remote-lab / gameplane-games"] + }, + { + "id": "1:40088", + "name": "Changing location help", + "type": "TEXT", + "x": 24, + "y": 74, + "width": 912, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Changing cluster starts a fresh draft. The chosen cluster handles all creation steps.", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Stepper", + "type": "INSTANCE", + "x": 0, + "y": 185, + "width": 960, + "height": 44, + "component": "Gameplane/Wizard Stepper", + "componentId": "1:1899", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [12, 24, 12, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "texts": [ + "1", + "Template", + "·", + "2", + "Version", + "·", + "3", + "Configure", + "·", + "4", + "Network", + "·", + "5", + "Review" + ] + }, + { + "id": "1:40038", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 229, + "width": 960, + "height": 2010, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40089", + "name": "StepBody", + "type": "FRAME", + "x": 24, + "y": 24, + "width": 627, + "height": 1962, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "Field Server name", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 627, + "height": 83, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Server name", "mc-survival", "Used as pod name and subdomain. Lowercase, dash-separated."] + }, + { + "name": "Field Description", + "type": "INSTANCE", + "x": 0, + "y": 95, + "width": 627, + "height": 98, + "component": "Textarea/Secondary", + "componentId": "1:2119", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Description", "Hardcore survival realm with curated mods. Invite only.", "Max 500 characters."] + }, + { + "id": "1:40170", + "name": "ResourceRow", + "type": "FRAME", + "x": 0, + "y": 205, + "width": 627, + "height": 101, + "layout": { + "mode": "HORIZONTAL", + "gap": 16, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40269", + "name": "Field", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 305.5, + "height": 101, + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "id": "1:40321", + "name": "Label", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 25, + "height": 16, + "opacity": 0, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "CPU", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:40322", + "name": "CtrlRow", + "type": "FRAME", + "x": 0, + "y": 20, + "width": 305.5, + "height": 62, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "CpuSlider", + "type": "INSTANCE", + "x": 0, + "y": 10, + "width": 115.5, + "height": 42, + "component": "Slider", + "componentId": "1:1440", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "texts": ["CPU"] + }, + { + "name": "CpuValue", + "type": "INSTANCE", + "x": 123.5, + "y": 0, + "width": 64, + "height": 62, + "component": "Input/Primary", + "componentId": "1:1082", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "texts": ["Email", "2", "We'll never share your email."] + }, + { + "name": "CpuUnit", + "type": "INSTANCE", + "x": 195.5, + "y": 0, + "width": 110, + "height": 62, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "texts": ["Country", "cores", "Choose your country."] + } + ] + }, + { + "id": "1:40323", + "name": "Helper", + "type": "TEXT", + "x": 0, + "y": 86, + "width": 305.5, + "height": 15, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Max 4 (largest node)", + "font": ["Geist", 400, 11], + "lineHeight": {"value": 139.9999976158142, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40270", + "name": "Field", + "type": "FRAME", + "x": 321.5, + "y": 0, + "width": 305.5, + "height": 101, + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "id": "1:40324", + "name": "Label", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 45, + "height": 16, + "opacity": 0, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Memory", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:40325", + "name": "CtrlRow", + "type": "FRAME", + "x": 0, + "y": 20, + "width": 305.5, + "height": 62, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "MemSlider", + "type": "INSTANCE", + "x": 0, + "y": 10, + "width": 115.5, + "height": 42, + "component": "Slider", + "componentId": "1:1440", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "texts": ["Memory"] + }, + { + "name": "MemValue", + "type": "INSTANCE", + "x": 123.5, + "y": 0, + "width": 64, + "height": 62, + "component": "Input/Primary", + "componentId": "1:1082", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "texts": ["Email", "4", "We'll never share your email."] + }, + { + "name": "MemUnit", + "type": "INSTANCE", + "x": 195.5, + "y": 0, + "width": 110, + "height": 62, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "texts": ["Country", "GiB", "Choose your country."] + } + ] + }, + { + "id": "1:40326", + "name": "Helper", + "type": "TEXT", + "x": 0, + "y": 86, + "width": 305.5, + "height": 15, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Max 13 GiB (largest node)", + "font": ["Geist", 400, 11], + "lineHeight": {"value": 139.9999976158142, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + } + ] + }, + { + "id": "1:40171", + "name": "ReserveLess", + "type": "FRAME", + "x": 0, + "y": 318, + "width": 627, + "height": 56, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40271", + "name": "SwitchRow", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 627, + "height": 20, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Switch", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 36, + "height": 20, + "component": "Gameplane/Switch/Off", + "componentId": "1:1470", + "fills": [{"type": "SOLID", "color": "#2C2932"}], + "cornerRadius": 24, + "variables": {"cornerRadius": "radius/3xl", "fills/0/color": "border/border"} + }, + { + "id": "1:40327", + "name": "Label", + "type": "TEXT", + "x": 48, + "y": 1, + "width": 170, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Reserve less than the limit", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:40272", + "name": "Helper", + "type": "TEXT", + "x": 0, + "y": 26, + "width": 627, + "height": 30, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Only the reserved amount counts when the server is placed on a node, so more servers fit; it can use more, up to the limit, when the node has room (Burstable QoS).", + "font": ["Geist", 400, 11], + "lineHeight": {"value": 139.9999976158142, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40172", + "name": "StoragePlacementRow", + "type": "FRAME", + "x": 0, + "y": 386, + "width": 627, + "height": 79, + "layout": { + "mode": "HORIZONTAL", + "gap": 16, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Field Persistent storage", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 305.5, + "height": 79, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "texts": ["Persistent storage", "20Gi", "Mounted at /data (RWO PVC)."] + }, + { + "id": "1:40273", + "name": "NodePlacement", + "type": "FRAME", + "x": 321.5, + "y": 0, + "width": 305.5, + "height": 75, + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "id": "1:40328", + "name": "Label", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 91, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Node placement", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:40329", + "name": "Segmented", + "type": "FRAME", + "x": 0, + "y": 20, + "width": 318, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [4, 4, 4, 4], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:40342", + "name": "Seg", + "type": "FRAME", + "x": 4, + "y": 4, + "width": 117, + "height": 28, + "fills": [{"type": "SOLID", "color": "#2C1926"}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "accent/soft"}, + "children": [ + { + "id": "1:40352", + "name": "Label", + "type": "TEXT", + "x": 12, + "y": 6, + "width": 93, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "text": "Auto (scheduler)", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/accent"} + } + ] + }, + { + "id": "1:40343", + "name": "Seg", + "type": "FRAME", + "x": 125, + "y": 4, + "width": 87, + "height": 28, + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "children": [ + { + "id": "1:40353", + "name": "Label", + "type": "TEXT", + "x": 12, + "y": 6, + "width": 63, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Pin to node", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40344", + "name": "Seg", + "type": "FRAME", + "x": 216, + "y": 4, + "width": 98, + "height": 28, + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "children": [ + { + "id": "1:40354", + "name": "Label", + "type": "TEXT", + "x": 12, + "y": 6, + "width": 74, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "GPU-enabled", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + } + ] + }, + { + "id": "1:40330", + "name": "Helper", + "type": "TEXT", + "x": 0, + "y": 60, + "width": 305.5, + "height": 15, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Picks node with most free memory, tolerations or no taints.", + "font": ["Geist", 400, 11], + "lineHeight": {"value": 139.9999976158142, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + } + ] + }, + { + "id": "1:40173", + "name": "TemplateConfigSection", + "type": "FRAME", + "x": 0, + "y": 477, + "width": 627, + "height": 1013, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40274", + "name": "SectionLabel", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 146, + "height": 14, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "TEMPLATE CONFIGURATION", + "font": ["Geist", 500, 11], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "name": "Field Difficulty", + "type": "INSTANCE", + "x": 0, + "y": 26, + "width": 627, + "height": 60, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Difficulty", "easy", "Choose your country."] + }, + { + "name": "Field Game mode", + "type": "INSTANCE", + "x": 0, + "y": 98, + "width": 627, + "height": 60, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Game mode", "survival", "Choose your country."] + }, + { + "name": "Field Max players", + "type": "INSTANCE", + "x": 0, + "y": 170, + "width": 627, + "height": 60, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Max players", "20", "We'll never share your email."] + }, + { + "name": "Field MOTD", + "type": "INSTANCE", + "x": 0, + "y": 242, + "width": 627, + "height": 77, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["MOTD", "A Gameplane Minecraft server", "Server description shown in the multiplayer list."] + }, + { + "name": "Field World seed", + "type": "INSTANCE", + "x": 0, + "y": 331, + "width": 627, + "height": 77, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["World seed", "Leave blank for a random seed."] + }, + { + "name": "Field Enforce whitelist", + "type": "INSTANCE", + "x": 0, + "y": 420, + "width": 627, + "height": 60, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Enforce whitelist", "false", "Choose your country."] + }, + { + "name": "Field PvP enabled", + "type": "INSTANCE", + "x": 0, + "y": 492, + "width": 627, + "height": 60, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["PvP enabled", "true", "Choose your country."] + }, + { + "name": "Field Hardcore mode", + "type": "INSTANCE", + "x": 0, + "y": 564, + "width": 627, + "height": 60, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Hardcore mode", "false", "Choose your country."] + }, + { + "name": "Field Online mode", + "type": "INSTANCE", + "x": 0, + "y": 636, + "width": 627, + "height": 76, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Online mode", "true", "Verify players with Mojang. Disable only for offline/LAN setups."] + }, + { + "name": "Field View distance (chunks)", + "type": "INSTANCE", + "x": 0, + "y": 724, + "width": 627, + "height": 60, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["View distance (chunks)", "10", "We'll never share your email."] + }, + { + "name": "Field JVM max heap", + "type": "INSTANCE", + "x": 0, + "y": 796, + "width": 627, + "height": 111, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": [ + "JVM max heap", + "Auto: 75% of the memory limit", + "Java heap ceiling (-Xmx, e.g. 2G, 3072M). Leave empty to size it automatically to 75% of the container memory limit — it then tracks the limit whenever you resize the server. If you set it yourself, keep roughly 25% below the limit: the JVM needs headroom for non-heap memory, and exceeding the limit gets the server OOM-killed." + ] + }, + { + "name": "Field JVM initial heap", + "type": "INSTANCE", + "x": 0, + "y": 919, + "width": 627, + "height": 94, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": [ + "JVM initial heap", + "Auto: 75% of the memory limit", + "Starting heap size (-Xms), at most JVM max heap. Leave empty to match the automatic max heap (a fixed heap avoids GC resizes)." + ] + } + ] + }, + { + "name": "Gameplane/Security Advanced", + "type": "INSTANCE", + "x": 0, + "y": 1502, + "width": 627, + "height": 460, + "component": "Gameplane/Security Advanced", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "Advanced security", + "1 override", + "Who the game runs as, and how the data volume's group is fixed. Leave a setting on Module default unless the game needs something else.", + "Run-as user", + "User ID the game process runs as.", + "Module default: image default", + "Custom value", + "1000", + "Risky", + "Run-as group", + "Group ID the game process runs as.", + "Module default: 1000", + "Module default", + "Filesystem group", + "Group that owns the data volume, so the game can write to it.", + "Module default: 1000", + "Module default", + "Volume ownership check", + "When the data volume's group is fixed on start.", + "Module default: Only when wrong (built-in)", + "Module default" + ] + } + ] + }, + { + "id": "1:40090", + "name": "Preview", + "type": "FRAME", + "x": 663, + "y": 24, + "width": 273, + "height": 387, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 8, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:40174", + "name": "PreviewHeader", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 273, + "height": 56, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [12, 14, 12, 14], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:40275", + "name": "IconWrap", + "type": "FRAME", + "x": 14, + "y": 14, + "width": 28, + "height": 28, + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"fills/0/color": "default/default"}, + "children": [ + { + "id": "1:40331", + "name": "GameIcon", + "type": "FRAME", + "x": 6, + "y": 6, + "width": 16, + "height": 16, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:40345", + "name": "path", + "type": "VECTOR", + "x": 1.3, + "y": 1.33, + "width": 13.4, + "height": 13.33, + "fills": [{"type": "SOLID", "color": "#9E98A6"}] + } + ] + } + ] + }, + { + "id": "1:40276", + "name": "TitleGroup", + "type": "FRAME", + "x": 50, + "y": 12, + "width": 144, + "height": 32, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:40332", + "name": "Title", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 144, + "height": 17, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Minecraft (Java Edition)", + "font": ["Geist", 500, 13], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:40333", + "name": "Subtitle", + "type": "TEXT", + "x": 0, + "y": 19, + "width": 144, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Template: minecraft-java", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + } + ] + } + ] + }, + { + "id": "1:40175", + "name": "CodeBlockWrap", + "type": "FRAME", + "x": 0, + "y": 56, + "width": 273, + "height": 277, + "fills": [{"type": "SOLID", "color": "#0A0A0A"}], + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [12, 14, 12, 14], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40277", + "name": "L0", + "type": "TEXT", + "x": 14, + "y": 12, + "width": 216, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "apiVersion: gameplane.local/v1alpha1", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40278", + "name": "L1", + "type": "TEXT", + "x": 14, + "y": 27, + "width": 96, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "kind: GameServer", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40279", + "name": "L2", + "type": "TEXT", + "x": 14, + "y": 42, + "width": 54, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "metadata:", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40280", + "name": "L3", + "type": "TEXT", + "x": 14, + "y": 57, + "width": 114, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " name: mc-survival", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40281", + "name": "L4", + "type": "TEXT", + "x": 14, + "y": 72, + "width": 30, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "spec:", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40282", + "name": "L5", + "type": "TEXT", + "x": 14, + "y": 87, + "width": 156, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " template: minecraft-java", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40283", + "name": "L6", + "type": "TEXT", + "x": 14, + "y": 102, + "width": 144, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " version: fabric-1.21.4", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40284", + "name": "L7", + "type": "TEXT", + "x": 14, + "y": 117, + "width": 72, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " resources:", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40285", + "name": "L8", + "type": "TEXT", + "x": 14, + "y": 132, + "width": 84, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " cpu: 2000m", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40286", + "name": "L9", + "type": "TEXT", + "x": 14, + "y": 147, + "width": 90, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " memory: 6Gi", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40287", + "name": "L10", + "type": "TEXT", + "x": 14, + "y": 162, + "width": 90, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " storage: 50Gi", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40288", + "name": "L11", + "type": "TEXT", + "x": 14, + "y": 177, + "width": 54, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " config:", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40289", + "name": "L12", + "type": "TEXT", + "x": 14, + "y": 192, + "width": 180, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " motd: \"A Gameplane server\"", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40290", + "name": "L13", + "type": "TEXT", + "x": 14, + "y": 207, + "width": 108, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " maxPlayers: 20", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40291", + "name": "L14", + "type": "TEXT", + "x": 14, + "y": 222, + "width": 120, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " difficulty: hard", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40292", + "name": "L15", + "type": "TEXT", + "x": 14, + "y": 237, + "width": 132, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " gamemode: survival", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40293", + "name": "L16", + "type": "TEXT", + "x": 14, + "y": 252, + "width": 120, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " onlineMode: true", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40176", + "name": "MemoryTip", + "type": "FRAME", + "x": 0, + "y": 333, + "width": 273, + "height": 54, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [12, 14, 12, 14], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:40294", + "name": "TipText", + "type": "TEXT", + "x": 14, + "y": 12, + "width": 245, + "height": 30, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "Memory tip — factor in mod/plugin overhead; Minecraft Vanilla uses ~1.5 GB at 4 players.", + "font": ["Geist", 400, 11], + "lineHeight": {"value": 139.9999976158142, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + } + ] + } + ] + }, + { + "name": "Footer", + "type": "INSTANCE", + "x": 0, + "y": 2239, + "width": 960, + "height": 68, + "component": "Gameplane/Wizard Modal Footer", + "componentId": "1:2019", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [16, 28, 16, 28], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Docs: Creating game servers", "Cancel", "Continue to Version"] + } + ] + } + ] + }, + { + "id": "1:39985", + "name": "Modal backdrop", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1440, + "height": 2461, + "fills": [{"type": "SOLID", "color": "#000000", "opacity": 0.4}], + "absolute": true, + "clips": true, + "children": [ + { + "name": "Gameplane/Dialog/Risky Security Value", + "type": "INSTANCE", + "x": 480, + "y": 1502, + "width": 480, + "height": 271, + "component": "Gameplane/Dialog/Risky Security Value", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 32, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "Keep a risky value for Run-as user?", + "The module marks this setting as risky. Its reason:", + "The image must start as root to drop privileges; forcing a user breaks its start.", + "With 1000 the server may fail to start. You can clear the override later to go back to the module default.", + "Cancel", + "Keep value" + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1163467012-2214.json b/assets/design-export/json/1163467012-2214.json new file mode 100644 index 000000000..12918cf84 --- /dev/null +++ b/assets/design-export/json/1163467012-2214.json @@ -0,0 +1,768 @@ +{ + "file": "1163467012-2214", + "id": "1:39956", + "name": "Screen/Mobile — Server Detail — Settings · Security", + "type": "FRAME", + "x": 14760, + "y": 54439, + "width": 375, + "height": 1352, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Mobile header", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 375, + "height": 64, + "component": "Gameplane/Mobile TopBar", + "componentId": "1:1782", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 16, 0, 16], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "texts": ["mc-survival", "AD"] + }, + { + "id": "1:39975", + "name": "Server detail header", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 375, + "height": 244, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [16, 16, 0, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40002", + "name": "Wrapped server header", + "type": "FRAME", + "x": 16, + "y": 16, + "width": 343, + "height": 166, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "id": "1:40027", + "name": "srvLeft", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 343, + "height": 70, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40076", + "name": "gameIcon", + "type": "FRAME", + "x": 0, + "y": 17, + "width": 36, + "height": 36, + "fills": [{"type": "SOLID", "color": "#5B9A3E33", "opacity": 0.2}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "children": [ + { + "id": "1:40153", + "name": "gameIconLabel", + "type": "TEXT", + "x": 8, + "y": 7.5, + "width": 20, + "height": 21, + "fills": [{"type": "SOLID", "color": "#5B9A3E"}], + "text": "MI", + "font": ["JetBrains Mono", 700, 16], + "variables": {"fontFamily": "typography/font-mono"} + } + ] + }, + { + "id": "1:40077", + "name": "srvTitle", + "type": "FRAME", + "x": 48, + "y": 0, + "width": 295, + "height": 70, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "id": "1:40154", + "name": "srvNameRow", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 221, + "height": 32, + "layout": { + "mode": "HORIZONTAL", + "gap": 10, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:40216", + "name": "srvName", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 159, + "height": 32, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "mc-survival", + "font": ["JetBrains Mono", 600, 24], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "foreground/foreground"} + }, + { + "name": "statusBadge", + "type": "INSTANCE", + "x": 169, + "y": 7.5, + "width": 52, + "height": 17, + "component": "Chip/Soft/Success/SM", + "componentId": "1:1790", + "fills": [{"type": "SOLID", "color": "#17C964", "opacity": 0.15}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 2, + "padding": [2, 4, 2, 4], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"cornerRadius": "radius/2xl", "fills/0/color": "success/soft"}, + "texts": ["Running"] + } + ] + }, + { + "id": "1:40155", + "name": "srvSubtitle", + "type": "TEXT", + "x": 0, + "y": 38, + "width": 295, + "height": 32, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "site: remote-lab · minecraft-java · 1.21.4-fabric · ns: gameplane-games", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + } + ] + }, + { + "id": "1:40028", + "name": "Wrapped server actions", + "type": "FRAME", + "x": 0, + "y": 86, + "width": 343, + "height": 80, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40078", + "name": "Lifecycle actions", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 244, + "height": 36, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "name": "Restart", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 105, + "height": 36, + "component": "Button/Outline/MD", + "componentId": "1:1794", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 16, 8, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "itemSpacing": "spacing/2", + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/4", + "paddingLeft": "spacing/4", + "strokes/0/color": "border-2" + }, + "texts": ["Restart"] + }, + { + "name": "Stop", + "type": "INSTANCE", + "x": 113, + "y": 0, + "width": 87, + "height": 36, + "component": "Button/Outline/MD", + "componentId": "1:1794", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 16, 8, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "itemSpacing": "spacing/2", + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/4", + "paddingLeft": "spacing/4", + "strokes/0/color": "border-2" + }, + "texts": ["Stop"] + }, + { + "name": "More", + "type": "INSTANCE", + "x": 208, + "y": 0, + "width": 36, + "height": 36, + "component": "Button/Outline/Icon/MD", + "componentId": "1:774", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"cornerRadius": "radius/3xl", "strokes/0/color": "border-2"} + } + ] + }, + { + "name": "Open console", + "type": "INSTANCE", + "x": 0, + "y": 44, + "width": 146, + "height": 36, + "component": "Button/Primary/MD", + "componentId": "1:1094", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 16, 8, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "itemSpacing": "spacing/2", + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "accent/accent" + }, + "texts": ["Open console"] + } + ] + } + ] + }, + { + "id": "1:40003", + "name": "Server tabs — scrolled to Settings", + "type": "FRAME", + "x": 16, + "y": 198, + "width": 343, + "height": 46, + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "clips": true, + "children": [ + { + "name": "Backups tab", + "type": "INSTANCE", + "x": 0, + "y": 7, + "width": 90, + "height": 32, + "component": "Tab/Inactive", + "componentId": "1:967", + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 16, 0, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"cornerRadius": "radius/3xl"}, + "texts": ["Backups"] + }, + { + "name": "Capture tab", + "type": "INSTANCE", + "x": 94, + "y": 7, + "width": 85, + "height": 32, + "component": "Tab/Inactive", + "componentId": "1:967", + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 16, 0, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"cornerRadius": "radius/3xl"}, + "texts": ["Capture"] + }, + { + "name": "Settings tab", + "type": "INSTANCE", + "x": 183, + "y": 7, + "width": 87, + "height": 32, + "component": "Tab/Active", + "componentId": "1:965", + "fills": [{"type": "SOLID", "color": "#1D1B22"}], + "effects": [{"type": "DROP_SHADOW", "radius": 3, "visible": true}], + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 16, 0, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"cornerRadius": "radius/3xl", "fills/0/color": "segment"}, + "texts": ["Settings"] + } + ] + } + ] + }, + { + "id": "1:39976", + "name": "Settings section tabs — scrolled to Security", + "type": "FRAME", + "x": 0, + "y": 308, + "width": 375, + "height": 50, + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 8, 8, 8], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "clips": true, + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:40004", + "name": "snPlacement2", + "type": "FRAME", + "x": 8, + "y": 8, + "width": 93, + "height": 34, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 12, 8, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:40029", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 69, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Placement", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40005", + "name": "snSecurity", + "type": "FRAME", + "x": 101, + "y": 8, + "width": 78, + "height": 34, + "fills": [{"type": "SOLID", "color": "#17151A"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 12, 8, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"fills/0/color": "surface/secondary"}, + "children": [ + { + "id": "1:40030", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 54, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Security", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:40006", + "name": "snRBACaccess", + "type": "FRAME", + "x": 179, + "y": 8, + "width": 122, + "height": 34, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 12, 8, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:40031", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 98, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "RBAC & access", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40007", + "name": "snSharelinks", + "type": "FRAME", + "x": 301, + "y": 8, + "width": 95, + "height": 34, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 12, 8, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:40032", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 71, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Share links", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + } + ] + }, + { + "id": "1:39977", + "name": "Form Body", + "type": "FRAME", + "x": 0, + "y": 358, + "width": 375, + "height": 938, + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Gameplane/Security Advanced/Mobile", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 327, + "height": 890, + "component": "Gameplane/Security Advanced/Mobile", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "Advanced security", + "1 override", + "Who the game runs as, and how the data volume's group is fixed. Leave a setting on Module default unless the game needs something else.", + "Applies on the next restart", + "Saving never restarts the server. Pending values take effect the next time it starts.", + "Run-as user", + "User ID the game process runs as.", + "Module default: 1000", + "Custom value", + "1000", + "Applied: 1000", + "Module default", + "Pending: 1000 · applies on the next restart", + "Run-as group", + "Group ID the game process runs as.", + "Module default: 1000", + "Module default", + "Applied: 1000", + "Module default", + "Filesystem group", + "Group that owns the data volume, so the game can write to it.", + "Module default: 1000", + "Module default", + "Applied: 1000", + "Module default", + "Volume ownership check", + "When the data volume's group is fixed on start.", + "Module default: Only when wrong (built-in)", + "Module default", + "Applied: Only when wrong", + "Built-in default" + ] + } + ] + }, + { + "id": "1:39978", + "name": "Form Footer", + "type": "FRAME", + "x": 0, + "y": 1296, + "width": 375, + "height": 56, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 24, 12, 24], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "Btn Discard", + "type": "INSTANCE", + "x": 148, + "y": 12, + "width": 86, + "height": 32, + "component": "Gameplane/Button/Small/Ghost", + "componentId": "1:1124", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "texts": ["Discard"] + }, + { + "name": "Btn Save Changes", + "type": "INSTANCE", + "x": 246, + "y": 12, + "width": 105, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "texts": ["Save changes"] + } + ] + } + ] +} diff --git a/assets/design-export/json/1163467012-2492.json b/assets/design-export/json/1163467012-2492.json new file mode 100644 index 000000000..a7bae058d --- /dev/null +++ b/assets/design-export/json/1163467012-2492.json @@ -0,0 +1,580 @@ +{ + "file": "1163467012-2492", + "id": "1:39960", + "name": "Screen/Cluster Details — Configuration — Remote (Allow root on)", + "type": "FRAME", + "x": 23470, + "y": 68073, + "width": 1440, + "height": 1293, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 1293, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:39986", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 1293, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Top Bar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "Clusters › Remote lab › Configuration", "Search servers…", "AD"] + }, + { + "id": "1:40011", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 1229, + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Page Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 53, + "component": "Gameplane/Page Header", + "componentId": "1:3282", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": ["Remote lab", "remote-lab · Registered workload cluster"] + }, + { + "id": "1:40039", + "name": "Cluster detail tabs", + "type": "FRAME", + "x": 24, + "y": 101, + "width": 1132, + "height": 44, + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [0, 0, 12, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "separator/separator"}, + "children": [ + { + "name": "Overview tab", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 94, + "height": 32, + "component": "Tab/Inactive", + "componentId": "1:967", + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 16, 0, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"cornerRadius": "radius/3xl"}, + "texts": ["Overview"] + }, + { + "name": "Nodes tab", + "type": "INSTANCE", + "x": 98, + "y": 0, + "width": 75, + "height": 32, + "component": "Tab/Inactive", + "componentId": "1:967", + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 16, 0, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"cornerRadius": "radius/3xl"}, + "texts": ["Nodes"] + }, + { + "name": "Configuration tab", + "type": "INSTANCE", + "x": 177, + "y": 0, + "width": 121, + "height": 32, + "component": "Tab/Active", + "componentId": "1:965", + "fills": [{"type": "SOLID", "color": "#1D1B22"}], + "effects": [{"type": "DROP_SHADOW", "radius": 3, "visible": true}], + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 16, 0, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"cornerRadius": "radius/3xl", "fills/0/color": "segment"}, + "texts": ["Configuration"] + } + ] + }, + { + "id": "1:40040", + "name": "Access", + "type": "FRAME", + "x": 24, + "y": 169, + "width": 1132, + "height": 95, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "id": "1:40091", + "name": "Access heading", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 1092, + "height": 23, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Access", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:40092", + "name": "Access description", + "type": "TEXT", + "x": 20, + "y": 55, + "width": 1092, + "height": 20, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Node enrollment and kubeconfig downloads are managed at this remote cluster.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40041", + "name": "Storage", + "type": "FRAME", + "x": 24, + "y": 288, + "width": 1132, + "height": 95, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "id": "1:40093", + "name": "Storage heading", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 1092, + "height": 23, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Storage", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:40094", + "name": "Storage description", + "type": "TEXT", + "x": 20, + "y": 55, + "width": 1092, + "height": 20, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Storage settings are managed on this cluster. Install-time storage values are available only for the built-in local cluster.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40042", + "name": "Backup destinations", + "type": "FRAME", + "x": 24, + "y": 407, + "width": 1132, + "height": 175, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "id": "1:40095", + "name": "Backup destinations heading", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 1092, + "height": 23, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Backup destinations", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:40096", + "name": "Backup destinations description", + "type": "TEXT", + "x": 20, + "y": 55, + "width": 1092, + "height": 20, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Repositories used by servers running on Remote lab.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:40097", + "name": "Empty backup destinations", + "type": "TEXT", + "x": 20, + "y": 87, + "width": 1092, + "height": 20, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "No backup destinations configured. Add one to enable snapshots.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "name": "Add remote backup destination", + "type": "INSTANCE", + "x": 20, + "y": 119, + "width": 159, + "height": 36, + "component": "Button/Primary/MD", + "componentId": "1:1094", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 16, 8, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "itemSpacing": "spacing/2", + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "accent/accent" + }, + "texts": ["Add destination"] + } + ] + }, + { + "name": "Security", + "type": "INSTANCE", + "x": 24, + "y": 606, + "width": 1132, + "height": 209, + "component": "Gameplane/Cluster Security Panel", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "Security", + "How game servers on this cluster may run.", + "Allow root overrides", + "Lets server owners run a game as root (user or group 0), or with the image's default user. Off by default, set per cluster.", + "Turning this off does not stop running servers on this cluster. Stopped servers that hold a root override will not start until the override is cleared or this is turned back on.", + "Control-plane namespace", + "gameplane-system" + ] + }, + { + "id": "1:40043", + "name": "Remove cluster", + "type": "FRAME", + "x": 24, + "y": 839, + "width": 1132, + "height": 143, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2E1317"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/3xl", "fills/0/color": "surface/surface", "strokes/0/color": "danger/soft"}, + "children": [ + { + "id": "1:40098", + "name": "Remove cluster heading", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 1092, + "height": 23, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Remove cluster", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:40099", + "name": "Remove cluster description", + "type": "TEXT", + "x": 20, + "y": 55, + "width": 1092, + "height": 20, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Remove this panel’s connection to Remote lab. Running workloads remain on the cluster.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "name": "Remove cluster registration", + "type": "INSTANCE", + "x": 20, + "y": 87, + "width": 159, + "height": 36, + "component": "Button/Danger Soft/MD", + "componentId": "1:5593", + "fills": [{"type": "SOLID", "color": "#2E1317"}], + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 16, 8, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "itemSpacing": "spacing/2", + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "danger/soft" + }, + "texts": ["Remove cluster"] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1163467012-259.json b/assets/design-export/json/1163467012-259.json new file mode 100644 index 000000000..3180aff16 --- /dev/null +++ b/assets/design-export/json/1163467012-259.json @@ -0,0 +1,1719 @@ +{ + "file": "1163467012-259", + "id": "1:39957", + "name": "Screen/Create Server — Step 3 Configure (Advanced security open)", + "type": "FRAME", + "x": 3280, + "y": 20454, + "width": 1440, + "height": 2461, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 2461, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:39979", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 2461, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "TopBar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "New", "Search servers…", "AD"] + } + ] + }, + { + "id": "1:39980", + "name": "ModalContainer", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1440, + "height": 2461, + "fills": [{"type": "SOLID", "color": "#000000B3", "opacity": 0.7}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "absolute": true, + "children": [ + { + "id": "1:40008", + "name": "Modal", + "type": "FRAME", + "x": 240, + "y": 77, + "width": 960, + "height": 2307, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 60, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "name": "Header", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 960, + "height": 83, + "component": "Gameplane/Wizard Modal Header", + "componentId": "1:1889", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [20, 28, 20, 28], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "texts": ["New game server", "Step 3 of 5 · Configure"] + }, + { + "id": "1:40033", + "name": "Location placement", + "type": "FRAME", + "x": 0, + "y": 83, + "width": 960, + "height": 102, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 5, + "padding": [12, 24, 12, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:40079", + "name": "Location label", + "type": "TEXT", + "x": 24, + "y": 12, + "width": 40, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Cluster", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Creation location", + "type": "INSTANCE", + "x": 24, + "y": 33, + "width": 912, + "height": 36, + "component": "Gameplane/Select", + "componentId": "1:311", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 2, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 12, 8, 12], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["remote-lab / gameplane-games"] + }, + { + "id": "1:40080", + "name": "Changing location help", + "type": "TEXT", + "x": 24, + "y": 74, + "width": 912, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Changing cluster starts a fresh draft. The chosen cluster handles all creation steps.", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Stepper", + "type": "INSTANCE", + "x": 0, + "y": 185, + "width": 960, + "height": 44, + "component": "Gameplane/Wizard Stepper", + "componentId": "1:1899", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [12, 24, 12, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "texts": [ + "1", + "Template", + "·", + "2", + "Version", + "·", + "3", + "Configure", + "·", + "4", + "Network", + "·", + "5", + "Review" + ] + }, + { + "id": "1:40034", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 229, + "width": 960, + "height": 2010, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40081", + "name": "StepBody", + "type": "FRAME", + "x": 24, + "y": 24, + "width": 627, + "height": 1962, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "Field Server name", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 627, + "height": 83, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Server name", "mc-survival", "Used as pod name and subdomain. Lowercase, dash-separated."] + }, + { + "name": "Field Description", + "type": "INSTANCE", + "x": 0, + "y": 95, + "width": 627, + "height": 98, + "component": "Textarea/Secondary", + "componentId": "1:2119", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Description", "Hardcore survival realm with curated mods. Invite only.", "Max 500 characters."] + }, + { + "id": "1:40156", + "name": "ResourceRow", + "type": "FRAME", + "x": 0, + "y": 205, + "width": 627, + "height": 101, + "layout": { + "mode": "HORIZONTAL", + "gap": 16, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40217", + "name": "Field", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 305.5, + "height": 101, + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "id": "1:40295", + "name": "Label", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 25, + "height": 16, + "opacity": 0, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "CPU", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:40296", + "name": "CtrlRow", + "type": "FRAME", + "x": 0, + "y": 20, + "width": 305.5, + "height": 62, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "CpuSlider", + "type": "INSTANCE", + "x": 0, + "y": 10, + "width": 115.5, + "height": 42, + "component": "Slider", + "componentId": "1:1440", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "texts": ["CPU"] + }, + { + "name": "CpuValue", + "type": "INSTANCE", + "x": 123.5, + "y": 0, + "width": 64, + "height": 62, + "component": "Input/Primary", + "componentId": "1:1082", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "texts": ["Email", "2", "We'll never share your email."] + }, + { + "name": "CpuUnit", + "type": "INSTANCE", + "x": 195.5, + "y": 0, + "width": 110, + "height": 62, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "texts": ["Country", "cores", "Choose your country."] + } + ] + }, + { + "id": "1:40297", + "name": "Helper", + "type": "TEXT", + "x": 0, + "y": 86, + "width": 305.5, + "height": 15, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Max 4 (largest node)", + "font": ["Geist", 400, 11], + "lineHeight": {"value": 139.9999976158142, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40218", + "name": "Field", + "type": "FRAME", + "x": 321.5, + "y": 0, + "width": 305.5, + "height": 101, + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "id": "1:40298", + "name": "Label", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 45, + "height": 16, + "opacity": 0, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Memory", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:40299", + "name": "CtrlRow", + "type": "FRAME", + "x": 0, + "y": 20, + "width": 305.5, + "height": 62, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "MemSlider", + "type": "INSTANCE", + "x": 0, + "y": 10, + "width": 115.5, + "height": 42, + "component": "Slider", + "componentId": "1:1440", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "texts": ["Memory"] + }, + { + "name": "MemValue", + "type": "INSTANCE", + "x": 123.5, + "y": 0, + "width": 64, + "height": 62, + "component": "Input/Primary", + "componentId": "1:1082", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "texts": ["Email", "4", "We'll never share your email."] + }, + { + "name": "MemUnit", + "type": "INSTANCE", + "x": 195.5, + "y": 0, + "width": 110, + "height": 62, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "texts": ["Country", "GiB", "Choose your country."] + } + ] + }, + { + "id": "1:40300", + "name": "Helper", + "type": "TEXT", + "x": 0, + "y": 86, + "width": 305.5, + "height": 15, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Max 13 GiB (largest node)", + "font": ["Geist", 400, 11], + "lineHeight": {"value": 139.9999976158142, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + } + ] + }, + { + "id": "1:40157", + "name": "ReserveLess", + "type": "FRAME", + "x": 0, + "y": 318, + "width": 627, + "height": 56, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40219", + "name": "SwitchRow", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 627, + "height": 20, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Switch", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 36, + "height": 20, + "component": "Gameplane/Switch/Off", + "componentId": "1:1470", + "fills": [{"type": "SOLID", "color": "#2C2932"}], + "cornerRadius": 24, + "variables": {"cornerRadius": "radius/3xl", "fills/0/color": "border/border"} + }, + { + "id": "1:40301", + "name": "Label", + "type": "TEXT", + "x": 48, + "y": 1, + "width": 170, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Reserve less than the limit", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:40220", + "name": "Helper", + "type": "TEXT", + "x": 0, + "y": 26, + "width": 627, + "height": 30, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Only the reserved amount counts when the server is placed on a node, so more servers fit; it can use more, up to the limit, when the node has room (Burstable QoS).", + "font": ["Geist", 400, 11], + "lineHeight": {"value": 139.9999976158142, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40158", + "name": "StoragePlacementRow", + "type": "FRAME", + "x": 0, + "y": 386, + "width": 627, + "height": 79, + "layout": { + "mode": "HORIZONTAL", + "gap": 16, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Field Persistent storage", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 305.5, + "height": 79, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "texts": ["Persistent storage", "20Gi", "Mounted at /data (RWO PVC)."] + }, + { + "id": "1:40221", + "name": "NodePlacement", + "type": "FRAME", + "x": 321.5, + "y": 0, + "width": 305.5, + "height": 75, + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "id": "1:40302", + "name": "Label", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 91, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Node placement", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:40303", + "name": "Segmented", + "type": "FRAME", + "x": 0, + "y": 20, + "width": 318, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [4, 4, 4, 4], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:40334", + "name": "Seg", + "type": "FRAME", + "x": 4, + "y": 4, + "width": 117, + "height": 28, + "fills": [{"type": "SOLID", "color": "#2C1926"}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "accent/soft"}, + "children": [ + { + "id": "1:40346", + "name": "Label", + "type": "TEXT", + "x": 12, + "y": 6, + "width": 93, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "text": "Auto (scheduler)", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/accent"} + } + ] + }, + { + "id": "1:40335", + "name": "Seg", + "type": "FRAME", + "x": 125, + "y": 4, + "width": 87, + "height": 28, + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "children": [ + { + "id": "1:40347", + "name": "Label", + "type": "TEXT", + "x": 12, + "y": 6, + "width": 63, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Pin to node", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40336", + "name": "Seg", + "type": "FRAME", + "x": 216, + "y": 4, + "width": 98, + "height": 28, + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "children": [ + { + "id": "1:40348", + "name": "Label", + "type": "TEXT", + "x": 12, + "y": 6, + "width": 74, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "GPU-enabled", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + } + ] + }, + { + "id": "1:40304", + "name": "Helper", + "type": "TEXT", + "x": 0, + "y": 60, + "width": 305.5, + "height": 15, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Picks node with most free memory, tolerations or no taints.", + "font": ["Geist", 400, 11], + "lineHeight": {"value": 139.9999976158142, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + } + ] + }, + { + "id": "1:40159", + "name": "TemplateConfigSection", + "type": "FRAME", + "x": 0, + "y": 477, + "width": 627, + "height": 1013, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40222", + "name": "SectionLabel", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 146, + "height": 14, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "TEMPLATE CONFIGURATION", + "font": ["Geist", 500, 11], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "name": "Field Difficulty", + "type": "INSTANCE", + "x": 0, + "y": 26, + "width": 627, + "height": 60, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Difficulty", "easy", "Choose your country."] + }, + { + "name": "Field Game mode", + "type": "INSTANCE", + "x": 0, + "y": 98, + "width": 627, + "height": 60, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Game mode", "survival", "Choose your country."] + }, + { + "name": "Field Max players", + "type": "INSTANCE", + "x": 0, + "y": 170, + "width": 627, + "height": 60, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Max players", "20", "We'll never share your email."] + }, + { + "name": "Field MOTD", + "type": "INSTANCE", + "x": 0, + "y": 242, + "width": 627, + "height": 77, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["MOTD", "A Gameplane Minecraft server", "Server description shown in the multiplayer list."] + }, + { + "name": "Field World seed", + "type": "INSTANCE", + "x": 0, + "y": 331, + "width": 627, + "height": 77, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["World seed", "Leave blank for a random seed."] + }, + { + "name": "Field Enforce whitelist", + "type": "INSTANCE", + "x": 0, + "y": 420, + "width": 627, + "height": 60, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Enforce whitelist", "false", "Choose your country."] + }, + { + "name": "Field PvP enabled", + "type": "INSTANCE", + "x": 0, + "y": 492, + "width": 627, + "height": 60, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["PvP enabled", "true", "Choose your country."] + }, + { + "name": "Field Hardcore mode", + "type": "INSTANCE", + "x": 0, + "y": 564, + "width": 627, + "height": 60, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Hardcore mode", "false", "Choose your country."] + }, + { + "name": "Field Online mode", + "type": "INSTANCE", + "x": 0, + "y": 636, + "width": 627, + "height": 76, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Online mode", "true", "Verify players with Mojang. Disable only for offline/LAN setups."] + }, + { + "name": "Field View distance (chunks)", + "type": "INSTANCE", + "x": 0, + "y": 724, + "width": 627, + "height": 60, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["View distance (chunks)", "10", "We'll never share your email."] + }, + { + "name": "Field JVM max heap", + "type": "INSTANCE", + "x": 0, + "y": 796, + "width": 627, + "height": 111, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": [ + "JVM max heap", + "Auto: 75% of the memory limit", + "Java heap ceiling (-Xmx, e.g. 2G, 3072M). Leave empty to size it automatically to 75% of the container memory limit — it then tracks the limit whenever you resize the server. If you set it yourself, keep roughly 25% below the limit: the JVM needs headroom for non-heap memory, and exceeding the limit gets the server OOM-killed." + ] + }, + { + "name": "Field JVM initial heap", + "type": "INSTANCE", + "x": 0, + "y": 919, + "width": 627, + "height": 94, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": [ + "JVM initial heap", + "Auto: 75% of the memory limit", + "Starting heap size (-Xms), at most JVM max heap. Leave empty to match the automatic max heap (a fixed heap avoids GC resizes)." + ] + } + ] + }, + { + "name": "Gameplane/Security Advanced", + "type": "INSTANCE", + "x": 0, + "y": 1502, + "width": 627, + "height": 460, + "component": "Gameplane/Security Advanced", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "Advanced security", + "2 overrides", + "Who the game runs as, and how the data volume's group is fixed. Leave a setting on Module default unless the game needs something else.", + "Run-as user", + "User ID the game process runs as.", + "Module default: image default", + "Custom value", + "1000", + "Risky", + "Run-as group", + "Group ID the game process runs as.", + "Module default: 1000", + "Use image default", + "Filesystem group", + "Group that owns the data volume, so the game can write to it.", + "Module default: 1000", + "Module default", + "Volume ownership check", + "When the data volume's group is fixed on start.", + "Module default: Only when wrong (built-in)", + "Module default" + ] + } + ] + }, + { + "id": "1:40082", + "name": "Preview", + "type": "FRAME", + "x": 663, + "y": 24, + "width": 273, + "height": 387, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 8, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:40160", + "name": "PreviewHeader", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 273, + "height": 56, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [12, 14, 12, 14], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:40223", + "name": "IconWrap", + "type": "FRAME", + "x": 14, + "y": 14, + "width": 28, + "height": 28, + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"fills/0/color": "default/default"}, + "children": [ + { + "id": "1:40305", + "name": "GameIcon", + "type": "FRAME", + "x": 6, + "y": 6, + "width": 16, + "height": 16, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:40337", + "name": "path", + "type": "VECTOR", + "x": 1.3, + "y": 1.33, + "width": 13.4, + "height": 13.33, + "fills": [{"type": "SOLID", "color": "#9E98A6"}] + } + ] + } + ] + }, + { + "id": "1:40224", + "name": "TitleGroup", + "type": "FRAME", + "x": 50, + "y": 12, + "width": 144, + "height": 32, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:40306", + "name": "Title", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 144, + "height": 17, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Minecraft (Java Edition)", + "font": ["Geist", 500, 13], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:40307", + "name": "Subtitle", + "type": "TEXT", + "x": 0, + "y": 19, + "width": 144, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Template: minecraft-java", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + } + ] + } + ] + }, + { + "id": "1:40161", + "name": "CodeBlockWrap", + "type": "FRAME", + "x": 0, + "y": 56, + "width": 273, + "height": 277, + "fills": [{"type": "SOLID", "color": "#0A0A0A"}], + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [12, 14, 12, 14], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40225", + "name": "L0", + "type": "TEXT", + "x": 14, + "y": 12, + "width": 216, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "apiVersion: gameplane.local/v1alpha1", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40226", + "name": "L1", + "type": "TEXT", + "x": 14, + "y": 27, + "width": 96, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "kind: GameServer", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40227", + "name": "L2", + "type": "TEXT", + "x": 14, + "y": 42, + "width": 54, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "metadata:", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40228", + "name": "L3", + "type": "TEXT", + "x": 14, + "y": 57, + "width": 114, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " name: mc-survival", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40229", + "name": "L4", + "type": "TEXT", + "x": 14, + "y": 72, + "width": 30, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "spec:", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40230", + "name": "L5", + "type": "TEXT", + "x": 14, + "y": 87, + "width": 156, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " template: minecraft-java", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40231", + "name": "L6", + "type": "TEXT", + "x": 14, + "y": 102, + "width": 144, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " version: fabric-1.21.4", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40232", + "name": "L7", + "type": "TEXT", + "x": 14, + "y": 117, + "width": 72, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " resources:", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40233", + "name": "L8", + "type": "TEXT", + "x": 14, + "y": 132, + "width": 84, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " cpu: 2000m", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40234", + "name": "L9", + "type": "TEXT", + "x": 14, + "y": 147, + "width": 90, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " memory: 6Gi", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40235", + "name": "L10", + "type": "TEXT", + "x": 14, + "y": 162, + "width": 90, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " storage: 50Gi", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40236", + "name": "L11", + "type": "TEXT", + "x": 14, + "y": 177, + "width": 54, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " config:", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40237", + "name": "L12", + "type": "TEXT", + "x": 14, + "y": 192, + "width": 180, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " motd: \"A Gameplane server\"", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40238", + "name": "L13", + "type": "TEXT", + "x": 14, + "y": 207, + "width": 108, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " maxPlayers: 20", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40239", + "name": "L14", + "type": "TEXT", + "x": 14, + "y": 222, + "width": 120, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " difficulty: hard", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40240", + "name": "L15", + "type": "TEXT", + "x": 14, + "y": 237, + "width": 132, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " gamemode: survival", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40241", + "name": "L16", + "type": "TEXT", + "x": 14, + "y": 252, + "width": 120, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " onlineMode: true", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40162", + "name": "MemoryTip", + "type": "FRAME", + "x": 0, + "y": 333, + "width": 273, + "height": 54, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [12, 14, 12, 14], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:40242", + "name": "TipText", + "type": "TEXT", + "x": 14, + "y": 12, + "width": 245, + "height": 30, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "Memory tip — factor in mod/plugin overhead; Minecraft Vanilla uses ~1.5 GB at 4 players.", + "font": ["Geist", 400, 11], + "lineHeight": {"value": 139.9999976158142, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + } + ] + } + ] + }, + { + "name": "Footer", + "type": "INSTANCE", + "x": 0, + "y": 2239, + "width": 960, + "height": 68, + "component": "Gameplane/Wizard Modal Footer", + "componentId": "1:2019", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [16, 28, 16, 28], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Docs: Creating game servers", "Cancel", "Continue to Version"] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1163467012-2680.json b/assets/design-export/json/1163467012-2680.json new file mode 100644 index 000000000..71fb1313a --- /dev/null +++ b/assets/design-export/json/1163467012-2680.json @@ -0,0 +1,582 @@ +{ + "file": "1163467012-2680", + "id": "1:39961", + "name": "Screen/Cluster Details — Configuration — Remote (Security settings missing)", + "type": "FRAME", + "x": 25110, + "y": 68073, + "width": 1440, + "height": 1385, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 1385, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:39987", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 1385, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Top Bar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "Clusters › Remote lab › Configuration", "Search servers…", "AD"] + }, + { + "id": "1:40012", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 1321, + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Page Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 53, + "component": "Gameplane/Page Header", + "componentId": "1:3282", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": ["Remote lab", "remote-lab · Registered workload cluster"] + }, + { + "id": "1:40044", + "name": "Cluster detail tabs", + "type": "FRAME", + "x": 24, + "y": 101, + "width": 1132, + "height": 44, + "strokes": [{"type": "SOLID", "color": "#232227"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [0, 0, 12, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "separator/separator"}, + "children": [ + { + "name": "Overview tab", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 94, + "height": 32, + "component": "Tab/Inactive", + "componentId": "1:967", + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 16, 0, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"cornerRadius": "radius/3xl"}, + "texts": ["Overview"] + }, + { + "name": "Nodes tab", + "type": "INSTANCE", + "x": 98, + "y": 0, + "width": 75, + "height": 32, + "component": "Tab/Inactive", + "componentId": "1:967", + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 16, 0, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"cornerRadius": "radius/3xl"}, + "texts": ["Nodes"] + }, + { + "name": "Configuration tab", + "type": "INSTANCE", + "x": 177, + "y": 0, + "width": 121, + "height": 32, + "component": "Tab/Active", + "componentId": "1:965", + "fills": [{"type": "SOLID", "color": "#1D1B22"}], + "effects": [{"type": "DROP_SHADOW", "radius": 3, "visible": true}], + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 16, 0, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"cornerRadius": "radius/3xl", "fills/0/color": "segment"}, + "texts": ["Configuration"] + } + ] + }, + { + "id": "1:40045", + "name": "Access", + "type": "FRAME", + "x": 24, + "y": 169, + "width": 1132, + "height": 95, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "id": "1:40100", + "name": "Access heading", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 1092, + "height": 23, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Access", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:40101", + "name": "Access description", + "type": "TEXT", + "x": 20, + "y": 55, + "width": 1092, + "height": 20, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Node enrollment and kubeconfig downloads are managed at this remote cluster.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40046", + "name": "Storage", + "type": "FRAME", + "x": 24, + "y": 288, + "width": 1132, + "height": 95, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "id": "1:40102", + "name": "Storage heading", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 1092, + "height": 23, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Storage", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:40103", + "name": "Storage description", + "type": "TEXT", + "x": 20, + "y": 55, + "width": 1092, + "height": 20, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Storage settings are managed on this cluster. Install-time storage values are available only for the built-in local cluster.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40047", + "name": "Backup destinations", + "type": "FRAME", + "x": 24, + "y": 407, + "width": 1132, + "height": 175, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "id": "1:40104", + "name": "Backup destinations heading", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 1092, + "height": 23, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Backup destinations", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:40105", + "name": "Backup destinations description", + "type": "TEXT", + "x": 20, + "y": 55, + "width": 1092, + "height": 20, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Repositories used by servers running on Remote lab.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:40106", + "name": "Empty backup destinations", + "type": "TEXT", + "x": 20, + "y": 87, + "width": 1092, + "height": 20, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "No backup destinations configured. Add one to enable snapshots.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "name": "Add remote backup destination", + "type": "INSTANCE", + "x": 20, + "y": 119, + "width": 159, + "height": 36, + "component": "Button/Primary/MD", + "componentId": "1:1094", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 16, 8, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "itemSpacing": "spacing/2", + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "accent/accent" + }, + "texts": ["Add destination"] + } + ] + }, + { + "name": "Security", + "type": "INSTANCE", + "x": 24, + "y": 606, + "width": 1132, + "height": 297, + "component": "Gameplane/Cluster Security Panel", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "Security", + "How game servers on this cluster may run.", + "Security settings missing", + "This cluster's security settings were not found in namespace gameplane-system. Run helm upgrade for Gameplane on this cluster, then reload this page. If Gameplane runs in another namespace, correct the control-plane namespace.", + "Allow root overrides", + "Lets server owners run a game as root (user or group 0), or with the image's default user. Off by default, set per cluster.", + "Turning this off does not stop running servers on this cluster. Stopped servers that hold a root override will not start until the override is cleared or this is turned back on.", + "Control-plane namespace", + "gameplane-system" + ] + }, + { + "id": "1:40048", + "name": "Remove cluster", + "type": "FRAME", + "x": 24, + "y": 927, + "width": 1132, + "height": 143, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2E1317"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/3xl", "fills/0/color": "surface/surface", "strokes/0/color": "danger/soft"}, + "children": [ + { + "id": "1:40107", + "name": "Remove cluster heading", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 1092, + "height": 23, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Remove cluster", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:40108", + "name": "Remove cluster description", + "type": "TEXT", + "x": 20, + "y": 55, + "width": 1092, + "height": 20, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Remove this panel’s connection to Remote lab. Running workloads remain on the cluster.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "name": "Remove cluster registration", + "type": "INSTANCE", + "x": 20, + "y": 87, + "width": 159, + "height": 36, + "component": "Button/Danger Soft/MD", + "componentId": "1:5593", + "fills": [{"type": "SOLID", "color": "#2E1317"}], + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 16, 8, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "itemSpacing": "spacing/2", + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "danger/soft" + }, + "texts": ["Remove cluster"] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1163467012-2868.json b/assets/design-export/json/1163467012-2868.json new file mode 100644 index 000000000..c9ae96048 --- /dev/null +++ b/assets/design-export/json/1163467012-2868.json @@ -0,0 +1,580 @@ +{ + "file": "1163467012-2868", + "id": "1:39962", + "name": "Screen/Cluster Details — Configuration — Remote (Light)", + "type": "FRAME", + "x": 26750, + "y": 68073, + "width": 1440, + "height": 1293, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 1293, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#F8DDE9"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:39988", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 1293, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Top Bar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "Clusters › Remote lab › Configuration", "Search servers…", "AD"] + }, + { + "id": "1:40013", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 1229, + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Page Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 53, + "component": "Gameplane/Page Header", + "componentId": "1:3282", + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": ["Remote lab", "remote-lab · Registered workload cluster"] + }, + { + "id": "1:40049", + "name": "Cluster detail tabs", + "type": "FRAME", + "x": 24, + "y": 101, + "width": 1132, + "height": 44, + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [0, 0, 12, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "separator/separator"}, + "children": [ + { + "name": "Overview tab", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 94, + "height": 32, + "component": "Tab/Inactive", + "componentId": "1:967", + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 16, 0, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"cornerRadius": "radius/3xl"}, + "texts": ["Overview"] + }, + { + "name": "Nodes tab", + "type": "INSTANCE", + "x": 98, + "y": 0, + "width": 75, + "height": 32, + "component": "Tab/Inactive", + "componentId": "1:967", + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 16, 0, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"cornerRadius": "radius/3xl"}, + "texts": ["Nodes"] + }, + { + "name": "Configuration tab", + "type": "INSTANCE", + "x": 177, + "y": 0, + "width": 121, + "height": 32, + "component": "Tab/Active", + "componentId": "1:965", + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "effects": [{"type": "DROP_SHADOW", "radius": 3, "visible": true}], + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 16, 0, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"cornerRadius": "radius/3xl", "fills/0/color": "segment"}, + "texts": ["Configuration"] + } + ] + }, + { + "id": "1:40050", + "name": "Access", + "type": "FRAME", + "x": 24, + "y": 169, + "width": 1132, + "height": 95, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "id": "1:40109", + "name": "Access heading", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 1092, + "height": 23, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "layoutAlignSelf": "STRETCH", + "text": "Access", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:40110", + "name": "Access description", + "type": "TEXT", + "x": 20, + "y": 55, + "width": 1092, + "height": 20, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "layoutAlignSelf": "STRETCH", + "text": "Node enrollment and kubeconfig downloads are managed at this remote cluster.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40051", + "name": "Storage", + "type": "FRAME", + "x": 24, + "y": 288, + "width": 1132, + "height": 95, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "id": "1:40111", + "name": "Storage heading", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 1092, + "height": 23, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "layoutAlignSelf": "STRETCH", + "text": "Storage", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:40112", + "name": "Storage description", + "type": "TEXT", + "x": 20, + "y": 55, + "width": 1092, + "height": 20, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "layoutAlignSelf": "STRETCH", + "text": "Storage settings are managed on this cluster. Install-time storage values are available only for the built-in local cluster.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40052", + "name": "Backup destinations", + "type": "FRAME", + "x": 24, + "y": 407, + "width": 1132, + "height": 175, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "id": "1:40113", + "name": "Backup destinations heading", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 1092, + "height": 23, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "layoutAlignSelf": "STRETCH", + "text": "Backup destinations", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:40114", + "name": "Backup destinations description", + "type": "TEXT", + "x": 20, + "y": 55, + "width": 1092, + "height": 20, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "layoutAlignSelf": "STRETCH", + "text": "Repositories used by servers running on Remote lab.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:40115", + "name": "Empty backup destinations", + "type": "TEXT", + "x": 20, + "y": 87, + "width": 1092, + "height": 20, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "layoutAlignSelf": "STRETCH", + "text": "No backup destinations configured. Add one to enable snapshots.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "name": "Add remote backup destination", + "type": "INSTANCE", + "x": 20, + "y": 119, + "width": 159, + "height": 36, + "component": "Button/Primary/MD", + "componentId": "1:1094", + "fills": [{"type": "SOLID", "color": "#DB2777"}], + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 16, 8, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "itemSpacing": "spacing/2", + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "accent/accent" + }, + "texts": ["Add destination"] + } + ] + }, + { + "name": "Security", + "type": "INSTANCE", + "x": 24, + "y": 606, + "width": 1132, + "height": 209, + "component": "Gameplane/Cluster Security Panel", + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "Security", + "How game servers on this cluster may run.", + "Allow root overrides", + "Lets server owners run a game as root (user or group 0), or with the image's default user. Off by default, set per cluster.", + "Turning this off does not stop running servers on this cluster. Stopped servers that hold a root override will not start until the override is cleared or this is turned back on.", + "Control-plane namespace", + "gameplane-system" + ] + }, + { + "id": "1:40053", + "name": "Remove cluster", + "type": "FRAME", + "x": 24, + "y": 839, + "width": 1132, + "height": 143, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#FEE2E2"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/3xl", "fills/0/color": "surface/surface", "strokes/0/color": "danger/soft"}, + "children": [ + { + "id": "1:40116", + "name": "Remove cluster heading", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 1092, + "height": 23, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "layoutAlignSelf": "STRETCH", + "text": "Remove cluster", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:40117", + "name": "Remove cluster description", + "type": "TEXT", + "x": 20, + "y": 55, + "width": 1092, + "height": 20, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "layoutAlignSelf": "STRETCH", + "text": "Remove this panel’s connection to Remote lab. Running workloads remain on the cluster.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "name": "Remove cluster registration", + "type": "INSTANCE", + "x": 20, + "y": 87, + "width": 159, + "height": 36, + "component": "Button/Danger Soft/MD", + "componentId": "1:5593", + "fills": [{"type": "SOLID", "color": "#FEE2E2"}], + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 16, 8, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "itemSpacing": "spacing/2", + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "danger/soft" + }, + "texts": ["Remove cluster"] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1163467012-3056.json b/assets/design-export/json/1163467012-3056.json new file mode 100644 index 000000000..3a13fe493 --- /dev/null +++ b/assets/design-export/json/1163467012-3056.json @@ -0,0 +1,794 @@ +{ + "file": "1163467012-3056", + "id": "1:39963", + "name": "Screen/Standalone — Register cluster (Control-plane namespace edited)", + "type": "FRAME", + "x": 28390, + "y": 68073, + "width": 1440, + "height": 900, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 900, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "Gameplane", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:39989", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 900, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Top Bar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "Clusters", "Search servers…", "AD"] + }, + { + "id": "1:40014", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 836, + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40054", + "name": "Clusters header", + "type": "FRAME", + "x": 24, + "y": 24, + "width": 1132, + "height": 53, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "id": "1:40118", + "name": "Title Col", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 444, + "height": 53, + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:40177", + "name": "phTitle", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 97, + "height": 31, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Clusters", + "font": ["Geist", 600, 24], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:40178", + "name": "phSubtitle", + "type": "TEXT", + "x": 0, + "y": 35, + "width": 444, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Administration of registered clusters, connectivity and node inventory.", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40119", + "name": "Page actions", + "type": "FRAME", + "x": 995, + "y": 8.5, + "width": 137, + "height": 36, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "children": [ + { + "name": "Register cluster", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 137, + "height": 36, + "component": "Button/Primary/MD", + "componentId": "1:1094", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 16, 8, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "itemSpacing": "spacing/2", + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "accent/accent" + }, + "texts": ["Register cluster"] + } + ] + } + ] + }, + { + "id": "1:40055", + "name": "No registered clusters", + "type": "FRAME", + "x": 24, + "y": 101, + "width": 1132, + "height": 101, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/3xl", "fills/0/color": "surface/surface"}, + "children": [ + { + "id": "1:40120", + "name": "Empty title", + "type": "TEXT", + "x": 24, + "y": 24, + "width": 1084, + "height": 24, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "No clusters available", + "font": ["Geist", 400, 16], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:40121", + "name": "Empty description", + "type": "TEXT", + "x": 24, + "y": 56, + "width": 1084, + "height": 21, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Register a workload cluster to deploy and manage game servers. This panel can run without a local cluster.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + } + ] + } + ] + }, + { + "id": "1:39990", + "name": "Modal backdrop", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1440, + "height": 900, + "fills": [{"type": "SOLID", "color": "#00000066", "opacity": 0.4}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [40, 40, 40, 40], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "absolute": true, + "children": [ + { + "id": "1:40015", + "name": "Register cluster dialog", + "type": "FRAME", + "x": 480, + "y": 73.5, + "width": 480, + "height": 753, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 32, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "id": "1:40056", + "name": "mTitle", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 123, + "height": 24, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Register cluster", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:40057", + "name": "mDescWrap", + "type": "FRAME", + "x": 20, + "y": 44, + "width": 440, + "height": 67, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40122", + "name": "mDesc", + "type": "TEXT", + "x": 0, + "y": 4, + "width": 440, + "height": 63, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "Connect an existing workload cluster with the Gameplane operator and CRDs installed. The panel host does not become a workload node.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40058", + "name": "Registration fields", + "type": "FRAME", + "x": 20, + "y": 111, + "width": 440, + "height": 570, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [16, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40123", + "name": "Name field", + "type": "FRAME", + "x": 0, + "y": 16, + "width": 440, + "height": 60, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40179", + "name": "Name label", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 440, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Name", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Name input", + "type": "INSTANCE", + "x": 0, + "y": 24, + "width": 440, + "height": 36, + "component": "Gameplane/Input", + "componentId": "1:706", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 2, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["production"] + } + ] + }, + { + "id": "1:40124", + "name": "Display name field", + "type": "FRAME", + "x": 0, + "y": 92, + "width": 440, + "height": 60, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40180", + "name": "Display name label", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 440, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Display name", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Display name input", + "type": "INSTANCE", + "x": 0, + "y": 24, + "width": 440, + "height": 36, + "component": "Gameplane/Input", + "componentId": "1:706", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 2, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + } + } + ] + }, + { + "id": "1:40125", + "name": "Kubeconfig field", + "type": "FRAME", + "x": 0, + "y": 168, + "width": 440, + "height": 196, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40181", + "name": "Kubeconfig label", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 440, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Kubeconfig", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:40182", + "name": "Kubeconfig textarea (eight rows)", + "type": "FRAME", + "x": 0, + "y": 24, + "width": 440, + "height": 172, + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [12, 12, 12, 12], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + } + } + ] + }, + { + "id": "1:40126", + "name": "Control-plane namespace field", + "type": "FRAME", + "x": 0, + "y": 380, + "width": 440, + "height": 120, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40183", + "name": "Control-plane namespace label", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 440, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Control-plane namespace (optional)", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Control-plane namespace input", + "type": "INSTANCE", + "x": 0, + "y": 24, + "width": 440, + "height": 36, + "component": "Gameplane/Input", + "componentId": "1:706", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 2, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["gameplane-system"] + }, + { + "id": "1:40184", + "name": "Control-plane namespace help", + "type": "TEXT", + "x": 0, + "y": 66, + "width": 440, + "height": 54, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Namespace where this cluster's Gameplane operator runs. Leave gameplane unless it was installed elsewhere; a wrong value shows the cluster's root setting as missing.", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40127", + "name": "Connection helper", + "type": "TEXT", + "x": 0, + "y": 516, + "width": 440, + "height": 54, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Use a self-contained kubeconfig with credentials and an API address reachable from this panel. Agent console, files and logs also require remote gateway configuration.", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40059", + "name": "mFooter", + "type": "FRAME", + "x": 20, + "y": 681, + "width": 440, + "height": 52, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [20, 0, 0, 0], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40128", + "name": "btnCancel", + "type": "FRAME", + "x": 296, + "y": 20, + "width": 64, + "height": 32, + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "children": [ + { + "id": "1:40185", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 40, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Cancel", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:40129", + "name": "btnPrimary", + "type": "FRAME", + "x": 368, + "y": 20, + "width": 72, + "height": 32, + "opacity": 0.5, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "accent/accent"}, + "children": [ + { + "id": "1:40186", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 48, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "text": "Register", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/foreground"} + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1163467012-3228.json b/assets/design-export/json/1163467012-3228.json new file mode 100644 index 000000000..c4e69d021 --- /dev/null +++ b/assets/design-export/json/1163467012-3228.json @@ -0,0 +1,809 @@ +{ + "file": "1163467012-3228", + "id": "1:39964", + "name": "Screen/Standalone — Register cluster (Invalid control-plane namespace)", + "type": "FRAME", + "x": 30030, + "y": 68073, + "width": 1440, + "height": 900, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 900, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "Gameplane", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:39991", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 900, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Top Bar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "Clusters", "Search servers…", "AD"] + }, + { + "id": "1:40016", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 836, + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40060", + "name": "Clusters header", + "type": "FRAME", + "x": 24, + "y": 24, + "width": 1132, + "height": 53, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "id": "1:40130", + "name": "Title Col", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 444, + "height": 53, + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:40187", + "name": "phTitle", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 97, + "height": 31, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Clusters", + "font": ["Geist", 600, 24], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:40188", + "name": "phSubtitle", + "type": "TEXT", + "x": 0, + "y": 35, + "width": 444, + "height": 18, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Administration of registered clusters, connectivity and node inventory.", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40131", + "name": "Page actions", + "type": "FRAME", + "x": 995, + "y": 8.5, + "width": 137, + "height": 36, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "children": [ + { + "name": "Register cluster", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 137, + "height": 36, + "component": "Button/Primary/MD", + "componentId": "1:1094", + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 24, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [8, 16, 8, 16], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "itemSpacing": "spacing/2", + "cornerRadius": "radius/3xl", + "paddingRight": "spacing/4", + "paddingLeft": "spacing/4", + "fills/0/color": "accent/accent" + }, + "texts": ["Register cluster"] + } + ] + } + ] + }, + { + "id": "1:40061", + "name": "No registered clusters", + "type": "FRAME", + "x": 24, + "y": 101, + "width": 1132, + "height": 101, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"cornerRadius": "radius/3xl", "fills/0/color": "surface/surface"}, + "children": [ + { + "id": "1:40132", + "name": "Empty title", + "type": "TEXT", + "x": 24, + "y": 24, + "width": 1084, + "height": 24, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "No clusters available", + "font": ["Geist", 400, 16], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:40133", + "name": "Empty description", + "type": "TEXT", + "x": 24, + "y": 56, + "width": 1084, + "height": 21, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Register a workload cluster to deploy and manage game servers. This panel can run without a local cluster.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + } + ] + } + ] + }, + { + "id": "1:39992", + "name": "Modal backdrop", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1440, + "height": 900, + "fills": [{"type": "SOLID", "color": "#00000066", "opacity": 0.4}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [40, 40, 40, 40], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "absolute": true, + "children": [ + { + "id": "1:40017", + "name": "Register cluster dialog", + "type": "FRAME", + "x": 480, + "y": 52.5, + "width": 480, + "height": 795, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 32, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "id": "1:40062", + "name": "mTitle", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 123, + "height": 24, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Register cluster", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:40063", + "name": "mDescWrap", + "type": "FRAME", + "x": 20, + "y": 44, + "width": 440, + "height": 67, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40134", + "name": "mDesc", + "type": "TEXT", + "x": 0, + "y": 4, + "width": 440, + "height": 63, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "Connect an existing workload cluster with the Gameplane operator and CRDs installed. The panel host does not become a workload node.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40064", + "name": "Registration fields", + "type": "FRAME", + "x": 20, + "y": 111, + "width": 440, + "height": 612, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [16, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40135", + "name": "Name field", + "type": "FRAME", + "x": 0, + "y": 16, + "width": 440, + "height": 60, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40189", + "name": "Name label", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 440, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Name", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Name input", + "type": "INSTANCE", + "x": 0, + "y": 24, + "width": 440, + "height": 36, + "component": "Gameplane/Input", + "componentId": "1:706", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 2, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["production"] + } + ] + }, + { + "id": "1:40136", + "name": "Display name field", + "type": "FRAME", + "x": 0, + "y": 92, + "width": 440, + "height": 60, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40190", + "name": "Display name label", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 440, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Display name", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Display name input", + "type": "INSTANCE", + "x": 0, + "y": 24, + "width": 440, + "height": 36, + "component": "Gameplane/Input", + "componentId": "1:706", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 2, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + } + } + ] + }, + { + "id": "1:40137", + "name": "Kubeconfig field", + "type": "FRAME", + "x": 0, + "y": 168, + "width": 440, + "height": 196, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40191", + "name": "Kubeconfig label", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 440, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Kubeconfig", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:40192", + "name": "Kubeconfig textarea (eight rows)", + "type": "FRAME", + "x": 0, + "y": 24, + "width": 440, + "height": 172, + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [12, 12, 12, 12], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + } + } + ] + }, + { + "id": "1:40138", + "name": "Control-plane namespace field", + "type": "FRAME", + "x": 0, + "y": 380, + "width": 440, + "height": 162, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40193", + "name": "Control-plane namespace label", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 440, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Control-plane namespace (optional)", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Control-plane namespace input", + "type": "INSTANCE", + "x": 0, + "y": 24, + "width": 440, + "height": 36, + "component": "Gameplane/Input", + "componentId": "1:706", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#E0304F"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 2, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "danger/danger" + }, + "texts": ["Gameplane_CP"] + }, + { + "id": "1:40194", + "name": "Control-plane namespace error", + "type": "TEXT", + "x": 0, + "y": 66, + "width": 440, + "height": 36, + "fills": [{"type": "SOLID", "color": "#E0304F"}], + "layoutAlignSelf": "STRETCH", + "text": "Use a lowercase DNS label: lowercase letters, digits and dashes, starting and ending with a letter or digit, at most 63 characters.", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "danger/danger"} + }, + { + "id": "1:40195", + "name": "Control-plane namespace help", + "type": "TEXT", + "x": 0, + "y": 108, + "width": 440, + "height": 54, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Namespace where this cluster's Gameplane operator runs. Leave gameplane unless it was installed elsewhere; a wrong value shows the cluster's root setting as missing.", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40139", + "name": "Connection helper", + "type": "TEXT", + "x": 0, + "y": 558, + "width": 440, + "height": 54, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Use a self-contained kubeconfig with credentials and an API address reachable from this panel. Agent console, files and logs also require remote gateway configuration.", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40065", + "name": "mFooter", + "type": "FRAME", + "x": 20, + "y": 723, + "width": 440, + "height": 52, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [20, 0, 0, 0], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40140", + "name": "btnCancel", + "type": "FRAME", + "x": 296, + "y": 20, + "width": 64, + "height": 32, + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "children": [ + { + "id": "1:40196", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 40, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Cancel", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:40141", + "name": "btnPrimary", + "type": "FRAME", + "x": 368, + "y": 20, + "width": 72, + "height": 32, + "opacity": 0.5, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "accent/accent"}, + "children": [ + { + "id": "1:40197", + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 48, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "text": "Register", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/foreground"} + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1163467012-906.json b/assets/design-export/json/1163467012-906.json new file mode 100644 index 000000000..5ab06e3b2 --- /dev/null +++ b/assets/design-export/json/1163467012-906.json @@ -0,0 +1,1722 @@ +{ + "file": "1163467012-906", + "id": "1:39958", + "name": "Screen/Create Server — Step 3 Configure (Advanced security refused)", + "type": "FRAME", + "x": 4920, + "y": 20454, + "width": 1440, + "height": 2552, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 2552, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:39981", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 2552, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "TopBar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "New", "Search servers…", "AD"] + } + ] + }, + { + "id": "1:39982", + "name": "ModalContainer", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1440, + "height": 2552, + "fills": [{"type": "SOLID", "color": "#000000B3", "opacity": 0.7}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "absolute": true, + "children": [ + { + "id": "1:40009", + "name": "Modal", + "type": "FRAME", + "x": 240, + "y": 77, + "width": 960, + "height": 2398, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 60, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "name": "Header", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 960, + "height": 83, + "component": "Gameplane/Wizard Modal Header", + "componentId": "1:1889", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [20, 28, 20, 28], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "texts": ["New game server", "Step 3 of 5 · Configure"] + }, + { + "id": "1:40035", + "name": "Location placement", + "type": "FRAME", + "x": 0, + "y": 83, + "width": 960, + "height": 102, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 5, + "padding": [12, 24, 12, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:40083", + "name": "Location label", + "type": "TEXT", + "x": 24, + "y": 12, + "width": 40, + "height": 16, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Cluster", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Creation location", + "type": "INSTANCE", + "x": 24, + "y": 33, + "width": 912, + "height": 36, + "component": "Gameplane/Select", + "componentId": "1:311", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 2, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 12, 8, 12], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["remote-lab / gameplane-games"] + }, + { + "id": "1:40084", + "name": "Changing location help", + "type": "TEXT", + "x": 24, + "y": 74, + "width": 912, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Changing cluster starts a fresh draft. The chosen cluster handles all creation steps.", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "Stepper", + "type": "INSTANCE", + "x": 0, + "y": 185, + "width": 960, + "height": 44, + "component": "Gameplane/Wizard Stepper", + "componentId": "1:1899", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [12, 24, 12, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "texts": [ + "1", + "Template", + "·", + "2", + "Version", + "·", + "3", + "Configure", + "·", + "4", + "Network", + "·", + "5", + "Review" + ] + }, + { + "id": "1:40036", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 229, + "width": 960, + "height": 2101, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40085", + "name": "StepBody", + "type": "FRAME", + "x": 24, + "y": 24, + "width": 627, + "height": 2053, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "Field Server name", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 627, + "height": 83, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Server name", "mc-survival", "Used as pod name and subdomain. Lowercase, dash-separated."] + }, + { + "name": "Field Description", + "type": "INSTANCE", + "x": 0, + "y": 95, + "width": 627, + "height": 98, + "component": "Textarea/Secondary", + "componentId": "1:2119", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Description", "Hardcore survival realm with curated mods. Invite only.", "Max 500 characters."] + }, + { + "id": "1:40163", + "name": "ResourceRow", + "type": "FRAME", + "x": 0, + "y": 205, + "width": 627, + "height": 101, + "layout": { + "mode": "HORIZONTAL", + "gap": 16, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40243", + "name": "Field", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 305.5, + "height": 101, + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "id": "1:40308", + "name": "Label", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 25, + "height": 16, + "opacity": 0, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "CPU", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:40309", + "name": "CtrlRow", + "type": "FRAME", + "x": 0, + "y": 20, + "width": 305.5, + "height": 62, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "CpuSlider", + "type": "INSTANCE", + "x": 0, + "y": 10, + "width": 115.5, + "height": 42, + "component": "Slider", + "componentId": "1:1440", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "texts": ["CPU"] + }, + { + "name": "CpuValue", + "type": "INSTANCE", + "x": 123.5, + "y": 0, + "width": 64, + "height": 62, + "component": "Input/Primary", + "componentId": "1:1082", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "texts": ["Email", "2", "We'll never share your email."] + }, + { + "name": "CpuUnit", + "type": "INSTANCE", + "x": 195.5, + "y": 0, + "width": 110, + "height": 62, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "texts": ["Country", "cores", "Choose your country."] + } + ] + }, + { + "id": "1:40310", + "name": "Helper", + "type": "TEXT", + "x": 0, + "y": 86, + "width": 305.5, + "height": 15, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Max 4 (largest node)", + "font": ["Geist", 400, 11], + "lineHeight": {"value": 139.9999976158142, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40244", + "name": "Field", + "type": "FRAME", + "x": 321.5, + "y": 0, + "width": 305.5, + "height": 101, + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "id": "1:40311", + "name": "Label", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 45, + "height": 16, + "opacity": 0, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Memory", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:40312", + "name": "CtrlRow", + "type": "FRAME", + "x": 0, + "y": 20, + "width": 305.5, + "height": 62, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "MemSlider", + "type": "INSTANCE", + "x": 0, + "y": 10, + "width": 115.5, + "height": 42, + "component": "Slider", + "componentId": "1:1440", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "texts": ["Memory"] + }, + { + "name": "MemValue", + "type": "INSTANCE", + "x": 123.5, + "y": 0, + "width": 64, + "height": 62, + "component": "Input/Primary", + "componentId": "1:1082", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "texts": ["Email", "4", "We'll never share your email."] + }, + { + "name": "MemUnit", + "type": "INSTANCE", + "x": 195.5, + "y": 0, + "width": 110, + "height": 62, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "texts": ["Country", "GiB", "Choose your country."] + } + ] + }, + { + "id": "1:40313", + "name": "Helper", + "type": "TEXT", + "x": 0, + "y": 86, + "width": 305.5, + "height": 15, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Max 13 GiB (largest node)", + "font": ["Geist", 400, 11], + "lineHeight": {"value": 139.9999976158142, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + } + ] + }, + { + "id": "1:40164", + "name": "ReserveLess", + "type": "FRAME", + "x": 0, + "y": 318, + "width": 627, + "height": 56, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40245", + "name": "SwitchRow", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 627, + "height": 20, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Switch", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 36, + "height": 20, + "component": "Gameplane/Switch/Off", + "componentId": "1:1470", + "fills": [{"type": "SOLID", "color": "#2C2932"}], + "cornerRadius": 24, + "variables": {"cornerRadius": "radius/3xl", "fills/0/color": "border/border"} + }, + { + "id": "1:40314", + "name": "Label", + "type": "TEXT", + "x": 48, + "y": 1, + "width": 170, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Reserve less than the limit", + "font": ["Geist", 400, 14], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "id": "1:40246", + "name": "Helper", + "type": "TEXT", + "x": 0, + "y": 26, + "width": 627, + "height": 30, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Only the reserved amount counts when the server is placed on a node, so more servers fit; it can use more, up to the limit, when the node has room (Burstable QoS).", + "font": ["Geist", 400, 11], + "lineHeight": {"value": 139.9999976158142, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40165", + "name": "StoragePlacementRow", + "type": "FRAME", + "x": 0, + "y": 386, + "width": 627, + "height": 79, + "layout": { + "mode": "HORIZONTAL", + "gap": 16, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Field Persistent storage", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 305.5, + "height": 79, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "texts": ["Persistent storage", "20Gi", "Mounted at /data (RWO PVC)."] + }, + { + "id": "1:40247", + "name": "NodePlacement", + "type": "FRAME", + "x": 321.5, + "y": 0, + "width": 305.5, + "height": 75, + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "id": "1:40315", + "name": "Label", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 91, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Node placement", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "id": "1:40316", + "name": "Segmented", + "type": "FRAME", + "x": 0, + "y": 20, + "width": 318, + "height": 36, + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 4, + "padding": [4, 4, 4, 4], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:40338", + "name": "Seg", + "type": "FRAME", + "x": 4, + "y": 4, + "width": 117, + "height": 28, + "fills": [{"type": "SOLID", "color": "#2C1926"}], + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "accent/soft"}, + "children": [ + { + "id": "1:40349", + "name": "Label", + "type": "TEXT", + "x": 12, + "y": 6, + "width": 93, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FF4FA3"}], + "text": "Auto (scheduler)", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/accent"} + } + ] + }, + { + "id": "1:40339", + "name": "Seg", + "type": "FRAME", + "x": 125, + "y": 4, + "width": 87, + "height": 28, + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "children": [ + { + "id": "1:40350", + "name": "Label", + "type": "TEXT", + "x": 12, + "y": 6, + "width": 63, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Pin to node", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40340", + "name": "Seg", + "type": "FRAME", + "x": 216, + "y": 4, + "width": 98, + "height": 28, + "cornerRadius": 4, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "children": [ + { + "id": "1:40351", + "name": "Label", + "type": "TEXT", + "x": 12, + "y": 6, + "width": 74, + "height": 16, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "GPU-enabled", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + } + ] + }, + { + "id": "1:40317", + "name": "Helper", + "type": "TEXT", + "x": 0, + "y": 60, + "width": 305.5, + "height": 15, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Picks node with most free memory, tolerations or no taints.", + "font": ["Geist", 400, 11], + "lineHeight": {"value": 139.9999976158142, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + } + ] + }, + { + "id": "1:40166", + "name": "TemplateConfigSection", + "type": "FRAME", + "x": 0, + "y": 477, + "width": 627, + "height": 1013, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40248", + "name": "SectionLabel", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 146, + "height": 14, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "TEMPLATE CONFIGURATION", + "font": ["Geist", 500, 11], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "name": "Field Difficulty", + "type": "INSTANCE", + "x": 0, + "y": 26, + "width": 627, + "height": 60, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Difficulty", "easy", "Choose your country."] + }, + { + "name": "Field Game mode", + "type": "INSTANCE", + "x": 0, + "y": 98, + "width": 627, + "height": 60, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Game mode", "survival", "Choose your country."] + }, + { + "name": "Field Max players", + "type": "INSTANCE", + "x": 0, + "y": 170, + "width": 627, + "height": 60, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Max players", "20", "We'll never share your email."] + }, + { + "name": "Field MOTD", + "type": "INSTANCE", + "x": 0, + "y": 242, + "width": 627, + "height": 77, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["MOTD", "A Gameplane Minecraft server", "Server description shown in the multiplayer list."] + }, + { + "name": "Field World seed", + "type": "INSTANCE", + "x": 0, + "y": 331, + "width": 627, + "height": 77, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["World seed", "Leave blank for a random seed."] + }, + { + "name": "Field Enforce whitelist", + "type": "INSTANCE", + "x": 0, + "y": 420, + "width": 627, + "height": 60, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Enforce whitelist", "false", "Choose your country."] + }, + { + "name": "Field PvP enabled", + "type": "INSTANCE", + "x": 0, + "y": 492, + "width": 627, + "height": 60, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["PvP enabled", "true", "Choose your country."] + }, + { + "name": "Field Hardcore mode", + "type": "INSTANCE", + "x": 0, + "y": 564, + "width": 627, + "height": 60, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Hardcore mode", "false", "Choose your country."] + }, + { + "name": "Field Online mode", + "type": "INSTANCE", + "x": 0, + "y": 636, + "width": 627, + "height": 76, + "component": "Select/Secondary", + "componentId": "1:2132", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["Online mode", "true", "Verify players with Mojang. Disable only for offline/LAN setups."] + }, + { + "name": "Field View distance (chunks)", + "type": "INSTANCE", + "x": 0, + "y": 724, + "width": 627, + "height": 60, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": ["View distance (chunks)", "10", "We'll never share your email."] + }, + { + "name": "Field JVM max heap", + "type": "INSTANCE", + "x": 0, + "y": 796, + "width": 627, + "height": 111, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": [ + "JVM max heap", + "Auto: 75% of the memory limit", + "Java heap ceiling (-Xmx, e.g. 2G, 3072M). Leave empty to size it automatically to 75% of the container memory limit — it then tracks the limit whenever you resize the server. If you set it yourself, keep roughly 25% below the limit: the JVM needs headroom for non-heap memory, and exceeding the limit gets the server OOM-killed." + ] + }, + { + "name": "Field JVM initial heap", + "type": "INSTANCE", + "x": 0, + "y": 919, + "width": 627, + "height": 94, + "component": "Input/Secondary", + "componentId": "1:2112", + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": [ + "JVM initial heap", + "Auto: 75% of the memory limit", + "Starting heap size (-Xms), at most JVM max heap. Leave empty to match the automatic max heap (a fixed heap avoids GC resizes)." + ] + } + ] + }, + { + "name": "Gameplane/Security Advanced", + "type": "INSTANCE", + "x": 0, + "y": 1502, + "width": 627, + "height": 551, + "component": "Gameplane/Security Advanced", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "Advanced security", + "2 overrides", + "Who the game runs as, and how the data volume's group is fixed. Leave a setting on Module default unless the game needs something else.", + "Not created: root overrides are off on this cluster", + "Run-as user 0 is a root override, and cluster remote-lab does not allow them. An administrator can allow root overrides in that cluster's Configuration.", + "Run-as user", + "User ID the game process runs as.", + "Module default: 1000", + "Custom value", + "0", + "Run-as group", + "Group ID the game process runs as.", + "Module default: 1000", + "Custom value", + "-5", + "Enter a whole number from 0 to 2147483647.", + "Filesystem group", + "Group that owns the data volume, so the game can write to it.", + "Module default: 1000", + "Module default", + "Volume ownership check", + "When the data volume's group is fixed on start.", + "Module default: Only when wrong (built-in)", + "Module default" + ] + } + ] + }, + { + "id": "1:40086", + "name": "Preview", + "type": "FRAME", + "x": 663, + "y": 24, + "width": 273, + "height": 387, + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 8, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:40167", + "name": "PreviewHeader", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 273, + "height": 56, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [12, 14, 12, 14], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:40249", + "name": "IconWrap", + "type": "FRAME", + "x": 14, + "y": 14, + "width": 28, + "height": 28, + "fills": [{"type": "SOLID", "color": "#232128"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "variables": {"fills/0/color": "default/default"}, + "children": [ + { + "id": "1:40318", + "name": "GameIcon", + "type": "FRAME", + "x": 6, + "y": 6, + "width": 16, + "height": 16, + "variables": {"fills/0/color": "muted"}, + "children": [ + { + "id": "1:40341", + "name": "path", + "type": "VECTOR", + "x": 1.3, + "y": 1.33, + "width": 13.4, + "height": 13.33, + "fills": [{"type": "SOLID", "color": "#9E98A6"}] + } + ] + } + ] + }, + { + "id": "1:40250", + "name": "TitleGroup", + "type": "FRAME", + "x": 50, + "y": 12, + "width": 144, + "height": 32, + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "HUG"] + }, + "children": [ + { + "id": "1:40319", + "name": "Title", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 144, + "height": 17, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "text": "Minecraft (Java Edition)", + "font": ["Geist", 500, 13], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "id": "1:40320", + "name": "Subtitle", + "type": "TEXT", + "x": 0, + "y": 19, + "width": 144, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "Template: minecraft-java", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + } + ] + } + ] + }, + { + "id": "1:40168", + "name": "CodeBlockWrap", + "type": "FRAME", + "x": 0, + "y": 56, + "width": 273, + "height": 277, + "fills": [{"type": "SOLID", "color": "#0A0A0A"}], + "layout": { + "mode": "VERTICAL", + "gap": 2, + "padding": [12, 14, 12, 14], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40251", + "name": "L0", + "type": "TEXT", + "x": 14, + "y": 12, + "width": 216, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "apiVersion: gameplane.local/v1alpha1", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40252", + "name": "L1", + "type": "TEXT", + "x": 14, + "y": 27, + "width": 96, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "kind: GameServer", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40253", + "name": "L2", + "type": "TEXT", + "x": 14, + "y": 42, + "width": 54, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "metadata:", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40254", + "name": "L3", + "type": "TEXT", + "x": 14, + "y": 57, + "width": 114, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " name: mc-survival", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40255", + "name": "L4", + "type": "TEXT", + "x": 14, + "y": 72, + "width": 30, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": "spec:", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40256", + "name": "L5", + "type": "TEXT", + "x": 14, + "y": 87, + "width": 156, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " template: minecraft-java", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40257", + "name": "L6", + "type": "TEXT", + "x": 14, + "y": 102, + "width": 144, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " version: fabric-1.21.4", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40258", + "name": "L7", + "type": "TEXT", + "x": 14, + "y": 117, + "width": 72, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " resources:", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40259", + "name": "L8", + "type": "TEXT", + "x": 14, + "y": 132, + "width": 84, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " cpu: 2000m", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40260", + "name": "L9", + "type": "TEXT", + "x": 14, + "y": 147, + "width": 90, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " memory: 6Gi", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40261", + "name": "L10", + "type": "TEXT", + "x": 14, + "y": 162, + "width": 90, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " storage: 50Gi", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40262", + "name": "L11", + "type": "TEXT", + "x": 14, + "y": 177, + "width": 54, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " config:", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40263", + "name": "L12", + "type": "TEXT", + "x": 14, + "y": 192, + "width": 180, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " motd: \"A Gameplane server\"", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40264", + "name": "L13", + "type": "TEXT", + "x": 14, + "y": 207, + "width": 108, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " maxPlayers: 20", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40265", + "name": "L14", + "type": "TEXT", + "x": 14, + "y": 222, + "width": 120, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " difficulty: hard", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40266", + "name": "L15", + "type": "TEXT", + "x": 14, + "y": 237, + "width": 132, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " gamemode: survival", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + }, + { + "id": "1:40267", + "name": "L16", + "type": "TEXT", + "x": 14, + "y": 252, + "width": 120, + "height": 13, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "text": " onlineMode: true", + "font": ["JetBrains Mono", 400, 10], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "muted"} + } + ] + }, + { + "id": "1:40169", + "name": "MemoryTip", + "type": "FRAME", + "x": 0, + "y": 333, + "width": 273, + "height": 54, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [12, 14, 12, 14], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "id": "1:40268", + "name": "TipText", + "type": "TEXT", + "x": 14, + "y": 12, + "width": 245, + "height": 30, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutGrow": 1, + "text": "Memory tip — factor in mod/plugin overhead; Minecraft Vanilla uses ~1.5 GB at 4 players.", + "font": ["Geist", 400, 11], + "lineHeight": {"value": 139.9999976158142, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + } + ] + } + ] + }, + { + "name": "Footer", + "type": "INSTANCE", + "x": 0, + "y": 2330, + "width": 960, + "height": 68, + "component": "Gameplane/Wizard Modal Footer", + "componentId": "1:2019", + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [16, 28, 16, 28], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "texts": ["Docs: Creating game servers", "Cancel", "Continue to Version"] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/1274632774-1258.json b/assets/design-export/json/1274632774-1258.json index 672e6f27e..0d2456f96 100644 --- a/assets/design-export/json/1274632774-1258.json +++ b/assets/design-export/json/1274632774-1258.json @@ -3,7 +3,7 @@ "name": "Screen/Server Detail — Modpacks — Change version", "type": "FRAME", "x": 6560, - "y": 32970, + "y": 35101, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/1274632774-130.json b/assets/design-export/json/1274632774-130.json index 0c287a67b..3d6227e7b 100644 --- a/assets/design-export/json/1274632774-130.json +++ b/assets/design-export/json/1274632774-130.json @@ -3,7 +3,7 @@ "name": "Screen/Server Detail — Modpacks (Active pack)", "type": "FRAME", "x": 1640, - "y": 32970, + "y": 35101, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/1274632774-1722.json b/assets/design-export/json/1274632774-1722.json index d4f85da54..08cedebb9 100644 --- a/assets/design-export/json/1274632774-1722.json +++ b/assets/design-export/json/1274632774-1722.json @@ -3,7 +3,7 @@ "name": "Screen/Server Detail — Modpacks — Confirm downgrade", "type": "FRAME", "x": 8200, - "y": 32970, + "y": 35101, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/1274632774-2112.json b/assets/design-export/json/1274632774-2112.json index dbec1556d..f0cd854b4 100644 --- a/assets/design-export/json/1274632774-2112.json +++ b/assets/design-export/json/1274632774-2112.json @@ -3,7 +3,7 @@ "name": "Screen/Server Detail — Modpacks — Remove", "type": "FRAME", "x": 9840, - "y": 32970, + "y": 35101, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/1274632774-2492.json b/assets/design-export/json/1274632774-2492.json index 4e62af02b..25e4a506c 100644 --- a/assets/design-export/json/1274632774-2492.json +++ b/assets/design-export/json/1274632774-2492.json @@ -3,7 +3,7 @@ "name": "Screen/Server Detail — Modpacks (Missing files)", "type": "FRAME", "x": 11480, - "y": 32970, + "y": 35101, "width": 1440, "height": 1080, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/1274632774-2877.json b/assets/design-export/json/1274632774-2877.json index c95dd9d82..60d8f83b0 100644 --- a/assets/design-export/json/1274632774-2877.json +++ b/assets/design-export/json/1274632774-2877.json @@ -3,7 +3,7 @@ "name": "Screen/Server Detail — Modpacks (Active pack, Light)", "type": "FRAME", "x": 13120, - "y": 32970, + "y": 35101, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#FFFFFF"}], diff --git a/assets/design-export/json/1274632774-3217.json b/assets/design-export/json/1274632774-3217.json index d91c812fe..c4ad4752c 100644 --- a/assets/design-export/json/1274632774-3217.json +++ b/assets/design-export/json/1274632774-3217.json @@ -3,7 +3,7 @@ "name": "Screen/Server Detail — Modpacks (Read-only)", "type": "FRAME", "x": 14760, - "y": 32970, + "y": 35101, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/1274632774-3559.json b/assets/design-export/json/1274632774-3559.json index e0f08ec81..0410975b8 100644 --- a/assets/design-export/json/1274632774-3559.json +++ b/assets/design-export/json/1274632774-3559.json @@ -3,7 +3,7 @@ "name": "States/Modpacks — Active card and tab states (reference)", "type": "FRAME", "x": 16400, - "y": 32970, + "y": 35101, "width": 2280, "height": 1158, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/1274632774-3890.json b/assets/design-export/json/1274632774-3890.json index 21ad4d80b..405229158 100644 --- a/assets/design-export/json/1274632774-3890.json +++ b/assets/design-export/json/1274632774-3890.json @@ -3,7 +3,7 @@ "name": "Screen/Mobile — Server Detail — Modpacks", "type": "FRAME", "x": 18880, - "y": 32970, + "y": 35101, "width": 390, "height": 1100, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/1274632774-4001.json b/assets/design-export/json/1274632774-4001.json index 24d8810d9..d44c09730 100644 --- a/assets/design-export/json/1274632774-4001.json +++ b/assets/design-export/json/1274632774-4001.json @@ -3,7 +3,7 @@ "name": "Screen/Admin Settings — Mod registries (Share CurseForge key)", "type": "FRAME", "x": 3280, - "y": 85089, + "y": 88972, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/1274632774-4260.json b/assets/design-export/json/1274632774-4260.json index b01afcd64..e818c1316 100644 --- a/assets/design-export/json/1274632774-4260.json +++ b/assets/design-export/json/1274632774-4260.json @@ -3,7 +3,7 @@ "name": "Screen/Admin Settings — Mod registries (Key from startup flag)", "type": "FRAME", "x": 4920, - "y": 85089, + "y": 88972, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/1274632774-470.json b/assets/design-export/json/1274632774-470.json index 365442e44..f59cc8732 100644 --- a/assets/design-export/json/1274632774-470.json +++ b/assets/design-export/json/1274632774-470.json @@ -3,7 +3,7 @@ "name": "Screen/Server Detail — Modpacks — Choose version", "type": "FRAME", "x": 3280, - "y": 32970, + "y": 35101, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/1274632774-907.json b/assets/design-export/json/1274632774-907.json index 30dbbcc88..5d35f293d 100644 --- a/assets/design-export/json/1274632774-907.json +++ b/assets/design-export/json/1274632774-907.json @@ -3,7 +3,7 @@ "name": "Screen/Server Detail — Modpacks — Confirm install", "type": "FRAME", "x": 4920, - "y": 32970, + "y": 35101, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/1494270493-26.json b/assets/design-export/json/1494270493-26.json index 789daa820..407a78598 100644 --- a/assets/design-export/json/1494270493-26.json +++ b/assets/design-export/json/1494270493-26.json @@ -3,7 +3,7 @@ "name": "States/Backup schedule — Edit with restricted snapshot strategy", "type": "FRAME", "x": 0, - "y": 94166, + "y": 98049, "width": 1524, "height": 582, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/2044649516-1099.json b/assets/design-export/json/2044649516-1099.json index 3bc0429ed..2a8ab5da7 100644 --- a/assets/design-export/json/2044649516-1099.json +++ b/assets/design-export/json/2044649516-1099.json @@ -3,7 +3,7 @@ "name": "Screen/MCP Tokens — Create", "type": "FRAME", "x": 3280, - "y": 96000, + "y": 99883, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/2044649516-13.json b/assets/design-export/json/2044649516-13.json index 06a407cbf..be9b17935 100644 --- a/assets/design-export/json/2044649516-13.json +++ b/assets/design-export/json/2044649516-13.json @@ -3,7 +3,7 @@ "name": "Screen/MCP Tokens", "type": "FRAME", "x": 0, - "y": 96000, + "y": 99883, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/2044649516-1687.json b/assets/design-export/json/2044649516-1687.json index 4319b576c..ee5fe7a8d 100644 --- a/assets/design-export/json/2044649516-1687.json +++ b/assets/design-export/json/2044649516-1687.json @@ -3,7 +3,7 @@ "name": "Screen/MCP Tokens — Created", "type": "FRAME", "x": 4920, - "y": 96000, + "y": 99883, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/2044649516-2282.json b/assets/design-export/json/2044649516-2282.json index 98c10fa1c..f7cd5b4d2 100644 --- a/assets/design-export/json/2044649516-2282.json +++ b/assets/design-export/json/2044649516-2282.json @@ -3,7 +3,7 @@ "name": "Screen/MCP Tokens — Revoke", "type": "FRAME", "x": 6560, - "y": 96000, + "y": 99883, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/2044649516-2862.json b/assets/design-export/json/2044649516-2862.json index 1f85b4c09..788bf88e4 100644 --- a/assets/design-export/json/2044649516-2862.json +++ b/assets/design-export/json/2044649516-2862.json @@ -3,7 +3,7 @@ "name": "Screen/Mobile — MCP Tokens", "type": "FRAME", "x": 8200, - "y": 96000, + "y": 99883, "width": 390, "height": 844, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/2044649516-2982.json b/assets/design-export/json/2044649516-2982.json index b425f4da2..f51940a20 100644 --- a/assets/design-export/json/2044649516-2982.json +++ b/assets/design-export/json/2044649516-2982.json @@ -3,7 +3,7 @@ "name": "Screen/Users & RBAC — MCP tokens", "type": "FRAME", "x": 8790, - "y": 96000, + "y": 99883, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/2044649516-579.json b/assets/design-export/json/2044649516-579.json index d43bd167a..5be8ca73c 100644 --- a/assets/design-export/json/2044649516-579.json +++ b/assets/design-export/json/2044649516-579.json @@ -3,7 +3,7 @@ "name": "Screen/MCP Tokens — Empty", "type": "FRAME", "x": 1640, - "y": 96000, + "y": 99883, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/46479436-2.json b/assets/design-export/json/46479436-2.json index a4b087050..5ef8c5ecd 100644 --- a/assets/design-export/json/46479436-2.json +++ b/assets/design-export/json/46479436-2.json @@ -3,7 +3,7 @@ "name": "Gameplane/Dialog/Back up now (No destinations)", "type": "FRAME", "x": 0, - "y": 94928, + "y": 98811, "width": 480, "height": 279, "fills": [{"type": "SOLID", "color": "#FFF7FB"}], diff --git a/assets/design-export/json/901437436-1.json b/assets/design-export/json/901437436-1.json new file mode 100644 index 000000000..2b44c5985 --- /dev/null +++ b/assets/design-export/json/901437436-1.json @@ -0,0 +1,448 @@ +{ + "file": "901437436-1", + "id": "1:39947", + "name": "Screen/Server Detail — Settings · Security", + "type": "FRAME", + "x": 0, + "y": 54439, + "width": 1440, + "height": 1001, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Gameplane/App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 1001, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:39965", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 1001, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Gameplane/Top Bar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "mc-survival", "Search servers…", "AD"] + }, + { + "id": "1:39993", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 937, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Detail Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 86, + "component": "Gameplane/Server Detail Header", + "componentId": "1:447", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [16, 24, 16, 24], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "MI", + "mc-survival", + "Running", + "site: remote-lab · minecraft-java · 1.21.4-fabric · ns: gameplane-games", + "Restart", + "Stop", + "Open console" + ] + }, + { + "name": "Tabs Bar", + "type": "INSTANCE", + "x": 24, + "y": 134, + "width": 1132, + "height": 40, + "component": "Gameplane/Server Detail Tabs", + "componentId": "1:466", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": [ + "Overview", + "Events", + "Console", + "Logs", + "Files", + "Mods", + "Modpacks", + "Players", + "Backups", + "Capture", + "Settings" + ] + }, + { + "id": "1:40018", + "name": "Settings Content", + "type": "FRAME", + "x": 24, + "y": 198, + "width": 1132, + "height": 715, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Settings Sub Nav", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 224, + "height": 715, + "component": "Gameplane/Server Settings Sub Nav", + "componentId": "1:1289", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [8, 8, 8, 8], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "General", + "Version", + "Game configuration", + "Resources", + "Networking", + "Environment", + "Lifecycle", + "Scheduled backups", + "Network capture", + "Placement", + "Security", + "RBAC & access", + "Share links", + "Danger zone" + ] + }, + { + "id": "1:40067", + "name": "Settings Panel Wrap", + "type": "FRAME", + "x": 224, + "y": 0, + "width": 908, + "height": 715, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40144", + "name": "Settings Form", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 908, + "height": 715, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40198", + "name": "Form Body", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 908, + "height": 659, + "layout": { + "mode": "VERTICAL", + "gap": 20, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Gameplane/Security Advanced", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 860, + "height": 611, + "component": "Gameplane/Security Advanced", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "Advanced security", + "2 overrides", + "Who the game runs as, and how the data volume's group is fixed. Leave a setting on Module default unless the game needs something else.", + "Applies on the next restart", + "Saving never restarts the server. Pending values take effect the next time it starts.", + "Run-as user", + "User ID the game process runs as.", + "Module default: image default", + "Custom value", + "1000", + "Applied: 1000", + "Override", + "Run-as group", + "Group ID the game process runs as.", + "Module default: 1000", + "Custom value", + "1001", + "Applied: 1000", + "Module default", + "Pending: 1001 · applies on the next restart", + "Filesystem group", + "Group that owns the data volume, so the game can write to it.", + "Module default: 1000", + "Module default", + "Applied: 1000", + "Module default", + "Volume ownership check", + "When the data volume's group is fixed on start.", + "Module default: Only when wrong (built-in)", + "Module default", + "Applied: Only when wrong", + "Built-in default" + ] + } + ] + }, + { + "id": "1:40199", + "name": "Form Footer", + "type": "FRAME", + "x": 0, + "y": 659, + "width": 908, + "height": 56, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 24, 12, 24], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "Btn Discard", + "type": "INSTANCE", + "x": 681, + "y": 12, + "width": 86, + "height": 32, + "component": "Gameplane/Button/Small/Ghost", + "componentId": "1:1124", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "texts": ["Discard"] + }, + { + "name": "Btn Save Changes", + "type": "INSTANCE", + "x": 779, + "y": 12, + "width": 105, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "texts": ["Save changes"] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/901437436-1393.json b/assets/design-export/json/901437436-1393.json new file mode 100644 index 000000000..d683da0a3 --- /dev/null +++ b/assets/design-export/json/901437436-1393.json @@ -0,0 +1,442 @@ +{ + "file": "901437436-1393", + "id": "1:39950", + "name": "Screen/Server Detail — Settings · Security (Read-only)", + "type": "FRAME", + "x": 4920, + "y": 54439, + "width": 1440, + "height": 900, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Gameplane/App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 900, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:39968", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 900, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Gameplane/Top Bar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "mc-survival", "Search servers…", "AD"] + }, + { + "id": "1:39996", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 836, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Detail Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 86, + "component": "Gameplane/Server Detail Header", + "componentId": "1:447", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [16, 24, 16, 24], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "MI", + "mc-survival", + "Running", + "site: remote-lab · minecraft-java · 1.21.4-fabric · ns: gameplane-games", + "Restart", + "Stop", + "Open console" + ] + }, + { + "name": "Tabs Bar", + "type": "INSTANCE", + "x": 24, + "y": 134, + "width": 1132, + "height": 40, + "component": "Gameplane/Server Detail Tabs", + "componentId": "1:466", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": [ + "Overview", + "Events", + "Console", + "Logs", + "Files", + "Mods", + "Modpacks", + "Players", + "Backups", + "Capture", + "Settings" + ] + }, + { + "id": "1:40021", + "name": "Settings Content", + "type": "FRAME", + "x": 24, + "y": 198, + "width": 1132, + "height": 614, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Settings Sub Nav", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 224, + "height": 614, + "component": "Gameplane/Server Settings Sub Nav", + "componentId": "1:1289", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [8, 8, 8, 8], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "General", + "Version", + "Game configuration", + "Resources", + "Networking", + "Environment", + "Lifecycle", + "Scheduled backups", + "Network capture", + "Placement", + "Security", + "RBAC & access", + "Share links", + "Danger zone" + ] + }, + { + "id": "1:40070", + "name": "Settings Panel Wrap", + "type": "FRAME", + "x": 224, + "y": 0, + "width": 908, + "height": 614, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40147", + "name": "Settings Form", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 908, + "height": 614, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40204", + "name": "Form Body", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 908, + "height": 614, + "layout": { + "mode": "VERTICAL", + "gap": 20, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Gameplane/Security Advanced", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 860, + "height": 417, + "component": "Gameplane/Security Advanced", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "Advanced security", + "Read-only", + "Who the game runs as, and how the data volume's group is fixed. Leave a setting on Module default unless the game needs something else.", + "You can see these settings. Changing them needs the servers:security permission.", + "Run-as user", + "User ID the game process runs as.", + "Module default: 1000", + "Applied: 1000", + "Override", + "Run-as group", + "Group ID the game process runs as.", + "Module default: 1000", + "Applied: 1000", + "Module default", + "Pending: 1001 · applies on the next restart", + "Filesystem group", + "Group that owns the data volume, so the game can write to it.", + "Module default: 1000", + "Applied: 1000", + "Module default", + "Volume ownership check", + "When the data volume's group is fixed on start.", + "Module default: Only when wrong (built-in)", + "Applied: Only when wrong", + "Built-in default" + ] + } + ] + }, + { + "id": "1:40205", + "name": "Form Footer", + "type": "FRAME", + "x": 0, + "y": 558, + "width": 908, + "height": 56, + "visible": false, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 24, 12, 24], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "Btn Discard", + "type": "INSTANCE", + "x": 681, + "y": 12, + "width": 86, + "height": 32, + "component": "Gameplane/Button/Small/Ghost", + "componentId": "1:1124", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "texts": ["Discard"] + }, + { + "name": "Btn Save Changes", + "type": "INSTANCE", + "x": 779, + "y": 12, + "width": 105, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "texts": ["Save changes"] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/901437436-1857.json b/assets/design-export/json/901437436-1857.json new file mode 100644 index 000000000..4e836dda4 --- /dev/null +++ b/assets/design-export/json/901437436-1857.json @@ -0,0 +1,447 @@ +{ + "file": "901437436-1857", + "id": "1:39951", + "name": "Screen/Server Detail — Settings · Security (Held back, stopped)", + "type": "FRAME", + "x": 6560, + "y": 54439, + "width": 1440, + "height": 1017, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Gameplane/App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 1017, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:39969", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 1017, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Gameplane/Top Bar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "mc-survival", "Search servers…", "AD"] + }, + { + "id": "1:39997", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 953, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Detail Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 86, + "component": "Gameplane/Server Detail Header", + "componentId": "1:447", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [16, 24, 16, 24], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "MI", + "mc-survival", + "Stopped", + "site: remote-lab · minecraft-java · 1.21.4-fabric · ns: gameplane-games", + "Restart", + "Stop", + "Open console" + ] + }, + { + "name": "Tabs Bar", + "type": "INSTANCE", + "x": 24, + "y": 134, + "width": 1132, + "height": 40, + "component": "Gameplane/Server Detail Tabs", + "componentId": "1:466", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": [ + "Overview", + "Events", + "Console", + "Logs", + "Files", + "Mods", + "Modpacks", + "Players", + "Backups", + "Capture", + "Settings" + ] + }, + { + "id": "1:40022", + "name": "Settings Content", + "type": "FRAME", + "x": 24, + "y": 198, + "width": 1132, + "height": 731, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Settings Sub Nav", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 224, + "height": 731, + "component": "Gameplane/Server Settings Sub Nav", + "componentId": "1:1289", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [8, 8, 8, 8], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "General", + "Version", + "Game configuration", + "Resources", + "Networking", + "Environment", + "Lifecycle", + "Scheduled backups", + "Network capture", + "Placement", + "Security", + "RBAC & access", + "Share links", + "Danger zone" + ] + }, + { + "id": "1:40071", + "name": "Settings Panel Wrap", + "type": "FRAME", + "x": 224, + "y": 0, + "width": 908, + "height": 731, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40148", + "name": "Settings Form", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 908, + "height": 731, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40206", + "name": "Form Body", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 908, + "height": 675, + "layout": { + "mode": "VERTICAL", + "gap": 20, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Gameplane/Security Advanced", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 860, + "height": 627, + "component": "Gameplane/Security Advanced", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "Advanced security", + "1 override", + "Who the game runs as, and how the data volume's group is fixed. Leave a setting on Module default unless the game needs something else.", + "Will not start: root override not allowed", + "Run-as user is 0 (root), and root overrides are off on cluster remote-lab. Clear the Run-as user override, or ask an administrator to allow root overrides in that cluster's Configuration.", + "Run-as user", + "User ID the game process runs as.", + "Module default: 1000", + "Custom value", + "0", + "Applied: 1000", + "Module default", + "Pending: 0 · applies on the next restart", + "Run-as group", + "Group ID the game process runs as.", + "Module default: 1000", + "Module default", + "Applied: 1000", + "Module default", + "Filesystem group", + "Group that owns the data volume, so the game can write to it.", + "Module default: 1000", + "Module default", + "Applied: 1000", + "Module default", + "Volume ownership check", + "When the data volume's group is fixed on start.", + "Module default: Only when wrong (built-in)", + "Module default", + "Applied: Only when wrong", + "Built-in default" + ] + } + ] + }, + { + "id": "1:40207", + "name": "Form Footer", + "type": "FRAME", + "x": 0, + "y": 675, + "width": 908, + "height": 56, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 24, 12, 24], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "Btn Discard", + "type": "INSTANCE", + "x": 681, + "y": 12, + "width": 86, + "height": 32, + "component": "Gameplane/Button/Small/Ghost", + "componentId": "1:1124", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "texts": ["Discard"] + }, + { + "name": "Btn Save Changes", + "type": "INSTANCE", + "x": 779, + "y": 12, + "width": 105, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "texts": ["Save changes"] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/901437436-2321.json b/assets/design-export/json/901437436-2321.json new file mode 100644 index 000000000..a3ac5423a --- /dev/null +++ b/assets/design-export/json/901437436-2321.json @@ -0,0 +1,446 @@ +{ + "file": "901437436-2321", + "id": "1:39952", + "name": "Screen/Server Detail — Settings · Security (Held back, running)", + "type": "FRAME", + "x": 8200, + "y": 54439, + "width": 1440, + "height": 1017, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Gameplane/App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 1017, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:39970", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 1017, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Gameplane/Top Bar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "mc-survival", "Search servers…", "AD"] + }, + { + "id": "1:39998", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 953, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Detail Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 86, + "component": "Gameplane/Server Detail Header", + "componentId": "1:447", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [16, 24, 16, 24], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "MI", + "mc-survival", + "Running", + "site: remote-lab · minecraft-java · 1.21.4-fabric · ns: gameplane-games", + "Restart", + "Stop", + "Open console" + ] + }, + { + "name": "Tabs Bar", + "type": "INSTANCE", + "x": 24, + "y": 134, + "width": 1132, + "height": 40, + "component": "Gameplane/Server Detail Tabs", + "componentId": "1:466", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": [ + "Overview", + "Events", + "Console", + "Logs", + "Files", + "Mods", + "Modpacks", + "Players", + "Backups", + "Capture", + "Settings" + ] + }, + { + "id": "1:40023", + "name": "Settings Content", + "type": "FRAME", + "x": 24, + "y": 198, + "width": 1132, + "height": 731, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Settings Sub Nav", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 224, + "height": 731, + "component": "Gameplane/Server Settings Sub Nav", + "componentId": "1:1289", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [8, 8, 8, 8], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "General", + "Version", + "Game configuration", + "Resources", + "Networking", + "Environment", + "Lifecycle", + "Scheduled backups", + "Network capture", + "Placement", + "Security", + "RBAC & access", + "Share links", + "Danger zone" + ] + }, + { + "id": "1:40072", + "name": "Settings Panel Wrap", + "type": "FRAME", + "x": 224, + "y": 0, + "width": 908, + "height": 731, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40149", + "name": "Settings Form", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 908, + "height": 731, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40208", + "name": "Form Body", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 908, + "height": 675, + "layout": { + "mode": "VERTICAL", + "gap": 20, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Gameplane/Security Advanced", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 860, + "height": 627, + "component": "Gameplane/Security Advanced", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "Advanced security", + "1 override", + "Who the game runs as, and how the data volume's group is fixed. Leave a setting on Module default unless the game needs something else.", + "Keeps running, but will not start again", + "Run-as user is 0 (root), and root overrides are off on cluster remote-lab. The server keeps running. It will not start again until the Run-as user override is cleared or an administrator allows root overrides in that cluster's Configuration.", + "Run-as user", + "User ID the game process runs as.", + "Module default: 1000", + "Custom value", + "0", + "Applied: 0", + "Override", + "Run-as group", + "Group ID the game process runs as.", + "Module default: 1000", + "Module default", + "Applied: 1000", + "Module default", + "Filesystem group", + "Group that owns the data volume, so the game can write to it.", + "Module default: 1000", + "Module default", + "Applied: 1000", + "Module default", + "Volume ownership check", + "When the data volume's group is fixed on start.", + "Module default: Only when wrong (built-in)", + "Module default", + "Applied: Only when wrong", + "Built-in default" + ] + } + ] + }, + { + "id": "1:40209", + "name": "Form Footer", + "type": "FRAME", + "x": 0, + "y": 675, + "width": 908, + "height": 56, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 24, 12, 24], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "Btn Discard", + "type": "INSTANCE", + "x": 681, + "y": 12, + "width": 86, + "height": 32, + "component": "Gameplane/Button/Small/Ghost", + "componentId": "1:1124", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "texts": ["Discard"] + }, + { + "name": "Btn Save Changes", + "type": "INSTANCE", + "x": 779, + "y": 12, + "width": 105, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "texts": ["Save changes"] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/901437436-2785.json b/assets/design-export/json/901437436-2785.json new file mode 100644 index 000000000..4965a47f7 --- /dev/null +++ b/assets/design-export/json/901437436-2785.json @@ -0,0 +1,448 @@ +{ + "file": "901437436-2785", + "id": "1:39953", + "name": "Screen/Server Detail — Settings · Security (Refused)", + "type": "FRAME", + "x": 9840, + "y": 54439, + "width": 1440, + "height": 1041, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Gameplane/App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 1041, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:39971", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 1041, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Gameplane/Top Bar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "mc-survival", "Search servers…", "AD"] + }, + { + "id": "1:39999", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 977, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Detail Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 86, + "component": "Gameplane/Server Detail Header", + "componentId": "1:447", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [16, 24, 16, 24], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "MI", + "mc-survival", + "Running", + "site: remote-lab · minecraft-java · 1.21.4-fabric · ns: gameplane-games", + "Restart", + "Stop", + "Open console" + ] + }, + { + "name": "Tabs Bar", + "type": "INSTANCE", + "x": 24, + "y": 134, + "width": 1132, + "height": 40, + "component": "Gameplane/Server Detail Tabs", + "componentId": "1:466", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": [ + "Overview", + "Events", + "Console", + "Logs", + "Files", + "Mods", + "Modpacks", + "Players", + "Backups", + "Capture", + "Settings" + ] + }, + { + "id": "1:40024", + "name": "Settings Content", + "type": "FRAME", + "x": 24, + "y": 198, + "width": 1132, + "height": 755, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Settings Sub Nav", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 224, + "height": 755, + "component": "Gameplane/Server Settings Sub Nav", + "componentId": "1:1289", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [8, 8, 8, 8], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "General", + "Version", + "Game configuration", + "Resources", + "Networking", + "Environment", + "Lifecycle", + "Scheduled backups", + "Network capture", + "Placement", + "Security", + "RBAC & access", + "Share links", + "Danger zone" + ] + }, + { + "id": "1:40073", + "name": "Settings Panel Wrap", + "type": "FRAME", + "x": 224, + "y": 0, + "width": 908, + "height": 755, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40150", + "name": "Settings Form", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 908, + "height": 755, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40210", + "name": "Form Body", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 908, + "height": 699, + "layout": { + "mode": "VERTICAL", + "gap": 20, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Gameplane/Security Advanced", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 860, + "height": 651, + "component": "Gameplane/Security Advanced", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "Advanced security", + "2 overrides", + "Who the game runs as, and how the data volume's group is fixed. Leave a setting on Module default unless the game needs something else.", + "Not saved: root overrides are off on this cluster", + "Run-as user 0 is a root override, and cluster remote-lab does not allow them. An administrator can allow root overrides in that cluster's Configuration.", + "Run-as user", + "User ID the game process runs as.", + "Module default: 1000", + "Custom value", + "0", + "Applied: 1000", + "Module default", + "Run-as group", + "Group ID the game process runs as.", + "Module default: 1000", + "Custom value", + "-5", + "Applied: 1000", + "Module default", + "Enter a whole number from 0 to 2147483647.", + "Filesystem group", + "Group that owns the data volume, so the game can write to it.", + "Module default: 1000", + "Module default", + "Applied: 1000", + "Module default", + "Volume ownership check", + "When the data volume's group is fixed on start.", + "Module default: Only when wrong (built-in)", + "Module default", + "Applied: Only when wrong", + "Built-in default" + ] + } + ] + }, + { + "id": "1:40211", + "name": "Form Footer", + "type": "FRAME", + "x": 0, + "y": 699, + "width": 908, + "height": 56, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 24, 12, 24], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "Btn Discard", + "type": "INSTANCE", + "x": 681, + "y": 12, + "width": 86, + "height": 32, + "component": "Gameplane/Button/Small/Ghost", + "componentId": "1:1124", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "texts": ["Discard"] + }, + { + "name": "Btn Save Changes", + "type": "INSTANCE", + "x": 779, + "y": 12, + "width": 105, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "texts": ["Save changes"] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/901437436-3249.json b/assets/design-export/json/901437436-3249.json new file mode 100644 index 000000000..7dbe09981 --- /dev/null +++ b/assets/design-export/json/901437436-3249.json @@ -0,0 +1,446 @@ +{ + "file": "901437436-3249", + "id": "1:39954", + "name": "Screen/Server Detail — Settings · Security (Forbidden)", + "type": "FRAME", + "x": 11480, + "y": 54439, + "width": 1440, + "height": 1001, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Gameplane/App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 1001, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:39972", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 1001, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Gameplane/Top Bar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "mc-survival", "Search servers…", "AD"] + }, + { + "id": "1:40000", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 937, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Detail Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 86, + "component": "Gameplane/Server Detail Header", + "componentId": "1:447", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [16, 24, 16, 24], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "MI", + "mc-survival", + "Running", + "site: remote-lab · minecraft-java · 1.21.4-fabric · ns: gameplane-games", + "Restart", + "Stop", + "Open console" + ] + }, + { + "name": "Tabs Bar", + "type": "INSTANCE", + "x": 24, + "y": 134, + "width": 1132, + "height": 40, + "component": "Gameplane/Server Detail Tabs", + "componentId": "1:466", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": [ + "Overview", + "Events", + "Console", + "Logs", + "Files", + "Mods", + "Modpacks", + "Players", + "Backups", + "Capture", + "Settings" + ] + }, + { + "id": "1:40025", + "name": "Settings Content", + "type": "FRAME", + "x": 24, + "y": 198, + "width": 1132, + "height": 715, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Settings Sub Nav", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 224, + "height": 715, + "component": "Gameplane/Server Settings Sub Nav", + "componentId": "1:1289", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [8, 8, 8, 8], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "General", + "Version", + "Game configuration", + "Resources", + "Networking", + "Environment", + "Lifecycle", + "Scheduled backups", + "Network capture", + "Placement", + "Security", + "RBAC & access", + "Share links", + "Danger zone" + ] + }, + { + "id": "1:40074", + "name": "Settings Panel Wrap", + "type": "FRAME", + "x": 224, + "y": 0, + "width": 908, + "height": 715, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40151", + "name": "Settings Form", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 908, + "height": 715, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40212", + "name": "Form Body", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 908, + "height": 659, + "layout": { + "mode": "VERTICAL", + "gap": 20, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Gameplane/Security Advanced", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 860, + "height": 611, + "component": "Gameplane/Security Advanced", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "Advanced security", + "1 override", + "Who the game runs as, and how the data volume's group is fixed. Leave a setting on Module default unless the game needs something else.", + "Not saved", + "You need the servers:security permission to change these settings.", + "Run-as user", + "User ID the game process runs as.", + "Module default: 1000", + "Custom value", + "1000", + "Applied: 1000", + "Module default", + "Run-as group", + "Group ID the game process runs as.", + "Module default: 1000", + "Module default", + "Applied: 1000", + "Module default", + "Filesystem group", + "Group that owns the data volume, so the game can write to it.", + "Module default: 1000", + "Module default", + "Applied: 1000", + "Module default", + "Volume ownership check", + "When the data volume's group is fixed on start.", + "Module default: Only when wrong (built-in)", + "Module default", + "Applied: Only when wrong", + "Built-in default" + ] + } + ] + }, + { + "id": "1:40213", + "name": "Form Footer", + "type": "FRAME", + "x": 0, + "y": 659, + "width": 908, + "height": 56, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 24, 12, 24], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "Btn Discard", + "type": "INSTANCE", + "x": 681, + "y": 12, + "width": 86, + "height": 32, + "component": "Gameplane/Button/Small/Ghost", + "componentId": "1:1124", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "texts": ["Discard"] + }, + { + "name": "Btn Save Changes", + "type": "INSTANCE", + "x": 779, + "y": 12, + "width": 105, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "texts": ["Save changes"] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/901437436-3713.json b/assets/design-export/json/901437436-3713.json new file mode 100644 index 000000000..8fe53f3c5 --- /dev/null +++ b/assets/design-export/json/901437436-3713.json @@ -0,0 +1,495 @@ +{ + "file": "901437436-3713", + "id": "1:39955", + "name": "Screen/Server Detail — Settings · Security (File-access warning)", + "type": "FRAME", + "x": 13120, + "y": 54439, + "width": 1440, + "height": 925, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Gameplane/App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 925, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:39973", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 925, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Gameplane/Top Bar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "mc-survival", "Search servers…", "AD"] + }, + { + "id": "1:40001", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 861, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Detail Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 86, + "component": "Gameplane/Server Detail Header", + "componentId": "1:447", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [16, 24, 16, 24], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "MI", + "mc-survival", + "Running", + "site: remote-lab · minecraft-java · 1.21.4-fabric · ns: gameplane-games", + "Restart", + "Stop", + "Open console" + ] + }, + { + "name": "Tabs Bar", + "type": "INSTANCE", + "x": 24, + "y": 134, + "width": 1132, + "height": 40, + "component": "Gameplane/Server Detail Tabs", + "componentId": "1:466", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": [ + "Overview", + "Events", + "Console", + "Logs", + "Files", + "Mods", + "Modpacks", + "Players", + "Backups", + "Capture", + "Settings" + ] + }, + { + "id": "1:40026", + "name": "Settings Content", + "type": "FRAME", + "x": 24, + "y": 198, + "width": 1132, + "height": 639, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Settings Sub Nav", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 224, + "height": 639, + "component": "Gameplane/Server Settings Sub Nav", + "componentId": "1:1289", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [8, 8, 8, 8], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "General", + "Version", + "Game configuration", + "Resources", + "Networking", + "Environment", + "Lifecycle", + "Scheduled backups", + "Network capture", + "Placement", + "Security", + "RBAC & access", + "Share links", + "Danger zone" + ] + }, + { + "id": "1:40075", + "name": "Settings Panel Wrap", + "type": "FRAME", + "x": 224, + "y": 0, + "width": 908, + "height": 639, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40152", + "name": "Settings Form", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 908, + "height": 639, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40214", + "name": "Form Body", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 908, + "height": 583, + "layout": { + "mode": "VERTICAL", + "gap": 20, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Gameplane/Security Advanced", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 860, + "height": 535, + "component": "Gameplane/Security Advanced", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "Advanced security", + "2 overrides", + "Who the game runs as, and how the data volume's group is fixed. Leave a setting on Module default unless the game needs something else.", + "Run-as user", + "User ID the game process runs as.", + "Module default: image default", + "Custom value", + "1000", + "Applied: 0", + "Image default", + "Run-as group", + "Group ID the game process runs as.", + "Module default: image default", + "Custom value", + "1000", + "Applied: 0", + "Image default", + "Filesystem group", + "Group that owns the data volume, so the game can write to it.", + "Module default: 1000", + "Module default", + "Applied: 1000", + "Module default", + "Volume ownership check", + "When the data volume's group is fixed on start.", + "Module default: Only when wrong (built-in)", + "Module default", + "Applied: Only when wrong", + "Built-in default" + ] + } + ] + }, + { + "id": "1:40215", + "name": "Form Footer", + "type": "FRAME", + "x": 0, + "y": 583, + "width": 908, + "height": 56, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 24, 12, 24], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "Btn Discard", + "type": "INSTANCE", + "x": 681, + "y": 12, + "width": 86, + "height": 32, + "component": "Gameplane/Button/Small/Ghost", + "componentId": "1:1124", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "texts": ["Discard"] + }, + { + "name": "Btn Save Changes", + "type": "INSTANCE", + "x": 779, + "y": 12, + "width": 105, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "texts": ["Save changes"] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "id": "1:39974", + "name": "Modal backdrop", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 1440, + "height": 925, + "fills": [{"type": "SOLID", "color": "#000000", "opacity": 0.4}], + "absolute": true, + "clips": true, + "children": [ + { + "name": "Gameplane/Dialog/Security File Access Warning", + "type": "INSTANCE", + "x": 480, + "y": 160, + "width": 480, + "height": 286, + "component": "Gameplane/Dialog/Security File Access Warning", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 32, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "Change who the game runs as?", + "mc-survival already has data. After the next restart it runs as user 1000 and group 1000.", + "Existing files may become unreadable", + "Files written before keep their old owner. If the game cannot read or change them, set a filesystem group or clear the override.", + "Saving does not restart the server.", + "Cancel", + "Save anyway" + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/901437436-465.json b/assets/design-export/json/901437436-465.json new file mode 100644 index 000000000..9917e3af4 --- /dev/null +++ b/assets/design-export/json/901437436-465.json @@ -0,0 +1,448 @@ +{ + "file": "901437436-465", + "id": "1:39948", + "name": "Screen/Server Detail — Settings · Security (Light)", + "type": "FRAME", + "x": 1640, + "y": 54439, + "width": 1440, + "height": 1001, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Gameplane/App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 1001, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#F8DDE9"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:39966", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 1001, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Gameplane/Top Bar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "mc-survival", "Search servers…", "AD"] + }, + { + "id": "1:39994", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 937, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Detail Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 86, + "component": "Gameplane/Server Detail Header", + "componentId": "1:447", + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [16, 24, 16, 24], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "MI", + "mc-survival", + "Running", + "site: remote-lab · minecraft-java · 1.21.4-fabric · ns: gameplane-games", + "Restart", + "Stop", + "Open console" + ] + }, + { + "name": "Tabs Bar", + "type": "INSTANCE", + "x": 24, + "y": 134, + "width": 1132, + "height": 40, + "component": "Gameplane/Server Detail Tabs", + "componentId": "1:466", + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": [ + "Overview", + "Events", + "Console", + "Logs", + "Files", + "Mods", + "Modpacks", + "Players", + "Backups", + "Capture", + "Settings" + ] + }, + { + "id": "1:40019", + "name": "Settings Content", + "type": "FRAME", + "x": 24, + "y": 198, + "width": 1132, + "height": 715, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Settings Sub Nav", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 224, + "height": 715, + "component": "Gameplane/Server Settings Sub Nav", + "componentId": "1:1289", + "fills": [{"type": "SOLID", "color": "#F8DDE9"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [8, 8, 8, 8], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "General", + "Version", + "Game configuration", + "Resources", + "Networking", + "Environment", + "Lifecycle", + "Scheduled backups", + "Network capture", + "Placement", + "Security", + "RBAC & access", + "Share links", + "Danger zone" + ] + }, + { + "id": "1:40068", + "name": "Settings Panel Wrap", + "type": "FRAME", + "x": 224, + "y": 0, + "width": 908, + "height": 715, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40145", + "name": "Settings Form", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 908, + "height": 715, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40200", + "name": "Form Body", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 908, + "height": 659, + "layout": { + "mode": "VERTICAL", + "gap": 20, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Gameplane/Security Advanced", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 860, + "height": 611, + "component": "Gameplane/Security Advanced", + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "Advanced security", + "2 overrides", + "Who the game runs as, and how the data volume's group is fixed. Leave a setting on Module default unless the game needs something else.", + "Applies on the next restart", + "Saving never restarts the server. Pending values take effect the next time it starts.", + "Run-as user", + "User ID the game process runs as.", + "Module default: image default", + "Custom value", + "1000", + "Applied: 1000", + "Override", + "Run-as group", + "Group ID the game process runs as.", + "Module default: 1000", + "Custom value", + "1001", + "Applied: 1000", + "Module default", + "Pending: 1001 · applies on the next restart", + "Filesystem group", + "Group that owns the data volume, so the game can write to it.", + "Module default: 1000", + "Module default", + "Applied: 1000", + "Module default", + "Volume ownership check", + "When the data volume's group is fixed on start.", + "Module default: Only when wrong (built-in)", + "Module default", + "Applied: Only when wrong", + "Built-in default" + ] + } + ] + }, + { + "id": "1:40201", + "name": "Form Footer", + "type": "FRAME", + "x": 0, + "y": 659, + "width": 908, + "height": 56, + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 24, 12, 24], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "Btn Discard", + "type": "INSTANCE", + "x": 681, + "y": 12, + "width": 86, + "height": 32, + "component": "Gameplane/Button/Small/Ghost", + "componentId": "1:1124", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "texts": ["Discard"] + }, + { + "name": "Btn Save Changes", + "type": "INSTANCE", + "x": 779, + "y": 12, + "width": 105, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "texts": ["Save changes"] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/901437436-929.json b/assets/design-export/json/901437436-929.json new file mode 100644 index 000000000..5f7f7feea --- /dev/null +++ b/assets/design-export/json/901437436-929.json @@ -0,0 +1,444 @@ +{ + "file": "901437436-929", + "id": "1:39949", + "name": "Screen/Server Detail — Settings · Security (Image default, no effect)", + "type": "FRAME", + "x": 3280, + "y": 54439, + "width": 1440, + "height": 925, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "clips": true, + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Gameplane/App Sidebar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 260, + "height": 925, + "component": "Gameplane/App Sidebar", + "componentId": "1:234", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "gameplane", + "homelab-01", + "GENERAL", + "Dashboard", + "Servers", + "Modules", + "Backups", + "ADMIN", + "Clusters", + "Nodes", + "Users & RBAC", + "Audit log", + "System logs", + "Settings", + "AD", + "admin", + "admin" + ] + }, + { + "id": "1:39967", + "name": "Main", + "type": "FRAME", + "x": 260, + "y": 0, + "width": 1180, + "height": 925, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Gameplane/Top Bar", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 1180, + "height": 64, + "component": "Gameplane/Top Bar", + "componentId": "1:281", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 32, 0, 32], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": ["gameplane", "mc-survival", "Search servers…", "AD"] + }, + { + "id": "1:39995", + "name": "Body", + "type": "FRAME", + "x": 0, + "y": 64, + "width": 1180, + "height": 861, + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "VERTICAL", + "gap": 24, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "children": [ + { + "name": "Detail Header", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 1132, + "height": 86, + "component": "Gameplane/Server Detail Header", + "componentId": "1:447", + "fills": [{"type": "SOLID", "color": "#121114"}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [16, 24, 16, 24], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background"}, + "texts": [ + "MI", + "mc-survival", + "Running", + "site: remote-lab · minecraft-java · 1.21.4-fabric · ns: gameplane-games", + "Restart", + "Stop", + "Open console" + ] + }, + { + "name": "Tabs Bar", + "type": "INSTANCE", + "x": 24, + "y": 134, + "width": 1132, + "height": 40, + "component": "Gameplane/Server Detail Tabs", + "componentId": "1:466", + "fills": [{"type": "SOLID", "color": "#121114"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 24], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "background/background", "strokes/0/color": "border/border"}, + "texts": [ + "Overview", + "Events", + "Console", + "Logs", + "Files", + "Mods", + "Modpacks", + "Players", + "Backups", + "Capture", + "Settings" + ] + }, + { + "id": "1:40020", + "name": "Settings Content", + "type": "FRAME", + "x": 24, + "y": 198, + "width": 1132, + "height": 639, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Settings Sub Nav", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 224, + "height": 639, + "component": "Gameplane/Server Settings Sub Nav", + "componentId": "1:1289", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [8, 8, 8, 8], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary", "strokes/0/color": "border/border"}, + "texts": [ + "General", + "Version", + "Game configuration", + "Resources", + "Networking", + "Environment", + "Lifecycle", + "Scheduled backups", + "Network capture", + "Placement", + "Security", + "RBAC & access", + "Share links", + "Danger zone" + ] + }, + { + "id": "1:40069", + "name": "Settings Panel Wrap", + "type": "FRAME", + "x": 224, + "y": 0, + "width": 908, + "height": 639, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40146", + "name": "Settings Form", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 908, + "height": 639, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40202", + "name": "Form Body", + "type": "FRAME", + "x": 0, + "y": 0, + "width": 908, + "height": 583, + "layout": { + "mode": "VERTICAL", + "gap": 20, + "padding": [24, 24, 24, 24], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "FIXED"] + }, + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Gameplane/Security Advanced", + "type": "INSTANCE", + "x": 24, + "y": 24, + "width": 860, + "height": 535, + "component": "Gameplane/Security Advanced", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "Advanced security", + "1 override", + "Who the game runs as, and how the data volume's group is fixed. Leave a setting on Module default unless the game needs something else.", + "Run-as user", + "User ID the game process runs as.", + "Module default: image default", + "Module default", + "Applied: image default", + "Image default", + "Run-as group", + "Group ID the game process runs as.", + "Module default: image default", + "Module default", + "Applied: image default", + "Image default", + "Filesystem group", + "Group that owns the data volume, so the game can write to it.", + "Module default: 1000", + "Use image default", + "Applied: image default", + "Image default (override)", + "Volume ownership check", + "When the data volume's group is fixed on start.", + "Module default: Every start", + "Every start", + "Applied: Every start", + "Module default", + "No effect: no filesystem group" + ] + } + ] + }, + { + "id": "1:40203", + "name": "Form Footer", + "type": "FRAME", + "x": 0, + "y": 583, + "width": 908, + "height": 56, + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 24, 12, 24], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"strokes/0/color": "border/border"}, + "children": [ + { + "name": "Btn Discard", + "type": "INSTANCE", + "x": 681, + "y": 12, + "width": 86, + "height": 32, + "component": "Gameplane/Button/Small/Ghost", + "componentId": "1:1124", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "texts": ["Discard"] + }, + { + "name": "Btn Save Changes", + "type": "INSTANCE", + "x": 779, + "y": 12, + "width": 105, + "height": 32, + "component": "Gameplane/Button/Small/Default", + "componentId": "1:709", + "fills": [{"type": "SOLID", "color": "#00000000", "opacity": 0}], + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 0, 0, 0], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "texts": ["Save changes"] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/9dBXM.json b/assets/design-export/json/9dBXM.json index 71025301e..4b2af9acd 100644 --- a/assets/design-export/json/9dBXM.json +++ b/assets/design-export/json/9dBXM.json @@ -4,7 +4,7 @@ "name": "Screen/Backups — Index (Empty)", "type": "FRAME", "x": 1640, - "y": 60040, + "y": 63923, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/A8vGwM.json b/assets/design-export/json/A8vGwM.json index 8cf49ee24..a78d13ae2 100644 --- a/assets/design-export/json/A8vGwM.json +++ b/assets/design-export/json/A8vGwM.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Lifecycle (Wake on connect unavailable)", "type": "FRAME", "x": 1640, - "y": 46388, + "y": 48519, "width": 1440, "height": 1620, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/B57dG.json b/assets/design-export/json/B57dG.json index 141454a82..57648223c 100644 --- a/assets/design-export/json/B57dG.json +++ b/assets/design-export/json/B57dG.json @@ -4,7 +4,7 @@ "name": "Screen/Share Link — Start timed out", "type": "FRAME", "x": 9840, - "y": 91786, + "y": 95669, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/Bbnga.json b/assets/design-export/json/Bbnga.json index 3c2c0cb48..e3819e281 100644 --- a/assets/design-export/json/Bbnga.json +++ b/assets/design-export/json/Bbnga.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Capture (Not enabled)", "type": "FRAME", "x": 0, - "y": 37128, + "y": 39259, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/BdmAW.json b/assets/design-export/json/BdmAW.json index ced79216f..5f6bd2abe 100644 --- a/assets/design-export/json/BdmAW.json +++ b/assets/design-export/json/BdmAW.json @@ -4,7 +4,7 @@ "name": "Screen/Nodes — All clusters", "type": "FRAME", "x": 11480, - "y": 64190, + "y": 68073, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/Be7ZW.json b/assets/design-export/json/Be7ZW.json index b62dab9d1..fd31b6b4a 100644 --- a/assets/design-export/json/Be7ZW.json +++ b/assets/design-export/json/Be7ZW.json @@ -4,7 +4,7 @@ "name": "Legacy/Standalone — Cluster inventory selection — Superseded", "type": "FRAME", "x": 4920, - "y": 64190, + "y": 68073, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/BguST.json b/assets/design-export/json/BguST.json index 242c874d6..af39e45c9 100644 --- a/assets/design-export/json/BguST.json +++ b/assets/design-export/json/BguST.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Game configuration (Password will be removed)", "type": "FRAME", "x": 6560, - "y": 41028, + "y": 43159, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/Bq2Yg.json b/assets/design-export/json/Bq2Yg.json index 460d04863..314d9585e 100644 --- a/assets/design-export/json/Bq2Yg.json +++ b/assets/design-export/json/Bq2Yg.json @@ -4,7 +4,7 @@ "name": "Screen/Admin — System Logs", "type": "FRAME", "x": 0, - "y": 73290, + "y": 77173, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/Burtr.json b/assets/design-export/json/Burtr.json index 3a39fe8aa..df2daaa17 100644 --- a/assets/design-export/json/Burtr.json +++ b/assets/design-export/json/Burtr.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Files", "type": "FRAME", "x": 0, - "y": 30370, + "y": 32501, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/C2LQE4.json b/assets/design-export/json/C2LQE4.json index dc70026fb..d22fec68a 100644 --- a/assets/design-export/json/C2LQE4.json +++ b/assets/design-export/json/C2LQE4.json @@ -4,7 +4,7 @@ "name": "Screen/Share Link — Up", "type": "FRAME", "x": 0, - "y": 91786, + "y": 95669, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/C5Aoe.json b/assets/design-export/json/C5Aoe.json index a5a29e26b..b7321009a 100644 --- a/assets/design-export/json/C5Aoe.json +++ b/assets/design-export/json/C5Aoe.json @@ -4,7 +4,7 @@ "name": "Screen/Mobile — Servers filters open", "type": "FRAME", "x": 6100, - "y": 14602, + "y": 16264, "width": 375, "height": 954, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/C9bR6.json b/assets/design-export/json/C9bR6.json index 64ee88958..541289299 100644 --- a/assets/design-export/json/C9bR6.json +++ b/assets/design-export/json/C9bR6.json @@ -4,7 +4,7 @@ "name": "Gameplane/Dialog/Edit user — Standalone (Remote grant)", "type": "FRAME", "x": 2320, - "y": 66790, + "y": 70673, "width": 480, "height": 643, "fills": [{"type": "SOLID", "color": "#1C1A20"}], diff --git a/assets/design-export/json/Cb3eC.json b/assets/design-export/json/Cb3eC.json index 49400cbb1..0ba4dfcc5 100644 --- a/assets/design-export/json/Cb3eC.json +++ b/assets/design-export/json/Cb3eC.json @@ -4,7 +4,7 @@ "name": "Screen/Backups — Schedules filters open", "type": "FRAME", "x": 3280, - "y": 61340, + "y": 65223, "width": 1440, "height": 1150, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/D9QYZ.json b/assets/design-export/json/D9QYZ.json index ae1d1f275..282a5c446 100644 --- a/assets/design-export/json/D9QYZ.json +++ b/assets/design-export/json/D9QYZ.json @@ -4,7 +4,7 @@ "name": "Legacy/Standalone — Backup destinations — Moved", "type": "FRAME", "x": 1640, - "y": 82489, + "y": 86372, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/DBQyF.json b/assets/design-export/json/DBQyF.json index 202dbc76d..06463466b 100644 --- a/assets/design-export/json/DBQyF.json +++ b/assets/design-export/json/DBQyF.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Telemetry (disabled)", "type": "FRAME", "x": 6560, - "y": 87754, + "y": 91637, "width": 1440, "height": 641, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/DPrYX.json b/assets/design-export/json/DPrYX.json index 103c0e33f..963634d14 100644 --- a/assets/design-export/json/DPrYX.json +++ b/assets/design-export/json/DPrYX.json @@ -4,7 +4,7 @@ "name": "Screen/Backups — Index", "type": "FRAME", "x": 0, - "y": 60040, + "y": 63923, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/DWztv.json b/assets/design-export/json/DWztv.json index 270793b91..824694dd3 100644 --- a/assets/design-export/json/DWztv.json +++ b/assets/design-export/json/DWztv.json @@ -4,7 +4,7 @@ "name": "Screen/Mobile — Servers (Light)", "type": "FRAME", "x": 5510, - "y": 14602, + "y": 16264, "width": 390, "height": 844, "fills": [{"type": "SOLID", "color": "#FFFFFF"}], diff --git a/assets/design-export/json/Dpb9f.json b/assets/design-export/json/Dpb9f.json index 43756f399..1f5ae3992 100644 --- a/assets/design-export/json/Dpb9f.json +++ b/assets/design-export/json/Dpb9f.json @@ -4,7 +4,7 @@ "name": "Screen/Users & RBAC — Identity providers", "type": "FRAME", "x": 0, - "y": 70690, + "y": 74573, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/DxKOh.json b/assets/design-export/json/DxKOh.json index 7b98cbfc9..9e84df533 100644 --- a/assets/design-export/json/DxKOh.json +++ b/assets/design-export/json/DxKOh.json @@ -4,7 +4,7 @@ "name": "Screen/Audit Log", "type": "FRAME", "x": 0, - "y": 71990, + "y": 75873, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/E0ypH.json b/assets/design-export/json/E0ypH.json index d81f08e1d..2d3572a25 100644 --- a/assets/design-export/json/E0ypH.json +++ b/assets/design-export/json/E0ypH.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Resources", "type": "FRAME", "x": 0, - "y": 42388, + "y": 44519, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/EKJyM.json b/assets/design-export/json/EKJyM.json index 036c832f5..f7b344543 100644 --- a/assets/design-export/json/EKJyM.json +++ b/assets/design-export/json/EKJyM.json @@ -4,7 +4,7 @@ "name": "Server Detail · Settings · Networking · Provider + credentials complete", "type": "FRAME", "x": 8200, - "y": 43788, + "y": 45919, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/EWrn0.json b/assets/design-export/json/EWrn0.json index f67286681..7a62f5811 100644 --- a/assets/design-export/json/EWrn0.json +++ b/assets/design-export/json/EWrn0.json @@ -4,7 +4,7 @@ "name": "Screen/Standalone — Modules (East selected)", "type": "FRAME", "x": 4920, - "y": 56208, + "y": 60091, "width": 1440, "height": 1900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/EZFW0.json b/assets/design-export/json/EZFW0.json index 829bc2e1d..2394fcd2f 100644 --- a/assets/design-export/json/EZFW0.json +++ b/assets/design-export/json/EZFW0.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Overview", "type": "FRAME", "x": 0, - "y": 24345, + "y": 26476, "width": 1440, "height": 1300, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/EcoGD.json b/assets/design-export/json/EcoGD.json index d02594514..bc371b143 100644 --- a/assets/design-export/json/EcoGD.json +++ b/assets/design-export/json/EcoGD.json @@ -4,7 +4,7 @@ "name": "Screen/Share Link — Starting", "type": "FRAME", "x": 4920, - "y": 91786, + "y": 95669, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/F9pUrx.json b/assets/design-export/json/F9pUrx.json index 6a581aa38..2f9d023d7 100644 --- a/assets/design-export/json/F9pUrx.json +++ b/assets/design-export/json/F9pUrx.json @@ -4,7 +4,7 @@ "name": "Screen/Servers", "type": "FRAME", "x": 0, - "y": 14602, + "y": 16264, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/FBiMN.json b/assets/design-export/json/FBiMN.json index e42ac1340..63e12787d 100644 --- a/assets/design-export/json/FBiMN.json +++ b/assets/design-export/json/FBiMN.json @@ -4,7 +4,7 @@ "name": "Screen/Share Link — Asleep (Start cooldown)", "type": "FRAME", "x": 3280, - "y": 91786, + "y": 95669, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/FOVMf.json b/assets/design-export/json/FOVMf.json index 0d5975163..371e63e96 100644 --- a/assets/design-export/json/FOVMf.json +++ b/assets/design-export/json/FOVMf.json @@ -4,7 +4,7 @@ "name": "Screen/Standalone — Settings · About", "type": "FRAME", "x": 1640, - "y": 90486, + "y": 94369, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/FtdkI.json b/assets/design-export/json/FtdkI.json index d6f5191ec..a36b914ad 100644 --- a/assets/design-export/json/FtdkI.json +++ b/assets/design-export/json/FtdkI.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Logs (Failed)", "type": "FRAME", "x": 1640, - "y": 29070, + "y": 31201, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/GR1G9.json b/assets/design-export/json/GR1G9.json index 88c8438e2..314ea5bbf 100644 --- a/assets/design-export/json/GR1G9.json +++ b/assets/design-export/json/GR1G9.json @@ -4,7 +4,7 @@ "name": "Screen/Dashboard Home — Telemetry notice (bundled)", "type": "FRAME", "x": 6560, - "y": 12822, + "y": 14484, "width": 1440, "height": 1380, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/GayoL.json b/assets/design-export/json/GayoL.json index bea87ae0a..4d84ace6c 100644 --- a/assets/design-export/json/GayoL.json +++ b/assets/design-export/json/GayoL.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Mods — Browse (added)", "type": "FRAME", "x": 3280, - "y": 31670, + "y": 33801, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/GsofJ.json b/assets/design-export/json/GsofJ.json index 986272151..237d29598 100644 --- a/assets/design-export/json/GsofJ.json +++ b/assets/design-export/json/GsofJ.json @@ -4,7 +4,7 @@ "name": "Screen/Login — Language menu open", "type": "FRAME", "x": 6560, - "y": 10222, + "y": 11884, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/HVhmb.json b/assets/design-export/json/HVhmb.json index fbbd3f120..192a9e0d2 100644 --- a/assets/design-export/json/HVhmb.json +++ b/assets/design-export/json/HVhmb.json @@ -4,7 +4,7 @@ "name": "Legacy/Clusters list — Remove registration — Moved", "type": "FRAME", "x": 8200, - "y": 64190, + "y": 68073, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/Hy9r0.json b/assets/design-export/json/Hy9r0.json index 9cd7f95d3..87c934824 100644 --- a/assets/design-export/json/Hy9r0.json +++ b/assets/design-export/json/Hy9r0.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Overview (Idle armed)", "type": "FRAME", "x": 6560, - "y": 24345, + "y": 26476, "width": 1440, "height": 1622, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/IBUqJ.json b/assets/design-export/json/IBUqJ.json index 5f00ebddc..2dcc50662 100644 --- a/assets/design-export/json/IBUqJ.json +++ b/assets/design-export/json/IBUqJ.json @@ -4,7 +4,7 @@ "name": "Screen/Nodes — Add node target", "type": "FRAME", "x": 19680, - "y": 64190, + "y": 68073, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/IMSD5.json b/assets/design-export/json/IMSD5.json index e085ed986..e8fa728f3 100644 --- a/assets/design-export/json/IMSD5.json +++ b/assets/design-export/json/IMSD5.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Danger zone (Owner-only)", "type": "FRAME", "x": 3280, - "y": 54908, + "y": 58791, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/IdbiB.json b/assets/design-export/json/IdbiB.json index 47758e84d..e9de2d513 100644 --- a/assets/design-export/json/IdbiB.json +++ b/assets/design-export/json/IdbiB.json @@ -4,7 +4,7 @@ "name": "Screen/Dialog/Build Module — Step 1 (Preset & Metadata)", "type": "FRAME", "x": 0, - "y": 58658, + "y": 62541, "width": 800, "height": 977, "fills": [{"type": "SOLID", "color": "#1C1A20"}], diff --git a/assets/design-export/json/IyMFM.json b/assets/design-export/json/IyMFM.json index 05192b749..850f5d9c1 100644 --- a/assets/design-export/json/IyMFM.json +++ b/assets/design-export/json/IyMFM.json @@ -4,7 +4,7 @@ "name": "J5pjJ3 states/Tunnel enabled", "type": "FRAME", "x": 9840, - "y": 43788, + "y": 45919, "width": 500, "height": 476, "fills": [{"type": "SOLID", "color": "#1C1A20"}], diff --git a/assets/design-export/json/IzuY2.json b/assets/design-export/json/IzuY2.json index d135fe1b8..a4a0dfd5a 100644 --- a/assets/design-export/json/IzuY2.json +++ b/assets/design-export/json/IzuY2.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Overview (Never sleeps)", "type": "FRAME", "x": 3280, - "y": 24345, + "y": 26476, "width": 1440, "height": 1725, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/J5pjJ3.json b/assets/design-export/json/J5pjJ3.json index 683fe2e9d..87216aed0 100644 --- a/assets/design-export/json/J5pjJ3.json +++ b/assets/design-export/json/J5pjJ3.json @@ -4,7 +4,7 @@ "name": "Server Detail · Settings · Networking · Complete", "type": "FRAME", "x": 0, - "y": 43788, + "y": 45919, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/J8GzM9.json b/assets/design-export/json/J8GzM9.json index e5aab219e..23c30df3d 100644 --- a/assets/design-export/json/J8GzM9.json +++ b/assets/design-export/json/J8GzM9.json @@ -4,7 +4,7 @@ "name": "Screen/Cluster Details — Nodes", "type": "FRAME", "x": 14760, - "y": 64190, + "y": 68073, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/K5XinZ.json b/assets/design-export/json/K5XinZ.json index 86d7db19c..85a384bdb 100644 --- a/assets/design-export/json/K5XinZ.json +++ b/assets/design-export/json/K5XinZ.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Telemetry (none)", "type": "FRAME", "x": 8200, - "y": 87754, + "y": 91637, "width": 1440, "height": 605, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/KJdxg.json b/assets/design-export/json/KJdxg.json index 37a573113..c1ab75dc6 100644 --- a/assets/design-export/json/KJdxg.json +++ b/assets/design-export/json/KJdxg.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Minecraft JVM startup", "type": "FRAME", "x": 9740, - "y": 41028, + "y": 43159, "width": 1440, "height": 980, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/KaRFX.json b/assets/design-export/json/KaRFX.json index bb9253ccb..8c19d6687 100644 --- a/assets/design-export/json/KaRFX.json +++ b/assets/design-export/json/KaRFX.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Scheduled backups", "type": "FRAME", "x": 0, - "y": 48408, + "y": 50539, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/KhYNc.json b/assets/design-export/json/KhYNc.json index 23c79768f..0e3f307e5 100644 --- a/assets/design-export/json/KhYNc.json +++ b/assets/design-export/json/KhYNc.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Mods (by ID)", "type": "FRAME", "x": 1640, - "y": 31670, + "y": 33801, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/LYPXU.json b/assets/design-export/json/LYPXU.json index 333ba70a0..c58f04212 100644 --- a/assets/design-export/json/LYPXU.json +++ b/assets/design-export/json/LYPXU.json @@ -4,7 +4,7 @@ "name": "Screen/Share Link — Stopped by owner", "type": "FRAME", "x": 8200, - "y": 91786, + "y": 95669, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/M2sA4u.json b/assets/design-export/json/M2sA4u.json index ec027c914..2aa8e519f 100644 --- a/assets/design-export/json/M2sA4u.json +++ b/assets/design-export/json/M2sA4u.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Updates", "type": "FRAME", "x": 0, - "y": 89186, + "y": 93069, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/N13Xud.json b/assets/design-export/json/N13Xud.json index 8cf45e404..76049bb0d 100644 --- a/assets/design-export/json/N13Xud.json +++ b/assets/design-export/json/N13Xud.json @@ -4,7 +4,7 @@ "name": "Screen/App Loading", "type": "FRAME", "x": 0, - "y": 11522, + "y": 13184, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/N1GkB.json b/assets/design-export/json/N1GkB.json index 16c340919..10f636024 100644 --- a/assets/design-export/json/N1GkB.json +++ b/assets/design-export/json/N1GkB.json @@ -4,7 +4,7 @@ "name": "Screen/Login", "type": "FRAME", "x": 0, - "y": 10222, + "y": 11884, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/N2nTf.json b/assets/design-export/json/N2nTf.json index 3b73a5c03..6efd21a3e 100644 --- a/assets/design-export/json/N2nTf.json +++ b/assets/design-export/json/N2nTf.json @@ -4,7 +4,7 @@ "name": "Screen/Mobile — Nodes — All clusters", "type": "FRAME", "x": 21280, - "y": 64190, + "y": 68073, "width": 390, "height": 1620, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/NKiqf.json b/assets/design-export/json/NKiqf.json index d90a43a95..693ac137b 100644 --- a/assets/design-export/json/NKiqf.json +++ b/assets/design-export/json/NKiqf.json @@ -4,7 +4,7 @@ "name": "Screen/Mobile — Backups filters open", "type": "FRAME", "x": 4920, - "y": 60040, + "y": 63923, "width": 375, "height": 844, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/NLu2I.json b/assets/design-export/json/NLu2I.json index 6afed8099..35fdf9783 100644 --- a/assets/design-export/json/NLu2I.json +++ b/assets/design-export/json/NLu2I.json @@ -4,9 +4,9 @@ "name": "Screen/Create Server — Step 3 Configure (Reserve less on)", "type": "FRAME", "x": 1640, - "y": 18792, + "y": 20454, "width": 1440, - "height": 2083, + "height": 2214, "fills": [{"type": "SOLID", "color": "#121114"}], "layout": { "mode": "HORIZONTAL", @@ -26,7 +26,7 @@ "x": 0, "y": 0, "width": 260, - "height": 2083, + "height": 2214, "component": "Gameplane/App Sidebar", "componentId": "1:234", "fills": [{"type": "SOLID", "color": "#17151A"}], @@ -69,7 +69,7 @@ "x": 260, "y": 0, "width": 1180, - "height": 2083, + "height": 2214, "fills": [{"type": "SOLID", "color": "#121114"}], "layout": { "mode": "VERTICAL", @@ -117,7 +117,7 @@ "x": 0, "y": 0, "width": 1440, - "height": 2083, + "height": 2214, "fills": [{"type": "SOLID", "color": "#000000B3", "opacity": 0.7}], "layout": { "mode": "VERTICAL", @@ -136,7 +136,7 @@ "x": 240, "y": 77, "width": 960, - "height": 1929, + "height": 2060, "fills": [{"type": "SOLID", "color": "#1C1A20"}], "strokes": [{"type": "SOLID", "color": "#2C2932"}], "strokeWeight": 1, @@ -304,7 +304,7 @@ "x": 0, "y": 229, "width": 960, - "height": 1632, + "height": 1763, "layout": { "mode": "HORIZONTAL", "gap": 12, @@ -322,7 +322,7 @@ "x": 24, "y": 24, "width": 627, - "height": 1584, + "height": 1715, "layout": { "mode": "VERTICAL", "gap": 12, @@ -1493,6 +1493,37 @@ ] } ] + }, + { + "name": "Gameplane/Security Advanced", + "type": "INSTANCE", + "x": 0, + "y": 1596, + "width": 627, + "height": 119, + "component": "Gameplane/Security Advanced", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "Advanced security", + "Who the game runs as, and how the data volume's group is fixed. Leave a setting on Module default unless the game needs something else." + ] } ] }, @@ -1919,7 +1950,7 @@ "name": "Footer", "type": "INSTANCE", "x": 0, - "y": 1861, + "y": 1992, "width": 960, "height": 68, "component": "Gameplane/Wizard Modal Footer", diff --git a/assets/design-export/json/Ne5TA.json b/assets/design-export/json/Ne5TA.json index 27e0a9b18..90c5cce35 100644 --- a/assets/design-export/json/Ne5TA.json +++ b/assets/design-export/json/Ne5TA.json @@ -4,7 +4,7 @@ "name": "Screen/Not Found", "type": "FRAME", "x": 0, - "y": 93086, + "y": 96969, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/NqaaU.json b/assets/design-export/json/NqaaU.json index 541c115fb..4b22fe772 100644 --- a/assets/design-export/json/NqaaU.json +++ b/assets/design-export/json/NqaaU.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Resources (Reserve less on)", "type": "FRAME", "x": 1640, - "y": 42388, + "y": 44519, "width": 1440, "height": 1000, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/O08uaD.json b/assets/design-export/json/O08uaD.json index 7a781b4b0..808a27525 100644 --- a/assets/design-export/json/O08uaD.json +++ b/assets/design-export/json/O08uaD.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Capture — Start capture", "type": "FRAME", "x": 6560, - "y": 37128, + "y": 39259, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/O5kaV.json b/assets/design-export/json/O5kaV.json index 2ac869e92..fe19b747f 100644 --- a/assets/design-export/json/O5kaV.json +++ b/assets/design-export/json/O5kaV.json @@ -4,7 +4,7 @@ "name": "Screen/Dialog/Build Module — Step 2 (Container & Ports)", "type": "FRAME", "x": 1000, - "y": 58658, + "y": 62541, "width": 800, "height": 546, "fills": [{"type": "SOLID", "color": "#1C1A20"}], diff --git a/assets/design-export/json/OC804.json b/assets/design-export/json/OC804.json index 42c266fcb..e8649104a 100644 --- a/assets/design-export/json/OC804.json +++ b/assets/design-export/json/OC804.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Game configuration", "type": "FRAME", "x": 0, - "y": 41028, + "y": 43159, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/OecJ5.json b/assets/design-export/json/OecJ5.json index d075becc6..dcdcf5bcf 100644 --- a/assets/design-export/json/OecJ5.json +++ b/assets/design-export/json/OecJ5.json @@ -4,9 +4,9 @@ "name": "Screen/Cluster Details — Configuration — Local", "type": "FRAME", "x": 16400, - "y": 64190, + "y": 68073, "width": 1440, - "height": 1060, + "height": 1293, "fills": [{"type": "SOLID", "color": "#121114"}], "layout": { "mode": "HORIZONTAL", @@ -26,7 +26,7 @@ "x": 0, "y": 0, "width": 260, - "height": 1060, + "height": 1293, "component": "Gameplane/App Sidebar", "componentId": "1:234", "fills": [{"type": "SOLID", "color": "#17151A"}], @@ -69,7 +69,7 @@ "x": 260, "y": 0, "width": 1180, - "height": 1060, + "height": 1293, "layout": { "mode": "VERTICAL", "gap": 0, @@ -113,7 +113,7 @@ "x": 0, "y": 64, "width": 1180, - "height": 996, + "height": 1229, "layout": { "mode": "VERTICAL", "gap": 24, @@ -638,12 +638,48 @@ } ] }, + { + "name": "Security", + "type": "INSTANCE", + "x": 24, + "y": 736, + "width": 1132, + "height": 209, + "component": "Gameplane/Cluster Security Panel", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "Security", + "How game servers on this cluster may run.", + "Allow root overrides", + "Lets server owners run a game as root (user or group 0), or with the image's default user. Off by default, set per cluster.", + "Turning this off does not stop running servers on this cluster. Stopped servers that hold a root override will not start until the override is cleared or this is turned back on.", + "Control-plane namespace", + "gameplane" + ] + }, { "id": "1:11034", "name": "Built-in cluster removal", "type": "TEXT", "x": 24, - "y": 736, + "y": 969, "width": 1132, "height": 17, "fills": [{"type": "SOLID", "color": "#9E98A6"}], diff --git a/assets/design-export/json/P08Uw.json b/assets/design-export/json/P08Uw.json index fa68c9e6f..876c8fc86 100644 --- a/assets/design-export/json/P08Uw.json +++ b/assets/design-export/json/P08Uw.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Events", "type": "FRAME", "x": 0, - "y": 26470, + "y": 28601, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/QFEg9.json b/assets/design-export/json/QFEg9.json index 241c2772d..38725dd1d 100644 --- a/assets/design-export/json/QFEg9.json +++ b/assets/design-export/json/QFEg9.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Game configuration (Invalid value)", "type": "FRAME", "x": 1640, - "y": 41028, + "y": 43159, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/QQtUD.json b/assets/design-export/json/QQtUD.json index 239ed4312..ca842268b 100644 --- a/assets/design-export/json/QQtUD.json +++ b/assets/design-export/json/QQtUD.json @@ -4,7 +4,7 @@ "name": "Screen/Create Server — Step 4 Network (as built)", "type": "FRAME", "x": 1640, - "y": 21275, + "y": 23406, "width": 1440, "height": 1270, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/QgW58.json b/assets/design-export/json/QgW58.json index f7b3714f5..85833b10c 100644 --- a/assets/design-export/json/QgW58.json +++ b/assets/design-export/json/QgW58.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Authentication (Save rejected)", "type": "FRAME", "x": 3280, - "y": 78780, + "y": 82663, "width": 1440, "height": 1660, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/QpEvu.json b/assets/design-export/json/QpEvu.json index d3e474d67..6e31fc827 100644 --- a/assets/design-export/json/QpEvu.json +++ b/assets/design-export/json/QpEvu.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Access", "type": "FRAME", "x": 1640, - "y": 52308, + "y": 56191, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/RC3Kf.json b/assets/design-export/json/RC3Kf.json index e401bbacf..f2640a7c8 100644 --- a/assets/design-export/json/RC3Kf.json +++ b/assets/design-export/json/RC3Kf.json @@ -4,7 +4,7 @@ "name": "Legacy/Admin Settings — Backup destinations — Moved", "type": "FRAME", "x": 0, - "y": 82489, + "y": 86372, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/RS0KZ.json b/assets/design-export/json/RS0KZ.json index 81ee8e65f..b3e73a07b 100644 --- a/assets/design-export/json/RS0KZ.json +++ b/assets/design-export/json/RS0KZ.json @@ -4,7 +4,7 @@ "name": "State/Standalone — Cluster selection and request states", "type": "FRAME", "x": 9840, - "y": 64190, + "y": 68073, "width": 1440, "height": 732, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/RodrS.json b/assets/design-export/json/RodrS.json index 1ef68f0b8..3eacc0776 100644 --- a/assets/design-export/json/RodrS.json +++ b/assets/design-export/json/RodrS.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Network capture", "type": "FRAME", "x": 0, - "y": 49708, + "y": 51839, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/RpHBg.json b/assets/design-export/json/RpHBg.json index 049e852e0..e22d1e5ac 100644 --- a/assets/design-export/json/RpHBg.json +++ b/assets/design-export/json/RpHBg.json @@ -4,7 +4,7 @@ "name": "Screen/Standalone — Register cluster", "type": "FRAME", "x": 6560, - "y": 64190, + "y": 68073, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -320,9 +320,9 @@ "name": "Register cluster dialog", "type": "FRAME", "x": 480, - "y": 141.5, + "y": 73.5, "width": 480, - "height": 617, + "height": 753, "fills": [{"type": "SOLID", "color": "#1C1A20"}], "strokes": [{"type": "SOLID", "color": "#2C2932"}], "strokeWeight": 1, @@ -395,7 +395,7 @@ "x": 20, "y": 111, "width": 440, - "height": 434, + "height": 570, "layout": { "mode": "VERTICAL", "gap": 16, @@ -599,12 +599,92 @@ } ] }, + { + "id": "1:40066", + "name": "Control-plane namespace field", + "type": "FRAME", + "x": 0, + "y": 380, + "width": 440, + "height": 120, + "layout": { + "mode": "VERTICAL", + "gap": 6, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "id": "1:40142", + "name": "Control-plane namespace label", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 440, + "height": 18, + "fills": [{"type": "SOLID", "color": "#F5F3F7"}], + "layoutAlignSelf": "STRETCH", + "text": "Control-plane namespace (optional)", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Control-plane namespace input", + "type": "INSTANCE", + "x": 0, + "y": 24, + "width": 440, + "height": 36, + "component": "Gameplane/Input", + "componentId": "1:706", + "fills": [{"type": "SOLID", "color": "#17151A"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 2, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [8, 12, 8, 12], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "field/background", + "strokes/0/color": "field/border" + }, + "texts": ["gameplane"] + }, + { + "id": "1:40143", + "name": "Control-plane namespace help", + "type": "TEXT", + "x": 0, + "y": 66, + "width": 440, + "height": 54, + "fills": [{"type": "SOLID", "color": "#9E98A6"}], + "layoutAlignSelf": "STRETCH", + "text": "Namespace where this cluster's Gameplane operator runs. Leave gameplane unless it was installed elsewhere; a wrong value shows the cluster's root setting as missing.", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, { "id": "1:9345", "name": "Connection helper", "type": "TEXT", "x": 0, - "y": 380, + "y": 516, "width": 440, "height": 54, "fills": [{"type": "SOLID", "color": "#9E98A6"}], @@ -620,7 +700,7 @@ "name": "mFooter", "type": "FRAME", "x": 20, - "y": 545, + "y": 681, "width": 440, "height": 52, "layout": { diff --git a/assets/design-export/json/SUcad.json b/assets/design-export/json/SUcad.json index 722668be8..fea04a308 100644 --- a/assets/design-export/json/SUcad.json +++ b/assets/design-export/json/SUcad.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Notifications (Add sink)", "type": "FRAME", "x": 1640, - "y": 86389, + "y": 90272, "width": 1440, "height": 965, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/SUtGZ.json b/assets/design-export/json/SUtGZ.json index 338a3f7b8..1c3493179 100644 --- a/assets/design-export/json/SUtGZ.json +++ b/assets/design-export/json/SUtGZ.json @@ -4,7 +4,7 @@ "name": "Screen/Mobile — Remote server Capture", "type": "FRAME", "x": 12840, - "y": 37128, + "y": 39259, "width": 375, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/SeizD.json b/assets/design-export/json/SeizD.json index 5dc8b56d5..bff9d9579 100644 --- a/assets/design-export/json/SeizD.json +++ b/assets/design-export/json/SeizD.json @@ -4,7 +4,7 @@ "name": "Screen/Mobile — Nav Drawer", "type": "FRAME", "x": 6675, - "y": 14602, + "y": 16264, "width": 390, "height": 844, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/Ss0Yr.json b/assets/design-export/json/Ss0Yr.json index 94f286539..cfca49908 100644 --- a/assets/design-export/json/Ss0Yr.json +++ b/assets/design-export/json/Ss0Yr.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Mods — Install mod (from URL)", "type": "FRAME", "x": 4920, - "y": 31670, + "y": 33801, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/T1wkiT.json b/assets/design-export/json/T1wkiT.json index b60a1413d..ea66516cf 100644 --- a/assets/design-export/json/T1wkiT.json +++ b/assets/design-export/json/T1wkiT.json @@ -4,7 +4,7 @@ "name": "Screen/Theme Settings — Warnings", "type": "FRAME", "x": 1640, - "y": 75890, + "y": 79773, "width": 1440, "height": 2490, "fills": [{"type": "SOLID", "color": "#FFFFFF"}], diff --git a/assets/design-export/json/T70dJ.json b/assets/design-export/json/T70dJ.json index 61c072e7e..60893cbd6 100644 --- a/assets/design-export/json/T70dJ.json +++ b/assets/design-export/json/T70dJ.json @@ -4,9 +4,9 @@ "name": "Screen/Cluster Details — Configuration — Default storage", "type": "FRAME", "x": 21830, - "y": 64190, + "y": 68073, "width": 1440, - "height": 1060, + "height": 1293, "fills": [{"type": "SOLID", "color": "#121114"}], "layout": { "mode": "HORIZONTAL", @@ -26,7 +26,7 @@ "x": 0, "y": 0, "width": 260, - "height": 1060, + "height": 1293, "component": "Gameplane/App Sidebar", "componentId": "1:234", "fills": [{"type": "SOLID", "color": "#17151A"}], @@ -69,7 +69,7 @@ "x": 260, "y": 0, "width": 1180, - "height": 1060, + "height": 1293, "layout": { "mode": "VERTICAL", "gap": 0, @@ -113,7 +113,7 @@ "x": 0, "y": 64, "width": 1180, - "height": 996, + "height": 1229, "layout": { "mode": "VERTICAL", "gap": 24, @@ -638,12 +638,48 @@ } ] }, + { + "name": "Security", + "type": "INSTANCE", + "x": 24, + "y": 736, + "width": 1132, + "height": 209, + "component": "Gameplane/Cluster Security Panel", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "Security", + "How game servers on this cluster may run.", + "Allow root overrides", + "Lets server owners run a game as root (user or group 0), or with the image's default user. Off by default, set per cluster.", + "Turning this off does not stop running servers on this cluster. Stopped servers that hold a root override will not start until the override is cleared or this is turned back on.", + "Control-plane namespace", + "gameplane" + ] + }, { "id": "1:11222", "name": "Built-in cluster removal", "type": "TEXT", "x": 24, - "y": 736, + "y": 969, "width": 1132, "height": 17, "fills": [{"type": "SOLID", "color": "#9E98A6"}], diff --git a/assets/design-export/json/TBvTC.json b/assets/design-export/json/TBvTC.json index 2e2c556df..eeee6ce3c 100644 --- a/assets/design-export/json/TBvTC.json +++ b/assets/design-export/json/TBvTC.json @@ -4,7 +4,7 @@ "name": "Screen/Users & RBAC — Service accounts", "type": "FRAME", "x": 0, - "y": 69390, + "y": 73273, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/TE2jI.json b/assets/design-export/json/TE2jI.json index 29ca0b9e8..586aa8604 100644 --- a/assets/design-export/json/TE2jI.json +++ b/assets/design-export/json/TE2jI.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Overview (Asleep)", "type": "FRAME", "x": 4920, - "y": 24345, + "y": 26476, "width": 1440, "height": 1102, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -1904,7 +1904,6 @@ "sizing": ["HUG", "FIXED"] }, "layoutAlignSelf": "STRETCH", - "clips": true, "variables": {"fills/0/color": "surface/surface", "strokes/0/color": "border/border"}, "texts": [ "QUICK ACTIONS", diff --git a/assets/design-export/json/U9xSg.json b/assets/design-export/json/U9xSg.json index 79bb677a4..8e4a091b1 100644 --- a/assets/design-export/json/U9xSg.json +++ b/assets/design-export/json/U9xSg.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Players (Nuclear Option)", "type": "FRAME", "x": 1640, - "y": 34528, + "y": 36659, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/UCNBm.json b/assets/design-export/json/UCNBm.json index 516b89059..65f720e1a 100644 --- a/assets/design-export/json/UCNBm.json +++ b/assets/design-export/json/UCNBm.json @@ -4,7 +4,7 @@ "name": "Screen/Servers — Cluster filters open", "type": "FRAME", "x": 3280, - "y": 14602, + "y": 16264, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/UMJli.json b/assets/design-export/json/UMJli.json index f19e58473..5b06ef5d8 100644 --- a/assets/design-export/json/UMJli.json +++ b/assets/design-export/json/UMJli.json @@ -4,7 +4,7 @@ "name": "Screen/Create Server — Step 5 Review", "type": "FRAME", "x": 0, - "y": 22945, + "y": 25076, "width": 1440, "height": 1000, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/UdnBT.json b/assets/design-export/json/UdnBT.json index 141a42d4b..606e4207d 100644 --- a/assets/design-export/json/UdnBT.json +++ b/assets/design-export/json/UdnBT.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Authentication (Role rules)", "type": "FRAME", "x": 6560, - "y": 78780, + "y": 82663, "width": 1440, "height": 2600, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/Uzzje.json b/assets/design-export/json/Uzzje.json index 157843e8b..9f271332f 100644 --- a/assets/design-export/json/Uzzje.json +++ b/assets/design-export/json/Uzzje.json @@ -4,7 +4,7 @@ "name": "Screen/Standalone — Settings · Updates", "type": "FRAME", "x": 1640, - "y": 89186, + "y": 93069, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/V1VhGE.json b/assets/design-export/json/V1VhGE.json index b429d8cf9..05f8411f5 100644 --- a/assets/design-export/json/V1VhGE.json +++ b/assets/design-export/json/V1VhGE.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Mods — Install mod (upload)", "type": "FRAME", "x": 6560, - "y": 31670, + "y": 33801, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/VctzT.json b/assets/design-export/json/VctzT.json index 96d71ab33..d3e70b7b9 100644 --- a/assets/design-export/json/VctzT.json +++ b/assets/design-export/json/VctzT.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Version", "type": "FRAME", "x": 1640, - "y": 39728, + "y": 41859, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/VfB0Y.json b/assets/design-export/json/VfB0Y.json index 737193977..a1262a5f9 100644 --- a/assets/design-export/json/VfB0Y.json +++ b/assets/design-export/json/VfB0Y.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · RBAC & access", "type": "FRAME", "x": 0, - "y": 52308, + "y": 56191, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/W8idqY.json b/assets/design-export/json/W8idqY.json index 86c2c0410..5d7d4d471 100644 --- a/assets/design-export/json/W8idqY.json +++ b/assets/design-export/json/W8idqY.json @@ -4,7 +4,7 @@ "name": "Screen/Create Server — Step 1 Template", "type": "FRAME", "x": 0, - "y": 16012, + "y": 17674, "width": 1440, "height": 980, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/WZdnw.json b/assets/design-export/json/WZdnw.json index 36c9798b0..dcb7a3d17 100644 --- a/assets/design-export/json/WZdnw.json +++ b/assets/design-export/json/WZdnw.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings", "type": "FRAME", "x": 0, - "y": 74590, + "y": 78473, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/Wj0V4.json b/assets/design-export/json/Wj0V4.json index 61e122038..4fbfc0b1e 100644 --- a/assets/design-export/json/Wj0V4.json +++ b/assets/design-export/json/Wj0V4.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Mod registries", "type": "FRAME", "x": 0, - "y": 85089, + "y": 88972, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/WrmU5.json b/assets/design-export/json/WrmU5.json index 83ec817b1..c9d840980 100644 --- a/assets/design-export/json/WrmU5.json +++ b/assets/design-export/json/WrmU5.json @@ -4,7 +4,7 @@ "name": "Screen/Standalone — Clusters (Registered)", "type": "FRAME", "x": 3280, - "y": 64190, + "y": 68073, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/X405l.json b/assets/design-export/json/X405l.json index 6c3687ede..ebfa594dc 100644 --- a/assets/design-export/json/X405l.json +++ b/assets/design-export/json/X405l.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Console (not running – Stopped/Suspended)", "type": "FRAME", "x": 1640, - "y": 27770, + "y": 29901, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/XR0f9.json b/assets/design-export/json/XR0f9.json index 95428c27d..b129c3111 100644 --- a/assets/design-export/json/XR0f9.json +++ b/assets/design-export/json/XR0f9.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Danger zone", "type": "FRAME", "x": 1640, - "y": 54908, + "y": 58791, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/Xn5ns.json b/assets/design-export/json/Xn5ns.json index 715befaa4..dcad21c60 100644 --- a/assets/design-export/json/Xn5ns.json +++ b/assets/design-export/json/Xn5ns.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Console", "type": "FRAME", "x": 0, - "y": 27770, + "y": 29901, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/Y5cmvI.json b/assets/design-export/json/Y5cmvI.json index fd3297285..810bad1c2 100644 --- a/assets/design-export/json/Y5cmvI.json +++ b/assets/design-export/json/Y5cmvI.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Placement", "type": "FRAME", "x": 0, - "y": 51008, + "y": 53139, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/YN8cE.json b/assets/design-export/json/YN8cE.json index fa092b0b5..efc9eba66 100644 --- a/assets/design-export/json/YN8cE.json +++ b/assets/design-export/json/YN8cE.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Game configuration (New password typed)", "type": "FRAME", "x": 8200, - "y": 41028, + "y": 43159, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/YPKbV.json b/assets/design-export/json/YPKbV.json index 2997e667c..1cb6d254b 100644 --- a/assets/design-export/json/YPKbV.json +++ b/assets/design-export/json/YPKbV.json @@ -4,7 +4,7 @@ "name": "Screen/Dashboard — Partial cluster coverage", "type": "FRAME", "x": 3280, - "y": 12822, + "y": 14484, "width": 1440, "height": 1220, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/Z0oyh.json b/assets/design-export/json/Z0oyh.json index e337e8c20..ccb79b69b 100644 --- a/assets/design-export/json/Z0oyh.json +++ b/assets/design-export/json/Z0oyh.json @@ -4,7 +4,7 @@ "name": "Screen/Standalone — Modules (No selection)", "type": "FRAME", "x": 1640, - "y": 56208, + "y": 60091, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/ZU1BG.json b/assets/design-export/json/ZU1BG.json index efef4bfc6..6318f1b60 100644 --- a/assets/design-export/json/ZU1BG.json +++ b/assets/design-export/json/ZU1BG.json @@ -4,7 +4,7 @@ "name": "Create Server — Step 4 Network · Tunnel enabled, provider selected", "type": "FRAME", "x": 6560, - "y": 21275, + "y": 23406, "width": 1440, "height": 1170, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/ZUAq1.json b/assets/design-export/json/ZUAq1.json index 46582abac..0dad3b4d6 100644 --- a/assets/design-export/json/ZUAq1.json +++ b/assets/design-export/json/ZUAq1.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Minecraft JVM heap validation", "type": "FRAME", "x": 11280, - "y": 41028, + "y": 43159, "width": 1440, "height": 980, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/ZlLf0.json b/assets/design-export/json/ZlLf0.json index 4182eff53..fabdb787a 100644 --- a/assets/design-export/json/ZlLf0.json +++ b/assets/design-export/json/ZlLf0.json @@ -4,7 +4,7 @@ "name": "Screen/Standalone — Modules (Permission denied)", "type": "FRAME", "x": 3280, - "y": 56208, + "y": 60091, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/a7o9C.json b/assets/design-export/json/a7o9C.json index 1f120f46d..b97bc59a2 100644 --- a/assets/design-export/json/a7o9C.json +++ b/assets/design-export/json/a7o9C.json @@ -4,7 +4,7 @@ "name": "Create Server — Step 4 Network · Tunnel enabled, no provider", "type": "FRAME", "x": 4920, - "y": 21275, + "y": 23406, "width": 1440, "height": 1170, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/aMU7O.json b/assets/design-export/json/aMU7O.json index 3b0809e12..793402bc0 100644 --- a/assets/design-export/json/aMU7O.json +++ b/assets/design-export/json/aMU7O.json @@ -4,7 +4,7 @@ "name": "Gameplane/Dialog/Edit user — Standalone (No target)", "type": "FRAME", "x": 1640, - "y": 66790, + "y": 70673, "width": 480, "height": 643, "fills": [{"type": "SOLID", "color": "#1C1A20"}], diff --git a/assets/design-export/json/akr4I.json b/assets/design-export/json/akr4I.json index 2603f2277..2e1b263f6 100644 --- a/assets/design-export/json/akr4I.json +++ b/assets/design-export/json/akr4I.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Capture (No access)", "type": "FRAME", "x": 9840, - "y": 37128, + "y": 39259, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/b4eaUf.json b/assets/design-export/json/b4eaUf.json index e85789f5d..255f1d674 100644 --- a/assets/design-export/json/b4eaUf.json +++ b/assets/design-export/json/b4eaUf.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Capture — Start capture (Invalid filter)", "type": "FRAME", "x": 8200, - "y": 37128, + "y": 39259, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/bYDHC.json b/assets/design-export/json/bYDHC.json index 2835e0579..3fe6649b0 100644 --- a/assets/design-export/json/bYDHC.json +++ b/assets/design-export/json/bYDHC.json @@ -4,7 +4,7 @@ "name": "Screen/Users & RBAC", "type": "FRAME", "x": 0, - "y": 66790, + "y": 70673, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/cDiNb.json b/assets/design-export/json/cDiNb.json index c3315b3bd..388bcd7c7 100644 --- a/assets/design-export/json/cDiNb.json +++ b/assets/design-export/json/cDiNb.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Telemetry (bundled)", "type": "FRAME", "x": 4920, - "y": 87754, + "y": 91637, "width": 1440, "height": 777, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/cluster-security-panel.json b/assets/design-export/json/cluster-security-panel.json new file mode 100644 index 000000000..9f4f600b4 --- /dev/null +++ b/assets/design-export/json/cluster-security-panel.json @@ -0,0 +1,235 @@ +{ + "file": "cluster-security-panel", + "name": "Gameplane/Cluster Security Panel", + "type": "COMPONENT", + "x": 1591, + "y": 10411, + "width": 1132, + "height": 209, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "heading", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 1092, + "height": 23, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "layoutAlignSelf": "STRETCH", + "text": "Security", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "description", + "type": "TEXT", + "x": 20, + "y": 55, + "width": 1092, + "height": 20, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "layoutAlignSelf": "STRETCH", + "text": "How game servers on this cluster may run.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "name": "missingSettings", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 640, + "height": 76, + "visible": false, + "component": "Gameplane/Inline Notice/Warning", + "fills": [{"type": "SOLID", "color": "#FEF3C7"}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 16, 12, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "warning/soft"}, + "texts": [ + "Security settings missing", + "This cluster's security settings were not found in namespace gameplane. Run helm upgrade for Gameplane on this cluster, then reload this page." + ] + }, + { + "name": "allowRootRow", + "type": "FRAME", + "x": 20, + "y": 87, + "width": 1092, + "height": 41, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "switchOff", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 36, + "height": 20, + "component": "Gameplane/Switch/Off", + "componentId": "1:1470", + "fills": [{"type": "SOLID", "color": "#EFC3D6"}], + "cornerRadius": 24, + "variables": {"cornerRadius": "radius/3xl", "fills/0/color": "border/border"} + }, + { + "name": "switchOn", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 36, + "height": 20, + "visible": false, + "component": "Gameplane/Switch/On", + "componentId": "1:1532", + "fills": [{"type": "SOLID", "color": "#DB2777"}], + "cornerRadius": 24, + "variables": {"cornerRadius": "radius/3xl", "fills/0/color": "accent/accent"} + }, + { + "name": "allowRootText", + "type": "FRAME", + "x": 48, + "y": 0, + "width": 1044, + "height": 41, + "layout": { + "mode": "VERTICAL", + "gap": 4, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutGrow": 1, + "children": [ + { + "name": "label", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 1044, + "height": 20, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "text": "Allow root overrides", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "help", + "type": "TEXT", + "x": 0, + "y": 24, + "width": 1044, + "height": 17, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "layoutAlignSelf": "STRETCH", + "text": "Lets server owners run a game as root (user or group 0), or with the image's default user. Off by default, set per cluster.", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + } + ] + }, + { + "name": "offNote", + "type": "TEXT", + "x": 20, + "y": 140, + "width": 1092, + "height": 17, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "layoutAlignSelf": "STRETCH", + "text": "Turning this off does not stop running servers on this cluster. Stopped servers that hold a root override will not start until the override is cleared or this is turned back on.", + "font": ["Geist", 400, 12], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "name": "namespaceRow", + "type": "FRAME", + "x": 20, + "y": 169, + "width": 1092, + "height": 20, + "layout": { + "mode": "HORIZONTAL", + "gap": 24, + "padding": [0, 0, 0, 0], + "primary": "SPACE_BETWEEN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "Namespace label", + "type": "TEXT", + "x": 0, + "y": 0, + "width": 1016, + "height": 20, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "layoutGrow": 1, + "text": "Control-plane namespace", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "Namespace value", + "type": "TEXT", + "x": 1016, + "y": 1, + "width": 76, + "height": 18, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "gameplane", + "font": ["JetBrains Mono", 400, 14], + "variables": {"fontFamily": "typography/font-mono", "fills/0/color": "foreground/foreground"} + } + ] + } + ] +} diff --git a/assets/design-export/json/dBILX.json b/assets/design-export/json/dBILX.json index 6dd1b1394..f602a77d3 100644 --- a/assets/design-export/json/dBILX.json +++ b/assets/design-export/json/dBILX.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Capture (Empty)", "type": "FRAME", "x": 1640, - "y": 37128, + "y": 39259, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/dPP50.json b/assets/design-export/json/dPP50.json index 83fe317d9..04cb5ae43 100644 --- a/assets/design-export/json/dPP50.json +++ b/assets/design-export/json/dPP50.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Players", "type": "FRAME", "x": 0, - "y": 34528, + "y": 36659, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/dQV9N.json b/assets/design-export/json/dQV9N.json index 563aaa9e9..eeeda3e82 100644 --- a/assets/design-export/json/dQV9N.json +++ b/assets/design-export/json/dQV9N.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Share links (Empty)", "type": "FRAME", "x": 1640, - "y": 53608, + "y": 57491, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/dhPtX.json b/assets/design-export/json/dhPtX.json index e8910d0bb..809073991 100644 --- a/assets/design-export/json/dhPtX.json +++ b/assets/design-export/json/dhPtX.json @@ -4,7 +4,7 @@ "name": "Server Detail · Settings · Networking · Tunnel initial enable", "type": "FRAME", "x": 3280, - "y": 43788, + "y": 45919, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/dialog-risky-security-value.json b/assets/design-export/json/dialog-risky-security-value.json new file mode 100644 index 000000000..6ea495caf --- /dev/null +++ b/assets/design-export/json/dialog-risky-security-value.json @@ -0,0 +1,228 @@ +{ + "file": "dialog-risky-security-value", + "name": "Gameplane/Dialog/Risky Security Value", + "type": "COMPONENT", + "x": 535, + "y": 10411, + "width": 480, + "height": 271, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 32, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "mTitle", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 270, + "height": 24, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "Keep a risky value for Run-as user?", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "mDescWrap", + "type": "FRAME", + "x": 20, + "y": 44, + "width": 440, + "height": 25, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "mDesc", + "type": "TEXT", + "x": 0, + "y": 4, + "width": 440, + "height": 21, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "layoutGrow": 1, + "text": "The module marks this setting as risky. Its reason:", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "mBody", + "type": "FRAME", + "x": 20, + "y": 69, + "width": 440, + "height": 130, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [16, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "reasonBox", + "type": "FRAME", + "x": 0, + "y": 16, + "width": 440, + "height": 66, + "fills": [{"type": "SOLID", "color": "#F8DDE9"}], + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [12, 12, 12, 12], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "surface/secondary"}, + "children": [ + { + "name": "reason", + "type": "TEXT", + "x": 12, + "y": 12, + "width": 416, + "height": 42, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "layoutGrow": 1, + "layoutAlignSelf": "STRETCH", + "text": "The image must start as root to drop privileges; forcing a user breaks its start.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "name": "consequence", + "type": "TEXT", + "x": 0, + "y": 98, + "width": 440, + "height": 32, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "layoutAlignSelf": "STRETCH", + "text": "With 1000 the server may fail to start. You can clear the override later to go back to the module default.", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "mFooter", + "type": "FRAME", + "x": 20, + "y": 199, + "width": 440, + "height": 52, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [20, 0, 0, 0], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "btnCancel", + "type": "FRAME", + "x": 282, + "y": 20, + "width": 64, + "height": 32, + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 40, + "height": 16, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "Cancel", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "name": "btnPrimary", + "type": "FRAME", + "x": 354, + "y": 20, + "width": 86, + "height": 32, + "opacity": 0.5, + "fills": [{"type": "SOLID", "color": "#DB2777"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "accent/accent"}, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 62, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "text": "Keep value", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/foreground"} + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/dialog-security-file-access.json b/assets/design-export/json/dialog-security-file-access.json new file mode 100644 index 000000000..05e6dedb1 --- /dev/null +++ b/assets/design-export/json/dialog-security-file-access.json @@ -0,0 +1,216 @@ +{ + "file": "dialog-security-file-access", + "name": "Gameplane/Dialog/Security File Access Warning", + "type": "COMPONENT", + "x": 1063, + "y": 10411, + "width": 480, + "height": 286, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "effects": [{"type": "DROP_SHADOW", "radius": 32, "visible": true}], + "cornerRadius": 12, + "layout": { + "mode": "VERTICAL", + "gap": 0, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "mTitle", + "type": "TEXT", + "x": 20, + "y": 20, + "width": 239, + "height": 24, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "Change who the game runs as?", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "mDescWrap", + "type": "FRAME", + "x": 20, + "y": 44, + "width": 440, + "height": 46, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [4, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "mDesc", + "type": "TEXT", + "x": 0, + "y": 4, + "width": 440, + "height": 42, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "layoutGrow": 1, + "text": "mc-survival already has data. After the next restart it runs as user 1000 and group 1000.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 150, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "mBody", + "type": "FRAME", + "x": 20, + "y": 90, + "width": 440, + "height": 124, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [16, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "fileAccessWarning", + "type": "INSTANCE", + "x": 0, + "y": 16, + "width": 440, + "height": 76, + "component": "Gameplane/Inline Notice/Warning", + "fills": [{"type": "SOLID", "color": "#FEF3C7"}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 16, 12, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "warning/soft"}, + "texts": [ + "Existing files may become unreadable", + "Files written before keep their old owner. If the game cannot read or change them, set a filesystem group or clear the override." + ] + }, + { + "name": "noRestart", + "type": "TEXT", + "x": 0, + "y": 108, + "width": 440, + "height": 16, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "layoutAlignSelf": "STRETCH", + "text": "Saving does not restart the server.", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "mFooter", + "type": "FRAME", + "x": 20, + "y": 214, + "width": 440, + "height": 52, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [20, 0, 0, 0], + "primary": "MAX", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "btnCancel", + "type": "FRAME", + "x": 270, + "y": 20, + "width": 64, + "height": 32, + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 40, + "height": 16, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "text": "Cancel", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + } + ] + }, + { + "name": "btnPrimary", + "type": "FRAME", + "x": 342, + "y": 20, + "width": 98, + "height": 32, + "opacity": 0.5, + "fills": [{"type": "SOLID", "color": "#DB2777"}], + "cornerRadius": 6, + "layout": { + "mode": "HORIZONTAL", + "gap": 0, + "padding": [0, 12, 0, 12], + "primary": "CENTER", + "counter": "CENTER", + "sizing": ["HUG", "FIXED"] + }, + "variables": {"fills/0/color": "accent/accent"}, + "children": [ + { + "name": "text", + "type": "TEXT", + "x": 12, + "y": 8, + "width": 74, + "height": 16, + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "text": "Save anyway", + "font": ["Geist", 500, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "accent/foreground"} + } + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/dxdEi.json b/assets/design-export/json/dxdEi.json index bd6341077..28b28c839 100644 --- a/assets/design-export/json/dxdEi.json +++ b/assets/design-export/json/dxdEi.json @@ -4,7 +4,7 @@ "name": "Legacy/Cluster Settings — Default storage — Superseded", "type": "FRAME", "x": 1640, - "y": 65490, + "y": 69373, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/e9FnC.json b/assets/design-export/json/e9FnC.json index aeab3a5d0..9147e6b7a 100644 --- a/assets/design-export/json/e9FnC.json +++ b/assets/design-export/json/e9FnC.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Game configuration (Orphaned key)", "type": "FRAME", "x": 4920, - "y": 41028, + "y": 43159, "width": 1440, "height": 960, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/e9lV4.json b/assets/design-export/json/e9lV4.json index 98e47eeb9..60035f1e5 100644 --- a/assets/design-export/json/e9lV4.json +++ b/assets/design-export/json/e9lV4.json @@ -4,7 +4,7 @@ "name": "Screen/Users & RBAC — Roles", "type": "FRAME", "x": 0, - "y": 68090, + "y": 71973, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/eGbsg.json b/assets/design-export/json/eGbsg.json index 516c14f7c..c99fcec48 100644 --- a/assets/design-export/json/eGbsg.json +++ b/assets/design-export/json/eGbsg.json @@ -4,7 +4,7 @@ "name": "Create Server — Step 4 Network · Tunnel enabled, complete", "type": "FRAME", "x": 8200, - "y": 21275, + "y": 23406, "width": 1440, "height": 1170, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/epZO2.json b/assets/design-export/json/epZO2.json index 32241e4ac..6dd3a5174 100644 --- a/assets/design-export/json/epZO2.json +++ b/assets/design-export/json/epZO2.json @@ -4,7 +4,7 @@ "name": "Screen/Share Link — Invalid or expired", "type": "FRAME", "x": 6560, - "y": 91786, + "y": 95669, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/f1Vga.json b/assets/design-export/json/f1Vga.json index 2266805f8..252aa1d42 100644 --- a/assets/design-export/json/f1Vga.json +++ b/assets/design-export/json/f1Vga.json @@ -4,7 +4,7 @@ "name": "Screen/Create Server — Step 4 Network", "type": "FRAME", "x": 0, - "y": 21275, + "y": 23406, "width": 1440, "height": 1270, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/fK8Bi.json b/assets/design-export/json/fK8Bi.json index f07e6f088..15cd884f6 100644 --- a/assets/design-export/json/fK8Bi.json +++ b/assets/design-export/json/fK8Bi.json @@ -4,7 +4,7 @@ "name": "Screen/Backups — Schedules", "type": "FRAME", "x": 0, - "y": 61340, + "y": 65223, "width": 1440, "height": 1150, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/fbBqA.json b/assets/design-export/json/fbBqA.json index 5485c8cb0..5c0398106 100644 --- a/assets/design-export/json/fbBqA.json +++ b/assets/design-export/json/fbBqA.json @@ -4,7 +4,7 @@ "name": "Screen/Backups — Restores filters open", "type": "FRAME", "x": 3280, - "y": 62890, + "y": 66773, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/g5mEpx.json b/assets/design-export/json/g5mEpx.json index c29f91699..de062e088 100644 --- a/assets/design-export/json/g5mEpx.json +++ b/assets/design-export/json/g5mEpx.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Module sources", "type": "FRAME", "x": 0, - "y": 83789, + "y": 87672, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/gWqMD.json b/assets/design-export/json/gWqMD.json index 090b87639..9d2929145 100644 --- a/assets/design-export/json/gWqMD.json +++ b/assets/design-export/json/gWqMD.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Access (Read-only)", "type": "FRAME", "x": 3280, - "y": 52308, + "y": 56191, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/gX7um.json b/assets/design-export/json/gX7um.json index de2b4dc61..7cf7fdd0a 100644 --- a/assets/design-export/json/gX7um.json +++ b/assets/design-export/json/gX7um.json @@ -4,7 +4,7 @@ "name": "Screen/Login (Light)", "type": "FRAME", "x": 1640, - "y": 10222, + "y": 11884, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#FFFFFF"}], diff --git a/assets/design-export/json/hLB9Z.json b/assets/design-export/json/hLB9Z.json index 5ea8a6cdb..0770da2bb 100644 --- a/assets/design-export/json/hLB9Z.json +++ b/assets/design-export/json/hLB9Z.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings", "type": "FRAME", "x": 0, - "y": 38428, + "y": 40559, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/hlwx3.json b/assets/design-export/json/hlwx3.json index b4a993654..0b3a4dc9c 100644 --- a/assets/design-export/json/hlwx3.json +++ b/assets/design-export/json/hlwx3.json @@ -4,7 +4,7 @@ "name": "State/Server Actions Menu — Owner-only disabled", "type": "FRAME", "x": 9840, - "y": 24345, + "y": 26476, "width": 520, "height": 220, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/hmPL7.json b/assets/design-export/json/hmPL7.json index 55d70252c..12808bc7e 100644 --- a/assets/design-export/json/hmPL7.json +++ b/assets/design-export/json/hmPL7.json @@ -4,7 +4,7 @@ "name": "Screen/Dialog/Build Module — Step 3 (Review & Export)", "type": "FRAME", "x": 2000, - "y": 58658, + "y": 62541, "width": 840, "height": 593, "fills": [{"type": "SOLID", "color": "#1C1A20"}], diff --git a/assets/design-export/json/i1bLR.json b/assets/design-export/json/i1bLR.json index 840901af1..4dbb6d18c 100644 --- a/assets/design-export/json/i1bLR.json +++ b/assets/design-export/json/i1bLR.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Lifecycle", "type": "FRAME", "x": 0, - "y": 46388, + "y": 48519, "width": 1440, "height": 1620, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/i4L0M.json b/assets/design-export/json/i4L0M.json index eef2bb6bf..666fcd536 100644 --- a/assets/design-export/json/i4L0M.json +++ b/assets/design-export/json/i4L0M.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Mod registries (Key saved)", "type": "FRAME", "x": 1640, - "y": 85089, + "y": 88972, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/i8wib.json b/assets/design-export/json/i8wib.json index d6ddb8b1c..5f1b08e6a 100644 --- a/assets/design-export/json/i8wib.json +++ b/assets/design-export/json/i8wib.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Danger zone", "type": "FRAME", "x": 0, - "y": 54908, + "y": 58791, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/iLm38.json b/assets/design-export/json/iLm38.json index 131ff7eec..a85f953ab 100644 --- a/assets/design-export/json/iLm38.json +++ b/assets/design-export/json/iLm38.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Environment", "type": "FRAME", "x": 1640, - "y": 45088, + "y": 47219, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/iSA6R.json b/assets/design-export/json/iSA6R.json index f0bc631b4..4729fb948 100644 --- a/assets/design-export/json/iSA6R.json +++ b/assets/design-export/json/iSA6R.json @@ -4,7 +4,7 @@ "name": "Screen/Mobile — Server Detail — Settings · Placement", "type": "FRAME", "x": 1640, - "y": 51008, + "y": 53139, "width": 375, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/iYUWc.json b/assets/design-export/json/iYUWc.json index 7074d92f1..828bbe850 100644 --- a/assets/design-export/json/iYUWc.json +++ b/assets/design-export/json/iYUWc.json @@ -4,7 +4,7 @@ "name": "Screen/Clusters — Registered clusters", "type": "FRAME", "x": 0, - "y": 64190, + "y": 68073, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/j24cXg.json b/assets/design-export/json/j24cXg.json index c03d33fdb..c1759fab6 100644 --- a/assets/design-export/json/j24cXg.json +++ b/assets/design-export/json/j24cXg.json @@ -4,7 +4,7 @@ "name": "Screen/Dashboard Home", "type": "FRAME", "x": 0, - "y": 12822, + "y": 14484, "width": 1440, "height": 1150, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/j88bl0.json b/assets/design-export/json/j88bl0.json index c44980653..f0e68f487 100644 --- a/assets/design-export/json/j88bl0.json +++ b/assets/design-export/json/j88bl0.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Console (not running – Pod failure)", "type": "FRAME", "x": 3280, - "y": 27770, + "y": 29901, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/j9W8A.json b/assets/design-export/json/j9W8A.json index d056b9eef..683cee90b 100644 --- a/assets/design-export/json/j9W8A.json +++ b/assets/design-export/json/j9W8A.json @@ -4,7 +4,7 @@ "name": "Legacy/Cluster Settings — Superseded", "type": "FRAME", "x": 0, - "y": 65490, + "y": 69373, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/jXykV.json b/assets/design-export/json/jXykV.json index a9a917f88..3afa5fa58 100644 --- a/assets/design-export/json/jXykV.json +++ b/assets/design-export/json/jXykV.json @@ -4,7 +4,7 @@ "name": "J5pjJ3 states/Alerts", "type": "FRAME", "x": 10540, - "y": 43788, + "y": 45919, "width": 700, "height": 246, "fills": [{"type": "SOLID", "color": "#1C1A20"}], diff --git a/assets/design-export/json/jmoi3.json b/assets/design-export/json/jmoi3.json index e6a35e259..83da3d30f 100644 --- a/assets/design-export/json/jmoi3.json +++ b/assets/design-export/json/jmoi3.json @@ -4,7 +4,7 @@ "name": "Screen/Login — Invalid credentials", "type": "FRAME", "x": 3280, - "y": 10222, + "y": 11884, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/kK8Ji.json b/assets/design-export/json/kK8Ji.json index dd4dce127..2833e0540 100644 --- a/assets/design-export/json/kK8Ji.json +++ b/assets/design-export/json/kK8Ji.json @@ -4,7 +4,7 @@ "name": "Screen/Modules Catalog", "type": "FRAME", "x": 0, - "y": 56208, + "y": 60091, "width": 1440, "height": 1320, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/kPmoo.json b/assets/design-export/json/kPmoo.json index c4d99fb69..377a0cb76 100644 --- a/assets/design-export/json/kPmoo.json +++ b/assets/design-export/json/kPmoo.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Logs", "type": "FRAME", "x": 0, - "y": 29070, + "y": 31201, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/l64bd.json b/assets/design-export/json/l64bd.json index 8948400ba..6b8a9e7ce 100644 --- a/assets/design-export/json/l64bd.json +++ b/assets/design-export/json/l64bd.json @@ -4,7 +4,7 @@ "name": "Screen/Standalone — Settings · Module sources", "type": "FRAME", "x": 1640, - "y": 83789, + "y": 87672, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/l7TRz9.json b/assets/design-export/json/l7TRz9.json index 585eced24..7b82135ab 100644 --- a/assets/design-export/json/l7TRz9.json +++ b/assets/design-export/json/l7TRz9.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Telemetry (default)", "type": "FRAME", "x": 1640, - "y": 87754, + "y": 91637, "width": 1440, "height": 1031, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/lCTci.json b/assets/design-export/json/lCTci.json index b42e326eb..e5b831140 100644 --- a/assets/design-export/json/lCTci.json +++ b/assets/design-export/json/lCTci.json @@ -4,7 +4,7 @@ "name": "Screen/Mobile — Theme Settings · Language", "type": "FRAME", "x": 3280, - "y": 75890, + "y": 79773, "width": 390, "height": 972, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/lWvcv.json b/assets/design-export/json/lWvcv.json index b45fbcdbd..8d3da5ca5 100644 --- a/assets/design-export/json/lWvcv.json +++ b/assets/design-export/json/lWvcv.json @@ -4,7 +4,7 @@ "name": "Screen/Theme Settings", "type": "FRAME", "x": 0, - "y": 75890, + "y": 79773, "width": 1440, "height": 2344, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/lhKzN.json b/assets/design-export/json/lhKzN.json index e4f8d8dcc..46049bc40 100644 --- a/assets/design-export/json/lhKzN.json +++ b/assets/design-export/json/lhKzN.json @@ -4,7 +4,7 @@ "name": "Create Server — Step 4 Network · Tunnel disabled", "type": "FRAME", "x": 3280, - "y": 21275, + "y": 23406, "width": 1440, "height": 1170, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/ljdA5.json b/assets/design-export/json/ljdA5.json index 329ea479b..75ea87718 100644 --- a/assets/design-export/json/ljdA5.json +++ b/assets/design-export/json/ljdA5.json @@ -4,7 +4,7 @@ "name": "Screen/Login — SSO only", "type": "FRAME", "x": 4920, - "y": 10222, + "y": 11884, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/m5kOm4.json b/assets/design-export/json/m5kOm4.json index ccc50abf6..b6263286c 100644 --- a/assets/design-export/json/m5kOm4.json +++ b/assets/design-export/json/m5kOm4.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Capture (List)", "type": "FRAME", "x": 4920, - "y": 37128, + "y": 39259, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/mrF6f.json b/assets/design-export/json/mrF6f.json index cff62f1ae..7e570c7dc 100644 --- a/assets/design-export/json/mrF6f.json +++ b/assets/design-export/json/mrF6f.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Authentication (Role rules empty, not overridden)", "type": "FRAME", "x": 8200, - "y": 78780, + "y": 82663, "width": 888, "height": 649, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/n2qdi.json b/assets/design-export/json/n2qdi.json index 255f12533..c56c46be1 100644 --- a/assets/design-export/json/n2qdi.json +++ b/assets/design-export/json/n2qdi.json @@ -4,7 +4,7 @@ "name": "Screen/Standalone — Clusters (Empty)", "type": "FRAME", "x": 1640, - "y": 64190, + "y": 68073, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/n6Xlo.json b/assets/design-export/json/n6Xlo.json index 723d19543..020cabc54 100644 --- a/assets/design-export/json/n6Xlo.json +++ b/assets/design-export/json/n6Xlo.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Notifications", "type": "FRAME", "x": 0, - "y": 86389, + "y": 90272, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/nGJE1.json b/assets/design-export/json/nGJE1.json index 88bcb1a2f..ba1ae4688 100644 --- a/assets/design-export/json/nGJE1.json +++ b/assets/design-export/json/nGJE1.json @@ -4,7 +4,7 @@ "name": "Server Detail · Settings · Networking · Tunnel disabled", "type": "FRAME", "x": 1640, - "y": 43788, + "y": 45919, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/nNGDX.json b/assets/design-export/json/nNGDX.json index e6a03ff69..b8777faae 100644 --- a/assets/design-export/json/nNGDX.json +++ b/assets/design-export/json/nNGDX.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Authentication (No OIDC mappings)", "type": "FRAME", "x": 1640, - "y": 78780, + "y": 82663, "width": 1440, "height": 1463, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/nNL3E.json b/assets/design-export/json/nNL3E.json index cf7ae564f..33e438bc0 100644 --- a/assets/design-export/json/nNL3E.json +++ b/assets/design-export/json/nNL3E.json @@ -4,7 +4,7 @@ "name": "Screen/Create Server — Step 2 Version", "type": "FRAME", "x": 0, - "y": 17392, + "y": 19054, "width": 1440, "height": 1000, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/nfMMj.json b/assets/design-export/json/nfMMj.json index 449573fc7..e37e42c0a 100644 --- a/assets/design-export/json/nfMMj.json +++ b/assets/design-export/json/nfMMj.json @@ -4,7 +4,7 @@ "name": "Screen/Backups — Restores (Empty)", "type": "FRAME", "x": 1640, - "y": 62890, + "y": 66773, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/o4LH8W.json b/assets/design-export/json/o4LH8W.json index 7095aed68..b66969a92 100644 --- a/assets/design-export/json/o4LH8W.json +++ b/assets/design-export/json/o4LH8W.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Overview (PVC Provisioning Failed)", "type": "FRAME", "x": 8200, - "y": 24345, + "y": 26476, "width": 1440, "height": 1320, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/oMuyw.json b/assets/design-export/json/oMuyw.json index cfdc8b81a..9937fe298 100644 --- a/assets/design-export/json/oMuyw.json +++ b/assets/design-export/json/oMuyw.json @@ -4,7 +4,7 @@ "name": "Gameplane/Dialog/New File (Invalid name)", "type": "FRAME", "x": 1640, - "y": 30370, + "y": 32501, "width": 440, "height": 310, "fills": [{"type": "SOLID", "color": "#FFF7FB"}], diff --git a/assets/design-export/json/oPF1n.json b/assets/design-export/json/oPF1n.json index fc60ed74a..0aa04caa6 100644 --- a/assets/design-export/json/oPF1n.json +++ b/assets/design-export/json/oPF1n.json @@ -4,7 +4,7 @@ "name": "Screen/Share links — Create link (Custom date)", "type": "FRAME", "x": 3960, - "y": 53608, + "y": 57491, "width": 480, "height": 382, "fills": [{"type": "SOLID", "color": "#FFF7FB"}], diff --git a/assets/design-export/json/oyoTs.json b/assets/design-export/json/oyoTs.json index 8b0edd2f0..f2c0d035c 100644 --- a/assets/design-export/json/oyoTs.json +++ b/assets/design-export/json/oyoTs.json @@ -4,7 +4,7 @@ "name": "Screen/Dashboard Home (Light)", "type": "FRAME", "x": 1640, - "y": 12822, + "y": 14484, "width": 1440, "height": 1150, "fills": [{"type": "SOLID", "color": "#FFFFFF"}], diff --git a/assets/design-export/json/p8QSPq.json b/assets/design-export/json/p8QSPq.json index 2c5cfb660..223ec553a 100644 --- a/assets/design-export/json/p8QSPq.json +++ b/assets/design-export/json/p8QSPq.json @@ -4,7 +4,7 @@ "name": "Screen/Standalone — Modules (Manage sources)", "type": "FRAME", "x": 6560, - "y": 56208, + "y": 60091, "width": 1440, "height": 2050, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/pnAbF.json b/assets/design-export/json/pnAbF.json index 6bfba81d4..153ca9f1c 100644 --- a/assets/design-export/json/pnAbF.json +++ b/assets/design-export/json/pnAbF.json @@ -4,7 +4,7 @@ "name": "Screen/Backups — Filters open", "type": "FRAME", "x": 3280, - "y": 60040, + "y": 63923, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/pssCT.json b/assets/design-export/json/pssCT.json index c7dc44f12..57ee140e6 100644 --- a/assets/design-export/json/pssCT.json +++ b/assets/design-export/json/pssCT.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Backups", "type": "FRAME", "x": 0, - "y": 35828, + "y": 37959, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/pszxE.json b/assets/design-export/json/pszxE.json index 7d59b8922..59e4f29a4 100644 --- a/assets/design-export/json/pszxE.json +++ b/assets/design-export/json/pszxE.json @@ -4,7 +4,7 @@ "name": "Users & RBAC — Return to SSO control dialogs", "type": "FRAME", "x": 4640, - "y": 66790, + "y": 70673, "width": 1040, "height": 721, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/q31B6w.json b/assets/design-export/json/q31B6w.json index 96812ee3a..02eaaba10 100644 --- a/assets/design-export/json/q31B6w.json +++ b/assets/design-export/json/q31B6w.json @@ -4,7 +4,7 @@ "name": "Screen/Share Link — Asleep (can start)", "type": "FRAME", "x": 1640, - "y": 91786, + "y": 95669, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/qFLfB.json b/assets/design-export/json/qFLfB.json index 262d87324..fe31ff523 100644 --- a/assets/design-export/json/qFLfB.json +++ b/assets/design-export/json/qFLfB.json @@ -4,7 +4,7 @@ "name": "Historical/Share Link — Asleep (view only)", "type": "FRAME", "x": 11480, - "y": 91786, + "y": 95669, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/r0heh.json b/assets/design-export/json/r0heh.json index 826abe3f3..c2cd8a1a0 100644 --- a/assets/design-export/json/r0heh.json +++ b/assets/design-export/json/r0heh.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Telemetry (custom)", "type": "FRAME", "x": 3280, - "y": 87754, + "y": 91637, "width": 1440, "height": 1032, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/r139UP.json b/assets/design-export/json/r139UP.json index 88018fc50..6077472bc 100644 --- a/assets/design-export/json/r139UP.json +++ b/assets/design-export/json/r139UP.json @@ -4,7 +4,7 @@ "name": "Screen/Standalone — System logs", "type": "FRAME", "x": 1640, - "y": 73290, + "y": 77173, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/rJt1I.json b/assets/design-export/json/rJt1I.json index b6dbc4f74..c8e0276a7 100644 --- a/assets/design-export/json/rJt1I.json +++ b/assets/design-export/json/rJt1I.json @@ -4,7 +4,7 @@ "name": "Screen/Users & RBAC — Role source", "type": "FRAME", "x": 3000, - "y": 66790, + "y": 70673, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/sSISK.json b/assets/design-export/json/sSISK.json index 304de0f7e..511e9b7c7 100644 --- a/assets/design-export/json/sSISK.json +++ b/assets/design-export/json/sSISK.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Overview (Light)", "type": "FRAME", "x": 1640, - "y": 24345, + "y": 26476, "width": 1440, "height": 1300, "fills": [{"type": "SOLID", "color": "#FFFFFF"}], diff --git a/assets/design-export/json/sZtDi.json b/assets/design-export/json/sZtDi.json index 63fc90743..c2828c26c 100644 --- a/assets/design-export/json/sZtDi.json +++ b/assets/design-export/json/sZtDi.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Mods", "type": "FRAME", "x": 0, - "y": 31670, + "y": 33801, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/security-advanced-mobile.json b/assets/design-export/json/security-advanced-mobile.json new file mode 100644 index 000000000..302323070 --- /dev/null +++ b/assets/design-export/json/security-advanced-mobile.json @@ -0,0 +1,360 @@ +{ + "file": "security-advanced-mobile", + "name": "Gameplane/Security Advanced/Mobile", + "type": "COMPONENT", + "x": 160, + "y": 10411, + "width": 327, + "height": 891, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "header", + "type": "FRAME", + "x": 20, + "y": 20, + "width": 287, + "height": 23, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "chevron", + "type": "INSTANCE", + "x": 0, + "y": 3.5, + "width": 16, + "height": 16, + "component": "lucide/chevron-down/16x16" + }, + { + "name": "title", + "type": "TEXT", + "x": 24, + "y": 0, + "width": 143, + "height": 23, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "layoutAlignSelf": "STRETCH", + "text": "Advanced security", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "overrideCount", + "type": "INSTANCE", + "x": 175, + "y": 3, + "width": 60, + "height": 17, + "component": "Chip/Soft/Accent/SM", + "componentId": "1:1397", + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 2, + "padding": [2, 4, 2, 4], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"cornerRadius": "radius/2xl", "fills/0/color": "accent/soft"}, + "texts": ["1 override"] + }, + { + "name": "readOnlyChip", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 63, + "height": 17, + "visible": false, + "component": "Chip/Soft/Default/SM", + "componentId": "1:1002", + "fills": [{"type": "SOLID", "color": "#F6DCE7"}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 2, + "padding": [2, 4, 2, 4], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"cornerRadius": "radius/2xl", "fills/0/color": "default/default"}, + "texts": ["Read-only"] + } + ] + }, + { + "name": "desc", + "type": "TEXT", + "x": 20, + "y": 59, + "width": 287, + "height": 80, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "layoutAlignSelf": "STRETCH", + "text": "Who the game runs as, and how the data volume's group is fixed. Leave a setting on Module default unless the game needs something else.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "name": "notices", + "type": "FRAME", + "x": 20, + "y": 155, + "width": 287, + "height": 100, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "heldBack", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 640, + "height": 76, + "visible": false, + "component": "Gameplane/Inline Notice/Warning", + "fills": [{"type": "SOLID", "color": "#FEF3C7"}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 16, 12, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "warning/soft"}, + "texts": [ + "Held back: root override not allowed", + "This server will not start. Run-as user is 0 (root), and root overrides are off on cluster remote-lab. Clear the override, or ask an administrator to allow root overrides in that cluster's Configuration." + ] + }, + { + "name": "restartNotice", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 640, + "height": 60, + "visible": false, + "component": "Gameplane/Inline Notice/Accent", + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 16, 12, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "accent/soft"}, + "texts": [ + "Applies on the next restart", + "Saving never restarts the server. Pending values take effect the next time it starts." + ] + }, + { + "name": "refusal", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 640, + "height": 60, + "visible": false, + "component": "Gameplane/Inline Notice/Danger", + "fills": [{"type": "SOLID", "color": "#FEE2E2"}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 16, 12, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "danger/soft"}, + "texts": ["Not saved", "You need the servers:security permission to change these settings."] + }, + { + "name": "readOnlyNote", + "type": "TEXT", + "x": 0, + "y": 22, + "width": 200, + "height": 48, + "visible": false, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "layoutAlignSelf": "STRETCH", + "text": "You can see these settings. Changing them needs the servers:security permission.", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "rows", + "type": "FRAME", + "x": 20, + "y": 271, + "width": 287, + "height": 600, + "layout": { + "mode": "VERTICAL", + "gap": 20, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "rowRunAsUser", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 287, + "height": 131, + "component": "Gameplane/Security Setting Row/Stacked", + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": [ + "Run-as user", + "User ID the game process runs as.", + "Module default: 1000", + "Module default", + "Applied: 1000", + "Module default" + ] + }, + { + "name": "rowRunAsGroup", + "type": "INSTANCE", + "x": 0, + "y": 151, + "width": 287, + "height": 131, + "component": "Gameplane/Security Setting Row/Stacked", + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": [ + "Run-as group", + "Group ID the game process runs as.", + "Module default: 1000", + "Module default", + "Applied: 1000", + "Module default" + ] + }, + { + "name": "rowFsGroup", + "type": "INSTANCE", + "x": 0, + "y": 302, + "width": 287, + "height": 147, + "component": "Gameplane/Security Setting Row/Stacked", + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": [ + "Filesystem group", + "Group that owns the data volume, so the game can write to it.", + "Module default: 1000", + "Module default", + "Applied: 1000", + "Module default" + ] + }, + { + "name": "rowOwnership", + "type": "INSTANCE", + "x": 0, + "y": 469, + "width": 287, + "height": 131, + "component": "Gameplane/Security Setting Row/Stacked", + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "texts": [ + "Volume ownership check", + "When the data volume's group is fixed on start.", + "Module default: Only when wrong (built-in)", + "Module default", + "Applied: Only when wrong", + "Built-in default" + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/security-advanced.json b/assets/design-export/json/security-advanced.json new file mode 100644 index 000000000..747419251 --- /dev/null +++ b/assets/design-export/json/security-advanced.json @@ -0,0 +1,360 @@ +{ + "file": "security-advanced", + "name": "Gameplane/Security Advanced", + "type": "COMPONENT", + "x": 3507, + "y": 9712, + "width": 860, + "height": 651, + "fills": [{"type": "SOLID", "color": "#FFF7FB"}], + "strokes": [{"type": "SOLID", "color": "#EFC3D6"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "children": [ + { + "name": "header", + "type": "FRAME", + "x": 20, + "y": 20, + "width": 820, + "height": 23, + "layout": { + "mode": "HORIZONTAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "chevron", + "type": "INSTANCE", + "x": 0, + "y": 3.5, + "width": 16, + "height": 16, + "component": "lucide/chevron-down/16x16" + }, + { + "name": "title", + "type": "TEXT", + "x": 24, + "y": 0, + "width": 143, + "height": 23, + "fills": [{"type": "SOLID", "color": "#2A0F1E"}], + "layoutAlignSelf": "STRETCH", + "text": "Advanced security", + "font": ["Geist", 600, 16], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "foreground/foreground"} + }, + { + "name": "overrideCount", + "type": "INSTANCE", + "x": 175, + "y": 3, + "width": 60, + "height": 17, + "component": "Chip/Soft/Accent/SM", + "componentId": "1:1397", + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 2, + "padding": [2, 4, 2, 4], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"cornerRadius": "radius/2xl", "fills/0/color": "accent/soft"}, + "texts": ["1 override"] + }, + { + "name": "readOnlyChip", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 63, + "height": 17, + "visible": false, + "component": "Chip/Soft/Default/SM", + "componentId": "1:1002", + "fills": [{"type": "SOLID", "color": "#F6DCE7"}], + "cornerRadius": 16, + "layout": { + "mode": "HORIZONTAL", + "gap": 2, + "padding": [2, 4, 2, 4], + "primary": "MIN", + "counter": "CENTER", + "sizing": ["HUG", "HUG"] + }, + "variables": {"cornerRadius": "radius/2xl", "fills/0/color": "default/default"}, + "texts": ["Read-only"] + } + ] + }, + { + "name": "desc", + "type": "TEXT", + "x": 20, + "y": 59, + "width": 820, + "height": 40, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "layoutAlignSelf": "STRETCH", + "text": "Who the game runs as, and how the data volume's group is fixed. Leave a setting on Module default unless the game needs something else.", + "font": ["Geist", 400, 14], + "lineHeight": {"value": 145.00000476837158, "unit": "PERCENT"}, + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + }, + { + "name": "notices", + "type": "FRAME", + "x": 20, + "y": 115, + "width": 820, + "height": 100, + "layout": { + "mode": "VERTICAL", + "gap": 8, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "heldBack", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 640, + "height": 76, + "visible": false, + "component": "Gameplane/Inline Notice/Warning", + "fills": [{"type": "SOLID", "color": "#FEF3C7"}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 16, 12, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "warning/soft"}, + "texts": [ + "Held back: root override not allowed", + "This server will not start. Run-as user is 0 (root), and root overrides are off on cluster remote-lab. Clear the override, or ask an administrator to allow root overrides in that cluster's Configuration." + ] + }, + { + "name": "restartNotice", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 640, + "height": 60, + "visible": false, + "component": "Gameplane/Inline Notice/Accent", + "fills": [{"type": "SOLID", "color": "#FFFFFF"}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 16, 12, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "accent/soft"}, + "texts": [ + "Applies on the next restart", + "Saving never restarts the server. Pending values take effect the next time it starts." + ] + }, + { + "name": "refusal", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 640, + "height": 60, + "visible": false, + "component": "Gameplane/Inline Notice/Danger", + "fills": [{"type": "SOLID", "color": "#FEE2E2"}], + "cornerRadius": 12, + "layout": { + "mode": "HORIZONTAL", + "gap": 12, + "padding": [12, 16, 12, 16], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "variables": {"fills/0/color": "danger/soft"}, + "texts": ["Not saved", "You need the servers:security permission to change these settings."] + }, + { + "name": "readOnlyNote", + "type": "TEXT", + "x": 0, + "y": 22, + "width": 200, + "height": 48, + "visible": false, + "fills": [{"type": "SOLID", "color": "#6E5262"}], + "layoutAlignSelf": "STRETCH", + "text": "You can see these settings. Changing them needs the servers:security permission.", + "font": ["Geist", 400, 12], + "variables": {"fontFamily": "typography/font-sans", "fills/0/color": "muted"} + } + ] + }, + { + "name": "rows", + "type": "FRAME", + "x": 20, + "y": 231, + "width": 820, + "height": 400, + "layout": { + "mode": "VERTICAL", + "gap": 20, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "children": [ + { + "name": "rowRunAsUser", + "type": "INSTANCE", + "x": 0, + "y": 0, + "width": 820, + "height": 85, + "component": "Gameplane/Security Setting Row", + "layout": { + "mode": "HORIZONTAL", + "gap": 16, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "texts": [ + "Run-as user", + "User ID the game process runs as.", + "Module default: 1000", + "Module default", + "Applied: 1000", + "Module default" + ] + }, + { + "name": "rowRunAsGroup", + "type": "INSTANCE", + "x": 0, + "y": 105, + "width": 820, + "height": 85, + "component": "Gameplane/Security Setting Row", + "layout": { + "mode": "HORIZONTAL", + "gap": 16, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "texts": [ + "Run-as group", + "Group ID the game process runs as.", + "Module default: 1000", + "Module default", + "Applied: 1000", + "Module default" + ] + }, + { + "name": "rowFsGroup", + "type": "INSTANCE", + "x": 0, + "y": 210, + "width": 820, + "height": 85, + "component": "Gameplane/Security Setting Row", + "layout": { + "mode": "HORIZONTAL", + "gap": 16, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "texts": [ + "Filesystem group", + "Group that owns the data volume, so the game can write to it.", + "Module default: 1000", + "Module default", + "Applied: 1000", + "Module default" + ] + }, + { + "name": "rowOwnership", + "type": "INSTANCE", + "x": 0, + "y": 315, + "width": 820, + "height": 85, + "component": "Gameplane/Security Setting Row", + "layout": { + "mode": "HORIZONTAL", + "gap": 16, + "padding": [0, 0, 0, 0], + "primary": "MIN", + "counter": "MIN", + "sizing": ["FIXED", "HUG"] + }, + "layoutAlignSelf": "STRETCH", + "texts": [ + "Volume ownership check", + "When the data volume's group is fixed on start.", + "Module default: Only when wrong (built-in)", + "Module default", + "Applied: Only when wrong", + "Built-in default" + ] + } + ] + } + ] +} diff --git a/assets/design-export/json/swxkJ.json b/assets/design-export/json/swxkJ.json index b3f233fa5..2efa4e932 100644 --- a/assets/design-export/json/swxkJ.json +++ b/assets/design-export/json/swxkJ.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Version", "type": "FRAME", "x": 0, - "y": 39728, + "y": 41859, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/t56aLu.json b/assets/design-export/json/t56aLu.json index 8a69cc4cd..ea672506c 100644 --- a/assets/design-export/json/t56aLu.json +++ b/assets/design-export/json/t56aLu.json @@ -4,9 +4,9 @@ "name": "Screen/Cluster Details — Configuration — Remote", "type": "FRAME", "x": 18040, - "y": 64190, + "y": 68073, "width": 1440, - "height": 1060, + "height": 1293, "fills": [{"type": "SOLID", "color": "#121114"}], "layout": { "mode": "HORIZONTAL", @@ -26,7 +26,7 @@ "x": 0, "y": 0, "width": 260, - "height": 1060, + "height": 1293, "component": "Gameplane/App Sidebar", "componentId": "1:234", "fills": [{"type": "SOLID", "color": "#17151A"}], @@ -69,7 +69,7 @@ "x": 260, "y": 0, "width": 1180, - "height": 1060, + "height": 1293, "layout": { "mode": "VERTICAL", "gap": 0, @@ -113,7 +113,7 @@ "x": 0, "y": 64, "width": 1180, - "height": 996, + "height": 1229, "layout": { "mode": "VERTICAL", "gap": 24, @@ -460,12 +460,48 @@ } ] }, + { + "name": "Security", + "type": "INSTANCE", + "x": 24, + "y": 606, + "width": 1132, + "height": 209, + "component": "Gameplane/Cluster Security Panel", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 12, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "Security", + "How game servers on this cluster may run.", + "Allow root overrides", + "Lets server owners run a game as root (user or group 0), or with the image's default user. Off by default, set per cluster.", + "Turning this off does not stop running servers on this cluster. Stopped servers that hold a root override will not start until the override is cleared or this is turned back on.", + "Control-plane namespace", + "gameplane-system" + ] + }, { "id": "1:11056", "name": "Remove cluster", "type": "FRAME", "x": 24, - "y": 606, + "y": 839, "width": 1132, "height": 143, "fills": [{"type": "SOLID", "color": "#1C1A20"}], diff --git a/assets/design-export/json/tSOeI.json b/assets/design-export/json/tSOeI.json index 9e2e365de..3a99d49c9 100644 --- a/assets/design-export/json/tSOeI.json +++ b/assets/design-export/json/tSOeI.json @@ -4,7 +4,7 @@ "name": "Server Detail · Settings · Networking · Provider selected", "type": "FRAME", "x": 4920, - "y": 43788, + "y": 45919, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/tTSdi.json b/assets/design-export/json/tTSdi.json index e31f7f508..01489cb44 100644 --- a/assets/design-export/json/tTSdi.json +++ b/assets/design-export/json/tTSdi.json @@ -4,7 +4,7 @@ "name": "Screen/Backups — Restores", "type": "FRAME", "x": 0, - "y": 62890, + "y": 66773, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/tY6RD.json b/assets/design-export/json/tY6RD.json index 64a50625b..b392fd849 100644 --- a/assets/design-export/json/tY6RD.json +++ b/assets/design-export/json/tY6RD.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Modpacks", "type": "FRAME", "x": 0, - "y": 32970, + "y": 35101, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/tooKB.json b/assets/design-export/json/tooKB.json index b0738ae7a..32c407d29 100644 --- a/assets/design-export/json/tooKB.json +++ b/assets/design-export/json/tooKB.json @@ -4,7 +4,7 @@ "name": "Screen/Mobile — Servers", "type": "FRAME", "x": 4920, - "y": 14602, + "y": 16264, "width": 390, "height": 954, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/tr6cE.json b/assets/design-export/json/tr6cE.json index b3d820c28..2cabfcc86 100644 --- a/assets/design-export/json/tr6cE.json +++ b/assets/design-export/json/tr6cE.json @@ -4,7 +4,7 @@ "name": "Screen/Share links — Create link (No expiry)", "type": "FRAME", "x": 3280, - "y": 53608, + "y": 57491, "width": 480, "height": 322, "fills": [{"type": "SOLID", "color": "#FFF7FB"}], diff --git a/assets/design-export/json/uCA23.json b/assets/design-export/json/uCA23.json index 827893358..1722a939a 100644 --- a/assets/design-export/json/uCA23.json +++ b/assets/design-export/json/uCA23.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · General", "type": "FRAME", "x": 1640, - "y": 38428, + "y": 40559, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/uMiwd.json b/assets/design-export/json/uMiwd.json index 0cf50ae76..6f8d3c508 100644 --- a/assets/design-export/json/uMiwd.json +++ b/assets/design-export/json/uMiwd.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Authentication", "type": "FRAME", "x": 0, - "y": 78780, + "y": 82663, "width": 1440, "height": 1636, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/ugDSa.json b/assets/design-export/json/ugDSa.json index 8ef261ddb..5eae9b05c 100644 --- a/assets/design-export/json/ugDSa.json +++ b/assets/design-export/json/ugDSa.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Environment", "type": "FRAME", "x": 0, - "y": 45088, + "y": 47219, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/uoxQW.json b/assets/design-export/json/uoxQW.json index e396044c2..46ab5ffe6 100644 --- a/assets/design-export/json/uoxQW.json +++ b/assets/design-export/json/uoxQW.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Telemetry", "type": "FRAME", "x": 0, - "y": 87754, + "y": 91637, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/vUqMl.json b/assets/design-export/json/vUqMl.json index 1e3d9c127..035b8832a 100644 --- a/assets/design-export/json/vUqMl.json +++ b/assets/design-export/json/vUqMl.json @@ -4,9 +4,9 @@ "name": "Screen/Create Server — Step 3 Configure", "type": "FRAME", "x": 0, - "y": 18792, + "y": 20454, "width": 1440, - "height": 1989, + "height": 2120, "fills": [{"type": "SOLID", "color": "#121114"}], "layout": { "mode": "HORIZONTAL", @@ -26,7 +26,7 @@ "x": 0, "y": 0, "width": 260, - "height": 1989, + "height": 2120, "component": "Gameplane/App Sidebar", "componentId": "1:234", "fills": [{"type": "SOLID", "color": "#17151A"}], @@ -69,7 +69,7 @@ "x": 260, "y": 0, "width": 1180, - "height": 1989, + "height": 2120, "fills": [{"type": "SOLID", "color": "#121114"}], "layout": { "mode": "VERTICAL", @@ -117,7 +117,7 @@ "x": 0, "y": 0, "width": 1440, - "height": 1989, + "height": 2120, "fills": [{"type": "SOLID", "color": "#000000B3", "opacity": 0.7}], "layout": { "mode": "VERTICAL", @@ -136,7 +136,7 @@ "x": 240, "y": 77, "width": 960, - "height": 1835, + "height": 1966, "fills": [{"type": "SOLID", "color": "#1C1A20"}], "strokes": [{"type": "SOLID", "color": "#2C2932"}], "strokeWeight": 1, @@ -304,7 +304,7 @@ "x": 0, "y": 229, "width": 960, - "height": 1538, + "height": 1669, "layout": { "mode": "HORIZONTAL", "gap": 12, @@ -322,7 +322,7 @@ "x": 24, "y": 24, "width": 627, - "height": 1490, + "height": 1621, "layout": { "mode": "VERTICAL", "gap": 12, @@ -1243,6 +1243,37 @@ ] } ] + }, + { + "name": "Gameplane/Security Advanced", + "type": "INSTANCE", + "x": 0, + "y": 1502, + "width": 627, + "height": 119, + "component": "Gameplane/Security Advanced", + "fills": [{"type": "SOLID", "color": "#1C1A20"}], + "strokes": [{"type": "SOLID", "color": "#2C2932"}], + "strokeWeight": 1, + "cornerRadius": 24, + "layout": { + "mode": "VERTICAL", + "gap": 16, + "padding": [20, 20, 20, 20], + "primary": "MIN", + "counter": "MIN", + "sizing": ["HUG", "FIXED"] + }, + "layoutAlignSelf": "STRETCH", + "variables": { + "cornerRadius": "radius/3xl", + "fills/0/color": "surface/surface", + "strokes/0/color": "border/border" + }, + "texts": [ + "Advanced security", + "Who the game runs as, and how the data volume's group is fixed. Leave a setting on Module default unless the game needs something else." + ] } ] }, @@ -1669,7 +1700,7 @@ "name": "Footer", "type": "INSTANCE", "x": 0, - "y": 1767, + "y": 1898, "width": 960, "height": 68, "component": "Gameplane/Wizard Modal Footer", diff --git a/assets/design-export/json/vtExV.json b/assets/design-export/json/vtExV.json index 4ff482cd8..8543560f1 100644 --- a/assets/design-export/json/vtExV.json +++ b/assets/design-export/json/vtExV.json @@ -4,7 +4,7 @@ "name": "Screen/Backups — Schedules (Empty)", "type": "FRAME", "x": 1640, - "y": 61340, + "y": 65223, "width": 1440, "height": 1150, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/w1QYmf.json b/assets/design-export/json/w1QYmf.json index 6a2312470..188663eac 100644 --- a/assets/design-export/json/w1QYmf.json +++ b/assets/design-export/json/w1QYmf.json @@ -4,7 +4,7 @@ "name": "States/Remote Capture — Access and capability", "type": "FRAME", "x": 11480, - "y": 37128, + "y": 39259, "width": 1160, "height": 559, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/w34N9.json b/assets/design-export/json/w34N9.json index 65daa6e44..ca314de8a 100644 --- a/assets/design-export/json/w34N9.json +++ b/assets/design-export/json/w34N9.json @@ -4,7 +4,7 @@ "name": "Screen/Standalone — Dashboard (No workload clusters)", "type": "FRAME", "x": 8200, - "y": 12822, + "y": 14484, "width": 1440, "height": 1150, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/wqnM9.json b/assets/design-export/json/wqnM9.json index 5d1b1780b..0efcf85b6 100644 --- a/assets/design-export/json/wqnM9.json +++ b/assets/design-export/json/wqnM9.json @@ -4,7 +4,7 @@ "name": "Screen/Cluster Details — Overview", "type": "FRAME", "x": 13120, - "y": 64190, + "y": 68073, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/wxINm.json b/assets/design-export/json/wxINm.json index 3ff9f1473..33a0ff4c3 100644 --- a/assets/design-export/json/wxINm.json +++ b/assets/design-export/json/wxINm.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Game configuration (Read-only)", "type": "FRAME", "x": 3280, - "y": 41028, + "y": 43159, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/x7MJI.json b/assets/design-export/json/x7MJI.json index ca976db59..75db8d605 100644 --- a/assets/design-export/json/x7MJI.json +++ b/assets/design-export/json/x7MJI.json @@ -4,7 +4,7 @@ "name": "Gameplane/Connection Card — Tunnel States (reference)", "type": "FRAME", "x": 10560, - "y": 24345, + "y": 26476, "width": 870, "height": 343, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/xCJlu.json b/assets/design-export/json/xCJlu.json index fac7972bd..524e2f235 100644 --- a/assets/design-export/json/xCJlu.json +++ b/assets/design-export/json/xCJlu.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Settings · Share links", "type": "FRAME", "x": 0, - "y": 53608, + "y": 57491, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/xvlB6.json b/assets/design-export/json/xvlB6.json index e76eabef5..7262d2716 100644 --- a/assets/design-export/json/xvlB6.json +++ b/assets/design-export/json/xvlB6.json @@ -4,7 +4,7 @@ "name": "Screen/Server Detail — Capture (Running)", "type": "FRAME", "x": 3280, - "y": 37128, + "y": 39259, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/y3YcQ.json b/assets/design-export/json/y3YcQ.json index 3b31a9d52..f4e90b519 100644 --- a/assets/design-export/json/y3YcQ.json +++ b/assets/design-export/json/y3YcQ.json @@ -4,7 +4,7 @@ "name": "Server Detail · Settings · Networking · Credentials entering", "type": "FRAME", "x": 6560, - "y": 43788, + "y": 45919, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], @@ -250,6 +250,7 @@ "Scheduled backups", "Network capture", "Placement", + "Security", "RBAC & access", "Share links", "Danger zone" diff --git a/assets/design-export/json/yrxK2.json b/assets/design-export/json/yrxK2.json index 4754829e0..66f75c623 100644 --- a/assets/design-export/json/yrxK2.json +++ b/assets/design-export/json/yrxK2.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Telemetry (Reset ID confirm)", "type": "FRAME", "x": 9840, - "y": 87754, + "y": 91637, "width": 1440, "height": 1031, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/zFiOW.json b/assets/design-export/json/zFiOW.json index f74edb924..7189101e8 100644 --- a/assets/design-export/json/zFiOW.json +++ b/assets/design-export/json/zFiOW.json @@ -4,7 +4,7 @@ "name": "Screen/Servers (Light)", "type": "FRAME", "x": 1640, - "y": 14602, + "y": 16264, "width": 1440, "height": 1010, "fills": [{"type": "SOLID", "color": "#FFFFFF"}], diff --git a/assets/design-export/json/zM0VF.json b/assets/design-export/json/zM0VF.json index 6db1d0009..2c4fc3439 100644 --- a/assets/design-export/json/zM0VF.json +++ b/assets/design-export/json/zM0VF.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — About", "type": "FRAME", "x": 0, - "y": 90486, + "y": 94369, "width": 1440, "height": 900, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/zj5a3.json b/assets/design-export/json/zj5a3.json index 90f4531b0..9f2a7004b 100644 --- a/assets/design-export/json/zj5a3.json +++ b/assets/design-export/json/zj5a3.json @@ -4,7 +4,7 @@ "name": "Screen/Dashboard Home — Telemetry notice (default)", "type": "FRAME", "x": 4920, - "y": 12822, + "y": 14484, "width": 1440, "height": 1380, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/json/zqzr4.json b/assets/design-export/json/zqzr4.json index f9068d003..d4314f8c2 100644 --- a/assets/design-export/json/zqzr4.json +++ b/assets/design-export/json/zqzr4.json @@ -4,7 +4,7 @@ "name": "Screen/Admin Settings — Authentication (Admin mapping warning)", "type": "FRAME", "x": 4920, - "y": 78780, + "y": 82663, "width": 1440, "height": 2488, "fills": [{"type": "SOLID", "color": "#121114"}], diff --git a/assets/design-export/parts.json b/assets/design-export/parts.json index 3f744b918..c635c3b28 100644 --- a/assets/design-export/parts.json +++ b/assets/design-export/parts.json @@ -5,7 +5,7 @@ "name": "Gameplane/Provenance Badge/Not configured", "width": 115, "height": 17, - "hash": "a6f27ccd0b656891b879e269fc4519f94f84e5d757b6f175e1a76e3c31828dd8" + "hash": "90ba3c20f56470574c986c2e7f311c7d6ede1f1b836a519abd4d299e16a7cea2" }, { "file": "CqaSq", @@ -13,7 +13,7 @@ "name": "Gameplane/Role Editor Modal", "width": 480, "height": 513, - "hash": "84074a4bff6843913b570a41b29129580ba75e93446d12a4ce5c0b4fd986c77b" + "hash": "167f98c1ac00aec40e55916070c11a0b17e07d837723f0e11dafcc106188c031" }, { "file": "DMnEi", @@ -21,7 +21,7 @@ "name": "Gameplane/Dialog/Add Module Source", "width": 480, "height": 885, - "hash": "d1d6a53e8e6159e41d70ee22e329caa730dc32f5b64693e7f2c2be7dcd3bb4c4" + "hash": "ca3037ce0d185a6c6a970f2a0887ab7ca97735de00b533adc3f58da3a73f2979" }, { "file": "E9EEv0", @@ -29,7 +29,7 @@ "name": "Gameplane/Dialog/Restore Backup", "width": 480, "height": 389, - "hash": "345bd0fb094d2c6fb34b3274e3be40373faafacc2d0dddb1c439944ab3da7c2f" + "hash": "9eda1e5f990da49cb6ca33369dc36ba7bf3021756356d3a498af33a2a007df02" }, { "file": "Kp48V", @@ -45,7 +45,7 @@ "name": "Gameplane/Dialog/Reset Password", "width": 480, "height": 215, - "hash": "a1be31f2325f39a981c0ffea5d8aa316c8906d170dbf8eef6ec4215622a18776" + "hash": "f01c5ea45f0085a5fe132d0a34fbc87927bdec63d882fcd19006a2af4fa25804" }, { "file": "NLDDv", @@ -53,7 +53,7 @@ "name": "Gameplane/Dialog/Invite User", "width": 480, "height": 516, - "hash": "5c925f6f8b526d7db1fffc4c845b71080d90355a727d71bf169a8dc9074691d2" + "hash": "24eb3554200b847199caaeaa3152e4f407666248e0c91092bbfc9afd898361a8" }, { "file": "R65Xyx", @@ -61,7 +61,7 @@ "name": "Gameplane/Provenance Badge/Overridden", "width": 169, "height": 17, - "hash": "9c947b27daea5d068defa7a80d369efb305847d7c7b816095e6e60463210a734" + "hash": "f9191c3fb79a87c89f8e7fa016b7369143866f8374b403cf3f78d37b8bb775d3" }, { "file": "Rwnu3", @@ -69,7 +69,7 @@ "name": "Gameplane/Provenance Badge/From Helm", "width": 127, "height": 17, - "hash": "719375922644cd74eb532ab5f11c28e28dadd1c47c1662f7ff516568dfe65a4e" + "hash": "da8e9cc4a602054d79c5e087c8ade02ffd0e028f44f5f26512f4b316b63f64f2" }, { "file": "S7SCDc", @@ -85,7 +85,7 @@ "name": "Gameplane/Dialog/Share Link Created", "width": 480, "height": 380, - "hash": "d7394f521d89b4bbee760c5ecdd6092d4f1202c0c460764a698b270089ffaaeb" + "hash": "2bb7c4817914fb650f1388db5f3cb2919ee645bbbc803a9d7b87c573c44ed7b3" }, { "file": "XL5ZU", @@ -93,7 +93,7 @@ "name": "Gameplane/Removable Group Chip/Orange", "width": 83, "height": 23, - "hash": "c56c7aabe9b203a303654c881edad7d4998e690f0a0a7352b689fdd8e4418229" + "hash": "d0f732437f659f8af9331cdbe52097ab9c6a28ce4dd05fa1439e2a1699e4ebd1" }, { "file": "atqRh", @@ -101,7 +101,7 @@ "name": "Gameplane/Dialog/Create Share Link", "width": 480, "height": 302, - "hash": "484193102fad9e2b9416575ec71fd292e36cfd89bc5f06901fafaae0172432e0" + "hash": "ca9ab9c4adfb2fd581bc40d669e423826a04f256794fa8932d5eb5509c75aeaf" }, { "file": "bHJy6", @@ -117,7 +117,7 @@ "name": "Integrity Banner (Broken)", "width": 1132, "height": 64, - "hash": "7da873f667c4bd5b142a69f9ea01421366cccf93a81c9a3831f651eb5bb49d1a" + "hash": "72db58c0d54bc99bc37d71d0f7679c2f9d530a71231b910443bd2432a37d9ce7" }, { "file": "t3IY3u", @@ -125,7 +125,7 @@ "name": "Gameplane/Dialog/Edit User", "width": 480, "height": 558, - "hash": "a6b7934776a545d8898996d067d258c6e5634eb4763dc950210d021b4d93b659" + "hash": "f64d8fd07763d2d8c30aa177d3186cbd9a11e7ae16815cb1acd975b638843b23" }, { "file": "uw0dB", @@ -133,7 +133,7 @@ "name": "Gameplane/Removable Group Chip/Secondary", "width": 77, "height": 23, - "hash": "c0d186b39901b1bd17bcf57adb85a44cdee6a1af9067e0690aa312b342da4590" + "hash": "6959522d0bb443cfccf5136c576b22a41843aae77582351a74f0891143b500aa" }, { "file": "vStkb", @@ -141,7 +141,7 @@ "name": "Gameplane/Removable Group Chip/Violet", "width": 77, "height": 23, - "hash": "9e9eee6302f18bfb85c24c139d628eea1203125bd2e5d4130c9147f8a78cfaf3" + "hash": "930971de322ebfebe0e447e440cb018e009ce60cb508eda6a58bced989716be7" }, { "file": "zhLZN", @@ -149,7 +149,47 @@ "name": "Gameplane/Backup Detail Drawer", "width": 440, "height": 760, - "hash": "5f661235dd27985a2fbfb7292b68cb3c364ee40d7d37e821b9ad26571b0b070f" + "hash": "39411551a5833b8a60b919ef6e52ab7b38f61db4648681e9777c032957e335d2" + }, + { + "file": "security-advanced", + "figId": "1344695818:183", + "name": "Gameplane/Security Advanced", + "width": 860, + "height": 651, + "hash": "83f49a80d3bb7cbe63f14cb5f6deeb6ce67ccd98397ba6d028b8d8a1820a564e" + }, + { + "file": "security-advanced-mobile", + "figId": "1344695818:343", + "name": "Gameplane/Security Advanced/Mobile", + "width": 327, + "height": 891, + "hash": "bc7cd0e6f699c6c3d18e4b309aba852fb5cfd665230d7d0e80da544906d694ec" + }, + { + "file": "dialog-risky-security-value", + "figId": "1344695818:344", + "name": "Gameplane/Dialog/Risky Security Value", + "width": 480, + "height": 271, + "hash": "220166db07fea752ec41c0c514619067fdaf0625786b928e2f04f27b2a9be207" + }, + { + "file": "dialog-security-file-access", + "figId": "1344695818:363", + "name": "Gameplane/Dialog/Security File Access Warning", + "width": 480, + "height": 286, + "hash": "a1046cf96a3fe71a0e224c5410d064ca838be92ae992ebd9df77f97af6250fac" + }, + { + "file": "cluster-security-panel", + "figId": "1344695818:414", + "name": "Gameplane/Cluster Security Panel", + "width": 1132, + "height": 209, + "hash": "d0bc64736eaf66503edcf7b984ec01720afa598ed07d1227e82b13b0da5f95ae" }, { "file": "UserMenu", @@ -157,6 +197,6 @@ "name": "Gameplane/Top Bar — User Menu", "width": 232, "height": 181, - "hash": "26806925bb1e863c648b974cde4cb459f39fcc87582a194d4a03ade661c597bb" + "hash": "30533515c59a99fcc4c9ec2861ad5bbfa4ea0a0c7b87f7afef0a81b0abe64725" } ] diff --git a/assets/design-export/screens.json b/assets/design-export/screens.json index 19e79ceec..af7073ef6 100644 --- a/assets/design-export/screens.json +++ b/assets/design-export/screens.json @@ -5,7 +5,7 @@ "name": "Screen/Login", "width": 1440, "height": 900, - "hash": "b6c7f802ba794bf973327dd67d3ca804ab5c15d2f9d05805c030815cb6b671ce" + "hash": "77ecaaf96c8338e014eba8b7101895e0cec32084071eb4a41ca7741017ceaa9e" }, { "file": "jmoi3", @@ -13,7 +13,7 @@ "name": "Screen/Login — Invalid credentials", "width": 1440, "height": 900, - "hash": "1ef9a12de00a4e63f96f81d2315e89bdeaae58f1cdda57a6a616091e786d59d4" + "hash": "f3c03f83a4c0c2d3c8baec003ecc856dcd49b6d767c8137b0430350e5007e5d4" }, { "file": "ljdA5", @@ -21,7 +21,7 @@ "name": "Screen/Login — SSO only", "width": 1440, "height": 900, - "hash": "28635b02883aaf42e30c495d2deffa8f1ac0261678c54379e945f08ff3ffbe5c" + "hash": "dc5870426ed3c765a5065ac329b1346dab7206ce495ee298c27c595caa65158f" }, { "file": "N13Xud", @@ -29,7 +29,7 @@ "name": "Screen/App Loading", "width": 1440, "height": 900, - "hash": "dcbb85124b3685a572bd8991a8734c2bf1d2bff5f508b4f8a7598a69692560e0" + "hash": "70784d92bdcd12f749aa37f15174e6ffb161cb437bbe280cd1337b812feef738" }, { "file": "j24cXg", @@ -37,7 +37,7 @@ "name": "Screen/Dashboard Home", "width": 1440, "height": 1150, - "hash": "32c5cc73b622d31a1f76a2a9739c1ec9ff7def9bd6f261fc2d9679af87e1dd58" + "hash": "bf1fb96b40f8089abd3a3e091037f73469e07b2632aca17f454a2414cc226dc2" }, { "file": "EZFW0", @@ -45,7 +45,7 @@ "name": "Screen/Server Detail — Overview", "width": 1440, "height": 1300, - "hash": "b5a5299c0f4fbfe2cbf6dc677272382b5e4187d1454f309079117e35b2192977" + "hash": "e4d3710d56062c9c3a39c7269f5829bfdf600a9f7394fbc70c0d5560090c512b" }, { "file": "P08Uw", @@ -53,7 +53,7 @@ "name": "Screen/Server Detail — Events", "width": 1440, "height": 900, - "hash": "e19e3f917b0192d85c50803df7069c446e3e22e332f84f59484b1d375fa66b35" + "hash": "71697ab54a29fd6c92e35fc3ee14d548b5df3d1b7fb381a567a503df1b495980" }, { "file": "Xn5ns", @@ -61,7 +61,7 @@ "name": "Screen/Server Detail — Console", "width": 1440, "height": 900, - "hash": "51de925195b889cc3d2a98885e01b51fecc47046457be71028c5c02fdc80e69b" + "hash": "881b058e4f27ed4ce89e69ed366f4d04c7552a1443408c48d858c7ebe9aa4b5b" }, { "file": "kPmoo", @@ -69,7 +69,7 @@ "name": "Screen/Server Detail — Logs", "width": 1440, "height": 900, - "hash": "b35aacd57b43b89dd338ecfd4452f4679ceeeca0f4add1608bae55b8e3fabe23" + "hash": "d874b477b122c7648250e8f9f503a74ff9db3eca9d22640e01d7d6b03f64436d" }, { "file": "FtdkI", @@ -77,7 +77,7 @@ "name": "Screen/Server Detail — Logs (Failed)", "width": 1440, "height": 900, - "hash": "c9ae4d821b6e3e4f4340a28346e9bf3ee012ad5a3f3033f3d5a61d1bcdfbc77e" + "hash": "f2afa9b9c6f4d6b792567fd0e56bf337146c590c7aa49c9ce01e912d80ca4a94" }, { "file": "Burtr", @@ -85,7 +85,7 @@ "name": "Screen/Server Detail — Files", "width": 1440, "height": 900, - "hash": "f65c2192842db85f7798fe587b5f4760a69c1d38ccdb5a5aa7cefba9ef2ebf00" + "hash": "3c14a54120a6c9d7b08abdcaeecb02dab5c8cb38bb209eda28958b53d53c3d83" }, { "file": "sZtDi", @@ -93,7 +93,7 @@ "name": "Screen/Server Detail — Mods", "width": 1440, "height": 900, - "hash": "db7fb43c25de25af50af1008cc175ca2eec0b6967e8c46c444077957ce2a5d43" + "hash": "df092a86b2a91fe8cb54ebc532124e3103eb71d699e78320df6bbea8a68d7591" }, { "file": "GayoL", @@ -101,7 +101,7 @@ "name": "Screen/Server Detail — Mods — Browse (added)", "width": 1440, "height": 900, - "hash": "d2d15032e76751ffacb003fb1d0d563072614872f1a4d28f031f54a8d8a49093" + "hash": "525a0022a098b836f79b24a84b7b8a800eb31e5288505a2d39191fb78523c6be" }, { "file": "Ss0Yr", @@ -109,7 +109,7 @@ "name": "Screen/Server Detail — Mods — Install mod (from URL)", "width": 1440, "height": 900, - "hash": "6959714ed02f6fe1c60b6f2963a49fe8e7b08e12637a02066ef34b687d4ff3ca" + "hash": "316389ed126b73f1edbfde2d4ffb9748b9ab9dcd00fc07622ab7f8bc07f9bfaf" }, { "file": "V1VhGE", @@ -117,7 +117,7 @@ "name": "Screen/Server Detail — Mods — Install mod (upload)", "width": 1440, "height": 900, - "hash": "97a1b3ac811a9c6164a39bf415b83c2d83c6440d26d7f50a2fd2a2ee5aeec0da" + "hash": "46665061927eeaf8d889057530de40292d643dadb475dc6d59d3798e4f0b0c1f" }, { "file": "tY6RD", @@ -125,7 +125,7 @@ "name": "Screen/Server Detail — Modpacks", "width": 1440, "height": 900, - "hash": "ee19a3a1f9e2b807e44118b712977ae1e11b4ced58c989404f58bd0e8808d5fb" + "hash": "5131f857ab745772221063155aef748b1606b331bc70d2d09800d03d182a63d9" }, { "file": "dPP50", @@ -133,7 +133,7 @@ "name": "Screen/Server Detail — Players", "width": 1440, "height": 900, - "hash": "8a8001c3520b1fad67f051fce0474a99e686c7a4fa62bd3be906a177e489239c" + "hash": "5e4809f626a93d7e4fb20fbd8cbb9d1991fd5bf3793a0657fff7451432382a2e" }, { "file": "pssCT", @@ -141,7 +141,7 @@ "name": "Screen/Server Detail — Backups", "width": 1440, "height": 900, - "hash": "d2235a6f333e9be7cd725764d73e7980bde4717e00e55c080ef2defdf9d03308" + "hash": "23e4050ece5b192ca5abd0937eefe4e800dd08cafd0a46d40f86a63dfda22d9b" }, { "file": "hLB9Z", @@ -149,7 +149,7 @@ "name": "Screen/Server Detail — Settings", "width": 1440, "height": 900, - "hash": "0ddd57afc7073d4505ef4d5957c7322c64329eeb7491e7c4734149b53db63cad" + "hash": "1b03fdd1d2cd1ae2ddf4847d7ace9e46e284a5462462726c6527b94193cbcb31" }, { "file": "swxkJ", @@ -157,7 +157,7 @@ "name": "Screen/Server Detail — Settings · Version", "width": 1440, "height": 900, - "hash": "854a9917ff38ec6643492ae7849b0cd236f274bad1c4e0343e8e1376bf3abfe3" + "hash": "3054b950494349c36184cd5760db50d472191c93699e535a54defe45312bc270" }, { "file": "E0ypH", @@ -165,7 +165,7 @@ "name": "Screen/Server Detail — Settings · Resources", "width": 1440, "height": 900, - "hash": "3ac260270da249023ace37871e509b12d7e188c2f9fcb25a88dc52899376f7ff" + "hash": "cefc250449a186bbc3a59a539afe351e680e4f7573395b675081801755113ae7" }, { "file": "J5pjJ3", @@ -173,7 +173,7 @@ "name": "Server Detail · Settings · Networking · Complete", "width": 1440, "height": 900, - "hash": "5b4563b944f6610be65c32b0b45c2e7a0bac14e7ca5c3432159594ba957707db" + "hash": "e81e027aebd078a45f26f9a5e9b3ff58957939132783616d7287b20de4f9af1c" }, { "file": "ugDSa", @@ -181,7 +181,7 @@ "name": "Screen/Server Detail — Settings · Environment", "width": 1440, "height": 900, - "hash": "35b125c5563b07982bbcad841b581f4de8602867abca19526baaf5151073f098" + "hash": "4012473a2e8c8b01ca37b6c927396fb7e8721087658fad1d9fe8f872a28d6b4e" }, { "file": "i1bLR", @@ -189,7 +189,7 @@ "name": "Screen/Server Detail — Settings · Lifecycle", "width": 1440, "height": 1620, - "hash": "800b85d6e85afa7d4b64578e217dac8d0b9c3a1030efd9661db579696c18fcfe" + "hash": "29ffb3d931a4eb3daa50de546f1f33b08fde617ee54f1961a9e67f9a3f9debe1" }, { "file": "KaRFX", @@ -197,7 +197,7 @@ "name": "Screen/Server Detail — Settings · Scheduled backups", "width": 1440, "height": 900, - "hash": "16ff8f483b57f0479a7c29c52a75897cbbd7bb24f410db9347824512627e3860" + "hash": "dcbe6f7df20b50a6b3caed4b7ec16f493b4929dd37c23c3a59d15cf216c22504" }, { "file": "Y5cmvI", @@ -205,7 +205,7 @@ "name": "Screen/Server Detail — Settings · Placement", "width": 1440, "height": 900, - "hash": "6906a1bc1e9449056ede9e018dd882c2eb5750a44385bb3a52601f9e6aadd1b2" + "hash": "019a460b6beb016a9bf3181ffe33aa5f07132e58de3c292afc9d857bf2107972" }, { "file": "iSA6R", @@ -213,7 +213,7 @@ "name": "Screen/Mobile — Server Detail — Settings · Placement", "width": 375, "height": 900, - "hash": "0824d1e07a4cc28feb8e0e64595e671e3ba5461dd390242e937260e2084860dc" + "hash": "5f73554994d7d0f5c8ad9572f427de02e575e3b4cddccdadbd3ed2c3de26c50f" }, { "file": "VfB0Y", @@ -221,7 +221,7 @@ "name": "Screen/Server Detail — Settings · RBAC & access", "width": 1440, "height": 900, - "hash": "16ab0a496d0a71031ce2206f26517036074f3498a4785cca3e8f78c354915943" + "hash": "6128ba198019be58178162ef24eee76a66fe91a892c127c25201c1013ddfbe13" }, { "file": "i8wib", @@ -229,7 +229,7 @@ "name": "Screen/Server Detail — Settings · Danger zone", "width": 1440, "height": 900, - "hash": "d612e4a4a77470e7bb49824f5f870a3a6a64c1f685add1da6125458eab68bbec" + "hash": "faa98e8a8912046a53026935d62f472b07396f32474de24b28f98a6bb1711c1f" }, { "file": "W8idqY", @@ -237,7 +237,7 @@ "name": "Screen/Create Server — Step 1 Template", "width": 1440, "height": 980, - "hash": "a46c953de313ceeffea4de11c3de62056492a8ee6868bc9392ff137f04e7c529" + "hash": "29b4a8ac0a1dfa57ee46085605d734edd6c601d3871995c68469c336d1b27d97" }, { "file": "nNL3E", @@ -245,15 +245,15 @@ "name": "Screen/Create Server — Step 2 Version", "width": 1440, "height": 1000, - "hash": "46bd474d268c948906b74548f6779a1fc3b95be673ac3be9a4dc7c3e3d5f0f1c" + "hash": "33545be3c88ff3950a69fdee573235fa283a85446102834bafa254227d966c84" }, { "file": "vUqMl", "figId": "1:2097", "name": "Screen/Create Server — Step 3 Configure", "width": 1440, - "height": 1989, - "hash": "335df702b7635c945f2b6479ff516a1fe44d94d90fd1f736eb819bb2ff61ca9d" + "height": 2120, + "hash": "a847aaad659f4af95673b6df2e8e1801079476b1f3017fb35240bf13b12d3c57" }, { "file": "f1Vga", @@ -261,7 +261,7 @@ "name": "Screen/Create Server — Step 4 Network", "width": 1440, "height": 1270, - "hash": "2170c0acbc095c0f19c1fdd9426a32f77b4e0bc019edaa456d12a612f6a08a63" + "hash": "ea291e97fafa8b6664b5a43ad9f730e6442b3d5ca69b979f7e395b901ade63bc" }, { "file": "UMJli", @@ -269,7 +269,7 @@ "name": "Screen/Create Server — Step 5 Review", "width": 1440, "height": 1000, - "hash": "b4fb8b0251043e72005e4dce79afa3e8c91ca5bcb809c6a9cd7403b8da408e2d" + "hash": "f24de233d58947f70817287623693d74031cc769078c0318e83d7d3ab2a98271" }, { "file": "kK8Ji", @@ -277,7 +277,7 @@ "name": "Screen/Modules Catalog", "width": 1440, "height": 1320, - "hash": "79a6fc05945160001557b923ee0a66af6c4ee6baf60173230632d31b5bd66aa7" + "hash": "0c4b1ccec03bc47e6de3d654536a9ee7937fea5cb86ee298b1a8b862671840af" }, { "file": "DPrYX", @@ -285,7 +285,7 @@ "name": "Screen/Backups — Index", "width": 1440, "height": 900, - "hash": "cb2bfd326a8825d1edd42634b682646c295a34bf4c2080f4a1d67418f7c78596" + "hash": "458e882c3789d085af42f6d696bde9190ff6df175e7c42f7c46742378203b2b6" }, { "file": "9dBXM", @@ -293,7 +293,7 @@ "name": "Screen/Backups — Index (Empty)", "width": 1440, "height": 900, - "hash": "47baa05d6461e893fcb5023a05f4e94be99363efc1f95be53d1fbbd746ef5915" + "hash": "6d3f38a17b599e5cb8e79a66338d04e89fe06bf1b4e6a65b6ff15b0b11dafd07" }, { "file": "fK8Bi", @@ -301,7 +301,7 @@ "name": "Screen/Backups — Schedules", "width": 1440, "height": 1150, - "hash": "19333cc0a3a1f6da46a37fed356984bbc566c05d59ce006cd7ff56447fac11b4" + "hash": "fc577fc2beebefa0ce7dda3cae3de587c1e6a0c9e8143773ec3761951ccdd86f" }, { "file": "vtExV", @@ -309,7 +309,7 @@ "name": "Screen/Backups — Schedules (Empty)", "width": 1440, "height": 1150, - "hash": "8cbedf108576fbcfbe20650d82f5d86af40ded8acd76ed9175fe254f69c6f2d1" + "hash": "243390a674f32729ebbb7e0fe897141aefb50a5468773397f6495c00ecbc66dd" }, { "file": "tTSdi", @@ -317,7 +317,7 @@ "name": "Screen/Backups — Restores", "width": 1440, "height": 900, - "hash": "7aa80def3a4bd77ab73e91c8152ba08850f6ce8e4d422c2c6b5db4f6c31f5c29" + "hash": "385daa91d044635f1487b32012a0629fcb58c24bab997a242975dc3a347fd88e" }, { "file": "nfMMj", @@ -325,7 +325,7 @@ "name": "Screen/Backups — Restores (Empty)", "width": 1440, "height": 900, - "hash": "c057983e97dc87c133b796119fe8c7a92729536a1cea25aea37518fd2390024b" + "hash": "5dc395a885dac374414cd92f2881baf3b21be052c02347a2839ea191b88d806c" }, { "file": "j9W8A", @@ -333,7 +333,7 @@ "name": "Legacy/Cluster Settings — Superseded", "width": 1440, "height": 900, - "hash": "3ca4b240668f149a954fcb1ac33c92067a10c6531297e5f27ad8a436b977e8dd" + "hash": "ad0265a467838e14ae69909e160a8ebbfe024f88681cb8d4ed2bdcf1562a5923" }, { "file": "bYDHC", @@ -341,7 +341,7 @@ "name": "Screen/Users & RBAC", "width": 1440, "height": 900, - "hash": "14e194bd370cb7e17d87834cd0a7f288c776165bc5a9bb9491f1d406f9fde447" + "hash": "9b79d2c93d87020d125a3f07e507ea559f5b02ca90db3db3af5f88058f2d55be" }, { "file": "e9lV4", @@ -349,7 +349,7 @@ "name": "Screen/Users & RBAC — Roles", "width": 1440, "height": 900, - "hash": "72caefae358aff5cfac0d70151022e3b3b78742ecd70dc4d587defefc728118c" + "hash": "92412f393020a97ea5e089e94182c28a9e1297da96100a14fcbb88a2b325a034" }, { "file": "TBvTC", @@ -357,7 +357,7 @@ "name": "Screen/Users & RBAC — Service accounts", "width": 1440, "height": 900, - "hash": "c6c65a5ed6b02fb1b842f35ddd7574a99d4a2254c8851ad0fcf23020f130a4da" + "hash": "9ef9674e8c77639e789a05f210d03487fcf31803d373140e52e98907f7aa3964" }, { "file": "Dpb9f", @@ -365,7 +365,7 @@ "name": "Screen/Users & RBAC — Identity providers", "width": 1440, "height": 900, - "hash": "f3fdcee5c9f0566defea9ba6201fdc544837b0b0c49566359cf2498d0b15133b" + "hash": "86e9a4fa778cdb93ad1495d92c1d6639be022bac6b1d429529717cb80703efa7" }, { "file": "DxKOh", @@ -373,7 +373,7 @@ "name": "Screen/Audit Log", "width": 1440, "height": 900, - "hash": "c40c152eb5b3fab96e7402006d5d89d73a6c264bc26ec536007481e0606dfbd1" + "hash": "532bc709b5129912d05b5251d86718fd88334224f8e4e38269a276d653a2d9ad" }, { "file": "Bq2Yg", @@ -381,7 +381,7 @@ "name": "Screen/Admin — System Logs", "width": 1440, "height": 900, - "hash": "f3ae8c82bb3c62edfea91238c0f3edcb212282ee6075acf2442fe091f77587fc" + "hash": "c805320801690bab8e8bbf16c923fffe2b6a6e79a1de9029fbdf2abd3030d4f5" }, { "file": "WZdnw", @@ -389,7 +389,7 @@ "name": "Screen/Admin Settings", "width": 1440, "height": 900, - "hash": "f8e41a98580e4d598a79b9ed029f794c8acfcba3ea3035f4c06ea4112a684816" + "hash": "b765d621ff1173462b561a823befe4db0272c34c27c04c5bc73cffc34ebf7e30" }, { "file": "uMiwd", @@ -397,7 +397,7 @@ "name": "Screen/Admin Settings — Authentication", "width": 1440, "height": 1636, - "hash": "8677c492b9ff80ef1ebfc84e66c62ae3bb86eb9533f12a7ff9de85715f3d9500" + "hash": "da8a62f7d3754acf340de75b2fa92fce8adcd43b6afb62185dcb9fc8ab0d7dbb" }, { "file": "RC3Kf", @@ -405,7 +405,7 @@ "name": "Legacy/Admin Settings — Backup destinations — Moved", "width": 1440, "height": 900, - "hash": "398041d7129bf053991f28d4349a10fc5e4d041150accff6be2d1ab6ec2339c9" + "hash": "21083e2230d924a7b2ed00f7910fa72462791f0a22b9722211f6d6df13bf6a92" }, { "file": "g5mEpx", @@ -413,7 +413,7 @@ "name": "Screen/Admin Settings — Module sources", "width": 1440, "height": 900, - "hash": "90ae3032360fc578a1f26605284690587cf8e6d5e26e9e0816647ace739ce242" + "hash": "00b5a4aa7370300fe688bb863895d05073ce1dcb1d4dc079c863f2261ce3cd11" }, { "file": "n6Xlo", @@ -421,7 +421,7 @@ "name": "Screen/Admin Settings — Notifications", "width": 1440, "height": 900, - "hash": "c23d19c598d4126f3d89c83009e40c995200718d6f3697841cbdbb7ab3861c30" + "hash": "a7bbb09cac5efdecfe7d52c16366418ae6f27ba97efeaf535e927f7f954659bb" }, { "file": "uoxQW", @@ -429,7 +429,7 @@ "name": "Screen/Admin Settings — Telemetry", "width": 1440, "height": 900, - "hash": "7ad04dfc010ca448e5c28a485ff846464b74ecb40c4b37f2633c7bddde3c37f4" + "hash": "77fec3de8463495dbfc5d99e9b01c9b8125ed48781e1e7fa50123280e6252657" }, { "file": "M2sA4u", @@ -437,7 +437,7 @@ "name": "Screen/Admin Settings — Updates", "width": 1440, "height": 900, - "hash": "83bac27cc0e0731309356168cc023c2a819cd992261f309e0b7c6148063f19ba" + "hash": "b3c7814d5ee073ae0d77956f3390339567932cfdad1d584edc34b21a3b2c21ef" }, { "file": "zM0VF", @@ -445,7 +445,7 @@ "name": "Screen/Admin Settings — About", "width": 1440, "height": 900, - "hash": "fe63b05d45feda8c60026f5d39f7161043888be4f379fda6a3b4e4f3d6e54826" + "hash": "2f022dddca4b7363a5ea7e0efa4a2e1771fb27269a82a96ffb1b28a665b9326e" }, { "file": "tooKB", @@ -453,7 +453,7 @@ "name": "Screen/Mobile — Servers", "width": 390, "height": 954, - "hash": "d251da09590478edb839965224b59a84ba760de2cdbc0d0a97cdaeec1a81a076" + "hash": "6467246897df9e558bf0343af8cb5607cfb111b1afc1af08b0fd040acad6b9f9" }, { "file": "SeizD", @@ -461,7 +461,7 @@ "name": "Screen/Mobile — Nav Drawer", "width": 390, "height": 844, - "hash": "846a2ae94c2c38aa414be4e5f2322fad5c9cfaf1016e4d31c731a679b4af4c19" + "hash": "e7f5cedf1fb93dc9607e738f9188e45d0dcec55cf8802c9f261c34335d3f6d90" }, { "file": "Wj0V4", @@ -469,7 +469,7 @@ "name": "Screen/Admin Settings — Mod registries", "width": 1440, "height": 900, - "hash": "0c83e9bc4b0f5086f18ef35081dc1e19aa6e665791e9c1274ac74cf5dd75da36" + "hash": "a281f937b4174f32288df5c13c2bdb219b001ae5dfe424d058fa381e5204f953" }, { "file": "i4L0M", @@ -477,7 +477,7 @@ "name": "Screen/Admin Settings — Mod registries (Key saved)", "width": 1440, "height": 900, - "hash": "ea81c473ae38c101f231b181904c6541d1ec44e078daf47663093a38ec6adf8b" + "hash": "8e314eaf5c2014c46ef6c08265ecee7994b10fd01c165db5502b08a4bb89d75d" }, { "file": "KhYNc", @@ -485,7 +485,7 @@ "name": "Screen/Server Detail — Mods (by ID)", "width": 1440, "height": 900, - "hash": "4ac9558db20d97ebe790f929e6589cd391a3601b24ea3959de8ea2ac1d701abe" + "hash": "99b88242b4c35eb5f00955e29838d4c64af1c27349cd3846cd22c4afa9006360" }, { "file": "IzuY2", @@ -493,7 +493,7 @@ "name": "Screen/Server Detail — Overview (Never sleeps)", "width": 1440, "height": 1725, - "hash": "b71fbc454fcc1db72e276a672768b587702172a33657e646fec6d0d2ea161c04" + "hash": "ca40aa0b2944bb423d18dba6263258215c0f922c67f6f590b7a8c19c34f4c13a" }, { "file": "TE2jI", @@ -501,7 +501,7 @@ "name": "Screen/Server Detail — Overview (Asleep)", "width": 1440, "height": 1102, - "hash": "832a8325ba49f1a5c3fe76a8b09d39f090a7d1e921e80958e40c7b51281450f8" + "hash": "2891cf1d9c94c33069c0890ed12e4ca28357fab14cf044d69c462b2d617e5cae" }, { "file": "x7MJI", @@ -509,7 +509,7 @@ "name": "Gameplane/Connection Card — Tunnel States (reference)", "width": 870, "height": 343, - "hash": "9c539c0787a99482c41420d93656047cf73e86080e3e09f8daa89729f884f2db" + "hash": "7e3bf23b2564924296e909cdd1f03bcffd1b67f462efb4b4150d993da07114f5" }, { "file": "xCJlu", @@ -517,7 +517,7 @@ "name": "Screen/Server Detail — Settings · Share links", "width": 1440, "height": 900, - "hash": "18a2b94439843f2c64ec2cd94a658500c1ebf4e52ea964797b5ce54c9c6fac5a" + "hash": "43a631499834f8337e801710f4b7cc680a61be4e37ebbc87aeb078bec4c35701" }, { "file": "dQV9N", @@ -525,7 +525,7 @@ "name": "Screen/Server Detail — Settings · Share links (Empty)", "width": 1440, "height": 900, - "hash": "cc3b59b1bdc92af5ec59f2f2ac8d8df7c72c0a4fbd74a940b474d5cdbcb58401" + "hash": "5a3f18271b0e03b17bcf1c1a2368dd3a4daeb0149ea165adae4645d6ef5bcfba" }, { "file": "C2LQE4", @@ -533,7 +533,7 @@ "name": "Screen/Share Link — Up", "width": 1440, "height": 900, - "hash": "306bd312b319443f306559dad0212dc557ed1c3590505df4e66235b88bc4e65b" + "hash": "ec10e46a36b0737d1654b8bbd4692534c608c1b8df89c1b1fce2f56f547ea43c" }, { "file": "q31B6w", @@ -541,7 +541,7 @@ "name": "Screen/Share Link — Asleep (can start)", "width": 1440, "height": 900, - "hash": "0cfe99b0d77030632fd827be38fdda74eb39c85784c1aff1e6a67f267271df80" + "hash": "b022993691902f3a734be042f3802a8fdea3960beddfd328cde128f8d14daf68" }, { "file": "qFLfB", @@ -549,7 +549,7 @@ "name": "Historical/Share Link — Asleep (view only)", "width": 1440, "height": 900, - "hash": "4808bbfa4a7433b3ff0f15267eb77832d8b6265d124e48e22269a94c389e4b63" + "hash": "df91eeb255d7d07adfb0dc131bf5f573dcefe354836b92929164c94a4fc058bf" }, { "file": "EcoGD", @@ -557,7 +557,7 @@ "name": "Screen/Share Link — Starting", "width": 1440, "height": 900, - "hash": "b95b8d1397b017b48f7609319107c9f0d7e7921b556c652b8d2bad8bd736d186" + "hash": "9d3c914c103af983dc17bacb241493bb0a44e5b71c42646ffa4fe785e41f3c4d" }, { "file": "epZO2", @@ -565,7 +565,7 @@ "name": "Screen/Share Link — Invalid or expired", "width": 1440, "height": 900, - "hash": "59f4c63cbb679639cedc3a13a3f34b2fd468601d92c03b770a419899a546113e" + "hash": "6dfb7b641d792ceb19fcf6878ef9ea881de24f03f265fe80bcf7b20a8765299a" }, { "file": "LYPXU", @@ -573,7 +573,7 @@ "name": "Screen/Share Link — Stopped by owner", "width": 1440, "height": 900, - "hash": "56b165f3d9547bdec0cb91b38a1ff0d914ef44190767506597969155cd128f68" + "hash": "015feb2cb477db1973765812edf35e81db06836546caf31a5751048909e0f08a" }, { "file": "B57dG", @@ -581,7 +581,7 @@ "name": "Screen/Share Link — Start timed out", "width": 1440, "height": 900, - "hash": "d700b9074ad137021d31e912c1f246dc4f84c50901f2e37b578eee88dd170283" + "hash": "6d4633d12130ac40d3d91102106479a9720a8847e862fc78337534672e47b49e" }, { "file": "Bbnga", @@ -589,7 +589,7 @@ "name": "Screen/Server Detail — Capture (Not enabled)", "width": 1440, "height": 900, - "hash": "3e8045ddb1b23c31859306cc1e77b9b6a5b3e113a39b96052a6b19fa8456c157" + "hash": "860a8081c256045d2ffd875dc80fcb98771e6ce687335162220925ea2386f669" }, { "file": "dBILX", @@ -597,7 +597,7 @@ "name": "Screen/Server Detail — Capture (Empty)", "width": 1440, "height": 900, - "hash": "842538459fe94ab4cd0c66f9d9978c4f4e6529e8c25f6260f1875be1fce721fb" + "hash": "9d6e3ea700f011da0347afe5796be939be7c28f541976af1f70a82f5fcf9373d" }, { "file": "xvlB6", @@ -605,7 +605,7 @@ "name": "Screen/Server Detail — Capture (Running)", "width": 1440, "height": 900, - "hash": "dee739aa48c9b21d8a16199f9aefb056f0fbd7020337db2ae11cba36ebc59934" + "hash": "d210860736c8b7b7adae32e16727cb82851304d0aac33bffb65d74375e4448d5" }, { "file": "m5kOm4", @@ -613,7 +613,7 @@ "name": "Screen/Server Detail — Capture (List)", "width": 1440, "height": 900, - "hash": "129f6e2e7f02b06c1f865f78b326834f0d222c7083368977c0526bfd0ccd2585" + "hash": "d2c222c7f9ebe6f14ac829e1cadf0bb67b5c5fe0897f69ef0eaaf6f18236d794" }, { "file": "O08uaD", @@ -621,7 +621,7 @@ "name": "Screen/Server Detail — Capture — Start capture", "width": 1440, "height": 900, - "hash": "f4e1c97c29c6858b545b63064b7deab2d66f6b6bb9ebccdf52a50ebab6fb7e2e" + "hash": "f185dc3e6a25fc5ca70ab001248d31715e720c274dfbb529363a9a8d43a8e14d" }, { "file": "b4eaUf", @@ -629,7 +629,7 @@ "name": "Screen/Server Detail — Capture — Start capture (Invalid filter)", "width": 1440, "height": 900, - "hash": "fbc93376e8bdaae75ff896f19064bede53c2215da63e063d7188bcd164c28ff9" + "hash": "863cb08a7c51a3ff8482bca848e5e30f653544b55cdab45ea3c91fd6e5679a78" }, { "file": "RodrS", @@ -637,7 +637,7 @@ "name": "Screen/Server Detail — Settings · Network capture", "width": 1440, "height": 900, - "hash": "59235f757b64ecca720c9c1c64d22f81a8ed8caa74cb5ca7e0b93becf85be210" + "hash": "87d117449c1bb2e4e68c0ce5eb7302c9513f261a2909cd391567bd4d18a3352b" }, { "file": "nNGDX", @@ -645,7 +645,7 @@ "name": "Screen/Admin Settings — Authentication (No OIDC mappings)", "width": 1440, "height": 1463, - "hash": "2d80d87caecde0526f8be2fbfdfe45413f2a403bfd21392977b33174141fbf1c" + "hash": "98274e8c4ce07557b50fc100eda9d8afb6174dcadf691143d249585867a3d7eb" }, { "file": "dxdEi", @@ -653,7 +653,7 @@ "name": "Legacy/Cluster Settings — Default storage — Superseded", "width": 1440, "height": 900, - "hash": "59cebfef872ca89ea70eb794acaffcba558c9c43c6fd63c0ce241d5fd2396ae0" + "hash": "0343a9e4f52246c8310713ab7a5eef2620aa774a56f785d3adf208d5a4ed89f3" }, { "file": "QgW58", @@ -661,7 +661,7 @@ "name": "Screen/Admin Settings — Authentication (Save rejected)", "width": 1440, "height": 1660, - "hash": "00e15e3b580311d7dfcf7da592f4f30a33cc8e62208f4027a1d7c40585aabe44" + "hash": "6009cc7a7c5df4121c202385028e66203820ed28f27a82c70c57e60585744900" }, { "file": "zqzr4", @@ -669,7 +669,7 @@ "name": "Screen/Admin Settings — Authentication (Admin mapping warning)", "width": 1440, "height": 2488, - "hash": "299566d86df4446a455aabc323fc8d50f2432669e2f0ba81b49025c4809f2c7b" + "hash": "554e9e422cfab688ff71c150e9c18a6d15e039512e9b482e35e7ffbc0e612a0b" }, { "file": "o4LH8W", @@ -677,7 +677,7 @@ "name": "Screen/Server Detail — Overview (PVC Provisioning Failed)", "width": 1440, "height": 1320, - "hash": "b14fc682862a974c1063f3b3a5602b6d8a8545b61a39a2f34c625017b169b8cc" + "hash": "58572e0cecfc779d30f07dd4566bc632babcfdfb4d478e44421f592fde029047" }, { "file": "zFiOW", @@ -685,7 +685,7 @@ "name": "Screen/Servers (Light)", "width": 1440, "height": 1010, - "hash": "90ed60d260d3d034756e9c4c508a544839b7af1a3b3bd8504612755a88133070" + "hash": "fed55c40b45b4be6cf8f29eaf2d1370eaaf39b357afe0136647b0dff0349adc5" }, { "file": "F9pUrx", @@ -693,7 +693,7 @@ "name": "Screen/Servers", "width": 1440, "height": 900, - "hash": "1e2d91ffe7329eb35d93a08d84f80b0b8a2724a8623ffc739337f00944485faf" + "hash": "00da5a6d3d2cf316c1c4b6ff17d75c52aebb4c7e736952aecd120ed24d9664ea" }, { "file": "Hy9r0", @@ -701,7 +701,7 @@ "name": "Screen/Server Detail — Overview (Idle armed)", "width": 1440, "height": 1622, - "hash": "709c5441146f1f24b4adbdedb72c4c32e28f45e1b73b8639f6dcf490fbc29602" + "hash": "c0c7232215f22a0bee256992231af936110ac0a1bf81ed9c6054463235902c9c" }, { "file": "sSISK", @@ -709,7 +709,7 @@ "name": "Screen/Server Detail — Overview (Light)", "width": 1440, "height": 1300, - "hash": "6c9577e9302c766db91950c111f4cd02b9c66b8aa300d36dd2017fc29c71b316" + "hash": "16d8cb72104fb6110a96f3c2576bd5382322d0fd89f0689373d04ccf7eebc71d" }, { "file": "gX7um", @@ -717,7 +717,7 @@ "name": "Screen/Login (Light)", "width": 1440, "height": 900, - "hash": "70e6758d2e43278eb5fb5801bd35e7581df6cb3d41f09e7261fd9f5243ff212d" + "hash": "dc8fdff3f1c5313cc08c48940cf33f72629e68a3162efff0c3deeb3b2b88f25e" }, { "file": "oyoTs", @@ -725,7 +725,7 @@ "name": "Screen/Dashboard Home (Light)", "width": 1440, "height": 1150, - "hash": "1513781d9d243e73542d9556a4018f3515af64f63e4cdab3fe7f348600f62353" + "hash": "e7a7c4f8a0679daac164627cbde3ebdd9de38c5a583ceceba8226e628c7b2759" }, { "file": "DWztv", @@ -733,7 +733,7 @@ "name": "Screen/Mobile — Servers (Light)", "width": 390, "height": 844, - "hash": "a62b1e870e5bd2138bf363b2394eb1748d7409b268ca44fc538476dbb9381554" + "hash": "3a0df42a6405bc29774bc856641479f277a30669ab02aafbde2fefa7e28bf8ba" }, { "file": "IdbiB", @@ -741,7 +741,7 @@ "name": "Screen/Dialog/Build Module — Step 1 (Preset & Metadata)", "width": 800, "height": 977, - "hash": "565606c0a852eda85d5fc54fcf4e1eaec07fd1acb45b926552ffb8c8a13e24c8" + "hash": "0bb057c7ee75f5afe3f6d4d67c9dfd6f19ad75d618e2da36e273f465227bbf28" }, { "file": "O5kaV", @@ -749,7 +749,7 @@ "name": "Screen/Dialog/Build Module — Step 2 (Container & Ports)", "width": 800, "height": 546, - "hash": "0869f7cf29e85fd018a6316530aacfdd3914ee192f5ea103708609e4db0e4d2c" + "hash": "47a938711d0698ea89f0d456191e9c70cfa4bd2d48345824b985345b70b474f8" }, { "file": "hmPL7", @@ -757,7 +757,7 @@ "name": "Screen/Dialog/Build Module — Step 3 (Review & Export)", "width": 840, "height": 593, - "hash": "7a2cd0cd3b25cf1931fa12b072e4790d01e7fa0d8108ad01bede189f40800a62" + "hash": "da96a1caed49732423b6c3829b041455b5f90372ffe386eed4fe27250dd5fc17" }, { "file": "uCA23", @@ -765,7 +765,7 @@ "name": "Screen/Server Detail — Settings · General", "width": 1440, "height": 900, - "hash": "837b9c59a192371bfa672a534693e91e493d4b8fd1288f8eecd28c1308bd9d25" + "hash": "89d56e4369307e0c2d1c23d883ce8b0e396ab3dc6f84f290f546513e2572af2c" }, { "file": "VctzT", @@ -773,7 +773,7 @@ "name": "Screen/Server Detail — Settings · Version", "width": 1440, "height": 900, - "hash": "24ec5152af732f5dd7aeb09e6718ff026e40a3f8eabc90b80788a6fd1ac5c827" + "hash": "3ed41e23ff79ad46be7e893a16cd2529b7fab6aa6fe37b90b69319ec4c226ac4" }, { "file": "iLm38", @@ -781,7 +781,7 @@ "name": "Screen/Server Detail — Settings · Environment", "width": 1440, "height": 900, - "hash": "0fa713f990bee85546a346da5571133f8f04484e405f8d1b843f4bdf034e0f3e" + "hash": "81c80ded0c9fdd69ead2730eb6c2c35319f1e706780a717722a7b4328c3aed6e" }, { "file": "QpEvu", @@ -789,7 +789,7 @@ "name": "Screen/Server Detail — Settings · Access", "width": 1440, "height": 900, - "hash": "82e68fb801ed0c077609763532fb00d575b5e7d0a3094fd2d91eb01c195f76cf" + "hash": "d01dee4a67fd824aec45394ff8bc3c031bb2729c57a131930d8c20aace40f456" }, { "file": "XR0f9", @@ -797,7 +797,7 @@ "name": "Screen/Server Detail — Settings · Danger zone", "width": 1440, "height": 900, - "hash": "1119f0dc0c55972d5b4da64b8e50397e8149d3b3d575e27d0d116faead1c70a9" + "hash": "50edf255de2e046e8c7b01db29010d1dca6d1dc5042e37b1a6eb9774e2ea3424" }, { "file": "QQtUD", @@ -805,7 +805,7 @@ "name": "Screen/Create Server — Step 4 Network (as built)", "width": 1440, "height": 1270, - "hash": "a7e6990b927019c70dd01d326565e3deb5d0f67d2bf4fdd21dd0381b5cb76ea7" + "hash": "b540213000cf715fb147a991104cd48391606206195d11be1c42fe73b37e5bd0" }, { "file": "IyMFM", @@ -813,7 +813,7 @@ "name": "J5pjJ3 states/Tunnel enabled", "width": 500, "height": 476, - "hash": "bc234fd3c147a16c5e1d674d4f732691387fa5ea3ca84ae842866017a0081cb7" + "hash": "03ecd26f8ce1d3f60ecf1440f59c9d52f79c925fda3d9a56153fc88f0199a99c" }, { "file": "jXykV", @@ -821,7 +821,7 @@ "name": "J5pjJ3 states/Alerts", "width": 700, "height": 246, - "hash": "dfeaebdfb17cd835b6802d011e31e777539abda00e7bbbbe174f02f116f8f0e7" + "hash": "68bd769f2705155fb2d7dd422bf7fff1e5d4b51fee3386799c034054e2d1d5ec" }, { "file": "tr6cE", @@ -829,7 +829,7 @@ "name": "Screen/Share links — Create link (No expiry)", "width": 480, "height": 322, - "hash": "e3d9aaa3c53f01caac9d782b647bd4b5ce6855e78db258f4e5d1e76dcb889900" + "hash": "c2ee77518dcec3b09408572b7348462e4cfc1f911216223438d7435eb585cb4b" }, { "file": "oPF1n", @@ -837,7 +837,7 @@ "name": "Screen/Share links — Create link (Custom date)", "width": 480, "height": 382, - "hash": "d413af15ce422dd2971ae3f63cbd2c43cd9c611b7275bb4625f057acf5bd359a" + "hash": "518b160fca0c4daa12de3c423d696f018751d26b431c21f8c52fffb79a889094" }, { "file": "X405l", @@ -845,7 +845,7 @@ "name": "Screen/Server Detail — Console (not running – Stopped/Suspended)", "width": 1440, "height": 900, - "hash": "ce3303b0883439624829129daa0a66d972bc8c9efa1aca12b3b2263577a8118d" + "hash": "2ed6457dfa9e7a5ab41cb86eb457f672ce14ffd4593d53222c979541a5662178" }, { "file": "j88bl0", @@ -853,7 +853,7 @@ "name": "Screen/Server Detail — Console (not running – Pod failure)", "width": 1440, "height": 900, - "hash": "aa8d7193b10f79a2700a0e67d13d7700490b8e5ef8e8690b13f0a8e1fbbb3f37" + "hash": "24ee6a17838c302f11954d252bb3395f501bf3cf29a7e80cffd391d0bc9d78d2" }, { "file": "lWvcv", @@ -861,7 +861,7 @@ "name": "Screen/Theme Settings", "width": 1440, "height": 2344, - "hash": "ca22070bfbef552af37c37ce31840680908fa3cc3bbdfe8ad9bbcb8a222373f7" + "hash": "9d85c80b1e188ec56a7e84c676f5dd4de76ab09be0736183128346c05c2f809f" }, { "file": "T1wkiT", @@ -869,7 +869,7 @@ "name": "Screen/Theme Settings — Warnings", "width": 1440, "height": 2490, - "hash": "886ec138599ecfb4bb56da72c23adabbdc155548400cc3d4c4f447206aac7ade" + "hash": "b40862f3412d34c253065df1e16c9a8866a5b71b9784ce2fe7687cbc75816bcc" }, { "file": "lhKzN", @@ -877,7 +877,7 @@ "name": "Create Server — Step 4 Network · Tunnel disabled", "width": 1440, "height": 1170, - "hash": "ec592f8aaa61b7493cb1230218ac903938c3fbc9334d39741fa0a5aa35308237" + "hash": "9696d4409eca5bd4ae5c50ef8d626b137091bc244222cf01813bc39e873a1e21" }, { "file": "a7o9C", @@ -885,7 +885,7 @@ "name": "Create Server — Step 4 Network · Tunnel enabled, no provider", "width": 1440, "height": 1170, - "hash": "d5f80aba43cf90395b56f2c3592375aa70c24aae78ce0da63be89f01d30474e2" + "hash": "1ed2b65b064dae9b5d4c4a37d7b85ffd2ac4407e087a240b41a67ec4d753cdce" }, { "file": "ZU1BG", @@ -893,7 +893,7 @@ "name": "Create Server — Step 4 Network · Tunnel enabled, provider selected", "width": 1440, "height": 1170, - "hash": "fbdd605175b2a89dcdfc09cdb4909a910212d3f44a2c08323ef5ca6052d21fba" + "hash": "b804fd31f674f4074bdc511228734f3f0b3435ad77ebab66449c62046dcf62b7" }, { "file": "eGbsg", @@ -901,7 +901,7 @@ "name": "Create Server — Step 4 Network · Tunnel enabled, complete", "width": 1440, "height": 1170, - "hash": "80705d0d7dacea9efeb313973710bff0af87fc914f148404d2f47c07cb066376" + "hash": "ff68df5f3f23e2f2e480ad886c2476ebcdeeff2f29dac61d8e1f452a59fa75f0" }, { "file": "nGJE1", @@ -909,7 +909,7 @@ "name": "Server Detail · Settings · Networking · Tunnel disabled", "width": 1440, "height": 900, - "hash": "870f0e4d35fd7a31bcafdd212af1ea09e87d82a074276ef0a9b302f9e5d60c3c" + "hash": "39d644e150a090920c451f25994b652c112d58bcc9bf1d5025e069066fc40d80" }, { "file": "dhPtX", @@ -917,7 +917,7 @@ "name": "Server Detail · Settings · Networking · Tunnel initial enable", "width": 1440, "height": 900, - "hash": "32f734a8daafd31ff23db6c16f10f481ababbc8d0d3f4482297da60abbda2cba" + "hash": "4b67875de9e95e451615262f37374008099a072ee01a7df772fc56276f02e8fd" }, { "file": "tSOeI", @@ -925,7 +925,7 @@ "name": "Server Detail · Settings · Networking · Provider selected", "width": 1440, "height": 900, - "hash": "aa5bd12f6f47e0d9a9434843d51b9f363a398c627ac1fb5b83161e3aed8d8eb7" + "hash": "a45e93569780006da0f64b0b9503b7cdee1617f2d05f084baeeb7efe2436daa1" }, { "file": "y3YcQ", @@ -933,7 +933,7 @@ "name": "Server Detail · Settings · Networking · Credentials entering", "width": 1440, "height": 900, - "hash": "f7127fd837a9e5aa007e469602c3e93bd6b9a2f49eb715530e26aa313021526d" + "hash": "8bfa2fdfbc7fd17d0d730798198791aa906a55a405e8456aadec52fbbe641e01" }, { "file": "EKJyM", @@ -941,7 +941,7 @@ "name": "Server Detail · Settings · Networking · Provider + credentials complete", "width": 1440, "height": 900, - "hash": "a848596c67e7ab9772bd43e3f7c778f1cc7e9e20adfc152ad586ed738f3653ee" + "hash": "83e93abc351bae844acc604f33099cb1f960762be8b6600e20a099354cfd3329" }, { "file": "akr4I", @@ -949,7 +949,7 @@ "name": "Screen/Server Detail — Capture (No access)", "width": 1440, "height": 900, - "hash": "cafac9046c886e55a8d82e2e0d2cd367b850edc1fb7b9741fdd96c468e738b2a" + "hash": "f0e522c092fe01b1c19fe018b416ab3e44e6ccb595964d23023349efd5fbd01d" }, { "file": "hlwx3", @@ -957,7 +957,7 @@ "name": "State/Server Actions Menu — Owner-only disabled", "width": 520, "height": 220, - "hash": "084d3c44be860c4f1f1596bbffa8bd26b3ee33ad1f1cf56aaf6a7c82ed20331a" + "hash": "6ae847aa81d527b3219afe543a0e4a9c66f661890959404e8b581e7b1743712e" }, { "file": "IMSD5", @@ -965,7 +965,7 @@ "name": "Screen/Server Detail — Settings · Danger zone (Owner-only)", "width": 1440, "height": 900, - "hash": "e66a87db0524298b25b1f5b5de2857d0205f8bc3e0f64365c19df34252e8747d" + "hash": "344a618e6e61001f57f575fad7037394f219782275872e22497d5eaa7844e075" }, { "file": "gWqMD", @@ -973,7 +973,7 @@ "name": "Screen/Server Detail — Settings · Access (Read-only)", "width": 1440, "height": 900, - "hash": "26bd094dee1a974d369147d6533b356dff9b4319cc6637aa3825fbd3fc627305" + "hash": "f37bebc3f8427f1ef11f482a661656cbeb6663e34141de21b6fb9d50223a9352" }, { "file": "UCNBm", @@ -981,7 +981,7 @@ "name": "Screen/Servers — Cluster filters open", "width": 1440, "height": 900, - "hash": "973e0335c9b10c877a0596f64555a1047615f997621c024cdc00a433041e87f2" + "hash": "cdaf24768519798c3ad4f91d306d9c1599f807d954564b48c73357ad3e264b40" }, { "file": "pnAbF", @@ -989,7 +989,7 @@ "name": "Screen/Backups — Filters open", "width": 1440, "height": 900, - "hash": "4600f3b208a8b985197dc5fa4b188161f0bd90e5f7ca5e8975adc7469ee9dafe" + "hash": "932b7ad024f836c0d3dd978d90f655d6b872976aeec62c14b592ceece821a75e" }, { "file": "Cb3eC", @@ -997,7 +997,7 @@ "name": "Screen/Backups — Schedules filters open", "width": 1440, "height": 1150, - "hash": "1e343be6a281c9d6ffe19b2726dc75cfee83328ecd25171cefb618a1d0879f90" + "hash": "18b52c4ac65eb49f2c811228d334eb5a13cea95bfac7009d29e81a32baa9eb3f" }, { "file": "fbBqA", @@ -1005,7 +1005,7 @@ "name": "Screen/Backups — Restores filters open", "width": 1440, "height": 900, - "hash": "83f545230e2518b7cf9b6b31197f5d6360f16c290531ace3a8f07a91fb242cce" + "hash": "2f7a78346403fbbec634cdb1874fb2932f58a487fede596daada74e24b4a9b0a" }, { "file": "YPKbV", @@ -1013,7 +1013,7 @@ "name": "Screen/Dashboard — Partial cluster coverage", "width": 1440, "height": 1220, - "hash": "4da3f2ca4c06154c828172ce7e2d62f1b51ffbdb66b23bfafdef26747b2b274b" + "hash": "2698a3a73dbe50a7a5459775c70b39de39e556971e5fefb02e189bd9881c4984" }, { "file": "w1QYmf", @@ -1021,7 +1021,7 @@ "name": "States/Remote Capture — Access and capability", "width": 1160, "height": 559, - "hash": "480585c4734c77332910083b47bca6addac09c858db4e61e094bee178869802c" + "hash": "7a72bc234a1cb690fa73f67bea6d84114feda5f9b0d15903cb404f2001852b94" }, { "file": "SUtGZ", @@ -1029,7 +1029,7 @@ "name": "Screen/Mobile — Remote server Capture", "width": 375, "height": 900, - "hash": "e9f3dda7abf0aa5745b6a5661630f89b16f0622fcda8cd3c5c751cc9b92ebd62" + "hash": "c8bfad92be14ddb9db3b81a56fb9ad44771a4db470bb4e5992857f1f81275d48" }, { "file": "C5Aoe", @@ -1037,7 +1037,7 @@ "name": "Screen/Mobile — Servers filters open", "width": 375, "height": 954, - "hash": "fd6c5de82b08e8c35ddbda87d7e848a75ce552087703fdc4ba94f293e6d8cfce" + "hash": "f1559130a0842fe883ebae363a15a7caa16a1271c3cf6c0749e75b7d637cf82d" }, { "file": "NKiqf", @@ -1045,7 +1045,7 @@ "name": "Screen/Mobile — Backups filters open", "width": 375, "height": 844, - "hash": "5f33928175805ae5b7111b9fbd38f5e8061cd5fc069986674ad758b125c90bd9" + "hash": "e4a9d68f5c996156ad86223c1f6006a17cec0f1dd3f5f4f51f146110209e1237" }, { "file": "iYUWc", @@ -1053,7 +1053,7 @@ "name": "Screen/Clusters — Registered clusters", "width": 1440, "height": 900, - "hash": "ffa9b41348cd7e67bd0dfb0e160e0540d6da5d794f54601f5c7817d108705985" + "hash": "f9d6ac1cb4b960bb8bfa3f7db5d9b5f5a307beda85788d213781c4e93869e581" }, { "file": "oMuyw", @@ -1061,7 +1061,7 @@ "name": "Gameplane/Dialog/New File (Invalid name)", "width": 440, "height": 310, - "hash": "f39b26234a17afa6a93e3b38e5140a685f2cfffab9d8b5224a221e80e8975499" + "hash": "d01789829e07435bb8d7bd9ad186098946ad46063eb4e222345536ae6a8d3b29" }, { "file": "OC804", @@ -1069,7 +1069,7 @@ "name": "Screen/Server Detail — Settings · Game configuration", "width": 1440, "height": 900, - "hash": "89cc8602d135b1149a3e9942509291e28515031bdeafbf06da9d2d49735e4a3a" + "hash": "c82458076fe6e773819dcac5a61621aab21f8de4bb4995e2ce2d9aec4d61137b" }, { "file": "QFEg9", @@ -1077,7 +1077,7 @@ "name": "Screen/Server Detail — Settings · Game configuration (Invalid value)", "width": 1440, "height": 900, - "hash": "ef4aeb6aee530549ee7f68dbe54fc69ee215ab27a650f7130fd3954707fd90f3" + "hash": "52a3f8bf603c3001d0852a3e07c3fb59bb3dc5f7970d831ace5c963d465f7db7" }, { "file": "wxINm", @@ -1085,7 +1085,7 @@ "name": "Screen/Server Detail — Settings · Game configuration (Read-only)", "width": 1440, "height": 900, - "hash": "1835f066d24fa7f94f491d62048832e551ef788f2330dc6c6bc07d1438972420" + "hash": "8ded99fd5eed17d069f89263e261b589a309eaec832c5a9118bed7bdb5ec2c55" }, { "file": "e9FnC", @@ -1093,7 +1093,7 @@ "name": "Screen/Server Detail — Settings · Game configuration (Orphaned key)", "width": 1440, "height": 960, - "hash": "7fac7776001ff4f95f1505837ebfe8543c28b0177eb2d5c5bf2debc9160fc4ea" + "hash": "07f0371a65092c9ed2ed7940c98b6fe754db221b26b7493b5b7de9732b96bad2" }, { "file": "Ne5TA", @@ -1101,7 +1101,7 @@ "name": "Screen/Not Found", "width": 1440, "height": 900, - "hash": "fb539e64772b87d1f8307e84760ab6cdadc9e6185520e89941f55d01eddb661c" + "hash": "aa05a169edd581d965b357efd9e30751aee58cb59486eaf65f98cc1ed72d9691" }, { "file": "FBiMN", @@ -1109,7 +1109,7 @@ "name": "Screen/Share Link — Asleep (Start cooldown)", "width": 1440, "height": 900, - "hash": "f799f5fb13768a2cf560b04cdb3f3af4e028432c696e4b7eb0b440ac0ba59e0f" + "hash": "785aecc2d868259cd9272cd85b2e56a4973da2557f45780d32be26b34f598934" }, { "file": "zj5a3", @@ -1117,7 +1117,7 @@ "name": "Screen/Dashboard Home — Telemetry notice (default)", "width": 1440, "height": 1380, - "hash": "92d73b4eeb8a5e946e89a35e9ec59835f9db4e113b1b5b4429c9e4a67a3b148e" + "hash": "d806d82227b28fd2600a2399d80064e5724ff2fbd44ff1e2e7bb2e5dc6eeedc1" }, { "file": "l7TRz9", @@ -1125,7 +1125,7 @@ "name": "Screen/Admin Settings — Telemetry (default)", "width": 1440, "height": 1031, - "hash": "22b33a6afd1c0f61f73d4a4247bd5ab14c5687ad404d9f47b8584bc3ef692117" + "hash": "e835187c4dc88cb417539c9e4a8963bf7bdbdee8aefa506d8ec867ef26a48541" }, { "file": "GR1G9", @@ -1133,7 +1133,7 @@ "name": "Screen/Dashboard Home — Telemetry notice (bundled)", "width": 1440, "height": 1380, - "hash": "b3b823ee1a5d57c89e6576cc1629ef6dd00d52c81c9526261574f232803ad2eb" + "hash": "620f9b60a4e43e4c2909d847ab723b806f5ed45a5aae48b97ad9a57c66ffbdcc" }, { "file": "r0heh", @@ -1141,7 +1141,7 @@ "name": "Screen/Admin Settings — Telemetry (custom)", "width": 1440, "height": 1032, - "hash": "eed4ed586c6d2624f581db3d115556238ce1e3dfe25ccbb01e6a6bcd0bcc1bf6" + "hash": "bd2316abeb711eaf9ce7f55dd8f054348e3d008e0e36dca730a2124fba36a4d4" }, { "file": "cDiNb", @@ -1149,7 +1149,7 @@ "name": "Screen/Admin Settings — Telemetry (bundled)", "width": 1440, "height": 777, - "hash": "c2507e650254e40df6451850285f048ae18a87463b5748eb5b6f063319083cbf" + "hash": "af2e5b90e26c6b5f226a86a80e95f3bf412dee919600e16374de3db8bc46b382" }, { "file": "DBQyF", @@ -1157,7 +1157,7 @@ "name": "Screen/Admin Settings — Telemetry (disabled)", "width": 1440, "height": 641, - "hash": "e2d9e9feb18817c92b305a87bbbd84092ab7fc861546d86ca3b1e004253415b8" + "hash": "e042daafd867376a962ceb4645f9d567e45073089536c8e3e51f494c9615157e" }, { "file": "K5XinZ", @@ -1165,7 +1165,7 @@ "name": "Screen/Admin Settings — Telemetry (none)", "width": 1440, "height": 605, - "hash": "a5343f63ef156ea5061bf1373608e1b396259de1c9b852f6900ae68ad5ca2a98" + "hash": "ea77966cd2c54aa0f43ac72939c128bfedd00a573884ead1ec7be5ef9e7d89ac" }, { "file": "yrxK2", @@ -1173,7 +1173,7 @@ "name": "Screen/Admin Settings — Telemetry (Reset ID confirm)", "width": 1440, "height": 1031, - "hash": "ae7ebd68d409f6baa0453d7fe158c9f7975452bf5bf1754633a3cb26ec0b6740" + "hash": "9237e3356d3734c37f37af64b1b18c6b08816e0beceec5f88b8d34103ce1e0a0" }, { "file": "n2qdi", @@ -1181,7 +1181,7 @@ "name": "Screen/Standalone — Clusters (Empty)", "width": 1440, "height": 900, - "hash": "5432e815de6fafdad333834c52d5efb90f424355734b6205e11a33348597db60" + "hash": "77a1c1be371b77d2ba2de4a362098b22debb1684f4cbfc95d1d77759b70ff4d2" }, { "file": "WrmU5", @@ -1189,7 +1189,7 @@ "name": "Screen/Standalone — Clusters (Registered)", "width": 1440, "height": 900, - "hash": "c554153129e7b3ca68bcfa1b8028f37b91538d11f8ee50e81b48e29267c07864" + "hash": "5be09472e646dfaef6987f725cb170c283c5ee6d159659f39f73fc9762e1045a" }, { "file": "Be7ZW", @@ -1197,7 +1197,7 @@ "name": "Legacy/Standalone — Cluster inventory selection — Superseded", "width": 1440, "height": 900, - "hash": "9572a5e316ff1ff5cb6fdb544d67431292a6d3b00f06d43e68bc4cd8b8301711" + "hash": "9d610fd0f3db173a0a11d93a11b1a221d93aadb0a7f0b98104a7dfcb863b54c0" }, { "file": "Z0oyh", @@ -1205,7 +1205,7 @@ "name": "Screen/Standalone — Modules (No selection)", "width": 1440, "height": 900, - "hash": "919e9aee206cd238f5d1efb5ff0ad07a7fc006f6d940142490324c9f3588f166" + "hash": "08ec9ad8f00747cd4d00bb4d6ba89caee9b35ec03c12014eafedc247b664cc92" }, { "file": "ZlLf0", @@ -1213,7 +1213,7 @@ "name": "Screen/Standalone — Modules (Permission denied)", "width": 1440, "height": 900, - "hash": "cefdee519450fd345c3851ebe2a82d48cb6cacc17cbeb649e17fb8781d4aa17e" + "hash": "b4d037f678e68a1da3876eec5f1e52217a5d3bbdf0975b831d730b2965a4480d" }, { "file": "RpHBg", @@ -1221,7 +1221,7 @@ "name": "Screen/Standalone — Register cluster", "width": 1440, "height": 900, - "hash": "2a788d3b07b0fee2c25d81f7095d3f5e716bb15eb05e93e03bfe72a9be8fd7a3" + "hash": "85d4a86132983e3d8acfd24e142ddc62e12bde4e4ffd8c647ef4126e4af9d4d7" }, { "file": "HVhmb", @@ -1229,7 +1229,7 @@ "name": "Legacy/Clusters list — Remove registration — Moved", "width": 1440, "height": 900, - "hash": "0ccd17018552f9a64227aca0c76f650fad10625114a9dbb050969399f9d7d59c" + "hash": "75e41bea36535221f80243a7b7ff3937d55a9a1e04c20d7fe0775bb6db70bbcc" }, { "file": "RS0KZ", @@ -1237,7 +1237,7 @@ "name": "State/Standalone — Cluster selection and request states", "width": 1440, "height": 732, - "hash": "894c8b225fa508186aac833b32647d4cac756819015b08e14269ac82b7f4a28b" + "hash": "d2e53e194fe094ec398ac3acf7833f123888f025c64f606438ede3af32e58ff5" }, { "file": "D9QYZ", @@ -1245,7 +1245,7 @@ "name": "Legacy/Standalone — Backup destinations — Moved", "width": 1440, "height": 900, - "hash": "70d3f2e75655567e5956e29ae70022b30290d5ab979b8f995dfe8b230781c205" + "hash": "5730e594521a249b00c536f14baf9031f6b44719815ebb6570584c3c92db2c5c" }, { "file": "l64bd", @@ -1253,7 +1253,7 @@ "name": "Screen/Standalone — Settings · Module sources", "width": 1440, "height": 900, - "hash": "8ace63ab0ab278f91b874c1438fba9ef95029dd3310b9a031578b7d70071d357" + "hash": "c3397377299a9eb8e891cf38a6f408d1273239559505328f7e5271b4255190f4" }, { "file": "Uzzje", @@ -1261,7 +1261,7 @@ "name": "Screen/Standalone — Settings · Updates", "width": 1440, "height": 900, - "hash": "acb100b65838cb0f896fa253aac942245c9631473b654f52985fd8d75650c69c" + "hash": "3c1f181213c96c2a7bb24f6b4d6a20ff3ba3bac84c5c8fdae03cd340bc1d948e" }, { "file": "FOVMf", @@ -1269,7 +1269,7 @@ "name": "Screen/Standalone — Settings · About", "width": 1440, "height": 900, - "hash": "22ce54f0e5c9e029e484f8c3aaba6bade7371171578fc5f83e92c588e5fa2305" + "hash": "248cb8b49735a09188b1b2abee96f3a436c20b7b96317651707d554f526c2caa" }, { "file": "r139UP", @@ -1277,7 +1277,7 @@ "name": "Screen/Standalone — System logs", "width": 1440, "height": 900, - "hash": "3a6fada445b92f1dcec79d63eb3713845afd2178e95310a1faee4247f03895fc" + "hash": "4dab3f9c27c1b897bb8e9818ecc72eb3cd28b24b8f494d319a1e1f057660a498" }, { "file": "EWrn0", @@ -1285,7 +1285,7 @@ "name": "Screen/Standalone — Modules (East selected)", "width": 1440, "height": 1900, - "hash": "db5cbda1dfb70027b56e4404f6d1886f2dcb2137483f6a6cbc62e97e24d29a38" + "hash": "9b567d8086225e3b68bf32cebc03bb1eb5cad109169ec8de964454dc25a05c18" }, { "file": "p8QSPq", @@ -1293,7 +1293,7 @@ "name": "Screen/Standalone — Modules (Manage sources)", "width": 1440, "height": 2050, - "hash": "8aa07d41e315a9eb9e97acdadc6e34a4d1f7ff5d94d19acf8cf33085cef3da9c" + "hash": "db1b8cf242a1968e00ac2b49747a0829f07721b35b44a4bf022c2e545b6f7fbd" }, { "file": "aMU7O", @@ -1301,7 +1301,7 @@ "name": "Gameplane/Dialog/Edit user — Standalone (No target)", "width": 480, "height": 643, - "hash": "8335d3784492bb33b4dc87f032329ebd1d92546ea64e84cde72ea2d1ec2d3cd0" + "hash": "8f82f8d42a8b99898e1d8ddc84a3e654afef4acbd63ffad6973b097cc74a1402" }, { "file": "C9bR6", @@ -1309,7 +1309,7 @@ "name": "Gameplane/Dialog/Edit user — Standalone (Remote grant)", "width": 480, "height": 643, - "hash": "36e14a509259f556d549468b011f66239de904a2d8a11be9ff07f154521da0cf" + "hash": "85a7db8a2ffaa8ea1a0e125d73290562dc87d727887cf2ec1e1ad9329a68afb6" }, { "file": "w34N9", @@ -1317,7 +1317,7 @@ "name": "Screen/Standalone — Dashboard (No workload clusters)", "width": 1440, "height": 1150, - "hash": "4f79bddfee05094aad77035877b7913e81399a0390dcc9d2b3154bbce64c2b7f" + "hash": "f731b3bf98f67518051bbd98c5c571f9a4a20c1d8f05f5686d1d8502af4123ac" }, { "file": "U9xSg", @@ -1325,7 +1325,7 @@ "name": "Screen/Server Detail — Players (Nuclear Option)", "width": 1440, "height": 900, - "hash": "d60d78d784fe57cfa0be157f58b7d5f698771ff5e7b007b15dee598add760ee8" + "hash": "0feb96d6e6aee5415a987d4c730a7e7d879204723e89dafebd837486e4e26ef0" }, { "file": "BguST", @@ -1333,7 +1333,7 @@ "name": "Screen/Server Detail — Settings · Game configuration (Password will be removed)", "width": 1440, "height": 900, - "hash": "3526e3040470cc732527424096ae6d0bc3ce885961bc1e2615fec9ffbea0828b" + "hash": "c4eaa7cf09bd3564a004e0cbb0894ec11408fe724eed92547fca632bc7d8ca8c" }, { "file": "YN8cE", @@ -1341,7 +1341,7 @@ "name": "Screen/Server Detail — Settings · Game configuration (New password typed)", "width": 1440, "height": 900, - "hash": "aa12aeb34950dfbae6756b749092bf446f498c17f72ebd500f73927b60e60fba" + "hash": "cee44b9bd498c798dbe4ac4e16af60473bd37808d67901f519eb3301484abd66" }, { "file": "GsofJ", @@ -1349,7 +1349,7 @@ "name": "Screen/Login — Language menu open", "width": 1440, "height": 900, - "hash": "822f7b2a666c52548d0b35b07514a2721a3a82b3136c248bb088fb57de575103" + "hash": "d7e66f08776b94a3cb64b7a6e40bb7312acd25e40b27e119de972793acfa09d2" }, { "file": "lCTci", @@ -1357,7 +1357,7 @@ "name": "Screen/Mobile — Theme Settings · Language", "width": 390, "height": 972, - "hash": "e6b4fe80ee9acff37f10f9dee4e073bc8f8ad4070a03870b2c4932ce125de98f" + "hash": "dbc02ab13bdb74e7c8638338e920e71aa4dc68cd47305377c919fa6774445b20" }, { "file": "SUcad", @@ -1365,7 +1365,7 @@ "name": "Screen/Admin Settings — Notifications (Add sink)", "width": 1440, "height": 965, - "hash": "5f3e404fd5868fa1dfc7f9eef04a395f8275ad5cb831d1bd9086831770adfed6" + "hash": "98f7d40f649a9ed436614a5114f35b26b7c87b76dc167e0806041890f28e90e3" }, { "file": "NqaaU", @@ -1373,15 +1373,15 @@ "name": "Screen/Server Detail — Settings · Resources (Reserve less on)", "width": 1440, "height": 1000, - "hash": "db60984f3e255011c97e08f24ea5982bb12deb659e2287f080ca7fe363a32bce" + "hash": "df6b39d7fbde902f55ae27856e6eaa3e432eb5b2da7d06ee9417763f15f632af" }, { "file": "NLu2I", "figId": "1:10655", "name": "Screen/Create Server — Step 3 Configure (Reserve less on)", "width": 1440, - "height": 2083, - "hash": "31137047f551e8308a6c7e7cf77118d122633db90ace784e4503c0fb908d9924" + "height": 2214, + "hash": "da4e3e87df6b1c49b0abb1ec9c5145fb65c78744d6dc0ad9aec4ea07aa6ee7d1" }, { "file": "A8vGwM", @@ -1389,7 +1389,7 @@ "name": "Screen/Server Detail — Settings · Lifecycle (Wake on connect unavailable)", "width": 1440, "height": 1620, - "hash": "46497425602c942d18f421d698031175200f7922f0ea80f6c8795def565c66e8" + "hash": "21ea5ed39afc843039e0b07ee83482cea73283b5eb84fbc88e8dbbb1ab7db76c" }, { "file": "BdmAW", @@ -1397,7 +1397,7 @@ "name": "Screen/Nodes — All clusters", "width": 1440, "height": 900, - "hash": "b97267555d9e11855ae244105b9555b408976f21a03719db12407a258493d739" + "hash": "d4d2101983cd559717492651a20a3556099bb9ff910f7a07ad05e59a7b9bd80c" }, { "file": "wqnM9", @@ -1405,7 +1405,7 @@ "name": "Screen/Cluster Details — Overview", "width": 1440, "height": 900, - "hash": "9eef21b9683629a20174f71d17079a3340c494b2cfd31bbd3d660519ba14f8ab" + "hash": "63d0d9b2a72e4fb0e703744b5af5a0feee8aea57c988817f1f000f7b5c90a3ce" }, { "file": "J8GzM9", @@ -1413,23 +1413,23 @@ "name": "Screen/Cluster Details — Nodes", "width": 1440, "height": 900, - "hash": "fc907032879b89504c87988800a4e0bf5a7680893d46953d05895d844bd2d946" + "hash": "ac6283aeb942b75ca69521d6a44511be83a71e6339ce31b86fcc1b963d7bafa7" }, { "file": "OecJ5", "figId": "1:11004", "name": "Screen/Cluster Details — Configuration — Local", "width": 1440, - "height": 1060, - "hash": "42740607d0cb7f116e339a6798fbb30b9c6023ad375fa3aea1f8c24ba57afaa0" + "height": 1293, + "hash": "ac8040db33aeba612c5e05ec06cc829916198dc57ea477875077b2266f454f5c" }, { "file": "t56aLu", "figId": "1:11035", "name": "Screen/Cluster Details — Configuration — Remote", "width": 1440, - "height": 1060, - "hash": "34cbfa4dbf9ca1227728ddd5649708bbfe518883fe844d4c0ffab812bac0e3b0" + "height": 1293, + "hash": "6c80ba606798fb1521943c9630e5d568555b19d13868da8df20cf0b16ea67e25" }, { "file": "IBUqJ", @@ -1437,7 +1437,7 @@ "name": "Screen/Nodes — Add node target", "width": 1440, "height": 900, - "hash": "a3fa15e4cc280df2abb961fd4ef0004e830628b858040eaf41c31c3af3af6715" + "hash": "3b767e90650a439a817a92a8db4ba4fd26c2469fd0f31a3196ebe8b127f99ec4" }, { "file": "N2nTf", @@ -1445,15 +1445,15 @@ "name": "Screen/Mobile — Nodes — All clusters", "width": 390, "height": 1620, - "hash": "561346b318dd7169425f0f811583ae23294607303f522ee528d86485b04d8734" + "hash": "097c798897b91f098c42a7d157703f690fc000bbbffb16c8225cc84af3cb9a31" }, { "file": "T70dJ", "figId": "1:11192", "name": "Screen/Cluster Details — Configuration — Default storage", "width": 1440, - "height": 1060, - "hash": "6a8217c21fb6a46e170005ffebd52abf6f690210ec3d03f68381774be59e65d8" + "height": 1293, + "hash": "51cd26a96588fb3edd332f22cb533d090a75a10f6ee2a1a41f465a99027e1976" }, { "file": "KJdxg", @@ -1461,7 +1461,7 @@ "name": "Screen/Server Detail — Settings · Minecraft JVM startup", "width": 1440, "height": 980, - "hash": "d5b597ec11c29ee7618179b64260095c1b99f7750687961a1bbdd672ebf8ff11" + "hash": "cce282a651d5d7afe160fe3c3c5dee881f2ebcbb5c5c819f9559923a18b4f08e" }, { "file": "ZUAq1", @@ -1469,7 +1469,7 @@ "name": "Screen/Server Detail — Settings · Minecraft JVM heap validation", "width": 1440, "height": 980, - "hash": "4213f28a22ebf2c7b13d03a2a161f3b47661270141da2814cd62d404faa2b41f" + "hash": "bf09904461ae52c3046b294e20edbbd27789d170e5e5aacfc62a66daaf093e39" }, { "file": "o1uEP", @@ -1477,7 +1477,7 @@ "name": "Gameplane/Dialog/Create ZIP", "width": 448, "height": 196, - "hash": "217bdc3dec6477cf41e6b15563f17732aa80108da24b11df4cd23e82fedbdaf9" + "hash": "7e2fe9db3d1bf8c9c210d1ecb86eb654c2e95258aa776d0ab636fc9273336c2b" }, { "file": "UdnBT", @@ -1485,7 +1485,7 @@ "name": "Screen/Admin Settings — Authentication (Role rules)", "width": 1440, "height": 2600, - "hash": "6291bd302368dc897f1450e8c0f7600ec97fc274a1fa541bdca9c54f45e89fa4" + "hash": "9bbf22ebe9b1df2b1820cfabf298b6f85cdf92a31d12c558a28fdd6f8756e07f" }, { "file": "mrF6f", @@ -1493,7 +1493,7 @@ "name": "Screen/Admin Settings — Authentication (Role rules empty, not overridden)", "width": 888, "height": 649, - "hash": "434b93fd661227aa0e88c60179ae7cdfa00a24fca14319f9bebddaa309a7c4ed" + "hash": "7589ebd89f62b7f6ad8828181ddf15d9e5bd888332dfb8361a01bfd93a57b9c7" }, { "file": "rJt1I", @@ -1501,7 +1501,7 @@ "name": "Screen/Users & RBAC — Role source", "width": 1440, "height": 900, - "hash": "f513f92d014998603a49157250f88235ee3eae4984e3a92358ff1b4f3f3a1ac7" + "hash": "13fd85c16c9a566721bc624178b39579562988e75051978e2faaa68b105c36dd" }, { "file": "pszxE", @@ -1509,7 +1509,7 @@ "name": "Users & RBAC — Return to SSO control dialogs", "width": 1040, "height": 721, - "hash": "84a948e631fc413f98e357201734df4fbed2e390da2fcc4b686b5e363c5d87ec" + "hash": "93b9948a30fb97f91dc4c9d0c07255a763a88e9de4cfaedfec106fd3bdb26695" }, { "file": "1274632774-130", @@ -1517,7 +1517,7 @@ "name": "Screen/Server Detail — Modpacks (Active pack)", "width": 1440, "height": 900, - "hash": "d429178a20382d8f86e134555c894a00e6df525f195f15dfac4e22cbfcb1e813" + "hash": "9da037830fc58c0ada631ca68a5f03bc9f2e6be7490659be466dd09b1f217d02" }, { "file": "1274632774-470", @@ -1525,7 +1525,7 @@ "name": "Screen/Server Detail — Modpacks — Choose version", "width": 1440, "height": 900, - "hash": "ef19dd5ba4807de89fc7ca4d0a5750d7321cebfdab87e7bf6f93f5a6bb5435de" + "hash": "75f64bd867cd9acbc5c5980fb0df2838a23c083a716b017889de71acd363b87e" }, { "file": "1274632774-907", @@ -1533,7 +1533,7 @@ "name": "Screen/Server Detail — Modpacks — Confirm install", "width": 1440, "height": 900, - "hash": "de11282e674930bc225223efd2bd3287b97ea7b4824442fda3d95bf135f18810" + "hash": "edfdcf766b22d2795236b968f0c256006768d2bd0699795de09baa9fe3d72abd" }, { "file": "1274632774-1258", @@ -1541,7 +1541,7 @@ "name": "Screen/Server Detail — Modpacks — Change version", "width": 1440, "height": 900, - "hash": "7da15fe69729f5403561e986659f355f413eb5a8d60168404ff8c099204d7e34" + "hash": "fd649681eb2573f6560496dfcb12e6d3e6d1a77b787dd219778268188cafbd3c" }, { "file": "1274632774-1722", @@ -1549,7 +1549,7 @@ "name": "Screen/Server Detail — Modpacks — Confirm downgrade", "width": 1440, "height": 900, - "hash": "5724aa960aaa4a1d7404c9f236cdaebb42721623d284fc866a5fee9c55e33ecf" + "hash": "70e4f1323976da87a5c25b3a0c1e32a0934510923c261c5935cb64179837c4e4" }, { "file": "1274632774-2112", @@ -1557,7 +1557,7 @@ "name": "Screen/Server Detail — Modpacks — Remove", "width": 1440, "height": 900, - "hash": "0fb7382bbf785071f25ac5401e505a400e14ce8e83f799ab2a4939f43be71e43" + "hash": "21bf68892ce979a6ecd7b25e92c5b2271f08c7abe9d86b5a286837edea3fad2c" }, { "file": "1274632774-2492", @@ -1565,7 +1565,7 @@ "name": "Screen/Server Detail — Modpacks (Missing files)", "width": 1440, "height": 1080, - "hash": "101ee890f9adaaee2940b7167751237cb9ee959c3cf88f012df58a243e89fd5d" + "hash": "00e8189cdf79908d5962a6c47d86bd62a13df447a5c566448d9b45f30e806db3" }, { "file": "1274632774-2877", @@ -1573,7 +1573,7 @@ "name": "Screen/Server Detail — Modpacks (Active pack, Light)", "width": 1440, "height": 900, - "hash": "a4c4f626d452d7c1811c9415d9f7615de01f4f58bf665e321e82cec82145eb3e" + "hash": "8faafdec17dc03b73e08dab6bf809b2d97e20e163f63b511a0e0b379a8555dd9" }, { "file": "1274632774-3217", @@ -1581,7 +1581,7 @@ "name": "Screen/Server Detail — Modpacks (Read-only)", "width": 1440, "height": 900, - "hash": "4b061d82c2ca6294e680bb14d472d86927014294ff2341f4122d16d6b0c57031" + "hash": "bb6ab213388ca4c23534787c93331674b9988fc7d3cf6449c1d72cfc8b2b89c1" }, { "file": "1274632774-3559", @@ -1589,7 +1589,7 @@ "name": "States/Modpacks — Active card and tab states (reference)", "width": 2280, "height": 1158, - "hash": "ba3f19442766bdbfb3809be801f1ca7929440e0724f4c9dc37d5b50f67da927e" + "hash": "870444c793eea6acc6e378d042058355176a816e3936555e7d14f8d36819f73d" }, { "file": "1274632774-3890", @@ -1597,7 +1597,7 @@ "name": "Screen/Mobile — Server Detail — Modpacks", "width": 390, "height": 1100, - "hash": "57ab9d1405ab0fc49826c6ae75eac1faa43309e6af4090aa4d802e3a35250539" + "hash": "54c37d7b8245cc26a02bb9bd1603bc15a633495120a953209ad0d701c13ba545" }, { "file": "1274632774-4001", @@ -1605,7 +1605,7 @@ "name": "Screen/Admin Settings — Mod registries (Share CurseForge key)", "width": 1440, "height": 900, - "hash": "f39a0cd563e42fa2b91acf70e6c13239c593413a8bbd0bc9e342d96407169b08" + "hash": "67b4995fb4d5a71da8d7459e62c5467f76011318bcebd3315462d80871b09e6f" }, { "file": "1274632774-4260", @@ -1613,7 +1613,7 @@ "name": "Screen/Admin Settings — Mod registries (Key from startup flag)", "width": 1440, "height": 900, - "hash": "2efb7c6f3ae8975a13cfcabee7817ae95f97488cc90b06cbd4706128e8bfec37" + "hash": "60da886e6958ab6e8417d242edcec688042f37fa5dc7f51b63ec3175942d4995" }, { "file": "1494270493-26", @@ -1621,7 +1621,7 @@ "name": "States/Backup schedule — Edit with restricted snapshot strategy", "width": 1524, "height": 582, - "hash": "3e879bca2e1d962daa7e2ed892b12e477a59adaf73e43d3d74f222d39d991304" + "hash": "112ea1ab66477f6a8c927a5bc0f82647bbfdcb98efb0937bd23b42c0e564fa65" }, { "file": "46479436-2", @@ -1629,7 +1629,7 @@ "name": "Gameplane/Dialog/Back up now (No destinations)", "width": 480, "height": 279, - "hash": "ef8e584d5c161f9b6c82d180f7ba8b5ec42b52ef2026d919e0e8d4681b1df2c8" + "hash": "a4bf75132b68f8f9d73662106d9fd04d4b232cacb58b848083c9a25f6fa1de5f" }, { "file": "2044649516-13", @@ -1637,7 +1637,7 @@ "name": "Screen/MCP Tokens", "width": 1440, "height": 900, - "hash": "6cf40db14283d3d67732605065e31ad812529484cf015e12fcb7516738d73f81" + "hash": "977729dda33c42ada5ae2ad39740192ffb4a3786c6ab14791e4cea05db28c49d" }, { "file": "2044649516-579", @@ -1645,7 +1645,7 @@ "name": "Screen/MCP Tokens — Empty", "width": 1440, "height": 900, - "hash": "f5ea51dd7129f4a01fee981182218cdb9e83f2aefc98719be8fd832671f144bb" + "hash": "93d85316117bdfe07601e62392ae3c1b4f76e288759f895b6b6f9b254f006cfc" }, { "file": "2044649516-1099", @@ -1653,7 +1653,7 @@ "name": "Screen/MCP Tokens — Create", "width": 1440, "height": 900, - "hash": "bd41f99d477e43fa5ee8f8f74572fc1f5b9eb2a507373d242b1a2cf4155b75ed" + "hash": "bdf8ecfeb20825c19662e9f5e8449dc1b2454eb435fa2773f3c03d2b82e6e313" }, { "file": "2044649516-1687", @@ -1661,7 +1661,7 @@ "name": "Screen/MCP Tokens — Created", "width": 1440, "height": 900, - "hash": "bcedef15c94231251414ebe7dbbbe799a5635e4ed484d7222cad4c6735e3e0e2" + "hash": "3e1b1825152a07f1e9a930f15a98cffdb7f9b5f4743080ac09a36e9adf2c9965" }, { "file": "2044649516-2282", @@ -1669,7 +1669,7 @@ "name": "Screen/MCP Tokens — Revoke", "width": 1440, "height": 900, - "hash": "9f503636d52d90e1e2942c0308d92401d1f6504d9965cce1c16fbc4079842379" + "hash": "bfbed148ff6ae45a4b2c79daeb7fa74ba45fb006e99a4674e057895d0694ce01" }, { "file": "2044649516-2862", @@ -1677,7 +1677,7 @@ "name": "Screen/Mobile — MCP Tokens", "width": 390, "height": 844, - "hash": "534b00d94ec3c5e0f15fdca1be4ee3141661f6833b3daad1ef81e88180c563c8" + "hash": "d39d85036286830609a9322a65a241af9d399f6a0c8bfa5eab7c46003db78b37" }, { "file": "2044649516-2982", @@ -1685,6 +1685,150 @@ "name": "Screen/Users & RBAC — MCP tokens", "width": 1440, "height": 900, - "hash": "16f72026a432d363cfc1c022ed7bd2fe95764e66d1286bf16d7ac449f47e1031" + "hash": "8729ed0ebf9a2df8a2c455b2be45c1130c9792abd994c6b50557789e916b7b4b" + }, + { + "file": "901437436-1", + "figId": "1:39947", + "name": "Screen/Server Detail — Settings · Security", + "width": 1440, + "height": 1001, + "hash": "cf78d87af59411e26e9fd4e8fc6f25368ddd8d51410874a9587ede7d925125d0" + }, + { + "file": "901437436-465", + "figId": "1:39948", + "name": "Screen/Server Detail — Settings · Security (Light)", + "width": 1440, + "height": 1001, + "hash": "bea86ea26661de2882019cba4e88be65977e8868a9c918161d9de3059b2c738a" + }, + { + "file": "901437436-929", + "figId": "1:39949", + "name": "Screen/Server Detail — Settings · Security (Image default, no effect)", + "width": 1440, + "height": 925, + "hash": "597971cef574d46465e3b99030ef905b34754a81dcf4d0dde95f48e8a406673c" + }, + { + "file": "901437436-1393", + "figId": "1:39950", + "name": "Screen/Server Detail — Settings · Security (Read-only)", + "width": 1440, + "height": 900, + "hash": "76af85e27648ed1f5800be71e192609cd56f7943b893424851f337859b5ee6d1" + }, + { + "file": "901437436-1857", + "figId": "1:39951", + "name": "Screen/Server Detail — Settings · Security (Held back, stopped)", + "width": 1440, + "height": 1017, + "hash": "a8b93bf7261472a731f1830326b4f8554f09e8f3fe580bb5eea0d703070e0332" + }, + { + "file": "901437436-2321", + "figId": "1:39952", + "name": "Screen/Server Detail — Settings · Security (Held back, running)", + "width": 1440, + "height": 1017, + "hash": "1110fb58875a4f5ef9dffe919206da76bc2b74b369b287e1b2c07aa77fbb92d0" + }, + { + "file": "901437436-2785", + "figId": "1:39953", + "name": "Screen/Server Detail — Settings · Security (Refused)", + "width": 1440, + "height": 1041, + "hash": "20481c1fb94189a05a93dfb4e873959144fdf4c17c0bee56f1787788e27a3c83" + }, + { + "file": "901437436-3249", + "figId": "1:39954", + "name": "Screen/Server Detail — Settings · Security (Forbidden)", + "width": 1440, + "height": 1001, + "hash": "f16e6e6916929287c52a8459c38fe78a6bd431be2b1c03094e0543c81a8dfe45" + }, + { + "file": "901437436-3713", + "figId": "1:39955", + "name": "Screen/Server Detail — Settings · Security (File-access warning)", + "width": 1440, + "height": 925, + "hash": "98f4f09f2cffe1e9f23a5221d7f1eb43bea5bf5a9ce34d6d125c234c40587b5d" + }, + { + "file": "1163467012-2214", + "figId": "1:39956", + "name": "Screen/Mobile — Server Detail — Settings · Security", + "width": 375, + "height": 1352, + "hash": "64461be5537086f9c4cbf157ebdecde593c75b3e0fd326970c8c967e5516c26f" + }, + { + "file": "1163467012-259", + "figId": "1:39957", + "name": "Screen/Create Server — Step 3 Configure (Advanced security open)", + "width": 1440, + "height": 2461, + "hash": "f0d7643d62592e98e931003d0a7525c1c5bbc0325b6460e3136907b101bcc5b0" + }, + { + "file": "1163467012-906", + "figId": "1:39958", + "name": "Screen/Create Server — Step 3 Configure (Advanced security refused)", + "width": 1440, + "height": 2552, + "hash": "5ac73ac88d5da031b649d946b7cadfb4ac7fc3adda5875001fb1cf6166973c14" + }, + { + "file": "1163467012-1553", + "figId": "1:39959", + "name": "Screen/Create Server — Step 3 Configure (Risky value confirmation)", + "width": 1440, + "height": 2461, + "hash": "fecdbc3537b639b1646916700f6413324a87ccbd11772a35f4609c624eb6c5fd" + }, + { + "file": "1163467012-2492", + "figId": "1:39960", + "name": "Screen/Cluster Details — Configuration — Remote (Allow root on)", + "width": 1440, + "height": 1293, + "hash": "5b1f5b1e4a37a219b3091e359c4ea66d9e76ca518dde34452c6b8b85a5c84518" + }, + { + "file": "1163467012-2680", + "figId": "1:39961", + "name": "Screen/Cluster Details — Configuration — Remote (Security settings missing)", + "width": 1440, + "height": 1385, + "hash": "8c0535780c746024d0365bb64ffb9f33dd62c76bd70d183430887fdc8b5cb04f" + }, + { + "file": "1163467012-2868", + "figId": "1:39962", + "name": "Screen/Cluster Details — Configuration — Remote (Light)", + "width": 1440, + "height": 1293, + "hash": "a590259ba18837bd668f4b50a1ed258ab113f251405f57a37354836d52eb677a" + }, + { + "file": "1163467012-3056", + "figId": "1:39963", + "name": "Screen/Standalone — Register cluster (Control-plane namespace edited)", + "width": 1440, + "height": 900, + "hash": "aca8fbc83f2c1f139aecfcb1a320b0735c8198adaf71765b21c6ad9e40615347" + }, + { + "file": "1163467012-3228", + "figId": "1:39964", + "name": "Screen/Standalone — Register cluster (Invalid control-plane namespace)", + "width": 1440, + "height": 900, + "hash": "56a24ac97bb6f656ac2f252dfad133e1639793badf3031c495497c3512b89d4c" } ] diff --git a/assets/design-export/screenshots/1163467012-1553.png b/assets/design-export/screenshots/1163467012-1553.png new file mode 100644 index 000000000..bd6370872 Binary files /dev/null and b/assets/design-export/screenshots/1163467012-1553.png differ diff --git a/assets/design-export/screenshots/1163467012-2214.png b/assets/design-export/screenshots/1163467012-2214.png new file mode 100644 index 000000000..9140ce4a9 Binary files /dev/null and b/assets/design-export/screenshots/1163467012-2214.png differ diff --git a/assets/design-export/screenshots/1163467012-2492.png b/assets/design-export/screenshots/1163467012-2492.png new file mode 100644 index 000000000..aa0f0256c Binary files /dev/null and b/assets/design-export/screenshots/1163467012-2492.png differ diff --git a/assets/design-export/screenshots/1163467012-259.png b/assets/design-export/screenshots/1163467012-259.png new file mode 100644 index 000000000..bba03590a Binary files /dev/null and b/assets/design-export/screenshots/1163467012-259.png differ diff --git a/assets/design-export/screenshots/1163467012-2680.png b/assets/design-export/screenshots/1163467012-2680.png new file mode 100644 index 000000000..be3c0a2d9 Binary files /dev/null and b/assets/design-export/screenshots/1163467012-2680.png differ diff --git a/assets/design-export/screenshots/1163467012-2868.png b/assets/design-export/screenshots/1163467012-2868.png new file mode 100644 index 000000000..307fb1d64 Binary files /dev/null and b/assets/design-export/screenshots/1163467012-2868.png differ diff --git a/assets/design-export/screenshots/1163467012-3056.png b/assets/design-export/screenshots/1163467012-3056.png new file mode 100644 index 000000000..027a050d0 Binary files /dev/null and b/assets/design-export/screenshots/1163467012-3056.png differ diff --git a/assets/design-export/screenshots/1163467012-3228.png b/assets/design-export/screenshots/1163467012-3228.png new file mode 100644 index 000000000..4c964be58 Binary files /dev/null and b/assets/design-export/screenshots/1163467012-3228.png differ diff --git a/assets/design-export/screenshots/1163467012-906.png b/assets/design-export/screenshots/1163467012-906.png new file mode 100644 index 000000000..fe4abe405 Binary files /dev/null and b/assets/design-export/screenshots/1163467012-906.png differ diff --git a/assets/design-export/screenshots/901437436-1.png b/assets/design-export/screenshots/901437436-1.png new file mode 100644 index 000000000..1571a5e61 Binary files /dev/null and b/assets/design-export/screenshots/901437436-1.png differ diff --git a/assets/design-export/screenshots/901437436-1393.png b/assets/design-export/screenshots/901437436-1393.png new file mode 100644 index 000000000..acc7d7853 Binary files /dev/null and b/assets/design-export/screenshots/901437436-1393.png differ diff --git a/assets/design-export/screenshots/901437436-1857.png b/assets/design-export/screenshots/901437436-1857.png new file mode 100644 index 000000000..54d290d76 Binary files /dev/null and b/assets/design-export/screenshots/901437436-1857.png differ diff --git a/assets/design-export/screenshots/901437436-2321.png b/assets/design-export/screenshots/901437436-2321.png new file mode 100644 index 000000000..e7f52013d Binary files /dev/null and b/assets/design-export/screenshots/901437436-2321.png differ diff --git a/assets/design-export/screenshots/901437436-2785.png b/assets/design-export/screenshots/901437436-2785.png new file mode 100644 index 000000000..d7defcadb Binary files /dev/null and b/assets/design-export/screenshots/901437436-2785.png differ diff --git a/assets/design-export/screenshots/901437436-3249.png b/assets/design-export/screenshots/901437436-3249.png new file mode 100644 index 000000000..1e483df95 Binary files /dev/null and b/assets/design-export/screenshots/901437436-3249.png differ diff --git a/assets/design-export/screenshots/901437436-3713.png b/assets/design-export/screenshots/901437436-3713.png new file mode 100644 index 000000000..761015b17 Binary files /dev/null and b/assets/design-export/screenshots/901437436-3713.png differ diff --git a/assets/design-export/screenshots/901437436-465.png b/assets/design-export/screenshots/901437436-465.png new file mode 100644 index 000000000..49011250f Binary files /dev/null and b/assets/design-export/screenshots/901437436-465.png differ diff --git a/assets/design-export/screenshots/901437436-929.png b/assets/design-export/screenshots/901437436-929.png new file mode 100644 index 000000000..18541d9d9 Binary files /dev/null and b/assets/design-export/screenshots/901437436-929.png differ diff --git a/assets/design-export/screenshots/A8vGwM.png b/assets/design-export/screenshots/A8vGwM.png index d741de625..d0b0d9f0e 100644 Binary files a/assets/design-export/screenshots/A8vGwM.png and b/assets/design-export/screenshots/A8vGwM.png differ diff --git a/assets/design-export/screenshots/BguST.png b/assets/design-export/screenshots/BguST.png index 3a02f5c62..afbe3b7a5 100644 Binary files a/assets/design-export/screenshots/BguST.png and b/assets/design-export/screenshots/BguST.png differ diff --git a/assets/design-export/screenshots/E0ypH.png b/assets/design-export/screenshots/E0ypH.png index 2aa29f507..7f1fb8a50 100644 Binary files a/assets/design-export/screenshots/E0ypH.png and b/assets/design-export/screenshots/E0ypH.png differ diff --git a/assets/design-export/screenshots/EKJyM.png b/assets/design-export/screenshots/EKJyM.png index ed38f1b2d..ede8f05da 100644 Binary files a/assets/design-export/screenshots/EKJyM.png and b/assets/design-export/screenshots/EKJyM.png differ diff --git a/assets/design-export/screenshots/IMSD5.png b/assets/design-export/screenshots/IMSD5.png index fce94c005..dcffd231a 100644 Binary files a/assets/design-export/screenshots/IMSD5.png and b/assets/design-export/screenshots/IMSD5.png differ diff --git a/assets/design-export/screenshots/J5pjJ3.png b/assets/design-export/screenshots/J5pjJ3.png index ed38f1b2d..ede8f05da 100644 Binary files a/assets/design-export/screenshots/J5pjJ3.png and b/assets/design-export/screenshots/J5pjJ3.png differ diff --git a/assets/design-export/screenshots/KJdxg.png b/assets/design-export/screenshots/KJdxg.png index 39aac847e..da21a7f9a 100644 Binary files a/assets/design-export/screenshots/KJdxg.png and b/assets/design-export/screenshots/KJdxg.png differ diff --git a/assets/design-export/screenshots/KaRFX.png b/assets/design-export/screenshots/KaRFX.png index b48653db5..3ae81895d 100644 Binary files a/assets/design-export/screenshots/KaRFX.png and b/assets/design-export/screenshots/KaRFX.png differ diff --git a/assets/design-export/screenshots/NLu2I.png b/assets/design-export/screenshots/NLu2I.png index 934ab5fec..7756658fd 100644 Binary files a/assets/design-export/screenshots/NLu2I.png and b/assets/design-export/screenshots/NLu2I.png differ diff --git a/assets/design-export/screenshots/NqaaU.png b/assets/design-export/screenshots/NqaaU.png index 6208b734a..fb3c1bc94 100644 Binary files a/assets/design-export/screenshots/NqaaU.png and b/assets/design-export/screenshots/NqaaU.png differ diff --git a/assets/design-export/screenshots/OC804.png b/assets/design-export/screenshots/OC804.png index 7e18d7690..85b654245 100644 Binary files a/assets/design-export/screenshots/OC804.png and b/assets/design-export/screenshots/OC804.png differ diff --git a/assets/design-export/screenshots/OecJ5.png b/assets/design-export/screenshots/OecJ5.png index 363934311..18f6978f5 100644 Binary files a/assets/design-export/screenshots/OecJ5.png and b/assets/design-export/screenshots/OecJ5.png differ diff --git a/assets/design-export/screenshots/QFEg9.png b/assets/design-export/screenshots/QFEg9.png index a0ba43794..b6cfd0f5b 100644 Binary files a/assets/design-export/screenshots/QFEg9.png and b/assets/design-export/screenshots/QFEg9.png differ diff --git a/assets/design-export/screenshots/QpEvu.png b/assets/design-export/screenshots/QpEvu.png index 0f30e544e..a9be778a0 100644 Binary files a/assets/design-export/screenshots/QpEvu.png and b/assets/design-export/screenshots/QpEvu.png differ diff --git a/assets/design-export/screenshots/RodrS.png b/assets/design-export/screenshots/RodrS.png index 1b4c0a6ba..3a5283f16 100644 Binary files a/assets/design-export/screenshots/RodrS.png and b/assets/design-export/screenshots/RodrS.png differ diff --git a/assets/design-export/screenshots/RpHBg.png b/assets/design-export/screenshots/RpHBg.png index cea6dc136..4d94b9867 100644 Binary files a/assets/design-export/screenshots/RpHBg.png and b/assets/design-export/screenshots/RpHBg.png differ diff --git a/assets/design-export/screenshots/T70dJ.png b/assets/design-export/screenshots/T70dJ.png index c7316e94f..d4dfda427 100644 Binary files a/assets/design-export/screenshots/T70dJ.png and b/assets/design-export/screenshots/T70dJ.png differ diff --git a/assets/design-export/screenshots/VctzT.png b/assets/design-export/screenshots/VctzT.png index 6c7f35757..168257cdf 100644 Binary files a/assets/design-export/screenshots/VctzT.png and b/assets/design-export/screenshots/VctzT.png differ diff --git a/assets/design-export/screenshots/VfB0Y.png b/assets/design-export/screenshots/VfB0Y.png index cec23636e..7115735a1 100644 Binary files a/assets/design-export/screenshots/VfB0Y.png and b/assets/design-export/screenshots/VfB0Y.png differ diff --git a/assets/design-export/screenshots/XR0f9.png b/assets/design-export/screenshots/XR0f9.png index be0718267..a655975ad 100644 Binary files a/assets/design-export/screenshots/XR0f9.png and b/assets/design-export/screenshots/XR0f9.png differ diff --git a/assets/design-export/screenshots/Y5cmvI.png b/assets/design-export/screenshots/Y5cmvI.png index a0502e34b..a5429d521 100644 Binary files a/assets/design-export/screenshots/Y5cmvI.png and b/assets/design-export/screenshots/Y5cmvI.png differ diff --git a/assets/design-export/screenshots/YN8cE.png b/assets/design-export/screenshots/YN8cE.png index c7767fe6b..1ba840355 100644 Binary files a/assets/design-export/screenshots/YN8cE.png and b/assets/design-export/screenshots/YN8cE.png differ diff --git a/assets/design-export/screenshots/ZUAq1.png b/assets/design-export/screenshots/ZUAq1.png index f044010f4..93bdc07c5 100644 Binary files a/assets/design-export/screenshots/ZUAq1.png and b/assets/design-export/screenshots/ZUAq1.png differ diff --git a/assets/design-export/screenshots/cluster-security-panel.png b/assets/design-export/screenshots/cluster-security-panel.png new file mode 100644 index 000000000..f5076b573 Binary files /dev/null and b/assets/design-export/screenshots/cluster-security-panel.png differ diff --git a/assets/design-export/screenshots/dQV9N.png b/assets/design-export/screenshots/dQV9N.png index 8c5aea17c..168f752a3 100644 Binary files a/assets/design-export/screenshots/dQV9N.png and b/assets/design-export/screenshots/dQV9N.png differ diff --git a/assets/design-export/screenshots/dhPtX.png b/assets/design-export/screenshots/dhPtX.png index ed38f1b2d..ede8f05da 100644 Binary files a/assets/design-export/screenshots/dhPtX.png and b/assets/design-export/screenshots/dhPtX.png differ diff --git a/assets/design-export/screenshots/dialog-risky-security-value.png b/assets/design-export/screenshots/dialog-risky-security-value.png new file mode 100644 index 000000000..df5825fd0 Binary files /dev/null and b/assets/design-export/screenshots/dialog-risky-security-value.png differ diff --git a/assets/design-export/screenshots/dialog-security-file-access.png b/assets/design-export/screenshots/dialog-security-file-access.png new file mode 100644 index 000000000..01faa7ebe Binary files /dev/null and b/assets/design-export/screenshots/dialog-security-file-access.png differ diff --git a/assets/design-export/screenshots/e9FnC.png b/assets/design-export/screenshots/e9FnC.png index 533428ece..360ea7a8e 100644 Binary files a/assets/design-export/screenshots/e9FnC.png and b/assets/design-export/screenshots/e9FnC.png differ diff --git a/assets/design-export/screenshots/gWqMD.png b/assets/design-export/screenshots/gWqMD.png index b3665211c..9e487dabd 100644 Binary files a/assets/design-export/screenshots/gWqMD.png and b/assets/design-export/screenshots/gWqMD.png differ diff --git a/assets/design-export/screenshots/hLB9Z.png b/assets/design-export/screenshots/hLB9Z.png index a8bf6e511..20907496e 100644 Binary files a/assets/design-export/screenshots/hLB9Z.png and b/assets/design-export/screenshots/hLB9Z.png differ diff --git a/assets/design-export/screenshots/i1bLR.png b/assets/design-export/screenshots/i1bLR.png index fd19d89a3..dffd9f564 100644 Binary files a/assets/design-export/screenshots/i1bLR.png and b/assets/design-export/screenshots/i1bLR.png differ diff --git a/assets/design-export/screenshots/i8wib.png b/assets/design-export/screenshots/i8wib.png index 72218120b..e63966cdd 100644 Binary files a/assets/design-export/screenshots/i8wib.png and b/assets/design-export/screenshots/i8wib.png differ diff --git a/assets/design-export/screenshots/iLm38.png b/assets/design-export/screenshots/iLm38.png index 8429d1875..7fee51640 100644 Binary files a/assets/design-export/screenshots/iLm38.png and b/assets/design-export/screenshots/iLm38.png differ diff --git a/assets/design-export/screenshots/nGJE1.png b/assets/design-export/screenshots/nGJE1.png index ed38f1b2d..ede8f05da 100644 Binary files a/assets/design-export/screenshots/nGJE1.png and b/assets/design-export/screenshots/nGJE1.png differ diff --git a/assets/design-export/screenshots/security-advanced-mobile.png b/assets/design-export/screenshots/security-advanced-mobile.png new file mode 100644 index 000000000..013cf9840 Binary files /dev/null and b/assets/design-export/screenshots/security-advanced-mobile.png differ diff --git a/assets/design-export/screenshots/security-advanced.png b/assets/design-export/screenshots/security-advanced.png new file mode 100644 index 000000000..edca62840 Binary files /dev/null and b/assets/design-export/screenshots/security-advanced.png differ diff --git a/assets/design-export/screenshots/swxkJ.png b/assets/design-export/screenshots/swxkJ.png index 925a0ede3..7e064fce3 100644 Binary files a/assets/design-export/screenshots/swxkJ.png and b/assets/design-export/screenshots/swxkJ.png differ diff --git a/assets/design-export/screenshots/t56aLu.png b/assets/design-export/screenshots/t56aLu.png index 822284400..3b30a869b 100644 Binary files a/assets/design-export/screenshots/t56aLu.png and b/assets/design-export/screenshots/t56aLu.png differ diff --git a/assets/design-export/screenshots/tSOeI.png b/assets/design-export/screenshots/tSOeI.png index ed38f1b2d..ede8f05da 100644 Binary files a/assets/design-export/screenshots/tSOeI.png and b/assets/design-export/screenshots/tSOeI.png differ diff --git a/assets/design-export/screenshots/uCA23.png b/assets/design-export/screenshots/uCA23.png index baa30a538..02cd20798 100644 Binary files a/assets/design-export/screenshots/uCA23.png and b/assets/design-export/screenshots/uCA23.png differ diff --git a/assets/design-export/screenshots/ugDSa.png b/assets/design-export/screenshots/ugDSa.png index d7fff15a8..11177fd28 100644 Binary files a/assets/design-export/screenshots/ugDSa.png and b/assets/design-export/screenshots/ugDSa.png differ diff --git a/assets/design-export/screenshots/vUqMl.png b/assets/design-export/screenshots/vUqMl.png index cd703fa29..538dadfe3 100644 Binary files a/assets/design-export/screenshots/vUqMl.png and b/assets/design-export/screenshots/vUqMl.png differ diff --git a/assets/design-export/screenshots/wxINm.png b/assets/design-export/screenshots/wxINm.png index cd1764f69..8c75046bc 100644 Binary files a/assets/design-export/screenshots/wxINm.png and b/assets/design-export/screenshots/wxINm.png differ diff --git a/assets/design-export/screenshots/xCJlu.png b/assets/design-export/screenshots/xCJlu.png index e9562c7d5..4dfb28dda 100644 Binary files a/assets/design-export/screenshots/xCJlu.png and b/assets/design-export/screenshots/xCJlu.png differ diff --git a/assets/design-export/screenshots/y3YcQ.png b/assets/design-export/screenshots/y3YcQ.png index ed38f1b2d..ede8f05da 100644 Binary files a/assets/design-export/screenshots/y3YcQ.png and b/assets/design-export/screenshots/y3YcQ.png differ diff --git a/changelog/unreleased/977-module-security-overrides.md b/changelog/unreleased/977-module-security-overrides.md new file mode 100644 index 000000000..774e0db21 --- /dev/null +++ b/changelog/unreleased/977-module-security-overrides.md @@ -0,0 +1,3 @@ +# Per-server security overrides with module defaults + +Modules can now set the run-as user, run-as group, filesystem group and volume ownership check for their game, and a server owner with the new `servers:security` permission can override each one in an Advanced section of the create-server wizard and the server's Settings. Overrides apply on the next restart; saving never restarts a server. Root overrides (user or group 0, or the image's default user) are off by default and are allowed per cluster under Clusters, cluster, Configuration, Security. The volume ownership check now defaults to "only when wrong", which starts servers with large volumes faster. Run `helm upgrade` so each cluster gets its security settings. [PR #977](https://github.com/GameplanePanel/Gameplane/pull/977) diff --git a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_backups.yaml b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_backups.yaml index 548b42eb7..3c36bdb39 100644 --- a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_backups.yaml +++ b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_backups.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 + gameplane.local/crd-bundle-sha256: 0e382ee93fec8733f79c30989981f42e8103df57d57f9d5c81af0409db3c7e40 controller-gen.kubebuilder.io/version: v0.22.0 name: backups.gameplane.local spec: diff --git a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_backupschedules.yaml b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_backupschedules.yaml index c332297c1..a3585bc75 100644 --- a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_backupschedules.yaml +++ b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_backupschedules.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 + gameplane.local/crd-bundle-sha256: 0e382ee93fec8733f79c30989981f42e8103df57d57f9d5c81af0409db3c7e40 controller-gen.kubebuilder.io/version: v0.22.0 name: backupschedules.gameplane.local spec: diff --git a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_clusters.yaml b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_clusters.yaml index fdd333d65..80027a9b5 100644 --- a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_clusters.yaml +++ b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_clusters.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 + gameplane.local/crd-bundle-sha256: 0e382ee93fec8733f79c30989981f42e8103df57d57f9d5c81af0409db3c7e40 controller-gen.kubebuilder.io/version: v0.22.0 name: clusters.gameplane.local spec: @@ -81,6 +81,16 @@ spec: - tlsSecretRef - url type: object + controlPlaneNamespace: + default: gameplane + description: |- + ControlPlaneNamespace is the namespace of this cluster's operator + control plane. The API reads the cluster's security settings ConfigMap + (gameplane-security-settings) in this namespace. Empty or absent means + "gameplane". Must match the namespace of the remote install. + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string displayName: description: DisplayName is an optional human-readable name for the cluster. diff --git a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_gameservers.yaml b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_gameservers.yaml index cfaf81c74..c04b15e17 100644 --- a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_gameservers.yaml +++ b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_gameservers.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 + gameplane.local/crd-bundle-sha256: 0e382ee93fec8733f79c30989981f42e8103df57d57f9d5c81af0409db3c7e40 controller-gen.kubebuilder.io/version: v0.22.0 name: gameservers.gameplane.local spec: @@ -2258,6 +2258,87 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object + security: + description: |- + Security overrides the module's security defaults (GameTemplate + spec.security) for this GameServer. Absent means no override. Saving a + change never restarts a running server; it applies at the next start. + properties: + fsGroup: + description: FSGroup overrides the gid the kubelet chowns the + data volume to. + properties: + useImageDefault: + description: UseImageDefault applies no value for this id, + even if the module sets one. + type: boolean + value: + description: Value is the uid or gid to apply. + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + type: object + x-kubernetes-validations: + - message: 'security.fsGroup: set exactly one of value or useImageDefault' + rule: has(self.value) != has(self.useImageDefault) + - message: security.fsGroup.useImageDefault must be true when + set + rule: '!has(self.useImageDefault) || self.useImageDefault == + true' + runAsGroup: + description: RunAsGroup overrides the gid the game container runs + as. + properties: + useImageDefault: + description: UseImageDefault applies no value for this id, + even if the module sets one. + type: boolean + value: + description: Value is the uid or gid to apply. + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + type: object + x-kubernetes-validations: + - message: 'security.runAsGroup: set exactly one of value or useImageDefault' + rule: has(self.value) != has(self.useImageDefault) + - message: security.runAsGroup.useImageDefault must be true when + set + rule: '!has(self.useImageDefault) || self.useImageDefault == + true' + runAsUser: + description: RunAsUser overrides the uid the game container runs + as. + properties: + useImageDefault: + description: UseImageDefault applies no value for this id, + even if the module sets one. + type: boolean + value: + description: Value is the uid or gid to apply. + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + type: object + x-kubernetes-validations: + - message: 'security.runAsUser: set exactly one of value or useImageDefault' + rule: has(self.value) != has(self.useImageDefault) + - message: security.runAsUser.useImageDefault must be true when + set + rule: '!has(self.useImageDefault) || self.useImageDefault == + true' + volumeOwnershipCheck: + description: |- + VolumeOwnershipCheck overrides the module's ownership check policy. + Omitted means the module's value, else OnlyWhenWrong. + enum: + - EveryStart + - OnlyWhenWrong + type: string + type: object serviceAccountName: description: |- ServiceAccountName, when set, overrides the SA the pod runs as. @@ -2900,6 +2981,206 @@ spec: - Suspended - Failed type: string + security: + description: |- + Security reports the desired and last-applied security settings for this + GameServer. Written only by the reconciler, as a merge patch of this field. + properties: + applied: + description: |- + Applied is what the pod last started with, read from the StatefulSet + annotation written once a pod's volumes were set up. Omitted before the + first start. + properties: + fsGroup: + description: FSGroup is the resolved volume filesystem group. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is the applied id. Absent when no id + is applied (image default). + format: int64 + type: integer + required: + - source + type: object + runAsGroup: + description: RunAsGroup is the resolved game container gid. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is the applied id. Absent when no id + is applied (image default). + format: int64 + type: integer + required: + - source + type: object + runAsUser: + description: RunAsUser is the resolved game container uid. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is the applied id. Absent when no id + is applied (image default). + format: int64 + type: integer + required: + - source + type: object + volumeOwnershipCheck: + description: VolumeOwnershipCheck is the resolved ownership + check policy. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is EveryStart or OnlyWhenWrong. + enum: + - EveryStart + - OnlyWhenWrong + type: string + required: + - source + - value + type: object + required: + - fsGroup + - runAsGroup + - runAsUser + - volumeOwnershipCheck + type: object + desired: + description: |- + Desired is what the next start will use: the server override over the + module default over nothing. Set after the first reconcile. + properties: + fsGroup: + description: FSGroup is the resolved volume filesystem group. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is the applied id. Absent when no id + is applied (image default). + format: int64 + type: integer + required: + - source + type: object + runAsGroup: + description: RunAsGroup is the resolved game container gid. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is the applied id. Absent when no id + is applied (image default). + format: int64 + type: integer + required: + - source + type: object + runAsUser: + description: RunAsUser is the resolved game container uid. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is the applied id. Absent when no id + is applied (image default). + format: int64 + type: integer + required: + - source + type: object + volumeOwnershipCheck: + description: VolumeOwnershipCheck is the resolved ownership + check policy. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is EveryStart or OnlyWhenWrong. + enum: + - EveryStart + - OnlyWhenWrong + type: string + required: + - source + - value + type: object + required: + - fsGroup + - runAsGroup + - runAsUser + - volumeOwnershipCheck + type: object + pending: + description: |- + Pending is true when Applied exists and any value differs from Desired. + A change of source with the same value is not pending. + type: boolean + type: object startedAt: description: |- StartedAt is the wall-clock time the game container was last diff --git a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_gametemplates.yaml b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_gametemplates.yaml index 3ea1ae809..608cab30d 100644 --- a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_gametemplates.yaml +++ b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_gametemplates.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 + gameplane.local/crd-bundle-sha256: 0e382ee93fec8733f79c30989981f42e8103df57d57f9d5c81af0409db3c7e40 controller-gen.kubebuilder.io/version: v0.22.0 name: gametemplates.gameplane.local spec: @@ -2322,6 +2322,54 @@ spec: maximum: 4294967295 minimum: 0 type: integer + risky: + description: |- + Risky marks the settings whose override a server owner should only + make with care (the image works only with that id, or must start as + root). Presence of a member means "overriding this is risky"; the + dashboard shows the reason before saving. It never forbids an override. + properties: + fsGroup: + description: FSGroup marks the volume filesystem group as + risky to override. + properties: + reason: + description: Reason is shown to the server owner before + they save the override. + maxLength: 200 + type: string + type: object + runAsGroup: + description: RunAsGroup marks the game container gid as risky + to override. + properties: + reason: + description: Reason is shown to the server owner before + they save the override. + maxLength: 200 + type: string + type: object + runAsUser: + description: RunAsUser marks the game container uid as risky + to override. + properties: + reason: + description: Reason is shown to the server owner before + they save the override. + maxLength: 200 + type: string + type: object + volumeOwnershipCheck: + description: VolumeOwnershipCheck marks the ownership check + policy as risky to override. + properties: + reason: + description: Reason is shown to the server owner before + they save the override. + maxLength: 200 + type: string + type: object + type: object runAsGroup: description: RunAsGroup is the gid the GAME container runs as. format: int64 @@ -2334,6 +2382,17 @@ spec: maximum: 4294967295 minimum: 0 type: integer + volumeOwnershipCheck: + description: |- + VolumeOwnershipCheck selects how the kubelet re-applies FSGroup to the + mounted volume. EveryStart re-owns every file on each start (Kubernetes + fsGroupChangePolicy Always); OnlyWhenWrong skips the walk when the + volume root already has the right group (OnRootMismatch). Omitted means + OnlyWhenWrong. Has an effect only when FSGroup is set. + enum: + - EveryStart + - OnlyWhenWrong + type: string type: object sentinelIsolation: description: |- diff --git a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_modules.yaml b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_modules.yaml index b224e0c9b..0064e8d17 100644 --- a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_modules.yaml +++ b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_modules.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 + gameplane.local/crd-bundle-sha256: 0e382ee93fec8733f79c30989981f42e8103df57d57f9d5c81af0409db3c7e40 controller-gen.kubebuilder.io/version: v0.22.0 name: modules.gameplane.local spec: diff --git a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_modulesources.yaml b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_modulesources.yaml index e81733ef1..b436101f7 100644 --- a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_modulesources.yaml +++ b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_modulesources.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 + gameplane.local/crd-bundle-sha256: 0e382ee93fec8733f79c30989981f42e8103df57d57f9d5c81af0409db3c7e40 controller-gen.kubebuilder.io/version: v0.22.0 name: modulesources.gameplane.local spec: diff --git a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_networkcaptures.yaml b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_networkcaptures.yaml index 50753e1bc..b94b0bc54 100644 --- a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_networkcaptures.yaml +++ b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_networkcaptures.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 + gameplane.local/crd-bundle-sha256: 0e382ee93fec8733f79c30989981f42e8103df57d57f9d5c81af0409db3c7e40 controller-gen.kubebuilder.io/version: v0.22.0 name: networkcaptures.gameplane.local spec: diff --git a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_restores.yaml b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_restores.yaml index 32c1b2609..b1db312ff 100644 --- a/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_restores.yaml +++ b/charts/gameplane/charts/gameplane-crds/crds/gameplane.local_restores.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 + gameplane.local/crd-bundle-sha256: 0e382ee93fec8733f79c30989981f42e8103df57d57f9d5c81af0409db3c7e40 controller-gen.kubebuilder.io/version: v0.22.0 name: restores.gameplane.local spec: diff --git a/charts/gameplane/crd-manifests/gameplane.local_backups.yaml b/charts/gameplane/crd-manifests/gameplane.local_backups.yaml index 548b42eb7..3c36bdb39 100644 --- a/charts/gameplane/crd-manifests/gameplane.local_backups.yaml +++ b/charts/gameplane/crd-manifests/gameplane.local_backups.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 + gameplane.local/crd-bundle-sha256: 0e382ee93fec8733f79c30989981f42e8103df57d57f9d5c81af0409db3c7e40 controller-gen.kubebuilder.io/version: v0.22.0 name: backups.gameplane.local spec: diff --git a/charts/gameplane/crd-manifests/gameplane.local_backupschedules.yaml b/charts/gameplane/crd-manifests/gameplane.local_backupschedules.yaml index c332297c1..a3585bc75 100644 --- a/charts/gameplane/crd-manifests/gameplane.local_backupschedules.yaml +++ b/charts/gameplane/crd-manifests/gameplane.local_backupschedules.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 + gameplane.local/crd-bundle-sha256: 0e382ee93fec8733f79c30989981f42e8103df57d57f9d5c81af0409db3c7e40 controller-gen.kubebuilder.io/version: v0.22.0 name: backupschedules.gameplane.local spec: diff --git a/charts/gameplane/crd-manifests/gameplane.local_clusters.yaml b/charts/gameplane/crd-manifests/gameplane.local_clusters.yaml index fdd333d65..80027a9b5 100644 --- a/charts/gameplane/crd-manifests/gameplane.local_clusters.yaml +++ b/charts/gameplane/crd-manifests/gameplane.local_clusters.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 + gameplane.local/crd-bundle-sha256: 0e382ee93fec8733f79c30989981f42e8103df57d57f9d5c81af0409db3c7e40 controller-gen.kubebuilder.io/version: v0.22.0 name: clusters.gameplane.local spec: @@ -81,6 +81,16 @@ spec: - tlsSecretRef - url type: object + controlPlaneNamespace: + default: gameplane + description: |- + ControlPlaneNamespace is the namespace of this cluster's operator + control plane. The API reads the cluster's security settings ConfigMap + (gameplane-security-settings) in this namespace. Empty or absent means + "gameplane". Must match the namespace of the remote install. + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string displayName: description: DisplayName is an optional human-readable name for the cluster. diff --git a/charts/gameplane/crd-manifests/gameplane.local_gameservers.yaml b/charts/gameplane/crd-manifests/gameplane.local_gameservers.yaml index cfaf81c74..c04b15e17 100644 --- a/charts/gameplane/crd-manifests/gameplane.local_gameservers.yaml +++ b/charts/gameplane/crd-manifests/gameplane.local_gameservers.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 + gameplane.local/crd-bundle-sha256: 0e382ee93fec8733f79c30989981f42e8103df57d57f9d5c81af0409db3c7e40 controller-gen.kubebuilder.io/version: v0.22.0 name: gameservers.gameplane.local spec: @@ -2258,6 +2258,87 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object + security: + description: |- + Security overrides the module's security defaults (GameTemplate + spec.security) for this GameServer. Absent means no override. Saving a + change never restarts a running server; it applies at the next start. + properties: + fsGroup: + description: FSGroup overrides the gid the kubelet chowns the + data volume to. + properties: + useImageDefault: + description: UseImageDefault applies no value for this id, + even if the module sets one. + type: boolean + value: + description: Value is the uid or gid to apply. + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + type: object + x-kubernetes-validations: + - message: 'security.fsGroup: set exactly one of value or useImageDefault' + rule: has(self.value) != has(self.useImageDefault) + - message: security.fsGroup.useImageDefault must be true when + set + rule: '!has(self.useImageDefault) || self.useImageDefault == + true' + runAsGroup: + description: RunAsGroup overrides the gid the game container runs + as. + properties: + useImageDefault: + description: UseImageDefault applies no value for this id, + even if the module sets one. + type: boolean + value: + description: Value is the uid or gid to apply. + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + type: object + x-kubernetes-validations: + - message: 'security.runAsGroup: set exactly one of value or useImageDefault' + rule: has(self.value) != has(self.useImageDefault) + - message: security.runAsGroup.useImageDefault must be true when + set + rule: '!has(self.useImageDefault) || self.useImageDefault == + true' + runAsUser: + description: RunAsUser overrides the uid the game container runs + as. + properties: + useImageDefault: + description: UseImageDefault applies no value for this id, + even if the module sets one. + type: boolean + value: + description: Value is the uid or gid to apply. + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + type: object + x-kubernetes-validations: + - message: 'security.runAsUser: set exactly one of value or useImageDefault' + rule: has(self.value) != has(self.useImageDefault) + - message: security.runAsUser.useImageDefault must be true when + set + rule: '!has(self.useImageDefault) || self.useImageDefault == + true' + volumeOwnershipCheck: + description: |- + VolumeOwnershipCheck overrides the module's ownership check policy. + Omitted means the module's value, else OnlyWhenWrong. + enum: + - EveryStart + - OnlyWhenWrong + type: string + type: object serviceAccountName: description: |- ServiceAccountName, when set, overrides the SA the pod runs as. @@ -2900,6 +2981,206 @@ spec: - Suspended - Failed type: string + security: + description: |- + Security reports the desired and last-applied security settings for this + GameServer. Written only by the reconciler, as a merge patch of this field. + properties: + applied: + description: |- + Applied is what the pod last started with, read from the StatefulSet + annotation written once a pod's volumes were set up. Omitted before the + first start. + properties: + fsGroup: + description: FSGroup is the resolved volume filesystem group. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is the applied id. Absent when no id + is applied (image default). + format: int64 + type: integer + required: + - source + type: object + runAsGroup: + description: RunAsGroup is the resolved game container gid. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is the applied id. Absent when no id + is applied (image default). + format: int64 + type: integer + required: + - source + type: object + runAsUser: + description: RunAsUser is the resolved game container uid. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is the applied id. Absent when no id + is applied (image default). + format: int64 + type: integer + required: + - source + type: object + volumeOwnershipCheck: + description: VolumeOwnershipCheck is the resolved ownership + check policy. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is EveryStart or OnlyWhenWrong. + enum: + - EveryStart + - OnlyWhenWrong + type: string + required: + - source + - value + type: object + required: + - fsGroup + - runAsGroup + - runAsUser + - volumeOwnershipCheck + type: object + desired: + description: |- + Desired is what the next start will use: the server override over the + module default over nothing. Set after the first reconcile. + properties: + fsGroup: + description: FSGroup is the resolved volume filesystem group. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is the applied id. Absent when no id + is applied (image default). + format: int64 + type: integer + required: + - source + type: object + runAsGroup: + description: RunAsGroup is the resolved game container gid. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is the applied id. Absent when no id + is applied (image default). + format: int64 + type: integer + required: + - source + type: object + runAsUser: + description: RunAsUser is the resolved game container uid. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is the applied id. Absent when no id + is applied (image default). + format: int64 + type: integer + required: + - source + type: object + volumeOwnershipCheck: + description: VolumeOwnershipCheck is the resolved ownership + check policy. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is EveryStart or OnlyWhenWrong. + enum: + - EveryStart + - OnlyWhenWrong + type: string + required: + - source + - value + type: object + required: + - fsGroup + - runAsGroup + - runAsUser + - volumeOwnershipCheck + type: object + pending: + description: |- + Pending is true when Applied exists and any value differs from Desired. + A change of source with the same value is not pending. + type: boolean + type: object startedAt: description: |- StartedAt is the wall-clock time the game container was last diff --git a/charts/gameplane/crd-manifests/gameplane.local_gametemplates.yaml b/charts/gameplane/crd-manifests/gameplane.local_gametemplates.yaml index 3ea1ae809..608cab30d 100644 --- a/charts/gameplane/crd-manifests/gameplane.local_gametemplates.yaml +++ b/charts/gameplane/crd-manifests/gameplane.local_gametemplates.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 + gameplane.local/crd-bundle-sha256: 0e382ee93fec8733f79c30989981f42e8103df57d57f9d5c81af0409db3c7e40 controller-gen.kubebuilder.io/version: v0.22.0 name: gametemplates.gameplane.local spec: @@ -2322,6 +2322,54 @@ spec: maximum: 4294967295 minimum: 0 type: integer + risky: + description: |- + Risky marks the settings whose override a server owner should only + make with care (the image works only with that id, or must start as + root). Presence of a member means "overriding this is risky"; the + dashboard shows the reason before saving. It never forbids an override. + properties: + fsGroup: + description: FSGroup marks the volume filesystem group as + risky to override. + properties: + reason: + description: Reason is shown to the server owner before + they save the override. + maxLength: 200 + type: string + type: object + runAsGroup: + description: RunAsGroup marks the game container gid as risky + to override. + properties: + reason: + description: Reason is shown to the server owner before + they save the override. + maxLength: 200 + type: string + type: object + runAsUser: + description: RunAsUser marks the game container uid as risky + to override. + properties: + reason: + description: Reason is shown to the server owner before + they save the override. + maxLength: 200 + type: string + type: object + volumeOwnershipCheck: + description: VolumeOwnershipCheck marks the ownership check + policy as risky to override. + properties: + reason: + description: Reason is shown to the server owner before + they save the override. + maxLength: 200 + type: string + type: object + type: object runAsGroup: description: RunAsGroup is the gid the GAME container runs as. format: int64 @@ -2334,6 +2382,17 @@ spec: maximum: 4294967295 minimum: 0 type: integer + volumeOwnershipCheck: + description: |- + VolumeOwnershipCheck selects how the kubelet re-applies FSGroup to the + mounted volume. EveryStart re-owns every file on each start (Kubernetes + fsGroupChangePolicy Always); OnlyWhenWrong skips the walk when the + volume root already has the right group (OnRootMismatch). Omitted means + OnlyWhenWrong. Has an effect only when FSGroup is set. + enum: + - EveryStart + - OnlyWhenWrong + type: string type: object sentinelIsolation: description: |- diff --git a/charts/gameplane/crd-manifests/gameplane.local_modules.yaml b/charts/gameplane/crd-manifests/gameplane.local_modules.yaml index b224e0c9b..0064e8d17 100644 --- a/charts/gameplane/crd-manifests/gameplane.local_modules.yaml +++ b/charts/gameplane/crd-manifests/gameplane.local_modules.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 + gameplane.local/crd-bundle-sha256: 0e382ee93fec8733f79c30989981f42e8103df57d57f9d5c81af0409db3c7e40 controller-gen.kubebuilder.io/version: v0.22.0 name: modules.gameplane.local spec: diff --git a/charts/gameplane/crd-manifests/gameplane.local_modulesources.yaml b/charts/gameplane/crd-manifests/gameplane.local_modulesources.yaml index e81733ef1..b436101f7 100644 --- a/charts/gameplane/crd-manifests/gameplane.local_modulesources.yaml +++ b/charts/gameplane/crd-manifests/gameplane.local_modulesources.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 + gameplane.local/crd-bundle-sha256: 0e382ee93fec8733f79c30989981f42e8103df57d57f9d5c81af0409db3c7e40 controller-gen.kubebuilder.io/version: v0.22.0 name: modulesources.gameplane.local spec: diff --git a/charts/gameplane/crd-manifests/gameplane.local_networkcaptures.yaml b/charts/gameplane/crd-manifests/gameplane.local_networkcaptures.yaml index 50753e1bc..b94b0bc54 100644 --- a/charts/gameplane/crd-manifests/gameplane.local_networkcaptures.yaml +++ b/charts/gameplane/crd-manifests/gameplane.local_networkcaptures.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 + gameplane.local/crd-bundle-sha256: 0e382ee93fec8733f79c30989981f42e8103df57d57f9d5c81af0409db3c7e40 controller-gen.kubebuilder.io/version: v0.22.0 name: networkcaptures.gameplane.local spec: diff --git a/charts/gameplane/crd-manifests/gameplane.local_restores.yaml b/charts/gameplane/crd-manifests/gameplane.local_restores.yaml index 32c1b2609..b1db312ff 100644 --- a/charts/gameplane/crd-manifests/gameplane.local_restores.yaml +++ b/charts/gameplane/crd-manifests/gameplane.local_restores.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - gameplane.local/crd-bundle-sha256: 71756d153338338b9589c840329595524591d3ef80fd7c4069ade51077609ed1 + gameplane.local/crd-bundle-sha256: 0e382ee93fec8733f79c30989981f42e8103df57d57f9d5c81af0409db3c7e40 controller-gen.kubebuilder.io/version: v0.22.0 name: restores.gameplane.local spec: diff --git a/charts/gameplane/templates/api-credentials.yaml b/charts/gameplane/templates/api-credentials.yaml index dba430782..069c0e9e0 100644 --- a/charts/gameplane/templates/api-credentials.yaml +++ b/charts/gameplane/templates/api-credentials.yaml @@ -43,6 +43,32 @@ metadata: namespace: {{ $namespace }} labels: {{- include "gameplane.labels" . | nindent 4 }} roleRef: { apiGroup: rbac.authorization.k8s.io, kind: Role, name: {{ .Release.Name }}-api-credentials } +subjects: + - kind: ServiceAccount + name: gameplane-api + namespace: {{ .Release.Namespace }} +--- +# Root-override switch (gameplane-security-settings, see security-settings.yaml). +# No create verb: resourceNames does not restrict create, and Helm creates the object. +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ .Release.Name }}-api-security-settings + namespace: {{ $namespace }} + labels: {{- include "gameplane.labels" . | nindent 4 }} +rules: + - apiGroups: [""] + resources: [configmaps] + resourceNames: [gameplane-security-settings] + verbs: [get, update, patch] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ .Release.Name }}-api-security-settings + namespace: {{ $namespace }} + labels: {{- include "gameplane.labels" . | nindent 4 }} +roleRef: { apiGroup: rbac.authorization.k8s.io, kind: Role, name: {{ .Release.Name }}-api-security-settings } subjects: - kind: ServiceAccount name: gameplane-api diff --git a/charts/gameplane/templates/security-settings.yaml b/charts/gameplane/templates/security-settings.yaml new file mode 100644 index 000000000..547023d82 --- /dev/null +++ b/charts/gameplane/templates/security-settings.yaml @@ -0,0 +1,58 @@ +{{- /* +Root-override switch for server security overrides (brief 00, sections 1 and 4). +One ConfigMap per cluster, in that cluster's operator control-plane namespace +(the operator's --control-plane-namespace). Written here, read and updated by +the API under a resourceNames-scoped grant, and read by the operator through +its cache. The value is the string "true" or "false"; anything else is off. + +Upgrades keep the value already on the cluster: lookup returns the live object, +and an existing "true" is re-rendered as "true". A first install, or a deleted +object, renders "false". Offline renders (helm template) have no live object, +so they also render "false". The keep annotation stops uninstall from removing +the switch. +*/}} +{{- if eq (include "gameplane.operatorEnabled" .) "true" }} +{{- $ns := include "gameplane.operatorClusterCredentialsNamespace" . }} +{{- $existing := lookup "v1" "ConfigMap" $ns "gameplane-security-settings" }} +{{- $allow := dig "data" "allowRootOverrides" "false" $existing | toString }} +{{- if ne $allow "true" }}{{ $allow = "false" }}{{ end }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: gameplane-security-settings + namespace: {{ $ns }} + labels: {{- include "gameplane.labels" . | nindent 4 }} + annotations: + helm.sh/resource-policy: keep +data: + allowRootOverrides: {{ $allow | quote }} +{{- with .Values.operator.securitySettingsSubjects }} +{{- if eq (include "gameplane.operatorEnabled" $) "true" }} +--- +# Remote operator-only installs: grants the central panel's identity on this +# cluster (operator.securitySettingsSubjects) get, update and patch on this one +# ConfigMap. The rule has no create verb. The subjects are not created here. +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ $.Release.Name }}-security-settings-api + namespace: {{ $ns }} + labels: {{- include "gameplane.labels" $ | nindent 4 }} +rules: + - apiGroups: [""] + resources: [configmaps] + resourceNames: [gameplane-security-settings] + verbs: [get, update, patch] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ $.Release.Name }}-security-settings-api + namespace: {{ $ns }} + labels: {{- include "gameplane.labels" $ | nindent 4 }} +roleRef: { apiGroup: rbac.authorization.k8s.io, kind: Role, name: {{ $.Release.Name }}-security-settings-api } +subjects: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- end }} +{{- end }} diff --git a/charts/gameplane/values.yaml b/charts/gameplane/values.yaml index 84314c2fc..fbc543660 100644 --- a/charts/gameplane/values.yaml +++ b/charts/gameplane/values.yaml @@ -97,6 +97,17 @@ operator: # Remote-cluster kubeconfigs. A native API shares api.credentialsNamespace. # With no native API, empty uses the release namespace. controlPlaneNamespace: "" + # Remote operator-only installs (api.enabled=false): the identity the central + # panel uses on this cluster, as subjects of its registered kubeconfig. Each + # entry gets get, update and patch on the gameplane-security-settings + # ConfigMap only (the root-override switch), in the control-plane namespace. + # Empty creates no grant. The chart cannot see the kubeconfig, so the subject + # must be set by the operator of that cluster. Example: + # securitySettingsSubjects: + # - kind: ServiceAccount + # name: panel-identity + # namespace: panel-namespace + securitySettingsSubjects: [] # Empty uses the release namespace. Non-default namespaces must already exist; # provision the referenced Secrets there before upgrading. These settings move # the operator's API reads, not the API pod or its mounted mTLS client material. diff --git a/design.fig b/design.fig index fdf1890b0..99f29a2ba 100644 Binary files a/design.fig and b/design.fig differ diff --git a/docs/agent-architecture.md b/docs/agent-architecture.md index 4767eab82..ff323357a 100644 --- a/docs/agent-architecture.md +++ b/docs/agent-architecture.md @@ -61,6 +61,7 @@ This document is the **first stop** for AI agents modifying or extending Gamepla | Change the website | `website/AGENTS.md` (submodule) | | Add a DB migration | `api/specs.md`, `api/internal/db/migrations/README.md` | | Change CI or a workflow | `docs/contributing.md` ("CI and workflows", "How CI picks tests") | +| Server security overrides (run-as user or group, fsGroup, ownership check, root rule, per-cluster allow-root setting) | `docs/security.md` ("Server security overrides"), `docs/module-authoring.md` ("Security context"), `operator/specs.md`, `api/specs.md`, `operator/internal/controller/security_overrides.go`, `operator/internal/controller/security_settings.go`, `api/internal/handlers/security_overrides.go`, `api/internal/handlers/security_settings.go`, `web/src/components/SecurityAdvanced.tsx`, `web/src/components/clusters/SecuritySettingsPanel.tsx` | | Change personal MCP tokens or the MCP read routes (`api/internal/auth/mcptokens.go`, `api/internal/handlers/mcp_tokens.go`, `api/internal/handlers/pods.go`, `web/src/routes/McpTokens.tsx`, the MCP tokens dialog in `web/src/routes/Users.tsx`) | `api/specs.md`, `web/specs.md`, `docs/security.md` ("mcp-server (optional)") | | Change MCP server RBAC or namespace scope (`charts/gameplane/templates/mcp-server.yaml`, `charts/gameplane/tests/mcp-server-rbac.sh`) | `docs/security.md` ("mcp-server (optional)"), `mcp-server/specs.md` | | Decide where new code goes | `docs/layout.md` | diff --git a/docs/module-authoring.md b/docs/module-authoring.md index 8a9ba7394..512000dd0 100644 --- a/docs/module-authoring.md +++ b/docs/module-authoring.md @@ -1183,7 +1183,8 @@ tab's "Container output" source covers those. ### Security context Some game images refuse to run as root or require a specific uid. Use -`spec.security` to override the pod/container security settings: +`spec.security` in the template to set the module default for the pod and +container security context: ```yaml security: @@ -1192,7 +1193,11 @@ security: fsGroup: 25000 # gid the kubelet chowns the data volume to ``` -All three fields are optional. When set, the operator applies these +The block is a default, not a lock. Every field is optional, and a server +owner can override any setting for one server (see +[Server security overrides](security.md#server-security-overrides)). Write the +default for the common case, and mark each value that breaks the game when it +changes as `risky` (see [Risky values](#risky-values)). When set, the operator applies these values to the game container's `securityContext`; `fsGroup` is set on the pod spec so the kubelet chowns mounted volumes on startup, letting a non-root game user write to the PVC without additional init @@ -1217,6 +1222,52 @@ spec: | `runAsUser` | int64 | omitted (image default) | 0 | 4294967295 | uid the game container runs as | | `runAsGroup` | int64 | omitted (image default) | 0 | 4294967295 | gid the game container runs as | | `fsGroup` | int64 | omitted (no chown) | 0 | 4294967295 | gid the kubelet chowns volumes to | +| `volumeOwnershipCheck` | enum | `OnlyWhenWrong` | n/a | n/a | `EveryStart` or `OnlyWhenWrong`; has an effect only when `fsGroup` applies | +| `risky` | object | omitted | n/a | n/a | marks settings a server owner should not change without a reason; see [Risky values](#risky-values) | + +#### Ownership check + +`volumeOwnershipCheck` controls how the kubelet re-applies `fsGroup` to the +data volume: + +- `EveryStart` makes the kubelet re-apply the group to the volume's files on + every start (pod `fsGroupChangePolicy: Always`). Use it when files inside the + volume can end up owned by another uid between starts, for example files a + helper process creates as root. The cost is a slower start on large volumes. +- `OnlyWhenWrong` (the built-in default) re-applies the group only when the + volume root is not already owned by `fsGroup` (`OnRootMismatch`). Starts are + faster, but files deeper in the volume keep whatever owner they have. + +The built-in default changed to `OnlyWhenWrong`. A template with `fsGroup` used +to get the Kubernetes default, which re-applies the group on every start. Servers +that already run with an `fsGroup` pick up the new default at their next start. +Set `volumeOwnershipCheck: EveryStart` in the template if the module needs the +previous behavior. + +#### Risky values + +Mark a setting in `risky` when changing it is likely to break the server. The +dashboard shows the reason and asks the server owner to confirm before saving an +override for that setting. Mark a value risky when the image works only with that +uid or gid, or must start as root. Marking a setting risky does not lock it. + +```yaml +security: + runAsUser: 25000 + runAsGroup: 25000 + fsGroup: 25000 + risky: + runAsUser: + reason: "The server must run as uid 25000, or it cannot read its save files." +``` + +The members of `risky` are `runAsUser`, `runAsGroup`, `fsGroup` and +`volumeOwnershipCheck`. A member may be set even when the template sets no +default for it. The `reason` is one plain-text sentence of 200 characters or +fewer that says what breaks. Do not write markup in it. The module validators +(`gp-module validate` and the module repository's `validate.py`) report a `risky` +member that is not one of these four settings, and a reason longer than 200 +characters, as errors. A `volumeOwnershipCheck` without an `fsGroup` is a warning. ### Reserved in-pod ports diff --git a/docs/security.md b/docs/security.md index 0c555c913..202b82ffd 100644 --- a/docs/security.md +++ b/docs/security.md @@ -632,6 +632,70 @@ that pod, including other players' packets. This access is admin-only and fully audited (every capture operation is logged). Default capture retention is 24 hours, reducing the exposure window for captured data. +### Server security overrides + +A module sets default run-as ids, the filesystem group and the ownership check in +`spec.security` of its `GameTemplate` (see [`module-authoring.md`](module-authoring.md#security-context)). +A server owner can override these per server in `GameServer.spec.security`. An +override never changes a running pod: the new values apply at the server's next +start, and the dashboard shows the value as pending until then. + +**Who may override.** Writing `spec.security` needs the `servers:security` +permission, which the admin role holds by default. A user without it gets 403 on +create and update. + +**The root rule.** A root value is `runAsUser` or `runAsGroup` set to `0` or to +the image default, or `fsGroup` set to `0`. Root values are refused unless the +cluster allows them. The setting is `allowRootOverrides`, and it is separate for +each cluster and off by default. An administrator sets it under Clusters, the +cluster, Configuration, with `PUT /security-settings?cluster=` and body +`{"allowRootOverrides": true}`. `GET /security-settings?cluster=` reads it and +needs `config:read`; the PUT needs `config:manage`. + +The value is stored in one ConfigMap per cluster, `gameplane-security-settings`, +in that cluster's operator control-plane namespace. Its key `allowRootOverrides` +is `"true"` or `"false"`. Any other value, a missing key or a missing ConfigMap +reads as off. The operator's Helm chart creates the ConfigMap with `"false"` and +the annotation `helm.sh/resource-policy: keep`, so an uninstall keeps it. On +upgrade the chart reads the current value back, so an upgrade never flips the +setting. The API never creates the ConfigMap. If it is deleted, the setting reads +as off until the next `helm upgrade`. For a remote cluster, the API uses the +namespace recorded on its registration, `Cluster.spec.controlPlaneNamespace` +(default `gameplane`). A wrong namespace cannot turn the setting on. The ConfigMap +is then not found, GET reports `present: false`, and PUT returns 409 +`server.cluster.security_settings_missing`. + +Two layers enforce the rule, and both fail closed: + +- The API refuses a create or update that saves a new or changed root value + while the setting is off, with 403 `server.security.root_disabled`. +- The operator does not start a stopped server that holds a saved root override + while the setting is off. Its replicas stay at zero, and the condition + `SecurityAllowed` is `False` with reason `RootOverrideDisallowed`. A server + that is already running keeps running. + +**Applied filesystem group for backups.** Backup and restore jobs use the +filesystem group the server last started with, not the value it will start with +next. A pending change to `fsGroup` therefore does not change how a backup reads +the data volume. + +**Ownership check trade-off.** `EveryStart` re-applies the group to every file on +each start, which is always correct and slow on large volumes. `OnlyWhenWrong` +starts faster but leaves files deeper in the volume with their current owner. +See the module authoring guide for the built-in default. + +**Audit trail.** Create, update, clone and refusal of an override write an audit +row, and so does each flip of `allowRootOverrides` (target `security/`, +reason `allowRootOverrides:false->true` or `true->false`). If the flip is recorded +but the ConfigMap update fails, a second row with reason `security_save_failed` +is written and the API returns 502. The audit schema is unchanged. + +**Writers that bypass the API.** Anyone with Kubernetes write access to a +`GameServer` or to the `gameplane-security-settings` ConfigMap can set these values +without the API checks or audit rows. The operator still applies the root hold to +every server it reconciles, so write access to the ConfigMap is equivalent to the +setting itself. Restrict it with Kubernetes RBAC. + ## Module supply chain A `GameTemplate` materialized from a module chooses the container image, diff --git a/gp-module/internal/preview/preview.go b/gp-module/internal/preview/preview.go index efb86763e..7154f771e 100644 --- a/gp-module/internal/preview/preview.go +++ b/gp-module/internal/preview/preview.go @@ -56,6 +56,7 @@ type Result struct { EffectiveEnv map[string]string `json:"effectiveEnv"` Ports []PortPreview `json:"ports"` Storage StoragePreview `json:"storage"` + Security *SecurityPreview `json:"security,omitempty"` RenderedManifest string `json:"renderedManifest,omitempty"` } @@ -294,6 +295,12 @@ func GeneratePreview(opts Options) (*Result, error) { storage.MountPath, _ = storMap["mountPath"].(string) } + // Security: resolved module defaults, ownership policy and risky settings. + var security *SecurityPreview + if secMap, ok := spec["security"].(map[string]any); ok { + security = buildSecurityPreview(secMap) + } + return &Result{ Game: game, DisplayName: displayName, @@ -305,6 +312,7 @@ func GeneratePreview(opts Options) (*Result, error) { EffectiveEnv: effectiveEnv, Ports: ports, Storage: storage, + Security: security, }, nil } @@ -360,6 +368,9 @@ func (p *Result) FormatHuman() string { fmt.Fprintf(&sb, " - %d/%s (%s)\n", port.ContainerPort, port.Protocol, port.Name) } } + sb.WriteString("\n") + + sb.WriteString(formatSecurityHuman(p.Security)) return sb.String() } diff --git a/gp-module/internal/preview/preview_security_test.go b/gp-module/internal/preview/preview_security_test.go new file mode 100644 index 000000000..319e6418f --- /dev/null +++ b/gp-module/internal/preview/preview_security_test.go @@ -0,0 +1,172 @@ +package preview + +import ( + "strings" + "testing" +) + +// secPreviewTemplate returns a minimal template.yaml with the given spec.security block. +func secPreviewTemplate(security string) []byte { + return []byte("apiVersion: gameplane.local/v1alpha1\n" + + "kind: GameTemplate\n" + + "metadata:\n name: sec-demo\n" + + "spec:\n" + + " game: sec-demo\n" + + " displayName: Security Demo\n" + + " image: example/sec-demo:1\n" + + " storage:\n size: 1Gi\n mountPath: /data\n" + + security) +} + +func TestPreview_SecurityResolvedDefaults(t *testing.T) { + res, err := GeneratePreview(Options{TemplateYAML: secPreviewTemplate( + " security:\n" + + " runAsUser: 2000\n" + + " runAsGroup: 2000\n" + + " fsGroup: 1000\n")}) + if err != nil { + t.Fatalf("GeneratePreview: %v", err) + } + if res.Security == nil { + t.Fatal("Security = nil, want resolved block") + } + s := res.Security + if s.RunAsUser == nil || *s.RunAsUser != 2000 { + t.Errorf("RunAsUser = %v, want 2000", s.RunAsUser) + } + if s.RunAsGroup == nil || *s.RunAsGroup != 2000 { + t.Errorf("RunAsGroup = %v, want 2000", s.RunAsGroup) + } + if s.FSGroup == nil || *s.FSGroup != 1000 { + t.Errorf("FSGroup = %v, want 1000", s.FSGroup) + } + if s.VolumeOwnershipCheck != "OnlyWhenWrong" || s.OwnershipCheckSource != "built-in default" { + t.Errorf("ownership = %q (%q), want OnlyWhenWrong (built-in default)", s.VolumeOwnershipCheck, s.OwnershipCheckSource) + } + if s.OwnershipCheckNoEffect { + t.Error("OwnershipCheckNoEffect = true with fsGroup set") + } + if len(s.Risky) != 0 { + t.Errorf("Risky = %+v, want none", s.Risky) + } +} + +func TestPreview_SecurityExplicitOwnershipCheck(t *testing.T) { + res, err := GeneratePreview(Options{TemplateYAML: secPreviewTemplate( + " security:\n" + + " fsGroup: 1000\n" + + " volumeOwnershipCheck: EveryStart\n")}) + if err != nil { + t.Fatalf("GeneratePreview: %v", err) + } + s := res.Security + if s == nil { + t.Fatal("Security = nil") + } + if s.VolumeOwnershipCheck != "EveryStart" || s.OwnershipCheckSource != "template" { + t.Errorf("ownership = %q (%q), want EveryStart (template)", s.VolumeOwnershipCheck, s.OwnershipCheckSource) + } + if s.RunAsUser != nil { + t.Errorf("RunAsUser = %v, want unset (image default)", s.RunAsUser) + } +} + +func TestPreview_SecurityOwnershipWithoutFSGroupHasNoEffect(t *testing.T) { + res, err := GeneratePreview(Options{TemplateYAML: secPreviewTemplate( + " security:\n volumeOwnershipCheck: EveryStart\n")}) + if err != nil { + t.Fatalf("GeneratePreview: %v", err) + } + s := res.Security + if s == nil { + t.Fatal("Security = nil") + } + if !s.OwnershipCheckNoEffect { + t.Error("OwnershipCheckNoEffect = false, want true without fsGroup") + } + out := res.FormatHuman() + if !strings.Contains(out, "EveryStart (no effect: fsGroup is not set)") { + t.Errorf("FormatHuman missing no-effect marker:\n%s", out) + } +} + +func TestPreview_SecurityNoFSGroupNoPolicyIsNotApplicable(t *testing.T) { + res, err := GeneratePreview(Options{TemplateYAML: secPreviewTemplate( + " security:\n runAsUser: 1000\n")}) + if err != nil { + t.Fatalf("GeneratePreview: %v", err) + } + out := res.FormatHuman() + if !strings.Contains(out, "not applicable (no fsGroup)") { + t.Errorf("FormatHuman missing not-applicable line:\n%s", out) + } +} + +func TestPreview_SecurityRiskyWithReasons(t *testing.T) { + res, err := GeneratePreview(Options{TemplateYAML: secPreviewTemplate( + " security:\n" + + " runAsUser: 2000\n" + + " fsGroup: 1000\n" + + " risky:\n" + + " fsGroup:\n" + + " reason: The data directory is owned by gid 1000.\n" + + " runAsUser:\n" + + " reason: The image only starts as uid 2000.\n" + + " volumeOwnershipCheck: {}\n")}) + if err != nil { + t.Fatalf("GeneratePreview: %v", err) + } + risky := res.Security.Risky + if len(risky) != 3 { + t.Fatalf("Risky = %+v, want 3 entries", risky) + } + // Fixed order: runAsUser, runAsGroup, fsGroup, volumeOwnershipCheck. + wantOrder := []string{"runAsUser", "fsGroup", "volumeOwnershipCheck"} + for i, want := range wantOrder { + if risky[i].Setting != want { + t.Errorf("Risky[%d].Setting = %q, want %q", i, risky[i].Setting, want) + } + } + if risky[0].Reason != "The image only starts as uid 2000." { + t.Errorf("runAsUser reason = %q", risky[0].Reason) + } + if risky[2].Reason != "" { + t.Errorf("volumeOwnershipCheck reason = %q, want empty", risky[2].Reason) + } + + out := res.FormatHuman() + for _, want := range []string{ + "runAsUser:", + "2000 (module default)", + "risky settings:", + "- runAsUser: The image only starts as uid 2000.", + "- fsGroup: The data directory is owned by gid 1000.", + "- volumeOwnershipCheck: no reason given", + } { + if !strings.Contains(out, want) { + t.Errorf("FormatHuman missing %q:\n%s", want, out) + } + } +} + +func TestPreview_SecurityAbsentPrintsImageDefault(t *testing.T) { + res, err := GeneratePreview(Options{TemplateYAML: secPreviewTemplate("")}) + if err != nil { + t.Fatalf("GeneratePreview: %v", err) + } + if res.Security != nil { + t.Errorf("Security = %+v, want nil without a security block", res.Security) + } + out := res.FormatHuman() + if !strings.Contains(out, "image default (template sets no security block)") { + t.Errorf("FormatHuman missing image-default line:\n%s", out) + } + + js, err := res.ToJSON() + if err != nil { + t.Fatalf("ToJSON: %v", err) + } + if strings.Contains(string(js), `"security"`) { + t.Errorf("JSON gained a security key for a template without one:\n%s", js) + } +} diff --git a/gp-module/internal/preview/security.go b/gp-module/internal/preview/security.go new file mode 100644 index 000000000..20abc0cad --- /dev/null +++ b/gp-module/internal/preview/security.go @@ -0,0 +1,150 @@ +package preview + +import ( + "fmt" + "math" + "strings" +) + +// Module default ownership policy names, as the template contract spells them. +const ( + ownershipEveryStart = "EveryStart" + ownershipOnlyWrong = "OnlyWhenWrong" + ownershipSourceTmpl = "template" + ownershipSourceBuilt = "built-in default" +) + +// RiskyPreview is one template-marked risky setting with its reason. +type RiskyPreview struct { + Setting string `json:"setting"` + Reason string `json:"reason,omitempty"` +} + +// SecurityPreview is the resolved spec.security block of a template: the +// module defaults that a server inherits unless its owner overrides them. +type SecurityPreview struct { + RunAsUser *int64 `json:"runAsUser,omitempty"` + RunAsGroup *int64 `json:"runAsGroup,omitempty"` + FSGroup *int64 `json:"fsGroup,omitempty"` + // VolumeOwnershipCheck is the resolved policy. It is empty when the + // template has no fsGroup and sets no policy, because nothing applies. + VolumeOwnershipCheck string `json:"volumeOwnershipCheck,omitempty"` + // OwnershipCheckSource says where VolumeOwnershipCheck came from. + OwnershipCheckSource string `json:"ownershipCheckSource,omitempty"` + // OwnershipCheckNoEffect is true when a policy is set without an fsGroup. + OwnershipCheckNoEffect bool `json:"ownershipCheckNoEffect,omitempty"` + Risky []RiskyPreview `json:"risky,omitempty"` +} + +// securityRiskOrder is the fixed order in which risky settings are listed. +var securityRiskOrder = []string{"runAsUser", "runAsGroup", "fsGroup", "volumeOwnershipCheck"} + +// toInt64Ptr converts a decoded YAML number to *int64. It returns nil for a +// missing value or a non-integral one; the validator reports those. +func toInt64Ptr(v any) *int64 { + var out int64 + switch n := v.(type) { + case int: + out = int64(n) + case int64: + out = n + case uint64: + if n > math.MaxInt64 { + return nil + } + out = int64(n) + case float64: + if n != float64(int64(n)) { + return nil + } + out = int64(n) + default: + return nil + } + return &out +} + +// buildSecurityPreview resolves a decoded spec.security mapping. +func buildSecurityPreview(sec map[string]any) *SecurityPreview { + out := &SecurityPreview{ + RunAsUser: toInt64Ptr(sec["runAsUser"]), + RunAsGroup: toInt64Ptr(sec["runAsGroup"]), + FSGroup: toInt64Ptr(sec["fsGroup"]), + } + + explicit, _ := sec["volumeOwnershipCheck"].(string) + switch { + case out.FSGroup != nil: + // The policy only acts on a filesystem group. Omitted means OnlyWhenWrong. + out.VolumeOwnershipCheck = ownershipOnlyWrong + out.OwnershipCheckSource = ownershipSourceBuilt + if explicit != "" { + out.VolumeOwnershipCheck = explicit + out.OwnershipCheckSource = ownershipSourceTmpl + } + case explicit != "": + out.VolumeOwnershipCheck = explicit + out.OwnershipCheckSource = ownershipSourceTmpl + out.OwnershipCheckNoEffect = true + } + + risky, _ := sec["risky"].(map[string]any) + for _, name := range securityRiskOrder { + member, marked := risky[name] + if !marked { + continue + } + reason := "" + if m, ok := member.(map[string]any); ok { + reason, _ = m["reason"].(string) + } + out.Risky = append(out.Risky, RiskyPreview{Setting: name, Reason: reason}) + } + + return out +} + +// formatSecurityHuman renders the resolved security block for the terminal. +func formatSecurityHuman(s *SecurityPreview) string { + var sb strings.Builder + sb.WriteString("Security Context:\n") + if s == nil { + sb.WriteString(" image default (template sets no security block)\n") + return sb.String() + } + + fmt.Fprintf(&sb, " %-22s %s\n", "runAsUser:", uidText(s.RunAsUser)) + fmt.Fprintf(&sb, " %-22s %s\n", "runAsGroup:", uidText(s.RunAsGroup)) + fmt.Fprintf(&sb, " %-22s %s\n", "fsGroup:", uidText(s.FSGroup)) + + switch { + case s.VolumeOwnershipCheck == "": + fmt.Fprintf(&sb, " %-22s %s\n", "volumeOwnershipCheck:", "not applicable (no fsGroup)") + case s.OwnershipCheckNoEffect: + fmt.Fprintf(&sb, " %-22s %s (no effect: fsGroup is not set)\n", "volumeOwnershipCheck:", s.VolumeOwnershipCheck) + default: + fmt.Fprintf(&sb, " %-22s %s (%s)\n", "volumeOwnershipCheck:", s.VolumeOwnershipCheck, s.OwnershipCheckSource) + } + + if len(s.Risky) == 0 { + fmt.Fprintf(&sb, " %-22s %s\n", "risky settings:", "none") + return sb.String() + } + sb.WriteString(" risky settings:\n") + for _, r := range s.Risky { + reason := r.Reason + if reason == "" { + reason = "no reason given" + } + fmt.Fprintf(&sb, " - %s: %s\n", r.Setting, reason) + } + return sb.String() +} + +// uidText shows a template value, or the image default when none is set. +func uidText(v *int64) string { + if v == nil { + return "image default" + } + return fmt.Sprintf("%d (module default)", *v) +} diff --git a/gp-module/internal/validator/rules.go b/gp-module/internal/validator/rules.go index b30e012b0..5066fb922 100644 --- a/gp-module/internal/validator/rules.go +++ b/gp-module/internal/validator/rules.go @@ -620,3 +620,97 @@ func validateAssetSizes(iconSize int64, totalSize int64) []Finding { return findings } + +// securityRiskSettings lists the template security settings that a +// spec.security.risky member may name (contracts/crd-gametemplate-security.md). +var securityRiskSettings = []string{"runAsUser", "runAsGroup", "fsGroup", "volumeOwnershipCheck"} + +// maxSecurityRiskReasonLength mirrors the GameTemplate CRD bound on SecurityRiskNote.reason. +const maxSecurityRiskReasonLength = 200 + +// isSecurityRiskSetting reports whether name is one of the settings a risky member may mark. +func isSecurityRiskSetting(name string) bool { + for _, s := range securityRiskSettings { + if s == name { + return true + } + } + return false +} + +// hasYAMLValue reports whether a mapping value is present and not an explicit null. +func hasYAMLValue(n *yaml.Node) bool { + return n != nil && n.Tag != "!!null" +} + +// validateSecurityRisky checks spec.security.risky: every member must name one +// of the four security settings, and every reason must fit the 200-character +// CRD bound. +func validateSecurityRisky(node *yaml.Node) []Finding { + riskyNode := common.FindNode(node, "spec.security.risky") + if riskyNode == nil || riskyNode.Kind != yaml.MappingNode { + return nil + } + + var findings []Finding + for i := 0; i+1 < len(riskyNode.Content); i += 2 { + keyNode := riskyNode.Content[i] + valNode := riskyNode.Content[i+1] + name := keyNode.Value + + if !isSecurityRiskSetting(name) { + findings = append(findings, Finding{ + Level: SeverityError, + RuleID: RuleTemplateSchemaViolation, + File: "template.yaml", + Line: keyNode.Line, + Column: keyNode.Column, + Field: "spec.security.risky." + name, + Message: fmt.Sprintf("risky marks %q, which is not a security setting", name), + Remediation: "Name one of runAsUser, runAsGroup, fsGroup or volumeOwnershipCheck under spec.security.risky.", + }) + } + + reasonNode := common.FindNode(valNode, "reason") + if reasonNode != nil && reasonNode.Kind == yaml.ScalarNode { + if n := len([]rune(reasonNode.Value)); n > maxSecurityRiskReasonLength { + findings = append(findings, Finding{ + Level: SeverityError, + RuleID: RuleTemplateSchemaViolation, + File: "template.yaml", + Line: reasonNode.Line, + Column: reasonNode.Column, + Field: "spec.security.risky." + name + ".reason", + Message: fmt.Sprintf("risky reason for %q is %d characters; the limit is %d", name, n, maxSecurityRiskReasonLength), + Remediation: "Shorten the reason to one sentence that says what breaks when the value is changed.", + }) + } + } + } + + return findings +} + +// validateSecurityOwnershipCheck warns when spec.security.volumeOwnershipCheck +// is set without spec.security.fsGroup: the ownership check only acts on a +// filesystem group, so the setting has no effect. +func validateSecurityOwnershipCheck(node *yaml.Node) []Finding { + ownNode := common.FindNode(node, "spec.security.volumeOwnershipCheck") + if !hasYAMLValue(ownNode) { + return nil + } + if hasYAMLValue(common.FindNode(node, "spec.security.fsGroup")) { + return nil + } + + return []Finding{{ + Level: SeverityWarn, + RuleID: RuleTemplateSchemaViolation, + File: "template.yaml", + Line: ownNode.Line, + Column: ownNode.Column, + Field: "spec.security.volumeOwnershipCheck", + Message: "volumeOwnershipCheck has no effect because spec.security.fsGroup is not set", + Remediation: "Set spec.security.fsGroup, or remove spec.security.volumeOwnershipCheck.", + }} +} diff --git a/gp-module/internal/validator/rules_security_test.go b/gp-module/internal/validator/rules_security_test.go new file mode 100644 index 000000000..ca9c88d50 --- /dev/null +++ b/gp-module/internal/validator/rules_security_test.go @@ -0,0 +1,200 @@ +package validator + +import ( + "strings" + "testing" + + "gopkg.in/yaml.v3" + + "github.com/GameplanePanel/gameplane/gp-module/internal/common" +) + +// secTemplate builds a minimal template.yaml whose spec.security block is the +// given YAML fragment (already indented under "spec:"). +func secTemplate(security string) string { + return "apiVersion: gameplane.local/v1alpha1\n" + + "kind: GameTemplate\n" + + "metadata:\n name: sec-demo\n" + + "spec:\n" + + " game: sec-demo\n" + + " image: example/sec-demo@sha256:" + strings.Repeat("a", 64) + "\n" + + " displayName: Security Demo\n" + + security +} + +func parseSecTemplate(t *testing.T, src string) *yaml.Node { + t.Helper() + node, err := common.ParseYAMLNode([]byte(src)) + if err != nil { + t.Fatalf("parse template: %v", err) + } + return node +} + +func securityFindings(findings []Finding) []Finding { + var out []Finding + for _, f := range findings { + if strings.HasPrefix(f.Field, "spec.security.") { + out = append(out, f) + } + } + return out +} + +func TestValidateSecurityRisky_Cases(t *testing.T) { + longReason := strings.Repeat("r", 200) + tooLongReason := strings.Repeat("r", 201) + + tests := []struct { + name string + security string + wantCount int + wantField string + }{ + { + name: "no security block", + security: "", + wantCount: 0, + }, + { + name: "no risky map", + security: " security:\n fsGroup: 1000\n", + wantCount: 0, + }, + { + name: "risky names each setting with a reason", + security: " security:\n runAsUser: 2000\n risky:\n runAsUser:\n reason: Image only works as uid 2000.\n fsGroup: {}\n", + wantCount: 0, + }, + { + name: "risky key that is not a setting", + security: " security:\n risky:\n hostNetwork:\n reason: nope\n", + wantCount: 1, + wantField: "spec.security.risky.hostNetwork", + }, + { + name: "risky key with a null value is still a setting check", + security: " security:\n risky:\n runAsGroupX:\n", + wantCount: 1, + wantField: "spec.security.risky.runAsGroupX", + }, + { + name: "reason exactly 200 characters is accepted", + security: " security:\n risky:\n runAsUser:\n reason: " + longReason + "\n", + wantCount: 0, + }, + { + name: "reason of 201 characters is an error", + security: " security:\n risky:\n runAsUser:\n reason: " + tooLongReason + "\n", + wantCount: 1, + wantField: "spec.security.risky.runAsUser.reason", + }, + { + name: "two bad members give two findings", + security: " security:\n risky:\n bogus:\n reason: " + tooLongReason + "\n", + wantCount: 2, + wantField: "spec.security.risky.bogus", + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + node := parseSecTemplate(t, secTemplate(tc.security)) + got := validateSecurityRisky(node) + if len(got) != tc.wantCount { + t.Fatalf("validateSecurityRisky findings = %d, want %d: %+v", len(got), tc.wantCount, got) + } + for _, f := range got { + if f.Level != SeverityError { + t.Errorf("level = %s, want ERROR", f.Level) + } + if f.RuleID != RuleTemplateSchemaViolation { + t.Errorf("ruleID = %s, want %s", f.RuleID, RuleTemplateSchemaViolation) + } + } + if tc.wantField != "" && (len(got) == 0 || got[0].Field != tc.wantField) { + t.Errorf("first field = %v, want %s", got, tc.wantField) + } + }) + } +} + +func TestValidateSecurityOwnershipCheck_Cases(t *testing.T) { + tests := []struct { + name string + security string + wantCount int + }{ + { + name: "no ownership check", + security: " security:\n fsGroup: 1000\n", + wantCount: 0, + }, + { + name: "ownership check with fsGroup", + security: " security:\n fsGroup: 1000\n volumeOwnershipCheck: EveryStart\n", + wantCount: 0, + }, + { + name: "ownership check without fsGroup warns", + security: " security:\n volumeOwnershipCheck: EveryStart\n", + wantCount: 1, + }, + { + name: "null fsGroup does not count as set", + security: " security:\n fsGroup:\n volumeOwnershipCheck: OnlyWhenWrong\n", + wantCount: 1, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + node := parseSecTemplate(t, secTemplate(tc.security)) + got := validateSecurityOwnershipCheck(node) + if len(got) != tc.wantCount { + t.Fatalf("validateSecurityOwnershipCheck findings = %d, want %d: %+v", len(got), tc.wantCount, got) + } + for _, f := range got { + if f.Level != SeverityWarn { + t.Errorf("level = %s, want WARN", f.Level) + } + if f.Field != "spec.security.volumeOwnershipCheck" { + t.Errorf("field = %s, want spec.security.volumeOwnershipCheck", f.Field) + } + if f.Line == 0 { + t.Errorf("line = 0, want the line of volumeOwnershipCheck") + } + } + }) + } +} + +// TestValidateFiles_SecurityChecksAreWired proves the checks run from +// ValidateFiles, not only when the functions are called directly. +func TestValidateFiles_SecurityChecksAreWired(t *testing.T) { + src := secTemplate(" security:\n" + + " volumeOwnershipCheck: EveryStart\n" + + " risky:\n" + + " hostNetwork:\n reason: nope\n") + + report, err := ValidateFiles("sec-demo", map[string][]byte{"template.yaml": []byte(src)}, ValidateOptions{}) + if err != nil { + t.Fatalf("ValidateFiles: %v", err) + } + + var sawRisky, sawOwnership bool + for _, f := range securityFindings(report.Findings) { + switch f.Field { + case "spec.security.risky.hostNetwork": + sawRisky = f.Level == SeverityError + case "spec.security.volumeOwnershipCheck": + sawOwnership = f.Level == SeverityWarn + } + } + if !sawRisky { + t.Errorf("risky key error not reported by ValidateFiles: %+v", report.Findings) + } + if !sawOwnership { + t.Errorf("ownership warning not reported by ValidateFiles: %+v", report.Findings) + } +} diff --git a/gp-module/internal/validator/validator.go b/gp-module/internal/validator/validator.go index 9859a8c4e..9b3fb13d3 100644 --- a/gp-module/internal/validator/validator.go +++ b/gp-module/internal/validator/validator.go @@ -168,6 +168,8 @@ func ValidateFiles(dirName string, files map[string][]byte, opts ValidateOptions findings = append(findings, validateImageDigest(node, string(tmplBytes))...) findings = append(findings, validatePorts(node)...) findings = append(findings, validateConfigSchemaRules(node)...) + findings = append(findings, validateSecurityRisky(node)...) + findings = append(findings, validateSecurityOwnershipCheck(node)...) findings = append(findings, validatePlayerQuery(node)...) } } diff --git a/gp-module/specs.md b/gp-module/specs.md index 82766fed5..21a1b555f 100644 --- a/gp-module/specs.md +++ b/gp-module/specs.md @@ -23,6 +23,8 @@ $$\text{mib} = \lfloor \text{bytes} \times \text{percent} / 100 / (1024 \times 1024) \rfloor \implies \text{"M"}$$ - Export valid OCI artifact bundles matching Gameplane's canonical media types and annotations. - Provide Go library functions under `pkg/` (backed by `internal/`) reusable by `api/` for web dashboard integration. +- Check the template's `spec.security` offline. `validateSecurityRisky` and `validateSecurityOwnershipCheck` in `internal/validator/rules.go` run from `validator.go` next to `validateConfigSchemaRules`. A `risky` member must be one of `runAsUser`, `runAsGroup`, `fsGroup` or `volumeOwnershipCheck` (error otherwise), a `risky` reason may be at most 200 characters (`maxSecurityRiskReasonLength`, error), and `volumeOwnershipCheck` without `fsGroup` is a warning. All three report under `RuleTemplateSchemaViolation`. +- Show the resolved security defaults, the ownership policy and the risky settings with their reasons in `preview` output. `internal/preview/security.go` (`buildSecurityPreview`) builds the block; `Result.Security` in `internal/preview/preview.go` carries it and `FormatHuman` prints it. With `fsGroup` set and no policy, the resolved ownership policy is `OnlyWhenWrong` (built-in default); a policy without `fsGroup` is flagged as having no effect. ## Non-goals / boundaries diff --git a/i18n/locales/en/app.json b/i18n/locales/en/app.json index 9f3403281..7d2befa4d 100644 --- a/i18n/locales/en/app.json +++ b/i18n/locales/en/app.json @@ -891,6 +891,10 @@ "defaultMessage": "bad request", "description": "API error for a malformed request that does not fit a more specific message." }, + "server.cluster.security_settings_missing": { + "defaultMessage": "the security settings ConfigMap is missing on this cluster; run helm upgrade to recreate it", + "description": "API error from the cluster security settings API (security_settings.go) when the gameplane-security-settings ConfigMap is not found on the cluster. Nothing is written." + }, "server.cluster_forbidden": { "defaultMessage": "cluster not permitted", "description": "API error when the ?cluster= query value names a cluster the caller may not use or that is unknown." @@ -1131,6 +1135,18 @@ "defaultMessage": "role not found", "description": "API error from the roles API (roles.go:del, roles.go:update)." }, + "server.security.forbidden": { + "defaultMessage": "changing security settings requires the servers:security permission", + "description": "API error from the GameServer save path (security_overrides.go) when a caller without servers:security changes spec.security." + }, + "server.security.invalid": { + "defaultMessage": "invalid security override: {detail}", + "description": "API error from the GameServer save path when spec.security has an invalid shape. Argument setting names the offending setting; argument detail says what is wrong." + }, + "server.security.root_disabled": { + "defaultMessage": "root values (user 0, group 0, filesystem group 0, or the image default for user or group) are not allowed on this cluster until an administrator allows root overrides in that cluster's Configuration", + "description": "API error from the GameServer save path when a new or changed root value is saved while the cluster's allow-root-overrides setting is off. Argument setting names the first offending setting." + }, "server.shares.expires_at_in_past": { "defaultMessage": "expiresAt must be in the future", "description": "API error from the share-links API (shares.go:createShareHandler)." @@ -1471,6 +1487,70 @@ "defaultMessage": "Cluster unavailable", "description": "Cluster detail requested registration is absent or inaccessible" }, + "web.clusters.control_plane_namespace_detail_label": { + "defaultMessage": "Control-plane namespace", + "description": "Cluster overview: label for the namespace where this remote cluster's Gameplane operator runs" + }, + "web.clusters.control_plane_namespace_field_label": { + "defaultMessage": "Control-plane namespace (optional)", + "description": "Register cluster dialog: label for the namespace field where the cluster's Gameplane operator runs" + }, + "web.clusters.control_plane_namespace_help": { + "defaultMessage": "Namespace where this cluster's Gameplane operator runs. Leave gameplane unless it was installed elsewhere; a wrong value shows the cluster's root setting as missing.", + "description": "Register cluster dialog: help text under the control-plane namespace field; gameplane is the default namespace name, not translated" + }, + "web.clusters.control_plane_namespace_invalid": { + "defaultMessage": "Use a lowercase DNS label: lowercase letters, digits and dashes, starting and ending with a letter or digit, at most 63 characters.", + "description": "Register cluster dialog: validation error when the control-plane namespace is not a lowercase DNS label; DNS label is a technical term, usually left untranslated" + }, + "web.clusters.security_denied": { + "defaultMessage": "You don't have permission to view this cluster's security settings.", + "description": "Cluster security settings: access denied when the user cannot read configuration" + }, + "web.clusters.security_load_error": { + "defaultMessage": "Couldn't load this cluster's security settings.", + "description": "Cluster security settings: error shown when the settings cannot be fetched; a retry button appears below it" + }, + "web.clusters.security_loading": { + "defaultMessage": "Loading security settings…", + "description": "Cluster security settings: loading text while the settings are fetched" + }, + "web.clusters.security_loading_permissions": { + "defaultMessage": "Loading permissions…", + "description": "Cluster security settings: identity loading state" + }, + "web.clusters.security_missing_body": { + "defaultMessage": "This cluster's security settings were not found. Run helm upgrade for Gameplane on this cluster, then reload this page.", + "description": "Cluster security settings: warning body when the security settings are missing; helm upgrade is a command name, usually left untranslated" + }, + "web.clusters.security_missing_title": { + "defaultMessage": "Security settings missing", + "description": "Cluster security settings: warning title when the cluster's security ConfigMap is not found" + }, + "web.clusters.security_permissions_error": { + "defaultMessage": "Couldn't load your permissions.", + "description": "Cluster security settings: identity loading failure" + }, + "web.clusters.security_root_help": { + "defaultMessage": "Lets server owners run a game as root (user or group 0), or with the image's default user. Off by default, set per cluster.", + "description": "Cluster security settings: help text under the allow root overrides switch" + }, + "web.clusters.security_root_label": { + "defaultMessage": "Allow root overrides", + "description": "Cluster security settings: label of the switch that allows game servers to run as root or the image default user" + }, + "web.clusters.security_root_note": { + "defaultMessage": "Turning this off does not stop running servers on this cluster. Stopped servers that hold a root override will not start until the override is cleared or this is turned back on.", + "description": "Cluster security settings: note explaining that disabling root overrides does not stop running servers but blocks stopped servers with a root override from starting" + }, + "web.clusters.security_subtitle": { + "defaultMessage": "How game servers on this cluster may run.", + "description": "Cluster security settings: subtitle under the Security section title" + }, + "web.clusters.security_title": { + "defaultMessage": "Security", + "description": "Cluster security settings: title of the section card for one cluster" + }, "web.common.close_glyph": { "defaultMessage": "×", "description": "Multiplication sign used as the close icon on dismiss buttons" @@ -6843,6 +6923,14 @@ "defaultMessage": "Address preference ignored", "description": "Create server: warning title of a notice shown when an address pool or requested address is set but Expose is not LoadBalancer" }, + "web.routes.create_server.advanced_invalid": { + "defaultMessage": "Fix the Advanced security values before continuing.", + "description": "Create server: reason the Configure step cannot continue because a security override is not a whole number from 0 to 4294967295" + }, + "web.routes.create_server.advanced_refused_title": { + "defaultMessage": "Not created: security settings refused", + "description": "Create server: error title when the API refuses the Advanced security overrides" + }, "web.routes.create_server.back": { "defaultMessage": "Back", "description": "Create server: footer button that returns to the previous wizard step; keep it short" @@ -8235,6 +8323,194 @@ "defaultMessage": "Wake", "description": "Server detail: header button that wakes a sleeping server; disabled without control access; keep it short" }, + "web.routes.server_settings.security_advanced_title": { + "defaultMessage": "Advanced security", + "description": "Advanced security: title of the collapsible security section on the server settings and create-server pages" + }, + "web.routes.server_settings.security_applied": { + "defaultMessage": "Applied: {value}", + "description": "Advanced security: status line showing the value the running server applied; {value} is the value, a number or a word such as image default" + }, + "web.routes.server_settings.security_check_built_in": { + "defaultMessage": "Only when wrong (built-in)", + "description": "Advanced security: module default text for the volume ownership check when the module sets none; the built-in Gameplane default is Only when wrong" + }, + "web.routes.server_settings.security_check_every_start": { + "defaultMessage": "Every start", + "description": "Advanced security: volume ownership check that runs on every start" + }, + "web.routes.server_settings.security_check_only_when_wrong": { + "defaultMessage": "Only when wrong", + "description": "Advanced security: volume ownership check that runs only when the data volume's group is wrong" + }, + "web.routes.server_settings.security_description": { + "defaultMessage": "Who the game runs as, and how the data volume's group is fixed. Leave a setting on Module default unless the game needs something else.", + "description": "Advanced security: description under the Advanced security title" + }, + "web.routes.server_settings.security_file_warning_body": { + "defaultMessage": "This server already has data. After the next restart the game runs with the new user or group. Files written before keep their old owner; if the game cannot read or change them, set a filesystem group or clear the override. Saving does not restart the server.", + "description": "Settings: body of the confirmation shown before saving a new run-as user or group on a server that already has data; explains files keep their old owner and saving does not restart" + }, + "web.routes.server_settings.security_file_warning_confirm": { + "defaultMessage": "Save anyway", + "description": "Settings: confirm button label in the run-as user or group warning, saving the change despite the existing files" + }, + "web.routes.server_settings.security_file_warning_title": { + "defaultMessage": "Change who the game runs as?", + "description": "Settings: title of the confirmation shown before saving a new run-as user or group on a server that already has data" + }, + "web.routes.server_settings.security_fs_group": { + "defaultMessage": "Filesystem group", + "description": "Advanced security: label of the setting for the group that owns the data volume" + }, + "web.routes.server_settings.security_fs_group_help": { + "defaultMessage": "Group that owns the data volume, so the game can write to it.", + "description": "Advanced security: help text under the Filesystem group label" + }, + "web.routes.server_settings.security_held_back_running_body": { + "defaultMessage": "A root override is set, and root overrides are off on this cluster. The server keeps running. It will not start again until the override is cleared or an administrator allows root overrides in that cluster's Configuration.", + "description": "Advanced security: default warning body when a running server holds a root override the cluster does not allow" + }, + "web.routes.server_settings.security_held_back_running_title": { + "defaultMessage": "Keeps running, but will not start again", + "description": "Advanced security: warning title when a server with a root override is running but cannot start again because root overrides are off" + }, + "web.routes.server_settings.security_held_back_stopped_body": { + "defaultMessage": "A root override is set, and root overrides are off on this cluster. Clear the override, or ask an administrator to allow root overrides in that cluster's Configuration.", + "description": "Advanced security: default warning body when a stopped server holds a root override the cluster does not allow" + }, + "web.routes.server_settings.security_held_back_stopped_title": { + "defaultMessage": "Will not start: root override not allowed", + "description": "Advanced security: warning title when a stopped server has a root override that the cluster does not allow" + }, + "web.routes.server_settings.security_id_range_error": { + "defaultMessage": "Enter a whole number from 0 to 4294967295.", + "description": "Advanced security: error under a numeric ID box when the entry is not a whole number from 0 to 4294967295" + }, + "web.routes.server_settings.security_mode_custom_value": { + "defaultMessage": "Custom value", + "description": "Advanced security: option in the setting's dropdown that lets the owner type a numeric ID" + }, + "web.routes.server_settings.security_mode_module_default": { + "defaultMessage": "Module default", + "description": "Advanced security: option in the setting's dropdown that keeps the module's default value" + }, + "web.routes.server_settings.security_mode_use_image_default": { + "defaultMessage": "Use image default", + "description": "Advanced security: option in the setting's dropdown that uses the container image's default user or group" + }, + "web.routes.server_settings.security_module_default_value": { + "defaultMessage": "Module default: {value}", + "description": "Advanced security: line under a setting that shows the value the game module sets; {value} is a number or the words image default" + }, + "web.routes.server_settings.security_next_start": { + "defaultMessage": "Next start: {value}", + "description": "Advanced security: status line showing the value the server will use on its next start, before it has ever started; {value} is the value" + }, + "web.routes.server_settings.security_no_fs_group": { + "defaultMessage": "No effect: no filesystem group", + "description": "Advanced security: chip on the volume ownership check when no filesystem group applies, so the check does nothing" + }, + "web.routes.server_settings.security_override_count": { + "defaultMessage": "{count, plural, one {# override} other {# overrides}}", + "description": "Advanced security: chip with the number of settings the owner has overridden; {count} is the number" + }, + "web.routes.server_settings.security_pending": { + "defaultMessage": "Pending: {value} · applies on the next restart", + "description": "Advanced security: warning chip for a saved value that is not applied yet; {value} is the saved value; the middle dot separates it from the rest of the sentence" + }, + "web.routes.server_settings.security_read_only": { + "defaultMessage": "Read-only", + "description": "Advanced security: chip shown when the user can see the security settings but not change them" + }, + "web.routes.server_settings.security_read_only_note": { + "defaultMessage": "You can see these settings. Changing them needs the servers:security permission.", + "description": "Advanced security: note shown to users who can see but not change the security settings; servers:security is a permission name, keep it unchanged" + }, + "web.routes.server_settings.security_restart_body": { + "defaultMessage": "Saving never restarts the server. Pending values take effect the next time it starts.", + "description": "Advanced security: notice body saying saving does not restart the server and pending values apply on the next start" + }, + "web.routes.server_settings.security_restart_title": { + "defaultMessage": "Applies on the next restart", + "description": "Advanced security: accent notice title saying saved security values take effect when the server next starts" + }, + "web.routes.server_settings.security_risky": { + "defaultMessage": "Risky", + "description": "Advanced security: warning chip on a setting the module marks as risky when the owner has overridden it" + }, + "web.routes.server_settings.security_risky_confirm": { + "defaultMessage": "Keep value", + "description": "Advanced security: confirm button label in the risky value dialog, keeping the value the owner entered" + }, + "web.routes.server_settings.security_risky_intro": { + "defaultMessage": "The module marks this setting as risky.", + "description": "Advanced security: confirmation dialog sentence saying the module marks the setting as risky, used when the module gives no reason" + }, + "web.routes.server_settings.security_risky_intro_reason": { + "defaultMessage": "The module marks this setting as risky. Its reason:", + "description": "Advanced security: confirmation dialog sentence before the module's plain-text reason for marking a setting risky" + }, + "web.routes.server_settings.security_risky_outro": { + "defaultMessage": "The server may fail to start with this value. You can clear the override later to go back to the module default.", + "description": "Advanced security: confirmation dialog sentence warning the server may fail to start and how to undo the override" + }, + "web.routes.server_settings.security_risky_title": { + "defaultMessage": "Keep a risky value for {setting}?", + "description": "Advanced security: confirmation dialog title before keeping a value the module marks as risky; {setting} is the setting name, such as Run-as user" + }, + "web.routes.server_settings.security_run_as_group": { + "defaultMessage": "Run-as group", + "description": "Advanced security: label of the setting for the group ID the game process runs as" + }, + "web.routes.server_settings.security_run_as_group_help": { + "defaultMessage": "Group ID the game process runs as.", + "description": "Advanced security: help text under the Run-as group label" + }, + "web.routes.server_settings.security_run_as_user": { + "defaultMessage": "Run-as user", + "description": "Advanced security: label of the setting for the user ID the game process runs as" + }, + "web.routes.server_settings.security_run_as_user_help": { + "defaultMessage": "User ID the game process runs as.", + "description": "Advanced security: help text under the Run-as user label" + }, + "web.routes.server_settings.security_source_built_in_default": { + "defaultMessage": "Built-in default", + "description": "Advanced security: source chip for the default built into Gameplane" + }, + "web.routes.server_settings.security_source_image_default": { + "defaultMessage": "Image default", + "description": "Advanced security: source chip for the container image's default user or group" + }, + "web.routes.server_settings.security_source_image_default_override": { + "defaultMessage": "Image default (override)", + "description": "Advanced security: source chip for an override that asks for the container image's default user or group" + }, + "web.routes.server_settings.security_source_module_default": { + "defaultMessage": "Module default", + "description": "Advanced security: source chip for a value that comes from the game module's default" + }, + "web.routes.server_settings.security_source_override": { + "defaultMessage": "Override", + "description": "Advanced security: source chip for a value the server owner overrode" + }, + "web.routes.server_settings.security_value_image_default": { + "defaultMessage": "image default", + "description": "Advanced security: value shown when a security ID is the container image's default, not a number" + }, + "web.routes.server_settings.security_value_input_label": { + "defaultMessage": "{setting} value", + "description": "Advanced security: accessible label of the number box for a setting's numeric ID; {setting} is the setting name, such as Run-as user" + }, + "web.routes.server_settings.security_volume_ownership_check": { + "defaultMessage": "Volume ownership check", + "description": "Advanced security: label of the setting that decides when the data volume's group is fixed on start" + }, + "web.routes.server_settings.security_volume_ownership_check_help": { + "defaultMessage": "When the data volume's group is fixed on start.", + "description": "Advanced security: help text under the Volume ownership check label" + }, "web.routes.servers.actions": { "defaultMessage": "Actions", "description": "Servers: column heading for the row buttons such as start, stop and restart; keep it short" @@ -10903,6 +11179,10 @@ "defaultMessage": "Scheduled backups", "description": "Settings: name of the Scheduled backups section in the settings tab list" }, + "web.routes.tabs.settings.section_security": { + "defaultMessage": "Security", + "description": "Settings: name of the Security section in the settings tab list" + }, "web.routes.tabs.settings.section_share_links": { "defaultMessage": "Share links", "description": "Settings: name of the Share links section in the settings tab list" diff --git a/i18n/locales/fr/app.json b/i18n/locales/fr/app.json index fb56e2f86..01970cc19 100644 --- a/i18n/locales/fr/app.json +++ b/i18n/locales/fr/app.json @@ -10896,6 +10896,70 @@ "web.cluster_detail.unavailable": { "defaultMessage": "Cluster indisponible" }, + "web.clusters.control_plane_namespace_detail_label": { + "defaultMessage": "Espace de noms du plan de contrôle", + "description": "Cluster overview: label for the namespace where this remote cluster's Gameplane operator runs" + }, + "web.clusters.control_plane_namespace_field_label": { + "defaultMessage": "Espace de noms du plan de contrôle (facultatif)", + "description": "Register cluster dialog: label for the namespace field where the cluster's Gameplane operator runs" + }, + "web.clusters.control_plane_namespace_help": { + "defaultMessage": "Espace de noms où s'exécute l'opérateur Gameplane de ce cluster. Laissez gameplane sauf s'il a été installé ailleurs ; une valeur erronée affiche le paramètre root du cluster comme manquant.", + "description": "Register cluster dialog: help text under the control-plane namespace field; gameplane is the default namespace name, not translated" + }, + "web.clusters.control_plane_namespace_invalid": { + "defaultMessage": "Utilisez un label DNS en minuscules : lettres minuscules, chiffres et tirets, commençant et finissant par une lettre ou un chiffre, 63 caractères au maximum.", + "description": "Register cluster dialog: validation error when the control-plane namespace is not a lowercase DNS label; DNS label is a technical term, usually left untranslated" + }, + "web.clusters.security_denied": { + "defaultMessage": "Vous n'avez pas l'autorisation de voir les paramètres de sécurité de ce cluster.", + "description": "Cluster security settings: access denied when the user cannot read configuration" + }, + "web.clusters.security_load_error": { + "defaultMessage": "Impossible de charger les paramètres de sécurité de ce cluster.", + "description": "Cluster security settings: error shown when the settings cannot be fetched; a retry button appears below it" + }, + "web.clusters.security_loading": { + "defaultMessage": "Chargement des paramètres de sécurité…", + "description": "Cluster security settings: loading text while the settings are fetched" + }, + "web.clusters.security_loading_permissions": { + "defaultMessage": "Chargement des autorisations…", + "description": "Cluster security settings: identity loading state" + }, + "web.clusters.security_missing_body": { + "defaultMessage": "Les paramètres de sécurité de ce cluster sont introuvables. Exécutez helm upgrade pour Gameplane sur ce cluster, puis rechargez cette page.", + "description": "Cluster security settings: warning body when the security settings are missing; helm upgrade is a command name, usually left untranslated" + }, + "web.clusters.security_missing_title": { + "defaultMessage": "Paramètres de sécurité manquants", + "description": "Cluster security settings: warning title when the cluster's security ConfigMap is not found" + }, + "web.clusters.security_permissions_error": { + "defaultMessage": "Impossible de charger vos autorisations.", + "description": "Cluster security settings: identity loading failure" + }, + "web.clusters.security_root_help": { + "defaultMessage": "Permet aux propriétaires de serveurs d'exécuter un jeu en root (utilisateur ou groupe 0), ou avec l'utilisateur par défaut de l'image. Désactivé par défaut, réglé par cluster.", + "description": "Cluster security settings: help text under the allow root overrides switch" + }, + "web.clusters.security_root_label": { + "defaultMessage": "Autoriser les dérogations root", + "description": "Cluster security settings: label of the switch that allows game servers to run as root or the image default user" + }, + "web.clusters.security_root_note": { + "defaultMessage": "Désactiver ce réglage n'arrête pas les serveurs en cours d'exécution sur ce cluster. Les serveurs arrêtés qui ont une dérogation root ne démarreront pas tant que la dérogation n'est pas retirée ou que ce réglage n'est pas réactivé.", + "description": "Cluster security settings: note explaining that disabling root overrides does not stop running servers but blocks stopped servers with a root override from starting" + }, + "web.clusters.security_subtitle": { + "defaultMessage": "Comment les serveurs de jeu de ce cluster peuvent s'exécuter.", + "description": "Cluster security settings: subtitle under the Security section title" + }, + "web.clusters.security_title": { + "defaultMessage": "Sécurité", + "description": "Cluster security settings: title of the section card for one cluster" + }, "web.cluster_detail.nodes": { "defaultMessage": "Nœuds" }, @@ -11381,5 +11445,21 @@ }, "web.cluster_configuration.open_named_configuration": { "defaultMessage": "Ouvrir la configuration de {name}" + }, + "server.cluster.security_settings_missing": { + "defaultMessage": "le ConfigMap des paramètres de sécurité est absent de ce cluster ; exécutez helm upgrade pour le recréer", + "description": "API error from the cluster security settings API (security_settings.go) when the gameplane-security-settings ConfigMap is not found on the cluster. Nothing is written." + }, + "server.security.forbidden": { + "defaultMessage": "la modification des paramètres de sécurité exige l'autorisation servers:security", + "description": "API error from the GameServer save path (security_overrides.go) when a caller without servers:security changes spec.security." + }, + "server.security.root_disabled": { + "defaultMessage": "les valeurs root (utilisateur 0, groupe 0, groupe de fichiers 0, ou l'image par défaut pour l'utilisateur ou le groupe) ne sont pas autorisées sur ce cluster tant qu'un administrateur n'autorise pas les dérogations root dans la configuration de ce cluster", + "description": "API error from the GameServer save path when a new or changed root value is saved while the cluster's allow-root-overrides setting is off. Argument setting names the first offending setting." + }, + "server.security.invalid": { + "defaultMessage": "dérogation de sécurité invalide : {detail}", + "description": "API error from the GameServer save path when spec.security has an invalid shape. Argument setting names the offending setting; argument detail says what is wrong." } } diff --git a/operator/api/v1alpha1/cluster_types.go b/operator/api/v1alpha1/cluster_types.go index c18df0187..595852587 100644 --- a/operator/api/v1alpha1/cluster_types.go +++ b/operator/api/v1alpha1/cluster_types.go @@ -18,6 +18,16 @@ type ClusterSpec struct { // Kubernetes configuration and pod streams still use KubeconfigSecret. // +optional AgentGateway *AgentGatewaySpec `json:"agentGateway,omitempty"` + + // ControlPlaneNamespace is the namespace of this cluster's operator + // control plane. The API reads the cluster's security settings ConfigMap + // (gameplane-security-settings) in this namespace. Empty or absent means + // "gameplane". Must match the namespace of the remote install. + // +kubebuilder:default=gameplane + // +kubebuilder:validation:MaxLength=63 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$` + // +optional + ControlPlaneNamespace string `json:"controlPlaneNamespace,omitempty"` } // AgentGatewaySpec configures the optional remote agent gateway. diff --git a/operator/api/v1alpha1/gameserver_types.go b/operator/api/v1alpha1/gameserver_types.go index b7a3dd59b..d127233cb 100644 --- a/operator/api/v1alpha1/gameserver_types.go +++ b/operator/api/v1alpha1/gameserver_types.go @@ -36,6 +36,14 @@ const ( // Absent once a wipe has succeeded and been acked. GameServerConditionDataWipe = "DataWipe" + // GameServerConditionSecurityAllowed reports whether spec.security may + // start this server. False with Reason GameServerReasonRootOverrideDisallowed + // while the cluster's "allow root overrides" setting is off and the + // override is a root override (uid or gid 0, or use image default for a + // run-as id). A stopped server is not started while False; a running one + // is left untouched. + GameServerConditionSecurityAllowed = "SecurityAllowed" + // GameServerConditionPortAllocation reports the Service ports a server // holds in its template's port pool (operator --port-pool): True with // Reason "Allocated", or False with Reason "PoolExhausted" when the pool @@ -65,6 +73,36 @@ const ( ModpackRemoveAnnotation = "gameplane.local/modpack-remove" ) +// GameServer condition reasons for GameServerConditionSecurityAllowed. +const ( + // GameServerReasonRootOverrideDisallowed is the SecurityAllowed=False reason + // used while the cluster does not allow root overrides. + GameServerReasonRootOverrideDisallowed = "RootOverrideDisallowed" +) + +// SecuritySource records where a resolved security setting came from. +// +kubebuilder:validation:Enum=ModuleDefault;Override;ImageDefaultOverride;ImageDefault;BuiltInDefault +type SecuritySource string + +const ( + // SecuritySourceModuleDefault means the value is the GameTemplate's spec.security default. + SecuritySourceModuleDefault SecuritySource = "ModuleDefault" + + // SecuritySourceOverride means the value is the GameServer's spec.security override. + SecuritySourceOverride SecuritySource = "Override" + + // SecuritySourceImageDefaultOverride means the server overrides the setting with + // "use image default", so no value is applied even if the module sets one. + SecuritySourceImageDefaultOverride SecuritySource = "ImageDefaultOverride" + + // SecuritySourceImageDefault means nothing is applied and the image's own default is used. + SecuritySourceImageDefault SecuritySource = "ImageDefault" + + // SecuritySourceBuiltInDefault means the value is the operator's built-in default + // (used only for the volume ownership check). + SecuritySourceBuiltInDefault SecuritySource = "BuiltInDefault" +) + // GameServerSpec is the desired state of a single game server instance. type GameServerSpec struct { // TemplateRef references a GameTemplate that provides defaults for @@ -188,6 +226,12 @@ type GameServerSpec struct { // +optional Capture *CaptureConfiguration `json:"capture,omitempty"` + // Security overrides the module's security defaults (GameTemplate + // spec.security) for this GameServer. Absent means no override. Saving a + // change never restarts a running server; it applies at the next start. + // +optional + Security *GameServerSecuritySpec `json:"security,omitempty"` + // Modpack is the modpack this server runs. Absent means no pack. The // operator renders the pack's env from this field (it never lives in // spec.env) and applies changes through status.modpack. Remove deletes @@ -196,6 +240,47 @@ type GameServerSpec struct { Modpack *GameServerModpackSpec `json:"modpack,omitempty"` } +// GameServerSecuritySpec overrides the module security defaults for one GameServer. +type GameServerSecuritySpec struct { + // RunAsUser overrides the uid the game container runs as. + // +kubebuilder:validation:XValidation:rule="has(self.value) != has(self.useImageDefault)",message="security.runAsUser: set exactly one of value or useImageDefault" + // +kubebuilder:validation:XValidation:rule="!has(self.useImageDefault) || self.useImageDefault == true",message="security.runAsUser.useImageDefault must be true when set" + // +optional + RunAsUser *SecurityIDOverride `json:"runAsUser,omitempty"` + + // RunAsGroup overrides the gid the game container runs as. + // +kubebuilder:validation:XValidation:rule="has(self.value) != has(self.useImageDefault)",message="security.runAsGroup: set exactly one of value or useImageDefault" + // +kubebuilder:validation:XValidation:rule="!has(self.useImageDefault) || self.useImageDefault == true",message="security.runAsGroup.useImageDefault must be true when set" + // +optional + RunAsGroup *SecurityIDOverride `json:"runAsGroup,omitempty"` + + // FSGroup overrides the gid the kubelet chowns the data volume to. + // +kubebuilder:validation:XValidation:rule="has(self.value) != has(self.useImageDefault)",message="security.fsGroup: set exactly one of value or useImageDefault" + // +kubebuilder:validation:XValidation:rule="!has(self.useImageDefault) || self.useImageDefault == true",message="security.fsGroup.useImageDefault must be true when set" + // +optional + FSGroup *SecurityIDOverride `json:"fsGroup,omitempty"` + + // VolumeOwnershipCheck overrides the module's ownership check policy. + // Omitted means the module's value, else OnlyWhenWrong. + // +kubebuilder:validation:Enum=EveryStart;OnlyWhenWrong + // +optional + VolumeOwnershipCheck VolumeOwnershipCheck `json:"volumeOwnershipCheck,omitempty"` +} + +// SecurityIDOverride is a per-server override for a uid or gid. Exactly one of +// Value and UseImageDefault is set. UseImageDefault, when set, is always true. +type SecurityIDOverride struct { + // Value is the uid or gid to apply. + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=4294967295 + // +optional + Value *int64 `json:"value,omitempty"` + + // UseImageDefault applies no value for this id, even if the module sets one. + // +optional + UseImageDefault *bool `json:"useImageDefault,omitempty"` +} + // ModpackRef identifies one modpack version from a registry. type ModpackRef struct { // Provider names the registry (a provider of the template's registry @@ -767,6 +852,11 @@ type GameServerStatus struct { // +optional Capture *CaptureStatus `json:"capture,omitempty"` + // Security reports the desired and last-applied security settings for this + // GameServer. Written only by the reconciler, as a merge patch of this field. + // +optional + Security *GameServerSecurityStatus `json:"security,omitempty"` + // TunnelEndpoints are the per-port addresses reported by the tunnel pod. // For frp/tailscale these are computed from the spec at reconcile time; // for playit they arrive asynchronously as the pod discovers assignments. @@ -782,6 +872,63 @@ type GameServerStatus struct { Modpack *GameServerModpackStatus `json:"modpack,omitempty"` } +// GameServerSecurityStatus is the reconciler's read model of spec.security. +type GameServerSecurityStatus struct { + // Desired is what the next start will use: the server override over the + // module default over nothing. Set after the first reconcile. + // +optional + Desired *SecuritySettings `json:"desired,omitempty"` + + // Applied is what the pod last started with, read from the StatefulSet + // annotation written once a pod's volumes were set up. Omitted before the + // first start. + // +optional + Applied *SecuritySettings `json:"applied,omitempty"` + + // Pending is true when Applied exists and any value differs from Desired. + // A change of source with the same value is not pending. + // +optional + Pending bool `json:"pending,omitempty"` +} + +// SecuritySettings is one full set of resolved security settings. +type SecuritySettings struct { + // RunAsUser is the resolved game container uid. + RunAsUser SecurityIDStatus `json:"runAsUser"` + + // RunAsGroup is the resolved game container gid. + RunAsGroup SecurityIDStatus `json:"runAsGroup"` + + // FSGroup is the resolved volume filesystem group. + FSGroup SecurityIDStatus `json:"fsGroup"` + + // VolumeOwnershipCheck is the resolved ownership check policy. + VolumeOwnershipCheck SecurityCheckStatus `json:"volumeOwnershipCheck"` +} + +// SecurityIDStatus is a resolved uid or gid and where it came from. +type SecurityIDStatus struct { + // Value is the applied id. Absent when no id is applied (image default). + // +optional + Value *int64 `json:"value,omitempty"` + + // Source records where the value came from. + // +kubebuilder:validation:Required + Source SecuritySource `json:"source"` +} + +// SecurityCheckStatus is a resolved volume ownership check policy and its source. +type SecurityCheckStatus struct { + // Value is EveryStart or OnlyWhenWrong. + // +kubebuilder:validation:Enum=EveryStart;OnlyWhenWrong + // +kubebuilder:validation:Required + Value VolumeOwnershipCheck `json:"value"` + + // Source records where the value came from. + // +kubebuilder:validation:Required + Source SecuritySource `json:"source"` +} + // IdleStatus is the observed state of idle auto-sleep. It is a read model: // the authoritative sleep marker is an operator-owned annotation, so the // decision survives a status subresource being reset. diff --git a/operator/api/v1alpha1/gametemplate_types.go b/operator/api/v1alpha1/gametemplate_types.go index fbfb9f5c2..d6974037a 100644 --- a/operator/api/v1alpha1/gametemplate_types.go +++ b/operator/api/v1alpha1/gametemplate_types.go @@ -211,6 +211,65 @@ type GameSecuritySpec struct { // +kubebuilder:validation:Maximum=4294967295 // +optional FSGroup *int64 `json:"fsGroup,omitempty"` + + // VolumeOwnershipCheck selects how the kubelet re-applies FSGroup to the + // mounted volume. EveryStart re-owns every file on each start (Kubernetes + // fsGroupChangePolicy Always); OnlyWhenWrong skips the walk when the + // volume root already has the right group (OnRootMismatch). Omitted means + // OnlyWhenWrong. Has an effect only when FSGroup is set. + // +kubebuilder:validation:Enum=EveryStart;OnlyWhenWrong + // +optional + VolumeOwnershipCheck VolumeOwnershipCheck `json:"volumeOwnershipCheck,omitempty"` + + // Risky marks the settings whose override a server owner should only + // make with care (the image works only with that id, or must start as + // root). Presence of a member means "overriding this is risky"; the + // dashboard shows the reason before saving. It never forbids an override. + // +optional + Risky *SecurityRiskSpec `json:"risky,omitempty"` +} + +// VolumeOwnershipCheck is the kubelet fsGroup ownership policy for a data volume. +type VolumeOwnershipCheck string + +const ( + // VolumeOwnershipCheckEveryStart re-applies the filesystem group to every + // file on each start (fsGroupChangePolicy Always). + VolumeOwnershipCheckEveryStart VolumeOwnershipCheck = "EveryStart" + + // VolumeOwnershipCheckOnlyWhenWrong re-applies the filesystem group only + // when the volume root's group differs (fsGroupChangePolicy OnRootMismatch). + VolumeOwnershipCheckOnlyWhenWrong VolumeOwnershipCheck = "OnlyWhenWrong" +) + +// SecurityRiskSpec marks which security settings are risky to override. A +// member may name a setting the template does not set. Absent member means +// not risky. +type SecurityRiskSpec struct { + // RunAsUser marks the game container uid as risky to override. + // +optional + RunAsUser *SecurityRiskNote `json:"runAsUser,omitempty"` + + // RunAsGroup marks the game container gid as risky to override. + // +optional + RunAsGroup *SecurityRiskNote `json:"runAsGroup,omitempty"` + + // FSGroup marks the volume filesystem group as risky to override. + // +optional + FSGroup *SecurityRiskNote `json:"fsGroup,omitempty"` + + // VolumeOwnershipCheck marks the ownership check policy as risky to override. + // +optional + VolumeOwnershipCheck *SecurityRiskNote `json:"volumeOwnershipCheck,omitempty"` +} + +// SecurityRiskNote explains, in one plain-text sentence, what breaks when a +// risky setting is overridden. +type SecurityRiskNote struct { + // Reason is shown to the server owner before they save the override. + // +kubebuilder:validation:MaxLength=200 + // +optional + Reason string `json:"reason,omitempty"` } // GameVersion is one selectable entry in a template's version catalog. diff --git a/operator/api/v1alpha1/zz_generated.deepcopy.go b/operator/api/v1alpha1/zz_generated.deepcopy.go index b65dc4551..823a63765 100644 --- a/operator/api/v1alpha1/zz_generated.deepcopy.go +++ b/operator/api/v1alpha1/zz_generated.deepcopy.go @@ -877,6 +877,11 @@ func (in *GameSecuritySpec) DeepCopyInto(out *GameSecuritySpec) { *out = new(int64) **out = **in } + if in.Risky != nil { + in, out := &in.Risky, &out.Risky + *out = new(SecurityRiskSpec) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GameSecuritySpec. @@ -1066,6 +1071,61 @@ func (in *GameServerNetworking) DeepCopy() *GameServerNetworking { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GameServerSecuritySpec) DeepCopyInto(out *GameServerSecuritySpec) { + *out = *in + if in.RunAsUser != nil { + in, out := &in.RunAsUser, &out.RunAsUser + *out = new(SecurityIDOverride) + (*in).DeepCopyInto(*out) + } + if in.RunAsGroup != nil { + in, out := &in.RunAsGroup, &out.RunAsGroup + *out = new(SecurityIDOverride) + (*in).DeepCopyInto(*out) + } + if in.FSGroup != nil { + in, out := &in.FSGroup, &out.FSGroup + *out = new(SecurityIDOverride) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GameServerSecuritySpec. +func (in *GameServerSecuritySpec) DeepCopy() *GameServerSecuritySpec { + if in == nil { + return nil + } + out := new(GameServerSecuritySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GameServerSecurityStatus) DeepCopyInto(out *GameServerSecurityStatus) { + *out = *in + if in.Desired != nil { + in, out := &in.Desired, &out.Desired + *out = new(SecuritySettings) + (*in).DeepCopyInto(*out) + } + if in.Applied != nil { + in, out := &in.Applied, &out.Applied + *out = new(SecuritySettings) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GameServerSecurityStatus. +func (in *GameServerSecurityStatus) DeepCopy() *GameServerSecurityStatus { + if in == nil { + return nil + } + out := new(GameServerSecurityStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GameServerSpec) DeepCopyInto(out *GameServerSpec) { *out = *in @@ -1149,6 +1209,11 @@ func (in *GameServerSpec) DeepCopyInto(out *GameServerSpec) { *out = new(CaptureConfiguration) (*in).DeepCopyInto(*out) } + if in.Security != nil { + in, out := &in.Security, &out.Security + *out = new(GameServerSecuritySpec) + (*in).DeepCopyInto(*out) + } if in.Modpack != nil { in, out := &in.Modpack, &out.Modpack *out = new(GameServerModpackSpec) @@ -1227,6 +1292,11 @@ func (in *GameServerStatus) DeepCopyInto(out *GameServerStatus) { *out = new(CaptureStatus) (*in).DeepCopyInto(*out) } + if in.Security != nil { + in, out := &in.Security, &out.Security + *out = new(GameServerSecurityStatus) + (*in).DeepCopyInto(*out) + } if in.TunnelEndpoints != nil { in, out := &in.TunnelEndpoints, &out.TunnelEndpoints *out = make([]GameServerEndpoint, len(*in)) @@ -2720,6 +2790,135 @@ func (in *SecretNameRef) DeepCopy() *SecretNameRef { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityCheckStatus) DeepCopyInto(out *SecurityCheckStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityCheckStatus. +func (in *SecurityCheckStatus) DeepCopy() *SecurityCheckStatus { + if in == nil { + return nil + } + out := new(SecurityCheckStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityIDOverride) DeepCopyInto(out *SecurityIDOverride) { + *out = *in + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = new(int64) + **out = **in + } + if in.UseImageDefault != nil { + in, out := &in.UseImageDefault, &out.UseImageDefault + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityIDOverride. +func (in *SecurityIDOverride) DeepCopy() *SecurityIDOverride { + if in == nil { + return nil + } + out := new(SecurityIDOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityIDStatus) DeepCopyInto(out *SecurityIDStatus) { + *out = *in + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = new(int64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityIDStatus. +func (in *SecurityIDStatus) DeepCopy() *SecurityIDStatus { + if in == nil { + return nil + } + out := new(SecurityIDStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityRiskNote) DeepCopyInto(out *SecurityRiskNote) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityRiskNote. +func (in *SecurityRiskNote) DeepCopy() *SecurityRiskNote { + if in == nil { + return nil + } + out := new(SecurityRiskNote) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityRiskSpec) DeepCopyInto(out *SecurityRiskSpec) { + *out = *in + if in.RunAsUser != nil { + in, out := &in.RunAsUser, &out.RunAsUser + *out = new(SecurityRiskNote) + **out = **in + } + if in.RunAsGroup != nil { + in, out := &in.RunAsGroup, &out.RunAsGroup + *out = new(SecurityRiskNote) + **out = **in + } + if in.FSGroup != nil { + in, out := &in.FSGroup, &out.FSGroup + *out = new(SecurityRiskNote) + **out = **in + } + if in.VolumeOwnershipCheck != nil { + in, out := &in.VolumeOwnershipCheck, &out.VolumeOwnershipCheck + *out = new(SecurityRiskNote) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityRiskSpec. +func (in *SecurityRiskSpec) DeepCopy() *SecurityRiskSpec { + if in == nil { + return nil + } + out := new(SecurityRiskSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecuritySettings) DeepCopyInto(out *SecuritySettings) { + *out = *in + in.RunAsUser.DeepCopyInto(&out.RunAsUser) + in.RunAsGroup.DeepCopyInto(&out.RunAsGroup) + in.FSGroup.DeepCopyInto(&out.FSGroup) + out.VolumeOwnershipCheck = in.VolumeOwnershipCheck +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecuritySettings. +func (in *SecuritySettings) DeepCopy() *SecuritySettings { + if in == nil { + return nil + } + out := new(SecuritySettings) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ServerActionSpec) DeepCopyInto(out *ServerActionSpec) { *out = *in diff --git a/operator/cmd/main.go b/operator/cmd/main.go index 0e461d48e..d8d0e2f87 100644 --- a/operator/cmd/main.go +++ b/operator/cmd/main.go @@ -552,6 +552,7 @@ func main() { WakeStartLimit: wakeStartLimit, WakeStartNamespace: controlPlaneNamespaceDefault, ControlPlaneNamespace: controlPlaneNamespace, + EventRecorder: mgr.GetEventRecorder("gameserver-controller"), AgentClient: agentClient, OperationQuiescer: agentClient, PodAttacher: &controller.StopAttachClient{ diff --git a/operator/config/crd/gameplane.local_clusters.yaml b/operator/config/crd/gameplane.local_clusters.yaml index 285dcc73d..d55756610 100644 --- a/operator/config/crd/gameplane.local_clusters.yaml +++ b/operator/config/crd/gameplane.local_clusters.yaml @@ -80,6 +80,16 @@ spec: - tlsSecretRef - url type: object + controlPlaneNamespace: + default: gameplane + description: |- + ControlPlaneNamespace is the namespace of this cluster's operator + control plane. The API reads the cluster's security settings ConfigMap + (gameplane-security-settings) in this namespace. Empty or absent means + "gameplane". Must match the namespace of the remote install. + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string displayName: description: DisplayName is an optional human-readable name for the cluster. diff --git a/operator/config/crd/gameplane.local_gameservers.yaml b/operator/config/crd/gameplane.local_gameservers.yaml index 86a2c4d40..225f65a4e 100644 --- a/operator/config/crd/gameplane.local_gameservers.yaml +++ b/operator/config/crd/gameplane.local_gameservers.yaml @@ -2257,6 +2257,87 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object + security: + description: |- + Security overrides the module's security defaults (GameTemplate + spec.security) for this GameServer. Absent means no override. Saving a + change never restarts a running server; it applies at the next start. + properties: + fsGroup: + description: FSGroup overrides the gid the kubelet chowns the + data volume to. + properties: + useImageDefault: + description: UseImageDefault applies no value for this id, + even if the module sets one. + type: boolean + value: + description: Value is the uid or gid to apply. + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + type: object + x-kubernetes-validations: + - message: 'security.fsGroup: set exactly one of value or useImageDefault' + rule: has(self.value) != has(self.useImageDefault) + - message: security.fsGroup.useImageDefault must be true when + set + rule: '!has(self.useImageDefault) || self.useImageDefault == + true' + runAsGroup: + description: RunAsGroup overrides the gid the game container runs + as. + properties: + useImageDefault: + description: UseImageDefault applies no value for this id, + even if the module sets one. + type: boolean + value: + description: Value is the uid or gid to apply. + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + type: object + x-kubernetes-validations: + - message: 'security.runAsGroup: set exactly one of value or useImageDefault' + rule: has(self.value) != has(self.useImageDefault) + - message: security.runAsGroup.useImageDefault must be true when + set + rule: '!has(self.useImageDefault) || self.useImageDefault == + true' + runAsUser: + description: RunAsUser overrides the uid the game container runs + as. + properties: + useImageDefault: + description: UseImageDefault applies no value for this id, + even if the module sets one. + type: boolean + value: + description: Value is the uid or gid to apply. + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + type: object + x-kubernetes-validations: + - message: 'security.runAsUser: set exactly one of value or useImageDefault' + rule: has(self.value) != has(self.useImageDefault) + - message: security.runAsUser.useImageDefault must be true when + set + rule: '!has(self.useImageDefault) || self.useImageDefault == + true' + volumeOwnershipCheck: + description: |- + VolumeOwnershipCheck overrides the module's ownership check policy. + Omitted means the module's value, else OnlyWhenWrong. + enum: + - EveryStart + - OnlyWhenWrong + type: string + type: object serviceAccountName: description: |- ServiceAccountName, when set, overrides the SA the pod runs as. @@ -2899,6 +2980,206 @@ spec: - Suspended - Failed type: string + security: + description: |- + Security reports the desired and last-applied security settings for this + GameServer. Written only by the reconciler, as a merge patch of this field. + properties: + applied: + description: |- + Applied is what the pod last started with, read from the StatefulSet + annotation written once a pod's volumes were set up. Omitted before the + first start. + properties: + fsGroup: + description: FSGroup is the resolved volume filesystem group. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is the applied id. Absent when no id + is applied (image default). + format: int64 + type: integer + required: + - source + type: object + runAsGroup: + description: RunAsGroup is the resolved game container gid. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is the applied id. Absent when no id + is applied (image default). + format: int64 + type: integer + required: + - source + type: object + runAsUser: + description: RunAsUser is the resolved game container uid. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is the applied id. Absent when no id + is applied (image default). + format: int64 + type: integer + required: + - source + type: object + volumeOwnershipCheck: + description: VolumeOwnershipCheck is the resolved ownership + check policy. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is EveryStart or OnlyWhenWrong. + enum: + - EveryStart + - OnlyWhenWrong + type: string + required: + - source + - value + type: object + required: + - fsGroup + - runAsGroup + - runAsUser + - volumeOwnershipCheck + type: object + desired: + description: |- + Desired is what the next start will use: the server override over the + module default over nothing. Set after the first reconcile. + properties: + fsGroup: + description: FSGroup is the resolved volume filesystem group. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is the applied id. Absent when no id + is applied (image default). + format: int64 + type: integer + required: + - source + type: object + runAsGroup: + description: RunAsGroup is the resolved game container gid. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is the applied id. Absent when no id + is applied (image default). + format: int64 + type: integer + required: + - source + type: object + runAsUser: + description: RunAsUser is the resolved game container uid. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is the applied id. Absent when no id + is applied (image default). + format: int64 + type: integer + required: + - source + type: object + volumeOwnershipCheck: + description: VolumeOwnershipCheck is the resolved ownership + check policy. + properties: + source: + description: Source records where the value came from. + enum: + - ModuleDefault + - Override + - ImageDefaultOverride + - ImageDefault + - BuiltInDefault + type: string + value: + description: Value is EveryStart or OnlyWhenWrong. + enum: + - EveryStart + - OnlyWhenWrong + type: string + required: + - source + - value + type: object + required: + - fsGroup + - runAsGroup + - runAsUser + - volumeOwnershipCheck + type: object + pending: + description: |- + Pending is true when Applied exists and any value differs from Desired. + A change of source with the same value is not pending. + type: boolean + type: object startedAt: description: |- StartedAt is the wall-clock time the game container was last diff --git a/operator/config/crd/gameplane.local_gametemplates.yaml b/operator/config/crd/gameplane.local_gametemplates.yaml index 80a33c3c0..bd54d5964 100644 --- a/operator/config/crd/gameplane.local_gametemplates.yaml +++ b/operator/config/crd/gameplane.local_gametemplates.yaml @@ -2321,6 +2321,54 @@ spec: maximum: 4294967295 minimum: 0 type: integer + risky: + description: |- + Risky marks the settings whose override a server owner should only + make with care (the image works only with that id, or must start as + root). Presence of a member means "overriding this is risky"; the + dashboard shows the reason before saving. It never forbids an override. + properties: + fsGroup: + description: FSGroup marks the volume filesystem group as + risky to override. + properties: + reason: + description: Reason is shown to the server owner before + they save the override. + maxLength: 200 + type: string + type: object + runAsGroup: + description: RunAsGroup marks the game container gid as risky + to override. + properties: + reason: + description: Reason is shown to the server owner before + they save the override. + maxLength: 200 + type: string + type: object + runAsUser: + description: RunAsUser marks the game container uid as risky + to override. + properties: + reason: + description: Reason is shown to the server owner before + they save the override. + maxLength: 200 + type: string + type: object + volumeOwnershipCheck: + description: VolumeOwnershipCheck marks the ownership check + policy as risky to override. + properties: + reason: + description: Reason is shown to the server owner before + they save the override. + maxLength: 200 + type: string + type: object + type: object runAsGroup: description: RunAsGroup is the gid the GAME container runs as. format: int64 @@ -2333,6 +2381,17 @@ spec: maximum: 4294967295 minimum: 0 type: integer + volumeOwnershipCheck: + description: |- + VolumeOwnershipCheck selects how the kubelet re-applies FSGroup to the + mounted volume. EveryStart re-owns every file on each start (Kubernetes + fsGroupChangePolicy Always); OnlyWhenWrong skips the walk when the + volume root already has the right group (OnRootMismatch). Omitted means + OnlyWhenWrong. Has an effect only when FSGroup is set. + enum: + - EveryStart + - OnlyWhenWrong + type: string type: object sentinelIsolation: description: |- diff --git a/operator/internal/controller/backup_controller.go b/operator/internal/controller/backup_controller.go index 97a5df0c1..14546a7ae 100644 --- a/operator/internal/controller/backup_controller.go +++ b/operator/internal/controller/backup_controller.go @@ -1042,7 +1042,7 @@ func volumeSnapshotsAvailable(rm meta.RESTMapper) bool { // // Both containers share the same env (repo + password from the user's // Secret) and a tmpfs-backed cache to keep the rootfs read-only. -func (r *BackupReconciler) buildBackupPodSpec(b *gameplanev1alpha1.Backup, tmpl *gameplanev1alpha1.GameTemplate) corev1.PodSpec { +func (r *BackupReconciler) buildBackupPodSpec(b *gameplanev1alpha1.Backup, tmpl *gameplanev1alpha1.GameTemplate, appliedFSGroup ...*int64) corev1.PodSpec { env := resticEnv(b.Spec.RepoRef.Name) containerSec := resticContainerSecurityContext() @@ -1055,7 +1055,7 @@ func (r *BackupReconciler) buildBackupPodSpec(b *gameplanev1alpha1.Backup, tmpl } spec := corev1.PodSpec{ - SecurityContext: buildBackupPodSecurityContext(tmpl), + SecurityContext: buildBackupPodSecurityContext(tmpl, appliedFSGroup...), InitContainers: []corev1.Container{{ Name: "restic-init", Image: resticImageOrDefault(r.ResticImage), @@ -1152,12 +1152,16 @@ func resticContainerSecurityContext() *corev1.SecurityContext { } // buildBackupPodSecurityContext returns the pod-level SecurityContext for backup/restore jobs. -// It includes the template's FSGroup (if set) along with standard settings for the backup job. -func buildBackupPodSecurityContext(tmpl *gameplanev1alpha1.GameTemplate) *corev1.PodSecurityContext { +// The filesystem group is the applied one when a value is passed (spec 030, FR-011): the +// group the data volume was last set up with. Without a value it is the template's FSGroup +// (if set), as before. Standard settings for the backup job are unchanged. +func buildBackupPodSecurityContext(tmpl *gameplanev1alpha1.GameTemplate, appliedFSGroup ...*int64) *corev1.PodSecurityContext { nonRoot := true uid := int64(65532) fsGroup := uid - if tmpl.Spec.Security != nil && tmpl.Spec.Security.FSGroup != nil { + if len(appliedFSGroup) > 0 && appliedFSGroup[0] != nil { + fsGroup = *appliedFSGroup[0] + } else if tmpl.Spec.Security != nil && tmpl.Spec.Security.FSGroup != nil { fsGroup = *tmpl.Spec.Security.FSGroup } return &corev1.PodSecurityContext{ diff --git a/operator/internal/controller/backup_worker.go b/operator/internal/controller/backup_worker.go index 0b6f65491..fa95a572a 100644 --- a/operator/internal/controller/backup_worker.go +++ b/operator/internal/controller/backup_worker.go @@ -126,8 +126,8 @@ func (r *BackupReconciler) prepareBackupWorkerSource(ctx context.Context, b *gam return &source, r.Update(ctx, b) } -func (r *BackupReconciler) buildPreparedBackupPodSpec(b *gameplanev1alpha1.Backup, tmpl *gameplanev1alpha1.GameTemplate, source *backupWorkerSource, serverUID types.UID, deadline time.Time) corev1.PodSpec { - spec := r.buildBackupPodSpec(b, tmpl) +func (r *BackupReconciler) buildPreparedBackupPodSpec(b *gameplanev1alpha1.Backup, tmpl *gameplanev1alpha1.GameTemplate, source *backupWorkerSource, serverUID types.UID, deadline time.Time, appliedFSGroup ...*int64) corev1.PodSpec { + spec := r.buildBackupPodSpec(b, tmpl, appliedFSGroup...) automount := false spec.AutomountServiceAccountToken = &automount spec.Tolerations = source.Tolerations @@ -301,9 +301,14 @@ func (r *BackupReconciler) reconcilePreparedRestic(ctx context.Context, b *gamep if err != nil && (bound.Annotations[effectiveTemplateAnnotation] != "" || !apierrors.IsNotFound(err)) { return r.abortResticCopy(ctx, b, "cannot resolve capture template: "+err.Error()) } + // The backup mounts the data volume as the server last set it up (spec 030, FR-011). + appliedFSGroup, err := appliedBackupFSGroup(ctx, r.backupAPIReader(), bound, tmpl) + if err != nil { + return ctrl.Result{}, err + } backoff, deadline := resolveJobLimits(r.JobBackoffLimit, r.JobActiveDeadlineSeconds) job = batchv1.Job{ObjectMeta: metav1.ObjectMeta{Name: b.Name, Namespace: b.Namespace, Annotations: map[string]string{backupWorkerProtocolAnnotation: "v1"}}, Spec: batchv1.JobSpec{BackoffLimit: &backoff, ActiveDeadlineSeconds: &deadline, - Template: corev1.PodTemplateSpec{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{backupRestoreJobLabel: backupRestoreJobValue, backupUIDLabel: string(b.UID)}}, Spec: r.buildPreparedBackupPodSpec(b, tmpl, source, bound.UID, preparation)}}} + Template: corev1.PodTemplateSpec{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{backupRestoreJobLabel: backupRestoreJobValue, backupUIDLabel: string(b.UID)}}, Spec: r.buildPreparedBackupPodSpec(b, tmpl, source, bound.UID, preparation, appliedFSGroup)}}} job.Spec.Template.Spec.RestartPolicy = corev1.RestartPolicyNever if source.NodeName == "" { // A scheduled game Pod has already bound its mounted claims. diff --git a/operator/internal/controller/gameserver_controller.go b/operator/internal/controller/gameserver_controller.go index 447de242b..662879fb3 100644 --- a/operator/internal/controller/gameserver_controller.go +++ b/operator/internal/controller/gameserver_controller.go @@ -37,6 +37,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/reconcile" + "sigs.k8s.io/controller-runtime/pkg/recorder" gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" ) @@ -54,10 +55,18 @@ type GameServerReconciler struct { WakeStartLimit int WakeStartNamespace string // ControlPlaneNamespace holds the managed mod-registry key Secret that - // modpack servers receive a CurseForge key from. Empty disables key sharing. + // modpack servers receive a CurseForge key from, and the cluster's + // security settings ConfigMap (gameplane-security-settings, spec 030 + // OD-7). Empty disables key sharing and disallows root overrides (fail + // closed). ControlPlaneNamespace string Scheme *runtime.Scheme + // EventRecorder emits a Warning event on a GameServer held back from + // starting by the root-override rule. Nil-safe: unit and envtest setups + // may leave it unset. + EventRecorder recorder.EventRecorder + // AgentImage is the container image used for the sidecar agent // injected into every game pod. Set from an operator flag so the // deployer can pin the agent version independently of the game. @@ -388,7 +397,7 @@ func (r *GameServerReconciler) Reconcile(ctx context.Context, req ctrl.Request) // the missing-template path) instead of materializing a pod that // silently ignores what the user asked for. if r.RestrictedWorkloads { - if err := validateRestrictedTemplate(&tmpl); err != nil { + if err := validateRestrictedSecurity(resolveGameSecurity(&tmpl, &gs)); err != nil { return ctrl.Result{}, r.setPhase(ctx, &gs, err.Error()) } } @@ -723,6 +732,7 @@ func (r *GameServerReconciler) SetupWithManager(mgr ctrl.Manager) error { Watches(&gameplanev1alpha1.Backup{}, handler.EnqueueRequestsFromMapFunc(mapModpackBackupToGameServer)). Watches(&gameplanev1alpha1.GameTemplate{}, handler.EnqueueRequestsFromMapFunc(r.mapTemplateToGameServers), builder.WithPredicates(predicate.GenerationChangedPredicate{})). + Watches(&corev1.ConfigMap{}, handler.EnqueueRequestsFromMapFunc(r.mapSecuritySettingsToGameServers)). Complete(r) } @@ -1997,6 +2007,42 @@ func (r *GameServerReconciler) reconcileStatefulSet( if err != nil { return err } + // Root-override hold (spec 030, OD-4, R9): while the cluster does not + // allow root overrides, a stopped server that saves one is not scaled + // up. This runs before the replica assignment and the security refresh, + // so the StatefulSet is left exactly as it was. A running server (replicas + // above zero) is never touched. A new StatefulSet is created at zero. + if actualReplicas > 0 && (ss.Spec.Replicas == nil || *ss.Spec.Replicas == 0) && r.rootOverrideHeld(ctx, &live) { + r.recordRootOverrideHold(&live) + if ss.ResourceVersion != "" { + return nil + } + actualReplicas = 0 + } + // Security-derived template parts are written only when the workload is + // new or starts from zero replicas (brief D3, R5). A running workload + // keeps the parts it was started with, so saving an override never + // restarts a pod. The live replica count is read before the assignment + // below overwrites it. + // A change of workload profile (restricted mode on or off) replaces the + // pods anyway, so it also takes the desired security values. + profileChange := ss.ResourceVersion != "" && + r.RestrictedWorkloads != (ss.Spec.Template.Annotations[workloadSecurityLabel] == "restricted") + securityRefresh := ss.ResourceVersion == "" || profileChange || + (ss.Spec.Replicas != nil && *ss.Spec.Replicas == 0 && actualReplicas > 0) + priorTemplate := ss.Spec.Template.Spec.DeepCopy() + priorSecurityApplied := ss.Spec.Template.Annotations[securityAppliedAnnotation] + desiredSecurity := resolveGameSecurity(tmpl, gs) + // Pod-level filesystem group and change policy the pod spec renders with. + // A kept template renders from what it already carries, which may predate + // the feature (no policy set). + securityFSGroup, securityPolicy := desiredSecurity.FSGroup.Value, desiredSecurity.fsGroupChangePolicy() + if !securityRefresh { + securityFSGroup, securityPolicy = nil, nil + if prior := priorTemplate.SecurityContext; prior != nil { + securityFSGroup, securityPolicy = prior.FSGroup, prior.FSGroupChangePolicy + } + } ss.Spec.Replicas = &actualReplicas if held && (op.Kind != "Rollout" || op.Token != live.Annotations[effectiveTemplateAnnotation] || len(op.Recovery) != 0) && (!ss.CreationTimestamp.IsZero() || ss.ResourceVersion != "") { // Restore and wipe may stop the existing workload, but rollout @@ -2033,6 +2079,21 @@ func (r *GameServerReconciler) reconcileStatefulSet( delete(ann, configHashAnnotation) } ss.Spec.Template.Annotations = ann + if securityRefresh { + encoded, err := encodeSecurityAnnotation(desiredSecurity.settings()) + if err != nil { + return err + } + if ss.Spec.Template.Annotations == nil { + ss.Spec.Template.Annotations = map[string]string{} + } + ss.Spec.Template.Annotations[securityAppliedAnnotation] = encoded + } else if priorSecurityApplied != "" { + if ss.Spec.Template.Annotations == nil { + ss.Spec.Template.Annotations = map[string]string{} + } + ss.Spec.Template.Annotations[securityAppliedAnnotation] = priorSecurityApplied + } ss.Spec.Template.Spec.Containers = []corev1.Container{ buildGameContainer(gs, tmpl, image, ver, mc), buildAgentContainer(gs, tmpl, ver, r.AgentImage, r.AgentLogLevel, r.AgentImagePullPolicy, r.AgentResources), @@ -2101,7 +2162,7 @@ func (r *GameServerReconciler) reconcileStatefulSet( }, }, }) - initContainers = append(initContainers, buildConfigInitContainer(r.ConfigInitImage, tmpl, r.AgentResources)) + initContainers = append(initContainers, buildConfigInitContainerResolved(r.ConfigInitImage, tmpl, securityFSGroup, r.AgentResources)) } ss.Spec.Template.Spec.InitContainers = initContainers // Per-(version+loader) mod volume, nested at storage.mountPath/ @@ -2140,7 +2201,13 @@ func (r *GameServerReconciler) reconcileStatefulSet( } // Same unconditional-assign reasoning: removing template.spec.security // must clear a previously-set pod-level FSGroup, not leave it pinned. - ss.Spec.Template.Spec.SecurityContext = gamePodSecurityContext(tmpl) + ss.Spec.Template.Spec.SecurityContext = gamePodSecurityContextResolved(securityFSGroup, securityPolicy) + if r.RestrictedWorkloads && ss.Spec.Template.Spec.SecurityContext == nil { + // Restricted mode requires a pod security context (applyWorkloadSecurity + // sets its restricted fields on it). Validation refuses a restricted + // server without an fsGroup; this keeps the write from dereferencing nil. + ss.Spec.Template.Spec.SecurityContext = &corev1.PodSecurityContext{} + } if r.RestrictedWorkloads { if ss.Spec.Template.Annotations == nil { ss.Spec.Template.Annotations = map[string]string{} @@ -2149,7 +2216,14 @@ func (r *GameServerReconciler) reconcileStatefulSet( } else { delete(ss.Spec.Template.Annotations, workloadSecurityLabel) } - applyWorkloadSecurity(&ss.Spec.Template.Spec, tmpl, r.RestrictedWorkloads, r.AgentTokenExpirationSeconds) + applyWorkloadSecurityResolved(&ss.Spec.Template.Spec, resolveGameSecurity(tmpl, gs), r.RestrictedWorkloads, r.AgentTokenExpirationSeconds) + if !securityRefresh { + // A running workload keeps the game container and config-init + // security it was started with. applyWorkloadSecurity above derives + // them from the template, so their exact prior values are restored. + restoreContainerSecurityContext(&ss.Spec.Template.Spec, priorTemplate, gameContainerName) + restoreContainerSecurityContext(&ss.Spec.Template.Spec, priorTemplate, securityConfigInitContainerName) + } // Default to the per-GameServer SA so the agent's heartbeat can // patch gameservers/status (see reconcileAgentRBAC); an explicit // spec.serviceAccountName still wins. @@ -2166,7 +2240,12 @@ func (r *GameServerReconciler) reconcileStatefulSet( ss.Spec.Template.Spec.ShareProcessNamespace = &shareProcess return controllerutil.SetControllerReference(gs, ss, r.Scheme) }) - return err + if err != nil { + return err + } + // Runs after the mutate, never inside it: the observed value comes from a + // pod that exists only once the StatefulSet has been written (R6). + return r.recordObservedSecurity(ctx, gs, ss) } // effectiveMountPath is where the game's data volume is mounted, @@ -2542,6 +2621,13 @@ func configInitImageOrDefault(image string) string { // and directory it copied group-writable so a non-root game sharing that // fsGroup can update them. func buildConfigInitContainer(image string, tmpl *gameplanev1alpha1.GameTemplate, defaults ...*corev1.ResourceRequirements) corev1.Container { + return buildConfigInitContainerResolved(image, tmpl, resolveGameSecurity(tmpl, nil).FSGroup.Value, defaults...) +} + +// buildConfigInitContainerResolved is buildConfigInitContainer with the +// filesystem group already resolved for the server (a nil fsGroup means none +// applies). Production callers pass the value the StatefulSet applies. +func buildConfigInitContainerResolved(image string, tmpl *gameplanev1alpha1.GameTemplate, fsGroup *int64, defaults ...*corev1.ResourceRequirements) corev1.Container { image = configInitImageOrDefault(image) mountPath := effectiveMountPath(tmpl) cpCmd := "cp -RL " + configFilesStagingPath + "/* '" + mountPath + "/'" @@ -2550,8 +2636,8 @@ func buildConfigInitContainer(image string, tmpl *gameplanev1alpha1.GameTemplate // Newly created files must inherit the declared shared group even on // local-path volumes that do not implement kubelet fsGroup ownership. // Only reconcile copied entries; unrelated server data keeps its modes. - if tmpl.Spec.Security != nil && tmpl.Spec.Security.FSGroup != nil { - group := *tmpl.Spec.Security.FSGroup + if fsGroup != nil { + group := *fsGroup security = &corev1.SecurityContext{RunAsGroup: ptrTo(group)} // Restricted init runs as the game UID. It can overwrite an existing // root-owned, shared-group-writable file, but cannot chmod that file. @@ -2694,28 +2780,34 @@ func buildGameContainer( c.TTY = true c.Stdin = true } - c.SecurityContext = gameContainerSecurityContext(tmpl) + resolved := resolveGameSecurity(tmpl, gs) + c.SecurityContext = gameContainerSecurityContextResolved(resolved.RunAsUser.Value, resolved.RunAsGroup.Value) return c } -// gameContainerSecurityContext returns the GAME container's -// SecurityContext derived from the template's optional Security block, or -// nil when the template sets neither RunAsUser nor RunAsGroup — so a -// template that doesn't opt in renders a pod spec byte-identical to -// before this field existed (no empty `securityContext: {}`). Unlike -// buildAgentContainer's fixed distroless SecurityContext, this only sets -// what the template asks for: most game images need nothing beyond the -// uid/gid override to run non-root (e.g. ARK's uid 25000), and forcing +// gameContainerSecurityContext returns the GAME container's SecurityContext +// for the template's own Security block, with no server override applied. +func gameContainerSecurityContext(tmpl *gameplanev1alpha1.GameTemplate) *corev1.SecurityContext { + resolved := resolveGameSecurity(tmpl, nil) + return gameContainerSecurityContextResolved(resolved.RunAsUser.Value, resolved.RunAsGroup.Value) +} + +// gameContainerSecurityContextResolved builds the GAME container's +// SecurityContext from the resolved runAsUser and runAsGroup, or returns nil +// when neither applies, so a server that sets nothing renders a pod spec +// byte-identical to before this field existed (no empty `securityContext: {}`). +// Unlike buildAgentContainer's fixed distroless SecurityContext, this only sets +// what the server asks for: most game images need nothing beyond the uid/gid +// override to run non-root (e.g. ARK's uid 25000), and forcing // readOnlyRootFilesystem/capabilities drops on arbitrary third-party game // images would break ones that don't expect it. -func gameContainerSecurityContext(tmpl *gameplanev1alpha1.GameTemplate) *corev1.SecurityContext { - sec := tmpl.Spec.Security - if sec == nil || (sec.RunAsUser == nil && sec.RunAsGroup == nil) { +func gameContainerSecurityContextResolved(runAsUser, runAsGroup *int64) *corev1.SecurityContext { + if runAsUser == nil && runAsGroup == nil { return nil } return &corev1.SecurityContext{ - RunAsUser: sec.RunAsUser, - RunAsGroup: sec.RunAsGroup, + RunAsUser: runAsUser, + RunAsGroup: runAsGroup, } } @@ -2820,16 +2912,23 @@ func isServerOwnedConfigMap(cm *corev1.ConfigMap, gs *gameplanev1alpha1.GameServ return false } -// gamePodSecurityContext returns the pod-level SecurityContext carrying -// FSGroup, or nil when the template's Security block doesn't set one — -// mirroring gameContainerSecurityContext's byte-identical-when-unset -// behavior at the pod level. +// gamePodSecurityContext returns the pod-level SecurityContext for the +// template's own Security block, with no server override applied. func gamePodSecurityContext(tmpl *gameplanev1alpha1.GameTemplate) *corev1.PodSecurityContext { - sec := tmpl.Spec.Security - if sec == nil || sec.FSGroup == nil { + resolved := resolveGameSecurity(tmpl, nil) + return gamePodSecurityContextResolved(resolved.FSGroup.Value, resolved.fsGroupChangePolicy()) +} + +// gamePodSecurityContextResolved returns the pod-level SecurityContext carrying +// the resolved FSGroup and its FSGroupChangePolicy, or nil when no filesystem +// group applies, mirroring gameContainerSecurityContextResolved's +// byte-identical-when-unset behavior at the pod level. The policy is only +// meaningful with an FSGroup, so it is dropped when fsGroup is nil. +func gamePodSecurityContextResolved(fsGroup *int64, policy *corev1.PodFSGroupChangePolicy) *corev1.PodSecurityContext { + if fsGroup == nil { return nil } - return &corev1.PodSecurityContext{FSGroup: sec.FSGroup} + return &corev1.PodSecurityContext{FSGroup: fsGroup, FSGroupChangePolicy: policy} } // buildAgentContainer constructs the sidecar management agent container definition. diff --git a/operator/internal/controller/gameserver_idle.go b/operator/internal/controller/gameserver_idle.go index 09c491ffc..b9f649ad0 100644 --- a/operator/internal/controller/gameserver_idle.go +++ b/operator/internal/controller/gameserver_idle.go @@ -330,6 +330,17 @@ func (r *GameServerReconciler) reconcileIdle( out := idleDecide(in) if out.wake && in.asleepSince != nil && !in.suspended && in.spec != nil && in.spec.Enabled && r.WakeStartLimit > 0 { + // A server that saves a root override while the cluster disallows one + // takes no wake slot and is not admitted (spec 030, OD-9 item 4). Its + // SecurityAllowed condition explains the hold. + if r.rootOverrideHeld(ctx, gs) { + rootHeld := &gameplanev1alpha1.IdleStatus{Asleep: true, AsleepSince: &metav1.Time{Time: *in.asleepSince}, + Reason: "held: saved root overrides are not allowed in this cluster"} + if gs.Status.Idle != nil { + rootHeld.LastWakeTime = gs.Status.Idle.LastWakeTime.DeepCopy() + } + return idleAsleep, rootHeld, 0, out.err, nil + } admitted, err := r.reserveWakeStart(ctx, gs) if err != nil { return idleAsleep, nil, 0, nil, err diff --git a/operator/internal/controller/gameserver_status.go b/operator/internal/controller/gameserver_status.go index 9846abe3c..8b7d6b154 100644 --- a/operator/internal/controller/gameserver_status.go +++ b/operator/internal/controller/gameserver_status.go @@ -341,6 +341,26 @@ func (r *GameServerReconciler) reconcileStatus( ports: extra.portAllocation, }) + // SecurityAllowed (spec 030, OD-4): a saved root override the cluster does + // not allow is reported, for a stopped server and a running one. + securityRunning := ssExists && ss.Spec.Replicas != nil && *ss.Spec.Replicas > 0 + gs.Status.Conditions = r.applySecurityAllowedCondition(ctx, gs.Status.Conditions, gs, securityRunning) + + // status.security (T021): desired is what the next start uses, from the + // effective template (the pin, D16) and this server's overrides. applied is + // what the data volume was last set up with, read from the observed record + // (nil before the first start). Both live in this one merge patch. + appliedSecurity, err := readAppliedSecurity(ctx, r.wipeReader(), gs) + if err != nil { + return 0, fmt.Errorf("read applied security: %w", err) + } + desiredSecurity := resolveGameSecurity(tmpl, gs).settings() + gs.Status.Security = &gameplanev1alpha1.GameServerSecurityStatus{ + Desired: &desiredSecurity, + Applied: appliedSecurity, + Pending: securityPending(desiredSecurity, appliedSecurity), + } + if !reflect.DeepEqual(orig, &gs.Status) { if err := r.Status().Patch(ctx, gs, client.MergeFrom(base)); err != nil { return 0, err diff --git a/operator/internal/controller/gameserver_template_revision.go b/operator/internal/controller/gameserver_template_revision.go index 8bbb33ba6..9e25be399 100644 --- a/operator/internal/controller/gameserver_template_revision.go +++ b/operator/internal/controller/gameserver_template_revision.go @@ -219,7 +219,7 @@ func (r *GameServerReconciler) reconcileTemplateRevision(ctx context.Context, gs return effective, false, workloadPolicyRejection{err} } if r.RestrictedWorkloads { - if err := validateRestrictedTemplate(target); err != nil { + if err := validateRestrictedSecurity(resolveGameSecurity(target, gs)); err != nil { return nil, false, err } } @@ -290,7 +290,7 @@ func (r *GameServerReconciler) reconcileTemplateRevision(ctx context.Context, gs return effective, false, workloadPolicyRejection{err} } if r.RestrictedWorkloads { - if err := validateRestrictedTemplate(target); err != nil { + if err := validateRestrictedSecurity(resolveGameSecurity(target, gs)); err != nil { return nil, false, err } } @@ -347,7 +347,10 @@ func (r *GameServerReconciler) baselineStopTemplate(ctx context.Context, gs *gam func (r *GameServerReconciler) baselineRenderInputs(gs *gameplanev1alpha1.GameServer, revision string) (string, error) { spec := gs.Spec.DeepCopy() spec.Suspend = false - spec.StopGracePeriodSeconds, spec.TemplateRollout, spec.BackupPolicy, spec.Idle, spec.Capture = nil, nil, nil, nil, nil + // Security overrides are applied only at a start from zero replicas (see + // reconcileStatefulSet), so saving one must not change the baseline hash + // and rewrite a running pod (spec 030, FR-008, T075). + spec.StopGracePeriodSeconds, spec.TemplateRollout, spec.BackupPolicy, spec.Idle, spec.Capture, spec.Security = nil, nil, nil, nil, nil, nil if spec.Networking.Expose == "Hostport" { spec.Networking = gameplanev1alpha1.GameServerNetworking{Expose: "Hostport"} } else { diff --git a/operator/internal/controller/restore_controller.go b/operator/internal/controller/restore_controller.go index 1fee91a2d..5c2792f94 100644 --- a/operator/internal/controller/restore_controller.go +++ b/operator/internal/controller/restore_controller.go @@ -274,7 +274,12 @@ func (r *RestoreReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct job.Spec.ActiveDeadlineSeconds = &deadline job.Annotations = map[string]string{restoreTargetAnnotation: rs.Annotations[restoreTargetAnnotation]} job.Spec.Template.Labels = map[string]string{backupRestoreJobLabel: backupRestoreJobValue, restoreUIDLabel: string(rs.UID)} - job.Spec.Template.Spec = r.buildRestorePodSpec(&rs, &src, &tmpl) + // The restore writes into the data volume as the server last set it up (spec 030, FR-011). + appliedFSGroup, err := appliedBackupFSGroup(ctx, r.apiReader(), &gs, &tmpl) + if err != nil { + return ctrl.Result{}, err + } + job.Spec.Template.Spec = r.buildRestorePodSpec(&rs, &src, &tmpl, appliedFSGroup) if err := r.GameWorkloadPolicy.placeFirstVolumeConsumer(ctx, r.apiReader(), &gs, &tmpl, &job.Spec.Template.Spec); err != nil { var rejected workloadPolicyRejection if errors.As(err, &rejected) { @@ -423,14 +428,14 @@ func (r *RestoreReconciler) SetupWithManager(mgr ctrl.Manager) error { // buildRestorePodSpec mirrors backup_controller.buildBackupPodSpec but // runs `restic restore ` and mounts the data PVC read-write. func (r *RestoreReconciler) buildRestorePodSpec( - rs *gameplanev1alpha1.Restore, src *gameplanev1alpha1.Backup, tmpl *gameplanev1alpha1.GameTemplate, + rs *gameplanev1alpha1.Restore, src *gameplanev1alpha1.Backup, tmpl *gameplanev1alpha1.GameTemplate, appliedFSGroup ...*int64, ) corev1.PodSpec { nonRoot := true roRootFS := true noPrivEsc := false uid := int64(65532) spec := corev1.PodSpec{ - SecurityContext: buildBackupPodSecurityContext(tmpl), + SecurityContext: buildBackupPodSecurityContext(tmpl, appliedFSGroup...), Containers: []corev1.Container{{ Name: "restic", TerminationMessagePolicy: corev1.TerminationMessageFallbackToLogsOnError, diff --git a/operator/internal/controller/security_backup_envtest_test.go b/operator/internal/controller/security_backup_envtest_test.go new file mode 100644 index 000000000..0580d80fe --- /dev/null +++ b/operator/internal/controller/security_backup_envtest_test.go @@ -0,0 +1,118 @@ +//go:build envtest + +package controller + +import ( + "context" + "testing" + + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" +) + +// secBackupStoppedSS creates a stopped StatefulSet controlled by the named +// GameServer, carrying the observed security annotation with observedGroup as +// the applied filesystem group. Creating it with the annotation avoids a race +// with the restore job's read. +func secBackupStoppedSS(t *testing.T, ns, name string, observedGroup int64) { + t.Helper() + gs := getGameServer(t, ns, name) + raw, err := encodeSecurityAnnotation(gameplanev1alpha1.SecuritySettings{ + FSGroup: gameplanev1alpha1.SecurityIDStatus{Value: secSettingsInt64(observedGroup), Source: gameplanev1alpha1.SecuritySourceOverride}, + }) + if err != nil { + t.Fatalf("encode observed security: %v", err) + } + zero := int32(0) + labels := map[string]string{"app": name} + ss := &appsv1.StatefulSet{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Namespace: ns, + Annotations: map[string]string{securityAppliedObservedAnnotation: raw}, + OwnerReferences: []metav1.OwnerReference{{ + APIVersion: gameplanev1alpha1.GroupVersion.String(), + Kind: "GameServer", + Name: name, + UID: gs.UID, + Controller: ownerBoolPtr(true), + }}, + }, + Spec: appsv1.StatefulSetSpec{ + Replicas: &zero, + ServiceName: name, + Selector: &metav1.LabelSelector{MatchLabels: labels}, + Template: corev1.PodTemplateSpec{ + ObjectMeta: metav1.ObjectMeta{Labels: labels}, + Spec: corev1.PodSpec{Containers: []corev1.Container{{Name: "game", Image: "busybox"}}}, + }, + }, + } + if err := k8sClient.Create(context.Background(), ss); err != nil { + t.Fatalf("create stopped statefulset: %v", err) + } + ss.Status.ObservedGeneration = ss.Generation + if err := k8sClient.Status().Update(context.Background(), ss); err != nil { + t.Fatalf("observe stopped statefulset: %v", err) + } +} + +// TestRestore_UsesAppliedFSGroupNotPendingOverride: a restore of a stopped +// server whose saved fsGroup override is pending runs its job with the group +// the data volume was last set up with (FR-011), not the saved value. +func TestRestore_UsesAppliedFSGroupNotPendingOverride(t *testing.T) { + ns := newNamespace(t) + startMgr(t, ns, withRestoreReconciler()) + tmplName := uniqueName("secrs") + tmpl := buildGameTemplate(tmplName) + tmpl.Spec.Security = &gameplanev1alpha1.GameSecuritySpec{FSGroup: secSettingsInt64(2000)} + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + + gs := buildGameServer(ns, "smp", tmplName) + gs.Spec.Security = &gameplanev1alpha1.GameServerSecuritySpec{ + FSGroup: &gameplanev1alpha1.SecurityIDOverride{Value: secSettingsInt64(3000)}, + } + if err := k8sClient.Create(context.Background(), gs); err != nil { + t.Fatalf("create gameserver: %v", err) + } + if err := k8sClient.Create(context.Background(), buildResticRepoSecret(ns, "repo")); err != nil { + t.Fatalf("create secret: %v", err) + } + if err := k8sClient.Create(context.Background(), buildBackup(ns, "smp-001", "smp", "repo")); err != nil { + t.Fatalf("create backup: %v", err) + } + markBackupSucceeded(t, ns, "smp-001", "snap-1", "") + + if err := k8sClient.Create(context.Background(), buildRestore(ns, "rs-1", "smp-001", "smp")); err != nil { + t.Fatalf("create restore: %v", err) + } + eventually(t, func() (bool, string) { + return getGameServer(t, ns, "smp").Spec.Suspend, "spec.suspend not yet true" + }) + markGameServerPhase(t, ns, "smp", gameplanev1alpha1.GameServerPhaseSuspended) + + // The volume was last set up with fsGroup 1000; the saved 3000 is pending. + secBackupStoppedSS(t, ns, "smp", 1000) + + var ps corev1.PodSpec + eventually(t, func() (bool, string) { + j, ok := getJob(t, ns, "restore-rs-1") + if !ok { + return false, "job not yet created" + } + ps = j.Spec.Template.Spec + return true, "" + }) + if ps.SecurityContext == nil || ps.SecurityContext.FSGroup == nil { + t.Fatal("restore pod has no fsGroup") + } + if got := *ps.SecurityContext.FSGroup; got != 1000 { + t.Errorf("restore FSGroup = %d, want applied 1000 (not desired 3000)", got) + } +} diff --git a/operator/internal/controller/security_backup_prefeature_test.go b/operator/internal/controller/security_backup_prefeature_test.go new file mode 100644 index 000000000..91d106473 --- /dev/null +++ b/operator/internal/controller/security_backup_prefeature_test.go @@ -0,0 +1,58 @@ +package controller + +import ( + "context" + "testing" + + appsv1 "k8s.io/api/apps/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + + gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" +) + +// A StatefulSet from before spec 030 has no security annotations. Its backup +// and restore pods keep the template group and never pick up a pending +// fsGroup override before the server restarts (FR-011). +func TestAppliedBackupFSGroup_PreFeatureIgnoresPendingOverride(t *testing.T) { + gs := &gameplanev1alpha1.GameServer{ + ObjectMeta: metav1.ObjectMeta{Name: "smp", Namespace: "games", UID: types.UID("secbackup-prefeature-uid")}, + Spec: gameplanev1alpha1.GameServerSpec{Security: &gameplanev1alpha1.GameServerSecuritySpec{ + FSGroup: &gameplanev1alpha1.SecurityIDOverride{Value: secSettingsInt64(3000)}, + }}, + } + ss := &appsv1.StatefulSet{ + ObjectMeta: metav1.ObjectMeta{ + Name: gs.Name, + Namespace: gs.Namespace, + OwnerReferences: []metav1.OwnerReference{{ + APIVersion: gameplanev1alpha1.GroupVersion.String(), + Kind: "GameServer", + Name: gs.Name, + UID: gs.UID, + Controller: ownerBoolPtr(true), + }}, + }, + } + cases := []struct { + name string + tmpl *gameplanev1alpha1.GameTemplate + want int64 + }{ + {name: "template group, not the pending override", tmpl: secBackupTemplate(secSettingsInt64(2000)), want: 2000}, + {name: "no template group uses the backup default", tmpl: secBackupTemplate(nil), want: backupDefaultFSGroup}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + c := fake.NewClientBuilder().WithScheme(testScheme(t)).WithObjects(ss.DeepCopy()).Build() + got, err := appliedBackupFSGroup(context.Background(), c, gs, tc.tmpl) + if err != nil { + t.Fatalf("appliedBackupFSGroup: %v", err) + } + if got == nil || *got != tc.want { + t.Fatalf("appliedBackupFSGroup = %v, want %d", got, tc.want) + } + }) + } +} diff --git a/operator/internal/controller/security_backup_test.go b/operator/internal/controller/security_backup_test.go new file mode 100644 index 000000000..71f96c204 --- /dev/null +++ b/operator/internal/controller/security_backup_test.go @@ -0,0 +1,161 @@ +package controller + +import ( + "context" + "testing" + + appsv1 "k8s.io/api/apps/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + + gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" +) + +// secBackupTemplate returns a template whose module default fsGroup is fsGroup, +// or no security block when fsGroup is nil. +func secBackupTemplate(fsGroup *int64) *gameplanev1alpha1.GameTemplate { + tmpl := &gameplanev1alpha1.GameTemplate{} + if fsGroup != nil { + tmpl.Spec.Security = &gameplanev1alpha1.GameSecuritySpec{FSGroup: fsGroup} + } + return tmpl +} + +func TestBuildBackupPodSecurityContext_AppliedFSGroupWins(t *testing.T) { + desired := secSettingsInt64(2000) + applied := secSettingsInt64(1000) + cases := []struct { + name string + tmpl *gameplanev1alpha1.GameTemplate + args []*int64 + want int64 + }{ + {name: "applied group beats the module default", tmpl: secBackupTemplate(desired), args: []*int64{applied}, want: 1000}, + {name: "no argument falls back to the module default", tmpl: secBackupTemplate(desired), args: nil, want: 2000}, + {name: "nil argument falls back to the module default", tmpl: secBackupTemplate(desired), args: []*int64{nil}, want: 2000}, + {name: "applied group without a module default", tmpl: secBackupTemplate(nil), args: []*int64{applied}, want: 1000}, + {name: "no group anywhere uses the backup default", tmpl: secBackupTemplate(nil), args: nil, want: backupDefaultFSGroup}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + sc := buildBackupPodSecurityContext(tc.tmpl, tc.args...) + if sc.FSGroup == nil || *sc.FSGroup != tc.want { + t.Fatalf("FSGroup = %v, want %d", sc.FSGroup, tc.want) + } + }) + } +} + +// secBackupObservedSS returns a StatefulSet controlled by gs whose observed +// annotation records the given settings. +func secBackupObservedSS(t *testing.T, gs *gameplanev1alpha1.GameServer, observed gameplanev1alpha1.SecuritySettings) *appsv1.StatefulSet { + t.Helper() + raw, err := encodeSecurityAnnotation(observed) + if err != nil { + t.Fatalf("encode observed: %v", err) + } + return &appsv1.StatefulSet{ + ObjectMeta: metav1.ObjectMeta{ + Name: gs.Name, + Namespace: gs.Namespace, + Annotations: map[string]string{securityAppliedObservedAnnotation: raw}, + OwnerReferences: []metav1.OwnerReference{{ + APIVersion: gameplanev1alpha1.GroupVersion.String(), + Kind: "GameServer", + Name: gs.Name, + UID: gs.UID, + Controller: ownerBoolPtr(true), + }}, + }, + } +} + +func TestAppliedBackupFSGroup_Sources(t *testing.T) { + gsUID := types.UID("secbackup-gs-uid") + newGS := func(override *gameplanev1alpha1.GameServerSecuritySpec) *gameplanev1alpha1.GameServer { + return &gameplanev1alpha1.GameServer{ + ObjectMeta: metav1.ObjectMeta{Name: "smp", Namespace: "games", UID: gsUID}, + Spec: gameplanev1alpha1.GameServerSpec{Security: override}, + } + } + overrideFS := func(v int64) *gameplanev1alpha1.GameServerSecuritySpec { + return &gameplanev1alpha1.GameServerSecuritySpec{FSGroup: &gameplanev1alpha1.SecurityIDOverride{Value: secSettingsInt64(v)}} + } + appliedFS := func(v *int64) gameplanev1alpha1.SecuritySettings { + return gameplanev1alpha1.SecuritySettings{FSGroup: gameplanev1alpha1.SecurityIDStatus{Value: v, Source: gameplanev1alpha1.SecuritySourceModuleDefault}} + } + + cases := []struct { + name string + gs *gameplanev1alpha1.GameServer + tmpl *gameplanev1alpha1.GameTemplate + objs func(gs *gameplanev1alpha1.GameServer) []*appsv1.StatefulSet + want int64 + }{ + { + name: "never started uses the resolved override, not the template", + gs: newGS(overrideFS(3000)), + tmpl: secBackupTemplate(secSettingsInt64(2000)), + want: 3000, + }, + { + name: "never started without an override uses the module default", + gs: newGS(nil), + tmpl: secBackupTemplate(secSettingsInt64(2000)), + want: 2000, + }, + { + name: "never started with no group anywhere uses the backup default", + gs: newGS(nil), + tmpl: secBackupTemplate(nil), + want: backupDefaultFSGroup, + }, + { + name: "pending start: applied group wins over the desired override", + gs: newGS(overrideFS(3000)), + tmpl: secBackupTemplate(secSettingsInt64(2000)), + objs: func(gs *gameplanev1alpha1.GameServer) []*appsv1.StatefulSet { + return []*appsv1.StatefulSet{secBackupObservedSS(t, gs, appliedFS(secSettingsInt64(1000)))} + }, + want: 1000, + }, + { + name: "applied record without a group means the image default", + gs: newGS(overrideFS(3000)), + tmpl: secBackupTemplate(secSettingsInt64(2000)), + objs: func(gs *gameplanev1alpha1.GameServer) []*appsv1.StatefulSet { + return []*appsv1.StatefulSet{secBackupObservedSS(t, gs, appliedFS(nil))} + }, + want: backupDefaultFSGroup, + }, + { + name: "a StatefulSet this server does not control is ignored", + gs: newGS(overrideFS(3000)), + tmpl: secBackupTemplate(secSettingsInt64(2000)), + objs: func(gs *gameplanev1alpha1.GameServer) []*appsv1.StatefulSet { + ss := secBackupObservedSS(t, gs, appliedFS(secSettingsInt64(1000))) + ss.OwnerReferences = nil + return []*appsv1.StatefulSet{ss} + }, + want: 3000, + }, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + b := fake.NewClientBuilder().WithScheme(testScheme(t)) + if tc.objs != nil { + for _, ss := range tc.objs(tc.gs) { + b = b.WithObjects(ss) + } + } + got, err := appliedBackupFSGroup(context.Background(), b.Build(), tc.gs, tc.tmpl) + if err != nil { + t.Fatalf("appliedBackupFSGroup: %v", err) + } + if got == nil || *got != tc.want { + t.Fatalf("appliedBackupFSGroup = %v, want %d", got, tc.want) + } + }) + } +} diff --git a/operator/internal/controller/security_builders_test.go b/operator/internal/controller/security_builders_test.go new file mode 100644 index 000000000..4bd888c9e --- /dev/null +++ b/operator/internal/controller/security_builders_test.go @@ -0,0 +1,139 @@ +package controller + +import ( + "encoding/json" + "strings" + "testing" + + corev1 "k8s.io/api/core/v1" + + gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" +) + +// secMarshal renders a value to JSON so a test can prove a key is absent from +// the rendered pod spec, not only nil in Go. +func secMarshal(t *testing.T, v any) string { + t.Helper() + raw, err := json.Marshal(v) + if err != nil { + t.Fatalf("marshal: %v", err) + } + return string(raw) +} + +// TestSecurityBuilders_UnsetRendersNoSecurityContext is the byte-identical +// contract (T016): with nothing applied, no container or pod securityContext is +// rendered, so an existing StatefulSet does not change on upgrade. +func TestSecurityBuilders_UnsetRendersNoSecurityContext(t *testing.T) { + tmpl := &gameplanev1alpha1.GameTemplate{} + tmpl.Name = "minecraft" + tmpl.Spec.Game = "minecraft" + gs := &gameplanev1alpha1.GameServer{} + gs.Name = "alpha" + + t.Run("template and server with no security", func(t *testing.T) { + game := buildGameContainer(gs, tmpl, "busybox:1.36", nil, &materializedConfig{}) + if game.SecurityContext != nil { + t.Errorf("game SecurityContext = %+v, want nil", game.SecurityContext) + } + if strings.Contains(secMarshal(t, game), `"securityContext"`) { + t.Error("rendered game container carries a securityContext key") + } + if got := gamePodSecurityContext(tmpl); got != nil { + t.Errorf("gamePodSecurityContext = %+v, want nil", got) + } + if got := gameContainerSecurityContext(tmpl); got != nil { + t.Errorf("gameContainerSecurityContext = %+v, want nil", got) + } + cfg := buildConfigInitContainer("busybox:1.36", tmpl) + if cfg.SecurityContext != nil { + t.Errorf("config-init SecurityContext = %+v, want nil", cfg.SecurityContext) + } + if strings.Contains(secMarshal(t, cfg), `"securityContext"`) { + t.Error("rendered config-init container carries a securityContext key") + } + }) + + t.Run("override that resolves to no value renders nothing", func(t *testing.T) { + gsOverride := gs.DeepCopy() + gsOverride.Spec.Security = &gameplanev1alpha1.GameServerSecuritySpec{ + RunAsUser: &gameplanev1alpha1.SecurityIDOverride{UseImageDefault: secBool(true)}, + } + game := buildGameContainer(gsOverride, tmpl, "busybox:1.36", nil, &materializedConfig{}) + if game.SecurityContext != nil { + t.Errorf("game SecurityContext = %+v, want nil for an image-default override", game.SecurityContext) + } + }) + + t.Run("resolved helpers with nothing to apply return nil", func(t *testing.T) { + if got := gameContainerSecurityContextResolved(nil, nil); got != nil { + t.Errorf("gameContainerSecurityContextResolved(nil, nil) = %+v, want nil", got) + } + onRoot := corev1.FSGroupChangeOnRootMismatch + if got := gamePodSecurityContextResolved(nil, &onRoot); got != nil { + t.Errorf("gamePodSecurityContextResolved(nil, policy) = %+v, want nil: the policy has no effect without fsGroup", got) + } + }) +} + +// TestSecurityBuilders_HelperContainersKeepFixedUsers proves the helper +// containers keep their fixed identities when a server or template sets +// security (FR-012). The config-init container takes only the group that the +// data volume needs, and never a user. +func TestSecurityBuilders_HelperContainersKeepFixedUsers(t *testing.T) { + tmpl := secTemplate(&gameplanev1alpha1.GameSecuritySpec{RunAsUser: secInt(25000), RunAsGroup: secInt(25000), FSGroup: secInt(25000)}) + gs := secServer(&gameplanev1alpha1.GameServerSecuritySpec{ + RunAsUser: &gameplanev1alpha1.SecurityIDOverride{Value: secInt(2000)}, + FSGroup: &gameplanev1alpha1.SecurityIDOverride{Value: secInt(3000)}, + }) + + t.Run("agent keeps its fixed non-root user", func(t *testing.T) { + agent := buildAgentContainer(gs, tmpl, nil, "agent:test", "", "") + sc := agent.SecurityContext + if sc == nil || sc.RunAsUser == nil || *sc.RunAsUser != 65532 { + t.Fatalf("agent RunAsUser = %+v, want fixed 65532", sc) + } + if sc.RunAsNonRoot == nil || !*sc.RunAsNonRoot { + t.Error("agent RunAsNonRoot not set") + } + }) + + t.Run("config-init takes the group from the resolved fsGroup and no user", func(t *testing.T) { + cfg := buildConfigInitContainerResolved("busybox:1.36", tmpl, secInt(3000)) + sc := cfg.SecurityContext + if sc == nil || sc.RunAsGroup == nil || *sc.RunAsGroup != 3000 { + t.Fatalf("config-init SecurityContext = %+v, want RunAsGroup 3000", sc) + } + if sc.RunAsUser != nil { + t.Errorf("config-init RunAsUser = %d, want unset", *sc.RunAsUser) + } + }) + + t.Run("config-init from the template fsGroup has no user", func(t *testing.T) { + cfg := buildConfigInitContainer("busybox:1.36", tmpl) + if cfg.SecurityContext == nil || cfg.SecurityContext.RunAsGroup == nil || *cfg.SecurityContext.RunAsGroup != 25000 { + t.Fatalf("config-init SecurityContext = %+v, want RunAsGroup 25000", cfg.SecurityContext) + } + if cfg.SecurityContext.RunAsUser != nil { + t.Errorf("config-init RunAsUser = %d, want unset", *cfg.SecurityContext.RunAsUser) + } + }) +} + +// TestGameContainerRunAsGroupUseImageDefault proves a runAsGroup override with +// useImageDefault leaves the game container runAsGroup unset while the module +// runAsUser still applies (US2 scenario). +func TestGameContainerRunAsGroupUseImageDefault(t *testing.T) { + tmpl := secTemplate(&gameplanev1alpha1.GameSecuritySpec{RunAsUser: secInt(25000), RunAsGroup: secInt(25000)}) + gs := secServer(&gameplanev1alpha1.GameServerSecuritySpec{ + RunAsGroup: &gameplanev1alpha1.SecurityIDOverride{UseImageDefault: secBool(true)}, + }) + game := buildGameContainer(gs, tmpl, "busybox:1.36", nil, &materializedConfig{}) + sc := game.SecurityContext + if sc == nil || sc.RunAsUser == nil || *sc.RunAsUser != 25000 { + t.Fatalf("game SecurityContext = %+v, want RunAsUser 25000", sc) + } + if sc.RunAsGroup != nil { + t.Errorf("game RunAsGroup = %d, want unset for useImageDefault", *sc.RunAsGroup) + } +} diff --git a/operator/internal/controller/security_crd_validation_envtest_test.go b/operator/internal/controller/security_crd_validation_envtest_test.go new file mode 100644 index 000000000..6c3b58ddf --- /dev/null +++ b/operator/internal/controller/security_crd_validation_envtest_test.go @@ -0,0 +1,191 @@ +//go:build envtest + +package controller + +import ( + "context" + "strings" + "testing" + + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + + gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" +) + +// These cases cover the CEL and bounds rules on spec.security (GameServer +// overrides, GameTemplate defaults and risky reasons) and on +// Cluster.spec.controlPlaneNamespace. They run against the CRD schemas the +// suite loads from operator/config/crd, like crd_validation_envtest_test.go. + +func securityCRDIDOverride(value *int64, useImageDefault bool) *gameplanev1alpha1.SecurityIDOverride { + o := &gameplanev1alpha1.SecurityIDOverride{Value: value} + if useImageDefault { + t := true + o.UseImageDefault = &t + } + return o +} + +func securityCRDBool(v bool) *bool { + return &v +} + +func securityCRDInt64(v int64) *int64 { + return &v +} + +func TestSecurityCRD_GameServerOverrideAccepted(t *testing.T) { + cases := []struct { + name string + sec *gameplanev1alpha1.GameServerSecuritySpec + }{ + {"runAsUser value", &gameplanev1alpha1.GameServerSecuritySpec{ + RunAsUser: securityCRDIDOverride(securityCRDInt64(1000), false)}}, + {"runAsUser useImageDefault", &gameplanev1alpha1.GameServerSecuritySpec{ + RunAsUser: securityCRDIDOverride(nil, true)}}, + {"runAsUser value 4294967295 bound", &gameplanev1alpha1.GameServerSecuritySpec{ + RunAsUser: securityCRDIDOverride(securityCRDInt64(4294967295), false)}}, + {"runAsGroup and fsGroup values", &gameplanev1alpha1.GameServerSecuritySpec{ + RunAsGroup: securityCRDIDOverride(securityCRDInt64(1000), false), + FSGroup: securityCRDIDOverride(securityCRDInt64(1000), false)}}, + {"volumeOwnershipCheck EveryStart", &gameplanev1alpha1.GameServerSecuritySpec{ + VolumeOwnershipCheck: gameplanev1alpha1.VolumeOwnershipCheckEveryStart}}, + {"volumeOwnershipCheck OnlyWhenWrong", &gameplanev1alpha1.GameServerSecuritySpec{ + VolumeOwnershipCheck: gameplanev1alpha1.VolumeOwnershipCheckOnlyWhenWrong}}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + ns := newNamespace(t) + gs := validGameServer(ns, "sec-ok") + gs.Spec.Security = tc.sec + if err := k8sClient.Create(context.Background(), gs); err != nil { + t.Fatalf("expected accepted, got %v", err) + } + }) + } +} + +func TestSecurityCRD_GameServerOverrideRejected(t *testing.T) { + cases := []struct { + name string + sec *gameplanev1alpha1.GameServerSecuritySpec + }{ + {"runAsUser both value and useImageDefault", &gameplanev1alpha1.GameServerSecuritySpec{ + RunAsUser: securityCRDIDOverride(securityCRDInt64(1000), true)}}, + {"runAsUser neither value nor useImageDefault", &gameplanev1alpha1.GameServerSecuritySpec{ + RunAsUser: &gameplanev1alpha1.SecurityIDOverride{}}}, + {"runAsUser useImageDefault false", &gameplanev1alpha1.GameServerSecuritySpec{ + RunAsUser: &gameplanev1alpha1.SecurityIDOverride{UseImageDefault: securityCRDBool(false)}}}, + {"runAsUser value -1", &gameplanev1alpha1.GameServerSecuritySpec{ + RunAsUser: securityCRDIDOverride(securityCRDInt64(-1), false)}}, + {"runAsUser value 4294967296", &gameplanev1alpha1.GameServerSecuritySpec{ + RunAsUser: securityCRDIDOverride(securityCRDInt64(4294967296), false)}}, + {"volumeOwnershipCheck bad enum", &gameplanev1alpha1.GameServerSecuritySpec{ + VolumeOwnershipCheck: gameplanev1alpha1.VolumeOwnershipCheck("Sometimes")}}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + ns := newNamespace(t) + gs := validGameServer(ns, "sec-bad") + gs.Spec.Security = tc.sec + err := k8sClient.Create(context.Background(), gs) + if !apierrors.IsInvalid(err) { + t.Fatalf("expected Invalid, got %v", err) + } + }) + } +} + +func TestSecurityCRD_GameServerWithoutSecurityStillApplies(t *testing.T) { + ns := newNamespace(t) + gs := validGameServer(ns, "sec-absent") + if err := k8sClient.Create(context.Background(), gs); err != nil { + t.Fatalf("GameServer without spec.security rejected: %v", err) + } + var got gameplanev1alpha1.GameServer + if err := k8sClient.Get(context.Background(), + types.NamespacedName{Namespace: ns, Name: "sec-absent"}, &got); err != nil { + t.Fatalf("get GameServer: %v", err) + } + if got.Spec.Security != nil { + t.Fatalf("expected spec.security to stay absent, got %+v", got.Spec.Security) + } +} + +func TestSecurityCRD_GameTemplateRiskyReasonBound(t *testing.T) { + newTmpl := func(name, reason string) *gameplanev1alpha1.GameTemplate { + return &gameplanev1alpha1.GameTemplate{ + ObjectMeta: metav1.ObjectMeta{Name: name}, + Spec: gameplanev1alpha1.GameTemplateSpec{ + DisplayName: "security risky reason", + Game: "busybox", + Version: "1", + Image: "busybox:1.36", + Security: &gameplanev1alpha1.GameSecuritySpec{ + Risky: &gameplanev1alpha1.SecurityRiskSpec{ + RunAsUser: &gameplanev1alpha1.SecurityRiskNote{Reason: reason}, + }, + }, + }, + } + } + + tooLong := newTmpl("sec-risky-reason-201", strings.Repeat("x", 201)) + if err := k8sClient.Create(context.Background(), tooLong); !apierrors.IsInvalid(err) { + t.Fatalf("expected Invalid for 201-character risky reason, got %v", err) + } + + atLimit := newTmpl("sec-risky-reason-200", strings.Repeat("x", 200)) + if err := k8sClient.Create(context.Background(), atLimit); err != nil { + t.Fatalf("200-character risky reason rejected: %v", err) + } + t.Cleanup(func() { + _ = k8sClient.Delete(context.Background(), atLimit) + }) +} + +func TestSecurityCRD_ClusterControlPlaneNamespaceDefault(t *testing.T) { + const name = "sec-cp-ns-default" + cluster := &gameplanev1alpha1.Cluster{ + ObjectMeta: metav1.ObjectMeta{Name: name}, + Spec: gameplanev1alpha1.ClusterSpec{ + DisplayName: "control plane default", + KubeconfigSecret: gameplanev1alpha1.KubeconfigSecretRef{ + Name: "sec-cp-ns-kubeconfig", + Key: "kubeconfig", + }, + }, + } + if err := k8sClient.Create(context.Background(), cluster); err != nil { + t.Fatalf("create cluster without controlPlaneNamespace: %v", err) + } + t.Cleanup(func() { + _ = k8sClient.Delete(context.Background(), cluster) + }) + + var got gameplanev1alpha1.Cluster + if err := k8sClient.Get(context.Background(), types.NamespacedName{Name: name}, &got); err != nil { + t.Fatalf("get cluster: %v", err) + } + if got.Spec.ControlPlaneNamespace != "gameplane" { + t.Fatalf("controlPlaneNamespace default = %q, want %q", got.Spec.ControlPlaneNamespace, "gameplane") + } +} + +func TestSecurityCRD_ClusterControlPlaneNamespaceInvalidRejected(t *testing.T) { + cluster := &gameplanev1alpha1.Cluster{ + ObjectMeta: metav1.ObjectMeta{Name: "sec-cp-ns-invalid"}, + Spec: gameplanev1alpha1.ClusterSpec{ + KubeconfigSecret: gameplanev1alpha1.KubeconfigSecretRef{ + Name: "sec-cp-ns-kubeconfig", + Key: "kubeconfig", + }, + ControlPlaneNamespace: "Bad_Namespace", + }, + } + if err := k8sClient.Create(context.Background(), cluster); !apierrors.IsInvalid(err) { + t.Fatalf("expected Invalid for controlPlaneNamespace Bad_Namespace, got %v", err) + } +} diff --git a/operator/internal/controller/security_lifecycle_envtest_test.go b/operator/internal/controller/security_lifecycle_envtest_test.go new file mode 100644 index 000000000..69e2fb3b8 --- /dev/null +++ b/operator/internal/controller/security_lifecycle_envtest_test.go @@ -0,0 +1,209 @@ +//go:build envtest + +package controller + +import ( + "context" + "testing" + + appsv1 "k8s.io/api/apps/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/client-go/util/retry" + + gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" +) + +// secLifecycleTemplate creates a GameTemplate whose module default fsGroup is +// 2000 and registers cleanup. +func secLifecycleTemplate(t *testing.T) string { + t.Helper() + tmpl := buildGameTemplate(uniqueName("seclc")) + tmpl.Spec.Security = &gameplanev1alpha1.GameSecuritySpec{FSGroup: secSettingsInt64(2000)} + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + return tmpl.Name +} + +// secLifecycleUpdateServer applies mutate to the named GameServer, retrying on +// conflicts with the reconciler. +func secLifecycleUpdateServer(t *testing.T, ns, name string, mutate func(gs *gameplanev1alpha1.GameServer)) { + t.Helper() + err := retry.RetryOnConflict(retry.DefaultRetry, func() error { + gs := getGameServer(t, ns, name) + mutate(gs) + return k8sClient.Update(context.Background(), gs) + }) + if err != nil { + t.Fatalf("update gameserver %s/%s: %v", ns, name, err) + } +} + +// secLifecycleSeedObserved plays the kubelet: once the StatefulSet template +// carries the security-applied annotation, copy it to the observed annotation, +// which is what the reconciler reads as status.security.applied (research R6). +func secLifecycleSeedObserved(t *testing.T, ns, name string) { + t.Helper() + key := types.NamespacedName{Namespace: ns, Name: name} + eventually(t, func() (bool, string) { + ss := secSettingsStatefulSet(t, ns, name) + if ss == nil { + return false, "statefulset not yet created" + } + raw := ss.Spec.Template.Annotations[securityAppliedAnnotation] + if raw == "" { + return false, "template has no security annotation yet" + } + err := retry.RetryOnConflict(retry.DefaultRetry, func() error { + var cur appsv1.StatefulSet + if err := k8sClient.Get(context.Background(), key, &cur); err != nil { + return err + } + if cur.Annotations == nil { + cur.Annotations = map[string]string{} + } + cur.Annotations[securityAppliedObservedAnnotation] = raw + return k8sClient.Update(context.Background(), &cur) + }) + if err != nil { + return false, "seed observed annotation: " + err.Error() + } + return true, "" + }) +} + +// secLifecycleStatus returns the current status.security of the named server. +func secLifecycleStatus(t *testing.T, ns, name string) *gameplanev1alpha1.GameServerSecurityStatus { + t.Helper() + return getGameServer(t, ns, name).Status.Security +} + +// TestSecurityLifecycle_NeverStartedHasNoApplied: a server that has never +// started reports desired values and no applied record, and is not pending. +func TestSecurityLifecycle_NeverStartedHasNoApplied(t *testing.T) { + ns := newNamespace(t) + startMgr(t, ns, withGameServerReconciler(t, ns)) + tmplName := secLifecycleTemplate(t) + + if err := k8sClient.Create(context.Background(), buildGameServer(ns, "fresh", tmplName)); err != nil { + t.Fatalf("create gameserver: %v", err) + } + + eventually(t, func() (bool, string) { + sec := secLifecycleStatus(t, ns, "fresh") + if sec == nil || sec.Desired == nil { + return false, "status.security.desired not yet written" + } + if sec.Desired.FSGroup.Value == nil || *sec.Desired.FSGroup.Value != 2000 { + return false, "desired fsGroup is not the module default 2000" + } + if sec.Applied != nil { + return false, "never-started server reports applied" + } + if sec.Pending { + return false, "never-started server reports pending" + } + return true, "" + }) +} + +// TestSecurityLifecycle_ChangedOverrideWaitsForRestart: saving a changed +// override on a running server leaves the pod template and the running pod +// alone, marks the change pending, clears it when the value is edited back to +// the applied one, and returns to the module default when the override is +// removed. +func TestSecurityLifecycle_ChangedOverrideWaitsForRestart(t *testing.T) { + ns := newNamespace(t) + startMgr(t, ns, withGameServerReconciler(t, ns)) + tmplName := secLifecycleTemplate(t) + + if err := k8sClient.Create(context.Background(), buildGameServer(ns, "live", tmplName)); err != nil { + t.Fatalf("create gameserver: %v", err) + } + eventually(t, func() (bool, string) { + if r := secSettingsReplicas(t, ns, "live"); r != 1 { + return false, "replicas not yet one" + } + return true, "" + }) + secLifecycleSeedObserved(t, ns, "live") + + eventually(t, func() (bool, string) { + sec := secLifecycleStatus(t, ns, "live") + if sec == nil || sec.Applied == nil || sec.Applied.FSGroup.Value == nil { + return false, "applied not yet recorded" + } + if *sec.Applied.FSGroup.Value != 2000 { + return false, "applied fsGroup is not 2000" + } + return true, "" + }) + + before := secSettingsStatefulSet(t, ns, "live") + uid := before.UID + priorAnnotation := before.Spec.Template.Annotations[securityAppliedAnnotation] + + // Save fsGroup 3000 while the server runs. + secLifecycleUpdateServer(t, ns, "live", func(gs *gameplanev1alpha1.GameServer) { + gs.Spec.Security = &gameplanev1alpha1.GameServerSecuritySpec{ + FSGroup: &gameplanev1alpha1.SecurityIDOverride{Value: secSettingsInt64(3000)}, + } + }) + + eventually(t, func() (bool, string) { + sec := secLifecycleStatus(t, ns, "live") + if sec == nil || sec.Desired == nil || sec.Desired.FSGroup.Value == nil || *sec.Desired.FSGroup.Value != 3000 { + return false, "desired fsGroup not yet 3000" + } + if !sec.Pending { + return false, "change not marked pending" + } + return true, "" + }) + consistently(t, defaultEventuallyInterval*5, func() (bool, string) { + ss := secSettingsStatefulSet(t, ns, "live") + if ss == nil || ss.UID != uid { + return false, "statefulset was recreated" + } + if ss.Spec.Template.Annotations[securityAppliedAnnotation] != priorAnnotation { + return false, "running pod template was rewritten" + } + if sc := ss.Spec.Template.Spec.SecurityContext; sc == nil || sc.FSGroup == nil || *sc.FSGroup != 2000 { + return false, "running pod template fsGroup changed" + } + return true, "" + }) + + // Edit back to the applied value: pending clears. + secLifecycleUpdateServer(t, ns, "live", func(gs *gameplanev1alpha1.GameServer) { + gs.Spec.Security = &gameplanev1alpha1.GameServerSecuritySpec{ + FSGroup: &gameplanev1alpha1.SecurityIDOverride{Value: secSettingsInt64(2000)}, + } + }) + eventually(t, func() (bool, string) { + sec := secLifecycleStatus(t, ns, "live") + if sec == nil || sec.Pending { + return false, "pending not yet cleared" + } + return true, "" + }) + + // Remove the override: the module default applies again. + secLifecycleUpdateServer(t, ns, "live", func(gs *gameplanev1alpha1.GameServer) { + gs.Spec.Security = nil + }) + eventually(t, func() (bool, string) { + sec := secLifecycleStatus(t, ns, "live") + if sec == nil || sec.Desired == nil { + return false, "desired not yet written" + } + if sec.Desired.FSGroup.Source != gameplanev1alpha1.SecuritySourceModuleDefault { + return false, "removed override is not ModuleDefault" + } + if sec.Desired.FSGroup.Value == nil || *sec.Desired.FSGroup.Value != 2000 { + return false, "removed override does not return to 2000" + } + return true, "" + }) +} diff --git a/operator/internal/controller/security_overrides.go b/operator/internal/controller/security_overrides.go new file mode 100644 index 000000000..416f19fef --- /dev/null +++ b/operator/internal/controller/security_overrides.go @@ -0,0 +1,485 @@ +package controller + +import ( + "context" + "encoding/json" + "fmt" + + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/equality" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + + gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" +) + +const ( + // securityAppliedAnnotation is written on the StatefulSet pod template. It + // carries the resolved values and sources the template was rendered with + // (research R5, R7). It is compact JSON of a SecuritySettings. + securityAppliedAnnotation = "gameplane.local/security-applied" + + // securityAppliedObservedAnnotation is written on the StatefulSet object. It + // holds the values the data volume was last set up with (research R6). It + // is the only source of status.security.applied and of the backup and + // restore filesystem group. + securityAppliedObservedAnnotation = "gameplane.local/security-applied-observed" + + // securityConfigInitContainerName is the config-init container name. Its + // start counts as volume setup (research R6). + securityConfigInitContainerName = "config-init" +) + +// securityIDResolved is one resolved uid or gid and where it came from. A nil +// Value means no id is applied (the image default). +type securityIDResolved struct { + Value *int64 + Source gameplanev1alpha1.SecuritySource +} + +// securityCheckResolved is the resolved volume ownership check policy and its +// source. +type securityCheckResolved struct { + Value gameplanev1alpha1.VolumeOwnershipCheck + Source gameplanev1alpha1.SecuritySource +} + +// resolvedGameSecurity is the output of resolveGameSecurity: the effective +// security settings for one GameServer against one GameTemplate. +type resolvedGameSecurity struct { + RunAsUser securityIDResolved + RunAsGroup securityIDResolved + FSGroup securityIDResolved + VolumeOwnershipCheck securityCheckResolved +} + +// resolveGameSecurity is the pure resolver (research R4, FR-003). Per id, in +// order: a server override with useImageDefault gives no value (source +// ImageDefaultOverride); a server override value gives that value (source +// Override); the template default gives its value (source ModuleDefault); +// otherwise no value (source ImageDefault). The ownership check resolves the +// same way, with the built-in default OnlyWhenWrong as the last layer (source +// BuiltInDefault). A nil template or server reads as no defaults or no +// overrides. +func resolveGameSecurity(tmpl *gameplanev1alpha1.GameTemplate, gs *gameplanev1alpha1.GameServer) resolvedGameSecurity { + var module *gameplanev1alpha1.GameSecuritySpec + if tmpl != nil { + module = tmpl.Spec.Security + } + var override *gameplanev1alpha1.GameServerSecuritySpec + if gs != nil { + override = gs.Spec.Security + } + + var runAsUser, runAsGroup, fsGroup *gameplanev1alpha1.SecurityIDOverride + var check gameplanev1alpha1.VolumeOwnershipCheck + if override != nil { + runAsUser = override.RunAsUser + runAsGroup = override.RunAsGroup + fsGroup = override.FSGroup + check = override.VolumeOwnershipCheck + } + + var moduleUser, moduleGroup, moduleFS *int64 + var moduleCheck gameplanev1alpha1.VolumeOwnershipCheck + if module != nil { + moduleUser = module.RunAsUser + moduleGroup = module.RunAsGroup + moduleFS = module.FSGroup + moduleCheck = module.VolumeOwnershipCheck + } + + out := resolvedGameSecurity{ + RunAsUser: resolveSecurityID(runAsUser, moduleUser), + RunAsGroup: resolveSecurityID(runAsGroup, moduleGroup), + FSGroup: resolveSecurityID(fsGroup, moduleFS), + } + switch { + case check != "": + out.VolumeOwnershipCheck = securityCheckResolved{Value: check, Source: gameplanev1alpha1.SecuritySourceOverride} + case moduleCheck != "": + out.VolumeOwnershipCheck = securityCheckResolved{Value: moduleCheck, Source: gameplanev1alpha1.SecuritySourceModuleDefault} + default: + out.VolumeOwnershipCheck = securityCheckResolved{Value: gameplanev1alpha1.VolumeOwnershipCheckOnlyWhenWrong, Source: gameplanev1alpha1.SecuritySourceBuiltInDefault} + } + return out +} + +// resolveSecurityID applies the per-id resolution order to one setting. +func resolveSecurityID(override *gameplanev1alpha1.SecurityIDOverride, module *int64) securityIDResolved { + if override != nil { + if override.UseImageDefault != nil && *override.UseImageDefault { + return securityIDResolved{Source: gameplanev1alpha1.SecuritySourceImageDefaultOverride} + } + if override.Value != nil { + return securityIDResolved{Value: copyInt64(*override.Value), Source: gameplanev1alpha1.SecuritySourceOverride} + } + } + if module != nil { + return securityIDResolved{Value: copyInt64(*module), Source: gameplanev1alpha1.SecuritySourceModuleDefault} + } + return securityIDResolved{Source: gameplanev1alpha1.SecuritySourceImageDefault} +} + +func copyInt64(v int64) *int64 { + return &v +} + +// settings converts the resolved values to the status read model. +func (g resolvedGameSecurity) settings() gameplanev1alpha1.SecuritySettings { + return gameplanev1alpha1.SecuritySettings{ + RunAsUser: idStatus(g.RunAsUser), + RunAsGroup: idStatus(g.RunAsGroup), + FSGroup: idStatus(g.FSGroup), + VolumeOwnershipCheck: gameplanev1alpha1.SecurityCheckStatus{Value: g.VolumeOwnershipCheck.Value, Source: g.VolumeOwnershipCheck.Source}, + } +} + +func idStatus(r securityIDResolved) gameplanev1alpha1.SecurityIDStatus { + return gameplanev1alpha1.SecurityIDStatus{Value: r.Value, Source: r.Source} +} + +// fsGroupChangePolicy maps the ownership check to the pod field +// fsGroupChangePolicy (research R8): EveryStart is Always, OnlyWhenWrong is +// OnRootMismatch. It returns nil when no filesystem group applies, because the +// policy has no effect then (FR-002a). +func (g resolvedGameSecurity) fsGroupChangePolicy() *corev1.PodFSGroupChangePolicy { + if g.FSGroup.Value == nil { + return nil + } + policy := corev1.FSGroupChangeOnRootMismatch + if g.VolumeOwnershipCheck.Value == gameplanev1alpha1.VolumeOwnershipCheckEveryStart { + policy = corev1.FSGroupChangeAlways + } + return &policy +} + +// encodeSecurityAnnotation renders the resolved settings and sources as the +// compact JSON stored in an annotation. +func encodeSecurityAnnotation(s gameplanev1alpha1.SecuritySettings) (string, error) { + raw, err := json.Marshal(s) + if err != nil { + return "", fmt.Errorf("encode security settings annotation: %w", err) + } + return string(raw), nil +} + +// decodeSecurityAnnotation parses an annotation written by encodeSecurityAnnotation. +func decodeSecurityAnnotation(raw string) (*gameplanev1alpha1.SecuritySettings, error) { + var s gameplanev1alpha1.SecuritySettings + if err := json.Unmarshal([]byte(raw), &s); err != nil { + return nil, fmt.Errorf("decode security settings annotation: %w", err) + } + return &s, nil +} + +// securityPending reports whether a start would change the applied values. It +// is true when applied exists and any value differs from desired. Sources do +// not count. The ownership check counts only when a filesystem group applies +// on either side, because it has no effect otherwise (FR-002a). +func securityPending(desired gameplanev1alpha1.SecuritySettings, applied *gameplanev1alpha1.SecuritySettings) bool { + if applied == nil { + return false + } + if !sameInt64Ptr(desired.RunAsUser.Value, applied.RunAsUser.Value) || + !sameInt64Ptr(desired.RunAsGroup.Value, applied.RunAsGroup.Value) || + !sameInt64Ptr(desired.FSGroup.Value, applied.FSGroup.Value) { + return true + } + if desired.FSGroup.Value == nil && applied.FSGroup.Value == nil { + return false + } + return desired.VolumeOwnershipCheck.Value != applied.VolumeOwnershipCheck.Value +} + +func sameInt64Ptr(a, b *int64) bool { + if a == nil || b == nil { + return a == nil && b == nil + } + return *a == *b +} + +// podVolumesSetUp reports whether a pod has passed volume setup, which is +// where the kubelet applies the filesystem group and change policy (research +// R6). The signal is the PodReadyToStartContainers condition, or any started +// init or game container status on clusters without that condition. +func podVolumesSetUp(pod *corev1.Pod) bool { + for _, c := range pod.Status.Conditions { + if c.Type == corev1.PodReadyToStartContainers && c.Status == corev1.ConditionTrue { + return true + } + } + for _, cs := range pod.Status.InitContainerStatuses { + if cs.Name == securityConfigInitContainerName && containerStatusStarted(cs) { + return true + } + } + for _, cs := range pod.Status.ContainerStatuses { + if cs.Name == gameContainerName && containerStatusStarted(cs) { + return true + } + } + return false +} + +func containerStatusStarted(cs corev1.ContainerStatus) bool { + return (cs.Started != nil && *cs.Started) || cs.State.Running != nil || cs.State.Terminated != nil +} + +// settingsFromPodSpec reconstructs the applied values from a pod spec. It is +// the fallback for StatefulSets created before this feature, which carry no +// security annotations. Non-empty values are labelled ModuleDefault and empty +// ids ImageDefault. An unset policy is Kubernetes' Always, which is EveryStart. +func settingsFromPodSpec(spec *corev1.PodSpec) gameplanev1alpha1.SecuritySettings { + var runAsUser, runAsGroup *int64 + for i := range spec.Containers { + if spec.Containers[i].Name != gameContainerName { + continue + } + if sc := spec.Containers[i].SecurityContext; sc != nil { + runAsUser = sc.RunAsUser + runAsGroup = sc.RunAsGroup + } + } + var fsGroup *int64 + var policy *corev1.PodFSGroupChangePolicy + if sc := spec.SecurityContext; sc != nil { + fsGroup = sc.FSGroup + policy = sc.FSGroupChangePolicy + } + check := gameplanev1alpha1.VolumeOwnershipCheckEveryStart + if policy != nil && *policy == corev1.FSGroupChangeOnRootMismatch { + check = gameplanev1alpha1.VolumeOwnershipCheckOnlyWhenWrong + } + return gameplanev1alpha1.SecuritySettings{ + RunAsUser: fallbackIDStatus(runAsUser), + RunAsGroup: fallbackIDStatus(runAsGroup), + FSGroup: fallbackIDStatus(fsGroup), + VolumeOwnershipCheck: gameplanev1alpha1.SecurityCheckStatus{Value: check, Source: gameplanev1alpha1.SecuritySourceBuiltInDefault}, + } +} + +func fallbackIDStatus(v *int64) gameplanev1alpha1.SecurityIDStatus { + if v == nil { + return gameplanev1alpha1.SecurityIDStatus{Source: gameplanev1alpha1.SecuritySourceImageDefault} + } + return gameplanev1alpha1.SecurityIDStatus{Value: copyInt64(*v), Source: gameplanev1alpha1.SecuritySourceModuleDefault} +} + +// readAppliedSecurity returns the values the data volume was last set up with +// (research R6), or nil when the server has never started. It reads the +// StatefulSet observed annotation first. Without it, a StatefulSet from this +// feature reports nothing until a pod has passed volume setup, and a StatefulSet +// from before the feature is read from its running pod, or from its pod +// template when no pod runs. +func readAppliedSecurity(ctx context.Context, reader client.Reader, gs *gameplanev1alpha1.GameServer) (*gameplanev1alpha1.SecuritySettings, error) { + var ss appsv1.StatefulSet + if err := reader.Get(ctx, client.ObjectKeyFromObject(gs), &ss); err != nil { + if apierrors.IsNotFound(err) { + return nil, nil + } + return nil, fmt.Errorf("read statefulset for applied security: %w", err) + } + if !metav1.IsControlledBy(&ss, gs) { + return nil, nil + } + if raw := ss.Annotations[securityAppliedObservedAnnotation]; raw != "" { + return decodeSecurityAnnotation(raw) + } + + pod, err := ownedTemplatePod(ctx, reader, gs) + if err != nil { + return nil, fmt.Errorf("read template pod for applied security: %w", err) + } + + if ss.Spec.Template.Annotations[securityAppliedAnnotation] == "" { + // Pre-feature StatefulSet: no security annotations exist yet. + if pod != nil { + s := settingsFromPodSpec(&pod.Spec) + return &s, nil + } + s := settingsFromPodSpec(&ss.Spec.Template.Spec) + return &s, nil + } + + // Feature StatefulSet without the observed annotation yet. Only a pod that + // has passed volume setup reports values. A pending or never-started + // start reports nothing. + if pod == nil || !podVolumesSetUp(pod) { + return nil, nil + } + raw := pod.Annotations[securityAppliedAnnotation] + if raw == "" { + raw = ss.Spec.Template.Annotations[securityAppliedAnnotation] + } + return decodeSecurityAnnotation(raw) +} + +// observedSecurityFromPod returns the value the StatefulSet observed annotation +// should copy from its pod, or "" when the pod has not passed volume setup yet +// or carries no security annotation. An empty result means leave the +// annotation as it is (research R6, step 2). The caller writes it with +// setObservedSecurityAnnotation. +func observedSecurityFromPod(ctx context.Context, reader client.Reader, gs *gameplanev1alpha1.GameServer) (string, error) { + pod, err := ownedTemplatePod(ctx, reader, gs) + if err != nil || pod == nil { + return "", err + } + if !podVolumesSetUp(pod) { + return "", nil + } + return pod.Annotations[securityAppliedAnnotation], nil +} + +// setObservedSecurityAnnotation sets the observed annotation on a StatefulSet +// object. It reports whether the object changed. An empty value is ignored. +func setObservedSecurityAnnotation(ss *appsv1.StatefulSet, value string) bool { + if value == "" || ss.Annotations[securityAppliedObservedAnnotation] == value { + return false + } + if ss.Annotations == nil { + ss.Annotations = map[string]string{} + } + ss.Annotations[securityAppliedObservedAnnotation] = value + return true +} + +// recordObservedSecurity copies the security-applied annotation from the owned +// pod onto the StatefulSet observed annotation once the pod has passed volume +// setup (research R6). It writes only the annotation, as a merge patch. +func (r *GameServerReconciler) recordObservedSecurity(ctx context.Context, gs *gameplanev1alpha1.GameServer, ss *appsv1.StatefulSet) error { + value, err := observedSecurityFromPod(ctx, r.wipeReader(), gs) + if err != nil { + return fmt.Errorf("read applied security from pod: %w", err) + } + base := ss.DeepCopy() + if !setObservedSecurityAnnotation(ss, value) { + return nil + } + if err := r.Patch(ctx, ss, client.MergeFrom(base)); err != nil { + return fmt.Errorf("record observed security on statefulset: %w", err) + } + return nil +} + +// restoreContainerSecurityContext keeps the named container's run-as user and +// group at the values it has in prior, so a running workload keeps the +// identity it was started with. Every other SecurityContext field stays as +// built, so a change of workload profile (restricted mode on or off) still +// applies. A container missing from either spec is left as built. +func restoreContainerSecurityContext(pod, prior *corev1.PodSpec, name string) { + before := podContainerNamed(prior, name) + if before == nil { + return + } + current := podContainerNamed(pod, name) + if current == nil { + return + } + var user, group *int64 + if before.SecurityContext != nil { + user, group = before.SecurityContext.RunAsUser, before.SecurityContext.RunAsGroup + } + if current.SecurityContext == nil { + if user == nil && group == nil { + return + } + current.SecurityContext = &corev1.SecurityContext{} + } + current.SecurityContext.RunAsUser = copyInt64Ptr(user) + current.SecurityContext.RunAsGroup = copyInt64Ptr(group) + if equality.Semantic.DeepEqual(*current.SecurityContext, corev1.SecurityContext{}) { + // Keep a pod spec byte-identical to one that never set a context. + current.SecurityContext = nil + } +} + +// copyInt64Ptr returns a copy of p, or nil. +func copyInt64Ptr(p *int64) *int64 { + if p == nil { + return nil + } + v := *p + return &v +} + +// podContainerNamed returns a pointer to the regular or init container with the +// given name, or nil. +func podContainerNamed(spec *corev1.PodSpec, name string) *corev1.Container { + for i := range spec.Containers { + if spec.Containers[i].Name == name { + return &spec.Containers[i] + } + } + for i := range spec.InitContainers { + if spec.InitContainers[i].Name == name { + return &spec.InitContainers[i] + } + } + return nil +} + +// backupDefaultFSGroup is the filesystem group a backup or restore pod uses +// when no group applies (buildBackupPodSecurityContext). +const backupDefaultFSGroup int64 = 65532 + +// appliedBackupFSGroup returns the filesystem group a backup or restore pod for +// gs runs with (spec 030, FR-011). It is the group the data volume was last set +// up with, read by readAppliedSecurity from the same StatefulSet and pod state +// as status.security.applied. A server that has never started has no applied +// record, so the desired group applies: the resolved override or template +// default. An applied record with no group means the image default, which the +// backup pod gives as 65532. A StatefulSet from before spec 030 (no security +// annotations) also has no applied record here, so its backups keep using the +// template group as before, without the server's pending override: that +// override reaches the volume only when the server restarts. The result is +// never nil. +func appliedBackupFSGroup(ctx context.Context, reader client.Reader, gs *gameplanev1alpha1.GameServer, tmpl *gameplanev1alpha1.GameTemplate) (*int64, error) { + recorded, preFeature, err := securityAppliedRecorded(ctx, reader, gs) + if err != nil { + return nil, fmt.Errorf("read applied filesystem group: %w", err) + } + var applied *gameplanev1alpha1.SecuritySettings + if recorded { + applied, err = readAppliedSecurity(ctx, reader, gs) + if err != nil { + return nil, fmt.Errorf("read applied filesystem group: %w", err) + } + } + var group *int64 + switch { + case applied != nil: + group = applied.FSGroup.Value + case preFeature: + group = resolveGameSecurity(tmpl, nil).FSGroup.Value + default: + group = resolveGameSecurity(tmpl, gs).FSGroup.Value + } + if group == nil { + def := backupDefaultFSGroup + return &def, nil + } + return copyInt64(*group), nil +} + +// securityAppliedRecorded reports whether gs's own StatefulSet carries the +// spec 030 security annotations (observed, or on its pod template). A missing +// or foreign StatefulSet reports false for both results. preFeature is true +// when gs's own StatefulSet exists without the annotations, that is, it was +// created before the feature and has not been rolled since. +func securityAppliedRecorded(ctx context.Context, reader client.Reader, gs *gameplanev1alpha1.GameServer) (recorded, preFeature bool, err error) { + var ss appsv1.StatefulSet + if err := reader.Get(ctx, client.ObjectKeyFromObject(gs), &ss); err != nil { + if apierrors.IsNotFound(err) { + return false, false, nil + } + return false, false, fmt.Errorf("read statefulset for applied security: %w", err) + } + if !metav1.IsControlledBy(&ss, gs) { + return false, false, nil + } + recorded = ss.Annotations[securityAppliedObservedAnnotation] != "" || ss.Spec.Template.Annotations[securityAppliedAnnotation] != "" + return recorded, !recorded, nil +} diff --git a/operator/internal/controller/security_overrides_envtest_test.go b/operator/internal/controller/security_overrides_envtest_test.go new file mode 100644 index 000000000..a406e6d44 --- /dev/null +++ b/operator/internal/controller/security_overrides_envtest_test.go @@ -0,0 +1,561 @@ +//go:build envtest + +package controller + +import ( + "context" + "reflect" + "testing" + "time" + + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/client-go/util/retry" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/manager" + + gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" +) + +// secEnvTemplate creates a cluster-scoped GameTemplate with the given security +// block and registers its cleanup. +func secEnvTemplate(t *testing.T, sec *gameplanev1alpha1.GameSecuritySpec) *gameplanev1alpha1.GameTemplate { + t.Helper() + tmpl := buildGameTemplate(uniqueName("secure")) + tmpl.Spec.Security = sec + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + return tmpl +} + +// secEnvRestrictedReconciler wires GameServerReconciler with RestrictedWorkloads +// on, the opt-in PSA-compatible profile the OD-5 refusal runs under. +func secEnvRestrictedReconciler(t *testing.T, ns string) setupReconciler { + t.Helper() + seedAgentCA(t, ns, "agent-ca") + return func(mgr manager.Manager) error { + return (&GameServerReconciler{ + Client: mgr.GetClient(), + APIReader: mgr.GetAPIReader(), + Scheme: mgr.GetScheme(), + AgentImage: "ghcr.io/gameplanepanel/gameplane/agent:test", + AgentCASecretName: "agent-ca", + AgentCASecretNamespace: ns, + RestrictedWorkloads: true, + }).SetupWithManager(mgr) + } +} + +// secEnvGetStatefulSet returns the StatefulSet, or false when it does not exist. +func secEnvGetStatefulSet(t *testing.T, ns, name string) (*appsv1.StatefulSet, bool) { + t.Helper() + var ss appsv1.StatefulSet + err := k8sClient.Get(context.Background(), types.NamespacedName{Namespace: ns, Name: name}, &ss) + if apierrors.IsNotFound(err) { + return nil, false + } + if err != nil { + t.Fatalf("get statefulset: %v", err) + } + return &ss, true +} + +// secEnvWaitStatefulSet waits until the reconciler has written the security +// annotation on the StatefulSet pod template, which is the first start. +func secEnvWaitStatefulSet(t *testing.T, ns, name string) *appsv1.StatefulSet { + t.Helper() + var out *appsv1.StatefulSet + eventually(t, func() (bool, string) { + ss, ok := secEnvGetStatefulSet(t, ns, name) + if !ok { + return false, "statefulset not created" + } + if ss.Spec.Template.Annotations[securityAppliedAnnotation] == "" { + return false, "security-applied annotation not written yet" + } + out = ss + return true, "" + }) + return out +} + +// secEnvNudge patches a label on the server. The GameServer watch has no +// predicates, so the patch queues a reconcile. Envtest has no StatefulSet or pod +// controller, so a seeded pod is only read on the next pass. +func secEnvNudge(t *testing.T, ns, name string) { + t.Helper() + gs := getGameServer(t, ns, name) + base := gs.DeepCopy() + if gs.Labels == nil { + gs.Labels = map[string]string{} + } + gs.Labels["test/nudge"] = uniqueName("n") + if err := k8sClient.Patch(context.Background(), gs, client.MergeFrom(base)); err != nil { + t.Fatalf("nudge gameserver: %v", err) + } +} + +// secEnvWaitStatusNudged polls the server's security status, nudging a reconcile +// on each pass, until cond holds. +func secEnvWaitStatusNudged(t *testing.T, ns, name string, cond func(*gameplanev1alpha1.GameServerSecurityStatus) (bool, string)) { + t.Helper() + eventually(t, func() (bool, string) { + secEnvNudge(t, ns, name) + st := getGameServer(t, ns, name).Status.Security + if st == nil { + return false, "status.security not set" + } + return cond(st) + }) +} + +// secEnvWaitStatus polls the server's security status without nudging. +func secEnvWaitStatus(t *testing.T, ns, name string, cond func(*gameplanev1alpha1.GameServerSecurityStatus) (bool, string)) { + t.Helper() + eventually(t, func() (bool, string) { + st := getGameServer(t, ns, name).Status.Security + if st == nil { + return false, "status.security not set" + } + return cond(st) + }) +} + +// secEnvSeedPod creates the server's template pod, controlled by the StatefulSet. +// With setUp true it also marks volume setup as done, so the applied reader +// reports the pod annotation. +func secEnvSeedPod(t *testing.T, ss *appsv1.StatefulSet, annotations map[string]string, setUp bool) *corev1.Pod { + t.Helper() + pod := &corev1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: ss.Name + "-0", + Namespace: ss.Namespace, + Annotations: annotations, + OwnerReferences: []metav1.OwnerReference{{ + APIVersion: "apps/v1", + Kind: "StatefulSet", + Name: ss.Name, + UID: ss.UID, + Controller: ownerBoolPtr(true), + }}, + }, + Spec: corev1.PodSpec{NodeName: "fixture-node", Containers: []corev1.Container{{Name: gameContainerName, Image: "test/game:fixture"}}}, + } + if err := k8sClient.Create(context.Background(), pod); err != nil { + t.Fatalf("seed pod: %v", err) + } + if setUp { + pod.Status.Phase = corev1.PodRunning + pod.Status.Conditions = []corev1.PodCondition{{Type: corev1.PodReadyToStartContainers, Status: corev1.ConditionTrue}} + if err := k8sClient.Status().Update(context.Background(), pod); err != nil { + t.Fatalf("mark seeded pod set up: %v", err) + } + } + return pod +} + +// secEnvReadyMessage returns the Ready condition message of the server, or "". +func secEnvReadyMessage(gs *gameplanev1alpha1.GameServer) string { + for _, c := range gs.Status.Conditions { + if c.Type == "Ready" { + return c.Message + } + } + return "" +} + +// secEnvGameContainer returns the game container of a StatefulSet template. +func secEnvGameContainer(t *testing.T, ss *appsv1.StatefulSet) *corev1.Container { + t.Helper() + for i := range ss.Spec.Template.Spec.Containers { + if ss.Spec.Template.Spec.Containers[i].Name == gameContainerName { + return &ss.Spec.Template.Spec.Containers[i] + } + } + t.Fatalf("statefulset %s has no game container", ss.Name) + return nil +} + +// TestSecurityOverrides_ModuleDefaultsApplyAndSettle covers the no-override path: +// the module values render into the pod, and once a pod has passed volume setup +// desired equals applied with the module sources and nothing is pending. +func TestSecurityOverrides_ModuleDefaultsApplyAndSettle(t *testing.T) { + ns := newNamespace(t) + startMgr(t, ns, withGameServerReconciler(t, ns)) + + tmpl := secEnvTemplate(t, &gameplanev1alpha1.GameSecuritySpec{ + RunAsUser: secInt(25000), + RunAsGroup: secInt(25000), + FSGroup: secInt(25000), + }) + if err := k8sClient.Create(context.Background(), buildGameServer(ns, "smp", tmpl.Name)); err != nil { + t.Fatalf("create gameserver: %v", err) + } + + ss := secEnvWaitStatefulSet(t, ns, "smp") + if gc := secEnvGameContainer(t, ss); gc.SecurityContext == nil || gc.SecurityContext.RunAsUser == nil || *gc.SecurityContext.RunAsUser != 25000 { + t.Errorf("game container SecurityContext = %+v, want RunAsUser 25000", gc.SecurityContext) + } + secEnvSeedPod(t, ss, map[string]string{securityAppliedAnnotation: ss.Spec.Template.Annotations[securityAppliedAnnotation]}, true) + + wantModule := func(v int64) gameplanev1alpha1.SecurityIDStatus { + return gameplanev1alpha1.SecurityIDStatus{Value: secInt(v), Source: gameplanev1alpha1.SecuritySourceModuleDefault} + } + secEnvWaitStatusNudged(t, ns, "smp", func(st *gameplanev1alpha1.GameServerSecurityStatus) (bool, string) { + if st.Applied == nil { + return false, "applied not yet recorded" + } + if st.Pending { + return false, "still pending" + } + if !reflect.DeepEqual(*st.Desired, *st.Applied) { + return false, "desired and applied differ" + } + return true, "" + }) + + st := getGameServer(t, ns, "smp").Status.Security + if !reflect.DeepEqual(st.Desired.RunAsUser, wantModule(25000)) { + t.Errorf("desired RunAsUser = %+v, want module 25000", st.Desired.RunAsUser) + } + if !reflect.DeepEqual(st.Desired.RunAsGroup, wantModule(25000)) { + t.Errorf("desired RunAsGroup = %+v, want module 25000", st.Desired.RunAsGroup) + } + if !reflect.DeepEqual(st.Desired.FSGroup, wantModule(25000)) { + t.Errorf("desired FSGroup = %+v, want module 25000", st.Desired.FSGroup) + } + if st.Desired.VolumeOwnershipCheck.Value != gameplanev1alpha1.VolumeOwnershipCheckOnlyWhenWrong || + st.Desired.VolumeOwnershipCheck.Source != gameplanev1alpha1.SecuritySourceBuiltInDefault { + t.Errorf("desired check = %+v, want OnlyWhenWrong from BuiltInDefault", st.Desired.VolumeOwnershipCheck) + } +} + +// TestSecurityOverrides_NoSecurityBlockShowsImageDefault covers a template with +// no security block: nothing is set, the sources are ImageDefault, and the check +// is the built-in default. A server that never started has no applied values. +func TestSecurityOverrides_NoSecurityBlockShowsImageDefault(t *testing.T) { + ns := newNamespace(t) + startMgr(t, ns, withGameServerReconciler(t, ns)) + + tmpl := secEnvTemplate(t, nil) + if err := k8sClient.Create(context.Background(), buildGameServer(ns, "smp", tmpl.Name)); err != nil { + t.Fatalf("create gameserver: %v", err) + } + + secEnvWaitStatus(t, ns, "smp", func(st *gameplanev1alpha1.GameServerSecurityStatus) (bool, string) { + if st.Desired == nil { + return false, "desired not set" + } + return true, "" + }) + st := getGameServer(t, ns, "smp").Status.Security + for name, id := range map[string]gameplanev1alpha1.SecurityIDStatus{ + "runAsUser": st.Desired.RunAsUser, + "runAsGroup": st.Desired.RunAsGroup, + "fsGroup": st.Desired.FSGroup, + } { + if id.Value != nil || id.Source != gameplanev1alpha1.SecuritySourceImageDefault { + t.Errorf("desired %s = %+v, want no value from ImageDefault", name, id) + } + } + if st.Desired.VolumeOwnershipCheck.Value != gameplanev1alpha1.VolumeOwnershipCheckOnlyWhenWrong { + t.Errorf("desired check = %q, want OnlyWhenWrong", st.Desired.VolumeOwnershipCheck.Value) + } + if st.Applied != nil || st.Pending { + t.Errorf("never-started server: applied = %+v, pending = %v; want nil and false", st.Applied, st.Pending) + } +} + +// TestSecurityOverrides_PreFeatureStatefulSetIsNotRecreated covers a StatefulSet +// from before the feature: it has no security annotation and no change policy. +// Reconciling it leaves the pod template untouched and reports the difference as +// pending. A scale to zero and back then writes the policy and clears pending. +func TestSecurityOverrides_PreFeatureStatefulSetIsNotRecreated(t *testing.T) { + ns := newNamespace(t) + startMgr(t, ns, withGameServerReconciler(t, ns)) + + tmpl := secEnvTemplate(t, &gameplanev1alpha1.GameSecuritySpec{FSGroup: secInt(25000)}) + if err := k8sClient.Create(context.Background(), buildGameServer(ns, "smp", tmpl.Name)); err != nil { + t.Fatalf("create gameserver: %v", err) + } + secEnvWaitStatefulSet(t, ns, "smp") + + // Make the StatefulSet look as it did before the feature: no security + // annotation and no fsGroupChangePolicy in the pod spec. + var stripped *appsv1.StatefulSet + if err := retry.RetryOnConflict(retry.DefaultRetry, func() error { + ss, ok := secEnvGetStatefulSet(t, ns, "smp") + if !ok { + t.Fatalf("statefulset vanished before the pre-feature rewrite") + } + delete(ss.Spec.Template.Annotations, securityAppliedAnnotation) + if ss.Spec.Template.Spec.SecurityContext != nil { + ss.Spec.Template.Spec.SecurityContext.FSGroupChangePolicy = nil + } + if err := k8sClient.Update(context.Background(), ss); err != nil { + return err + } + stripped = ss + return nil + }); err != nil { + t.Fatalf("strip security fields: %v", err) + } + preGen := stripped.Generation + + secEnvWaitStatusNudged(t, ns, "smp", func(st *gameplanev1alpha1.GameServerSecurityStatus) (bool, string) { + if st.Applied == nil { + return false, "applied not yet read" + } + if !st.Pending { + return false, "pending not yet set" + } + return true, "" + }) + + st := getGameServer(t, ns, "smp").Status.Security + if st.Applied.VolumeOwnershipCheck.Value != gameplanev1alpha1.VolumeOwnershipCheckEveryStart { + t.Errorf("applied check = %q, want EveryStart (kubelet default)", st.Applied.VolumeOwnershipCheck.Value) + } + if st.Desired.VolumeOwnershipCheck.Value != gameplanev1alpha1.VolumeOwnershipCheckOnlyWhenWrong { + t.Errorf("desired check = %q, want OnlyWhenWrong", st.Desired.VolumeOwnershipCheck.Value) + } + + // The running pod template is not rewritten while the server runs. + consistently(t, 2*time.Second, func() (bool, string) { + ss, ok := secEnvGetStatefulSet(t, ns, "smp") + if !ok { + return false, "statefulset gone" + } + if ss.Generation != preGen { + return false, "pod template generation changed on a running server" + } + if policy := ss.Spec.Template.Spec.SecurityContext; policy != nil && policy.FSGroupChangePolicy != nil { + return false, "fsGroupChangePolicy added to a running pod template" + } + if ss.Spec.Template.Annotations[securityAppliedAnnotation] != "" { + return false, "security annotation added to a running pod template" + } + return true, "" + }) + + // Scale to zero and back: the next start renders the policy and clears pending. + setSuspend := func(suspend bool) { + gs := getGameServer(t, ns, "smp") + base := gs.DeepCopy() + gs.Spec.Suspend = suspend + if err := k8sClient.Patch(context.Background(), gs, client.MergeFrom(base)); err != nil { + t.Fatalf("set suspend=%v: %v", suspend, err) + } + } + setSuspend(true) + eventually(t, func() (bool, string) { + ss, ok := secEnvGetStatefulSet(t, ns, "smp") + if !ok || ss.Spec.Replicas == nil { + return false, "statefulset replicas not set" + } + if *ss.Spec.Replicas != 0 { + return false, "replicas not yet zero" + } + return true, "" + }) + setSuspend(false) + + var restarted *appsv1.StatefulSet + eventually(t, func() (bool, string) { + ss, ok := secEnvGetStatefulSet(t, ns, "smp") + if !ok { + return false, "statefulset gone" + } + sc := ss.Spec.Template.Spec.SecurityContext + if sc == nil || sc.FSGroupChangePolicy == nil || *sc.FSGroupChangePolicy != corev1.FSGroupChangeOnRootMismatch { + return false, "fsGroupChangePolicy not yet OnRootMismatch" + } + restarted = ss + return true, "" + }) + if restarted.Spec.Template.Annotations[securityAppliedAnnotation] == "" { + t.Error("security-applied annotation not written at the start from zero") + } + + // Once the new pod has passed volume setup, pending clears. + secEnvSeedPod(t, restarted, map[string]string{securityAppliedAnnotation: restarted.Spec.Template.Annotations[securityAppliedAnnotation]}, true) + secEnvWaitStatusNudged(t, ns, "smp", func(st *gameplanev1alpha1.GameServerSecurityStatus) (bool, string) { + if st.Applied == nil { + return false, "applied not yet recorded" + } + if st.Pending { + return false, "still pending" + } + return true, "" + }) +} + +// TestSecurityOverrides_RunAsUserOverrideReachesGameContainer covers a server +// override: runAsUser 2000 reaches the game container, runAsGroup useImageDefault +// leaves the container runAsGroup unset, and the other settings keep their +// module sources. +func TestSecurityOverrides_RunAsUserOverrideReachesGameContainer(t *testing.T) { + ns := newNamespace(t) + startMgr(t, ns, withGameServerReconciler(t, ns)) + + tmpl := secEnvTemplate(t, &gameplanev1alpha1.GameSecuritySpec{ + RunAsUser: secInt(25000), + RunAsGroup: secInt(25000), + FSGroup: secInt(25000), + }) + gs := buildGameServer(ns, "smp", tmpl.Name) + gs.Spec.Security = &gameplanev1alpha1.GameServerSecuritySpec{ + RunAsUser: &gameplanev1alpha1.SecurityIDOverride{Value: secInt(2000)}, + RunAsGroup: &gameplanev1alpha1.SecurityIDOverride{UseImageDefault: secBool(true)}, + } + if err := k8sClient.Create(context.Background(), gs); err != nil { + t.Fatalf("create gameserver: %v", err) + } + + ss := secEnvWaitStatefulSet(t, ns, "smp") + sc := secEnvGameContainer(t, ss).SecurityContext + if sc == nil || sc.RunAsUser == nil || *sc.RunAsUser != 2000 { + t.Fatalf("game container SecurityContext = %+v, want RunAsUser 2000", sc) + } + if sc.RunAsGroup != nil { + t.Errorf("game container RunAsGroup = %d, want unset for useImageDefault", *sc.RunAsGroup) + } + + secEnvWaitStatus(t, ns, "smp", func(st *gameplanev1alpha1.GameServerSecurityStatus) (bool, string) { + if st.Desired == nil { + return false, "desired not set" + } + return true, "" + }) + st := getGameServer(t, ns, "smp").Status.Security + if want := (gameplanev1alpha1.SecurityIDStatus{Value: secInt(2000), Source: gameplanev1alpha1.SecuritySourceOverride}); !reflect.DeepEqual(st.Desired.RunAsUser, want) { + t.Errorf("desired RunAsUser = %+v, want %+v", st.Desired.RunAsUser, want) + } + if want := (gameplanev1alpha1.SecurityIDStatus{Source: gameplanev1alpha1.SecuritySourceImageDefaultOverride}); !reflect.DeepEqual(st.Desired.RunAsGroup, want) { + t.Errorf("desired RunAsGroup = %+v, want %+v", st.Desired.RunAsGroup, want) + } + if want := (gameplanev1alpha1.SecurityIDStatus{Value: secInt(25000), Source: gameplanev1alpha1.SecuritySourceModuleDefault}); !reflect.DeepEqual(st.Desired.FSGroup, want) { + t.Errorf("desired FSGroup = %+v, want module default", st.Desired.FSGroup) + } +} + +// TestSecurityOverrides_RestrictedRefusalLeavesRunningPodAlone covers OD-5 under +// restricted mode: an override the identity rule refuses sets the existing +// failure phase and message, and a pod that is already running is untouched. +func TestSecurityOverrides_RestrictedRefusalLeavesRunningPodAlone(t *testing.T) { + ns := newNamespace(t) + startMgr(t, ns, secEnvRestrictedReconciler(t, ns)) + + tmpl := secEnvTemplate(t, &gameplanev1alpha1.GameSecuritySpec{ + RunAsUser: secInt(25000), + RunAsGroup: secInt(25000), + FSGroup: secInt(25000), + }) + if err := k8sClient.Create(context.Background(), buildGameServer(ns, "smp", tmpl.Name)); err != nil { + t.Fatalf("create gameserver: %v", err) + } + ss := secEnvWaitStatefulSet(t, ns, "smp") + pod := secEnvSeedPod(t, ss, map[string]string{securityAppliedAnnotation: ss.Spec.Template.Annotations[securityAppliedAnnotation]}, true) + before := ss.Spec.Template.DeepCopy() + beforeGen := ss.Generation + + // "Use image default" for runAsUser has no value, which restricted mode refuses. + gs := getGameServer(t, ns, "smp") + base := gs.DeepCopy() + gs.Spec.Security = &gameplanev1alpha1.GameServerSecuritySpec{ + RunAsUser: &gameplanev1alpha1.SecurityIDOverride{UseImageDefault: secBool(true)}, + } + if err := k8sClient.Patch(context.Background(), gs, client.MergeFrom(base)); err != nil { + t.Fatalf("save refused override: %v", err) + } + + eventually(t, func() (bool, string) { + secEnvNudge(t, ns, "smp") + got := getGameServer(t, ns, "smp") + if got.Status.Phase != gameplanev1alpha1.GameServerPhaseFailed { + return false, "phase is " + string(got.Status.Phase) + } + if msg := secEnvReadyMessage(got); msg != restrictedIdentityMessage { + return false, "ready message is " + msg + } + return true, "" + }) + + consistently(t, 2*time.Second, func() (bool, string) { + cur, ok := secEnvGetStatefulSet(t, ns, "smp") + if !ok { + return false, "statefulset gone" + } + if cur.Generation != beforeGen || !reflect.DeepEqual(cur.Spec.Template, *before) { + return false, "pod template changed after a refused override" + } + var running corev1.Pod + if err := k8sClient.Get(context.Background(), client.ObjectKeyFromObject(pod), &running); err != nil { + return false, "running pod: " + err.Error() + } + if running.UID != pod.UID { + return false, "running pod was replaced" + } + return true, "" + }) +} + +// TestSecurityOverrides_SavingOverrideDoesNotRewriteRunningPod covers T075: on a +// baseline-pinned running server, saving a security override does not change the +// pod template. The override shows as pending until the next start from zero. +func TestSecurityOverrides_SavingOverrideDoesNotRewriteRunningPod(t *testing.T) { + ns := newNamespace(t) + startMgr(t, ns, withGameServerReconciler(t, ns)) + + tmpl := secEnvTemplate(t, nil) + if err := k8sClient.Create(context.Background(), buildGameServer(ns, "smp", tmpl.Name)); err != nil { + t.Fatalf("create gameserver: %v", err) + } + ss := secEnvWaitStatefulSet(t, ns, "smp") + secEnvSeedPod(t, ss, map[string]string{securityAppliedAnnotation: ss.Spec.Template.Annotations[securityAppliedAnnotation]}, true) + + // Wait until the server holds its template baseline pin. + eventually(t, func() (bool, string) { + secEnvNudge(t, ns, "smp") + if getGameServer(t, ns, "smp").Annotations[effectiveTemplateAnnotation] == "" { + return false, "baseline pin not yet recorded" + } + return true, "" + }) + ss, _ = secEnvGetStatefulSet(t, ns, "smp") + before := ss.Spec.Template.DeepCopy() + beforeGen := ss.Generation + + gs := getGameServer(t, ns, "smp") + base := gs.DeepCopy() + gs.Spec.Security = &gameplanev1alpha1.GameServerSecuritySpec{ + RunAsUser: &gameplanev1alpha1.SecurityIDOverride{Value: secInt(2000)}, + FSGroup: &gameplanev1alpha1.SecurityIDOverride{Value: secInt(3000)}, + } + if err := k8sClient.Patch(context.Background(), gs, client.MergeFrom(base)); err != nil { + t.Fatalf("save override: %v", err) + } + + secEnvWaitStatusNudged(t, ns, "smp", func(st *gameplanev1alpha1.GameServerSecurityStatus) (bool, string) { + if !st.Pending { + return false, "override not yet reported as pending" + } + return true, "" + }) + + consistently(t, 2*time.Second, func() (bool, string) { + cur, ok := secEnvGetStatefulSet(t, ns, "smp") + if !ok { + return false, "statefulset gone" + } + if cur.Generation != beforeGen || !reflect.DeepEqual(cur.Spec.Template, *before) { + return false, "saving an override changed the running pod template" + } + return true, "" + }) +} diff --git a/operator/internal/controller/security_overrides_test.go b/operator/internal/controller/security_overrides_test.go new file mode 100644 index 000000000..2c6de15f5 --- /dev/null +++ b/operator/internal/controller/security_overrides_test.go @@ -0,0 +1,682 @@ +package controller + +import ( + "context" + "reflect" + "testing" + + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + + gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" +) + +func secInt(v int64) *int64 { return &v } + +func secBool(v bool) *bool { return &v } + +func secTemplate(sec *gameplanev1alpha1.GameSecuritySpec) *gameplanev1alpha1.GameTemplate { + tmpl := &gameplanev1alpha1.GameTemplate{} + tmpl.Name = "secure-game" + tmpl.Spec.Game = "secure-game" + tmpl.Spec.Security = sec + return tmpl +} + +func secServer(sec *gameplanev1alpha1.GameServerSecuritySpec) *gameplanev1alpha1.GameServer { + gs := &gameplanev1alpha1.GameServer{} + gs.Name = "alpha" + gs.Namespace = "games" + gs.UID = types.UID("alpha-uid") + gs.Spec.Security = sec + return gs +} + +// TestResolveGameSecurity_Sources is the resolver table (research R4): every id +// source, the override over module order, and the BuiltInDefault ownership +// check. +func TestResolveGameSecurity_Sources(t *testing.T) { + cases := []struct { + name string + tmpl *gameplanev1alpha1.GameTemplate + gs *gameplanev1alpha1.GameServer + want resolvedGameSecurity + }{ + { + name: "nil template and nil server read as image defaults", + want: resolvedGameSecurity{ + RunAsUser: securityIDResolved{Source: gameplanev1alpha1.SecuritySourceImageDefault}, + RunAsGroup: securityIDResolved{Source: gameplanev1alpha1.SecuritySourceImageDefault}, + FSGroup: securityIDResolved{Source: gameplanev1alpha1.SecuritySourceImageDefault}, + VolumeOwnershipCheck: securityCheckResolved{Value: gameplanev1alpha1.VolumeOwnershipCheckOnlyWhenWrong, Source: gameplanev1alpha1.SecuritySourceBuiltInDefault}, + }, + }, + { + name: "template with no security block gives image default and built-in check", + tmpl: secTemplate(nil), + want: resolvedGameSecurity{ + RunAsUser: securityIDResolved{Source: gameplanev1alpha1.SecuritySourceImageDefault}, + RunAsGroup: securityIDResolved{Source: gameplanev1alpha1.SecuritySourceImageDefault}, + FSGroup: securityIDResolved{Source: gameplanev1alpha1.SecuritySourceImageDefault}, + VolumeOwnershipCheck: securityCheckResolved{Value: gameplanev1alpha1.VolumeOwnershipCheckOnlyWhenWrong, Source: gameplanev1alpha1.SecuritySourceBuiltInDefault}, + }, + }, + { + name: "module default only", + tmpl: secTemplate(&gameplanev1alpha1.GameSecuritySpec{RunAsUser: secInt(25000), FSGroup: secInt(25000), VolumeOwnershipCheck: gameplanev1alpha1.VolumeOwnershipCheckEveryStart}), + gs: secServer(nil), + want: resolvedGameSecurity{ + RunAsUser: securityIDResolved{Value: secInt(25000), Source: gameplanev1alpha1.SecuritySourceModuleDefault}, + RunAsGroup: securityIDResolved{Source: gameplanev1alpha1.SecuritySourceImageDefault}, + FSGroup: securityIDResolved{Value: secInt(25000), Source: gameplanev1alpha1.SecuritySourceModuleDefault}, + VolumeOwnershipCheck: securityCheckResolved{Value: gameplanev1alpha1.VolumeOwnershipCheckEveryStart, Source: gameplanev1alpha1.SecuritySourceModuleDefault}, + }, + }, + { + name: "override value beats module default", + tmpl: secTemplate(&gameplanev1alpha1.GameSecuritySpec{RunAsUser: secInt(25000)}), + gs: secServer(&gameplanev1alpha1.GameServerSecuritySpec{ + RunAsUser: &gameplanev1alpha1.SecurityIDOverride{Value: secInt(2000)}, + }), + want: resolvedGameSecurity{ + RunAsUser: securityIDResolved{Value: secInt(2000), Source: gameplanev1alpha1.SecuritySourceOverride}, + RunAsGroup: securityIDResolved{Source: gameplanev1alpha1.SecuritySourceImageDefault}, + FSGroup: securityIDResolved{Source: gameplanev1alpha1.SecuritySourceImageDefault}, + VolumeOwnershipCheck: securityCheckResolved{Value: gameplanev1alpha1.VolumeOwnershipCheckOnlyWhenWrong, Source: gameplanev1alpha1.SecuritySourceBuiltInDefault}, + }, + }, + { + name: "override useImageDefault beats module default with no value", + tmpl: secTemplate(&gameplanev1alpha1.GameSecuritySpec{RunAsGroup: secInt(25000)}), + gs: secServer(&gameplanev1alpha1.GameServerSecuritySpec{ + RunAsGroup: &gameplanev1alpha1.SecurityIDOverride{UseImageDefault: secBool(true)}, + }), + want: resolvedGameSecurity{ + RunAsUser: securityIDResolved{Source: gameplanev1alpha1.SecuritySourceImageDefault}, + RunAsGroup: securityIDResolved{Source: gameplanev1alpha1.SecuritySourceImageDefaultOverride}, + FSGroup: securityIDResolved{Source: gameplanev1alpha1.SecuritySourceImageDefault}, + VolumeOwnershipCheck: securityCheckResolved{Value: gameplanev1alpha1.VolumeOwnershipCheckOnlyWhenWrong, Source: gameplanev1alpha1.SecuritySourceBuiltInDefault}, + }, + }, + { + name: "override check beats module check", + tmpl: secTemplate(&gameplanev1alpha1.GameSecuritySpec{VolumeOwnershipCheck: gameplanev1alpha1.VolumeOwnershipCheckEveryStart}), + gs: secServer(&gameplanev1alpha1.GameServerSecuritySpec{ + VolumeOwnershipCheck: gameplanev1alpha1.VolumeOwnershipCheckOnlyWhenWrong, + }), + want: resolvedGameSecurity{ + RunAsUser: securityIDResolved{Source: gameplanev1alpha1.SecuritySourceImageDefault}, + RunAsGroup: securityIDResolved{Source: gameplanev1alpha1.SecuritySourceImageDefault}, + FSGroup: securityIDResolved{Source: gameplanev1alpha1.SecuritySourceImageDefault}, + VolumeOwnershipCheck: securityCheckResolved{Value: gameplanev1alpha1.VolumeOwnershipCheckOnlyWhenWrong, Source: gameplanev1alpha1.SecuritySourceOverride}, + }, + }, + { + name: "override value with no template resolves as override", + gs: secServer(&gameplanev1alpha1.GameServerSecuritySpec{ + FSGroup: &gameplanev1alpha1.SecurityIDOverride{Value: secInt(3000)}, + }), + want: resolvedGameSecurity{ + RunAsUser: securityIDResolved{Source: gameplanev1alpha1.SecuritySourceImageDefault}, + RunAsGroup: securityIDResolved{Source: gameplanev1alpha1.SecuritySourceImageDefault}, + FSGroup: securityIDResolved{Value: secInt(3000), Source: gameplanev1alpha1.SecuritySourceOverride}, + VolumeOwnershipCheck: securityCheckResolved{Value: gameplanev1alpha1.VolumeOwnershipCheckOnlyWhenWrong, Source: gameplanev1alpha1.SecuritySourceBuiltInDefault}, + }, + }, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + got := resolveGameSecurity(tc.tmpl, tc.gs) + if !reflect.DeepEqual(got, tc.want) { + t.Errorf("resolveGameSecurity() = %+v, want %+v", got, tc.want) + } + }) + } +} + +// TestFSGroupChangePolicyMapping covers R8: EveryStart is Always, OnlyWhenWrong +// is OnRootMismatch, and no policy is written when no filesystem group applies. +func TestFSGroupChangePolicyMapping(t *testing.T) { + withFS := func(check gameplanev1alpha1.VolumeOwnershipCheck) resolvedGameSecurity { + return resolvedGameSecurity{ + FSGroup: securityIDResolved{Value: secInt(25000), Source: gameplanev1alpha1.SecuritySourceModuleDefault}, + VolumeOwnershipCheck: securityCheckResolved{Value: check, Source: gameplanev1alpha1.SecuritySourceModuleDefault}, + } + } + withoutFS := func(check gameplanev1alpha1.VolumeOwnershipCheck) resolvedGameSecurity { + return resolvedGameSecurity{ + FSGroup: securityIDResolved{Source: gameplanev1alpha1.SecuritySourceImageDefault}, + VolumeOwnershipCheck: securityCheckResolved{Value: check, Source: gameplanev1alpha1.SecuritySourceModuleDefault}, + } + } + always := corev1.FSGroupChangeAlways + onRoot := corev1.FSGroupChangeOnRootMismatch + + cases := []struct { + name string + in resolvedGameSecurity + want *corev1.PodFSGroupChangePolicy + }{ + {"EveryStart with fsGroup is Always", withFS(gameplanev1alpha1.VolumeOwnershipCheckEveryStart), &always}, + {"OnlyWhenWrong with fsGroup is OnRootMismatch", withFS(gameplanev1alpha1.VolumeOwnershipCheckOnlyWhenWrong), &onRoot}, + {"EveryStart without fsGroup is unset", withoutFS(gameplanev1alpha1.VolumeOwnershipCheckEveryStart), nil}, + {"OnlyWhenWrong without fsGroup is unset", withoutFS(gameplanev1alpha1.VolumeOwnershipCheckOnlyWhenWrong), nil}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + got := tc.in.fsGroupChangePolicy() + if !reflect.DeepEqual(got, tc.want) { + t.Errorf("fsGroupChangePolicy() = %v, want %v", got, tc.want) + } + }) + } +} + +// TestSecurityAnnotationRoundTrip proves the annotation codec keeps values and +// sources, and that a malformed annotation is an error. +func TestSecurityAnnotationRoundTrip(t *testing.T) { + tmpl := secTemplate(&gameplanev1alpha1.GameSecuritySpec{ + RunAsUser: secInt(25000), + RunAsGroup: secInt(25000), + FSGroup: secInt(25000), + VolumeOwnershipCheck: gameplanev1alpha1.VolumeOwnershipCheckEveryStart, + }) + gs := secServer(&gameplanev1alpha1.GameServerSecuritySpec{ + RunAsGroup: &gameplanev1alpha1.SecurityIDOverride{UseImageDefault: secBool(true)}, + }) + want := resolveGameSecurity(tmpl, gs).settings() + + raw, err := encodeSecurityAnnotation(want) + if err != nil { + t.Fatalf("encodeSecurityAnnotation: %v", err) + } + got, err := decodeSecurityAnnotation(raw) + if err != nil { + t.Fatalf("decodeSecurityAnnotation: %v", err) + } + if !reflect.DeepEqual(*got, want) { + t.Errorf("round trip = %+v, want %+v", *got, want) + } + if got.RunAsGroup.Source != gameplanev1alpha1.SecuritySourceImageDefaultOverride { + t.Errorf("RunAsGroup source = %q, want ImageDefaultOverride", got.RunAsGroup.Source) + } + + if _, err := decodeSecurityAnnotation("{not json"); err == nil { + t.Error("decodeSecurityAnnotation on malformed input returned nil error") + } +} + +// TestSecurityPending covers the pending rule: nothing applied is never pending, +// a source-only change is not pending, and a value change is. +func TestSecurityPending(t *testing.T) { + settings := func(user, group, fs *int64, check gameplanev1alpha1.VolumeOwnershipCheck) gameplanev1alpha1.SecuritySettings { + src := func(v *int64) gameplanev1alpha1.SecuritySource { + if v == nil { + return gameplanev1alpha1.SecuritySourceImageDefault + } + return gameplanev1alpha1.SecuritySourceModuleDefault + } + return gameplanev1alpha1.SecuritySettings{ + RunAsUser: gameplanev1alpha1.SecurityIDStatus{Value: user, Source: src(user)}, + RunAsGroup: gameplanev1alpha1.SecurityIDStatus{Value: group, Source: src(group)}, + FSGroup: gameplanev1alpha1.SecurityIDStatus{Value: fs, Source: src(fs)}, + VolumeOwnershipCheck: gameplanev1alpha1.SecurityCheckStatus{Value: check, Source: gameplanev1alpha1.SecuritySourceBuiltInDefault}, + } + } + every := gameplanev1alpha1.VolumeOwnershipCheckEveryStart + onlyWrong := gameplanev1alpha1.VolumeOwnershipCheckOnlyWhenWrong + base := settings(secInt(25000), secInt(25000), secInt(25000), every) + + t.Run("never started is not pending", func(t *testing.T) { + if securityPending(base, nil) { + t.Error("securityPending(applied=nil) = true, want false") + } + }) + t.Run("identical values are not pending", func(t *testing.T) { + if securityPending(base, &base) { + t.Error("securityPending(identical) = true, want false") + } + }) + t.Run("source-only change is not pending", func(t *testing.T) { + applied := base + applied.RunAsUser.Source = gameplanev1alpha1.SecuritySourceOverride + if securityPending(base, &applied) { + t.Error("securityPending(source-only change) = true, want false") + } + }) + t.Run("runAsUser value change is pending", func(t *testing.T) { + desired := settings(secInt(2000), secInt(25000), secInt(25000), every) + if !securityPending(desired, &base) { + t.Error("securityPending(runAsUser changed) = false, want true") + } + }) + t.Run("fsGroup value change is pending", func(t *testing.T) { + desired := settings(secInt(25000), secInt(25000), secInt(3000), every) + if !securityPending(desired, &base) { + t.Error("securityPending(fsGroup changed) = false, want true") + } + }) + t.Run("fsGroup removed is pending", func(t *testing.T) { + desired := settings(secInt(25000), secInt(25000), nil, every) + if !securityPending(desired, &base) { + t.Error("securityPending(fsGroup removed) = false, want true") + } + }) + t.Run("ownership check change with fsGroup is pending", func(t *testing.T) { + desired := settings(secInt(25000), secInt(25000), secInt(25000), onlyWrong) + if !securityPending(desired, &base) { + t.Error("securityPending(check changed, fsGroup set) = false, want true") + } + }) + t.Run("ownership check change without fsGroup on either side is not pending", func(t *testing.T) { + desiredNoFS := settings(secInt(25000), secInt(25000), nil, onlyWrong) + appliedNoFS := settings(secInt(25000), secInt(25000), nil, every) + if securityPending(desiredNoFS, &appliedNoFS) { + t.Error("securityPending(check changed, no fsGroup) = true, want false") + } + }) +} + +// TestPodVolumesSetUp covers the volume-setup signal used by the applied reader. +func TestPodVolumesSetUp(t *testing.T) { + started := true + cases := []struct { + name string + pod corev1.Pod + want bool + }{ + {"empty pod has not passed volume setup", corev1.Pod{}, false}, + { + "ready to start containers is set up", + corev1.Pod{Status: corev1.PodStatus{Conditions: []corev1.PodCondition{ + {Type: corev1.PodReadyToStartContainers, Status: corev1.ConditionTrue}, + }}}, + true, + }, + { + "ready to start containers false is not set up", + corev1.Pod{Status: corev1.PodStatus{Conditions: []corev1.PodCondition{ + {Type: corev1.PodReadyToStartContainers, Status: corev1.ConditionFalse}, + }}}, + false, + }, + { + "started config-init is set up", + corev1.Pod{Status: corev1.PodStatus{InitContainerStatuses: []corev1.ContainerStatus{ + {Name: securityConfigInitContainerName, Started: &started}, + }}}, + true, + }, + { + "config-init waiting is not set up", + corev1.Pod{Status: corev1.PodStatus{InitContainerStatuses: []corev1.ContainerStatus{ + {Name: securityConfigInitContainerName, State: corev1.ContainerState{Waiting: &corev1.ContainerStateWaiting{}}}, + }}}, + false, + }, + { + "other init container running is not set up", + corev1.Pod{Status: corev1.PodStatus{InitContainerStatuses: []corev1.ContainerStatus{ + {Name: "sentinel", State: corev1.ContainerState{Running: &corev1.ContainerStateRunning{}}}, + }}}, + false, + }, + { + "running game container is set up", + corev1.Pod{Status: corev1.PodStatus{ContainerStatuses: []corev1.ContainerStatus{ + {Name: gameContainerName, State: corev1.ContainerState{Running: &corev1.ContainerStateRunning{}}}, + }}}, + true, + }, + { + "terminated game container is set up", + corev1.Pod{Status: corev1.PodStatus{ContainerStatuses: []corev1.ContainerStatus{ + {Name: gameContainerName, State: corev1.ContainerState{Terminated: &corev1.ContainerStateTerminated{}}}, + }}}, + true, + }, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + if got := podVolumesSetUp(&tc.pod); got != tc.want { + t.Errorf("podVolumesSetUp() = %v, want %v", got, tc.want) + } + }) + } +} + +// secOwnedStatefulSet builds a StatefulSet controlled by gs, as reconcile does. +func secOwnedStatefulSet(gs *gameplanev1alpha1.GameServer, uid types.UID) *appsv1.StatefulSet { + return &appsv1.StatefulSet{ + ObjectMeta: metav1.ObjectMeta{ + Name: gs.Name, + Namespace: gs.Namespace, + UID: uid, + OwnerReferences: []metav1.OwnerReference{{ + APIVersion: gameplanev1alpha1.GroupVersion.String(), + Kind: "GameServer", + Name: gs.Name, + UID: gs.UID, + Controller: ownerBoolPtr(true), + }}, + }, + } +} + +// secTemplatePod builds the template pod of a StatefulSet, controlled by it. +func secTemplatePod(ss *appsv1.StatefulSet, annotations map[string]string) *corev1.Pod { + return &corev1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: ss.Name + "-0", + Namespace: ss.Namespace, + Annotations: annotations, + OwnerReferences: []metav1.OwnerReference{{ + APIVersion: "apps/v1", + Kind: "StatefulSet", + Name: ss.Name, + UID: ss.UID, + Controller: ownerBoolPtr(true), + }}, + }, + Spec: corev1.PodSpec{Containers: []corev1.Container{{Name: gameContainerName, Image: "test/game:fixture"}}}, + } +} + +// TestReadAppliedSecurity covers the applied reader (R6): never started, the +// observed annotation, pre-feature StatefulSets read from the pod or template, +// and feature StatefulSets that report only after volume setup. +func TestReadAppliedSecurity(t *testing.T) { + s := testScheme(t) + ctx := context.Background() + gs := secServer(nil) + + t.Run("never started returns nil", func(t *testing.T) { + cl := fake.NewClientBuilder().WithScheme(s).Build() + got, err := readAppliedSecurity(ctx, cl, gs) + if err != nil || got != nil { + t.Errorf("readAppliedSecurity() = %+v, %v; want nil, nil", got, err) + } + }) + + t.Run("observed annotation wins", func(t *testing.T) { + observed := gameplanev1alpha1.SecuritySettings{ + RunAsUser: gameplanev1alpha1.SecurityIDStatus{Value: secInt(2000), Source: gameplanev1alpha1.SecuritySourceOverride}, + RunAsGroup: gameplanev1alpha1.SecurityIDStatus{Source: gameplanev1alpha1.SecuritySourceImageDefault}, + FSGroup: gameplanev1alpha1.SecurityIDStatus{Value: secInt(25000), Source: gameplanev1alpha1.SecuritySourceModuleDefault}, + VolumeOwnershipCheck: gameplanev1alpha1.SecurityCheckStatus{Value: gameplanev1alpha1.VolumeOwnershipCheckOnlyWhenWrong, Source: gameplanev1alpha1.SecuritySourceBuiltInDefault}, + } + raw, err := encodeSecurityAnnotation(observed) + if err != nil { + t.Fatalf("encode: %v", err) + } + ss := secOwnedStatefulSet(gs, "alpha-ss-uid") + ss.Annotations = map[string]string{securityAppliedObservedAnnotation: raw} + cl := fake.NewClientBuilder().WithScheme(s).WithObjects(ss).Build() + got, err := readAppliedSecurity(ctx, cl, gs) + if err != nil || got == nil { + t.Fatalf("readAppliedSecurity() = %+v, %v; want observed value", got, err) + } + if !reflect.DeepEqual(*got, observed) { + t.Errorf("readAppliedSecurity() = %+v, want %+v", *got, observed) + } + }) + + t.Run("pre-feature statefulset without pod reads its template", func(t *testing.T) { + ss := secOwnedStatefulSet(gs, "alpha-ss-uid") + ss.Spec.Template.Spec = corev1.PodSpec{ + Containers: []corev1.Container{{ + Name: gameContainerName, + SecurityContext: &corev1.SecurityContext{RunAsUser: secInt(25000), RunAsGroup: secInt(25000)}, + }}, + SecurityContext: &corev1.PodSecurityContext{FSGroup: secInt(25000)}, + } + cl := fake.NewClientBuilder().WithScheme(s).WithObjects(ss).Build() + got, err := readAppliedSecurity(ctx, cl, gs) + if err != nil || got == nil { + t.Fatalf("readAppliedSecurity() = %+v, %v; want template values", got, err) + } + want := gameplanev1alpha1.SecuritySettings{ + RunAsUser: gameplanev1alpha1.SecurityIDStatus{Value: secInt(25000), Source: gameplanev1alpha1.SecuritySourceModuleDefault}, + RunAsGroup: gameplanev1alpha1.SecurityIDStatus{Value: secInt(25000), Source: gameplanev1alpha1.SecuritySourceModuleDefault}, + FSGroup: gameplanev1alpha1.SecurityIDStatus{Value: secInt(25000), Source: gameplanev1alpha1.SecuritySourceModuleDefault}, + VolumeOwnershipCheck: gameplanev1alpha1.SecurityCheckStatus{Value: gameplanev1alpha1.VolumeOwnershipCheckEveryStart, Source: gameplanev1alpha1.SecuritySourceBuiltInDefault}, + } + if !reflect.DeepEqual(*got, want) { + t.Errorf("readAppliedSecurity() = %+v, want %+v", *got, want) + } + }) + + t.Run("pre-feature statefulset with empty template reads image defaults", func(t *testing.T) { + ss := secOwnedStatefulSet(gs, "alpha-ss-uid") + cl := fake.NewClientBuilder().WithScheme(s).WithObjects(ss).Build() + got, err := readAppliedSecurity(ctx, cl, gs) + if err != nil || got == nil { + t.Fatalf("readAppliedSecurity() = %+v, %v; want image defaults", got, err) + } + if got.FSGroup.Value != nil || got.FSGroup.Source != gameplanev1alpha1.SecuritySourceImageDefault { + t.Errorf("FSGroup = %+v, want image default", got.FSGroup) + } + if got.VolumeOwnershipCheck.Value != gameplanev1alpha1.VolumeOwnershipCheckEveryStart { + t.Errorf("check = %q, want EveryStart", got.VolumeOwnershipCheck.Value) + } + }) + + t.Run("pre-feature statefulset with pod reads the running pod", func(t *testing.T) { + ss := secOwnedStatefulSet(gs, "alpha-ss-uid") + ss.Spec.Template.Spec = corev1.PodSpec{ + SecurityContext: &corev1.PodSecurityContext{FSGroup: secInt(25000)}, + } + pod := secTemplatePod(ss, nil) + pod.Spec.SecurityContext = &corev1.PodSecurityContext{ + FSGroup: secInt(30000), + FSGroupChangePolicy: ptrTo(corev1.FSGroupChangeOnRootMismatch), + } + cl := fake.NewClientBuilder().WithScheme(s).WithObjects(ss, pod).Build() + got, err := readAppliedSecurity(ctx, cl, gs) + if err != nil || got == nil { + t.Fatalf("readAppliedSecurity() = %+v, %v; want pod values", got, err) + } + if got.FSGroup.Value == nil || *got.FSGroup.Value != 30000 { + t.Errorf("FSGroup = %+v, want the pod value 30000", got.FSGroup) + } + if got.VolumeOwnershipCheck.Value != gameplanev1alpha1.VolumeOwnershipCheckOnlyWhenWrong { + t.Errorf("check = %q, want OnlyWhenWrong from the pod policy", got.VolumeOwnershipCheck.Value) + } + }) + + t.Run("feature statefulset with no pod reports nothing", func(t *testing.T) { + ss := secOwnedStatefulSet(gs, "alpha-ss-uid") + ss.Annotations = nil + ss.Spec.Template.Annotations = map[string]string{securityAppliedAnnotation: `{}`} + cl := fake.NewClientBuilder().WithScheme(s).WithObjects(ss).Build() + got, err := readAppliedSecurity(ctx, cl, gs) + if err != nil || got != nil { + t.Errorf("readAppliedSecurity() = %+v, %v; want nil, nil", got, err) + } + }) + + t.Run("feature statefulset with pod that has not passed volume setup reports nothing", func(t *testing.T) { + ss := secOwnedStatefulSet(gs, "alpha-ss-uid") + ss.Spec.Template.Annotations = map[string]string{securityAppliedAnnotation: `{}`} + pod := secTemplatePod(ss, map[string]string{securityAppliedAnnotation: `{}`}) + cl := fake.NewClientBuilder().WithScheme(s).WithObjects(ss, pod).Build() + got, err := readAppliedSecurity(ctx, cl, gs) + if err != nil || got != nil { + t.Errorf("readAppliedSecurity() = %+v, %v; want nil, nil", got, err) + } + }) + + t.Run("feature statefulset with a set-up pod reports the pod annotation", func(t *testing.T) { + want := gameplanev1alpha1.SecuritySettings{ + RunAsUser: gameplanev1alpha1.SecurityIDStatus{Value: secInt(2000), Source: gameplanev1alpha1.SecuritySourceOverride}, + RunAsGroup: gameplanev1alpha1.SecurityIDStatus{Source: gameplanev1alpha1.SecuritySourceImageDefault}, + FSGroup: gameplanev1alpha1.SecurityIDStatus{Value: secInt(25000), Source: gameplanev1alpha1.SecuritySourceModuleDefault}, + VolumeOwnershipCheck: gameplanev1alpha1.SecurityCheckStatus{Value: gameplanev1alpha1.VolumeOwnershipCheckEveryStart, Source: gameplanev1alpha1.SecuritySourceModuleDefault}, + } + raw, err := encodeSecurityAnnotation(want) + if err != nil { + t.Fatalf("encode: %v", err) + } + ss := secOwnedStatefulSet(gs, "alpha-ss-uid") + ss.Spec.Template.Annotations = map[string]string{securityAppliedAnnotation: raw} + pod := secTemplatePod(ss, map[string]string{securityAppliedAnnotation: raw}) + pod.Status.Conditions = []corev1.PodCondition{{Type: corev1.PodReadyToStartContainers, Status: corev1.ConditionTrue}} + cl := fake.NewClientBuilder().WithScheme(s).WithObjects(ss, pod).Build() + got, err := readAppliedSecurity(ctx, cl, gs) + if err != nil || got == nil { + t.Fatalf("readAppliedSecurity() = %+v, %v; want pod annotation", got, err) + } + if !reflect.DeepEqual(*got, want) { + t.Errorf("readAppliedSecurity() = %+v, want %+v", *got, want) + } + }) +} + +// TestSetObservedSecurityAnnotation covers the observed annotation writer: an +// empty value is ignored, and an unchanged value reports no change. +func TestSetObservedSecurityAnnotation(t *testing.T) { + ss := &appsv1.StatefulSet{} + if setObservedSecurityAnnotation(ss, "") { + t.Error("empty value reported a change") + } + if !setObservedSecurityAnnotation(ss, `{"a":1}`) { + t.Error("first write reported no change") + } + if got := ss.Annotations[securityAppliedObservedAnnotation]; got != `{"a":1}` { + t.Errorf("observed annotation = %q", got) + } + if setObservedSecurityAnnotation(ss, `{"a":1}`) { + t.Error("unchanged value reported a change") + } +} + +// TestRestrictedIdentityUsesEffectiveValues is the OD-5 table: restricted +// validation reads the effective values of one server, so a positive override +// passes where a root module default would fail, and a root or "use image +// default" value is refused. +func TestRestrictedIdentityUsesEffectiveValues(t *testing.T) { + cases := []struct { + name string + tmpl *gameplanev1alpha1.GameTemplate + gs *gameplanev1alpha1.GameServer + wantErr bool + }{ + { + name: "module identity is valid", + tmpl: secTemplate(&gameplanev1alpha1.GameSecuritySpec{RunAsUser: secInt(25000), FSGroup: secInt(25000)}), + gs: secServer(nil), + }, + { + name: "root module default without override is refused", + tmpl: secTemplate(&gameplanev1alpha1.GameSecuritySpec{RunAsUser: secInt(0), FSGroup: secInt(25000)}), + gs: secServer(nil), + + wantErr: true, + }, + { + name: "positive override of a root module default passes", + tmpl: secTemplate(&gameplanev1alpha1.GameSecuritySpec{RunAsUser: secInt(0), FSGroup: secInt(25000)}), + gs: secServer(&gameplanev1alpha1.GameServerSecuritySpec{ + RunAsUser: &gameplanev1alpha1.SecurityIDOverride{Value: secInt(2000)}, + }), + }, + { + name: "root override value is refused", + tmpl: secTemplate(&gameplanev1alpha1.GameSecuritySpec{RunAsUser: secInt(25000), FSGroup: secInt(25000)}), + gs: secServer(&gameplanev1alpha1.GameServerSecuritySpec{ + RunAsUser: &gameplanev1alpha1.SecurityIDOverride{Value: secInt(0)}, + }), + wantErr: true, + }, + { + name: "use image default for run-as user is refused", + tmpl: secTemplate(&gameplanev1alpha1.GameSecuritySpec{RunAsUser: secInt(25000), FSGroup: secInt(25000)}), + gs: secServer(&gameplanev1alpha1.GameServerSecuritySpec{ + RunAsUser: &gameplanev1alpha1.SecurityIDOverride{UseImageDefault: secBool(true)}, + }), + wantErr: true, + }, + { + name: "use image default for fsGroup is refused", + tmpl: secTemplate(&gameplanev1alpha1.GameSecuritySpec{RunAsUser: secInt(25000), FSGroup: secInt(25000)}), + gs: secServer(&gameplanev1alpha1.GameServerSecuritySpec{ + FSGroup: &gameplanev1alpha1.SecurityIDOverride{UseImageDefault: secBool(true)}, + }), + wantErr: true, + }, + { + name: "zero runAsGroup override is refused", + tmpl: secTemplate(&gameplanev1alpha1.GameSecuritySpec{RunAsUser: secInt(25000), RunAsGroup: secInt(25000), FSGroup: secInt(25000)}), + gs: secServer(&gameplanev1alpha1.GameServerSecuritySpec{ + RunAsGroup: &gameplanev1alpha1.SecurityIDOverride{Value: secInt(0)}, + }), + wantErr: true, + }, + { + name: "absent runAsGroup is allowed", + tmpl: secTemplate(&gameplanev1alpha1.GameSecuritySpec{RunAsUser: secInt(25000), FSGroup: secInt(25000)}), + gs: secServer(nil), + }, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + err := validateRestrictedSecurity(resolveGameSecurity(tc.tmpl, tc.gs)) + if (err != nil) != tc.wantErr { + t.Errorf("validateRestrictedSecurity() error = %v, wantErr %v", err, tc.wantErr) + } + }) + } + + t.Run("template-only validation still refuses a root default", func(t *testing.T) { + if err := validateRestrictedTemplate(secTemplate(&gameplanev1alpha1.GameSecuritySpec{RunAsUser: secInt(0), FSGroup: secInt(25000)})); err == nil { + t.Error("validateRestrictedTemplate(root default) = nil, want error") + } + }) +} + +// TestRestrictedGameContainerUsesOverride proves restricted mode takes the game +// container identity from the effective values (OD-5), and that a non-restricted +// build leaves the game container alone. +func TestRestrictedGameContainerUsesOverride(t *testing.T) { + tmpl := secTemplate(&gameplanev1alpha1.GameSecuritySpec{RunAsUser: secInt(25000), RunAsGroup: secInt(25000), FSGroup: secInt(25000)}) + gs := secServer(&gameplanev1alpha1.GameServerSecuritySpec{ + RunAsUser: &gameplanev1alpha1.SecurityIDOverride{Value: secInt(2000)}, + }) + sec := resolveGameSecurity(tmpl, gs) + + newPod := func() *corev1.PodSpec { + return &corev1.PodSpec{ + Containers: []corev1.Container{ + {Name: gameContainerName, Image: "test/game:fixture"}, + {Name: "agent", Image: "test/agent:fixture"}, + }, + SecurityContext: &corev1.PodSecurityContext{}, + } + } + + t.Run("restricted game container takes the override", func(t *testing.T) { + pod := newPod() + applyWorkloadSecurityResolved(pod, sec, true, 3600) + sc := podContainerNamed(pod, gameContainerName).SecurityContext + if sc == nil || sc.RunAsUser == nil || *sc.RunAsUser != 2000 { + t.Fatalf("game RunAsUser = %+v, want 2000", sc) + } + if sc.RunAsGroup == nil || *sc.RunAsGroup != 25000 { + t.Errorf("game RunAsGroup = %v, want 25000", sc.RunAsGroup) + } + if sc.RunAsNonRoot == nil || !*sc.RunAsNonRoot { + t.Error("game RunAsNonRoot not set in restricted mode") + } + }) + + t.Run("non-restricted leaves the game container unchanged", func(t *testing.T) { + pod := newPod() + applyWorkloadSecurityResolved(pod, sec, false, 3600) + if sc := podContainerNamed(pod, gameContainerName).SecurityContext; sc != nil { + t.Errorf("game SecurityContext = %+v, want nil when not restricted", sc) + } + }) +} diff --git a/operator/internal/controller/security_settings.go b/operator/internal/controller/security_settings.go new file mode 100644 index 000000000..9f4e526a2 --- /dev/null +++ b/operator/internal/controller/security_settings.go @@ -0,0 +1,191 @@ +package controller + +import ( + "context" + "fmt" + "strings" + + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/log" + "sigs.k8s.io/controller-runtime/pkg/reconcile" + + gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" +) + +const ( + // securitySettingsConfigMapName is the per-cluster security settings + // ConfigMap. Helm creates it in the operator control-plane namespace (OD-8). + securitySettingsConfigMapName = "gameplane-security-settings" + + // securitySettingsAllowRootKey holds "true" when the cluster allows root + // overrides. Only that exact value allows them. + securitySettingsAllowRootKey = "allowRootOverrides" + + // securityConditionReasonAllowed is the SecurityAllowed=True reason used + // once root overrides are allowed in the cluster. + securityConditionReasonAllowed = "RootOverrideAllowed" + + // securityConditionReasonNoOverride is the SecurityAllowed=True reason used + // once a previously held server no longer saves a root override. + securityConditionReasonNoOverride = "NoRootOverride" +) + +// securitySettingsAllowRoot reports whether the settings ConfigMap allows root +// overrides. A nil ConfigMap, a missing key or any value other than exactly +// "true" is off (fail closed). +func securitySettingsAllowRoot(cm *corev1.ConfigMap) bool { + if cm == nil { + return false + } + return cm.Data[securitySettingsAllowRootKey] == "true" +} + +// rootOverridesAllowed reads this cluster's setting from the manager cache. An +// empty ControlPlaneNamespace, a missing ConfigMap or a read error is off. +func (r *GameServerReconciler) rootOverridesAllowed(ctx context.Context) bool { + if r.ControlPlaneNamespace == "" { + return false + } + var cm corev1.ConfigMap + key := types.NamespacedName{Namespace: r.ControlPlaneNamespace, Name: securitySettingsConfigMapName} + if err := r.Get(ctx, key, &cm); err != nil { + if !apierrors.IsNotFound(err) { + log.FromContext(ctx).Error(err, "read security settings ConfigMap; root overrides stay disallowed", + "namespace", key.Namespace, "name", key.Name) + } + return false + } + return securitySettingsAllowRoot(&cm) +} + +// isRootIDOverride reports whether one override id is a root value. A value of +// 0 is root. useImageDefault on runAsUser or runAsGroup is root too, because the +// image may run as root. fsGroup useImageDefault is not a root rule. +func isRootIDOverride(o *gameplanev1alpha1.SecurityIDOverride, imageDefaultIsRoot bool) bool { + if o == nil { + return false + } + if o.Value != nil && *o.Value == 0 { + return true + } + return imageDefaultIsRoot && o.UseImageDefault != nil && *o.UseImageDefault +} + +// rootOverrideSettings names the overrides on gs that are root values, in +// spec order (runAsUser, runAsGroup, fsGroup). Module defaults are never +// overrides and are not named here. +func rootOverrideSettings(gs *gameplanev1alpha1.GameServer) []string { + if gs == nil || gs.Spec.Security == nil { + return nil + } + sec := gs.Spec.Security + var names []string + if isRootIDOverride(sec.RunAsUser, true) { + names = append(names, "runAsUser") + } + if isRootIDOverride(sec.RunAsGroup, true) { + names = append(names, "runAsGroup") + } + if isRootIDOverride(sec.FSGroup, false) { + names = append(names, "fsGroup") + } + return names +} + +// hasRootOverride reports whether gs saves at least one root override. +func hasRootOverride(gs *gameplanev1alpha1.GameServer) bool { + return len(rootOverrideSettings(gs)) > 0 +} + +// rootOverrideHeld reports whether gs must not start: it saves a root override +// while the cluster does not allow one (OD-4, FR-005a). +func (r *GameServerReconciler) rootOverrideHeld(ctx context.Context, gs *gameplanev1alpha1.GameServer) bool { + return hasRootOverride(gs) && !r.rootOverridesAllowed(ctx) +} + +// recordRootOverrideHold emits a Warning event on gs when the reconciler holds +// it back. It is a no-op without an EventRecorder (unit and envtest setups). +func (r *GameServerReconciler) recordRootOverrideHold(gs *gameplanev1alpha1.GameServer) { + if r.EventRecorder == nil { + return + } + message := fmt.Sprintf("not started: saved root overrides (%s) are not allowed in this cluster; clear the override or allow root overrides in the cluster's Configuration", + strings.Join(rootOverrideSettings(gs), ", ")) + reason := gameplanev1alpha1.GameServerReasonRootOverrideDisallowed + r.EventRecorder.Eventf(gs, nil, corev1.EventTypeWarning, reason, reason, "%s", message) +} + +// applySecurityAllowedCondition sets the SecurityAllowed condition. While the +// cluster does not allow root overrides, a server that saves one reports False +// with reason RootOverrideDisallowed. A running server keeps running; a stopped +// one stays at zero replicas. Once allowed, or once the override is cleared, the +// condition is True. A server that never saved a root override has no condition +// unless one was already set, in which case it is set to True. +func (r *GameServerReconciler) applySecurityAllowedCondition( + ctx context.Context, conds []metav1.Condition, gs *gameplanev1alpha1.GameServer, running bool, +) []metav1.Condition { + condType := gameplanev1alpha1.GameServerConditionSecurityAllowed + if !hasRootOverride(gs) { + if meta.FindStatusCondition(conds, condType) == nil { + return conds + } + return upsertCondition(conds, metav1.Condition{ + Type: condType, + Status: metav1.ConditionTrue, + ObservedGeneration: gs.Generation, + Reason: securityConditionReasonNoOverride, + Message: "No root override is saved for this server.", + }) + } + settings := strings.Join(rootOverrideSettings(gs), ", ") + if r.rootOverridesAllowed(ctx) { + return upsertCondition(conds, metav1.Condition{ + Type: condType, + Status: metav1.ConditionTrue, + ObservedGeneration: gs.Generation, + Reason: securityConditionReasonAllowed, + Message: fmt.Sprintf("Root overrides (%s) are allowed in this cluster.", + settings), + }) + } + const clearHint = "the override is cleared or root overrides are allowed in this cluster's Configuration" + message := fmt.Sprintf("Saved root overrides (%s) are not allowed in this cluster, so the server will not start until %s.", settings, clearHint) + if running { + message = fmt.Sprintf("Saved root overrides (%s) are not allowed in this cluster. The server keeps running but will not start again until %s.", settings, clearHint) + } + return upsertCondition(conds, metav1.Condition{ + Type: condType, + Status: metav1.ConditionFalse, + ObservedGeneration: gs.Generation, + Reason: gameplanev1alpha1.GameServerReasonRootOverrideDisallowed, + Message: message, + }) +} + +// mapSecuritySettingsToGameServers enqueues the GameServers that save a root +// override when the settings ConfigMap changes (created, updated or deleted) in +// the control-plane namespace. Other ConfigMaps and other servers are ignored. +func (r *GameServerReconciler) mapSecuritySettingsToGameServers(ctx context.Context, obj client.Object) []reconcile.Request { + if r.ControlPlaneNamespace == "" || obj.GetName() != securitySettingsConfigMapName || + obj.GetNamespace() != r.ControlPlaneNamespace { + return nil + } + var servers gameplanev1alpha1.GameServerList + if err := r.List(ctx, &servers); err != nil { + log.FromContext(ctx).Error(err, "list servers for security settings change") + return nil + } + var requests []reconcile.Request + for i := range servers.Items { + gs := &servers.Items[i] + if hasRootOverride(gs) { + requests = append(requests, reconcile.Request{NamespacedName: client.ObjectKeyFromObject(gs)}) + } + } + return requests +} diff --git a/operator/internal/controller/security_settings_envtest_test.go b/operator/internal/controller/security_settings_envtest_test.go new file mode 100644 index 000000000..b7926d1e0 --- /dev/null +++ b/operator/internal/controller/security_settings_envtest_test.go @@ -0,0 +1,293 @@ +//go:build envtest + +package controller + +import ( + "context" + "strings" + "testing" + + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/client-go/util/retry" + "sigs.k8s.io/controller-runtime/pkg/manager" + + gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" +) + +// withGameServerReconcilerControlPlane wires GameServerReconciler with +// ControlPlaneNamespace set to ns, so the scoped envtest cache sees the +// security settings ConfigMap there (spec 030, OD-4, OD-8). +func withGameServerReconcilerControlPlane(t *testing.T, ns string) setupReconciler { + t.Helper() + seedAgentCA(t, ns, "agent-ca") + return func(mgr manager.Manager) error { + return (&GameServerReconciler{ + Client: mgr.GetClient(), + APIReader: mgr.GetAPIReader(), + Scheme: mgr.GetScheme(), + AgentImage: "ghcr.io/gameplanepanel/gameplane/agent:test", + AgentCASecretName: "agent-ca", + AgentCASecretNamespace: ns, + ControlPlaneNamespace: ns, + EventRecorder: mgr.GetEventRecorder("gameserver-controller-security-test"), + }).SetupWithManager(mgr) + } +} + +// secSettingsWriteConfigMap creates or replaces the settings ConfigMap in ns +// with allowRootOverrides set to value. +func secSettingsWriteConfigMap(t *testing.T, ns, value string) { + t.Helper() + ctx := context.Background() + key := types.NamespacedName{Namespace: ns, Name: securitySettingsConfigMapName} + err := retry.RetryOnConflict(retry.DefaultRetry, func() error { + var cm corev1.ConfigMap + if err := k8sClient.Get(ctx, key, &cm); err != nil { + if !apierrors.IsNotFound(err) { + return err + } + fresh := &corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{Name: key.Name, Namespace: key.Namespace}, + Data: map[string]string{securitySettingsAllowRootKey: value}, + } + return k8sClient.Create(ctx, fresh) + } + if cm.Data == nil { + cm.Data = map[string]string{} + } + cm.Data[securitySettingsAllowRootKey] = value + return k8sClient.Update(ctx, &cm) + }) + if err != nil { + t.Fatalf("write security settings ConfigMap %s/%s: %v", ns, key.Name, err) + } +} + +// secSettingsRootServer returns a GameServer that saves a root runAsUser. +func secSettingsRootServer(ns, name, tmplName string) *gameplanev1alpha1.GameServer { + gs := buildGameServer(ns, name, tmplName) + gs.Spec.Security = &gameplanev1alpha1.GameServerSecuritySpec{ + RunAsUser: &gameplanev1alpha1.SecurityIDOverride{Value: secSettingsInt64(0)}, + } + return gs +} + +// secSettingsCreateTemplate creates a plain GameTemplate and registers cleanup. +func secSettingsCreateTemplate(t *testing.T) string { + t.Helper() + tmpl := buildGameTemplate(uniqueName("secset")) + if err := k8sClient.Create(context.Background(), tmpl); err != nil { + t.Fatalf("create template: %v", err) + } + deleteCleanup(t, tmpl) + return tmpl.Name +} + +// secSettingsStatefulSet returns the StatefulSet of the named server, or nil. +func secSettingsStatefulSet(t *testing.T, ns, name string) *appsv1.StatefulSet { + t.Helper() + var ss appsv1.StatefulSet + if err := k8sClient.Get(context.Background(), types.NamespacedName{Namespace: ns, Name: name}, &ss); err != nil { + return nil + } + return &ss +} + +// secSettingsReplicas reports the StatefulSet replica count, or -1 while the +// StatefulSet does not exist yet. +func secSettingsReplicas(t *testing.T, ns, name string) int32 { + t.Helper() + ss := secSettingsStatefulSet(t, ns, name) + if ss == nil || ss.Spec.Replicas == nil { + return -1 + } + return *ss.Spec.Replicas +} + +// secSettingsCondition returns the SecurityAllowed condition of the named server. +func secSettingsCondition(t *testing.T, ns, name string) *metav1.Condition { + t.Helper() + gs := getGameServer(t, ns, name) + return meta.FindStatusCondition(gs.Status.Conditions, gameplanev1alpha1.GameServerConditionSecurityAllowed) +} + +// TestSecuritySettings_OffHoldsStoppedServer: with the ConfigMap absent, "false" +// or any value other than "true", a new server that saves a root override is +// created at zero replicas and reports SecurityAllowed=False. +func TestSecuritySettings_OffHoldsStoppedServer(t *testing.T) { + values := []struct { + name string + value *string + }{ + {name: "absent", value: nil}, + {name: "false", value: strPtrSecSettings("false")}, + {name: "garbage", value: strPtrSecSettings("yes")}, + } + for _, tc := range values { + t.Run(tc.name, func(t *testing.T) { + ns := newNamespace(t) + if tc.value != nil { + secSettingsWriteConfigMap(t, ns, *tc.value) + } + startMgr(t, ns, withGameServerReconcilerControlPlane(t, ns)) + tmplName := secSettingsCreateTemplate(t) + + if err := k8sClient.Create(context.Background(), secSettingsRootServer(ns, "held", tmplName)); err != nil { + t.Fatalf("create gameserver: %v", err) + } + + eventually(t, func() (bool, string) { + c := secSettingsCondition(t, ns, "held") + if c == nil { + return false, "no SecurityAllowed condition yet" + } + if c.Status != metav1.ConditionFalse || c.Reason != gameplanev1alpha1.GameServerReasonRootOverrideDisallowed { + return false, "condition " + string(c.Status) + "/" + c.Reason + } + if !strings.Contains(c.Message, "runAsUser") { + return false, "message does not name runAsUser: " + c.Message + } + return true, "" + }) + eventually(t, func() (bool, string) { + if r := secSettingsReplicas(t, ns, "held"); r != 0 { + return false, "replicas not yet zero" + } + return true, "" + }) + consistently(t, defaultEventuallyInterval*5, func() (bool, string) { + if r := secSettingsReplicas(t, ns, "held"); r != 0 { + return false, "replicas rose above zero" + } + return true, "" + }) + }) + } +} + +// TestSecuritySettings_FlipOnStartsHeldServer: a held stopped server starts as +// soon as the ConfigMap flips to "true", with no other change to the server. +func TestSecuritySettings_FlipOnStartsHeldServer(t *testing.T) { + ns := newNamespace(t) + secSettingsWriteConfigMap(t, ns, "false") + startMgr(t, ns, withGameServerReconcilerControlPlane(t, ns)) + tmplName := secSettingsCreateTemplate(t) + + if err := k8sClient.Create(context.Background(), secSettingsRootServer(ns, "held", tmplName)); err != nil { + t.Fatalf("create gameserver: %v", err) + } + eventually(t, func() (bool, string) { + if r := secSettingsReplicas(t, ns, "held"); r != 0 { + return false, "replicas not yet zero" + } + return true, "" + }) + + secSettingsWriteConfigMap(t, ns, "true") + + eventually(t, func() (bool, string) { + if r := secSettingsReplicas(t, ns, "held"); r != 1 { + return false, "replicas not yet one" + } + c := secSettingsCondition(t, ns, "held") + if c == nil || c.Status != metav1.ConditionTrue || c.Reason != securityConditionReasonAllowed { + return false, "condition not yet True/RootOverrideAllowed" + } + return true, "" + }) +} + +// TestSecuritySettings_FlipOffKeepsRunningServer: flipping the setting off never +// stops a running server. It keeps its StatefulSet at one replica and gets only +// the informational condition. +func TestSecuritySettings_FlipOffKeepsRunningServer(t *testing.T) { + ns := newNamespace(t) + secSettingsWriteConfigMap(t, ns, "true") + startMgr(t, ns, withGameServerReconcilerControlPlane(t, ns)) + tmplName := secSettingsCreateTemplate(t) + + if err := k8sClient.Create(context.Background(), secSettingsRootServer(ns, "live", tmplName)); err != nil { + t.Fatalf("create gameserver: %v", err) + } + eventually(t, func() (bool, string) { + if r := secSettingsReplicas(t, ns, "live"); r != 1 { + return false, "replicas not yet one" + } + return true, "" + }) + uidBefore := secSettingsStatefulSet(t, ns, "live").UID + + secSettingsWriteConfigMap(t, ns, "false") + + eventually(t, func() (bool, string) { + c := secSettingsCondition(t, ns, "live") + if c == nil || c.Status != metav1.ConditionFalse { + return false, "condition not yet False" + } + if !strings.Contains(c.Message, "keeps running") { + return false, "running message missing: " + c.Message + } + return true, "" + }) + consistently(t, defaultEventuallyInterval*5, func() (bool, string) { + ss := secSettingsStatefulSet(t, ns, "live") + if ss == nil || ss.Spec.Replicas == nil || *ss.Spec.Replicas != 1 { + return false, "running server was scaled" + } + if ss.UID != uidBefore { + return false, "statefulset was recreated" + } + return true, "" + }) +} + +// TestSecuritySettings_ClearingOverrideStartsHeldServer: removing the root +// override starts the held server even while the setting stays off, and the +// condition moves to True with reason NoRootOverride. +func TestSecuritySettings_ClearingOverrideStartsHeldServer(t *testing.T) { + ns := newNamespace(t) + secSettingsWriteConfigMap(t, ns, "false") + startMgr(t, ns, withGameServerReconcilerControlPlane(t, ns)) + tmplName := secSettingsCreateTemplate(t) + + if err := k8sClient.Create(context.Background(), secSettingsRootServer(ns, "held", tmplName)); err != nil { + t.Fatalf("create gameserver: %v", err) + } + eventually(t, func() (bool, string) { + c := secSettingsCondition(t, ns, "held") + if c == nil || c.Status != metav1.ConditionFalse { + return false, "condition not yet False" + } + return true, "" + }) + + err := retry.RetryOnConflict(retry.DefaultRetry, func() error { + gs := getGameServer(t, ns, "held") + gs.Spec.Security = nil + return k8sClient.Update(context.Background(), gs) + }) + if err != nil { + t.Fatalf("clear override: %v", err) + } + + eventually(t, func() (bool, string) { + if r := secSettingsReplicas(t, ns, "held"); r != 1 { + return false, "replicas not yet one" + } + c := secSettingsCondition(t, ns, "held") + if c == nil || c.Status != metav1.ConditionTrue || c.Reason != securityConditionReasonNoOverride { + return false, "condition not yet True/NoRootOverride" + } + return true, "" + }) +} + +// strPtrSecSettings returns a pointer to s for the table cases above. +func strPtrSecSettings(s string) *string { + return &s +} diff --git a/operator/internal/controller/security_settings_test.go b/operator/internal/controller/security_settings_test.go new file mode 100644 index 000000000..7b11bb0c9 --- /dev/null +++ b/operator/internal/controller/security_settings_test.go @@ -0,0 +1,221 @@ +package controller + +import ( + "context" + "sort" + "testing" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + + gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" +) + +// secSettingsInt64 returns a pointer to v. Shared by the spec 030 settings +// tests in this package, including the envtest files. +func secSettingsInt64(v int64) *int64 { + return &v +} + +// secSettingsBool returns a pointer to v for the security settings tests. +func secSettingsBool(v bool) *bool { + return &v +} + +func TestSecuritySettingsAllowRoot_OnlyExactTrue(t *testing.T) { + cases := []struct { + name string + cm *corev1.ConfigMap + want bool + }{ + {name: "nil configmap", cm: nil, want: false}, + {name: "missing key", cm: &corev1.ConfigMap{}, want: false}, + {name: "empty value", cm: &corev1.ConfigMap{Data: map[string]string{"allowRootOverrides": ""}}, want: false}, + {name: "false", cm: &corev1.ConfigMap{Data: map[string]string{"allowRootOverrides": "false"}}, want: false}, + {name: "capitalised True", cm: &corev1.ConfigMap{Data: map[string]string{"allowRootOverrides": "True"}}, want: false}, + {name: "one", cm: &corev1.ConfigMap{Data: map[string]string{"allowRootOverrides": "1"}}, want: false}, + {name: "padded true", cm: &corev1.ConfigMap{Data: map[string]string{"allowRootOverrides": " true"}}, want: false}, + {name: "garbage", cm: &corev1.ConfigMap{Data: map[string]string{"allowRootOverrides": "yes please"}}, want: false}, + {name: "exact true", cm: &corev1.ConfigMap{Data: map[string]string{"allowRootOverrides": "true"}}, want: true}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + if got := securitySettingsAllowRoot(tc.cm); got != tc.want { + t.Fatalf("securitySettingsAllowRoot = %v, want %v", got, tc.want) + } + }) + } +} + +func TestRootOverrideSettings_RuleTable(t *testing.T) { + cases := []struct { + name string + sec *gameplanev1alpha1.GameServerSecuritySpec + want []string + }{ + {name: "no security block", sec: nil, want: nil}, + {name: "empty security block", sec: &gameplanev1alpha1.GameServerSecuritySpec{}, want: nil}, + { + name: "runAsUser zero is root", + sec: &gameplanev1alpha1.GameServerSecuritySpec{RunAsUser: &gameplanev1alpha1.SecurityIDOverride{Value: secSettingsInt64(0)}}, + want: []string{"runAsUser"}, + }, + { + name: "runAsGroup zero is root", + sec: &gameplanev1alpha1.GameServerSecuritySpec{RunAsGroup: &gameplanev1alpha1.SecurityIDOverride{Value: secSettingsInt64(0)}}, + want: []string{"runAsGroup"}, + }, + { + name: "runAsUser useImageDefault may be root", + sec: &gameplanev1alpha1.GameServerSecuritySpec{RunAsUser: &gameplanev1alpha1.SecurityIDOverride{UseImageDefault: secSettingsBool(true)}}, + want: []string{"runAsUser"}, + }, + { + name: "runAsGroup useImageDefault may be root", + sec: &gameplanev1alpha1.GameServerSecuritySpec{RunAsGroup: &gameplanev1alpha1.SecurityIDOverride{UseImageDefault: secSettingsBool(true)}}, + want: []string{"runAsGroup"}, + }, + { + name: "fsGroup zero is root", + sec: &gameplanev1alpha1.GameServerSecuritySpec{FSGroup: &gameplanev1alpha1.SecurityIDOverride{Value: secSettingsInt64(0)}}, + want: []string{"fsGroup"}, + }, + { + name: "fsGroup useImageDefault is not a root rule", + sec: &gameplanev1alpha1.GameServerSecuritySpec{FSGroup: &gameplanev1alpha1.SecurityIDOverride{UseImageDefault: secSettingsBool(true)}}, + want: nil, + }, + { + name: "non-root values are not named", + sec: &gameplanev1alpha1.GameServerSecuritySpec{ + RunAsUser: &gameplanev1alpha1.SecurityIDOverride{Value: secSettingsInt64(1000)}, + RunAsGroup: &gameplanev1alpha1.SecurityIDOverride{Value: secSettingsInt64(1000)}, + FSGroup: &gameplanev1alpha1.SecurityIDOverride{Value: secSettingsInt64(2000)}, + }, + want: nil, + }, + { + name: "useImageDefault false is not an override", + sec: &gameplanev1alpha1.GameServerSecuritySpec{RunAsUser: &gameplanev1alpha1.SecurityIDOverride{UseImageDefault: secSettingsBool(false)}}, + want: nil, + }, + { + name: "all three in spec order", + sec: &gameplanev1alpha1.GameServerSecuritySpec{ + FSGroup: &gameplanev1alpha1.SecurityIDOverride{Value: secSettingsInt64(0)}, + RunAsGroup: &gameplanev1alpha1.SecurityIDOverride{Value: secSettingsInt64(0)}, + RunAsUser: &gameplanev1alpha1.SecurityIDOverride{Value: secSettingsInt64(0)}, + }, + want: []string{"runAsUser", "runAsGroup", "fsGroup"}, + }, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + gs := &gameplanev1alpha1.GameServer{Spec: gameplanev1alpha1.GameServerSpec{Security: tc.sec}} + got := rootOverrideSettings(gs) + if len(got) != len(tc.want) { + t.Fatalf("rootOverrideSettings = %v, want %v", got, tc.want) + } + for i := range got { + if got[i] != tc.want[i] { + t.Fatalf("rootOverrideSettings = %v, want %v", got, tc.want) + } + } + if hasRootOverride(gs) != (len(tc.want) > 0) { + t.Fatalf("hasRootOverride = %v, want %v", hasRootOverride(gs), len(tc.want) > 0) + } + }) + } + if rootOverrideSettings(nil) != nil || hasRootOverride(nil) { + t.Fatal("nil server must not hold a root override") + } +} + +func TestRootOverridesAllowed_ConfigMapReader(t *testing.T) { + const cpNS = "gameplane-cp" + cmWith := func(ns string, data map[string]string) *corev1.ConfigMap { + return &corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{Name: securitySettingsConfigMapName, Namespace: ns}, + Data: data, + } + } + cases := []struct { + name string + cpNS string + objs []*corev1.ConfigMap + want bool + }{ + {name: "no control-plane namespace is off even with a true ConfigMap", cpNS: "", objs: []*corev1.ConfigMap{cmWith(cpNS, map[string]string{"allowRootOverrides": "true"})}, want: false}, + {name: "absent ConfigMap is off", cpNS: cpNS, objs: nil, want: false}, + {name: "missing key is off", cpNS: cpNS, objs: []*corev1.ConfigMap{cmWith(cpNS, map[string]string{"other": "true"})}, want: false}, + {name: "false is off", cpNS: cpNS, objs: []*corev1.ConfigMap{cmWith(cpNS, map[string]string{"allowRootOverrides": "false"})}, want: false}, + {name: "garbage is off", cpNS: cpNS, objs: []*corev1.ConfigMap{cmWith(cpNS, map[string]string{"allowRootOverrides": "maybe"})}, want: false}, + {name: "true is on", cpNS: cpNS, objs: []*corev1.ConfigMap{cmWith(cpNS, map[string]string{"allowRootOverrides": "true"})}, want: true}, + {name: "true in another namespace is ignored", cpNS: cpNS, objs: []*corev1.ConfigMap{cmWith("elsewhere", map[string]string{"allowRootOverrides": "true"})}, want: false}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + b := fake.NewClientBuilder().WithScheme(testScheme(t)) + for _, cm := range tc.objs { + b = b.WithObjects(cm) + } + r := &GameServerReconciler{Client: b.Build(), ControlPlaneNamespace: tc.cpNS} + if got := r.rootOverridesAllowed(context.Background()); got != tc.want { + t.Fatalf("rootOverridesAllowed = %v, want %v", got, tc.want) + } + }) + } +} + +func TestMapSecuritySettingsToGameServers_OnlyHeldSettingsChange(t *testing.T) { + const cpNS = "gameplane-cp" + root := &gameplanev1alpha1.GameServerSecuritySpec{RunAsUser: &gameplanev1alpha1.SecurityIDOverride{Value: secSettingsInt64(0)}} + servers := []*gameplanev1alpha1.GameServer{ + {ObjectMeta: metav1.ObjectMeta{Name: "held", Namespace: "games"}, Spec: gameplanev1alpha1.GameServerSpec{Security: root}}, + {ObjectMeta: metav1.ObjectMeta{Name: "plain", Namespace: "games"}}, + {ObjectMeta: metav1.ObjectMeta{Name: "held-elsewhere", Namespace: "other"}, Spec: gameplanev1alpha1.GameServerSpec{Security: root}}, + } + s := testScheme(t) + b := fake.NewClientBuilder().WithScheme(s) + for _, gs := range servers { + b = b.WithObjects(gs) + } + r := &GameServerReconciler{Client: b.Build(), ControlPlaneNamespace: cpNS} + + settings := func(ns, name string) *corev1.ConfigMap { + return &corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Name: name, Namespace: ns}} + } + cases := []struct { + name string + obj *corev1.ConfigMap + want []string + }{ + {name: "settings ConfigMap enqueues only servers that save a root override", obj: settings(cpNS, securitySettingsConfigMapName), want: []string{"games/held", "other/held-elsewhere"}}, + {name: "other ConfigMap name is ignored", obj: settings(cpNS, "something-else"), want: nil}, + {name: "same name outside the control-plane namespace is ignored", obj: settings("games", securitySettingsConfigMapName), want: nil}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + reqs := r.mapSecuritySettingsToGameServers(context.Background(), tc.obj) + var got []string + for _, req := range reqs { + got = append(got, req.Namespace+"/"+req.Name) + } + sort.Strings(got) + if len(got) != len(tc.want) { + t.Fatalf("enqueued %v, want %v", got, tc.want) + } + for i := range got { + if got[i] != tc.want[i] { + t.Fatalf("enqueued %v, want %v", got, tc.want) + } + } + }) + } + + unset := &GameServerReconciler{Client: r.Client} + if reqs := unset.mapSecuritySettingsToGameServers(context.Background(), settings(cpNS, securitySettingsConfigMapName)); len(reqs) != 0 { + t.Fatalf("empty ControlPlaneNamespace must enqueue nothing, got %d", len(reqs)) + } +} diff --git a/operator/internal/controller/suite_envtest_test.go b/operator/internal/controller/suite_envtest_test.go index f7a012985..a77ab520b 100644 --- a/operator/internal/controller/suite_envtest_test.go +++ b/operator/internal/controller/suite_envtest_test.go @@ -49,6 +49,10 @@ func TestMain(m *testing.M) { }, ErrorIfCRDPathMissing: true, } + // Namespaces are never deleted in envtest (no namespace controller), so + // every Service the suite creates keeps its ClusterIP. The default /24 + // range runs out once the suite passes ~250 Services; a /16 leaves room. + testEnv.ControlPlane.GetAPIServer().Configure().Set("service-cluster-ip-range", "10.0.0.0/16") var err error cfg, err = testEnv.Start() diff --git a/operator/internal/controller/workload_security.go b/operator/internal/controller/workload_security.go index d1471444c..42c9fc3b9 100644 --- a/operator/internal/controller/workload_security.go +++ b/operator/internal/controller/workload_security.go @@ -1,7 +1,7 @@ package controller import ( - "fmt" + "errors" gameplanev1alpha1 "github.com/GameplanePanel/gameplane/operator/api/v1alpha1" corev1 "k8s.io/api/core/v1" @@ -10,23 +10,37 @@ import ( const agentTokenVolumeName = "agent-api-token" const workloadSecurityLabel = "gameplane.local/workload-security" +// restrictedIdentityMessage is the failure reported for a restricted server +// whose effective identity is not usable (OD-5 A: validation uses the effective +// values, so an override is refused by the same rule as a template default). +const restrictedIdentityMessage = "restricted workload requires template security.runAsUser and security.fsGroup greater than zero, and a positive security.runAsGroup when specified; use an image compatible with that identity" + // Images must declare their compatible numeric identity; guessing from an // image name or trusting an unknown image USER only moves failure to kubelet. func validateRestrictedTemplate(tmpl *gameplanev1alpha1.GameTemplate) error { - sec := tmpl.Spec.Security - if sec == nil || sec.RunAsUser == nil || *sec.RunAsUser <= 0 || sec.FSGroup == nil || *sec.FSGroup <= 0 || (sec.RunAsGroup != nil && *sec.RunAsGroup <= 0) { - return fmt.Errorf("restricted workload requires template security.runAsUser and security.fsGroup greater than zero, and a positive security.runAsGroup when specified; use an image compatible with that identity") + return validateRestrictedSecurity(resolveGameSecurity(tmpl, nil)) +} + +// validateRestrictedSecurity applies the restricted identity rule to the +// effective values of one server. An absent or "use image default" run-as user +// and filesystem group are refused, because restricted mode needs both. An +// absent group is allowed and falls back to the filesystem group. +func validateRestrictedSecurity(sec resolvedGameSecurity) error { + if sec.RunAsUser.Value == nil || *sec.RunAsUser.Value <= 0 || + sec.FSGroup.Value == nil || *sec.FSGroup.Value <= 0 || + (sec.RunAsGroup.Value != nil && *sec.RunAsGroup.Value <= 0) { + return errors.New(restrictedIdentityMessage) } return nil } -func restrictedContainerSecurity(tmpl *gameplanev1alpha1.GameTemplate) *corev1.SecurityContext { - group := tmpl.Spec.Security.RunAsGroup +func restrictedContainerSecurity(sec resolvedGameSecurity) *corev1.SecurityContext { + group := sec.RunAsGroup.Value if group == nil { - group = tmpl.Spec.Security.FSGroup + group = sec.FSGroup.Value } return &corev1.SecurityContext{ - RunAsUser: tmpl.Spec.Security.RunAsUser, RunAsGroup: group, + RunAsUser: sec.RunAsUser.Value, RunAsGroup: group, RunAsNonRoot: ptrTo(true), AllowPrivilegeEscalation: ptrTo(false), Capabilities: &corev1.Capabilities{Drop: []corev1.Capability{"ALL"}}, SeccompProfile: &corev1.SeccompProfile{Type: corev1.SeccompProfileTypeRuntimeDefault}, @@ -37,6 +51,13 @@ func restrictedContainerSecurity(tmpl *gameplanev1alpha1.GameTemplate) *corev1.S // remains intentional for metrics: this is mount isolation, not a hard trust // boundary against a process that can inspect another process through /proc. func applyWorkloadSecurity(pod *corev1.PodSpec, tmpl *gameplanev1alpha1.GameTemplate, restricted bool, expirationSeconds int64) { + applyWorkloadSecurityResolved(pod, resolveGameSecurity(tmpl, nil), restricted, expirationSeconds) +} + +// applyWorkloadSecurityResolved is applyWorkloadSecurity with the effective +// values of one server. Restricted mode takes its identity from sec, so a +// server override reaches the game and init containers (OD-5 A). +func applyWorkloadSecurityResolved(pod *corev1.PodSpec, sec resolvedGameSecurity, restricted bool, expirationSeconds int64) { if expirationSeconds < 600 || expirationSeconds > 3600 { expirationSeconds = 3600 } @@ -54,14 +75,14 @@ func applyWorkloadSecurity(pod *corev1.PodSpec, tmpl *gameplanev1alpha1.GameTemp c.VolumeMounts = append(c.VolumeMounts, corev1.VolumeMount{Name: agentTokenVolumeName, MountPath: "/var/run/secrets/kubernetes.io/serviceaccount", ReadOnly: true}) } if restricted && c.Name == "game" { - c.SecurityContext = restrictedContainerSecurity(tmpl) + c.SecurityContext = restrictedContainerSecurity(sec) } } if restricted { pod.SecurityContext.RunAsNonRoot = ptrTo(true) pod.SecurityContext.SeccompProfile = &corev1.SeccompProfile{Type: corev1.SeccompProfileTypeRuntimeDefault} for i := range pod.InitContainers { - pod.InitContainers[i].SecurityContext = restrictedContainerSecurity(tmpl) + pod.InitContainers[i].SecurityContext = restrictedContainerSecurity(sec) } } } diff --git a/operator/specs.md b/operator/specs.md index a9edd62e2..44bd0e316 100644 --- a/operator/specs.md +++ b/operator/specs.md @@ -717,6 +717,12 @@ until cancellation or replacement because it may have partially cleared data. - **gameserver_condition_args.go:** `deriveConditionArgs` rebuilds `status.conditionArgs` from the final GameServer conditions on every `reconcileStatus` pass (the values each reason's English message interpolates); `setConditionArgs` maintains the entries written out of band; `provisioningArgs` reads the pod's container states for CrashLoopBackOff and ContainerExited. - **hack/condition-ids (generator):** `go run ./hack/condition-ids -app ../i18n/locales/en/app.json` writes every `condition..` id from its table into the English reference (`make i18n-sync`); `-check` (run by `make check-i18n`) reports drift and exits 1. Its coverage guard parses the non-test controller sources with `go/parser` and fails when a reason literal they set has no table entry, or when a non-dynamic table reason is set nowhere; it reports the mismatch rather than editing the table. Rows marked dynamic (Backup `Pending`/`Running`, which come from the phase string) are exempt from the second check. +### Security overrides and the root hold + +`security_overrides.go` resolves `GameServer.spec.security` over the template's `spec.security` into the desired values (`status.security.desired`) and encodes them on the pod: game container `runAsUser`/`runAsGroup`, pod `fsGroup`, and pod `fsGroupChangePolicy` (`Always` for `EveryStart`, `OnRootMismatch` for `OnlyWhenWrong`) only when `fsGroup` applies. The applied values are read back from the annotation `gameplane.local/security-applied-observed`, which the reconciler copies from the pod template once the pod's volumes are set up. `status.security.pending` is true when applied and desired differ. Overrides take effect at the next start: `baselineRenderInputs` (`gameserver_template_revision.go`) excludes `spec.security`, so saving an override never rewrites a running pod, and a template rollout on a suspended or sleeping server refreshes the values at its next start. + +The root hold is decided in `security_settings.go`. The operator reads the ConfigMap `gameplane-security-settings` (key `allowRootOverrides`) in `GameServerReconciler.ControlPlaneNamespace`, set from `--control-plane-namespace`. The read is from the informer cache and fails closed: an empty namespace, a missing ConfigMap or key, or any value other than `"true"` means off. A map function on the ConfigMap watch re-reconciles the servers that hold root overrides when the value changes. While the setting is off, a stopped server holding a root override keeps zero replicas and gets condition `SecurityAllowed=False` with reason `RootOverrideDisallowed`. The hold is checked before `reserveWakeStart` in `gameserver_idle.go`, so a held server takes no wake slot. A running server is not touched. The operator only reads the ConfigMap. Helm creates it and the API updates it. + ## External interface / contracts ### Entry point: `cmd/main.go` @@ -874,6 +880,8 @@ Forgetting codegen leaves the YAML out of sync with types — CI's `make manifes 7. **Finalizers:** Controllers use ownership and finalizers to ensure cleanup (e.g., Module deletion cascades to GameTemplate; a quiesced Backup's `gameplane.local/backup-finalizer` blocks deletion until the matching unquiesce is sent, so `kubectl delete` can't drop it and leave the game with auto-save off; associated Jobs are reclaimed via ownerReference GC, not a finalizer). +8. **Root hold and security overrides:** A root value (`runAsUser` or `runAsGroup` of 0 or the image default, `fsGroup` of 0) does not start while the cluster's `allowRootOverrides` is off, and the reconciler fails closed on any unreadable or unexpected value. Under `--restricted-workloads`, the effective (desired) values are validated, not the template alone. Backup and restore Jobs take their pod `fsGroup` from the applied value, never from desired. + ## Testing & coverage **Envtest tier (controller-runtime envtest, real Kubernetes API):** Co-located `*_envtest_test.go` files in `operator/internal/controller/`. Tests create CRs, advance reconcilers, assert status fields and child objects. Covers controller logic without kind-cluster overhead. diff --git a/specs/030-security-context-overrides/OPEN-DECISIONS.md b/specs/030-security-context-overrides/OPEN-DECISIONS.md index 5d50ac0f7..a47cc31f6 100644 --- a/specs/030-security-context-overrides/OPEN-DECISIONS.md +++ b/specs/030-security-context-overrides/OPEN-DECISIONS.md @@ -1,6 +1,6 @@ # Open decisions: spec 030 security context overrides -OD-1..OD-3 were answered by valgul on 2026-11-07, OD-4..OD-6 on 2026-11-13. All are settled. +OD-1..OD-3 were answered by valgul on 2026-11-07, OD-4..OD-6 on 2026-11-13. OD-7..OD-9 were raised by the implementation scout on 2026-11-15 and were all answered by valgul the same day. OD-10 was raised the same day and answered by valgul on 2026-11-15 (A). OD-1 to OD-10 are all answered; none is open. ## OD-1: Who may set security overrides? (SETTLED: B) @@ -111,3 +111,55 @@ but a direct API call has no dialog. Plan impact if the ruling differs: B adds a template read to the create and update handlers and one error code; C adds one word to the audit reason. + +--- + +The decisions below were raised by the implementation scout (T001, briefs in `briefs/`) on 2026-11-15. All three are settled. + +## OD-7: How does the root setting reach remote clusters? (SETTLED: C) + +**Ruling (valgul, 2026-11-15):** C, a separate setting per cluster, set under Clusters, cluster, Configuration (like backup destinations), stored and mirrored per cluster. + +The operator on each cluster must know `allowRootOverrides` (FR-005a), through the ConfigMap `gameplane-security-settings` (R9). The home cluster is covered. For a remote cluster (operator plus gateway install, registered by kubeconfig), nothing defines the namespace or the RBAC the central API would need to write the ConfigMap there (`briefs/03-api.md` D16). + +- A. The central API writes the ConfigMap into every registered cluster. The remote chart grants the API's remote identity `get`/`update`/`patch` on that one ConfigMap in its control-plane namespace. A cluster the API cannot write to stays off (fail closed). (Recommended: one panel-wide setting, the same everywhere; fail closed keeps it safe while a remote cluster lags.) +- B. Home cluster only for now: remote clusters always read the setting as off, so root overrides never start there; a later spec adds remote propagation. +- C. A separate setting per cluster, set under Clusters, cluster, Configuration (like backup destinations since v0.4.0), stored and mirrored per cluster. + +## OD-8: Who creates the settings ConfigMap? (SETTLED: A) + +**Ruling (valgul, 2026-11-15):** A, Helm creates the ConfigMap with `"false"`, keeps it on uninstall and keeps its value on upgrade; the API only reads and updates it by name; a deleted ConfigMap reads as off until the next `helm upgrade`. + +Kubernetes RBAC cannot limit `create` to one object name (`resourceNames` does not apply to `create`). The contract has the API create the ConfigMap, which would need `create` on every ConfigMap in the credentials namespace. Today the API has that only when the catalog admin option is on (`charts/gameplane/templates/api-credentials.yaml`; `briefs/04-chart-e2e-gpmodule-docs.md` discrepancy 2). + +- A. Helm creates the ConfigMap with `"false"`, keeps it on uninstall, and keeps its current value on upgrade. The API only reads and updates it by name. If someone deletes it, the setting reads as off until the next `helm upgrade` recreates it. (Recommended: the narrowest grant, and deletion still fails closed.) +- B. The API creates it, and the chart grants the API `create` on all ConfigMaps in the credentials namespace. + +## OD-9: Accept the scout's spec corrections? (SETTLED: A) + +The scout found places where the spec text does not match the code. The behavior changes only in item 1. The other items align the tasks with the contracts and the code. + +**Ruling (valgul, 2026-11-15):** A, accept all seven. Item 1 means an empty body returns 400 `server.empty_body`. The other items are applied as written; `briefs/00-rulings.md` section 6 says how each one is applied. + +1. An empty `PUT /admin/config/security` body returns 400 `server.empty_body`, like every other config section (`config.go:126-129`). The contract says 422. +2. New tests go in new files, and existing call sites keep compiling through optional parameters, so no existing test file is edited. Examples: `gameserver_security_test.go` already exists with unrelated tests, and about 20 test call sites use the builder signatures. +3. Clone writes the security audit row too, as `contracts/audit-events.md` says (T059 named only create and update). +4. A sleeping server held back by the root rule does not take a wake-start slot (the hold is checked before `reserveWakeStart`). +5. T044: a template rollout on a suspended or sleeping server refreshes the security values at its next start, not at the rollout. This matches FR-008. +6. The template baseline hash (`baselineRenderInputs`) excludes `spec.security`, so saving an override never rewrites a running pod (FR-008). +7. The stale `file:line` citations in the spec are superseded by the briefs. + +- A. Accept all seven. +- B. Discuss some items first. + +--- + +## OD-10: How does the API find the settings ConfigMap on a remote cluster? (SETTLED: A) + +**Ruling (valgul, 2026-11-15):** A, the cluster registration records it: a new optional field on the Cluster object, `spec.controlPlaneNamespace`, defaulting to `gameplane`, set in the register-cluster form and shown on the cluster page. + +Raised 2026-11-15 while applying OD-7. On a remote operator install the ConfigMap lives in that install's control-plane namespace, which defaults to the remote release namespace (`charts/gameplane/templates/_helpers.tpl:220-225`) and can differ per cluster. The Cluster registration (`operator/api/v1alpha1/cluster_types.go`) holds only the kubeconfig Secret and the agent gateway, so the API cannot know that namespace today. The home cluster is not affected. + +- A. The cluster registration records it: a new optional field on the Cluster object, `spec.controlPlaneNamespace`, defaulting to `gameplane`, set in the register-cluster form and shown on the cluster page. (Recommended: explicit, needs no extra permission on the remote cluster, and a wrong value only means the panel shows the setting as missing.) +- B. Every install puts the ConfigMap in one fixed namespace name on every cluster, regardless of release namespace. +- C. The API looks it up by label on each remote cluster, which needs permission to list ConfigMaps in all namespaces there. diff --git a/specs/030-security-context-overrides/briefs/00-rulings.md b/specs/030-security-context-overrides/briefs/00-rulings.md new file mode 100644 index 000000000..f1d9940ea --- /dev/null +++ b/specs/030-security-context-overrides/briefs/00-rulings.md @@ -0,0 +1,162 @@ +# Brief 00: binding rulings (read this first) + +**Status**: binding for every fix agent. Written 2026-11-15, after valgul settled OD-7 (C), OD-8 (A), OD-9 (A, all seven items) and OD-10 (A) in [OPEN-DECISIONS.md](../OPEN-DECISIONS.md). + +Read this file before briefs 01 to 04. Where this file and an earlier brief disagree, this file wins. Briefs 01 to 04 stay valid for their facts (exact `file:line` after the corrections in their own discrepancy lists). Their design statements listed in section 10 are superseded. Do not edit the briefs; do not edit any existing test file. + +--- + +## 1. The root setting: per cluster, one ConfigMap, no config row (OD-7 C) + +- "Allow root overrides" is a separate setting for each cluster. It is off by default. +- Its only store is the ConfigMap `gameplane-security-settings`, key `allowRootOverrides`, value `"true"` or `"false"`. The ConfigMap lives in that cluster's operator control-plane namespace, which is the operator's `--control-plane-namespace` (the chart's `gameplane.operatorClusterCredentialsNamespace` helper). On a default install with the API enabled that is the credentials namespace `-credentials`. In standalone or no-API mode it is the release namespace. +- Missing ConfigMap, missing key, or any value other than exact `"true"` reads as off (fail closed). +- Removed everywhere: the config-table row, a `security` section in `newValidators`, `PUT /admin/config/security`, the API start-up sync, and `api/internal/handlers/security_settings_sync.go`. +- Set in the dashboard under Clusters, cluster, Configuration (a "Security" panel), not in Admin Settings. + +## 2. Routes, validation and RBAC (API) + +- Routes: `GET /security-settings?cluster=` and `PUT /security-settings?cluster=`. The cluster is chosen with `resolveCluster` (`api/internal/handlers/resources.go:113`), the same way `/backup-destinations` does it. +- PUT body: `{"allowRootOverrides": bool}`. + - Empty body: 400 `server.empty_body` (OD-9 item 1; the same as every config section, `config.go:126-129`). + - Invalid JSON, or a non-boolean value: 422. +- Permission: a new rule-table entry in `api/internal/rbac/rbac.go`, placed next to the `/admin/config` rules (`:209` is GET `config:read`, `:214` is `config:manage`). PUT needs `config:manage`. GET needs `config:read`. Copy the shape of the neighbouring rules. +- GET 200 body: `{"cluster": "", "allowRootOverrides": bool, "present": bool}`. + - ConfigMap NotFound: `allowRootOverrides` false, `present` false. + - Any other read error: 502. +- PUT 200 body: the GET body, with `present` true. +- PUT order: + 1. Read the ConfigMap. NotFound: 409 `server.cluster.security_settings_missing`, no audit row (nothing was attempted). + 2. Value unchanged: 200, nothing written, no audit row. + 3. Value changes: write the flip audit row first (section 5), then update the ConfigMap. Never create it. + 4. Update fails: 502, and a `security_save_failed` row (section 5). +- Messages (`api/internal/messages/`, cluster entries, with en and fr keys per FR-014): + - `server.cluster.security_settings_missing`, 409, English: "the security settings ConfigMap is missing on this cluster; run helm upgrade to recreate it". + - `server.security.root_disabled` text now says the administrator allows root overrides "in that cluster's Configuration" (see `contracts/api-server-security.md`). +- Files: new production file `api/internal/handlers/security_settings.go` with `MountSecuritySettings(r chi.Router, reg *kube.Registry, auditor *audit.Auditor)`, mounted from `api/cmd/main.go`. Route rules and envtests use dedicated routers, never `mountedR`. +- The server root rule (case 5) lives in `api/internal/handlers/security_overrides.go` (renamed from `resources_security.go`). It reads the ConfigMap of the request's own cluster through that cluster's registry client (`resolveCluster`), and only for a request that carries a new or changed root value. Any read error or any value other than exact `"true"` is off, so the request is refused. The rule no longer reads the config store, so `MountResources` needs no `*db.Store` for it. It still takes the auditor. + +## 3. Operator (OD-7; research R9, unchanged in substance) + +- Informer cache, fail closed, `Watches` with a map function, condition `SecurityAllowed` with reason `RootOverrideDisallowed`: all unchanged from R9. +- New field on `GameServerReconciler`: `ControlPlaneNamespace string`, set in `operator/cmd/main.go` from the `controlPlaneNamespace` variable (brief 02 D7). Do not use `WakeStartNamespace`. An empty value means off, so the 159 existing constructions keep working. +- Production files: + - `operator/internal/controller/security_overrides.go`: resolver, pod encoding, annotation codec, applied reader. Replaces the planned `gameserver_security.go`. + - `operator/internal/controller/security_settings.go`: ConfigMap reader, `hasRootOverride`, `rootOverrideSettings`, map function. +- Hold position: before `reserveWakeStart` (section 6, item 4) and before the R5 refresh (brief 01 section 3.1). + +## 4. Helm and chart RBAC (OD-8 A) + +- The operator chart creates the ConfigMap `gameplane-security-settings` in the operator's control-plane namespace, wherever the operator chart renders (home install and remote operator installs). Data `allowRootOverrides: "false"`. Annotation `helm.sh/resource-policy: keep`, so uninstall keeps it. +- On upgrade the template reads the current object with Helm `lookup` and re-renders its current value, so an upgrade never flips it. When `lookup` finds nothing (first install, or the object was deleted), the value renders as `"false"`. Shape to verify with `helm template`: read `allowRootOverrides` from the looked-up `data` when the key exists, else `"false"`. +- Home cluster API grant: add a rule to the existing Role in `charts/gameplane/templates/api-credentials.yaml` (the credentials namespace, `:14-37`): + + ```yaml + - apiGroups: [""] + resources: [configmaps] + resourceNames: [gameplane-security-settings] + verbs: [get, update, patch] + ``` + + No `create` verb. Kubernetes does not apply `resourceNames` to `create`, so the old `create` placeholder in brief 04 T058 is dropped. +- Standalone: no Role and no ConfigMap (corrected 2026-11-16, valgul approved: a standalone panel has no local operator and mounts no service account token, so it renders neither the ConfigMap nor an API Role for it; `charts/tests/check_standalone.py` asserts it renders no Roles). +- Remote clusters: the remote chart grants the identity the API uses for that cluster the same three verbs on the same ConfigMap, in the control-plane namespace recorded on that cluster's registration (`Cluster.spec.controlPlaneNamespace`, section 12) (task T076). The identity must be found in the chart. Do not guess (section 7). +- A deleted ConfigMap reads as off until the next `helm upgrade` renders it again as `"false"`. + +## 5. Audit (contracts/audit-events.md) + +- Flip row: `method` PUT, `path` `/security-settings`, `target` `security/`, `status` 200, `reason` `allowRootOverrides:false->true` (or `true->false`). +- Written with `Auditor.WriteSync` before the ConfigMap update. If `WriteSync` fails: 500, nothing changes. If the update then fails: a second row, `reason` `security_save_failed`, and the 502 response. +- Override rows (create, update, clone, refusals) are unchanged from `contracts/audit-events.md`, written from `security_overrides.go`. +- This supersedes the `config.go:175-178` row pattern and brief 03 T056 (`target` `security`, route `/admin/config/security`). + +## 6. OD-9 items (accepted 2026-11-15) + +1. Empty PUT body: 400 `server.empty_body` (section 2). Invalid JSON or non-boolean: 422. +2. No existing test file is edited. New files only (section 8). +3. Clone writes the security audit row too. `MountLifecycle(r, reg, auditor ...*audit.Auditor)` takes the auditor as an optional variadic parameter, so the four existing call sites compile unchanged. `cloneHandler` writes the row like create does. +4. A held sleeping server takes no wake slot. In the idle wake path, check the root hold before `r.reserveWakeStart(ctx, gs)` (`operator/internal/controller/gameserver_idle.go:333`). A server held by the root rule (setting off, root override saved, zero replicas) is not admitted: no `reserveWakeStart`, no "cold start admitted" status. It gets `SecurityAllowed=False`. This resolves brief 02 D15. +5. T044: a template rollout on a suspended or sleeping server refreshes the security values at its next start, not at the rollout. Until then `pending` stays true. Tests must not assert a start for those servers. This replaces the "premise correction" in brief 01 section 4.3 and the T044 wording in tasks.md. +6. `baselineRenderInputs` (`operator/internal/controller/gameserver_template_revision.go:338-340`, the line range OD-9 cites; verify before editing) excludes `spec.security`, so saving an override never rewrites a running pod. New task T075 (Phase 3). +7. Spec `file:line` citations are stale. Use the citations in briefs 01 to 04. tasks.md now states this in its binding rules. + +## 7. Open items: stop and ask, do not guess + +- **Remote cluster namespace: settled by OD-10 (A, 2026-11-15), see section 12.** The API reads a remote cluster's ConfigMap in the namespace on its registration. The identity the API uses on a remote cluster must still be found in the chart (T076); if it cannot be found, stop and ask. Do not hard-code `-credentials` for remote clusters. The home cluster uses `moduleConfigMapNS` (brief 03 D12). +- Helm chart tests: none exist for RBAC or `lookup` (brief 04 Q3). Adding one needs sign-off. +- The web and module test file names in section 8 are proposals. OD-9 does not name them. The maintainer accepts or renames them. +- Palworld `risky` and `volumeOwnershipCheck` (brief 04 Q4) is still open. T037 does not change Palworld until the module review decides. + +## 8. Test files: names to create (no existing test file is edited) + +Never edit these existing files: `operator/internal/controller/gameserver_security_test.go`, `api/internal/handlers/resources_security_test.go`, and every other existing test file. Create the new names below. + +| Area | New file | Content | +|---|---|---| +| operator unit | `operator/internal/controller/security_overrides_test.go` | resolver, codec, pending, gate, restricted-mode effective values, backup group cases (T015, T026, T040 unit part) | +| operator unit | `operator/internal/controller/security_settings_test.go` | `hasRootOverride`, `rootOverrideSettings`, ConfigMap reader (T050) | +| operator envtest | `operator/internal/controller/security_overrides_envtest_test.go` | reconcile behavior, OD-4 refusal and hold (T017, T027, T039, T051) | +| operator envtest | `operator/internal/controller/security_crd_validation_envtest_test.go` | CEL and bounds (T008) | +| operator unit | `operator/internal/controller/security_builders_test.go` | byte-identical unset, helper containers (T016) | +| operator envtest | `operator/internal/controller/security_backup_envtest_test.go` | backup and restore applied group (T040 envtest part) | +| API unit | `api/internal/handlers/security_overrides_test.go` | cases 1 to 5, shape, reason builder (T013, T028 unit, T048 unit, T049 unit) | +| API envtest | `api/internal/handlers/security_overrides_envtest_test.go` | permission, shape, root rule, audit rows (T014, T028, T048, T049 envtest) | +| API unit | `api/internal/handlers/security_settings_test.go` | GET and PUT shapes, empty body 400, invalid 422, flip logic (T047 unit) | +| API envtest | `api/internal/handlers/security_settings_envtest_test.go` | dedicated router, RBAC, flip, 409, 502, `security_save_failed` (T047 envtest) | +| RBAC unit | `api/internal/rbac/catalog_security_test.go` | `servers:security` exists, namespaced, admin only (T010) | +| E2E | `test/e2e/gameserver_security_e2e_test.go`, `test/e2e/api_security_override_e2e_test.go` | unchanged names | +| gp-module (proposed) | `gp-module/internal/validator/rules_security_test.go`, `gp-module/internal/preview/preview_security_test.go` | T038 | +| module repo (proposed) | `test-validate-py-security.sh` | T036 | +| web (proposed) | `web/src/components/SecurityAdvanced.test.tsx`, `web/src/routes/CreateServerSecurity.test.tsx`, `web/src/routes/tabs/settings/Security.test.tsx`, `web/src/components/clusters/SecuritySettingsPanel.test.tsx` | T029, T041, T052 | + +## 9. Production file names + +- Operator: `operator/internal/controller/security_overrides.go` (replaces `gameserver_security.go`) and `security_settings.go`. +- API: `api/internal/handlers/security_overrides.go` (replaces `resources_security.go`) and `security_settings.go`. `security_settings_sync.go` is not created. +- Web: `web/src/components/clusters/SecuritySettingsPanel.tsx` replaces `web/src/routes/AdminSettings.tsx` (not touched). Wired into `web/src/components/clusters/ClusterConfiguration.tsx`, next to `BackupDestinationsPanel.tsx`. + +## 10. Earlier brief statements that are superseded + +| Brief | Statement | Superseded by | +|---|---|---| +| 01 section 3.1, T044 | Rollout on a suspended or idle server "premise" (section 4.3) | section 6 item 5 | +| 01 section 6, T016 | Extend `build_game_container_test.go`, `workload_security_test.go` | `security_builders_test.go` (section 8) | +| 01 T039, D4 | Baseline fix noted in passing | T075 (section 6 item 6) | +| 01 T019, D6 | Change positional signatures of `gamePodSecurityContext`, `buildConfigInitContainer`, `buildGameContainer` | section 11 (keep callers compiling) | +| 02 D15 | Wake admission decision open | section 6 item 4 | +| 02 D12, T051 | Envtest file name `gameserver_security_envtest_test.go` | `security_overrides_envtest_test.go` (section 8) | +| 02 T040, T050 | Add cases to existing `gameserver_security_test.go` | new files (section 8) | +| 02 D7 | Namespace field source | section 3: `ControlPlaneNamespace` from `controlPlaneNamespace` | +| 03 D3 | Empty body 422 vs 400 open | section 6 item 1: 400 | +| 03 D6 | Clone audit open | section 6 item 3: yes | +| 03 D11, D13 | Store and auditor parameters on the validator and `MountConfig` | section 2: no store for the root rule; `MountSecuritySettings` takes the registry and auditor | +| 03 D12 | ConfigMap namespace is `moduleConfigMapNS` | section 1 and 2: the cluster's control-plane namespace (home value is the same) | +| 03 D15 | Config row write | section 1: no config row | +| 03 D16 | Remote ConfigMap writes not designed | section 4 (T076) and section 7 (namespace still open) | +| 03 T013, T014, T028, T047, T048, T049, T010 | Extend or add files named `resources_security*`, `config_envtest_test.go`, `catalog_test.go`, `rbac_test.go` | section 8 | +| 03 T047, T055, T056, T057, T058 | Config section, store read, `newValidators`, ConfigMap mirror and sync, Role with `create` | sections 1 to 5 | +| 03 T058 snippet | Role verbs `get, create, update, patch` | section 4: `get, update, patch` | +| 04 discrepancy 2, Q1 | Open choice of `create` verb | closed: no `create` | +| 04 T036, T038 | Add to `validate.py` test script, `validator_test.go`, `preview_test.go` | new files (section 8) | +| 04 T058 YAML | Role with a `create` placeholder inside `api.yaml` | section 4 | +| tasks.md T052, T063, design prompt | `AdminSettings.tsx` placement | section 9 | + +## 11. Signatures and compatibility (no existing test call site changes) + +- Keep every existing function name and positional signature that tests call. Add variants instead: + - `gamePodSecurityContext(tmpl)`, `gameContainerSecurityContext(tmpl)`, `buildConfigInitContainer(...)`: keep as wrappers that resolve from the template. Add `...Resolved` variants that take the resolved values. Production callers use the variants. + - `buildBackupPodSecurityContext(tmpl)` gains a trailing `appliedFSGroup ...*int64` variadic. No value means the current behavior. + - `buildRestorePodSpec` and `buildPreparedBackupPodSpec`: same trailing variadic, or a new function. Test call sites (brief 02 D16) stay unchanged. + - `reconcileStatefulSet` keeps its signature. The hold decision goes through a new internal function that returns the hold flag, and `reconcileStatefulSet` wraps it. + - `reconcileStatus` already takes variadic conditions: add the `SecurityAllowed` condition through that variadic. + - `MountLifecycle` and `MountConfig`: optional variadic parameters only. +- Verify each call site with `grep` before you change a signature. CI is the compile verifier for tests, and nobody may edit the tests to make them compile. + +## 12. Remote cluster control-plane namespace (OD-10 A, 2026-11-15) + +- The cluster registration records the namespace: an optional field `spec.controlPlaneNamespace` on the Cluster object, default `gameplane`, set in the register-cluster form and shown on the cluster page (tasks T078 and T079). +- The API reads a remote cluster's settings ConfigMap in that value. The home cluster keeps `moduleConfigMapNS` (section 2). A remote cluster with no value uses `gameplane`. +- The value must be the operator control-plane namespace of that remote install. A remote install that does not use `gameplane` must be registered with its real namespace. The remote chart's grant (T076) and the ConfigMap Helm creates there (T077) use the same namespace. +- A wrong value cannot turn the setting on. The ConfigMap is not found there, so it reads as off: GET reports `present: false`, and PUT returns 409 `server.cluster.security_settings_missing`. +- The API needs no extra permission on the remote cluster to learn the namespace; it comes from the registration. +- Rejected: a fixed namespace name on every install (OD-10 B), and a label lookup across all namespaces (OD-10 C), which needs cluster-wide ConfigMap list permission. diff --git a/specs/030-security-context-overrides/briefs/01-operator-pod.md b/specs/030-security-context-overrides/briefs/01-operator-pod.md new file mode 100644 index 000000000..5f537bd4b --- /dev/null +++ b/specs/030-security-context-overrides/briefs/01-operator-pod.md @@ -0,0 +1,414 @@ +# Brief 01: operator pod building and lifecycle + +Scope: T005, T006, T007, T015 to T021, T031, T032, T039, T044 (plus T016, T017 test specifics). Facts verified against the working tree on branch `feat/030-security-context-overrides` (read only). Line numbers are current; "stale" means the spec citation differs from the code today. All `file` paths are under `/home/user/Gameplane/`. Controller package = `operator/internal/controller/` (abbreviated `ctl/`). + +## Spec references + +- Spec: `spec.md` (FR-001..FR-013, US1..US4). Plan: `plan.md` (gap 3 at `plan.md:86-104`). Research: `research.md` R4 (resolver, `:85`), R5 (gate, `:99`), R6 (applied source, `:123`), R7 (status, `:138`), R8 (ownership check, `:146`), R9 (cluster setting, `:160`). Data model: `data-model.md` "Pod-level encoding" (`:133`), "Start refusal" (`:147`), "State transitions" (`:168`), "Invariants" (`:195`). Contracts: `contracts/crd-gametemplate-security.md`, `contracts/crd-gameserver-security.md`. + +--- + +## 1. CRD types (T005, T006, T007) + +### 1.1 Template side (T005) + +- `operator/api/v1alpha1/gametemplate_types.go:186` `Security *GameSecuritySpec \`json:"security,omitempty"\`` (field in `GameTemplateSpec`). Doc comment `:181-185`. +- `operator/api/v1alpha1/gametemplate_types.go:194` `type GameSecuritySpec struct`. Members (all `*int64`, `+kubebuilder:validation:Minimum=0`, `Maximum=4294967295`, `+optional`): `RunAsUser` `:199`, `RunAsGroup` `:206`, `FSGroup` `:213` (line numbers of the field declarations, approx; struct ends `:215`). +- **Stale**: spec T005 says "`gametemplate_types.go:185`". `:185` is a comment line; the type is `:194`, the field `:186`. +- Intended change (T005, contract `crd-gametemplate-security.md`): + - add `VolumeOwnershipCheck *SecurityOwnershipCheck` (or `*string`) with `+kubebuilder:validation:Enum=EveryStart;OnlyWhenWrong`, `+optional`, doc: omitted means `OnlyWhenWrong`; only effective when `fsGroup` is set. + - add `Risky *SecurityRiskSpec \`json:"risky,omitempty"\`` (`+optional`). + - new `type SecurityRiskSpec struct` with four optional pointer members `RunAsUser`, `RunAsGroup`, `FSGroup`, `VolumeOwnershipCheck` of type `*SecurityRiskNote`; `type SecurityRiskNote struct { Reason string \`json:"reason,omitempty"\` }` with `+kubebuilder:validation:MaxLength=200`. Contract says `reason?` is optional, so each member is a pointer (presence = "risky"). Contract: a `risky` member may name a setting the template does not set. + - Task refs: T005; contract `crd-gametemplate-security.md` "Shape", "Behavior"; data-model `:16-45` (`risky` at `:28`); research R3. +- Operator reads only the four values, never `Risky` (contract "Behavior"). + +### 1.2 GameServer side (T006) + +- `operator/api/v1alpha1/gameserver_types.go:161` `Capture *CaptureConfiguration \`json:"capture,omitempty"\`` is the last field of `GameServerSpec` (`:41`). Insert `Security *GameServerSecuritySpec` immediately after `:161` (T006 says "after `Capture` (`:161`)": CORRECT). +- Condition-type const block: `gameserver_types.go:24-38` (`// GameServer condition types.` `const (...)` starts `:25`; the `:13-21` block is phase constants, do not add there; existing `GameServerConditionAddressAssignment` `:30`, `GameServerConditionDataWipe` `:37`). Add `GameServerConditionSecurityAllowed = "SecurityAllowed"` here with a doc comment in the same style (type constants are prefixed `GameServerCondition...`). +- Reason strings are NOT constants in this package. Convention is literal strings: `Reason: "JobFailed"` (literal in tests `ctl/gameserver_wipe_poll_test.go:23`; production `ctl/gameserver_wipe.go:341`, compared at `ctl/gameserver_wipe_guard.go:78`; `ctl/backup_controller.go:594`). For `RootOverrideDisallowed` either a literal (matches convention) or a new `const` next to the type const. Note in the brief: the operator writes the status only via the Patch path; reason is consumed by web i18n id `condition..` (per the comment at `gameserver_types.go:576-580`, and `web/src/lib/i18n/conditionMessage.test.ts`). A new reason therefore needs a translation entry (out of this area; flag to the web owner). +- `GameServerSpec.Security *GameServerSecuritySpec` new type `GameServerSecuritySpec` with fields `RunAsUser`, `RunAsGroup`, `FSGroup` of type `*SecurityIDOverride` and `VolumeOwnershipCheck *string` (enum `EveryStart|OnlyWhenWrong`). `SecurityIDOverride{ Value *int64 (Min 0, Max 4294967295); UseImageDefault bool }`. CEL rules per `contracts/crd-gameserver-security.md` "spec.security": exactly one of `value`/`useImageDefault`; `useImageDefault` must be `true` when present. Messages verbatim: `security.: set exactly one of value or useImageDefault`, `security..useImageDefault must be true when set`. Existing CEL style example: `gameserver_types.go` (`+kubebuilder:validation:XValidation:rule="self == oldSelf",...` on `TemplateRef`, at `:49`). +- `GameServerStatus` starts at `gameserver_types.go:558`. `Conditions` `:574` (`patchStrategy:"merge"`, `patchMergeKey:"type"`). Add `Security *GameServerSecurityStatus` (`+optional`) after `Capture` (`:611`) or next to `Conditions`; `GameServerSecurityStatus{ Desired, Applied *SecuritySettings (Applied omitted before first start); Pending bool }`, `SecuritySettings{ RunAsUser, RunAsGroup, FSGroup SecurityIDStatus; VolumeOwnershipCheck SecurityCheckStatus }`, `SecurityIDStatus{ Value *int64 (omitempty); Source string enum }`, `SecurityCheckStatus{ Value string; Source string }`. Source enum: `ModuleDefault|Override|ImageDefaultOverride|ImageDefault|BuiltInDefault` (data-model `:127`ff). +- Spec citation "`GameServerStatus.Security` (`:558`)": CORRECT (struct start). + +### 1.3 Regeneration (T007) + +- `make generate && make manifests` (CLAUDE.md rule 7). Files to commit: `operator/api/v1alpha1/zz_generated.deepcopy.go`, `operator/config/crd/gameplane.local_gameservers.yaml`, `operator/config/crd/gameplane.local_gametemplates.yaml`, `charts/gameplane/charts/gameplane-crds/crds/*.yaml` (both CRDs), `charts/gameplane/crd-manifests/*.yaml` (both CRDs). Verify the exact filenames exist with `ls operator/config/crd charts/gameplane/crd-manifests` before the brief's agent runs `make` (read-only check only; do not run make locally: CLAUDE.md rule 8 allows only compile checks; `make generate` is codegen, so the agent running it must be CI-safe; the parent decides). +- CRD path check: `ctl/crd_validation_envtest_test.go` loads `operator/config/crd` (`suite_envtest_test.go:44`), so T007 output must be present before envtest-based T017, T039. + +--- + +## 2. Resolver, encoding and annotation codec (T018, T031, T015) + +### 2.1 New file (T018, T031) + +- `operator/internal/controller/gameserver_security.go` does NOT exist (checked). Create it (package `controller`). +- Annotation keys: no collision. Existing `gameplane.local/...` keys in `ctl/` are `config-hash`, `hostport-node`, `effective-template-revision`, `template-revision`, `template-baseline*`, `wipe-*`, `stop-requested`, `capture-*`, `protected-config-keys`, `idle-*`, `restart-*`, `node`. None is `security*`. New keys: `gameplane.local/security-applied` (pod template, carries resolved values+sources as compact JSON, R5/data-model) and `gameplane.local/security-applied-observed` (on the StatefulSet object, R6). +- Pod template annotation writes: follow the existing pattern in `reconcileStatefulSet` (`ctl/gameserver_controller.go:1820-1823`): + ```go + ann := ss.Spec.Template.Annotations + if revision := gs.Annotations[effectiveTemplateAnnotation]; revision != "" { + if ann == nil { ann = map[string]string{} } + ann[templateRevisionAnnotation] = revision + } + ``` + (current code at `:1805-1816` region; the template revision annotation is the precedent). +- Existing "resolved by one function" precedent: none. Use R4 design: pure `resolveGameSecurity(tmpl *GameTemplate, gs *GameServer) GameSecurity` returning per-id `{Value *int64; Source string}` and ownership check `{Value string; Source string}`. + +### 2.2 Resolution rules (R4, FR-003; contract "Reconciler behavior") + +- ids (`runAsUser`, `runAsGroup`, `fsGroup`), in order: `gs.Spec.Security..UseImageDefault==true` → value nil, source `ImageDefaultOverride`; else `gs...Value != nil` → value, source `Override`; else `tmpl.Spec.Security. != nil` → value, source `ModuleDefault`; else value nil, source `ImageDefault`. +- ownership check: override (`gs.Spec.Security.VolumeOwnershipCheck`), else template (`tmpl.Spec.Security.VolumeOwnershipCheck`) → source `Override`/`ModuleDefault`; else `OnlyWhenWrong`, source `BuiltInDefault` (gap 1 in plan.md:88). +- `pending` (contract "status"): `applied != nil && any value differs` (source-only change is not pending). + +### 2.3 Pod encoding (data-model "Pod-level encoding", `:133-145`) + +| Setting | Pod field | Current code | +|---|---|---| +| runAsUser / runAsGroup | game container `SecurityContext` | `ctl/gameserver_controller.go:2496-2506` | +| fsGroup | pod `SecurityContext.FSGroup`, config-init `RunAsGroup` + chgrp target | `:2612-2617`, `:2345-2352` | +| volumeOwnershipCheck | pod `SecurityContext.FSGroupChangePolicy`: `EveryStart→Always`, `OnlyWhenWrong→OnRootMismatch`, written only when fsGroup applies | new | + +Current code (`ctl/gameserver_controller.go:2496-2506`): +```go +func gameContainerSecurityContext(tmpl *gameplanev1alpha1.GameTemplate) *corev1.SecurityContext { + sec := tmpl.Spec.Security + if sec == nil || (sec.RunAsUser == nil && sec.RunAsGroup == nil) { + return nil + } + return &corev1.SecurityContext{ + RunAsUser: sec.RunAsUser, + RunAsGroup: sec.RunAsGroup, + } +} +``` +Definition is at `:2496` (spec T019 says `:2470`: STALE, the call site inside `buildGameContainer` is `:2482`, the definition `:2496`). + +Current `gamePodSecurityContext` (`ctl/gameserver_controller.go:2612-2617`): +```go +func gamePodSecurityContext(tmpl *gameplanev1alpha1.GameTemplate) *corev1.PodSecurityContext { + sec := tmpl.Spec.Security + if sec == nil || sec.FSGroup == nil { + return nil + } + return &corev1.PodSecurityContext{FSGroup: sec.FSGroup} +} +``` +Spec T019 says `:2586`: STALE. Definition `:2612`. + +Current config-init (`ctl/gameserver_controller.go:2336`, definition; spec T019 says `:2310`: STALE): +```go +// :2345-2348 +if tmpl.Spec.Security != nil && tmpl.Spec.Security.FSGroup != nil { + group := *tmpl.Spec.Security.FSGroup + security = &corev1.SecurityContext{RunAsGroup: ptrTo(group)} +// :2352 chgrp inside cpCmd uses fmt.Sprintf(..., group, group) -> "[ \"$group\" = %d ] || chgrp %d" +``` +Intended: signature takes the resolved filesystem group (`*int64`) instead of reading `tmpl.Spec.Security`; keep `security == nil` when no group (byte-identical). Config-init has no runAsUser; it only gets `RunAsGroup` + the chgrp command. + +Pod field `FSGroupChangePolicy` (new): needs `corev1.PodFSGroupChangePolicy` constants `corev1.FSGroupChangeAlways` and `corev1.FSGroupChangeOnRootMismatch` (k8s.io/api core/v1 names; verify with the module source before relying on them, see section 9). + +### 2.4 Annotation codec / readers (R5, R6, data-model "Pod-level encoding" last para) + +- Pre-feature reader: no annotation → non-empty template values `ModuleDefault`, empty ids `ImageDefault`, ownership check `EveryStart` with `BuiltInDefault` (data-model `:144`). Note the contradictory-looking pair: an unannotated pod has no change policy, Kubernetes treats it as `Always` (= `EveryStart`); the reader reports `EveryStart`, and `desired` is `OnlyWhenWrong` when fsGroup applies, so the pre-feature server shows `pending=true` until its next start (plan/data-model). +- `ownedTemplatePod` (`ctl/gameserver_template_revision.go:498-514`): spec says `:480` (STALE). It returns nil when the StatefulSet is not controlled by gs, when pod `-0` is absent, or when the pod is not controlled by the StatefulSet or is deleting. Use it for the observed-annotation copy (R6 step 2) and for the applied-values reader. +- `observedTemplateRevision` (`:516-531`) is the precedent: it checks `container.Name == "game" && container.State.Running != nil`. R6 wants the start signal `PodReadyToStartContainers=True` or any started init/game container status. Note: `ownedTemplatePod` returns the pod; use `pod.Status.Conditions` for `corev1.PodReadyToStartContainers` (see section 9 for the k8s.io/api check). +- Observed annotation lives on the StatefulSet object (`ss.Annotations`), not the pod template. + +--- + +## 3. reconcileStatefulSet: mutate function and zero-to-one gate (T019, T020) + +Current structure (`ctl/gameserver_controller.go`): + +| Line | Current code | +|---|---| +| `:1613` | `func (r *GameServerReconciler) reconcileStatefulSet(` (spec `:1611`: stale by 2) | +| `:1637` | `_, err := controllerutil.CreateOrUpdate(ctx, r.Client, ss, func() error {` (the mutate function starts here) | +| `:1643-1646` | `actualReplicas := replicas` (restore/wipe guard sets 0) | +| `:1650-1657` | live GameServer re-read; UID and effective-template fences | +| `:1698` | `op, held, err := lifecycleOwner(live)`; held-operation branches `:1698-1790` | +| `:1793` | `preserveBaseline, err := r.preserveBaselinePodTemplate(ctx, &live, ss)` | +| `:1797` | `ss.Spec.Replicas = &actualReplicas` (overwrites the live replica count; the gate must read `ss.Spec.Replicas` BEFORE this line) | +| `:1798-1801` | `if held && (...) && (!ss.CreationTimestamp.IsZero() || ss.ResourceVersion != "") { return nil }` | +| `:1803-1805` | `if preserveBaseline { return nil }` | +| `:1833-1834` | `ss.Spec.Template.Spec.Containers = []corev1.Container{ buildGameContainer(gs, tmpl, image, ver, mc), ...` | +| `:1895` | `ss.Spec.Template.Spec.InitContainers = []corev1.Container{buildConfigInitContainer(r.ConfigInitImage, tmpl, r.AgentResources)}` | +| `:1920-1930` | hostport affinity gate: `if actualReplicas == 0 \|\| ss.ResourceVersion == "" \|\| ...hostportNodeAnnotation != ""` (spec says "gate near :1889-1905": STALE, the real hostport gate is `:1920`, and it is the pattern R5 cites) | +| `:1935` | `ss.Spec.Template.Spec.SecurityContext = gamePodSecurityContext(tmpl)` (comment `:1933-1934`: unconditional assign) | +| `:1944` | `applyWorkloadSecurity(&ss.Spec.Template.Spec, tmpl, r.RestrictedWorkloads, r.AgentTokenExpirationSeconds)` | +| `:1959` | `return controllerutil.SetControllerReference(gs, ss, r.Scheme)` | + +Current `gameContainerSecurityContext` is called from `buildGameContainer` at `:2482` (`c.SecurityContext = gameContainerSecurityContext(tmpl)`). `buildGameContainer` is at `:2397`. + +### 3.1 Gate (R5) + +Intended, inside the mutate function, before `:1797`: +```go +prevReplicas := ss.Spec.Replicas // live value, read before :1797 overwrites it +refresh := ss.ResourceVersion == "" || + (prevReplicas != nil && *prevReplicas == 0 && actualReplicas > 0) +``` +- Note `ss.Spec.Replicas` is nil on a fresh object; `ss.ResourceVersion == ""` already covers create. +- When `!refresh`: copy forward from a snapshot taken at the top of the mutate function (before the containers/initContainers/pod SecurityContext assignments at `:1833`, `:1895`, `:1935`): the game container `SecurityContext` (from the existing `ss.Spec.Template.Spec.Containers` entry named `gameContainerName`), `ss.Spec.Template.Spec.SecurityContext`, the config-init container (`InitContainers`), and the `gameplane.local/security-applied` annotation. Simplest shape: `prev := ss.Spec.Template.Spec.DeepCopy()` and `prevAnn := ss.Spec.Template.Annotations[securityAppliedAnnotation]` before the template rebuild; then restore the security fields from `prev` when `!refresh`. +- Caution: `applyWorkloadSecurity` (`:1944`) also writes into the game container's and pod's SecurityContext in restricted mode (`workload_security.go:56-57, 60-62`). The copy-forward must run after `applyWorkloadSecurity` or cover that path, otherwise the restricted-mode values are rebuilt from the template (see D8 in section 9). +- Early returns before the template rebuild (`:1798-1801` held ops, `:1803-1805` preserveBaseline) skip ALL template writes, so security is not written on those paths either. That is consistent with R5, but the observed annotation and `status.security.applied` then are not refreshed on those paths. See section 5.3 and D4. + +### 3.2 Gate scope vs. zero-to-one through the rest of the code (R5 "rollout", T044) + +- `desiredReplicas` (`:1320`) returns the replica count. A restart (`restartPhase`) is scale-down then scale-up (ack at `:1408`; spec says `:1283-1290`: stale). Suspend and idle stop return 0 via `softStop` (tail `:1421-1428`: `stopping := gs.Spec.Suspend || restart == restartDraining || idle == idleAsleep`). +- Refresh point is the first reconcile where live replicas are 0 and desired `actualReplicas` is 1. The `softStop` path (`:1493`) runs while the pod still exists, so there is one reconcile at zero where the pod template is not yet refreshed. Good. + +--- + +## 4. Template revision: pin, rollouts and validation call sites (T032, T044) + +### 4.1 Restricted-workload validation call sites + +- `ctl/gameserver_controller.go:352-355` (Reconcile): + ```go + if r.RestrictedWorkloads { + if err := validateRestrictedTemplate(&tmpl); err != nil { + return ctrl.Result{}, r.setPhase(ctx, &gs, err.Error()) + } + } + ``` + Spec T032 cites `gameserver_controller.go:334`: STALE. `:334` is inside the `reconcileTemplateRevision` error branch (`:331` setPhase with RequeueAfter). The validation call is `:353` and the setPhase `:354`. +- `ctl/gameserver_template_revision.go:221-225` (rollout admission on the "op.Token != pin" branch, inside `if held && op.Kind == "Rollout"`). Spec says `:216`: STALE. +- `ctl/gameserver_template_revision.go:287-291` (admit branch). Spec says `:278`: STALE. +- Both call `validateRestrictedTemplate(target)` where `target` is a `GameTemplate`. With overrides, the check must use the resolved desired values for this GameServer, so the template-only call is no longer enough (T032). At `:222` and `:288` the GameServer is `gs` (available), so `resolveGameSecurity(target, gs)` is possible there. + +### 4.2 Workload security helpers (`ctl/workload_security.go`) + +- `:15-21` `validateRestrictedTemplate(tmpl)`: current check is on `tmpl.Spec.Security.RunAsUser > 0`, `FSGroup > 0`, and `RunAsGroup` > 0 when set. Message at `:18`: `restricted workload requires template security.runAsUser and security.fsGroup greater than zero, and a positive security.runAsGroup when specified; use an image compatible with that identity`. Spec: "`workload_security.go:15, 23`": CORRECT. +- `:23-34` `restrictedContainerSecurity(tmpl)`: reads `tmpl.Spec.Security.RunAsUser`, `RunAsGroup` (fallback `FSGroup`). Needs the resolved values (T032). CORRECT line. +- `:39-67` `applyWorkloadSecurity(pod, tmpl, restricted, expirationSeconds)`: `restricted` branch `:60-66`. Line `:61` `pod.SecurityContext.RunAsNonRoot = ptrTo(true)` dereferences `pod.SecurityContext`; it is non-nil today only because `validateRestrictedTemplate` forces template `fsGroup > 0`, which is what gives `gamePodSecurityContext` a non-nil return. See D8. +- `:63-65` applies `restrictedContainerSecurity(tmpl)` to EVERY init container (not just config-init by name). See D9. +- Intended (T032, OD-5 settled A): the three functions take the resolved (desired) values, not `tmpl.Spec.Security`. Validation of the effective values uses the same rule. A violation fails the server through `setPhase` with the existing message until the override is fixed; a running pod is untouched (contract "Restricted workload mode"). + +### 4.3 Rollout pin semantics (T044) + +- Pin: `gs.Annotations[effectiveTemplateAnnotation]` (`ctl/gameserver_template_revision.go` `:~110-205`; `reconcileTemplateRevision` at `:~100`). Installed catalog vs pinned revision: `installed` GET at `:~188-189`. +- Rollout policy default: `gameserver_template_revision.go:129` sets `TemplateRollout{Policy: "OnRequest"}` only on the held Rollout-restore branch. The admit computation is `:267`: `admit := pin == "" || migrateBaseline || policy == nil || policy.Policy == "" || policy.Policy == "Automatic" || policy.RequestedRevision == revision`. So `OnRequest` admits only when `RequestedRevision == revision` (API-requested), `Automatic` admits always. +- Admission: `claimLifecycleOperation` with `Kind: "Rollout"` (`:~305-309`). During the Rollout op, `desiredReplicas` routes through `softStop` (`ctl/gameserver_controller.go:1331-1340`, `held && op.Kind == "Rollout" ... op.Token != live.Annotations[effectiveTemplateAnnotation]`). +- The effective pin is updated at `:~228-229` and `:~295-297`: `gs.Annotations[effectiveTemplateAnnotation] = op.Token` followed by `r.Update(ctx, gs)`. + +**T044 premise is partly false (evidence).** The task says "confirm both `OnRequest` and `Automatic` rollouts end in a start that refreshes the template" (plan gap 3, `plan.md:86-104`). Code: +- For a running, awake server, a rollout drains (softStop) and then restarts: `desiredReplicas` after the op returns 1 (`:1423` `stopping := gs.Spec.Suspend || restart == restartDraining || idle == idleAsleep`, `!stopping` returns 1). +- For a **suspended** server (`gs.Spec.Suspend == true`) or an **idle-asleep** one, `stopping` is true, so the rollout ends at zero replicas (`:1421-1428`). No start occurs. The template refresh (and `applied`) waits until the next wake or resume. The status writer must show `pending=true` in that window (not a bug, but T044's claim "ends in a start" must not be written as a fact). +- For `OnRequest` without a `RequestedRevision` match, `admit=false` (`:267-268`): no rollout, no start. Pending is still recomputed from the pinned template. + +### 4.4 Status writer and pin change (T044) + +- `reconcileStatus` is called with the effective (pinned) template at `ctl/gameserver_controller.go:562` (`r.reconcileStatus(ctx, &gs, idle, idleStatus, idleScheduleErr, tunnelPlan, &tmpl, svcEvents, conflictingServer, plan.hostportCondition)`). `desired` must be computed from `&tmpl` (effective pin), not from `installed`. T044 recompute is then automatic each reconcile. The writer does not touch the pod (T044). + +--- + +## 5. Backup, restore and failure paths (T043 context, T039 expectations) + +Not in my T-list but affected by the operator resolver signatures: + +- `ctl/backup_controller.go:1058` `SecurityContext: buildBackupPodSecurityContext(tmpl),` (spec `:1035`: stale). Definition `:1156` (spec `:1133`: stale). Reads FS group directly: `:1160-1161` `if tmpl.Spec.Security != nil && tmpl.Spec.Security.FSGroup != nil { fsGroup = *tmpl.Spec.Security.FSGroup }`. +- `ctl/restore_controller.go:433` `SecurityContext: buildBackupPodSecurityContext(tmpl),` (spec `:425`: stale). + +### 5.1 `reconcileStatus` (gameserver_status.go) and MergeFrom + +- `ctl/gameserver_status.go:42` `func (r *GameServerReconciler) reconcileStatus(` with variadic `hostportConditions ...*metav1.Condition` (`:46`), a precedent for passing a new condition. +- `:47-54` comment block explaining MergeFrom; `:55` `base := gs.DeepCopy()`; `:56` `orig := gs.Status.DeepCopy()`. +- `:316` `if err := r.Status().Patch(ctx, gs, client.MergeFrom(base)); err != nil { return 0, err }`, guarded by `if !reflect.DeepEqual(orig, &gs.Status)` at `:315`. +- Discrepancy with T021's wording: the patch is a MergeFrom of the WHOLE status (diff of `gs` vs `base`), not "that field only". It leaves `status.agent` alone because `gs.Status.Agent` is not changed in this reconcile (the agent's heartbeat is a separate writer). Keep it that way: do not write `gs.Status.Agent` from the reconciler. +- Conditions: `upsertCondition` (`ctl/helpers.go:18`) sets `LastTransitionTime` only on status change; `removeCondition` (`ctl/gameserver_status.go:1287`). The hostport precedent: `applyHostportCondition` at `:330-335` and call at `:198-203`. +- For `SecurityAllowed` use the same shape: compute before `reconcileStatus` (the root-override check needs the settings ConfigMap, a read), pass as a new variadic param or compute inside, then `upsertCondition`/`removeCondition` in the same block as `:198-203`. Adding a NON-variadic positional parameter breaks 7 test callers (D7). +- Test callers of `reconcileStatus` (all positional): `gameserver_capture_status_test.go:64`, `gameserver_envtest_test.go:385`, `gameserver_idle_condition_test.go:74,83`, `gameserver_status_test.go:1461,1476,1519,1537`. + +### 5.2 Failure path + +- `setPhase` at `ctl/gameserver_controller.go:2783`. Used for the restricted-workload failure (`:354`). `reconcileTemplateRevision` error goes to `setPhase` at `:331`. + +### 5.3 Preserved-baseline and held early returns (affects T020, T039, T044) + +- `ctl/gameserver_template_revision.go:416` `preserveBaselinePodTemplate(ctx, gs, ss)`. First line checks pin, baseline markers and `ss.Spec.Template.Annotations[templateRevisionAnnotation] != ""`. Returns `true` (preserve the whole template) when `r.GameWorkloadPolicy != nil` (`:424-427`) or when `baselineRenderInputs` matches `gs.Annotations[baselineInputsAnnotation]`. +- `ctl/gameserver_template_revision.go:337-357` `baselineRenderInputs(gs, revision)`: `spec := gs.Spec.DeepCopy()` (`:338`), then `spec.StopGracePeriodSeconds, spec.TemplateRollout, spec.BackupPolicy, spec.Idle, spec.Capture = nil, nil, nil, nil, nil` (`:340`). The whole spec is hashed (`:343-352`). + +**D4 (must address).** `GameServerSpec.Security` is NOT in the exclusion list at `:340`. A baseline-pinned server whose user saves an override changes its `baselineRenderInputs` hash, so `preserveBaselinePodTemplate` returns `false` (`:431-433` path) and `reconcileStatefulSet` rewrites the pod template, which restarts the server. This violates FR-008 / R5. Fix: add `spec.Security = nil` to the list at `:340` (the list already excludes `Capture`, a per-server opt-in, with the same rationale in the comment at `:333-335`). Expected test: T039 (save override on a baseline-pinned server, pod template unchanged). + +Also: when `preserveBaseline` is true the mutate function returns at `:1803-1805` BEFORE any security write. A preserved StatefulSet therefore never gets the `security-applied` annotation or the security-derived template parts until it is refreshed. Document this in T018 (the observed-annotation reader then falls back to the pre-feature rule for that StatefulSet). + +--- + +## 6. Test files to extend and envtest helpers + +### 6.1 Unit tests (no build tag) + +- `ctl/build_game_container_test.go` (package `controller`): + - `TestBuildGameContainer_SecurityContext_Unset` `:72-88`: asserts `c.SecurityContext == nil` with no security block. + - `TestBuildGameContainer_SecurityContext_RunAsUserGroup` `:90-123`: asserts only RunAsUser/RunAsGroup set on the game container (no ReadOnly/Capabilities/Seccomp). + - `TestGamePodSecurityContext` `:167-` (asserts nil when unset; FSGroup otherwise). Lines `:170`, `:179` call `gamePodSecurityContext(tmpl)`. + - Five `buildGameContainer(gs, tmpl, image, nil, &materializedConfig{})` calls at `:36, :61, :79, :103, :138` (5-arg signature at `ctl/gameserver_controller.go:2397`). +- `ctl/workload_security_test.go`: `TestRestrictedHostportFailsBeforeWorkloadCreation` `:17`, `TestRestrictedTemplateIdentity` `:66` (calls `validateRestrictedTemplate(tmpl)` at `:82`), `TestWorkloadTokenOnlyMountedInAgent` `:89` (calls `gamePodSecurityContext(tmpl)` `:93` and `applyWorkloadSecurity(&pod, tmpl, true, 3600)` `:94`). T016 extends this file. +- `ctl/gameserver_security_test.go`: ALREADY EXISTS (`:1-` package `controller`, no build tag). It holds `TestValidateServerEnvSecrets` (`:16`) and `TestReconcileTunnel_CredentialsSecretOwnership` (`:333`). This is D1: T015 says "Table test `operator/internal/controller/gameserver_security_test.go`". Creating that path would collide. Use a new name, for example `ctl/gameserver_security_resolve_test.go`, and update T015, or get sign-off to append. Do not overwrite the existing file. +- `ctl/gameserver_files_test.go` calls `buildConfigInitContainer` at `:16, :48, :61, :77, :143, :181, :194`; `ctl/auxiliary_resources_test.go:69` also calls it. +- `ctl/gameserver_template_revision_test.go` calls `applyWorkloadSecurity(&ss.Spec.Template.Spec, ...)` at `:624` and `:749`. + +### 6.2 Envtest (build tag `envtest`) + +- `ctl/suite_envtest_test.go`: `//go:build envtest` (line 1). `TestMain` at `:37`. CRD dirs: `operator/config/crd` and `test/crds/snapshot` (`:44-48`), `ErrorIfCRDPathMissing: true`. Shared globals `cfg`, `k8sClient`, `scheme` (`:27-31`). Envtest has no kube-controller-manager: no StatefulSet or Pod controllers (comment `:14-15`). +- `ctl/helpers_envtest_test.go` (`//go:build envtest`, line 1): + - `withGameServerReconciler(t, ns)` `:92-104`: builds `GameServerReconciler{Client, APIReader, Scheme, AgentImage, AgentCASecretName, AgentCASecretNamespace}`. Does NOT set `RestrictedWorkloads`, `ConfigInitImage`, or a control-plane namespace. T060/T061 need a settings-namespace field; set it here (test helper change; needs sign-off per CLAUDE.md rule 1 if it changes existing behavior; additive only). + - `startMgr(t, ns, setups...)` `:160`: manager cache `DefaultNamespaces: {ns: {}}` (`:169-172`). ConfigMaps in another namespace (the control-plane namespace) are NOT in the cache in envtest. The settings ConfigMap read must use `APIReader` or the test must place it in `ns`. This is D10. + - `newNamespace(t)` `:208`, `eventually(t, cond)` `:241`, `eventuallyWith` `:246`, `consistently(t, window, cond)` `:267`, `buildGameServer(ns, name, tmplName)` `:318`, `buildGameTemplate(name)` `:330`, `getGameServer(t, ns, name)` `:763`, `getTemplateByName` `:754`, `getJob` `:774`, `markGameServerPhase` `:618`, `seedGameServer` `:863`, `uniqueName(prefix)` `:412`, `deleteCleanup` `:421`. +- `ctl/crd_validation_envtest_test.go`: `//go:build envtest` (line 1). Pattern for CEL/schema tests: `validGameServer(ns, name)` `:25-32`; `TestCRDValidation_GameServerEmptyTemplateRef` `:34-42` does `k8sClient.Create` and `apierrors.IsInvalid(err)`. CEL tests for `spec.security` follow this pattern (T0xx, not in my list, but the CRD is needed). +- New envtest file: `ctl/gameserver_security_envtest_test.go` (does not exist; create it with `//go:build envtest`). T017 and T039 target it. + +--- + +## 7. Per-task brief + +### T005 (template types) +- Edit `operator/api/v1alpha1/gametemplate_types.go`: `GameSecuritySpec` at `:194`; add fields per section 1.1. Doc comments are required by the repo's CRD doc generation style (copy the `FSGroup` comment style, `:208-212`). +- Justification: FR-001, FR-002a, FR-006a, FR-013; contract `crd-gametemplate-security.md`; research R3, R8, R14; data-model `:16-45`. + +### T006 (GameServer types) +- Edit `operator/api/v1alpha1/gameserver_types.go`: insert `Security` after `:161`; condition const at `:22-38` block; status field next to `:558`/`:611`. Justification: FR-002, FR-002a, FR-003, FR-004, FR-005, FR-009; contract `crd-gameserver-security.md`; data-model "Server security override" `:46-100`, "Desired and applied" `:100-146`, "Start refusal" `:147-166`. + +### T007 (generated) +- Commit list in section 1.3. Justification: CLAUDE.md rule 7. + +### T015 (table test, pure resolver) +- New test file name (see D1). Cases: every id source (module default, image default with neither set, override `value`, override `useImageDefault`); ownership check override > template > `BuiltInDefault`; `fsGroupChangePolicy` mapping `EveryStart`→`Always`, `OnlyWhenWrong`→`OnRootMismatch`, unset when no fsGroup applies (FR-002a, R8); annotation encode/decode round trip for `gameplane.local/security-applied`; pre-feature reader (no annotation: non-empty values `ModuleDefault`, empty ids `ImageDefault`, ownership check `EveryStart`/`BuiltInDefault`, data-model `:144`); `pending` (source-only change is not pending, contract "status" table). + +### T016 (byte-identical unset; helpers keep fixed users) +- Extend `build_game_container_test.go` and `workload_security_test.go` (section 6.1). Assert with nothing applied: `SecurityContext == nil` on game container and `Spec.Template.Spec.SecurityContext == nil` (from `gamePodSecurityContext` returning nil). Helper containers keep fixed users: agent (`buildAgentContainer`, uid 65532, `ctl/gameserver_controller.go:2621`, its SecurityContext at `:2730`), config-init (`:2336-2360`: only `RunAsGroup`, and only with fsGroup), sentinel (`ctl/gameserver_sentinel.go`), tunnel and wipe: none derive from `desired`/`applied` (FR-012). +- CAUTION (D9): in restricted mode `applyWorkloadSecurity` (`workload_security.go:63-65`) gives config-init the game identity. The test must state that, not assert "fixed user" for config-init in restricted mode. + +### T017 (envtest: defaults, pre-feature StatefulSet not recreated) +- New `ctl/gameserver_security_envtest_test.go` (`//go:build envtest`). Use `startMgr`, `withGameServerReconciler`, `newNamespace`, `buildGameTemplate`, `buildGameServer`, `getGameServer`. Envtest has no StatefulSet controller, so "not recreated" is asserted by reading the StatefulSet's `ResourceVersion`/`UID` and `Spec.Template` before and after reconcile (pod template untouched, `pending=true`, `applied.volumeOwnershipCheck=EveryStart`, `desired=OnlyWhenWrong`). Then scale to zero and back (set `spec.suspend` or fake replicas via `Status`), pod template gets `fsGroupChangePolicy: OnRootMismatch` and `pending=false`. +- A pre-feature StatefulSet can be seeded by creating it without the new annotations with `k8sClient.Create` before the reconciler runs. +- Interaction: `reconcileStatefulSet` calls `validateServerEnvSources` (`:1625`) and `validateTemplateEnvSources` (`:1630`) and `r.wipeReader()`; the envtest reconciler must have what these need (existing helpers already set this for other envtest files). + +### T018 (new `gameserver_security.go`) +- Create file (section 2). Contents: `resolveGameSecurity`, pod encoding helpers (`fsGroupChangePolicy` mapping, `runAsUser`/`runAsGroup` pass-through), annotation codec for `gameplane.local/security-applied` (compact JSON of resolved value+source), `gameplane.local/security-applied-observed` reader and writer, applied-values reader (observed annotation on the StatefulSet; copied from pod-template annotation once `ownedTemplatePod` (`gameserver_template_revision.go:498`) returns a pod with `PodReadyToStartContainers=True` or any started container; pre-feature fallback to the running pod, else the StatefulSet template; R6). Depends on T006, T007. +- The observed-annotation copy happens in the reconcile loop AFTER the pod exists, so it must be done in a separate step (not inside the mutate function, which runs before the pod is started). Decide placement in T018's brief with the parent; the existing `ownedTemplatePod` call sites show the pattern (`gameserver_template_revision.go:517`, `:584`). + +### T019 (signature change) +- `gameContainerSecurityContext` `ctl/gameserver_controller.go:2496`; `gamePodSecurityContext` `:2612`; `buildConfigInitContainer` `:2336`. Callers: `buildGameContainer` `:2482` (its own signature `:2397` must carry the resolved security, or the resolved values are passed through a new param; this changes 5 test calls, D6); `gamePodSecurityContext` call at `:1935`; `buildConfigInitContainer` call at `:1895`. +- Keep `nil` when nothing is set (byte-identical, R8, FR-002a). +- Depends on T018. + +### T020 (mutate gate) +- Section 3. Gate placement: read prior `ss.Spec.Replicas` before `:1797`; refresh when `ss.ResourceVersion == ""` or prior replicas 0 and `actualReplicas > 0`; otherwise copy security-derived parts forward (game container SC, pod SC, config-init, `security-applied` annotation). Note the early returns `:1798-1805` (D4 and section 5.3). +- Justification: R5, R8, FR-001, FR-008, SC-001. + +### T021 (status.security) +- In `reconcileStatus` (`ctl/gameserver_status.go:42`), compute `desired` from `resolveGameSecurity(tmpl, gs)` where `tmpl` is the effective template (`:562` call). `applied` from the observed annotation (T018); omitted when no start has happened (`applied` absent when the annotation is absent and no pod has started). `pending` per contract. Write through the existing `base`/`orig` patch (`:55-56`, `:315-316`); no separate patch. +- D11: the patch is the whole status diff. Do not write `gs.Status.Agent`. + +### T031 (override layer) +- Extend `resolveGameSecurity` (section 2.2). Justification: R4, FR-003, FR-009. + +### T032 (restricted validation on effective values) +- `workload_security.go:15, 23, 39` take resolved values. Call sites: `ctl/gameserver_controller.go:353` (Reconcile), `ctl/gameserver_template_revision.go:222` and `:288` (admission). Violation: `setPhase` with the existing message (`workload_security.go:18`), server stays failed until fixed, running pod untouched (contract "Restricted workload mode", OD-5 settled A). +- D8: the validator must enforce effective fsGroup > 0 (else `applyWorkloadSecurity`'s `pod.SecurityContext` deref at `:61` can nil-panic). +- Spec `:334` / `:216` / `:278` citations: stale (see section 4.1). + +### T039 (envtest: override saves, pending, rollouts) +- Extend `ctl/gameserver_security_envtest_test.go` (created by T017). Cases: changed override does not change pod template generation or the pod (`pending=true`, `applied` unchanged). An unrelated env change (`spec.env`) rolls the pod (template changes) but must not pick up the pending security change: i.e. `security` parts copied forward (section 3.1 copy-forward applies when not refreshing; a plain env change does not reset replicas from zero, so `refresh` is false). Scale to zero and up refreshes and clears `pending`. Edit back to the applied value clears `pending` (source-only change not pending). Removal returns `ModuleDefault`. Template rollout keeps overridden setting and others follow the new default (US3 scenario 3). Never-started server: `applied` absent. +- D4 must be fixed (`baselineRenderInputs` exclusion) for the baseline-pinned case. + +### T044 (status recompute on pin change, rollout ends in start) +- Recompute is automatic (section 4.4): `pending` is derived each reconcile from the effective template. Writer does not touch the pod. +- Premise correction (section 4.3): a rollout ends in a start only for a running awake server; suspended or idle-asleep servers end at zero. Tests must not assert a start for those. This is a spec-accuracy point for the parent; OD-5/US3 unaffected. + +--- + +## 8. Concrete line index (quick reference) + +| Symbol | File:line (current) | Spec cites | +|---|---|---| +| `GameSecuritySpec` type | `operator/api/v1alpha1/gametemplate_types.go:194` (field `:186`) | `:185` (stale) | +| `GameServerSpec.Capture` | `operator/api/v1alpha1/gameserver_types.go:161` | `:161` OK | +| `GameServerStatus` | `operator/api/v1alpha1/gameserver_types.go:558` (Conditions `:574`) | `:558` OK | +| condition const block | `operator/api/v1alpha1/gameserver_types.go:25-38` | n/a | +| `reconcileStatefulSet` | `operator/internal/controller/gameserver_controller.go:1613` (CreateOrUpdate `:1637`) | `:1611` stale | +| replicas assign | `ctl/gameserver_controller.go:1797` | n/a | +| preserveBaseline early return | `ctl/gameserver_controller.go:1803-1805` | n/a | +| containers rebuild | `ctl/gameserver_controller.go:1833-1834` | n/a | +| config-init assign | `ctl/gameserver_controller.go:1895` | n/a | +| hostport gate | `ctl/gameserver_controller.go:1920-1930` | `:1889-1905` stale | +| pod SC assign | `ctl/gameserver_controller.go:1935` | n/a | +| applyWorkloadSecurity call | `ctl/gameserver_controller.go:1944` | n/a | +| `buildConfigInitContainer` | `ctl/gameserver_controller.go:2336` (fsGroup block `:2345-2352`) | `:2310` stale | +| `buildGameContainer` | `ctl/gameserver_controller.go:2397` (SC call `:2482`) | n/a | +| `gameContainerSecurityContext` | `ctl/gameserver_controller.go:2496` | `:2470` stale | +| `gamePodSecurityContext` | `ctl/gameserver_controller.go:2612` | `:2586` stale | +| `buildAgentContainer` | `ctl/gameserver_controller.go:2621` | n/a | +| Reconcile restricted check | `ctl/gameserver_controller.go:353` (setPhase `:354`) | `:334` stale | +| reconcileStatus call | `ctl/gameserver_controller.go:562` | n/a | +| SetupWithManager | `ctl/gameserver_controller.go:594` (Owns ConfigMap `:605`, Watches Pod `:609`, Template `:610`) | n/a | +| template rollout restricted check (admit A) | `ctl/gameserver_template_revision.go:221-225` | `:216` stale | +| template rollout restricted check (admit B) | `ctl/gameserver_template_revision.go:287-291` | `:278` stale | +| admit computation | `ctl/gameserver_template_revision.go:267` | n/a | +| `baselineRenderInputs` exclusion | `ctl/gameserver_template_revision.go:338-340` | n/a | +| `preserveBaselinePodTemplate` | `ctl/gameserver_template_revision.go:416` | n/a | +| `ownedTemplatePod` | `ctl/gameserver_template_revision.go:498` | `:480` stale | +| `observedTemplateRevision` | `ctl/gameserver_template_revision.go:516` | n/a | +| `validateRestrictedTemplate` | `ctl/workload_security.go:15` | `:15` OK | +| `restrictedContainerSecurity` | `ctl/workload_security.go:23` | `:23` OK | +| `applyWorkloadSecurity` | `ctl/workload_security.go:39` | `:39` OK | +| `reconcileStatus` | `ctl/gameserver_status.go:42` (MergeFrom base `:55`, patch `:316`) | `:42-60` OK | +| `buildBackupPodSecurityContext` | `operator/internal/controller/backup_controller.go:1156` (caller `:1058`) | `:1133` / `:1035` stale | +| restore call | `ctl/restore_controller.go:433` | `:425` stale | +| `ownedTemplatePod` pod name | `gs.Name + "-0"` (`gameserver_template_revision.go:506`) | n/a | +| control-plane namespace flag | `operator/cmd/main.go:277` (default from `POD_NAMESPACE`, else `gameplane-system`) | n/a | +| secret-only cache scoping | `operator/internal/secretscope/cache.go:18-27` (scopes `corev1.Secret` only) | n/a | + +--- + +## 9. Discrepancies and environment checks + +**D1. Test file name collision (T015).** `operator/internal/controller/gameserver_security_test.go` already exists with unrelated tests (`TestValidateServerEnvSecrets` `:16`, `TestReconcileTunnel_CredentialsSecretOwnership` `:333`). T015 must use another file name or get sign-off to append. Evidence: `ls` of the controller directory. + +**D2. Stale citations.** Full list in section 8 ("Spec cites" column). Most significant: T019 `:2470/:2586/:2310`, T020 `:1611`, T020/T021 `:1889-1905`, T032 `:334`, `:216`, `:278`, T043 `:1133/:1035/:425` (backup/restore), `ownedTemplatePod :480`, T005 `:185`. + +**D3. Gate placement (T020).** Spec says "gate near :1889-1905". The real gate pattern R5 cites is the hostport gate at `:1920-1930`. The zero-to-one decision must read `ss.Spec.Replicas` before `:1797` overwrites it. + +**D4. `baselineRenderInputs` would restart a baseline-pinned server on save (T039, FR-008).** `ctl/gameserver_template_revision.go:338-340` hashes the whole `GameServerSpec` except a fixed exclusion list. Adding `GameServerSpec.Security` without excluding it changes the hash, so `preserveBaselinePodTemplate` (`:416`) returns false and the template rewrites. Fix: add `spec.Security = nil` to the list at `:340` (precedent: `Capture`, same comment rationale at `:333-335`). Also: when `preserveBaseline` is true, the mutate function returns at `:1803` before any security write (section 5.3). Document it in T018. + +**D5. T044 premise (rollout always ends in a start) is false for suspended or idle servers.** Evidence: `ctl/gameserver_controller.go:1421-1428` (`stopping := gs.Spec.Suspend || restart == restartDraining || idle == idleAsleep` → `softStop`, replicas 0). Plan gap 3 (`plan.md:86-104`) assumes a start. Correct wording: a refresh waits for the next start; `pending=true` in the meantime. + +**D6. Signature churn breaks test compile (needs sign-off, CLAUDE.md rule 1).** Callers that change if signatures change: +- `buildConfigInitContainer`: `ctl/auxiliary_resources_test.go:69`; `ctl/gameserver_files_test.go:16, 48, 61, 77, 143, 181, 194`; prod `:1895`. +- `buildGameContainer` (5-arg): `ctl/build_game_container_test.go:36, 61, 79, 103, 138`; prod `:1834`. +- `gamePodSecurityContext`: `ctl/build_game_container_test.go:170, 179`; `ctl/workload_security_test.go:93`; prod `:1935`. +- `applyWorkloadSecurity`: `ctl/gameserver_template_revision_test.go:624, 749`; `ctl/workload_security_test.go:94`; prod `:1944`. +- `validateRestrictedTemplate`: `ctl/workload_security_test.go:82`; prod `ctl/gameserver_controller.go:353`, `ctl/gameserver_template_revision.go:222, 288`. +- `restrictedContainerSecurity`: only `ctl/workload_security.go` (`:57`, `:64`). +Recommendation for the parent: keep the existing functions' names; the change is to the argument type. Each test edit is a test change and needs human sign-off. + +**D7. `reconcileStatus` positional callers.** Seven test call sites pass positional args (section 5.1). A new non-variadic parameter breaks them; use a variadic like `hostportConditions` (`gameserver_status.go:46`). + +**D8. Restricted-mode nil dereference dependency.** `ctl/workload_security.go:61` `pod.SecurityContext.RunAsNonRoot = ptrTo(true)` assumes `pod.SecurityContext` non-nil. Today it is non-nil only because `validateRestrictedTemplate` requires template `fsGroup > 0`. With overrides, validation of effective values (T032) must still require effective `fsGroup > 0`, or a restricted server with `fsGroup` `useImageDefault` panics. + +**D9. Restricted mode gives config-init the game identity.** `ctl/workload_security.go:63-65` applies `restrictedContainerSecurity` to every `pod.InitContainers` entry. Non-restricted config-init only gets `RunAsGroup` (`:2347`). T016's "helper containers keep fixed users" must cover this: in restricted mode config-init runs as the game uid (existing behavior). + +**D10. Envtest cache scope and namespace (T060/T061, T039).** `ctl/helpers_envtest_test.go:169-172` restricts the manager cache to the test namespace. Production caches ConfigMaps cluster-wide (only Secrets are scoped, `operator/internal/secretscope/cache.go:18-27`). The settings ConfigMap lives in the control-plane namespace (`operator/cmd/main.go:277`). `GameServerReconciler` has no control-plane namespace field (grep: none in `ctl/`). The field must be injectable; the envtest helper must set it to the test namespace or read via `APIReader`. `Owns(&corev1.ConfigMap{})` (`ctl/gameserver_controller.go:605`) does not enqueue for an unowned ConfigMap, so R9's `Watches(&corev1.ConfigMap{}, ...)` entry is required (`:609-611` shows the existing `Watches` pattern and `mapTemplateToGameServers` at `:617`). + +**D11. MergeFrom is a whole-status diff (T021 wording).** `ctl/gameserver_status.go:55-56` and `:315-316`: `client.MergeFrom(base)` diffs the entire `gs` status, not only `status.security`. `status.agent` is untouched only because the reconciler does not change it. The wording "that field only" in T021 is not how the code works; the requirement (do not clobber the heartbeat) holds. + +**D12. Condition reasons are literal strings (T006).** No reason constants in the package; literals like `"JobFailed"` (`ctl/gameserver_wipe.go:341`). The const block holds only condition TYPE names (`gameserver_types.go:22-38`). + +**D13. i18n for the new condition reason.** `gameserver_types.go:576-580` says the UI resolves condition messages by id `condition..` (lower-cased). `SecurityAllowed` / `RootOverrideDisallowed` needs a translation entry in the web/i18n packs (out of this brief's scope; flag to the web owner). Evidence of the consumer: `web/src/lib/i18n/conditionMessage.test.ts`. + +**D17. Held branches before the gate.** Verified: the held-operation branches that assign `ss.Spec.Replicas` (`:1726-1733`, `:1789`) all `return nil` before `:1797`, so reading `ss.Spec.Replicas` immediately before `:1797` still yields the live value. Replica count and gate are safe. + +**D14. k8s.io/api version and `PodReadyToStartContainers` (unverified).** `operator/go.mod:22` `k8s.io/api v0.37.2`, `:23` `k8s.io/apimachinery v0.37.2`, `:27` `sigs.k8s.io/controller-runtime v0.25.2`. The module source is NOT in the local cache (`/root/go/pkg/mod` holds only `cache/` and `golang.org`), so I could not confirm `corev1.PodReadyToStartContainers` or `corev1.FSGroupChangeAlways` / `corev1.FSGroupChangeOnRootMismatch` by reading source. The constant has been in k8s.io/api core/v1 since v0.29 (PodReadyToStartContainers condition, k8s 1.29). Treat it as expected, not verified; the T018 agent must confirm with `go doc k8s.io/api/core/v1 PodReadyToStartContainers` or by compiling (CLAUDE.md rule 8: compile checks only, which the parent decides). + +**D15. `reconcileStatefulSet` early returns skip security writes (T020).** Held-operation returns (`:1798-1801`) and `preserveBaseline` (`:1803-1805`) happen before any template write. R5's copy-forward is therefore not reached on those paths; the observed annotation and `applied` stay unchanged there. This is the intended behavior for held operations, but T020/T039 must not assume the template is rebuilt on every reconcile. + +**D16. Status writer must use the pinned template.** `reconcileStatus` receives `&tmpl` (effective pin) at `:562`. T021 and T044 must compute `desired` from that object, not from a fresh GET of the installed GameTemplate (which would show the new catalog default before the pin moves). + +--- + +Checked and correct (no discrepancy): `workload_security.go:15, 23, 39`; `gameserver_status.go:42-60` MergeFrom pattern; `gameserver_types.go:161` (Capture) and `:558` (GameServerStatus); `gameserver_controller.go:1613`-ish function existence; `helpers_envtest_test.go` helper names used in T017/T039 exist (`startMgr`, `withGameServerReconciler`, `newNamespace`, `eventually`, `consistently`, `buildGameServer`, `buildGameTemplate`, `getGameServer`, `markGameServerPhase`, `seedGameServer`); `build_game_container_test.go` exists with the three security tests cited in section 6.1; `crd_validation_envtest_test.go` exists with `validGameServer` at `:25`. + +Not read (out of scope or not verified): `docs/agent-architecture.md`, `gameserver_wipe.go` beyond condition lines, `gameserver_sentinel.go` and tunnel/wipe security contexts (only FR-012 claim), `operator/config/crd` and `charts/` file list (not listed; run `ls` before T007). diff --git a/specs/030-security-context-overrides/briefs/02-operator-backup-and-setting.md b/specs/030-security-context-overrides/briefs/02-operator-backup-and-setting.md new file mode 100644 index 000000000..5dc1ceb93 --- /dev/null +++ b/specs/030-security-context-overrides/briefs/02-operator-backup-and-setting.md @@ -0,0 +1,176 @@ +# Brief 02: operator backup/restore fsGroup, cluster root setting, mcp-server fixture + +Scope: T040, T043 (backup/restore), T050, T051, T060, T061 (operator root setting), T022 (mcp-server). Facts verified against the working tree at /home/user/Gameplane on feat/030-security-context-overrides, read-only. Line numbers are current; spec citations that are stale are corrected in Discrepancies. + +## Discrepancies + +D1. Backup security context is defined at `operator/internal/controller/backup_controller.go:1156`, not `:1133`. Its only caller is `backup_controller.go:1058` (inside `buildBackupPodSpec`, which starts at `:1045`). Spec's `:1035` is inside the doc comment of `buildBackupPodSpec` (`:1033-1044`). +D2. The live backup path does not pass through `backup_controller.go:1058` directly. Chain: `backup_worker.go:306` (`Spec: r.buildPreparedBackupPodSpec(b, tmpl, source, bound.UID, preparation)`) -> `backup_worker.go:129` `buildPreparedBackupPodSpec` -> `backup_worker.go:130` `spec := r.buildBackupPodSpec(b, tmpl)` -> `backup_controller.go:1058`. In that chain there is no GameServer or StatefulSet in scope; `bound` (a GameServer, from `r.ownedBackupTarget` at `backup_worker.go:251`) is in scope only at `:300-310` in the caller. T043 must therefore thread the applied fsGroup through three signatures, or pass `bound` / the applied value from `backup_worker.go:306`. +D3. Restore: `buildRestorePodSpec` is defined at `restore_controller.go:425` and its security call is `restore_controller.go:433` (`SecurityContext: buildBackupPodSecurityContext(tmpl),`). Spec's `:425` is the def line, which is fine. The caller is `restore_controller.go:277`. `gs` (GameServer) is in scope there (`effectiveGameTemplate(ctx, r.apiReader(), &gs)` at `:216`), so the applied value can be read from `&gs` plus its StatefulSet. +D4. ConfigMap RBAC marker is `operator/internal/controller/gameserver_controller.go:261` (`// +kubebuilder:rbac:groups=core,resources=services;persistentvolumeclaims;configmaps,verbs=get;list;watch`), not `:258`. Events markers are `:268-269`. Chart ClusterRole grant is `charts/gameplane/templates/operator.yaml:66` (configmaps get/list/watch) and events create/get/list/patch/watch at `operator.yaml:74-75`. The spec's "no new RBAC marker" holds. +D5. `SetupWithManager` is `gameserver_controller.go:594-613`. The Pod and GameTemplate watches are at `:609-611`. `Owns(&corev1.ConfigMap{})` already exists at `:605`. Consequence: the cluster-wide ConfigMap informer already exists, so research R9's "one more watched object" is zero extra informers. `operator/internal/secretscope/cache.go:26-28` restricts only `corev1.Secret`, not ConfigMaps. The new `Watches(&corev1.ConfigMap{}, ...)` (T060) reuses the existing informer. Do not add `GenerationChangedPredicate` (ConfigMaps have no generation bump semantics that help here); filter by name and namespace in the map function or a predicate. +D6. Control-plane namespace: the operator does NOT get it from the release namespace by default. In a default chart install the operator is started with `--control-plane-namespace={{ include "gameplane.operatorClusterCredentialsNamespace" . }}` (`charts/gameplane/templates/operator.yaml:396`). `gameplane.operatorClusterCredentialsNamespace` (`_helpers.tpl:220-226`) returns `gameplane.credentialsNamespace` when the API is enabled and not standalone, which is `api.credentialsNamespace` or `operator.controlPlaneNamespace` or `-credentials` (`_helpers.tpl:212-218`); the release namespace only in standalone or no-API mode. The API's own namespace is `GAMEPLANE_NAMESPACE` = pod namespace (`charts/gameplane/templates/api.yaml:398-400`), and it also gets `GAMEPLANE_CREDENTIALS_NAMESPACE` (`api.yaml:402-403`). Consequence for T057/T058: the ConfigMap `gameplane-security-settings` must be written to and read from the credentials/control-plane namespace the operator watches (`--control-plane-namespace`), not `.Release.Namespace`. T058's Role "in the release namespace" is wrong for the default install; it must be in the namespace the API writes, which is `GAMEPLANE_CREDENTIALS_NAMESPACE`. Flag this to the orchestrator. +D7. `WakeStartNamespace` is set from `controlPlaneNamespaceDefault` (`operator/cmd/main.go:538`), not from the flag variable `controlPlaneNamespace` (declared `:144`, flag at `:277`, value from `POD_NAMESPACE` env else `gameplane-system` at `:273-276`). The two diverge when the flag is overridden. `GameServerReconciler` has no control-plane namespace field at all (struct `gameserver_controller.go:45-60`). T060 must add `ControlPlaneNamespace string` to the struct and set it from `controlPlaneNamespace` in the construction at `cmd/main.go:517-540` (`ClusterStatusReconciler` already gets `controlPlaneNamespace` at `cmd/main.go:661`). Reading the namespace with the `WakeStartNamespace` value is the wrong source. +D8. The GameServer controller has NO event recorder and emits no events today. `GameServerReconciler` fields (`gameserver_controller.go:45-60`) have no `EventRecorder`. grep for `Eventf(` / `.Event(` in `operator/internal/controller/*.go` (non-test) finds only `backup_controller.go:876` and `module_locales.go:501`. T061's "emit an event" needs a new field. Pattern to copy: `backup_controller.go:142-148` (`EventRecorder recorder.EventRecorder`), `cmd/main.go:581` (`EventRecorder: mgr.GetEventRecorder("backup-controller")`), helper `backup_controller.go:869-876` (`recordEvent`). Note 159 test sites construct `GameServerReconciler{...}` without a recorder (e.g. `gameserver_status_envtest_test.go:384`, `:2525`), so any emit must be nil-safe or the tests panic. +D9. Stale citations for the GameServer controller, all corrected here: `validateRestrictedTemplate` caller is `gameserver_controller.go:353` (not `:334`); template-revision callers are `gameserver_template_revision.go:222` and `:288` (not `:216`, `:278`); `buildConfigInitContainer` def `:2336` (not `:2310`), call `:1895`; `gameContainerSecurityContext` def `:2496` (call `:2482` inside `buildGameContainer` def `:2397`, not `:2371`); `gamePodSecurityContext` def `:2612` (call `:1935`, not `:2586`/`:1909`); `applyWorkloadSecurity` call `:1944` (not `:1918`); `buildGameContainer` call `:1834` (not `:1808`); `reconcileStatefulSet` def `:1613`, its `CreateOrUpdate` mutate at `:1637` (not `:1611`); the hostport gate that R5 mirrors is `:1916-1925` (not `:1889-1905`; the condition is `:1920`). +D10. `ownedTemplatePod` is `operator/internal/controller/gameserver_template_revision.go:498` (not `:480`). Signature `ownedTemplatePod(ctx, reader client.Reader, gs *GameServer) (*corev1.Pod, error)`. +D11. The spec assumes the R5 "copy forward" is a single gate. It is not: the mutate function assigns the whole pod template wholesale after the replica decision. Order inside the mutate func (`gameserver_controller.go`): replicas set `:1797` -> held-return `:1798-1801` -> `preserveBaseline` return `:1803-1804` -> `ServiceName`/`Selector`/labels `:1807-1816` -> `ss.Spec.Template.Annotations = ann` `:1832` -> `Containers = [buildGameContainer, buildAgentContainer]` `:1833-1836` -> InitContainers `:1894-1896` (nil at else branch) -> hostport affinity gate `:1919-1925` -> pod `SecurityContext = gamePodSecurityContext(tmpl)` `:1935` -> `applyWorkloadSecurity(...)` `:1944`. T020 must snapshot the existing StatefulSet's security-derived parts (pod `SecurityContext`, game container `SecurityContext`, config-init container, `gameplane.local/security-applied` annotation) before `:1832-1944` and restore them when not refreshing. The hostport gate only covers affinity and an annotation, so it is a pattern, not a drop-in. +D12. T039 says "Extend `operator/internal/controller/gameserver_security_envtest_test.go`", but that file does not exist (only `gameserver_security_test.go` exists, with `TestValidateServerEnvSecrets` and `TestReconcileTunnel_CredentialsSecretOwnership`). T051 creates it. Not in my scope but the orchestrator should know T039 is wrong. +D13. T022 says "`mcp-server/tools.go` redaction". There is NO redaction in tools.go. The only transform is `stripManagedFields` (`tools.go:353-375`), which deletes `metadata.managedFields`. Spec and status are returned verbatim, so the round-trip assertion holds with no code change, as research R15 says. Citations: generic list handler `tools.go:114` (registered `:63`), generic get handler `tools.go:140` (registered `:70`). R15's `tools.go:64, 109, 135` is stale. +D14. T022 fixture: `newUnstructuredCRD(kind, ns, name string, status map[string]any)` (`mcp-server/main_test.go:147-161`) sets only `status`, has no spec parameter. `testClientWithFixtures` (`main_test.go:163-182`) hard-codes one GameServer with `status.phase: Running`. The new fixture needs a separate unstructured object with `spec.security` and `status.security`, passed to `dynamicfake.NewSimpleDynamicClientWithCustomListKinds(scheme, gvrToListKindMap(), obj)` and `kube.NewFrom(typed, dyn, scheme)` (`main_test.go:181`). Do not change the shared fixture's existing assertions. +D15. Interaction not in the spec: the idle wake reservation runs BEFORE the StatefulSet mutate. `gameserver_idle.go:333` calls `r.reserveWakeStart(ctx, gs)` (`gameserver_wake_admission.go:23`) and sets status "cold start admitted; waiting for game readiness" (`gameserver_idle.go:341`). A sleeping server with a root override, held by T061 at zero, still consumes a fleet wake admission and reports cold start admitted while the StatefulSet stays at zero. T061 should either skip admission for held servers or set a status reason. Decision needed; flag to orchestrator. +D16. Test call sites of changed signatures (will not compile after T043/T019/T060-T061 unless updated; CI is the verifier): + - `buildRestorePodSpec` (T043): `operator/internal/controller/recovery_test.go:104`, `recovery_controller_test.go:991`, `auxiliary_resources_test.go:63`, `restore_delete_flag_test.go:24`. + - `buildPreparedBackupPodSpec` (T043, if its signature changes): `backup_budgets_test.go:556, 570, 584`. + - `buildConfigInitContainer` (T019): `gameserver_files_test.go:16, 48, 61, 77, 143, 181, 194`; `auxiliary_resources_test.go:69`. + - `gamePodSecurityContext` (T019): `build_game_container_test.go:170, 179`; `workload_security_test.go:93`. + - `buildGameContainer` (T019): `build_game_container_test.go` (5 calls in total in `*_test.go`). + - `reconcileStatus` (T061 if it gets a new param): 8 test call sites (e.g. `gameserver_status_envtest_test.go:385`). + - `reconcileStatefulSet` (T020/T061): 54 test call sites in `*_test.go`. + Prefer adding an argument-free accessor or a new variadic param over changing positional signatures. + +## T040 (test cases, `backup_envtest_test.go` and `gameserver_security_test.go`) + +- Existing envtest file: `operator/internal/controller/backup_envtest_test.go` (funcs `TestBackup_*`, e.g. `:22`). Suite: `suite_envtest_test.go` (`TestMain` at `:37`). +- Existing unit file: `operator/internal/controller/gameserver_security_test.go` (`package controller`, funcs at `:16`, `:333`). Add cases there; do not rename. +- Cases to add (from spec T040 / research R6): stopped server with pending fsGroup change; start in progress whose pod has not passed volume setup. Assert `buildBackupPodSecurityContext` (after T043 signature, takes applied group) and restore pod (`restore_controller.go:433`) use applied.fsGroup, not desired. Start failing before volume setup leaves `applied` and `pending` unchanged. Never-started server (no observed annotation) uses desired. +- Observed-applied source (T018, not written yet): StatefulSet annotation `gameplane.local/security-applied-observed`, read from the StatefulSet object (not pod template). Helper name per T018 is `resolveGameSecurity` family in `gameserver_security.go` (does not exist yet). + +## T043 (implementation, `backup_controller.go`, `backup_worker.go`, `restore_controller.go`) + +Current code, `backup_controller.go:1156-1166`: +```go +func buildBackupPodSecurityContext(tmpl *gameplanev1alpha1.GameTemplate) *corev1.PodSecurityContext { + nonRoot := true + uid := int64(65532) + fsGroup := uid + if tmpl.Spec.Security != nil && tmpl.Spec.Security.FSGroup != nil { + fsGroup = *tmpl.Spec.Security.FSGroup + } + return &corev1.PodSecurityContext{ + RunAsNonRoot: &nonRoot, + RunAsUser: &uid, + RunAsGroup: &uid, + FSGroup: &fsGroup, + SeccompProfile: &corev1.SeccompProfile{Type: corev1.SeccompProfileTypeRuntimeDefault}, + } +} +``` +Intended change: take the applied filesystem group as a `*int64` (nil = never started, fall back to the template value as today; non-nil = applied value, which may be 0 or any uid). Shape: +```go +func buildBackupPodSecurityContext(tmpl *GameTemplate, appliedFSGroup *int64) *corev1.PodSecurityContext +// fsGroup := uid; if appliedFSGroup != nil { fsGroup = *appliedFSGroup } else if tmpl...FSGroup != nil { fsGroup = *tmpl...FSGroup } +``` +Note: the "never started" fallback must be decided from `status.security.applied` absence, not from a zero value. Keep the default 65532 unchanged. + +Restore (`restore_controller.go:423-433`): `buildRestorePodSpec(rs, src, tmpl)` gains the applied group (read from `&gs` plus its StatefulSet in the same reconcile); call site `restore_controller.go:277`. Test call sites: see D16. + +Backup (`backup_controller.go:1045`, `backup_worker.go:129-130`, `backup_worker.go:306`): thread the applied group from `bound` (GameServer, `backup_worker.go:251`) at `:306`, through `buildPreparedBackupPodSpec` (`:129`) into `buildBackupPodSpec` (`:1045`) and then `:1058`. The applied reader from T018 needs `r.backupAPIReader()` or the same reader used at `:300`. + +Depends on T018 (applied reader and annotation codec). Do not implement the reader in T043. + +## T050 (unit tests, `operator/internal/controller/gameserver_security_test.go`) + +- New file `operator/internal/controller/security_settings.go` (NEW, does not exist). Functions to test: `hasRootOverride(gs *GameServer) bool`, `rootOverrideSettings(gs *GameServer) []string` (names offending settings), and the ConfigMap reader (absent, missing key, `"false"`, garbage, `"true"`; only exact `"true"` is on, everything else off). +- Root forms per FR-005/R9 (table): override `runAsUser` value 0 or `useImageDefault: true`; `runAsGroup` value 0 or `useImageDefault: true`; `fsGroup` value 0. Non-root values and a module default that is root (template `security.runAsUser: 0`) are NOT overrides and must return false. `fsGroup` `useImageDefault` is not in the rule table (R3/R10 list only runAsUser/runAsGroup useImageDefault and fsGroup value 0); test should assert exactly that. +- Template field names: `GameTemplateSpec.Security` (`operator/api/v1alpha1/gametemplate_types.go:177`), `GameSecuritySpec` `:185-204`. GameServer override field does not exist yet (T006/T007). + +## T051 (envtest, NEW `operator/internal/controller/gameserver_security_envtest_test.go`) + +- Pattern to copy: any `*_envtest_test.go` (e.g. `gameserver_status_envtest_test.go`). Reconciler construction in envtests: `&GameServerReconciler{Client: k8sClient, APIReader: k8sClient, Scheme: scheme, ...}` (`gameserver_status_envtest_test.go:384`, `:2525`). Set the new `ControlPlaneNamespace` field (D7) in the test to the namespace where the test writes the ConfigMap. +- Empty `ControlPlaneNamespace` (as in the 159 existing constructions) must mean "setting off" (fail closed), so existing tests keep working. +- Assertions per T051: ConfigMap absent or `"false"` + stopped server with root override stays at 0 replicas with `SecurityAllowed=False` reason `RootOverrideDisallowed` naming the settings; running server keeps pod and restart count and only gets the informational condition; flipping ConfigMap to `"true"` starts the stopped server (the watch re-enqueues it) with no other event; clearing the override starts it; flipping off never restarts or stops any server; unrelated servers not enqueued by the flip. + +## T060 (NEW `operator/internal/controller/security_settings.go`, `gameserver_controller.go:605-611`) + +- ConfigMap name: `gameplane-security-settings`, key `allowRootOverrides`. Namespace: the operator's `--control-plane-namespace` (D6, D7). Read from the informer cache (`r.Get` on `corev1.ConfigMap`, cluster-wide informer already exists via `Owns` at `:605`) or from `r.APIReader` as the wake path does (`gameserver_wake_admission.go:26`). Fail closed on any error or missing object. +- Watch: add next to the existing watches at `gameserver_controller.go:609-611`: +```go +Watches(&corev1.ConfigMap{}, handler.EnqueueRequestsFromMapFunc(r.mapSecuritySettingsToGameServers)). +``` + Map function filters `obj.GetName() == "gameplane-security-settings" && obj.GetNamespace() == r.ControlPlaneNamespace`, then lists GameServers (`r.List`, cached, like `mapTemplateToGameServers` at `:618-`) and enqueues those for which `hasRootOverride` is true, across all namespaces. Unrelated servers not enqueued. +- No new RBAC marker: `gameserver_controller.go:261` already covers configmaps get/list/watch; chart `operator.yaml:66` covers it. +- Add `ControlPlaneNamespace string` to `GameServerReconciler` (`gameserver_controller.go:45-60`) and set it in `operator/cmd/main.go:517-540` from `controlPlaneNamespace` (D7). Do not reuse `WakeStartNamespace`. + +## T061 (`reconcileStatefulSet`, `gameserver_status.go`, events) + +Where to hold (research R9): before the R5 refresh, so the StatefulSet is left as it was. +- Existing precedent inside the same mutate func: guard holds set `actualReplicas = 0` (`gameserver_controller.go:1645`, `:1686`, `:1710`, `:1740`, `:1757`, `:1765`, `:1772`); `ss.Spec.Replicas = &actualReplicas` at `:1797`; return-early before template assignment at `:1798-1804` (`held` branch returns at `:1798-1801`; `preserveBaseline` return at `:1803-1804`). +- Proposed placement: immediately BEFORE `ss.Spec.Replicas = &actualReplicas` at `:1797` (after `preserveBaselinePodTemplate` at `:1793`), because `CreateOrUpdate` has already loaded the existing StatefulSet into `ss` and `:1797` overwrites `ss.Spec.Replicas`; checking the existing replicas after `:1797` would read the new value, not the live one: +```go +existing := !ss.CreationTimestamp.IsZero() || ss.ResourceVersion != "" +wasStopped := existing && (ss.Spec.Replicas == nil || *ss.Spec.Replicas == 0) +if holdRoot /* !securityAllowed && hasRootOverride(&live) && actualReplicas > 0 */ && wasStopped { + return nil // StatefulSet left exactly as it was (zero replicas, old template) +} +// not existing (create): fall through, render at zero: actualReplicas = 0 (a StatefulSet cannot be created without containers). +``` + Guard against holding a RUNNING server: the condition must be `ss.Spec.Replicas` already zero (or create). A running server (`*ss.Spec.Replicas > 0` and desired > 0) must be left untouched: no zeroing, no template change. Desired zero (suspend/idle, `desiredReplicas` at `gameserver_controller.go:1320`) is never changed. +- Hold must not stop a running server: when `ss.Spec.Replicas > 0`, skip the hold entirely (even when the ConfigMap is off). +- Condition source: `reconcileStatus` (`gameserver_status.go:42-46`) takes `hostportConditions ...*metav1.Condition` as its last param; the existing caller passes `plan.hostportCondition` at `gameserver_controller.go:562`. `reconcileStatefulSet` returns only `error` (`:1613`). The hold decision must reach status: add a field on the reconcile-local state or a second return. Helpers to mirror: `applyHostportCondition` (`gameserver_status.go:330`), `removeCondition` (`gameserver_status.go:1287`), status applied at `:197-201`. +- Condition `SecurityAllowed`: `False` / reason `RootOverrideDisallowed` with settings named (`rootOverrideSettings`) and what clears it; `True` once allowed or cleared. For a running server: `False` with the "keeps running but will not start again" message (R9). +- Event: needs `EventRecorder` on `GameServerReconciler` (D8). Nil-safe emit (159 test constructions have no recorder). Pattern: `backup_controller.go:869-876`. Reason suggestion: `RootOverrideDisallowed`. RBAC for events already present (`gameserver_controller.go:268`). +- Never restart or stop on a flip: the ConfigMap watch (T060) only enqueues. Turning the setting off must not change `ss.Spec.Replicas` of a running server. +- Interaction D15 (wake admission) must be decided. + +## T020 interaction note (for the R5 copy-forward used by T061's ordering) + +Copy-forward must happen after `:1803` and before `:1832-1944` (D11). Do not place the T061 hold inside the copy-forward branch. + +## T050/T051 test helpers and bucket + +- Bucket: `test/e2e/buckets.sh` (`bucket_operator`) for the E2E tests in T042/R16 (not my task; R16 decides `bucket_operator`). + +## T022 (mcp-server) + +- Test file: `mcp-server/main_test.go` (540 lines). Helpers: `newUnstructuredCRD` `:147-161`; `gvrToListKindMap` `:139-145`; `testClientWithFixtures` `:163-182`; `callToolText` `:108-137`; `connectInMemory` `:54-73`; happy path `TestToolsListAndGetHappyPath` `:184-259` (uses `list_gameplane_resources` and `get_gameplane_resource` on GameServer `games/my-server`). +- Add a new test func (e.g. `TestGameServer_SecurityFieldsUnredacted`) that builds a GameServer unstructured object with `spec.security` (runAsUser/runAsGroup/fsGroup value and useImageDefault forms) and `status.security` (`desired`, `applied`, `pending`), gives it a fake dynamic client via `kube.NewFrom` (`main_test.go:181`), calls `get_gameplane_resource` and `list_gameplane_resources` and asserts the JSON text contains the security keys and values unchanged. +- Do not change `tools.go`: no redaction exists (D13), and the T022 task says no code change. +- Docs: `mcp-server/README.md` one example (tool table at `README.md:64`, `:67`; "read-only" sentence at `:37`); `mcp-server/specs.md` one sentence (generic exposure is at `specs.md:57`, Security considerations at `specs.md:150`). +- Read-only: `TestRegisteredToolsAreReadOnly` (`main_test.go:75`) and `TestClientHasNoMutatingMethods` (`main_test.go:42`) must keep passing; the new test adds no write tool. + +## Facts summary (exact current locations) + +| What | Where | +|---|---| +| buildBackupPodSecurityContext def / call | backup_controller.go:1156 / :1058 | +| buildBackupPodSpec def | backup_controller.go:1045 (doc 1033-1044) | +| buildPreparedBackupPodSpec def / call to buildBackupPodSpec | backup_worker.go:129 / :130 | +| buildPreparedBackupPodSpec call (job) | backup_worker.go:306 | +| buildRestorePodSpec def / security call / job call | restore_controller.go:425 / :433 / :277 | +| GameServerReconciler struct | gameserver_controller.go:45-60 (WakeStartNamespace :54) | +| SetupWithManager / Owns(ConfigMap) / Pod+Template Watches | :594 / :605 / :609-611 | +| RBAC configmaps / events markers | :261 / :268-269 | +| reconcileStatefulSet def / CreateOrUpdate | :1613 / :1637 | +| replicas assignment / preserveBaseline return | :1797 / :1803 | +| containers / init / pod SecurityContext / applyWorkloadSecurity | :1833 / :1894-1896 / :1935 / :1944 | +| hostport gate | :1916-1925 | +| desiredReplicas def / Suspend check / idle sleep check | :1320 / :1352 / :1414, :1423 | +| validateRestrictedTemplate caller | :353 | +| gameContainerSecurityContext def / call | :2496 / :2482 (inside buildGameContainer def :2397, call site :1834) | +| buildConfigInitContainer def / call | :2336 / :1895 | +| gamePodSecurityContext def | :2612 | +| reconcileStatus def / caller | gameserver_status.go:42 / gameserver_controller.go:562 | +| applyHostportCondition / removeCondition | gameserver_status.go:330 / :1287 | +| ownedTemplatePod | gameserver_template_revision.go:498 | +| validateRestrictedTemplate template-revision callers | gameserver_template_revision.go:222, :288 | +| wake reservation (before mutate) | gameserver_idle.go:333; gameserver_wake_admission.go:23-26 | +| Operator flag control-plane-namespace | operator/cmd/main.go:273-278 (flag :277) | +| WakeStartNamespace construction | operator/cmd/main.go:538 (uses controlPlaneNamespaceDefault) | +| GameServerReconciler construction | operator/cmd/main.go:517-540 | +| ClusterStatusReconciler gets controlPlaneNamespace | operator/cmd/main.go:661 | +| Backup EventRecorder pattern | operator/cmd/main.go:581; backup_controller.go:142-148, :869-876 | +| Secret-only cache restriction | operator/internal/secretscope/cache.go:18-30 | +| Chart operator controlPlane flag | charts/gameplane/templates/operator.yaml:396 (helper _helpers.tpl:220-226; credentials ns _helpers.tpl:212-218) | +| Chart operator ClusterRole configmaps / events | charts/gameplane/templates/operator.yaml:66 / :74-75 | +| Chart API GAMEPLANE_NAMESPACE / CREDENTIALS | charts/gameplane/templates/api.yaml:398 / :402-403 | +| mcp-server shared fixture / helpers | mcp-server/main_test.go:163-182 / :147-161 | +| mcp-server generic handlers | mcp-server/tools.go:114 (list), :140 (get), registration :63, :70 | +| mcp-server managedFields strip (only transform) | mcp-server/tools.go:353-375 | + + +## Reviewer additions + +- R1. The T061 snippet in the first draft read `ss.Spec.Replicas` after `:1797` (already overwritten); corrected above to evaluate before the assignment. `live` (the GameServer read inside the mutate, `var live gameplanev1alpha1.GameServer` at `:1650`) is the variable to pass to `hasRootOverride`; the outer `gs` may be stale. +- R2. ConfigMap informer is cluster-wide: `operator/cmd/main.go` cache options (`secretscope.CacheOptions`, `cache.go:18-30`) restrict only Secrets, so a ConfigMap in the control-plane namespace is readable from cache. Confirmed. +- R3. T060/T040/T001 spec citations stale: T060 cites `gameserver_controller.go:583` (actual Watches `:609-611`) and `:258` (actual `:261`); T040 cites `backup_controller.go:1133`/`:1035`/`restore_controller.go:425` (see D1, D3). diff --git a/specs/030-security-context-overrides/briefs/03-api.md b/specs/030-security-context-overrides/briefs/03-api.md new file mode 100644 index 000000000..90a87533d --- /dev/null +++ b/specs/030-security-context-overrides/briefs/03-api.md @@ -0,0 +1,285 @@ +# Brief 03: API (T009-T014, T028, T033, T047-T049, T055-T059) + +Factual scout brief. Repo `/home/user/Gameplane`, branch `feat/030-security-context-overrides`. All line numbers are as found today (read-only scout, no source edited). Spec sources: `spec.md`, `plan.md`, `research.md` (R9-R13), `data-model.md`, `contracts/rbac-permission.md`, `contracts/api-server-security.md`, `contracts/cluster-setting.md`, `contracts/audit-events.md`, `tasks.md`. + +Abbrev: VAP = `validateAndProtectGameServer`. CS = `writeServerValidationError`. + +--- + +## 0. Citation corrections (spec says -> code has) + +| Spec citation | Actual | Note | +|---|---|---| +| `resources.go:538` (VAP) | `resources.go:570` | comment block 548-569 | +| create calls VAP `:218` | `resources.go:250` | inside `else` after `resolveNS` (`:246-258`) | +| update calls VAP `:290` | `resources.go:322` | `live` fetched `:300-313` | +| clone calls VAP `lifecycle.go:243` | `lifecycle.go:243` | correct; `cloneHandler(reg)` at `lifecycle.go:196` | +| capture block `resources.go:565-583` | `resources.go:597-614` | `// 1. Validate spec.capture` at 597 | +| `resources.go:538` insertion "after capture step" | insert after line 614 (`}`), before blank 615 and `// 2. Validate spec.serviceAccountName` at 616 | | +| `MountResources` call `main.go:382` | `api/cmd/main.go:396` | `MountLifecycle` `:400`, `MountConfigWithTelemetry` `:407`, `MountCapture` `:454` | +| config audit pattern `config.go:174-179` | `config.go:175-178` | | +| rule table config:manage `rbac.go:223-228` | config rules are `rbac.go:209` (GET config:read) and `rbac.go:214` (`{segment:"admin",prefix:"/admin/config",perm:"config:manage"}`). `rbac.go:223-228` is registries and telemetry. | no rule change needed | +| `servers:write` route `rbac.go:267` | `rbac.go:253` | `{segment: "servers", perm: "servers:write"}` | +| catalog `servers` group `catalog.go:25-29` | correct; `servers:console` is `catalog.go:28` | | +| `privilegedPermissions` `privileged_grants.go:21` | correct | SQL `IN (...)` lists at `privileged_grants.go:43` and `:57` | +| `writeServerValidationError` `resources_snapshot.go:24` | correct (`:24-33`) | see Discrepancy D1 | +| `MountResources` `resources.go:51` | correct | | +| `newValidators` `config.go:462` | correct (`:462-471`) | | +| `config.go` PUT handler | `config.go:115` (`put`) | | +| `db.Store` config get | `api/internal/db/config.go:13` `ConfigValue(ctx, key) (string, bool, error)`; `ConfigValueTx` `:19` | no exported setter | +| `audit.MarkRecorded` | `audit/audit.go:602` (package func, takes ctx) | | +| `Auditor.WriteSync` | `audit/audit.go:711` `(ctx, method, path, target, reason string, status int) error` | | +| capture precedent | `handlers/capture.go:1252-1258` (`auditWriteOrFail`) | matches | +| `User.Can` | `auth/perms.go:123` `Can(perm string, namespaced bool, cluster, ns string) bool`; nil-safe (`if u == nil return false`) | | +| `T012` "resources_security_test.go" | file already exists (519 lines), see D7 | | + +--- + +## 1. Shared facts (verified) + +- **Permission reads (captures:manage precedent)**, `resources.go:578-582`: + ```go + u := auth.UserFromContext(ctx) + isAdmin := false + canManageCaptures := false + if u != nil { + isAdmin = u.Role == "admin" || u.Can("*", false, cl, ns) + canManageCaptures = isAdmin || u.Can("captures:manage", true, cl, ns) + } + ``` + For security: `canSetSecurity := isAdmin || u.Can("servers:security", true, cl, ns)` (same block, same `u != nil` guard). `cl := scope.RequestedCluster(req)` in handlers (`resources.go:249`, `:321`, `lifecycle.go:242`). +- **Capture step shape to mirror** (`resources.go:597-614`): if `!canManage`: `live == nil` -> refuse when present and non-nil; else compare with `reflect.DeepEqual` -> refuse on change; absent in request and present in live -> `_ = unstructured.SetNestedField(desired.Object, liveRaw, "spec", "capture")` (restore). Plain `errors.New` returns, mapped to 403 by CS. +- **Errors/status**: `writeServerValidationError` (`resources_snapshot.go:24-33`): + ```go + code := http.StatusForbidden + if errors.Is(err, errTemplateRefImmutable) { code = http.StatusConflict } + if errors.Is(err, errSnapshotSourceUnavailable) { code = http.StatusServiceUnavailable } + httperr.WriteCode(w, req, code, err) + ``` + `httperr.WriteCode` (`httperr/httperr.go:202-217`) uses the passed `status`, and for a `*httperr.Message` in the chain uses only `m.English` and `m.ID`/`m.Args`, not `m.Status`. + `httperr.WriteMessage(w, r, m)` (`httperr.go:224-238`) uses `m.Status` (>=500 masked). `httperr.Write` (`:245`) uses `classify` which honors `*Message` status (`:260-266`). `messages.New(id, args) *httperr.Message` (`messages/messages.go:252-262`). +- **decode of request body**, `resources.go:512-520`: `json.NewDecoder(...).Decode(&map[string]any)`. Integers arrive as **float64**. Live objects from the dynamic client are **int64**. See D9. +- **Config PUT** (`config.go:115-181`): section lookup `h.validators[section]` (`:117`) -> 400 `server.config.unknown_section`; body read; empty body -> 400 `server.empty_body` (`:126-129`); `canon, err := validate(body)` (`:131`); errors: `*httperr.Message` -> `WriteMessage`; else `WriteCode(422, err)` (`:136-140`). Telemetry branch `config.go:151-160` (`if section == "telemetry" {...}`), generic upsert `config.go:161-172` (`} else if _, err := h.db.DB.ExecContext(... INSERT INTO config ...`), audit loop `config.go:175-179`, response `config.go:181`. +- **Audit row precedent in config** (`config.go:175-178`): after the config write, `_ = h.auditor.WriteSync(req.Context(), http.MethodPut, "/admin/config/auth", evt.role, reason, http.StatusOK)` (error ignored). +- **validators map** `config.go:462-471`: + ```go + return map[string]func([]byte) (json.RawMessage, error){ + "general": validateGeneral, "auth": validateAuth(helmOIDCPresent), "notifications": validateNotifications, + "telemetry": validateTelemetry, "i18n": validateI18n, registry.ConfigSectionModRegistries: validateModRegistries, + } + ``` + `validateTelemetry` (`config.go:769-779`) is the model: unmarshal, canonicalize, `json.Marshal`. `getAll` (`config.go:80-114`) returns only keys in `h.validators`, so `security` appears automatically once registered. +- **Kube clients / registry** (`api/internal/kube/registry.go`, `kube/client.go:18-27`): `*kube.Registry` with `IDs() []string` sorted (`registry.go:249-258`), `Get(id) (*Client, bool)` (`:160`), `Default()` (`:169`), `Management()` (`:138`). `kube.Client` has `Dynamic dynamic.Interface`, `Typed kubernetes.Interface`. Per-request cluster: `resolveCluster(w, req, reg)` (`resources.go:113`), `scope.RequestedCluster(req)` (`scope/cluster.go:46`). +- **Namespaces the API uses** (`api/cmd/main.go`): + - `cfg.namespace` from `GAMEPLANE_NAMESPACE`, default `gameplane-system` (`main.go:726`). Chart sets it to the pod's own namespace via fieldRef (`charts/gameplane/templates/api.yaml:398-399`), i.e. the release namespace. + - `credentialsNS, moduleConfigMapNS := cfg.managementNamespaces()` (`main.go:231`). `managementNamespaces` (`main.go:625-634`): `credentials = GAMEPLANE_CREDENTIALS_NAMESPACE || cfg.namespace`; standalone -> `(credentials, cfg.namespace)`; else `(credentials, credentials)`. Chart sets `GAMEPLANE_CREDENTIALS_NAMESPACE` (`api.yaml:402`) when not standalone. + - `moduleConfigMapNS` is passed to `MountModulesWithRegistry` (`main.go:423`). +- **Operator's control-plane namespace** (for the ConfigMap T057): `operator/cmd/main.go:273-277` defaults to `POD_NAMESPACE` / `gameplane-system`; the chart passes `--control-plane-namespace={{ gameplane.operatorClusterCredentialsNamespace }}` (`charts/gameplane/templates/operator.yaml:396`). That helper (`_helpers.tpl:220-226`) is `-credentials` (via `gameplane.credentialsNamespace`) when API enabled and not standalone, else `operator.controlPlaneNamespace` or release namespace. **So the operator reads the ConfigMap in `credentialsNS` (non-standalone) or the release namespace (standalone), which is `moduleConfigMapNS` from `main.go:231` in both modes.** See D12. +- **Chart API RBAC**: `charts/gameplane/templates/api-credentials.yaml` (rendered only when `apiEnabled` and not standalone, line 3). Role `{{ .Release.Name }}-api-credentials` in `$namespace` (= credentials namespace) at `:14-37`; configmaps rule at `:31-36`: + ```yaml + - apiGroups: [""] + resources: [configmaps] + {{- if $rbac.catalogAdmin }} + verbs: [get, list, create, update, delete] + {{- else }} + verbs: [get, list] + {{- end }} + ``` + RoleBinding `:39-50`, subject `ServiceAccount gameplane-api` in release namespace (`:47-49`). `charts/gameplane/templates/api.yaml` has the cluster read ClusterRole (`:21`), Roles `-api-games` `:74` and `-api-logs` `:139` in release namespace, no configmap write. Operator ClusterRole has `configmaps` get/list/watch at `operator.yaml:66`. +- **Route mounting**: `mountOne` (`resources.go:57-66`) mounts `POST /` -> `createHandler` (`:60`), `PUT /{name}` -> `updateHandler` (`:65`). +- **Clone** `cloneHandler(reg *kube.Registry)` (`lifecycle.go:196`), `MountLifecycle(r, reg)` (`lifecycle.go:40`), `stampOwner` (`ownership.go:41`). Clone: `clone := src.DeepCopy()` (`:216`), `RemoveNestedField` for nodeDiagnostic (`:234`), `validateCloneConfig` (`:237`), **VAP call `:243` with `live == nil`**, Create `:246-248`. Clone has no store and no auditor. +- **Envtest suite** `api/internal/handlers/suite_envtest_test.go`: TestMain builds `mountedR` (`:~119-142`) with `MountResources(mountedR, reg, nil)` (`:124`), `MountLifecycle(mountedR, reg)` (`:125`), `captureAuditStore` (`file:captureaudit?mode=memory&cache=shared&_pragma=journal_mode(WAL)`), `captureAuditor := audit.New(captureAuditStore)` (`:121`), `MountConfig(mountedR, captureAuditStore, captureAuditor, false, "", nil)` (`:141`), `apiSrv`/`apiBase`. `kubeC` is the envtest client; `reg.Set(scope.DefaultCluster, kubeC)` pattern at `:86-96` in suite. +- **Envtest router helpers to copy**: + - `newCaptureRBACRouter` (`capture_rbac_envtest_test.go:84-100`): `reg := kube.NewRegistry(scope.DefaultCluster); reg.Set(scope.DefaultCluster, kubeC); r := chi.NewRouter(); r.Use(rbac.Middleware(reg)); MountCapture(r, reg, audit.New(captureAuditStore), ...)`. + - `doAsUser(t, h, u, method, path, body)` (`capture_rbac_envtest_test.go:103-118`) injects user via `auth.WithUser(t.Context(), u)`. + - `newConfigRBACRouter` (`config_envtest_test.go:36-44`): `r.Use(rbac.Middleware(kube.NewRegistry("default")))` (no clusters registered), `MountConfig(r, captureAuditStore, audit.New(captureAuditStore), false, "", nil)`. + - `doConfigAsUser` (`config_envtest_test.go:47-67`), `configAdminUser` (`:69`), `configOperatorUser` (`:81`), `configViewerUser` (`:105`). + - `doJSON`/`getDynamic`/`gvrServers()` in `resources_envtest_test.go:306-347` use `apiBase` (no user, no RBAC middleware). + - `createRBACTestServer(t, name, ownerID)` (`capture_rbac_envtest_test.go:128-160`) creates a GameServer fixture in `scope.DefaultNamespace` via `kubeC.Dynamic`. + - User fixtures: `operatorUser()` `:163`, `viewerUser()` `:181`, `adminUser()` `:199` (Perms keyed `"*": {"*": {...}}`). +- **Unit fixtures** `api/internal/handlers/resources_fake_test.go:15-21`: `mountResourcesRouter(k)` = `reg.Set(scope.DefaultCluster, k)`, `MountResources(r, reg, nil)` (nil store, no auditor). `fakeKubeClient(objs...)` in `modules_fake_test.go:27`; `newServerObj(ns, name)` in `lifecycle_fake_test.go:28`. +- **Existing security unit test file** `api/internal/handlers/resources_security_test.go` (519 lines): helpers `doWithUser(t, h, method, path, body, user) *httptest.ResponseRecorder` (`:16`), `testOperatorUser()` (`:40`, perms servers:read/write only), `testAdminUser()` (`:56`, `{"*": {"*": {}}}`). Tests `TestResources_Security_CaptureBypassBlocked` (`:69`), `..ServiceAccountNameOverrideBlocked` (`:98`), `..ImageOverrideBlocked` (`:140`), `..SecretRefExfiltrationBlocked` (`:182`), `..TunnelCredentialsSecretProtected` (`:435`). Names do not collide with the new `servers:security` work. +- **Rbac test helpers** `api/internal/rbac/rbac_test.go`: `userForRole(t, store, role)` (`:17-24`, binds seeded perms at `scope.DefaultCluster` `"*"`), `loadRolePerms` (`:26`), `migratedStore(t)` (`:44`, sqlite `:memory:`), `TestAllow` (`:57`). +- **Seeded roles**: `api/internal/db/migrations/sqlite/003_roles.sql:38-60` (admin `*`; operator explicit list at `:43-60` with `servers:console` at `:49`; viewer has no rows here). Postgres twin `migrations/postgres/003_roles.sql:54`. `servers:security` is in NO seed row (admin `*` covers it). +- **Message registry**: `messages/entries_server.go` (`serverEntries`, sorted by id, `Entry{ID, English, Description, Status}`); roles block `:111-151`, `server.shares.expires_at_in_past` at `:152-157` (`{` on 152). `messages.go:216-229` merges `entries` + `serverEntries` and sorts. `export.go` `ExportJSON` (for i18n sync). +- **i18n**: `i18n/locales/en/app.json` (2-space indent): `server.roles.role_not_found` block `:1038-1041`, `server.shares.expires_at_in_past` starts `:1042`. `i18n/locales/fr/app.json` (4-space indent): `server.roles.role_not_found` `:862-865`, `server.shares.expires_at_in_past` `:866`. `i18n/locales/fr/.review.json` holds per-key `sourceHash` (e.g. `"server.roles.role_not_found": "07ba515a3db3"` line ~221). `i18n-check` (`i18n/cmd/i18n-check/main.go`): `--check-server` flags server.* drift both ways vs the registry (`:543-563`); `--sync-server` replaces en server.* from the registry; `--stamp` records sourceHash for translated entries that lack one (`:77`). + +--- + +## 2. Per-task edits + +### T009 Catalog entry +File `api/internal/rbac/catalog.go`, insert after line 28 (`servers:console`), inside the `servers` group (lines 25-29): +```go +{Key: "servers:security", Label: "Set or change a server's security overrides (run-as user and group, filesystem group, volume ownership check)", Namespaced: true}, +``` +Do NOT add to `privilegedPermissions` (`handlers/privileged_grants.go:21`). Justification: contracts/rbac-permission.md "Catalog entry", "Privilege grant guard"; OD-1; research R10. No seed row, no migration (admin `*` covers it). No route rule (rule table unchanged). + +### T010 Catalog and admin tests +- `api/internal/rbac/catalog_test.go:20-38` `TestNamespaced` map: optionally add `"servers:security": true`. Existing cases end at line 36-37 (`"audit:read": false`, then `"*"` and `"unknown:key"`). +- `api/internal/rbac/rbac_test.go`: new test. For each of `RoleAdmin`, `RoleOperator`, `RoleViewer` call `userForRole(t, store, role)` (`:17`), assert `u.Can("servers:security", true, scope.DefaultCluster, scope.DefaultNamespace)` true only for admin. Store from `migratedStore(t)` (`:44`). Also assert `ValidPermission("servers:security")` and `Namespaced("servers:security")` (`catalog.go:111`, `:117` funcs). +- `TestCatalog_CoversSeededPermissions` (`catalog_test.go:68`) and `TestCatalog_CoversRuleTablePermissions` (`catalog_test.go:104`) need no change (no seed or rule references the key). + +### T011 Message registry and locale keys +Add three entries to `api/internal/messages/entries_server.go` after line 151 (end of `server.roles.role_not_found`), before `server.shares.expires_at_in_past` (`:152`). Sort order holds (`server.roles.*` < `server.security.*` < `server.shares.*`). +```go +{ + ID: "server.security.forbidden", + English: "changing security settings requires the servers:security permission", + Description: "API error from the GameServer save path (resources_security.go) when a caller without servers:security changes spec.security.", + Status: http.StatusForbidden, +}, +{ + ID: "server.security.root_disabled", + English: "root values (user 0, group 0, filesystem group 0, or the image default for user or group) are not allowed until an administrator enables root overrides", + Description: "API error from the GameServer save path when a new or changed root value is saved while the allow-root-overrides setting is off. Argument setting names the first offending setting.", + Status: http.StatusForbidden, +}, +{ + ID: "server.security.invalid", + English: "invalid security override: {detail}", + Description: "API error from the GameServer save path when spec.security has an invalid shape. Argument setting names the offending setting; argument detail says what is wrong.", + Status: http.StatusUnprocessableEntity, +}, +``` +Text from contracts/api-server-security.md "Errors". Add matching en keys in `i18n/locales/en/app.json` after line 1041 (before `"server.shares.expires_at_in_past"` at 1042), 2-space indent, shape `"server.security.forbidden": {"defaultMessage": "", "description": ""}`. `i18n-check --check-server` requires the en text and description to equal the registry exactly. +Add fr keys in `i18n/locales/fr/app.json` after line 865, 4-space indent, French `defaultMessage` (translator review needed; proposal: forbidden "la modification des paramètres de sécurité exige l'autorisation servers:security"; invalid "dérogation de sécurité invalide : {detail}"). Then `fr/.review.json` needs `sourceHash` entries via `i18n-check --stamp` (not run by fixers; CI verifies). +Test requirements: `messages/messages_test.go` checks only sorted/unique, non-empty descriptions, `httperr` ids registered. `messages/usage_test.go:TestEveryMessagesNewLiteralIsRegistered` checks each literal `messages.New("server.…")` in `api/internal` non-test files is registered, and at least 100 sites. Neither verifies that every entry is used (D2). + +### T012 Field-level security step (new file) +- NEW `api/internal/handlers/resources_security.go`. Function name not present in repo (grep: no `security` func in handlers outside tests and comments). +- Call site: insert after `resources.go:614` in VAP (before `// 2.` at 616). Current code at 597-616 (capture block then blank). Add a block that runs the cases from contracts/api-server-security.md table (order: 1 unchanged accept; 2 absent restore; 3 changed+no permission 403; 4 shape 422; 5 root rule 403). +- Call sites that already call VAP and need no signature change for T012 alone: create `resources.go:250`, update `resources.go:322`, clone `lifecycle.go:243`. +- Case 1 compare: normalize numbers before compare (see D9). Case 2 restore: copy the capture pattern `_ = unstructured.SetNestedField(desired.Object, liveRaw, "spec", "security")` (`SetNestedField` deep-copies values, so use JSON-native types, see D10). +- Clone (`live == nil`): present and non-nil spec.security without permission -> 403 (research R10 "clone reads as create"). +- Refusals must carry status: return `messages.New("server.security.forbidden", nil)` (a `*httperr.Message`, status 403). Requires CS fix, see D1 and D11. + +### T013 Unit tests for T012 cases +- File: NOT a new file (D7). Options: append to existing `api/internal/handlers/resources_security_test.go` (already has `doWithUser`, `testOperatorUser`, `testAdminUser`), or create `resources_security_override_test.go`. +- Fixtures: `newServerObj(ns, name)` (`lifecycle_fake_test.go:28`) + `fakeKubeClient(...)` (`modules_fake_test.go:27`) + `mountResourcesRouter(k)` (`resources_fake_test.go:15`). The router passes **nil store and nil auditor** (D10). Unit tests for create/update/clone can call the validator directly with `ctx` carrying the user (`auth.WithUser`) to avoid the router; pass a `*db.Store` only where the root rule is exercised (T055 tests). +- Cases: both absent (unchanged, 200), equal (200), restored field (absent in request, live present, no permission: 200, field restored), forbidden on create (`live == nil`), update and clone. + +### T014 Envtest for permission behavior +- New file `api/internal/handlers/resources_security_envtest_test.go`. Does not exist yet (ls confirmed). +- Build a dedicated router (do not use `mountedR`, D10): `reg := kube.NewRegistry(scope.DefaultCluster); reg.Set(scope.DefaultCluster, kubeC); r := chi.NewRouter(); r.Use(rbac.Middleware(reg)); MountResources(r, reg, captureAuditStore, audit.New(captureAuditStore)); MountLifecycle(r, reg, ...)` (signature changes per T055/T059, D13). Use `doAsUser` (`capture_rbac_envtest_test.go:103`) style with a user holding `servers:read`, `servers:write` (copy `operatorUser` shape without `servers:security`), and `adminUser()`. +- Fixture: `createRBACTestServer` (`capture_rbac_envtest_test.go:128`) creates a bare server in `scope.DefaultNamespace` with `templateRef.name: minecraft`; for clone and update tests use a unique name (`uniqueResourceName`, `suite_envtest_test.go:157`). +- Note: `rbac.Middleware` `servers:write` rule `rbac.go:253`; `/servers` PUT and POST need `servers:write`. Owner fallback `rbac.go:122-150` does not cover full PUT (contract). + +### T028 Shape-case tests (unit + envtest) +- Extend `resources_security_test.go` and `resources_security_envtest_test.go` (see T013/T014). Cases: `value` 4294967296, `-1`, both `value` and `useImageDefault`, neither, `useImageDefault:false`, unknown member, bad enum (`volumeOwnershipCheck` not in `EveryStart|OnlyWhenWrong`), non-integer `value` (e.g. 1.5). Expect 422 `server.security.invalid` with `args.setting`, and nothing created (`kubeC.Dynamic` Get returns NotFound). A valid override (`value: 2000`) stored and returned. +- Shape rules: contracts/api-server-security.md case 4; data-model.md (`SecurityIDOverride`). + +### T033 Shape validation +- Function in `resources_security.go`. Input is `spec.security` from the desired object (map from `decode`, numbers are float64, see D9). Validate each of `runAsUser`, `runAsGroup`, `fsGroup`: a map with exactly one of `value` (whole number 0..4294967295, accept float64 when `v == math.Trunc(v)`, and int64 for safety) or `useImageDefault` (must be `true`); unknown members rejected; `volumeOwnershipCheck` string in the enum (or absent). Return `messages.New("server.security.invalid", map[string]any{"setting": name, "detail": text})` with status 422. +- Note the CRD CEL stays the second line (T006/T008, not this brief). + +### T047 Config section tests +- Extend `api/internal/handlers/config_envtest_test.go` and add validator unit tests (new in `config_validators_test.go`, pattern `TestValidateI18n` at `:240-250`, and `TestUpdatesSectionRemoved` at `:233-238`). +- Router: `newConfigRBACRouter` (`config_envtest_test.go:36-44`) registers no cluster, so the ConfigMap write has zero clusters (D13). The envtest for the ConfigMap must register `kubeC` (`reg.Set(scope.DefaultCluster, kubeC)`) and pass `reg` plus namespace into `MountConfig` (signature change, D13). +- Users: `configViewerUser()` (`config_envtest_test.go:105`) for the 403 case, `configAdminUser()` (`:69`) for success. Reads via `GET /admin/config` (`getAll` `config.go:80`). +- ConfigMap failing write: use a `Typed` fake whose ConfigMap create/update returns an error (e.g. `k8sfake` reactor `PrependReactor`), or use `k8sfake.NewSimpleClientset()` with a reactor. Expect 502 per contracts/cluster-setting.md? (see D14; existing `httperr` writes 500 for unknown errors). + +### T048 Root rule tests +Unit and envtest in `resources_security_test.go` and `resources_security_envtest_test.go`. Cases: new or changed `runAsUser` or `runAsGroup` with `value: 0` or `useImageDefault: true`, or `fsGroup` `value: 0`: 403 `server.security.root_disabled` with `args.setting` while off, 200 once on (`PUT /security-settings?cluster=` by admin). `fsGroup` `useImageDefault` allowed. Unchanged stored root value passes an unrelated whole-spec PUT with setting off. Removal and replacement always allowed. + +### T049 Audit tests +Unit: `reason` builder (new func in `resources_security.go` or `resources_security_audit.go`). Envtest: rows via `GET /admin/audit` or direct `audit` store read, and `GET /admin/audit/verify`. See audit-events.md "Events" and "reason". Failure tests: a broken store (`newBrokenAuditStore`, `capture_rbac_envtest_test.go:323-357`) with `TestCaptureAudit_BrokenStore_FailsOperation` (`:359`) as the model for "failed WriteSync returns 500, nothing saved". + +### T055 Root rule (API) +- Read the setting: `store.ConfigValue(ctx, "security")` (`db/config.go:13`), decode `{"allowRootOverrides": bool}`; absent or unparsable -> false (fail closed). Guard `store == nil` (tests pass nil, D10). +- Predicate (contract api-server-security.md "A root value"): `runAsUser`/`runAsGroup` with `value == 0` or `useImageDefault == true`; `fsGroup` with `value == 0`. Count only new or changed root values (vs `live`; `live == nil` means new). Unchanged stored root value passes. +- Error: `messages.New("server.security.root_disabled", map[string]any{"setting": ""})`, status 403. Order of "first offending": runAsUser, runAsGroup, fsGroup (assumption; contract says "the first offending setting"). +- Read only when a new or changed root value exists ("one indexed config read, only on a request that carries a new or changed root value", contract). + +### T056 Register `security` validator and flip audit +- Add `"security": validateSecurity,` to the map in `newValidators` (`config.go:462-471`). `validateSecurity(body []byte) (json.RawMessage, error)` modeled on `validateTelemetry` (`config.go:769-779`): struct `{AllowRootOverrides *bool \`json:"allowRootOverrides"\`}`; nil -> error (422 via `config.go:136-140`); canonical `json.Marshal`. Unknown members dropped by struct decode. +- `put` branch: insert a `section == "security"` branch next to the telemetry branch at `config.go:151`, or before the generic upsert at `config.go:161`. It must NOT fall into the generic `INSERT INTO config` branch (`config.go:161-172`) because the order is ConfigMap first (T057). +- Flip detection: read the old value with `h.db.ConfigValue(ctx, "security")` (or `db.ConfigValueTx` inside a tx) before writing; if the new value differs, write the audit row before the writes: + - `h.auditor.WriteSync(req.Context(), http.MethodPut, "/security-settings", "security/", "allowRootOverrides:false->true", http.StatusOK)`; on error `httperr.WriteCode(w, req, 500, errors.New("audit write failed"))` and return (pattern `capture.go:1252-1258`); on success `audit.MarkRecorded(req.Context())`. + - Then ConfigMap write (T057), then config row upsert. If a later write fails, write a second row `reason: security_save_failed`, status error code (audit-events.md "Write order" 2). + - No flip -> no extra row (generic middleware row stands). +- Reason string: `allowRootOverrides:false->true` or `true->false` (direction from old to new). +- Config row upsert SQL for reuse (`config.go:161-171`): + ```sql + INSERT INTO config(key, value, updated_at) VALUES (?, ?, ?) + ON CONFLICT(key) DO UPDATE SET value = excluded.value, updated_at = excluded.updated_at + ``` + with `db.NowTimestamp()`. (`db/telemetry.go` has unexported `upsertConfigTx`, D15.) + +### T057 ConfigMap mirror (new file) +- NEW `api/internal/handlers/security_settings_sync.go`. +- ConfigMap: name `gameplane-security-settings`, namespace = `moduleConfigMapNS` (`main.go:231`; see D12), labels `app.kubernetes.io/managed-by: gameplane-api`, data `allowRootOverrides: "true"|"false"`. +- Writer: loop `for _, id := range reg.IDs()` (`kube/registry.go:249`); `c, ok := reg.Get(id)` (`:160`); skip nil `c` or nil `c.Typed`; `c.Typed.CoreV1().ConfigMaps(ns)` Get then Create (NotFound) or Update. Fail the request on any error (T057: "failing the request if the write fails"). +- Start-up sync: rewrite from the config row (contract cluster-setting.md "Storage and routes" operator mirror). Call site: `api/cmd/main.go`, after `reg`/`store` are built and before serving; `ns` is `moduleConfigMapNS` (`main.go:231`) which is in scope there (declared at `:231`, used by `:423`). +- Config handler needs `reg` and `ns` (MountConfig has neither today, D13). + +### T058 Chart RBAC +- Target file is `charts/gameplane/templates/api-credentials.yaml` (D12), NOT `api.yaml`. Add a rule to the Role `{{ .Release.Name }}-api-credentials` (`:14-37`, namespace `$namespace` = credentials namespace): + ```yaml + - apiGroups: [""] + resources: [configmaps] + resourceNames: ["gameplane-security-settings"] + verbs: [get, create, update, patch] + ``` + (the existing `configmaps` rule `:31-36` has no resourceNames, so do not reuse it for the write verbs). +- Standalone: `api-credentials.yaml:3` renders only when not standalone. For standalone the namespace is the release namespace (`moduleConfigMapNS` = `cfg.namespace`), so an equivalent Role/RoleBinding for the API (subject `gameplane-api`) in the release namespace is also needed (in `api.yaml` where the other API Roles live, `:74-158`). Verify against `charts/gameplane/templates/_helpers.tpl:220-226` before writing. +- Chart test fixtures: `charts/gameplane/tests/` has only `monitoring-rules.test.yaml` (no RBAC fixture found). No chart test change expected. + +### T059 Audit wiring in MountResources, create, update, clone +- `MountResources(r chi.Router, reg *kube.Registry, store *db.Store)` (`resources.go:51`): add `auditor *audit.Auditor` param (contract: "gains the audit writer"). Thread into `mountOne` (`:55`) and `createHandler(reg, gvr)` (`:222`), `updateHandler(reg, gvr)` (`:275`). Call site `main.go:396`: pass `auditor` (in scope, `main.go:269`). +- Create (`resources.go` create block, VAP call `:250`, Kubernetes write `:259` namespaced / `:241` cluster): before `:259`, if `spec.security` changed (`before {}`, `after` listed), `WriteSync(req.Context(), req.Method, req.URL.Path, name, reason, http.StatusCreated)`; on error 500 `audit write failed`, return; on success `audit.MarkRecorded`. After a failed Kubernetes write add `security_save_failed` row. +- Update (VAP call `:322`, Kubernetes write `:340` namespaced / `:333` cluster): same, before `:340`, `status http.StatusOK`. +- Refusals (403/422): the validator has no `req` or auditor, so return a typed error (e.g. `*securityRefusal{status, reason string, err *httperr.Message}`) and have the handler write the row (`reason` `security_forbidden`, `security_root_disabled:runAsUser`, `security_invalid:fsGroup`) with `WriteSync`; on WriteSync failure leave MarkRecorded unset (middleware fallback), still return the refusal (audit-events.md "Write order" 3). +- Clone: `cloneHandler(reg)` (`lifecycle.go:196`) has no auditor. Contract audit-events.md "Events" lists clone, T059 does not. Needs `MountLifecycle(r, reg)` (`lifecycle.go:40`) signature change to take the auditor (and store for T055 when clone passes VAP, D11). Call sites: `main.go:400`, `lifecycle_fake_test.go:24`, `lifecycle_suspend_test.go:41`, `suite_envtest_test.go:125`. +- `reason` builder: JSON `security:{"before":{...},"after":{...}[,"risky":[...]]}`. Values: not set -> `null`; number -> number; image default -> `"image"`; ownership check -> `"EveryStart"`/`"OnlyWhenWrong"`. Only changed settings. `risky` lists changed settings whose template `risky` member is set (names only). Template: read `kube.GVRs["templates"]` cluster-scoped by `spec.templateRef.name` (same pattern as `managedTemplateBlocked`, `resources.go:452-454`). `risky` does not exist in the code yet (D8). +- Confirm the clone path is covered by the shared validator: yes, `lifecycle.go:243` calls the same VAP (`:243`). + +--- + +## 3. Discrepancies + +**D1. `writeServerValidationError` does not pass status-carrying errors through.** Evidence: `resources_snapshot.go:24-33` sets `code := 403` by default and calls `httperr.WriteCode(w, req, code, err)`. `WriteCode` (`httperr.go:202-217`) writes the `code` it is given and only takes `m.English`, `m.ID`, `m.Args` from a `*Message`, ignoring `m.Status`. So a `messages.New("server.security.invalid", ...)` (status 422) would reach the client as 403. Contract claim "the new errors carry their own status, so writeServerValidationError passes them through" is false today. Fix in CS: `var m *httperr.Message; if errors.As(err, &m) { httperr.WriteMessage(w, req, m); return }` before the code switch. Existing errors (`errTemplateRefImmutable` 409, `errSnapshotSourceUnavailable` 503) must keep their codes (they are plain errors, so unaffected). + +**D2. Messages tests do not require every ID to be used.** Evidence: `messages/messages_test.go` (`TestAllSortedAndUnique`, `TestEveryEntryHasDescription`, `TestKnownIDsAreRegistered`, ...) and `messages/usage_test.go:TestEveryMessagesNewLiteralIsRegistered` check only that literal ids are registered. Nothing flags an unused entry. Task T011 and the contract ("the existing messages_test.go and usage_test.go require every ID to be used") are inaccurate. CI for locale drift is `i18n-check --check-server` (`i18n/cmd/i18n-check/main.go:543-563`), which does check en/registry parity. + +**D3. Config empty body is 400, not 422.** Evidence: `config.go:126-129` returns `messages.New("server.empty_body", nil)`; `messages.go:94-98` sets `Status: http.StatusBadRequest`. Contract cluster-setting.md ("rejects ... an empty body (422)") and T047 say 422. Either change the test expectation to 400 (matches existing sections) or change the contract. Tests are not changed without sign-off (CLAUDE.md rule 1), so this is for the maintainer. + +**D4. Config flip audit order differs from the existing pattern.** Evidence: existing audit rows in `put` are written after the config row (`config.go:175-178`) and errors are ignored (`_ =`). Contract audit-events.md "Write order" requires `WriteSync` before the ConfigMap and config row writes, returning 500 with no change if it fails. Build the new branch to the contract, not to the `config.go:175-178` pattern. Only the row format (`reason`, `target`) is copied. + +**D5. Stale line citations in the spec and contracts.** See section 0 (VAP at 570, create at 250, update at 322, capture block 597-614, `MountResources` main.go:396, config rule rbac.go:214, servers:write rbac.go:253, audit 175-178, `rbac.go:223-228` is the wrong range). + +**D6. Clone is listed in the audit contract but not in T059.** Evidence: audit-events.md "Events" row "Override set, changed or removed (create, update, clone)"; T059 lists only create and update. `cloneHandler` has no `*audit.Auditor` (`lifecycle.go:196`). Decide: add clone audit (needs `MountLifecycle` signature change, D13) or change the contract. + +**D7. `resources_security_test.go` already exists.** Evidence: `api/internal/handlers/resources_security_test.go` (519 lines, 5 existing tests, helpers `doWithUser`, `testOperatorUser`, `testAdminUser`). T013 says "Unit tests in ... resources_security_test.go" (fine if extending), but its phrasing and the file list in T014/T028/T048/T049 mix extend and create. `resources_security_envtest_test.go` does NOT exist yet (ls). New production file `resources_security.go` does NOT exist (ls). Decided by OD-9 item 2 (briefs/00-rulings.md): never edit the existing file; use the new `security_overrides_test.go` and `security_overrides_envtest_test.go`. + +**D8. `risky` does not exist in the code.** Evidence: `grep -rli risky --include=*.go .` returns 0 files. The audit `risky` marker (T059, audit-events.md) depends on the template CRD field from T005 (`GameSecuritySpec.risky`, `operator/api/v1alpha1/gametemplate_types.go:185`), which is not yet written. The API reads templates as unstructured, so the field path is `spec.security.risky..reason` (confirm with T005). Until T005 lands, the `risky` key is always absent. + +**D9. Numeric types differ between request and live object, so DeepEqual gives false "changed".** Evidence: `resources.go:512-520` `decode` uses `json.Decoder` into `map[string]any`, so integers are **float64**. Live objects from `k.Dynamic` are unstructured with **int64** integers (standard client-go decode; module cache not present locally to double-check, so treat as expected). `reflect.DeepEqual(float64(2000), int64(2000))` is false. The capture precedent compares only bools/strings, so it never hit this. Case 1 "unchanged" must compare numerically (e.g. normalize both sides via `json.Marshal` or convert all numbers to float64 before DeepEqual). + +**D10. Nil store and nil auditor in every existing router, and in the envtest `mountedR`.** Evidence: `MountResources(…, nil)` in `resources_fake_test.go:19`, `suite_envtest_test.go:124`, `server_identity_test.go:52`, `config_create_race_test.go:48,139`, `resources_annotations_test.go:21`, `resources_snapshot_test.go:224`, `config_clone_race_test.go:40`, `shares_test.go:1096` (store is non-nil there). A nil `*audit.Auditor` makes `WriteSync` (`audit.go:711`) dereference nil; a nil `*db.Store` makes `ConfigValue` (`db/config.go:13`) dereference nil. Any test that sets a security block through these routers panics unless (a) the new code nil-guards, or (b) the call sites are updated to pass a real store and auditor. Updating existing tests needs sign-off (CLAUDE.md rule 1). Use new dedicated routers for the security envtests (D13-style). +- Also `SetNestedField` deep-copies via `runtime.DeepCopyJSONValue`, which (per apimachinery) panics on Go `int`; fixtures must use `float64` or `int64` (unverified locally, module cache absent). + +**D11. The root rule and audit need store/auditor inside the validator, and `cloneHandler` has neither.** Evidence: VAP signature `resources.go:570-575` `(ctx, k, cl, ns, name, desired, live)`, no store or auditor. `cloneHandler(reg)` `lifecycle.go:196` and `MountLifecycle(r, reg)` `lifecycle.go:40`. T055 says "through the `*db.Store` MountResources already receives", which is true for create and update only. Options: add `sec securityDeps{store, auditor}` param to VAP and to `MountLifecycle`; or pass store and auditor through a closure. Decide before T012/T055. + +**D12. ConfigMap namespace and Role location.** Evidence: T058 says Role in the release namespace via `api.yaml`. The operator reads the ConfigMap in its control-plane namespace, which the chart sets to `-credentials` when the API is enabled and not standalone (`charts/gameplane/templates/operator.yaml:396`, `_helpers.tpl:220-222`). The API writes to `moduleConfigMapNS` (`main.go:231`), which equals `GAMEPLANE_CREDENTIALS_NAMESPACE` in non-standalone and `cfg.namespace` in standalone. `GAMEPLANE_NAMESPACE` (`api.yaml:398-399`) is the release namespace, so using `cfg.namespace` for the non-standalone write would put the ConfigMap where the operator does not look. Also the API's existing grant in that namespace is `api-credentials.yaml` (`:14-37`), so the new rule belongs there (and an equivalent for standalone in `api.yaml`). + +**D13. Config and lifecycle constructors have no registry or namespace; test call sites are many.** Evidence: `MountConfigWithTelemetry(r, store, auditor, helmOIDCPresent, storageClass, helmPolicy, tel)` (`config.go:55`) has no `*kube.Registry` or namespace. `MountConfig` is called in 14 places across 8 files (`main.go:407`, `config_test.go`, `config_envtest_test.go:41` and `:736`, `config_db_test.go`, `telemetry_envtest_test.go`, `registry_secret_test.go`, `suite_envtest_test.go:141`, `config.go`). `MountLifecycle` has 4 call sites (`main.go:400`, `lifecycle_fake_test.go:24`, `lifecycle_suspend_test.go:41`, `suite_envtest_test.go:125`). Adding parameters means updating all of them. Test fixtures in `config_envtest_test.go:36-44` register no cluster (`kube.NewRegistry("default")`), so a ConfigMap write there would hit zero clusters and the flip test would pass vacuously unless the fixture registers `kubeC`. + +**D14. Failing ConfigMap write status.** Evidence: T047 and contract cluster-setting.md say "502 with the existing error body" for a failing ConfigMap write, and T047 says "a failing ConfigMap write returns an error". Contract cluster-setting.md "Storage and routes" says 502. `httperr.Write` (`httperr.go:245-258`) returns 500 for an unclassified error. To return 502 use `httperr.WriteCode(w, req, http.StatusBadGateway, ...)` (only for 5xx, the message is masked to the generic status text, `WriteCode` `:203-205`). + +**D15. No exported db helper to write a config row.** Evidence: the only writes are inline SQL in `config.go:161-171` and `config.go:270-280` and an unexported `upsertConfigTx` in `db/telemetry.go:~109-115`. Reuse the inline SQL in the handler (as today) or add an exported `db` helper. Either is fine; flag for consistency with contract "ConfigMap first then the config row". + +**D16. Multi-cluster ConfigMap writes on remote clusters are not designed.** Evidence: `reg.IDs()` covers all registered clusters (`kube/registry.go:249`), but the remote cluster's control-plane namespace and whether the API's remote kubeconfig may write ConfigMaps there is not defined anywhere in the chart I read (`operator.yaml` `remoteClusters` branch and `api-credentials.yaml` only cover the home cluster). Contract says "every registered cluster the API can reach"; the remote namespace (`operatorClusterCredentialsNamespace` on the remote chart) and its RBAC are unverified. Open item for the maintainer. + +**D17. Envtest suite router cannot exercise the new paths as-is.** `mountedR` (`suite_envtest_test.go:119-142`) has nil store (`:124`), no rbac middleware, and no auditor on `MountResources`. `resources_envtest_test.go` helper `doJSON` uses `apiBase` with no user at all, so `validateAndProtectGameServer` sees `u == nil` (permission false) for every call. Security envtests must build a dedicated router like `newCaptureRBACRouter` (`capture_rbac_envtest_test.go:84-100`) with `rbac.Middleware`. + +**D18. T013's "clone with live == nil" and create share one branch.** Confirmed: `lifecycle.go:243` passes `nil` live, same as `resources.go:250`. No discrepancy in behavior; noted because T013 lists clone separately. + +--- + +## 4. Open items (not verifiable by read) + +- `api/internal/rbac/middleware` `Can` namespace semantics for `scope.DefaultNamespace` vs `"*"` bindings used in T010: `userForRole` binds at `"*"` namespace (`rbac_test.go:17-24`); `Can` treats a cluster-wide `"*"` binding as holding namespaced perms (`perms.go` comment at `:118-128`). Assumed, not run. +- SQL dialect: no new migration (contract). `config` row key `security` needs no schema change. +- Postgres seed `migrations/postgres/003_roles.sql` unchanged. +- Local verification: per CLAUDE.md rule 8, only `go build ./...` is allowed locally. Not run by this scout. diff --git a/specs/030-security-context-overrides/briefs/04-chart-e2e-gpmodule-docs.md b/specs/030-security-context-overrides/briefs/04-chart-e2e-gpmodule-docs.md new file mode 100644 index 000000000..861e1b97c --- /dev/null +++ b/specs/030-security-context-overrides/briefs/04-chart-e2e-gpmodule-docs.md @@ -0,0 +1,140 @@ +# Brief 04: chart, E2E, gp-module, module repo, docs + +Scope: T030, T042, T053, T054, T058, T064 (chart, E2E), T038 (gp-module), T036 (module repo, validate.py, schema), T065-T068 (docs and specs). Facts checked against the tree at `/home/user/Gameplane` on `feat/030-security-context-overrides` and the module repo at `/home/user/module`. No source file was edited. + +Note on the tree: `modules/` in `/home/user/Gameplane` is an empty, uninitialised submodule. The module repo itself is at `/home/user/module` (contains `validate.py`, `test-validate-py.sh`, `palworld/`, `.schema/`). + +## Discrepancies + +1. **Chart T058 placement (CORRECTED by review).** `charts/gameplane/templates/api.yaml:16` opens `{{- if not .Values.api.standalone }}` but it closes at `:136`, BEFORE the `gameplane-api-logs` Role/RoleBinding (`:137-164`). So that Role is rendered in standalone installs too. `:165` `{{- end }}` closes the `apiEnabled` guard opened at `:8`. Insert the new Role/RoleBinding after `:164` and BEFORE `:165` (inside `apiEnabled`; do not place after `:165`). No standalone decision is needed (Q2 withdrawn). +2. **Chart T058 `create` verb.** Kubernetes does not enforce `resourceNames` on `create` (the name is unknown at authorisation time). A Role with `resourceNames: [gameplane-security-settings]` and verb `create` grants create on every ConfigMap in the release namespace. Options: a second Role without `resourceNames` for `create` only, or drop `create` and pre-create the ConfigMap via Helm (then the API only needs get/update/patch). Surface to the human before implementing. +3. **Chart T058 test fixture.** No Helm RBAC fixture exists. The only chart test is `charts/gameplane/tests/monitoring-rules.sh` (run from `.github/workflows/ci.yaml:1232`). CI runs `helm template` at `ci.yaml:1291, 1313, 1329`. T058's "add a Helm check if a fixture exists" resolves to: none exists. Adding one is a new test, so ask first (CLAUDE.md rule 1). +4. **suite-components.json line numbers.** Spec says `:32, 46`. Actual: `"^TestGameServer_"` at `test/e2e/suite-components.json:34` and `"^TestAPI_"` at `:48`. Mapping content is as the spec says. +5. **buckets.sh tally comment location.** Spec cites `buckets.sh:355-362` for the "operator: 4 admin logins" tally. That text is in the comment block above `bucket_multicluster` (starts `:356`, tally line `:363`, function `:367`). `bucket_operator()` is at `test/e2e/buckets.sh:36` and has no tally comment. The T064 comment must be added above `:36` (before `bucket_operator() {`). The "4" figure is not verified here (no login count was done). +6. **Busybox helpers do not take a security block.** `test/e2e/test_helpers_e2e_test.go:42-70` (`applyBusyboxTemplate`) builds a GameTemplate with no `security` key. `:73-113` (`applyBusyboxGameServer`, `applyBusyboxGameServerSpec`) builds a GameServer with only `templateRef` and optional `capture`. Spec's "`:42-90`" range is loose. T030 needs either a new helper variant that accepts a `security` map, or inline `unstructured` objects inside `gameserver_security_e2e_test.go`. +7. **gp-module template validator is not in rules.go.** The template-schema check is `validateTemplateSchema` in `gp-module/internal/validator/schema.go:279`. Template-level calls are wired in `gp-module/internal/validator/validator.go:167-170` (`validateTemplateSchema`, `validateImageDigest`, `validatePorts`, `validateConfigSchemaRules`). `rules.go` holds `validatePorts` (`:147`) and `validateConfigSchemaRules` (`:261`). New checks may live in `rules.go` (as the plan says) but must be called from `validator.go` next to `:169-170`. +8. **gp-module has no security knowledge today.** `grep -i security|risky|fsGroup` over `internal/validator` and `internal/preview` returns nothing. The only `DefaultSecurity` uses are `internal/archetypes/archetypes.go:83-85` (type `SecurityDef`, field `DefaultSecurity`) and `internal/scaffold/scaffold.go:167-168, 213-217`. Scaffold lines match the spec. +9. **gp-module preview has no security output.** `internal/preview/preview.go` `Result` struct is at `:44-60` (fields `Game`...`RenderedManifest`); `FormatHuman` at `:317`. Preview needs new fields and output lines. There is no existing security section to extend. +10. **gp-module rule IDs.** `internal/validator/report.go:22-38` is the rule-ID const block. No ID for risky/ownership exists. Either reuse `RuleTemplateSchemaViolation` (`report.go:25`) or add new IDs in that block. +11. **validate.py rule locations (T036).** Spec cites `validate.py:610-660, 903-958`. Actual: `rule_nonroot_requires_runasuser` at `:611`, `rule_runasuser_requires_home` at `:654`, `rule_puid_image_needs_fsgroup` at `:902` (docstring `:903`, body to `:963`). Ranges are roughly right. +12. **validate.py placement.** Image-dependent rules run inside `for ref in image_refs: ... if not result.get("ok"): continue` (`validate_module`, `:1128-1151`). `validate_module` returns early at `:1131-1132` when there are no image refs. The three new template-only checks do not need network or image config and should go after `findings += rule_rcon_protocol(spec)` (`:1153`), outside the image loop. `Finding(level, rule, message)` at `:134-137`; `ERROR`/`WARN` constants at `:111-112`. +13. **test-validate-py.sh covers layout only.** The script (`/home/user/module/test-validate-py.sh`, 111 lines) tests directory-layout rules through a `check ` helper (`:9-15`) and a `create_valid_fixture` (`:~30`) that writes `template.yaml`. Cases grep `validate.py` output for rule IDs. New security cases follow this pattern. No existing case covers template security rules. +14. **Module-authoring section range (T065).** Spec cites `docs/module-authoring.md:1137-1173`. Actual `### Security context` heading is `:1157`; section ends at `:1194` (next heading `### Reserved in-pod ports` at `:1195`). `:1129` is `### Console mode and game log`; `:1137-1156` is inside that section. +15. **docs/security.md insertion point (T066).** `## Pod security` is at `:435` (correct). Its last subsection is `### Network Capture Security Exception` at `:478`. `## Module supply chain` at `:564` is the next level-2 heading. Insert the new `### Server security overrides` before `:564`. +16. **Palworld template gap.** `/home/user/module/palworld/template.yaml:63-64` is `security:` / `fsGroup: 1000`. No task edits it, yet `data-model.md:41` and `contracts/crd-gametemplate-security.md` illustrate Palworld marking `runAsUser` risky. Also, a template with `fsGroup` and no `volumeOwnershipCheck` now means `OnlyWhenWrong` (the default flip), which changes Palworld's behaviour. Ask whether T036 should add `risky`/`volumeOwnershipCheck` to Palworld. +17. **CRD line citations (used by T036 regen chain).** `data-model.md:7, 18` and `contracts/crd-gametemplate-security.md:5` cite `GameSecuritySpec` at `gametemplate_types.go:185`. Actual type declaration is `:194`; the field is `:186` (`Security *GameSecuritySpec`), with the comment at `:181-185`. Contract cites `GameTemplateSpec.Security` at `:177`; actual is `:186`. Outside this area; noted for the operator brief. +18. **Makefile target writes into the submodule.** `hack/gen-module-schema.py:21` CRD path, `:22` OUT path `modules/.schema/gametemplate.schema.json`. The script writes directly into the submodule checkout (no copy step). The spec's "output copied into the module repo" is only true when `modules/` is initialised. Makefile `module-schema` is at `Makefile:387-388`. `/home/user/module/.schema/` already holds `gametemplate.schema.json` and `module.schema.json`. +19. **T053 non-admin role.** Built-in role names: `api/internal/rbac/rbac.go:48-49` (`RoleOperator = "operator"`, `RoleViewer = "viewer"`); admin holds `*`. Test helper `Env.CreateUser(t, admin, role, prefix)` at `test/e2e/env.go:713`. Use role `operator` for the non-admin. This relies on the operator role holding `servers:write` and not `servers:security` (OD-1). Not verified in code here; verify in `rbac.go` before relying on it. +20. **KubectlExec target form.** `env.go:259` `KubectlExec(t, ns, target, cmd...)` takes a `pod/` target. Existing tests use `"pod/"+gs+"-0"` (e.g. `api_agent_e2e_test.go:185`). T030's `id -u` and T054's pod UID checks must use `"pod/"+gsName+"-0"`. +21. **T067 spec anchors.** Verified headings: `operator/specs.md` `## Reconcilers` :352, `## Key invariants` :775, `## Security considerations` :844. `api/specs.md` `## External interface / contracts` :88, `## Security considerations` :655. `web/specs.md` `## ServerDetail Settings Sub-sections` :990, `## External Interface / API Client` :1015. `gp-module/specs.md` `## Responsibilities` :16, `## Key Invariants` :84. `mcp-server/specs.md` `## Responsibilities` :10, `### Registered tools (7 total)` :51. `test/e2e/specs.md` `### Backup preparation acceptance` :160-170, `## Non-goals` :171 (insert the two-test subsection before `:171`). `test/e2e/specs.md` `## The bucket contract` at :185. +22. **T068 task map.** `docs/agent-architecture.md` task map is the table at `:47-58` (header `| Task | Read |`, `| --- | --- |`). No security row exists. The five new files named in T068 do not exist yet (checked). The spec's `operator/internal/controller/security_settings.go` naming matches plan.md:132 only with the controller path; plan.md:132 lists it under `internal/controller/`. + +## Edit briefs + +### T030 (E2E, operator bucket, zero logins) +- New file `test/e2e/gameserver_security_e2e_test.go`, first line `//go:build e2e`, package `e2e`. Pattern: `gameserver_e2e_test.go:51` uses `t.Parallel()`. +- Template: inline `unstructured` GameTemplate (pattern `test_helpers_e2e_test.go:45-66`) with `spec.security: {fsGroup: 1000}` (module default). Server: inline GameServer (pattern `:88-113`) with `spec.security: {runAsUser: {value: }}`. +- Assert: `envInstance.KubectlExec(t, ns, "pod/"+gs+"-0", "id", "-u")` (`env.go:259`) equals the override uid; `id -g` and other ids at module default. +- Use `waitStatefulSetReplicas` (`test_helpers_e2e_test.go:261`) before exec. +- Unique names via a per-test suffix; cleanup via `t.Cleanup` like `:76-80`. + +### T042 (same test, part 2) +- Change override, assert same pod UID (`pod.metadata.uid`), `status.security.pending == true`, `status.security.applied` unchanged. +- Restart, assert new uid and `pending == false`. Remove override, restart, assert module default uid. + +### T054 (same test, part 3, zero logins) +- Save root `fsGroup` override (`value: 0`), stop server, ensure ConfigMap `gameplane-security-settings` in the control-plane namespace is absent or `"false"` (`kubectl`, via `envInstance.Kubectl`, `env.go:~245`). +- Start; assert replicas stay 0 and condition `SecurityAllowed=False` reason `RootOverrideDisallowed`. +- Set ConfigMap `allowRootOverrides: "true"` with `kubectl apply`; assert the server starts. +- Set back to `"false"`; assert running pod keeps UID and `restartCount`. +- Control-plane namespace name: from `envInstance` (confirm the field name in `env.go` before use; not checked here). + +### T053 (new file `test/e2e/api_security_override_e2e_test.go`, one admin login plus one non-admin) +- Admin: `envInstance.BootstrapAdmin` then `envInstance.APIClient(t, adminUsername, adminPassword)` (`env.go:301, 503`; pattern `api_auth_e2e_test.go:119-127`). +- Non-admin: `envInstance.CreateUser(t, admin, "operator", "e2e-sec")` (`env.go:713`), then `envInstance.APIClient(t, u, pw)`. +- Refused 403 on create and update without `servers:security`; accepted after granting it (a role with the key; admin can create a custom role or grant it via the role endpoint, to be confirmed in `api/internal/rbac`). +- Root value refused 403 while the cluster's `allowRootOverrides` is off; accepted after an admin sets `{"allowRootOverrides":true}` with `PUT /security-settings?cluster=` (`contracts/cluster-setting.md`). +- ConfigMap mirror checked with `kubectl get configmap` after each flip. +- Audit log rows checked through the existing audit endpoint used in other `api_*_e2e_test.go` files (not verified which). + +### T064 (`test/e2e/buckets.sh`) +- Add `TestGameServer_SecurityOverrideAppliesOnRestart` and `TestAPI_SecurityOverride_PermissionAndRootRule` to `bucket_operator()` heredoc (`:36-125`, `EOF` at `:125`), in alphabetical position within their groups. +- Add tally comment immediately above `bucket_operator() {` at `:36`. +- No change to `suite-components.json`, CI matrix, or any other bucket. `buckets.sh verify` must pass. + +### T058 (`charts/gameplane/templates/api.yaml`) +- Insert after `:164` (last line of the logs RoleBinding) and before the `{{- end }}` at `:165` (closes the `apiEnabled` guard from `:8`; next block starts `:170`): +```yaml +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ .Release.Name }}-api-security-settings + namespace: {{ .Release.Namespace }} + labels: {{- include "gameplane.labels" . | nindent 4 }} +rules: + - apiGroups: [""] + resources: [configmaps] + resourceNames: [gameplane-security-settings] + verbs: [get, update, patch] + # create cannot be restricted by resourceNames (see brief Discrepancy 2) + - apiGroups: [""] + resources: [configmaps] + verbs: [create] # DECISION PENDING +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ .Release.Name }}-api-security-settings + namespace: {{ .Release.Namespace }} + labels: {{- include "gameplane.labels" . | nindent 4 }} +roleRef: { apiGroup: rbac.authorization.k8s.io, kind: Role, name: {{ .Release.Name }}-api-security-settings } +subjects: + - kind: ServiceAccount + name: gameplane-api + namespace: {{ .Release.Namespace }} +``` +- The second rule is a placeholder: do not ship `create` without the human decision. Operator ClusterRole `get;list;watch` on ConfigMaps is `operator.yaml:66` (confirmed, in `gameplane-operator-watch` ClusterRole, `:16-114`); no change to operator.yaml. +- No chart test added without sign-off (Discrepancy 3). + +### T036 (module repo `/home/user/module`, separate PR) +- Regenerate: `make module-schema` from the Gameplane root (`Makefile:387`), which runs `hack/gen-module-schema.py`. Output: `modules/.schema/gametemplate.schema.json`. Requires the CRD regen from T007 first. Run only after the human has the branch ready (CLAUDE.md rule 8: no local tests; running the generator is not a test but needs the submodule initialised). +- `validate.py` new function(s), called from `validate_module` after `:1153`: + - `risky` member not in {`runAsUser`, `runAsGroup`, `fsGroup`, `volumeOwnershipCheck`} → ERROR. + - `risky..reason` length > 200 → ERROR. + - `spec.security.volumeOwnershipCheck` set and `spec.security.fsGroup` unset → WARN. + - Use `get_path(spec, "security.risky")`, `get_path(spec, "security.fsGroup")` (`validate.py:515`). + - Severity constants `ERROR`/`WARN` (`:111-112`). +- `test-validate-py.sh`: add cases after the existing layout cases (end of file, before the summary); follow the `check` helper (`:9-15`). Each case greps output for the new rule ID. +- `palworld/template.yaml`: no change unless the human decides (Discrepancy 16). + +### T038 (gp-module) +- `gp-module/internal/validator/rules.go`: add three functions (template-only, operating on `*yaml.Node`, path lookup via `common.FindNode(node, "spec.security.risky")` as used in `schema.go` around the backupFlush check). Wire in `gp-module/internal/validator/validator.go` after `:170`. +- Rule IDs: add to `report.go:22-38` or reuse `RuleTemplateSchemaViolation`. +- Tests: add table cases to `gp-module/internal/validator/validator_test.go` (pattern `TestValidate_*`, e.g. `:260` ConfigSchemaAndMemory). Coverage gate for gp-module is 80 (CLAUDE.md). +- `gp-module/internal/preview/preview.go`: add `Security` (or similar) to `Result` at `:44-60`; populate in `GeneratePreview` after template parse (`:80-85`); print in `FormatHuman` (`:317`): resolved defaults, ownership check, risky settings with reasons. Tests in `preview_test.go` (pattern `TestPreviewManifest` `:37`). +- Leave `internal/scaffold/scaffold.go:167-168, 213-217` and `internal/archetypes/archetypes.go:83-85` unchanged (spec: no archetype asks for risky). + +### T065 (`docs/module-authoring.md`) +- Replace `### Security context` section, lines `1157-1194` (not `1137-1173`). +- Content per FR-013: block is a default, servers may override; new fields `volumeOwnershipCheck` and `risky` (field table); when to mark risky; reason wording (one sentence, what breaks); when to set `EveryStart`; default flip to `OnlyWhenWrong`. + +### T066 (`docs/security.md`) +- Insert `### Server security overrides` before `## Module supply chain` at `:564` (after `### Network Capture Security Exception` `:478`). Covers: `servers:security` (admin by default), root rule and `allowRootOverrides`, `RootOverrideDisallowed`, apply-on-restart, applied fsGroup for backups, ownership-check trade-off, audit trail, `kubectl` writers bypass API checks. + +### T067 (specs) +- `operator/specs.md`: update `## Reconcilers` (`:352`), `## Key invariants` (`:775`), `## Security considerations` (`:844`). +- `api/specs.md`: `## External interface / contracts` (`:88`), `## Security considerations` (`:655`). +- `web/specs.md`: `## ServerDetail Settings Sub-sections` (`:990`), `## External Interface / API Client` (`:1015`). +- `gp-module/specs.md`: `## Responsibilities` (`:16`), `## Key Invariants` (`:84`). +- `mcp-server/specs.md`: `### Registered tools (7 total)` (`:51`), T022 read-only note. +- `test/e2e/specs.md`: new `### Server security override acceptance` subsection before `## Non-goals / boundaries` (`:171`); lists the two tests. + +### T068 (`docs/agent-architecture.md`) +- Add a row to the task map table (`:47-58`), format `| | |`. Suggested row: `| Server security overrides (run-as user or group, fsGroup, root rule, ownership check) | operator/specs.md, api/specs.md, web/specs.md, docs/security.md, docs/module-authoring.md, operator/internal/controller/gameserver_security.go, operator/internal/controller/security_settings.go, api/internal/handlers/resources_security.go, api/internal/handlers/security_settings_sync.go, web/src/components/SecurityAdvanced.tsx |`. None of these files exist yet (checked). + +## Open questions for the human (do not decide in code) +- Q1: T058 `create` verb scope (Discrepancy 2). +- Q3: Helm RBAC check: add a new chart test or skip (Discrepancy 3). +- Q4: Palworld `risky` and `volumeOwnershipCheck` (Discrepancy 16). +- Q5: T053 role for the non-admin: `operator` (needs confirmation that it holds `servers:write` and not `servers:security`). diff --git a/specs/030-security-context-overrides/checklists/requirements.md b/specs/030-security-context-overrides/checklists/requirements.md index 48eee3442..dfe730dba 100644 --- a/specs/030-security-context-overrides/checklists/requirements.md +++ b/specs/030-security-context-overrides/checklists/requirements.md @@ -31,8 +31,8 @@ ## Notes -- Open questions are tracked as OD-1..OD-6 in `OPEN-DECISIONS.md` instead of inline +- Open questions are tracked as OD-1..OD-9 in `OPEN-DECISIONS.md` instead of inline markers (project rule: unsettled values go in OPEN-DECISIONS.md). OD-1..OD-3 were - settled by valgul on 2026-11-07, OD-4..OD-6 on 2026-11-13. + settled by valgul on 2026-11-07, OD-4..OD-6 on 2026-11-13, and OD-7..OD-9 on 2026-11-15. - Names such as "reconciler", "API" and "audit log" refer to existing Gameplane components the stakeholders already know; no new technology is prescribed. diff --git a/specs/030-security-context-overrides/contracts/api-server-security.md b/specs/030-security-context-overrides/contracts/api-server-security.md index 2d3304e5f..a2c78b5ab 100644 --- a/specs/030-security-context-overrides/contracts/api-server-security.md +++ b/specs/030-security-context-overrides/contracts/api-server-security.md @@ -13,7 +13,7 @@ No new route. The override travels in the GameServer object through the existing (All `/servers` paths take the usual `?cluster=` and namespace parameters.) -The `security` config section is also mirrored by this API into the ConfigMap the operator reads ([cluster-setting.md](cluster-setting.md)). The enforcement lives in `validateAndProtectGameServer` (`api/internal/handlers/resources.go:538`), called from `resources.go:218` (create), `:290` (update) and `lifecycle.go:243` (clone). `MountResources` (`resources.go:51`) gains the audit writer (`*audit.Auditor`) and reads the `security` config section through the `*db.Store` it already receives. +The root rule reads the setting from the ConfigMap of the request's own cluster ([cluster-setting.md](cluster-setting.md)). The enforcement lives in `validateAndProtectGameServer` (`api/internal/handlers/resources.go:570`), called from `resources.go:250` (create), `:322` (update) and `lifecycle.go:243` (clone). `MountResources` (`resources.go:51`) gains the audit writer (`*audit.Auditor`), and `MountLifecycle` takes it as an optional variadic parameter so that clone writes its row (OD-9 item 3). ## Request @@ -34,7 +34,7 @@ Semantics, in the order the handler applies them (the first failure decides): | 2 | Absent in the request, present in the stored object, caller lacks `servers:security` | The stored value is copied back into the request (a client that drops the field cannot wipe it by accident); then continues as case 1. | | 3 | Any other difference, caller lacks `servers:security` on that cluster and namespace | **403** `server.security.forbidden`. Nothing is written. | | 4 | Shape invalid (id not a whole number, outside 0 to 4294967295, both or neither of `value`/`useImageDefault`, `useImageDefault: false`, unknown member, bad enum) | **422** `server.security.invalid`. | -| 5 | A new or changed root value (see below) and `allowRootOverrides` is false | **403** `server.security.root_disabled`. | +| 5 | A new or changed root value (see below) and the request's cluster setting is not on (its ConfigMap, [cluster-setting.md](cluster-setting.md)) | **403** `server.security.root_disabled`. | | 6 | Otherwise | Accepted and stored; the response is the stored object. | A **root value** is `runAsUser` or `runAsGroup` with `value: 0` or `useImageDefault: true`, or `fsGroup` with `value: 0` (FR-005 and the 2026-11-13 clarifications). A root value that is already stored and unchanged does not trigger case 5; removing or replacing one is always allowed. A stored root override is enforced later, by the reconciler, which refuses to start the server while the setting is off (OD-4 settled A, FR-005a; [cluster-setting.md](cluster-setting.md)). The API does not stop the save. @@ -48,10 +48,10 @@ Both bodies follow the existing `httperr` rules (`api/internal/httperr/httperr.g | Status | `messageId` | English text | `args` | |---|---|---|---| | 403 | `server.security.forbidden` | `changing security settings requires the servers:security permission` | none | -| 403 | `server.security.root_disabled` | `root values (user 0, group 0, filesystem group 0, or the image default for user or group) are not allowed until an administrator enables root overrides` | `{"setting":"runAsUser"}` (the first offending setting) | +| 403 | `server.security.root_disabled` | `root values (user 0, group 0, filesystem group 0, or the image default for user or group) are not allowed on this cluster until an administrator allows root overrides in that cluster's Configuration` | `{"setting":"runAsUser"}` (the first offending setting) | | 422 | `server.security.invalid` | `invalid security override: {detail}` | `{"setting":"fsGroup","detail":"must be between 0 and 4294967295"}` | -The three messages are added to `api/internal/messages/entries_server.go` and to `i18n/locales/en/app.json` (FR-014), next to `server.forbidden`. +The three messages, and `server.cluster.security_settings_missing` (409, [cluster-setting.md](cluster-setting.md)), are added to `api/internal/messages/entries_server.go` and to `i18n/locales/en/app.json` (FR-014), next to `server.forbidden`. Existing generic mapping: `writeServerValidationError` (`api/internal/handlers/resources_snapshot.go:24`) maps a plain error to 403; the new errors carry their own status, so it passes them through. @@ -62,12 +62,12 @@ Existing generic mapping: `writeServerValidationError` (`api/internal/handlers/r ## Dashboard behavior tied to the contract - Without `servers:security` (the user's permission set is already known to the dashboard) the Advanced section shows `desired`, `applied`, sources and `pending` read-only (US4 scenario 1) and never sends `spec.security` changes. -- The server refusals above are shown inline; a refused root value says an administrator can allow it in Settings. +- The server refusals above are shown inline; a refused root value says an administrator can allow it in that cluster's Configuration. - Risky-value confirmation is dashboard-only (OD-6, settled C): the API accepts a risky value from any `servers:security` holder and refuses nothing on that basis; the audit row records that the value was marked risky ([audit-events.md](audit-events.md)). -- A server held back by the reconciler (`SecurityAllowed=False`, `RootOverrideDisallowed`) shows the reason from its status condition, with the text that an administrator can allow root overrides in Settings, or the override can be cleared. +- A server held back by the reconciler (`SecurityAllowed=False`, `RootOverrideDisallowed`) shows the reason from its status condition, with the text that an administrator can allow root overrides in that cluster's Configuration, or the override can be cleared. ## Tests -- Handler envtest `api/internal/handlers/resources_security_envtest_test.go` (create, update, clone, permission, root rule, invalid shapes, field restore, audit row). -- Unit tests for the validator function and for the three message IDs (`messages_test.go`, `usage_test.go` verify every ID is used and has an English entry). +- Handler envtest `api/internal/handlers/security_overrides_envtest_test.go` (create, update, clone, permission, root rule, invalid shapes, field restore, audit row). +- Unit tests for the validator function and for the three message IDs (`messages_test.go`, `usage_test.go` check registration and descriptions, not use (brief 03 D2); the new IDs are used by the code). - E2E: `TestAPI_SecurityOverride_PermissionAndRootRule` (research R16). diff --git a/specs/030-security-context-overrides/contracts/audit-events.md b/specs/030-security-context-overrides/contracts/audit-events.md index 26f1d85d9..39f65db89 100644 --- a/specs/030-security-context-overrides/contracts/audit-events.md +++ b/specs/030-security-context-overrides/contracts/audit-events.md @@ -10,8 +10,8 @@ Each handler writes its row with `Auditor.WriteSync` and then calls `audit.MarkR The override lives on the CRD and the audit row in the API database, so no single transaction covers both. The order makes sure no saved change ever lacks its before and after values (FR-010): -1. **Change (create, update, clone, setting flip):** the handler builds the row and calls `WriteSync` *before* the Kubernetes write (for the setting flip, before the ConfigMap and config row writes). If `WriteSync` fails, the request fails with 500 `audit write failed` (as the capture handler does) and nothing is saved. The generic middleware row then records the failed request. -2. If the Kubernetes write (or the ConfigMap or config row write) then fails, the handler writes a second row for the same request, `status` the error status and `reason` `security_save_failed`, so a reader sees the change was attempted and not stored. If that second write fails too, the error is logged; the first row stays and is the known, accepted gap: the trail can show an intent that was not stored, never a stored change without its record. +1. **Change (create, update, clone, setting flip):** the handler builds the row and calls `WriteSync` *before* the Kubernetes write (for the setting flip, before the ConfigMap update). If `WriteSync` fails, the request fails with 500 `audit write failed` (as the capture handler does) and nothing is saved. The generic middleware row then records the failed request. +2. If the Kubernetes write (or the ConfigMap update) then fails, the handler writes a second row for the same request, `status` the error status and `reason` `security_save_failed`, so a reader sees the change was attempted and not stored. If that second write fails too, the error is logged; the first row stays and is the known, accepted gap: the trail can show an intent that was not stored, never a stored change without its record. 3. **Refusals (403, 422):** nothing is saved, so the order does not matter. If `WriteSync` fails, `MarkRecorded` is not called and the middleware's generic row is the fallback (`audit.go:594-611`); the response is still the refusal. ## Events @@ -23,7 +23,7 @@ The override lives on the CRD and the audit row in the API database, so no singl | Refused: root rule | the request's own | server name | 403 | `security_root_disabled:runAsUser` (the first offending setting) | | Refused: invalid shape | the request's own | server name | 422 | `security_invalid:fsGroup` | | Save failed after the row was written | the request's own | server name or `security` | the error status | `security_save_failed` | -| Cluster setting flipped | `PUT /admin/config/security` | `security` | 200 | `allowRootOverrides:false->true` | +| Cluster setting flipped | `PUT /security-settings?cluster=` | `security/` | 200 | `allowRootOverrides:false->true` | A request that changes other fields but leaves `spec.security` unchanged writes no security row; the generic middleware row stands. diff --git a/specs/030-security-context-overrides/contracts/cluster-setting.md b/specs/030-security-context-overrides/contracts/cluster-setting.md index 516337c86..8d7e5ad3a 100644 --- a/specs/030-security-context-overrides/contracts/cluster-setting.md +++ b/specs/030-security-context-overrides/contracts/cluster-setting.md @@ -1,69 +1,118 @@ -# Contract: cluster-wide "allow root overrides" setting +# Contract: per-cluster "allow root overrides" setting -**Requirements**: FR-005, FR-005a, SC-003, OD-2, OD-4. **Research**: R9, R11. +**Requirements**: FR-005, FR-005a, SC-003, OD-2, OD-4, OD-7, OD-8, OD-9. **Research**: R9, R11. **Briefs**: `briefs/00-rulings.md` sections 1 to 5 are the binding form of this contract. -## Storage and routes +## Scope and store -A new section `security` in the API's config store (`config` table, key `security`). No migration: the row is created on first write; an absent row means `false`. +- The setting is separate for each cluster and off by default (OD-7 C). Each cluster is set on its own, under Clusters, cluster, Configuration. +- Its only store is one ConfigMap per cluster: -| Route | Permission | Behavior | +```yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: gameplane-security-settings + namespace: + annotations: { helm.sh/resource-policy: keep } + labels: +data: + allowRootOverrides: "false" # "true" or "false"; nothing else is on +``` + +- The namespace is the operator's `--control-plane-namespace` on that cluster. On a default install with the API enabled it is the credentials namespace `-credentials`. In no-API mode it is the release namespace. A standalone panel has no local operator and no ConfigMap. +- There is no config-table row, no `security` config section, and no API start-up sync (OD-7). + +## Namespace the API uses (OD-10 A) + +- Home cluster: the cluster's own control-plane namespace, the same `moduleConfigMapNS` as today (`api/cmd/main.go:231`). On a default install that is the credentials namespace. +- Remote cluster: the namespace recorded on that cluster's registration, `Cluster.spec.controlPlaneNamespace`. The default is `gameplane`. It is set in the register-cluster form and shown on the cluster page (tasks T078 and T079). +- The API reads and updates the ConfigMap in that namespace through the cluster's registry client, by name only. +- A ConfigMap not found in the resolved namespace reads as off. GET returns `present: false`, and PUT returns 409 `server.cluster.security_settings_missing` with no audit row. +- A wrong namespace cannot turn the setting on; it only shows the setting as missing. The namespace must be the operator control-plane namespace of that remote install. + +## Creation: Helm (OD-8 A) + +- The operator chart creates the ConfigMap wherever it renders: the home install and every remote operator install. +- On first install it renders `"false"`. On upgrade it reads the current object with Helm `lookup` and re-renders the value it finds, so an upgrade never flips the setting. When `lookup` finds nothing, the value renders as `"false"`. +- The annotation `helm.sh/resource-policy: keep` keeps the object on uninstall. +- The API never creates the ConfigMap. If it is deleted, the setting reads as off until the next `helm upgrade`. + +## Who may read and write + +| Actor | Access | Scope | +|---|---|---| +| Operator (on its own cluster) | `get;list;watch` on ConfigMaps (already held, `operator/internal/controller/gameserver_controller.go:261`, chart `operator.yaml:66`) | cluster | +| API, home cluster | `get`, `update`, `patch` by `resourceNames: [gameplane-security-settings]` in the credentials namespace (`charts/gameplane/templates/api-credentials.yaml`) | one object | +| API, standalone panel | none: no local operator and no service account token, so the chart renders neither the ConfigMap nor a Role for it (corrected 2026-11-16) | none | +| API, remote cluster | the same three verbs granted by the remote chart to the identity the API uses for that cluster (task T076), in the namespace on its registration (OD-10 A) | one object | + +No `create` verb is granted anywhere: Kubernetes does not limit `create` by name (OD-8). + +## Routes + +| Route | Permission | Cluster | |---|---|---| -| `GET /admin/config` | `config:read` | Includes `"security": {"allowRootOverrides": false}` once the section has been written; absent otherwise (the dashboard treats absent as false). | -| `PUT /admin/config/security` | `config:manage` | Validates and stores the section. Both rules already exist (`api/internal/rbac/rbac.go:223-228`); no rule-table change. | +| `GET /security-settings?cluster=` | `config:read` | `resolveCluster` (`api/internal/handlers/resources.go:113`), as `/backup-destinations` | +| `PUT /security-settings?cluster=` | `config:manage` | same | + +Both rules are new entries in `api/internal/rbac/rbac.go`, next to the `/admin/config` rules (`:209` GET `config:read`, `:214` `config:manage`). -The validator is registered in `newValidators` (`api/internal/handlers/config.go:462`), so the section name joins the closed allowlist and unknown members are dropped. +Body of PUT: ```http -PUT /admin/config/security +PUT /security-settings?cluster= { "allowRootOverrides": true } - -200 { "section": "security", "value": { "allowRootOverrides": true } } ``` -| Field | Type | Rule | -|---|---|---| -| `allowRootOverrides` | bool | Required. Invalid JSON or a non-boolean value returns 422 like the other sections. | +| Condition | Result | +|---|---| +| Body empty | 400 `server.empty_body` (OD-9 item 1) | +| Body is not JSON, or `allowRootOverrides` is missing or not a boolean | 422 | +| ConfigMap NotFound | 409 `server.cluster.security_settings_missing`, no audit row | +| Value unchanged | 200, nothing written, no audit row | +| Value changes, audit row written, update succeeds | 200 | +| Audit write fails | 500, nothing changes | +| Update fails after the audit row | 502, plus a `security_save_failed` row | -## Operator mirror +GET body: `{"cluster": "", "allowRootOverrides": bool, "present": bool}`. A NotFound ConfigMap reads as `allowRootOverrides: false, present: false`. Any other read error returns 502. PUT returns the same body with `present: true`. -The operator must know the setting (FR-005a), and it neither reads the API database nor calls the API (CLAUDE.md rule 10). The API therefore mirrors the value into a ConfigMap: +Message `server.cluster.security_settings_missing`: 409, English "the security settings ConfigMap is missing on this cluster; run helm upgrade to recreate it". Registered in `api/internal/messages/` (cluster entries), with en and fr keys (FR-014). -```yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: gameplane-security-settings - namespace: - labels: { app.kubernetes.io/managed-by: gameplane-api } -data: - allowRootOverrides: "false" # "true" or "false" -``` +Handler: `api/internal/handlers/security_settings.go`, mounted by `MountSecuritySettings(r chi.Router, reg *kube.Registry, auditor *audit.Auditor)` from `api/cmd/main.go`. + +## Operator reading (FR-005a) -- `PUT /admin/config/security` writes the ConfigMap, then the config row; if the ConfigMap write fails the request fails (502 with the existing error body) and the config row is unchanged, so the two never silently disagree. A multi-cluster API writes the ConfigMap into every registered cluster it can reach. -- On start the API rewrites the ConfigMap from the config row (it converges after a database restore, a new cluster or a deleted ConfigMap). No other writer exists; a hand edit is overwritten at the next sync. -- **Fail closed**: the operator reads a missing ConfigMap, a missing key or any value other than `"true"` as off. -- RBAC: the chart gives the API `get;create;update;patch` on this one ConfigMap by `resourceNames` in the release namespace (`charts/gameplane/templates/api.yaml`); the operator already holds `get;list;watch` on ConfigMaps. +- The operator reads the ConfigMap in its own control-plane namespace from its informer cache (`ControlPlaneNamespace`, briefs/00 section 3). Missing ConfigMap, missing key, or any value other than `"true"` is off. +- While the setting is off, the reconciler does not start a server that holds a saved root override. Replicas stay at zero and the server reports condition `SecurityAllowed=False`, reason `RootOverrideDisallowed` (details in [data-model.md](../data-model.md), "Start refusal"). The hold is checked before the server takes a wake slot (OD-9 item 4). +- Turning the setting off never restarts or stops a running server and never edits a stored override. Turning it on, or clearing the override, lets the next reconcile start a stopped server. The ConfigMap watch re-enqueues the servers that hold a root override. -## What it governs +## API reading (case 5) -1. **API write path** (see [api-server-security.md](api-server-security.md), case 5): each request that carries a new or changed root value is refused while the setting is off. A root value is run-as user or run-as group set to 0 or to "use image default", or filesystem group set to 0. -2. **Reconciler start path** (OD-4, settled A; FR-005a): while the setting is off, the operator does not start a server that holds a saved root override. Replicas stay at zero and the server reports condition `SecurityAllowed=False` with reason `RootOverrideDisallowed` (details in [data-model.md](../data-model.md), "Start refusal"). It starts once the override is cleared or the setting is on again. +- A request that carries a new or changed root value (run-as user or group set to 0 or "use image default", or filesystem group set to 0) reads the ConfigMap of the request's own cluster through that cluster's registry client, in the namespace resolved for that cluster (see "Namespace the API uses"). The setting is on only for exact `"true"`. Missing, unreadable or any other value refuses the request with 403 `server.security.root_disabled`. +- A request that does not change a root value does not read the ConfigMap. -Turning it **off** never restarts or stops a running server and never edits a stored override; it only makes future writes of root values fail and makes a stopped server holding one refuse to start. Turning it **on** lets such a server start on the next reconcile (the operator watches the ConfigMap, so there is no delay beyond the reconcile). +## Multi-cluster -Multi-cluster: the setting is the central API's, and applies to servers created or edited through that API on any registered cluster. Per-cluster values are out of scope. +- The setting belongs to one cluster. A flip touches only that cluster's ConfigMap. Other clusters keep their own value, and a new cluster starts off. +- The API reads a remote cluster's ConfigMap in the namespace on its registration, `Cluster.spec.controlPlaneNamespace` (OD-10 A; briefs/00 section 12). The remote chart grants the API identity access in that namespace (T076). ## Audit -A successful change that flips the value writes one extra row, see [audit-events.md](audit-events.md) (`PUT /admin/config/security`, `target` `security`, `reason` `allowRootOverrides:false->true`). A save that leaves the value as it was writes only the generic middleware row. +- A flip writes one row before the ConfigMap update: `PUT /security-settings`, `target` `security/`, `reason` `allowRootOverrides:false->true` (or `true->false`). See [audit-events.md](audit-events.md), "Write order". +- A save that leaves the value as it was writes only the generic middleware row. ## Dashboard -The Admin Settings screen (`web/src/routes/AdminSettings.tsx`) gains a "Security" section with one switch, off by default, with text that states what it allows and that it does not change existing servers. Designed in `design.pen` first (plan.md, design gate). +- A "Security" panel in `web/src/components/clusters/ClusterConfiguration.tsx` (Clusters, cluster, Configuration), next to `BackupDestinationsPanel.tsx`. The component is `web/src/components/clusters/SecuritySettingsPanel.tsx`. It is not in Admin Settings. +- One switch, off by default. Text: turning it off does not stop running servers on this cluster, but stopped servers with a root override will not start until the override is cleared or the switch is back on. +- A "settings missing, run helm upgrade" state when GET reports `present: false` or PUT returns 409. +- Designed in `design.pen` first (plan.md, design gate). ## Tests -- Unit: validator accepts `{"allowRootOverrides":true}`, rejects non-boolean and empty body, drops unknown members. -- Envtest (`config_envtest_test.go` pattern): the section round-trips through `GET /admin/config`; a viewer without `config:manage` gets 403 on `PUT`; a flip writes the ConfigMap with the expected value and a failing ConfigMap write leaves the config row unchanged; the start-up sync recreates a deleted ConfigMap. -- Operator envtest (`gameserver_security_envtest_test.go`): with the ConfigMap absent or `"false"`, a stopped server holding a root override stays at zero replicas with `SecurityAllowed=False` / `RootOverrideDisallowed`; a running one is untouched; flipping the ConfigMap to `"true"` starts the stopped one; clearing the override starts it too. -- The server-path behavior with the setting on and off is covered by the handler envtest and the E2E in [api-server-security.md](api-server-security.md). +Test files are new (briefs/00 section 8). + +- Unit (`api/internal/handlers/security_settings_test.go`): validator accepts `{"allowRootOverrides":true}`, rejects non-boolean, returns 400 for an empty body, drops unknown members. +- Envtest (`api/internal/handlers/security_settings_envtest_test.go`, dedicated router): GET round trip; a viewer without `config:manage` gets 403 on PUT; a flip updates the ConfigMap and writes one row; a failing audit write returns 500 and leaves the ConfigMap unchanged; a failing update returns 502 and writes `security_save_failed`; a missing ConfigMap returns 409 and writes no row. Nothing creates the ConfigMap. +- Operator envtest (`operator/internal/controller/security_overrides_envtest_test.go`): with the ConfigMap absent or `"false"`, a stopped server holding a root override stays at zero replicas with `SecurityAllowed=False` / `RootOverrideDisallowed`; a running one is untouched; flipping the ConfigMap to `"true"` starts the stopped one; clearing the override starts it too. +- Chart: no test fixture exists (briefs/04 Q3). Rendering and RBAC are checked by CI `helm template` and by the E2E. diff --git a/specs/030-security-context-overrides/contracts/crd-gameserver-security.md b/specs/030-security-context-overrides/contracts/crd-gameserver-security.md index 01f60e67e..f22fe4ec4 100644 --- a/specs/030-security-context-overrides/contracts/crd-gameserver-security.md +++ b/specs/030-security-context-overrides/contracts/crd-gameserver-security.md @@ -64,7 +64,7 @@ status: - **Applying** (research R5): the security-derived parts of the pod template change only when the StatefulSet is created or goes from zero replicas to one or more. Saving a change never restarts the server (FR-008). - **Backup and restore** (FR-011): jobs take their pod `fsGroup` from `status.security.applied.fsGroup`'s source of truth (the same pod or StatefulSet read), never from `desired`. - **Restricted workload mode** (OD-5, settled A): when the operator runs with `--restricted-workloads`, the effective (desired) values, not the template alone, are validated with the existing rule (`validateRestrictedTemplate`, `workload_security.go:15`; a positive run-as user and filesystem group). A violation (a root value, or "use image default" for run-as user) sets the existing failure phase message through `setPhase` and the server stays failed until the override is fixed; a pod that is already running keeps running with its applied values. The refusal is the same one an invalid template gets (`gameserver_controller.go:334`). -- **Root overrides while the cluster setting is off** (OD-4, settled A; FR-005a): a stopped server holding a root override is not started and reports condition `SecurityAllowed=False`, reason `RootOverrideDisallowed`; a running one is untouched; the server starts once the override is cleared or the setting is on. The setting is read from the ConfigMap mirror (research R9, [cluster-setting.md](cluster-setting.md)); the condition is described in [data-model.md](../data-model.md), "Start refusal". +- **Root overrides while the cluster setting is off** (OD-4, settled A; FR-005a): a stopped server holding a root override is not started and reports condition `SecurityAllowed=False`, reason `RootOverrideDisallowed`; a running one is untouched; the server starts once the override is cleared or the setting is on. The setting is read from the cluster's ConfigMap (research R9, [cluster-setting.md](cluster-setting.md)); the condition is described in [data-model.md](../data-model.md), "Start refusal". - **Unchanged**: agent, config-init user, sentinel, tunnel, wipe and capture helper security contexts (FR-012). ## Compatibility @@ -74,4 +74,4 @@ status: | Existing server, no `spec.security` | `desired` equals today's resolution; pod spec unchanged while running. `applied` is rebuilt from the pod without the annotation (module defaults). | | Existing server with a module `fsGroup` | After the operator upgrade `desired.volumeOwnershipCheck` is `OnlyWhenWrong` and `pending` is true until the next start; no restart is caused by the upgrade. | | Older operator reading a GameServer with `spec.security` | The field is unknown to it and ignored; the CRD's structural schema keeps it stored. | -| Operator upgrade, setting never written | The ConfigMap is absent, so the setting reads as off; no existing server holds an override yet, so nothing is refused and nothing restarts. | +| Operator upgrade | The chart creates the cluster's ConfigMap with its current value (`lookup`, OD-8), so the setting keeps its value. A cluster with no ConfigMap reads as off. No existing server holds a root override yet, so nothing is refused and nothing restarts. | diff --git a/specs/030-security-context-overrides/data-model.md b/specs/030-security-context-overrides/data-model.md index 5d40a684c..a8e446aec 100644 --- a/specs/030-security-context-overrides/data-model.md +++ b/specs/030-security-context-overrides/data-model.md @@ -6,7 +6,7 @@ Five places hold data. No database table or column is added (research R12). - **GameTemplate** (CRD, cluster-scoped): the module's defaults and the risky flags. YAML in [contracts/crd-gametemplate-security.md](contracts/crd-gametemplate-security.md). - **GameServer** (CRD, namespaced): the per-server override in `spec`, the read model in `status`. YAML in [contracts/crd-gameserver-security.md](contracts/crd-gameserver-security.md). -- **API config store**: one new section, `security`, in the existing `config` table, mirrored by the API into one ConfigMap per cluster that the operator reads (OD-4). See [contracts/cluster-setting.md](contracts/cluster-setting.md). +- **Cluster ConfigMap**: one per cluster, `gameplane-security-settings`, created by Helm, read by the operator and updated by the API through `PUT /security-settings` (OD-7, OD-8). See [contracts/cluster-setting.md](contracts/cluster-setting.md). - **Audit log**: one structured `reason` string per change. See [contracts/audit-events.md](contracts/audit-events.md). The four settings are named `runAsUser`, `runAsGroup`, `fsGroup` (numeric ids) and `volumeOwnershipCheck` (an enum). "Setting" below means any of the four. @@ -82,7 +82,7 @@ Order of checks in `validateAndProtectGameServer` (research R10); the first fail | 1 | The block is unchanged from the stored one | accepted, no permission needed | | 2 | The caller holds `servers:security` on this cluster and namespace (or `*`) for any other change | else 403 `server.security.forbidden` | | 3 | Shape: ids are whole numbers 0 to 4294967295; exactly one of `value`/`useImageDefault`; enum values valid; no unknown members | else 422 `server.security.invalid` | -| 4 | Root rule: a **new or changed** `runAsUser` or `runAsGroup` that is `value: 0` or `useImageDefault: true`, or a new or changed `fsGroup` that is `value: 0`, needs `allowRootOverrides` to be true | else 403 `server.security.root_disabled` | +| 4 | Root rule: a **new or changed** `runAsUser` or `runAsGroup` that is `value: 0` or `useImageDefault: true`, or a new or changed `fsGroup` that is `value: 0`, needs the request's cluster setting to be on (its ConfigMap, R9) | else 403 `server.security.root_disabled` | Root rule table (FR-005, clarifications 2026-11-13): @@ -202,25 +202,34 @@ A save never changes the pod template while a pod runs (research R5). The pod te --- -## Cluster setting (API config section `security`) +## Cluster setting (ConfigMap per cluster) -| Field | Type | Default | Rule | -|---|---|---|---| -| `allowRootOverrides` | bool | false | Absent row means false. Unknown members are dropped by the validator, like every section. | +| Property | Value | +|---|---| +| Name | `gameplane-security-settings` | +| Namespace | the operator's control-plane namespace of that cluster (`--control-plane-namespace`; the credentials namespace `-credentials` on a default install with the API enabled, the release namespace in no-API mode; a standalone panel has none) | +| Data | `allowRootOverrides`: `"true"` or `"false"`. A missing ConfigMap, a missing key or any other value is off (fail closed). | +| Default | `"false"`, written by Helm. An upgrade keeps the current value (`lookup`). | +| Created by | the operator chart only (OD-8). The API never creates it. | +| Updated by | the API, through `PUT /security-settings?cluster=` (`config:manage`), by name only | +| Read by | the operator (its own cluster, through a watch) and the API (case 5, for the request's own cluster) | +| Deleted | reads as off until the next `helm upgrade` renders it again as `"false"` | +| Annotation | `helm.sh/resource-policy: keep` | -Stored as the JSON blob `{"allowRootOverrides":false}` in `config` under key `security`; written only through `PUT /admin/config/security` (`config:manage`). +The setting has no config-table row (OD-7). Details are in [contracts/cluster-setting.md](contracts/cluster-setting.md). -### Operator mirror (ConfigMap) +## Cluster registration field (OD-10 A) | Property | Value | |---|---| -| Name and namespace | `gameplane-security-settings` in the gameplane (control-plane) namespace of each cluster | -| Data | `allowRootOverrides`: `"true"` or `"false"` | -| Writer | the API only (on each flip, and a sync on API start); readers: the operator (watch) | -| Missing or malformed | read as off (fail closed) | -| Labels | `app.kubernetes.io/managed-by: gameplane-api` | - -The config row is the source of truth; the ConfigMap is a derived copy (research R9). +| Object | `Cluster` (`operator/api/v1alpha1/cluster_types.go`), field `spec.controlPlaneNamespace` | +| Type | string, optional, JSON name `controlPlaneNamespace` | +| Rule | a DNS label: lowercase letters, digits and hyphens, starting and ending with a letter or digit, at most 63 characters (`MaxLength=63`, DNS label pattern) | +| Default | `gameplane` (`+kubebuilder:default`); an absent value means `gameplane` | +| Set by | the register-cluster form (web), through the cluster registration API (`api/internal/handlers/clusters.go` accepts and returns it) | +| Shown by | the cluster page | +| Read by | the API, to find the settings ConfigMap on that remote cluster (`contracts/cluster-setting.md`, "Namespace the API uses"). The home cluster does not use it. | +| Generated | with T007 (`make generate && make manifests`) | ## Permission diff --git a/specs/030-security-context-overrides/plan.md b/specs/030-security-context-overrides/plan.md index 10900c946..3cc9e5722 100644 --- a/specs/030-security-context-overrides/plan.md +++ b/specs/030-security-context-overrides/plan.md @@ -1,9 +1,11 @@ # Implementation Plan: Module security defaults with a per-server override -**Branch**: `spec-030/security-context-overrides` (planning on `spec-030/plan-and-tasks`) | **Date**: 2026-11-13 | **Spec**: [spec.md](spec.md) +**Branch**: `spec-030/security-context-overrides` (planning on `spec-030/plan-and-tasks`) | **Date**: 2026-11-13, revised 2026-11-15 | **Spec**: [spec.md](spec.md) **Input**: Feature specification from `specs/030-security-context-overrides/spec.md` +**Binding rules for this revision**: [briefs/00-rulings.md](briefs/00-rulings.md) is read first. It holds the settled OD-7, OD-8 and OD-9 rulings and supersedes the earlier briefs where they differ. + ## Summary A game template already declares the uid, gid and filesystem group its game container runs with. This feature keeps those values as the module's defaults, adds a fourth module-level setting (the volume ownership check, defaulting to the faster "only when wrong"), and lets a server owner who holds a new `servers:security` permission override each of the four per server, from an "Advanced" section of the create wizard and the server Settings tab. @@ -12,39 +14,39 @@ A game template already declares the uid, gid and filesystem group its game cont **Who computes what.** One pure resolver in the operator turns the template and the override into the desired settings and the source of each value (R4). The operator renders them into the game container, the pod `fsGroup` and `fsGroupChangePolicy`, and the config-init container, and publishes `status.security` with `desired`, `applied` and `pending` (R7). The API only stores, validates and audits (FR-004). -**The operator also enforces the setting (OD-4).** The operator reads the mirrored setting from its cache. While the setting is off, a stopped server whose saved override is a root value is not scaled up (the same zero-to-one gate as R5); the server reports condition `SecurityAllowed=False`, reason `RootOverrideDisallowed`, naming the settings. Running servers are never touched, flipping the setting enqueues every server that holds a root override, and the server starts again once the override is cleared or the setting is back on (R9, FR-005a). +**The operator also enforces the setting (OD-4, OD-7).** The operator reads its own cluster's setting from a ConfigMap in its control-plane namespace (R9). While the setting is off, a stopped server whose saved override is a root value is not scaled up. The check runs before the server takes a wake slot, so a held sleeping server does not use one (OD-9 item 4). The server reports condition `SecurityAllowed=False`, reason `RootOverrideDisallowed`, naming the settings. Running servers are never touched. Flipping the setting enqueues every server that holds a root override, and the server starts again once the override is cleared or the setting is back on (R9, FR-005a). -**Applying on the next restart, without restarting.** The StatefulSet rolls on any pod-template difference, so the security-derived parts of the template are refreshed only on first create or when the workload goes from zero replicas to one or more, reusing the pattern the hostport affinity already uses (R5). The same rule keeps the ownership-check default flip from restarting existing servers when the operator upgrades (R8). The applied filesystem group (read from the pod or the StatefulSet) is what backup and restore jobs use (R6, FR-011). +**Applying on the next restart, without restarting.** The StatefulSet rolls on any pod-template difference, so the security-derived parts of the template are refreshed only on first create or when the workload goes from zero replicas to one or more, reusing the pattern the hostport affinity already uses (R5). The same rule keeps the ownership-check default flip from restarting existing servers when the operator upgrades (R8). A template rollout on a suspended or sleeping server refreshes security at its next start, not at the rollout (OD-9 item 5). The applied filesystem group (read from the pod or the StatefulSet) is what backup and restore jobs use (R6, FR-011). `spec.security` is excluded from the template baseline hash, so saving an override never rewrites a running pod (OD-9 item 6, task T075). -**API.** No new route. `servers:security` is a field-level check inside `validateAndProtectGameServer` next to the `captures:manage` precedent, with the root rule driven by a new `security` config section, `allowRootOverrides`, off by default and changed through `PUT /admin/config/security` (R9, R10). The API stays the only writer of the setting and mirrors it into an API-owned ConfigMap in the gameplane namespace of each cluster, which the operator watches (R9). Every change, refusal and setting flip writes one audit row whose `reason` carries before and after (and the risky marker), with no migration (R11, R12). +**API.** No new route for overrides. `servers:security` is a field-level check inside `validateAndProtectGameServer` next to the `captures:manage` precedent. The root rule reads the setting from the ConfigMap of the request's own cluster, only for a request that carries a new or changed root value, and is off unless that ConfigMap says exactly `"true"` (R9, R10). The cluster setting has its own routes, `GET` and `PUT /security-settings?cluster=`, guarded by `config:read` and `config:manage` (OD-7). The API never creates the ConfigMap: Helm creates it with `"false"` and keeps its value on upgrade, and the API only reads and updates it by name (OD-8, R9). Every override change, refusal and setting flip writes one audit row whose `reason` carries before and after (and the risky marker), with no migration (R11, R12). The clone path writes the same row (OD-9 item 3). -**Dashboard.** One shared collapsed "Advanced" section for the wizard and the Settings tab, read-only without the permission, with the pending marker, the restart notice, the file-access warning and the risky-value confirmation (R13). **All dashboard work is blocked until valgul designs the Advanced section in `design.pen` on the maintainer's machine through the Pencil MCP and exports it to `assets/design-export/`** (constitution II, CLAUDE.md rules 1 and 2; a cloud session cannot run Pencil). Backend, operator, API, module, docs and E2E work does not wait for it. +**Dashboard.** One shared collapsed "Advanced" section for the wizard and the Settings tab, read-only without the permission, with the pending marker, the restart notice, the file-access warning and the risky-value confirmation (R13). The cluster's root switch is a "Security" panel under Clusters, cluster, Configuration, next to the backup destinations (OD-7; `SecuritySettingsPanel.tsx`). **All dashboard work is blocked until valgul designs the Advanced section and the Security panel in `design.pen` on the maintainer's machine through the Pencil MCP and exports them to `assets/design-export/`** (constitution II, CLAUDE.md rules 1 and 2; a cloud session cannot run Pencil). Backend, operator, API, module, docs and E2E work does not wait for it. **Modules.** The template schema, the module repo's `validate.py`, the `gp-module` validator and preview, `docs/module-authoring.md` and the Palworld template change. The module repo changes ship as a **separate PR to `GameplanePanel/module`**, and the main repo takes them only through a **submodule pointer bump after that PR merges** (`submodule-bump` skill, CLAUDE.md "Game module" workflow). The main-repo changes work without them. -**Settled rulings (OD-1 to OD-6, all by valgul).** [OD-4](OPEN-DECISIONS.md) A: when the cluster setting is off, the reconciler refuses to start a server that holds a saved root override (status says why, `RootOverrideDisallowed`), never restarts or stops a running one; this is why the operator now reads the setting, through an API-owned ConfigMap (R9). [OD-5](OPEN-DECISIONS.md) A: the reconciler validates the effective values with the restricted-workload rule and fails the server with the existing message until fixed; a running pod is untouched (R4). [OD-6](OPEN-DECISIONS.md) C: the dashboard asks for the risky confirmation, the audit row records that the value was risky, and the API refuses nothing on that basis (R11, R13). +**Settled rulings (OD-1 to OD-10).** [OD-1](OPEN-DECISIONS.md) B: a new `servers:security` permission, admin only by default. [OD-2](OPEN-DECISIONS.md) C: root values need the cluster's setting on. [OD-3](OPEN-DECISIONS.md) A: changes apply on the next restart. [OD-4](OPEN-DECISIONS.md) A: when the setting is off, the reconciler refuses to start a server that holds a saved root override (status says why, `RootOverrideDisallowed`), and never restarts or stops a running one. [OD-5](OPEN-DECISIONS.md) A: the reconciler validates the effective values with the restricted-workload rule and fails the server with the existing message until fixed; a running pod is untouched (R4). [OD-6](OPEN-DECISIONS.md) C: the dashboard asks for the risky confirmation, the audit row records that the value was risky, and the API refuses nothing on that basis (R11, R13). [OD-7](OPEN-DECISIONS.md) C (2026-11-15): the root setting is separate per cluster, set under Clusters, cluster, Configuration, stored in that cluster's ConfigMap. [OD-8](OPEN-DECISIONS.md) A (2026-11-15): Helm creates the ConfigMap with `"false"`, keeps it on uninstall and keeps its value on upgrade; the API only reads and updates it by name. [OD-9](OPEN-DECISIONS.md) A (2026-11-15): the seven spec corrections are accepted (see briefs/00 section 6). [OD-10](OPEN-DECISIONS.md) A (2026-11-15): the cluster registration records the control-plane namespace of a remote cluster, `spec.controlPlaneNamespace` (default `gameplane`), set in the register-cluster form and shown on the cluster page (briefs/00 section 12). ## Technical Context -**Language/Version**: Go 1.27 modules per `go.work` (`operator`, `api`, `gp-module`, `mcp-server`, `test/e2e`); TypeScript 7 strict and React 19 for `web`; Python 3 for the module repo's `validate.py`; Kubernetes CRDs `gameplane.local/v1alpha1`. +**Language/Version**: Go 1.27 modules per `go.work` (`operator`, `api`, `gp-module`, `mcp-server`, `test/e2e`); TypeScript 7 strict and React 19 for `web`; Python 3 for the module repo's `validate.py`; Kubernetes CRDs `gameplane.local/v1alpha1`; Helm templates for the chart. -**Primary Dependencies**: existing ones only. Operator: controller-runtime, `k8s.io/api` (`PodSecurityContext.FSGroupChangePolicy` is a core field). API: chi, client-go dynamic client, `database/sql` over SQLite or PostgreSQL. Web: React 19, TanStack Router and Query, HeroUI v3, Tailwind. No new module and no new dependency. +**Primary Dependencies**: existing ones only. Operator: controller-runtime, `k8s.io/api` (`PodSecurityContext.FSGroupChangePolicy` is a core field). API: chi, client-go (typed client for the ConfigMap), dynamic client, `database/sql` over SQLite or PostgreSQL. Web: React 19, TanStack Router and Query, HeroUI v3, Tailwind. No new module and no new dependency. -**Storage**: CRD fields (`GameServer.spec.security`, `GameServer.status.security`, `GameServer` condition `SecurityAllowed`, `GameTemplate.spec.security` additions); one new key in the existing API `config` table (`security`); one API-owned ConfigMap per cluster mirroring it (`gameplane-security-settings`, R9); the existing `audit_events.reason` column. **No database migration** (R12); the next free portable number, `020`, is not used. +**Storage**: CRD fields (`GameServer.spec.security`, `GameServer.status.security`, `GameServer` condition `SecurityAllowed`, `GameTemplate.spec.security` additions); one ConfigMap per cluster, `gameplane-security-settings`, created by the chart (R9, OD-8); the Cluster field `spec.controlPlaneNamespace` (OD-10, T078); the existing `audit_events.reason` column. **No database migration** (R12); the next free portable number, `020`, is not used, and the `config` table is not used for this setting. -**Testing** (CI only, constitution VI; local work is compile checks): +**Testing** (CI only, constitution VI; local work is compile checks). New test files only; no existing test file is edited (OD-9 item 2, briefs/00 section 8): - `go test` with coverage gates: `operator` 72, `api` 80, `gp-module` 80, `mcp-server` 70. -- envtest: operator reconcile suite (`gameserver_security_envtest_test.go`) and API handler suite (`resources_security_envtest_test.go`, config section). +- envtest: operator reconcile suite (`operator/internal/controller/security_overrides_envtest_test.go`) and API handler suites (`api/internal/handlers/security_overrides_envtest_test.go`, `security_settings_envtest_test.go`). - vitest for the dashboard (`web` gates 92/76/82/92). -- The module repo's `test-validate-py.sh` for the new validator rules. +- The module repo's `test-validate-py-security.sh` for the new validator rules. - Kind E2E: `TestGameServer_SecurityOverrideAppliesOnRestart` and `TestAPI_SecurityOverride_PermissionAndRootRule`, registered in `test/e2e/buckets.sh` (R16). - `make lint` drift and doc checks: CRD sync, `i18n-check`, `check-specs`, `check-doc-versions`, `check-links`. **Target Platform**: Kubernetes (k3s, kind, managed), linux/amd64 and arm64, single and multi-cluster; behavior identical on both. -**Project Type**: Multi-component: operator CRDs and reconciler, API gateway, React dashboard, a module-authoring CLI, and the separate module repo. +**Project Type**: Multi-component: operator CRDs and reconciler, API gateway, React dashboard, a module-authoring CLI, Helm chart, and the separate module repo. -**Performance Goals**: SC-006: a server with 100,000 or more files and a filesystem group starts at least as fast as today, and with the default `OnRootMismatch` policy an unchanged restart adds no measurable ownership pass. The API adds one indexed `config` read to a server create or update that carries a root value, and nothing to other requests. +**Performance Goals**: SC-006: a server with 100,000 or more files and a filesystem group starts at least as fast as today, and with the default `OnRootMismatch` policy an unchanged restart adds no measurable ownership pass. The API reads the cluster's ConfigMap only for a request that carries a new or changed root value, and nothing for other requests. **Constraints**: - A server with no override runs with the same user, group and filesystem group as today (SC-001); an operator upgrade restarts no server (R5, R8). @@ -54,15 +56,17 @@ A game template already declares the uid, gid and filesystem group its game cont - No suppression directives, `%w` error wrapping, strict TypeScript (constitution III). - Dashboard text only through the shared language packs (FR-014). - Pencil files are touched only through the Pencil MCP, by the maintainer. +- Existing function names and positional signatures that tests call stay as they are (briefs/00 section 11). **Scale/Scope**: -- 2 CRDs changed (additive), 4 generated locations. -- 1 new permission, 1 new config section plus its ConfigMap mirror (1 new chart Role for the API), 1 new operator watch, 3 new API messages, 0 new routes. -- 1 shared dashboard section used on 2 screens, 1 admin switch, about 3 new design frames. +- 3 CRDs changed (additive): GameServer, GameTemplate, and the Cluster field `spec.controlPlaneNamespace` (OD-10, T078). Each generated copy is committed in the same change (`make generate && make manifests`). +- 1 new permission, 2 new routes (`GET` and `PUT /security-settings`), 1 ConfigMap per cluster created by Helm, 1 new operator watch, chart RBAC for the API on the home cluster and each remote cluster, none on a standalone panel (R9; corrected 2026-11-16). +- 4 new messages: 3 `server.security.*` and `server.cluster.security_settings_missing`. +- 1 shared dashboard section used on 2 screens, 1 cluster Security panel, about 4 new design frames. - About 20 module templates carry a `security` block; Palworld is the one known risky value. - 2 new E2E tests (the first also covers the OD-4 refusal). -No NEEDS CLARIFICATION remains. Every technical unknown is resolved in [research.md](research.md) (R1 to R16). OD-1 to OD-6 are all settled (valgul, 2026-11-07 and 2026-11-13); the plan builds on the rulings. +No NEEDS CLARIFICATION remains in the spec. The control-plane namespace the API uses for a remote cluster is settled by OD-10: the cluster registration records it (briefs/00 section 12). Every technical unknown is resolved in [research.md](research.md) (R1 to R16). OD-1 to OD-10 are all settled (valgul, 2026-11-07, 2026-11-13 and 2026-11-15); the plan builds on the rulings. ## Constitution Check @@ -70,24 +74,24 @@ No NEEDS CLARIFICATION remains. Every technical unknown is resolved in [research | Principle | Gate | Pre-design | Post-design | |---|---|---|---| -| **I. E2E-tested delivery (non-negotiable)** | A Kind E2E test exercises the real path, is registered in `test/e2e/buckets.sh`, uses `t.Parallel()`, unique names and the shared-state guards. | Planned: the spec's Assumptions name a Kind E2E that creates a server with an override and checks the running uid. | **PASS**: `TestGameServer_SecurityOverrideAppliesOnRestart` (running uid, no auto-restart, applied on restart, removal returns the module default, and the OD-4 refusal of a stopped root-override server when the setting ConfigMap says off) and `TestAPI_SecurityOverride_PermissionAndRootRule` (permission refusal, root refusal and allow, audit rows, the ConfigMap mirror). Login budget: the first test does zero logins; the second goes in the `operator` bucket (one admin login plus one login as its own user, about six against a ceiling near seven; see R16 and tasks.md). No game-module join applies: no module's game behavior changes. | -| **II. Design-first for user-facing change** | Dashboard changes are designed in `design.pen` via the Pencil MCP and exported before React code. | Required: wizard Advanced section, Settings Advanced section, admin switch. | **PASS, with a hard gate**: the design is made by valgul locally; no web task starts until `assets/design-export/{json,screenshots}/` for the new frames is in the branch. A cloud session writes no `.pen` file and never opens one (CLAUDE.md rule 2). Backend and docs tasks are exempt from the gate and proceed. | +| **I. E2E-tested delivery (non-negotiable)** | A Kind E2E test exercises the real path, is registered in `test/e2e/buckets.sh`, uses `t.Parallel()`, unique names and the shared-state guards. | Planned: the spec's Assumptions name a Kind E2E that creates a server with an override and checks the running uid. | **PASS**: `TestGameServer_SecurityOverrideAppliesOnRestart` (running uid, no auto-restart, applied on restart, removal returns the module default, and the OD-4 refusal of a stopped root-override server when the setting ConfigMap says off) and `TestAPI_SecurityOverride_PermissionAndRootRule` (permission refusal, root refusal and allow after the setting's `PUT /security-settings`, audit rows, the ConfigMap value). Login budget: the first test does zero logins; the second goes in the `operator` bucket (one admin login plus one login as its own user, about six against a ceiling near seven; see R16 and tasks.md). No game-module join applies: no module's game behavior changes. | +| **II. Design-first for user-facing change** | Dashboard changes are designed in `design.pen` via the Pencil MCP and exported before React code. | Required: wizard Advanced section, Settings Advanced section, the cluster Security panel. | **PASS, with a hard gate**: the design is made by valgul locally; no web task starts until `assets/design-export/{json,screenshots}/` for the new frames is in the branch. A cloud session writes no `.pen` file and never opens one (CLAUDE.md rule 2). Backend and docs tasks are exempt from the gate and proceed. | | **III. Language and ecosystem best practice** | No suppressions; `%w`; strict TS; CRD edits followed by `make generate && make manifests` with all artifacts in the same commit. | Required. | **PASS**: the CRD tasks list the generated deepcopy, `operator/config/crd/*.yaml`, `charts/gameplane/charts/gameplane-crds/crds/*.yaml` and `charts/gameplane/crd-manifests/*.yaml` in the same commit. No exclusion or loosened config is planned. New operator code stays under `operator/internal/controller/` (exempt from revive `exported:` only). | -| **IV. Spec-driven; per-module `specs.md`** | Behavior changes update the matching `specs.md` in the same change. | Required. | **PASS** (planned): `operator/specs.md`, `api/specs.md`, `web/specs.md`, `gp-module/specs.md`, `mcp-server/specs.md`, `test/e2e/specs.md`, `modules/palworld/specs.md` (module repo), plus `docs/module-authoring.md` (FR-013) and `docs/security.md` (new "Server security overrides" subsection under "Pod security"). OD-1 to OD-6 are settled in `OPEN-DECISIONS.md` and the specs follow the rulings. The folder becomes `done_030-...` only after merge and all tasks are complete or withdrawn. | +| **IV. Spec-driven; per-module `specs.md`** | Behavior changes update the matching `specs.md` in the same change. | Required. | **PASS** (planned): `operator/specs.md`, `api/specs.md`, `web/specs.md`, `gp-module/specs.md`, `mcp-server/specs.md`, `test/e2e/specs.md`, `modules/palworld/specs.md` (module repo), plus `docs/module-authoring.md` (FR-013) and `docs/security.md` (new "Server security overrides" subsection under "Pod security"). OD-1 to OD-9 are settled in `OPEN-DECISIONS.md` and the specs follow the rulings. The folder becomes `done_030-...` only after merge and all tasks are complete or withdrawn. | | **V. Delegate to Workflows and subagents** | The main loop delegates through `Workflow`, `model:` set on every `agent()`, haiku first, review one tier up, scout once. | Required. | **PASS** (process): the tasks phase produces scout briefs with exact `file:line` per slice; implementation waves are split by component (see Delivery slices); the CRD wave and the mechanical wave (i18n keys, docs) are scripted; reviews are one per batch against the brief. | | **VI. CI bears the heavy lifting** | Locally only `go build` and `tsc --noEmit`; nothing is reported validated before CI is green. | Required. | **PASS**: [quickstart.md](quickstart.md) lists only compile checks locally; all tests, lint, envtest and E2E run on CI, and the PR is not called ready until they pass. | -| CLAUDE.md core rule 3 (login privacy) | Unauthenticated views reveal nothing. | n/a | **PASS**: all new UI is behind sign-in; refusal messages name no cluster data. | -| CLAUDE.md core rules 9 and 10 | Kubernetes primitives first; the operator owns business logic. | Required. | **PASS**: the override is a field on an existing CRD; the ownership check is the kubelet's `fsGroupChangePolicy`; the operator computes and applies, and the API only validates and stores. | -| CLAUDE.md system override 10 (unsettled values) | Unsettled values go in `OPEN-DECISIONS.md`. | Required. | **PASS**: OD-1 to OD-6 are all settled; nothing unsettled is committed as a contract. | -| CLAUDE.md core rules 9 and 10, re-checked for OD-4 | The operator owns business logic; Kubernetes primitives first. | The operator must now learn the cluster setting. | **PASS**: the setting travels in a ConfigMap (a Kubernetes primitive) that the API writes and the operator watches; the refusal to start is reconciler logic, and the API still never bypasses reconciliation. | +| CLAUDE.md core rule 3 (login privacy) | Unauthenticated views reveal nothing. | n/a | **PASS**: all new UI is behind sign-in; refusal messages name no cluster data beyond the cluster id the caller chose. | +| CLAUDE.md core rules 9 and 10 | Kubernetes primitives first; the operator owns business logic. | Required. | **PASS**: the override is a field on an existing CRD; the ownership check is the kubelet's `fsGroupChangePolicy`; the cluster setting is a ConfigMap, a Kubernetes primitive that Helm creates and the operator watches; the operator computes and applies, and the API only validates, stores and audits. | +| CLAUDE.md core rules 9 and 10, re-checked for OD-4 and OD-7 | The operator owns business logic; Kubernetes primitives first. | The operator must learn the cluster setting. | **PASS**: the setting travels in a ConfigMap that the operator reads and the API reads and updates by name; the refusal to start is reconciler logic, and the API still never bypasses reconciliation. | +| CLAUDE.md system override 10 (unsettled values) | Unsettled values go in `OPEN-DECISIONS.md`. | Required. | **PASS**: OD-1 to OD-10 are settled. The remote cluster's control-plane namespace is settled by OD-10 (briefs/00 section 12); the identity for the remote grant still has to be found in the chart (briefs/00 section 7). | -**Result**: no violations, and no principle is bent. The one cost worth stating is a hard dependency, the design gate under principle II, which is a sequencing constraint, not a violation. +**Result**: no violations, and no principle is bent. The costs worth stating are a hard dependency, the design gate under principle II, which is a sequencing constraint, and the open remote-namespace item. ### Spec gaps found while planning 1. **No label for the ownership check's platform default.** FR-009 lists four sources (module default, override, "use image default" override, image default). The ownership check, when neither the module nor the server sets it, is neither "module default" nor "image default". The plan adds a fifth source, `BuiltInDefault`, used only for that setting ([data-model.md](data-model.md)). If the maintainers prefer another label this is a one-line change. 2. **Audit "before and after" has no field to live in.** FR-010 wants before and after in the audit log; the audit schema has none. The plan puts them in the existing `reason` column (R11) rather than adding a column. -3. **US1 scenario 3 ("on its next restart") and a template rollout.** With the default `Automatic` template rollout policy a module upgrade already stops and starts the server (`gameserver_template_revision.go`), so "next restart" is that rollout, not a separate event; with `OnRequest` it is the admitted rollout. No spec change needed; noted so tests expect it. +3. **US1 scenario 3 ("on its next restart") and a template rollout.** With the default `Automatic` template rollout policy a module upgrade already stops and starts the server (`gameserver_template_revision.go`), so "next restart" is that rollout, not a separate event; with `OnRequest` it is the admitted rollout. A rollout on a suspended or sleeping server ends at zero replicas, so its refresh waits for the next start (OD-9 item 5). Noted so tests expect it. ## Project Structure @@ -96,17 +100,20 @@ No NEEDS CLARIFICATION remains. Every technical unknown is resolved in [research ```text specs/030-security-context-overrides/ ├── spec.md -├── OPEN-DECISIONS.md # OD-1..OD-6 settled +├── OPEN-DECISIONS.md # OD-1..OD-10 settled ├── plan.md # this file ├── research.md # R1 to R16 ├── data-model.md ├── quickstart.md +├── briefs/ +│ ├── 00-rulings.md # binding rulings for OD-7..OD-9; read first +│ └── 01..04-*.md # scout briefs (facts); design statements superseded by 00 ├── contracts/ │ ├── crd-gameserver-security.md # spec.security + status.security, reconciler behavior │ ├── crd-gametemplate-security.md # ownership-check default, risky flag and reason, validators │ ├── api-server-security.md # create/update/clone semantics, error codes │ ├── rbac-permission.md # servers:security -│ ├── cluster-setting.md # security.allowRootOverrides +│ ├── cluster-setting.md # per-cluster ConfigMap, /security-settings routes, Helm creation │ └── audit-events.md # who/when/before/after in reason ├── checklists/requirements.md └── tasks.md # /speckit-tasks (not created here) @@ -118,60 +125,70 @@ specs/030-security-context-overrides/ operator/ ├── api/v1alpha1/ │ ├── gametemplate_types.go GameSecuritySpec (+ volumeOwnershipCheck, risky; new SecurityRiskSpec, SecurityRiskNote) :177, :185 +│ ├── cluster_types.go ClusterSpec.ControlPlaneNamespace (OD-10, T078; optional, default gameplane) │ ├── gameserver_types.go GameServerSpec.Security (after Capture :161); GameServerStatus.Security (:558); new GameServerSecuritySpec, │ │ SecurityIDOverride, GameServerSecurityStatus, SecuritySettings, SecurityIDStatus, SecurityCheckStatus │ └── zz_generated.deepcopy.go GENERATED ├── config/crd/gameplane.local_gameservers.yaml, gameplane.local_gametemplates.yaml GENERATED (make manifests) +├── cmd/main.go ControlPlaneNamespace set on GameServerReconciler from controlPlaneNamespace (:517-540) ├── internal/controller/ -│ ├── gameserver_security.go NEW: resolver (R4), pod encoding, applied reader, annotation codec, fsGroupChangePolicy mapping -│ ├── gameserver_controller.go gameContainerSecurityContext :2470, gamePodSecurityContext :2586, buildConfigInitContainer :2310, -│ │ reconcileStatefulSet gate around :1807-1918 (R5), validateRestrictedTemplate call :334 +│ ├── security_overrides.go NEW: resolver (R4), pod encoding, applied reader, annotation codec, fsGroupChangePolicy mapping +│ ├── security_settings.go NEW: ConfigMap reader (informer cache, fail closed), hasRootOverride, rootOverrideSettings, map func that re-enqueues servers holding a root override +│ ├── gameserver_controller.go gameContainerSecurityContext :2496, gamePodSecurityContext :2612, buildConfigInitContainer :2336 (wrappers kept, *Resolved variants added); +│ │ reconcileStatefulSet gate around :1797-1935 (R5); validateRestrictedTemplate call :353; ControlPlaneNamespace field (:45-60); Watches near :609-611 +│ ├── gameserver_idle.go root hold checked before reserveWakeStart (:333) (OD-9 item 4) +│ ├── gameserver_template_revision.go validateRestrictedTemplate calls :222, :288 take effective values; baselineRenderInputs :338-340 excludes spec.security (T075) +│ ├── gameserver_status.go publish status.security (merge patch); SecurityAllowed condition │ ├── workload_security.go validateRestrictedTemplate :15, restrictedContainerSecurity :23, applyWorkloadSecurity :39 take effective values -│ ├── gameserver_template_revision.go validateRestrictedTemplate calls :216, :278 take effective values -│ ├── gameserver_status.go publish status.security (merge patch of that field only); SecurityAllowed condition -│ ├── security_settings.go NEW: reader of the mirrored setting (ConfigMap gameplane-security-settings), root-override detector, map func that re-enqueues servers holding a root override -│ ├── gameserver_controller.go (also) watch on the ConfigMap near the other Watches (:583); start refusal in the R5 gate (RootOverrideDisallowed) -│ ├── backup_controller.go buildBackupPodSecurityContext :1133 takes the applied fsGroup; call :1035 -│ ├── restore_controller.go call :425 -│ ├── gameserver_security_test.go NEW: resolver table, encoding, gate, annotation round trip, root detector, restricted-mode effective values -│ ├── gameserver_security_envtest_test.go NEW: override applies on restart, pending, removal, upgrade no-restart, backup group, root-override refusal (setting off), running server untouched, start after clear or after the setting is back on -│ ├── workload_security_test.go, build_game_container_test.go, backup_envtest_test.go extended -│ └── crd_validation_envtest_test.go CEL cases for SecurityIDOverride and the enums +│ ├── backup_controller.go buildBackupPodSecurityContext :1156 (caller :1058) takes the applied fsGroup as a trailing variadic +│ ├── backup_worker.go applied fsGroup threaded from bound GameServer (:306, :129-130) +│ ├── restore_controller.go buildRestorePodSpec :425 (call :277, security :433) takes the applied fsGroup +│ ├── security_overrides_test.go NEW unit tests (resolver, codec, gate, restricted mode, backup group) +│ ├── security_overrides_envtest_test.go NEW envtest: override applies on restart, pending, removal, upgrade no-restart, root-override refusal (setting off), running server untouched, start after clear or after the setting is back on +│ ├── security_settings_test.go NEW unit tests: hasRootOverride, rootOverrideSettings, ConfigMap reader +│ ├── security_builders_test.go NEW unit tests: byte-identical unset pod, helper containers keep their users +│ ├── security_crd_validation_envtest_test.go NEW CEL cases for SecurityIDOverride and the enums +│ └── security_backup_envtest_test.go NEW backup and restore applied-group cases └── specs.md charts/gameplane/ -├── templates/api.yaml Role + RoleBinding in the release namespace: configmaps `gameplane-security-settings` get/create/update/patch (R9) -├── charts/gameplane-crds/crds/*.yaml GENERATED (gameservers, gametemplates) -└── crd-manifests/*.yaml GENERATED (gameservers, gametemplates) +├── templates/api-credentials.yaml Role rule in the credentials namespace: configmaps `gameplane-security-settings` get/update/patch by resourceNames (no create) (R9, OD-8) +├── templates/operator*.yaml the ConfigMap `gameplane-security-settings` created by Helm with "false", keep annotation, lookup on upgrade (OD-8) +├── templates/ remote-chart grant for the identity the API uses for a remote cluster (T076; identity to be found in the chart) +├── charts/gameplane-crds/crds/*.yaml GENERATED (gameservers, gametemplates) +└── crd-manifests/*.yaml GENERATED (gameservers, gametemplates) api/ -├── cmd/main.go MountResources now receives the auditor (:382) -├── internal/rbac/catalog.go servers:security (:25-29) -├── internal/rbac/catalog_test.go, rbac_test.go key exists, namespaced, admin-only among built-ins +├── cmd/main.go MountResources receives the auditor; MountSecuritySettings mounted; MountLifecycle receives the auditor (variadic) +├── internal/rbac/catalog.go servers:security (:25-29) +├── internal/rbac/rbac.go rule entries for GET and PUT /security-settings next to the /admin/config rules (:209, :214) +├── internal/rbac/catalog_security_test.go NEW: key exists, namespaced, held by admin only among the built-in roles ├── internal/handlers/ -│ ├── security_settings_sync.go NEW: writes the ConfigMap mirror on a setting flip, re-syncs on API start (R9) -│ ├── resources.go MountResources :51; validateAndProtectGameServer :538 new security step; create :218 and update :290 audit write -│ ├── resources_security.go NEW: shape validation, root rule, restore-live, reason builder -│ ├── lifecycle.go clone path :243 (no change expected; covered by the shared validator) -│ ├── config.go "security" validator in newValidators :462; audit row on flip (:174 pattern); ConfigMap mirror call -│ ├── resources_security_envtest_test.go NEW; config_envtest_test.go extended -│ └── resources_security_test.go existing file; extended or a sibling unit test -├── internal/messages/entries_server.go server.security.forbidden, .root_disabled, .invalid +│ ├── security_overrides.go NEW: shape validation, root rule (reads the request cluster's ConfigMap), restore-live, reason builder, refusal typing +│ ├── security_settings.go NEW: GET and PUT /security-settings, ConfigMap get and update by name, flip audit row, MountSecuritySettings +│ ├── resources.go MountResources :51; validateAndProtectGameServer :570 new security step; create :250 and update :322 audit write +│ ├── lifecycle.go clone path :243 (validator call with live nil; audit row); MountLifecycle :40 takes the auditor variadic +│ ├── security_overrides_test.go NEW unit tests +│ ├── security_overrides_envtest_test.go NEW envtest (dedicated router) +│ ├── security_settings_test.go NEW unit tests (validator, GET and PUT shape) +│ └── security_settings_envtest_test.go NEW envtest (dedicated router, flip, 409, 502, rows) +├── internal/messages/ server.security.forbidden, .root_disabled, .invalid; server.cluster.security_settings_missing └── specs.md -i18n/locales/en/app.json server.security.* and web.routes.* keys (other locales follow docs/translating.md) +i18n/locales/en/app.json, fr/app.json server.security.* and server.cluster.security_settings_missing, web.routes.* and web.clusters.* keys web/src/ BLOCKED until the design export lands ├── types.ts GameServer.spec.security, GameServer.status.security (:557), GameTemplate.spec.security (:303) -├── lib/api.ts server create/update already pass spec; add the security config section get/put +├── lib/api.ts server create/update already pass spec; add GET and PUT /security-settings client methods ├── components/SecurityAdvanced.tsx NEW shared section + risky confirmation (and .test.tsx) +├── components/clusters/SecuritySettingsPanel.tsx NEW cluster Security panel (switch, missing state) (and .test.tsx) +├── components/clusters/ClusterConfiguration.tsx mounts SecuritySettingsPanel next to BackupDestinationsPanel.tsx ├── routes/CreateServer.tsx collapsed Advanced section in the wizard ├── routes/tabs/Settings.tsx, routes/tabs/settings/Security.tsx NEW settings subsection for an existing server -├── routes/AdminSettings.tsx "Security" section with the allow-root switch └── specs.md gp-module/ -├── internal/validator/rules.go risky and ownership-check rules +├── internal/validator/rules.go risky and ownership-check rules (called from validator.go next to :169-170) ├── internal/preview/ print resolved defaults and risky settings ├── internal/scaffold/scaffold.go :167, :213 (README text) unchanged unless an archetype asks for risky └── specs.md @@ -186,21 +203,22 @@ test/e2e/ └── specs.md docs/ -├── module-authoring.md "Security context" :1137-1173 (FR-013) -└── security.md server security overrides under "Pod security" (:435) +├── module-authoring.md "Security context" :1157-1194 (FR-013) +└── security.md server security overrides under "Pod security" (:435, insert before "## Module supply chain" :564) hack/gen-module-schema.py run via `make module-schema`, output in the module repo assets/design-export/ maintainer-produced export of the new frames (design gate) design.pen maintainer only, through the Pencil MCP; never touched here +/mnt/project-files/notes/design-prompts/030-security-overrides.md design prompt for the maintainer's local agent # Separate repository: GameplanePanel/module (checked out at modules/, local clone /home/user/module) .schema/gametemplate.schema.json regenerated from the CRD (make module-schema) -validate.py, test-validate-py.sh new risky and ownership-check rules and tests -palworld/template.yaml, palworld/specs.md risky.runAsUser with a reason +validate.py, test-validate-py-security.sh new risky and ownership-check rules and tests +palworld/template.yaml, palworld/specs.md risky.runAsUser with a reason # Main repo afterwards: `git add modules` pointer bump (submodule-bump skill), only after the module PR merges ``` -**Structure Decision**: no new module or service. The work follows the existing component boundaries (operator computes and applies; API validates, stores and audits; web renders; modules declare defaults). The only new files are one operator source file, one API source file, one shared web component and two E2E tests. Target folder shapes were checked against `docs/layout.md`. +**Structure Decision**: no new module or service. The work follows the existing component boundaries (operator computes and applies; API validates, stores and audits; web renders; the chart creates the setting's ConfigMap; modules declare defaults). The new files are two operator source files, two API source files, two dashboard components and two E2E tests. Target folder shapes were checked against `docs/layout.md`. ### Delivery slices @@ -208,15 +226,16 @@ Independent slices, fanned out per constitution V; each slice ends in compile ch | Slice | Content | Depends on | |---|---|---| -| A. CRD | Go types, `make generate && make manifests`, CEL tests | none | -| B. Operator | resolver, encoding, gate, status, backup/restore group, restricted mode (OD-5), setting reader and root-override start refusal (OD-4) | A | -| C. API | permission, validator, config section and ConfigMap mirror (plus chart RBAC), audit (incl. risky marker, OD-6), messages | A (types only for tests) | -| D. Module repo | schema regeneration, `validate.py`, Palworld, then a separate PR | A | -| E. gp-module and docs | validator rules, preview, `module-authoring.md`, `security.md`, `specs.md` files | A, D | -| F. E2E | the two tests and bucket registration (both in `operator`) | B, C | -| G. Dashboard | shared section, wizard, Settings, admin switch, i18n, vitest | C, **design export** | -| H. Pointer bump | `git add modules` after the module PR merges | D merged | +| A. CRD | Go types (GameServer, GameTemplate, Cluster `controlPlaneNamespace`, T078), `make generate && make manifests`, CEL tests | none | +| B. Operator | resolver, encoding, gate, status, backup/restore group, restricted mode (OD-5), setting reader and root-override start refusal (OD-4), wake hold (OD-9 item 4), baseline exclusion (T075) | A | +| C. API | permission, validator, the `/security-settings` routes and rules, the root rule, audit (incl. risky marker, OD-6, and the flip row), messages | A (types only for tests) | +| D. Chart | the Helm-created ConfigMap with lookup (T077), the API Role rules (T058), the remote grant (T076) | none | +| E. Module repo | schema regeneration, `validate.py`, Palworld, then a separate PR | A | +| F. gp-module and docs | validator rules, preview, `module-authoring.md`, `security.md`, `specs.md` files | A, E | +| G. E2E | the two tests and bucket registration (both in `operator`) | B, C, D | +| H. Dashboard | shared section, wizard, Settings, cluster Security panel, i18n, vitest | C, **design export** | +| I. Pointer bump | `git add modules` after the module PR merges | E merged | ## Complexity Tracking -No Constitution Check violations; nothing to justify. The design gate on slice G (principle II) and the separate module-repo PR with a later pointer bump are sequencing constraints, recorded above, not bent principles. +No Constitution Check violations; nothing to justify. The design gate on slice H (principle II), the separate module-repo PR with a later pointer bump, and the open remote-namespace item are sequencing constraints or open questions, recorded above, not bent principles. diff --git a/specs/030-security-context-overrides/quickstart.md b/specs/030-security-context-overrides/quickstart.md index 8a8a7fcca..38de542fe 100644 --- a/specs/030-security-context-overrides/quickstart.md +++ b/specs/030-security-context-overrides/quickstart.md @@ -20,7 +20,7 @@ cd web && npx tsc --noEmit && cd .. | What | Where | |---|---| | Resolver table tests, StatefulSet gate, backup/restore group, status, root-override start refusal, restricted-mode effective values | `go test` and envtest for `operator` (gate 72) | -| Create, update, clone, permission, root rule, config section and its ConfigMap mirror, audit rows (with the risky marker) | `make test-integration` (envtest, `api` gate 80) | +| Create, update, clone, permission, root rule, the cluster setting routes and its ConfigMap, audit rows (with the risky marker) | `make test-integration` (envtest, `api` gate 80) | | Template checks | `gp-module` unit tests (gate 80); the module repo's validator tests (`test-validate-py.sh`) | | Dashboard section, wizard, settings, admin switch | vitest (`web` gates) | | i18n key coverage | `i18n-check` in `make lint` | @@ -34,7 +34,7 @@ cd web && npx tsc --noEmit && cd .. - `git submodule update --init modules` and `make dev-up`, then `make images && make dev-load && make dev-install` with this branch's operator and API. - A game template with a security block. The E2E busybox fixture (`test/e2e/test_helpers_e2e_test.go:42`) is enough: add `security: {runAsUser: 1000, runAsGroup: 1000, fsGroup: 1000}` to it and apply it. - Two sign-ins: the bootstrap admin, and a user bound to the built-in `operator` role (holds `servers:write`, not `servers:security`). -- `GET /admin/config` shows no `security` section (setting off). +- `GET /security-settings?cluster=` shows `allowRootOverrides: false`, `present: true` (the chart created the ConfigMap as `"false"`, OD-8). ### S1: no override means no change (US1; FR-001, SC-001) @@ -81,19 +81,23 @@ cd web && npx tsc --noEmit && cd .. 6. Open the server's Advanced section as the `operator`-role user. - **Expect** the values, sources and pending marker are visible and read-only. -### S5: the root setting (FR-005, FR-005a; OD-2, OD-4) +### S5: the root setting (FR-005, FR-005a; OD-2, OD-4, OD-7) -1. As admin, `PUT /admin/config/security {"allowRootOverrides": true}` ([cluster-setting.md](contracts/cluster-setting.md)). +1. As admin, `PUT /security-settings?cluster= {"allowRootOverrides": true}` ([cluster-setting.md](contracts/cluster-setting.md)). + - **Expect** 200, and `GET` shows `allowRootOverrides: true`. 2. Create a server with `fsGroup { value: 0 }`, then one with `runAsUser { useImageDefault: true }`. - **Expect** both accepted. -3. Turn the setting off (`PUT /admin/config/security {"allowRootOverrides": false}`) and save an unrelated change to the first server. +3. Turn the setting off (`PUT /security-settings?cluster= {"allowRootOverrides": false}`) and save an unrelated change to the first server. - **Expect** 200 and the override remains; a new server with a root value is refused again. `kubectl get configmap gameplane-security-settings -n -o yaml` shows `allowRootOverrides: "false"`. +4. Per cluster: on a second registered cluster, the setting is still off until its own switch is turned on, and that cluster's ConfigMap is not changed by the first cluster's switch. + - **Expect** a root value on the second cluster is refused (403 `server.security.root_disabled`) until its own switch is on (OD-7). + ### S5a: turning the setting off with root-override servers (FR-005a; OD-4) Prerequisite: S5 step 2 left two servers holding root overrides (`fsGroup { value: 0 }` and `runAsUser { useImageDefault: true }`) and the setting is on. Stop the first one (Suspend), keep the second running, then turn the setting off. -1. Note the second server's pod UID and restart count, then `PUT /admin/config/security {"allowRootOverrides": false}`. +1. Note the second server's pod UID and restart count, then `PUT /security-settings?cluster= {"allowRootOverrides": false}`. - **Expect** the running server's pod UID and restart count do not change; no server restarts or stops. Its `SecurityAllowed` condition is `False` with reason `RootOverrideDisallowed` and a message that it will not start again until the override is cleared or the setting is on. 2. Start the stopped first server (Resume or Start). - **Expect** it stays at zero replicas; its status shows `SecurityAllowed=False`, reason `RootOverrideDisallowed`, naming `fsGroup`; the dashboard shows the reason and what clears it. @@ -102,7 +106,7 @@ Prerequisite: S5 step 2 left two servers holding root overrides (`fsGroup { valu 4. Suspend the second server, then turn the setting back on, and start it. - **Expect** it starts with its override; `SecurityAllowed` is `True`. Repeat step 2 with the setting on first: **expect** a stopped server holding a root override starts as soon as the setting is flipped on (no other action). 5. Delete the ConfigMap `gameplane-security-settings` while a stopped server holds a root override. - - **Expect** the setting reads as off (fail closed): the server does not start; restarting the API recreates the ConfigMap from the stored setting. + - **Expect** the setting reads as off (fail closed): the server does not start, `GET /security-settings` reports `present: false`, and `PUT /security-settings` returns 409 `server.cluster.security_settings_missing`. The next `helm upgrade` recreates the ConfigMap as `"false"`, because nothing is left to keep (OD-8). ### S5b: restricted workload mode (OD-5) diff --git a/specs/030-security-context-overrides/research.md b/specs/030-security-context-overrides/research.md index e0bf3f0c0..c29c93b81 100644 --- a/specs/030-security-context-overrides/research.md +++ b/specs/030-security-context-overrides/research.md @@ -2,7 +2,7 @@ **Feature**: [spec.md](spec.md) | **Plan**: [plan.md](plan.md) | **Date**: 2026-11-13 -Each entry records a decision, why it was made, and what else was considered. Facts about current code cite `file:line` as of the `spec-030/plan-and-tasks` branch. Questions that need a product ruling are in [OPEN-DECISIONS.md](OPEN-DECISIONS.md) (OD-1 to OD-6, all settled by valgul, 2026-11-07 and 2026-11-13); each entry that a ruling shaped says which one. +Each entry records a decision, why it was made, and what else was considered. Facts about current code cite `file:line` as of the `spec-030/plan-and-tasks` branch. Questions that need a product ruling are in [OPEN-DECISIONS.md](OPEN-DECISIONS.md) (OD-1 to OD-10, all settled by valgul, 2026-11-07, 2026-11-13 and 2026-11-15; `briefs/00-rulings.md` is binding where it differs); each entry that a ruling shaped says which one. ## Baseline facts @@ -157,34 +157,33 @@ The config-init container already makes copied files group-writable itself (`gam **Residual risk**: `OnRootMismatch` does not repair files created with the wrong group inside an otherwise correct top folder (for example by an earlier run as another uid). The dashboard's `EveryStart` choice is the remedy; the data-model and quickstart both cover it. A per-feature note in `docs/module-authoring.md` (FR-013) explains when a module should set `EveryStart`. -## R9. The cluster-wide "allow root overrides" setting, and how the operator learns it +## R9. The per-cluster "allow root overrides" setting, and how the operator learns it -**Decision**: a new config section `security` with one boolean, `allowRootOverrides`, default false (absent row means false). It is added to `newValidators` (`config.go:462`), is read through `GET /admin/config`, and is written through `PUT /admin/config/security`, which the existing rule table already gates with `config:manage` (`rbac.go:223-228`). A change writes its own audit row (R11), following `config.go:174-179`. +**Decision** (OD-7 C, OD-8 A, settled 2026-11-15): the setting is separate for each cluster and off by default. Its only store is one ConfigMap per cluster, `gameplane-security-settings`, in the operator's control-plane namespace on that cluster (the credentials namespace `-credentials` on a default install with the API enabled; the release namespace in standalone or no-API mode). It has one key, `allowRootOverrides`, with the value `"true"` or `"false"`. A missing ConfigMap, a missing key, or any value other than exact `"true"` is off. There is no config-table row and no API start-up sync (OD-7). -**The operator must read it (OD-4, settled A).** FR-005a: while the setting is off, the reconciler must not start a server that holds a saved root override, and must say why. The operator has no access to the API's database and must not call the API (CLAUDE.md rule 10), so the setting reaches it as a Kubernetes object: - -- The API owns one ConfigMap, `gameplane-security-settings`, in the gameplane (control-plane) namespace of each cluster, with the single key `allowRootOverrides` (`"true"` or `"false"`). The API is its only writer; the config table stays the source of truth. -- `PUT /admin/config/security` writes the ConfigMap first, then the config row, and fails the request if the ConfigMap write fails, so the two cannot drift silently. In a multi-cluster install the central API writes the ConfigMap into every registered cluster it can reach; a start-up sync in the API rewrites it from the config row, so a restored database, a newly registered cluster or a manually deleted ConfigMap converge. -- **Fail closed**: a missing ConfigMap, a missing key or any value other than `"true"` means the setting is off. The default install therefore refuses root overrides on start with no extra step. -- The operator reads it from its informer cache (it already has cluster-wide `get;list;watch` on ConfigMaps, `operator/internal/controller/gameserver_controller.go:258`; the cache cost is one more watched object) and adds a `Watches(&corev1.ConfigMap{})` entry next to the Pod and GameTemplate watches (`:583`), filtered to that name and namespace, with a map function that enqueues every GameServer holding a root override in any namespace (so a flip, in either direction, is picked up at once; unrelated servers are not enqueued). -- The API's chart Role gains `get;create;update;patch` on that one ConfigMap by `resourceNames` (`charts/gameplane/templates/api.yaml`); the operator needs no new rule. +- **Creation.** Helm creates the ConfigMap wherever the operator chart renders, with `"false"` and the annotation `helm.sh/resource-policy: keep`. On upgrade the template reads the current object with `lookup` and re-renders its value, so an upgrade never flips it. A deleted ConfigMap reads as off until the next `helm upgrade`. +- **API access.** The API reads the ConfigMap of the request's own cluster for case 5 of the root rule (R10), through that cluster's registry client. It writes only through `PUT /security-settings?cluster=` (`config:manage`), by name, and never creates the object. The grant is `get`, `update` and `patch` with `resourceNames: [gameplane-security-settings]`: on the home cluster in `charts/gameplane/templates/api-credentials.yaml` and on each remote cluster (none on a standalone panel (corrected 2026-11-16, valgul approved: a standalone panel has no local operator and mounts no service account token, so it renders neither the ConfigMap nor an API Role for it; `charts/tests/check_standalone.py` asserts it renders no Roles)) from the remote chart (task T076), in the control-plane namespace recorded on that cluster's registration (`Cluster.spec.controlPlaneNamespace`, default `gameplane`, OD-10 A; see the paragraph below R10). The identity the API uses on a remote cluster must be found in the chart (briefs/00 section 7). +- **Operator access.** The operator reads its own cluster's ConfigMap from its informer cache, in the namespace given by `ControlPlaneNamespace` (set from the `--control-plane-namespace` flag). The ConfigMap informer is cluster-wide (only Secrets are scoped, briefs/02 D5), so no new informer is needed. Any error or a missing object means off (fail closed). +- **Watch.** `Watches(&corev1.ConfigMap{}, ...)` sits next to the Pod and GameTemplate watches. Its map function filters to that name and namespace, and enqueues every GameServer that holds a root override, in any namespace. Unrelated servers are not enqueued. **What the reconciler does with it** (FR-005a). A *root override* is a saved `spec.security` whose `runAsUser` or `runAsGroup` is `value: 0` or `useImageDefault: true`, or whose `fsGroup` is `value: 0`. While the setting is off and the server holds one: -- a server that is not running (zero replicas, so the next scale-up would be a start) is **not scaled up**: the zero-to-one transition in `reconcileStatefulSet` (the R5 refresh point) is held at zero and the server reports condition `SecurityAllowed` `False`, reason `RootOverrideDisallowed`, message naming the offending settings and how to clear them; -- a server that is already running is **never touched**: no scale-down, no pod-template change, no restart, and its phase is unchanged; the same condition is set to `False` with a message saying the server keeps running but will not start again until the override is cleared or the setting is on, so the dashboard can warn before the next restart; -- turning the setting off never restarts or stops any server, and turning it back on (or clearing the override) lets the next reconcile start the server with no other step. The module's own root defaults (a template that sets user 0) are not overrides and are not affected. - -The check runs before the R5 refresh, so a refused start leaves the StatefulSet exactly as it was. The reconciler sets the condition from the same pure helper the tests exercise (`hasRootOverride(gs)` and `rootOverrideSettings(gs)` in `security_settings.go`). +- a server that is not running (zero replicas, so the next scale-up would be a start) is **not scaled up**. The zero-to-one transition in `reconcileStatefulSet` (the R5 refresh point) is held at zero, and the server reports condition `SecurityAllowed` `False`, reason `RootOverrideDisallowed`, with a message that names the offending settings and says how to clear them. The hold is checked before `reserveWakeStart` (`gameserver_idle.go:333`), so a held sleeping server takes no wake slot (OD-9 item 4); +- a server that is already running is **never touched**: no scale-down, no pod-template change, no restart, and its phase is unchanged. The condition is `False` with a message that the server keeps running but will not start again until the override is cleared or the setting is on; +- turning the setting off never restarts or stops any server. Turning it back on, or clearing the override, lets the next reconcile start the server with no other step. The module's own root defaults (a template that sets user 0) are not overrides and are not affected. -The API still reads the setting from the config table per request inside the create and update path (one indexed `SELECT` on `config`) and refuses only a request that *sets or changes* a root value; an unchanged one passes through (so a whole-spec PUT from the dashboard still works) and removing one is always allowed. The reconciler's refusal is the second line, for overrides saved before the setting was turned off, and for writers that bypass the API (`kubectl`). +The check runs before the R5 refresh, so a refused start leaves the StatefulSet exactly as it was. The reconciler computes the condition with the pure helpers `hasRootOverride(gs)` and `rootOverrideSettings(gs)` in `operator/internal/controller/security_settings.go`. -**Rationale**: the config store is the established home for admin switches, has validation, audit hooks, dashboard plumbing (`AdminSettings.tsx`) and RBAC for free, and the spec says an admin turns it on and off, audited (FR-005). A ConfigMap is the Kubernetes primitive for small cluster configuration the operator must watch (CLAUDE.md rule 9), is namespaced, RBAC-controlled and cached, and keeps the operator from learning the API's database or calling it (rule 10). +**Rationale**: the operator must learn the setting without calling the API or reading its database (CLAUDE.md rule 10). A ConfigMap is the Kubernetes primitive for small cluster configuration that the operator watches (CLAUDE.md rule 9). Helm owns creation, so the API needs only the narrowest grant (get, update and patch by name), and a deleted object fails closed. Keeping the setting per cluster matches where the dashboard shows it (Clusters, cluster, Configuration). **Alternatives considered**: -- *The operator calls the API for the setting.* A runtime dependency in the wrong direction (operator to API), and it fails if the API is down exactly when a server must be started. -- *A Helm value or operator flag.* Needs a rollout to change and cannot be changed or audited as an admin action. -- *A field on a cluster-scoped CRD (a new `ClusterSecurityPolicy`).* A new CRD, schema, RBAC and generated copies for one boolean; a ConfigMap is enough. -- *Copying the flag onto each GameServer (`status` or an annotation) from the API.* Fans out writes to every server on each flip and adds another writer of GameServer objects. +- *A config-table row written by the API and mirrored to a ConfigMap.* Rejected by OD-7: two stores, a start-up sync, and an API `create` verb that Kubernetes cannot limit by name (OD-8). +- *One panel-wide value copied to every cluster.* Rejected by OD-7 C, which makes the setting per cluster. +- *The operator calls the API for the setting.* A runtime dependency in the wrong direction, and it fails exactly when a server must start while the API is down. +- *A Helm value or operator flag.* Needs a rollout to change, and cannot be changed or audited as an admin action. +- *A field on a cluster-scoped CRD.* A new CRD and schema for one boolean. +- *Copying the flag onto each GameServer from the API.* Fans out writes to every server on each flip. + +**Remote namespace (OD-10 A, settled 2026-11-15).** The API learns a remote cluster's control-plane namespace from its registration: an optional `Cluster.spec.controlPlaneNamespace`, default `gameplane`, set in the register-cluster form and shown on the cluster page. It needs no extra permission on the remote cluster, and a wrong value only shows the setting as missing (the ConfigMap is not found, so it reads as off). Rejected: a fixed namespace name on every install (OD-10 B), which fixes the release layout, and a label lookup across all namespaces (OD-10 C), which needs cluster-wide ConfigMap list permission. ## R10. Where each permission and validation check runs @@ -195,7 +194,7 @@ The new block in `validateAndProtectGameServer` (after the capture step), for `d 2. **Absent in the request, present in live**, caller lacks `servers:security`: restore live's value into the request (the same move the capture and image steps make), so a client that drops the field cannot wipe it by accident. 3. **Changed** and the caller lacks `servers:security`: refuse (403, `server.security.forbidden`). 4. **Shape**: each id 0 to 4294967295, exactly one of `value`/`useImageDefault`, enum values valid: refuse (422, `server.security.invalid`). The CRD's CEL and bounds are the second line. -5. **Root rule** (FR-005, OD-2): a new or changed `runAsUser`/`runAsGroup` with value 0 or `useImageDefault`, or `fsGroup` with value 0, is refused (403, `server.security.root_disabled`) unless `allowRootOverrides` is true. Only new or changed values are checked at write time; an existing root override is checked by the reconciler on start (R9, OD-4 settled A). +5. **Root rule** (FR-005, OD-2): a new or changed `runAsUser`/`runAsGroup` with value 0 or `useImageDefault`, or `fsGroup` with value 0, is refused (403, `server.security.root_disabled`) unless the request's cluster setting is on (its ConfigMap `gameplane-security-settings`, R9). Only new or changed values are checked at write time; an existing root override is checked by the reconciler on start (R9, OD-4 settled A). Clone (`lifecycle.go:243`) reaches the same function with `live == nil`, so a clone of a server that has overrides is refused for a caller without `servers:security`, with the same message; a holder can clone. That is the intended reading of "no inheriting a privilege on a clone" already used for the capture node exception (`lifecycle.go:232-234`). @@ -213,7 +212,7 @@ Clone (`lifecycle.go:243`) reaches the same function with `live == nil`, so a cl **Risky marker (OD-6, settled C).** The change row also records which of the changed settings the pinned template had marked risky at the time of the change: the JSON gains `"risky":["runAsUser"]` after `after` (the setting names only, never the module's reason text). The handler learns it from the template it already loads for the server (the same `GameTemplate` read the create and update path uses for the template reference); a template without a `risky` map, or a change touching no risky setting, adds no key. Nothing is refused on this basis: the dashboard asks, a direct API call is accepted from any `servers:security` holder. -A root refusal and a permission refusal also write a row (`status` 403, `reason` `security_forbidden` or `security_root_disabled`), as the capture handler records failures. The cluster setting change writes its own row: `PUT /admin/config/security`, `target` `security`, `reason` `allowRootOverrides:false->true`. The reconciler's refusal to start a server is a status condition and an event, not an audit row (the audit log records API actions). +A root refusal and a permission refusal also write a row (`status` 403, `reason` `security_forbidden` or `security_root_disabled`), as the capture handler records failures. The cluster setting flip writes its own row before the ConfigMap update: `PUT /security-settings`, `target` `security/`, `reason` `allowRootOverrides:false->true` (briefs/00 section 5). The reconciler's refusal to start a server is a status condition and an event, not an audit row (the audit log records API actions). **Rationale**: FR-010 and SC-005 need who, when, before and after. The `reason` column is the existing structured, hash-chained, webhook-forwarded and S3-forwarded field (`audit.go:711-750`), so the entry reaches every sink with no schema or chain change. The values are four small numbers, bounded. @@ -221,13 +220,13 @@ A root refusal and a permission refusal also write a row (`status` 403, `reason` ## R12. Database migration -**Decision**: none. No new table or column: the override lives on the CRD, the setting is a new key in the existing `config` table (a row created on first write), and the audit detail uses the existing `reason` column. The next free portable migration number is 020 (`api/internal/db/migrations/common/`); it is not consumed. +**Decision**: none. No new table or column: the override lives on the CRD, the setting is a ConfigMap per cluster, not a config row (R9), and the audit detail uses the existing `reason` column. The next free portable migration number is 020 (`api/internal/db/migrations/common/`); it is not consumed. ## R13. The dashboard **Decision**: one reusable "Advanced security" section component used in the create wizard and the server Settings tab, both behind a collapsed disclosure (FR-006, FR-007). It renders, per setting: the module default (or "image default"), the applied value and source (existing servers), the pending value, and an override control (value, "use image default", or clear). It reads permission from the existing user permission data to render read-only without `servers:security` (US4 scenario 1) and surfaces the three server refusals (R10) as inline errors. Risky values trigger a confirmation dialog showing the template's `reason` (OD-6, settled C: the confirmation is the dashboard's only; the API refuses nothing on that basis, and the audit row records that the value was risky at change time, R11). A saved change on an existing server shows the "applies on the next restart" notice and, for run-as user or group on a server with data, the file-access warning (FR-007, FR-008). -**Design-first (constitution II, CLAUDE.md rule 1)**: the section, its states and the dialogs are designed in `design.pen` on the maintainer's local machine through the Pencil MCP and exported to `assets/design-export/` **before any web code**. A cloud session cannot run Pencil, so web tasks are blocked until that export is committed. Backend, operator, API, module and docs work is independent of the design and proceeds in parallel. All strings go through the shared packs (FR-014): `web.routes.create_server.advanced_*` and `web.routes.server_settings.security_*` keys in `i18n/locales/en/app.json`, plus `server.security.*` messages in `api/internal/messages/entries_server.go` for the three API refusals. +**Design-first (constitution II, CLAUDE.md rule 1)**: the section, its states and the dialogs are designed in `design.pen` on the maintainer's local machine through the Pencil MCP and exported to `assets/design-export/` **before any web code**. A cloud session cannot run Pencil, so web tasks are blocked until that export is committed. Backend, operator, API, module and docs work is independent of the design and proceeds in parallel. All strings go through the shared packs (FR-014): `web.routes.create_server.advanced_*` and `web.routes.server_settings.security_*` keys in `i18n/locales/en/app.json`, plus `server.security.*` messages in `api/internal/messages/entries_server.go` for the three API refusals, and `server.cluster.security_settings_missing` for the missing-ConfigMap state. The `web.clusters.security_*` keys serve the cluster Security panel. **Alternatives considered**: *A new admin page for overrides.* Contradicts the spec's assumption that Advanced is a collapsed section on the existing screens. @@ -249,8 +248,8 @@ A root refusal and a permission refusal also write a row (`status` 403, `reason` ## R16. End-to-end proof **Decision**: two E2E tests in `test/e2e/`, registered in `test/e2e/buckets.sh`, both `t.Parallel()` with unique names: -- `TestGameServer_SecurityOverrideAppliesOnRestart` (operator bucket, zero logins, busybox fixture from `test_helpers_e2e_test.go:42-90`): create with a run-as user override, assert the running uid with `Env.KubectlExec(... id -u)` (`env.go:259`); change the override, assert no restart (same pod UID, `status.security.pending` true, applied unchanged); restart, assert the new uid and `pending` false; remove the override, restart, assert the module default. Then the OD-4 phase, still without the API: save a root `fsGroup` override, stop the server, make sure the ConfigMap `gameplane-security-settings` says off (absent or `"false"`), start it and assert it stays at zero replicas with condition `SecurityAllowed=False` / `RootOverrideDisallowed`; set the ConfigMap to `"true"` with `kubectl` and assert the server starts; set it back to `"false"` and assert the running pod keeps its UID and restart count. -- `TestAPI_SecurityOverride_PermissionAndRootRule` (needs admin and a non-admin login): a user without `servers:security` is refused (403) on create and on update; with the permission, accepted; a root value is refused (403) while `allowRootOverrides` is off and accepted after an admin enables it; the audit log has the rows, and each flip of the setting is mirrored into the ConfigMap (`allowRootOverrides` `"true"` or `"false"`). +- `TestGameServer_SecurityOverrideAppliesOnRestart` (operator bucket, zero logins, busybox fixture from `test_helpers_e2e_test.go:42-90`): create with a run-as user override, assert the running uid with `Env.KubectlExec(... id -u)` (`env.go:259`); change the override, assert no restart (same pod UID, `status.security.pending` true, applied unchanged); restart, assert the new uid and `pending` false; remove the override, restart, assert the module default. Then the OD-4 phase, still without the API: save a root `fsGroup` override, stop the server, make sure the ConfigMap `gameplane-security-settings` says off (`"false"`, as Helm creates it, OD-8), start it and assert it stays at zero replicas with condition `SecurityAllowed=False` / `RootOverrideDisallowed`; set the ConfigMap to `"true"` with `kubectl` and assert the server starts; set it back to `"false"` and assert the running pod keeps its UID and restart count. +- `TestAPI_SecurityOverride_PermissionAndRootRule` (needs admin and a non-admin login): a user without `servers:security` is refused (403) on create and on update; with the permission, accepted; a root value is refused (403) while `allowRootOverrides` is off and accepted after an admin enables it; the audit log has the rows, and each `PUT /security-settings` writes the ConfigMap (`allowRootOverrides` `"true"` or `"false"`). **Bucket (decided when writing tasks).** `bucket_operator` carries about four admin logins (`buckets.sh:355-362`: "operator: 4 admin logins with the EventStream test") against a per-job ceiling near seven, and `api-auth`, `api-roles`, `api-rbac`, `api-agent` and `api-mods` are documented as at their ceilings. The second test costs one admin login plus one login as its own non-admin user, which brings `operator` to about six, so both tests go in `bucket_operator`, with a comment recording the tally. No new bucket, CI matrix entry or `suite-components.json` entry is needed: `^TestGameServer_` and `^TestAPI_` already map both tests to their components (`test/e2e/suite-components.json:32, 46`). No game-module join is involved (constitution I's join rule is about game modules; this feature changes no module's game behavior). @@ -273,4 +272,4 @@ A root refusal and a permission refusal also write a row (`status` 403, `reason` | MCP exposure | R15 | | E2E | R16 | -Product rulings (not unknowns about the code): OD-1 to OD-6, all settled in [OPEN-DECISIONS.md](OPEN-DECISIONS.md). +Product rulings (not unknowns about the code): OD-1 to OD-10, all settled in [OPEN-DECISIONS.md](OPEN-DECISIONS.md). diff --git a/specs/030-security-context-overrides/spec.md b/specs/030-security-context-overrides/spec.md index 528ebe3d4..e319253e2 100644 --- a/specs/030-security-context-overrides/spec.md +++ b/specs/030-security-context-overrides/spec.md @@ -37,6 +37,12 @@ to every file on each start, or only when the volume's top folder has the wrong - Q: Does the root rule also block a filesystem group override of 0? → A: Yes. Filesystem group 0 counts as root, like run-as user and run-as group 0. - Q: Should "use image default" for the run-as user also need the root setting? → A: Yes. A "use image default" override of run-as user or run-as group always needs the cluster "allow root overrides" setting, because most images default to root. +### Session 2026-11-15 + +- Q: Where does the root setting live, and does it cover every cluster? A: It is separate for each cluster and off by default (OD-7 C). It is set under Clusters, cluster, Configuration, and stored in that cluster's operator control-plane ConfigMap `gameplane-security-settings`. +- Q: Who creates that ConfigMap? A: The Helm chart, with `"false"`. It keeps its value on upgrade and is kept on uninstall. The API only reads and updates it by name, and a deleted ConfigMap reads as off until the next `helm upgrade` (OD-8 A). +- Q: Are the scout's spec corrections accepted? A: Yes, all seven (OD-9 A): an empty settings body returns 400; new tests go in new files; clone is audited; a root hold takes no wake slot; a rollout on a suspended or sleeping server applies its security values at the next start; `spec.security` is excluded from the template baseline; stale citations defer to the briefs. + ## User Scenarios & Testing *(mandatory)* ### User Story 1 - Server uses the module's security defaults (Priority: P1) @@ -144,7 +150,7 @@ carrying overrides is refused; as a user with it, confirm both work. is processed, **Then** it is refused with a permission error and nothing changes. 3. **Given** a request that sets run-as user, run-as group or filesystem group to 0, **When** it is processed, **Then** it is - refused unless an admin has turned on the cluster-wide "allow root overrides" + refused unless an admin has turned on that cluster's "allow root overrides" setting (OD-2). 4. **Given** a module that sets run-as user 1000 and the root setting is off, **When** a request sets run-as user to "use image default", **Then** it is refused like a @@ -198,12 +204,13 @@ carrying overrides is refused; as a user with it, confirm both work. - **FR-005**: Override values MUST be validated as whole numbers from 0 to 4294967295, matching the module's own limits, with the root rule from OD-2: an override of 0 for run-as user, run-as group or filesystem group MUST be refused unless an admin has - turned on a cluster-wide "allow root overrides" setting, which is off by default. + turned on a per-cluster "allow root overrides" setting, which is off by default. A "use image default" override of run-as user or run-as group counts as a root override too and is refused the same way, because most game images run as root by - default. The setting lives in global settings (`config:manage`) and turning it on or - off is audited. -- **FR-005a**: When the cluster "allow root overrides" setting is off, a server that + default. The setting is per cluster, off by default, set under Clusters, cluster, + Configuration (`config:manage`), stored in that cluster's ConfigMap, and turning it on + or off is audited (OD-7). +- **FR-005a**: When the server's cluster "allow root overrides" setting is off, a server that holds a saved root override (any value FR-005 counts as root) MUST NOT be started by the reconciler; its status MUST say why. A server already running keeps running, and turning the setting off MUST NOT restart or stop any server. The server starts again @@ -296,9 +303,9 @@ carrying overrides is refused; as a user with it, confirm both work. ## Decisions All open decisions are settled in [`OPEN-DECISIONS.md`](OPEN-DECISIONS.md) -(valgul, 2026-11-07 and 2026-11-13): OD-1 new `servers:security` permission (admin -only by default), OD-2 root overrides only when a cluster-wide setting allows them (off +(valgul, 2026-11-07, 2026-11-13 and 2026-11-15): OD-1 new `servers:security` permission (admin +only by default), OD-2 root overrides only when a per-cluster setting allows them (off by default), OD-3 changes apply on the next restart, OD-4 a saved root override is not started while the setting is off, OD-5 an override that breaks restricted workload mode fails the server with the reason, OD-6 the risky confirmation is in the dashboard and -the audit entry records it. +the audit entry records it. OD-7 (2026-11-15): the root setting is separate per cluster, set under Clusters, cluster, Configuration, and stored in that cluster's ConfigMap. OD-8 (2026-11-15): Helm creates that ConfigMap with "false" and keeps its value on upgrade; the API only reads and updates it by name. OD-9 (2026-11-15): the seven spec corrections are accepted (see briefs/00-rulings.md section 6). diff --git a/specs/030-security-context-overrides/tasks.md b/specs/030-security-context-overrides/tasks.md index 4dcee5f06..9f6b8db4d 100644 --- a/specs/030-security-context-overrides/tasks.md +++ b/specs/030-security-context-overrides/tasks.md @@ -2,11 +2,11 @@ **Input**: Design documents from `specs/030-security-context-overrides/` -**Prerequisites**: [plan.md](./plan.md), [spec.md](./spec.md), [research.md](./research.md), [data-model.md](./data-model.md), [contracts/](./contracts/), [quickstart.md](./quickstart.md), [OPEN-DECISIONS.md](./OPEN-DECISIONS.md) (OD-1 to OD-6 all settled) +**Prerequisites**: [plan.md](./plan.md), [spec.md](./spec.md), [research.md](./research.md), [data-model.md](./data-model.md), [contracts/](./contracts/), [quickstart.md](./quickstart.md), [OPEN-DECISIONS.md](./OPEN-DECISIONS.md) (OD-1 to OD-10 all settled; `briefs/00-rulings.md` is read first) **Tests**: requested. Constitution I requires a Kind E2E on the real path; each component also gets unit and envtest tests under its coverage gate (operator 72, api 80, gp-module 80, mcp-server 70, web 92/76/82/92). Tests are written first and fail in CI until the implementation in the same PR lands. -**Organization**: one phase per user story in spec priority order (US1 P1, US2 P1, US3 P2, US4 P2). Stories share files (`gameserver_security.go`, `SecurityAdvanced.tsx`, the two E2E files), so the phases build on each other in order; see "Dependencies & Execution Order". Backend, operator, API, module and docs work never waits for the dashboard design. +**Organization**: one phase per user story in spec priority order (US1 P1, US2 P1, US3 P2, US4 P2). Stories share files (`security_overrides.go`, `SecurityAdvanced.tsx`, the two E2E files), so the phases build on each other in order; see "Dependencies & Execution Order". Backend, operator, API, module and docs work never waits for the dashboard design. **Binding rules for every task** (repeat them in every Workflow script and agent brief, CLAUDE.md rules 4, 6-8, 11-14, 18): @@ -18,6 +18,8 @@ - Signed commits (`git commit -s`), conventional prefix, `Co-Authored-By` trailer; never amend after push; one branch per unit of work. PR labels via REST (`type: feature`, `area: operator|api|web|modules|chart|e2e|specs|shared` as touched, never `gh pr edit`). - Implementation runs through Workflow scripts with `model:` set on every agent, starting at haiku, review one tier up on the diff, scout once and brief many (T001). - Unsettled values never go into a contract; anything new goes to `OPEN-DECISIONS.md` and pauses the task. +- Read `briefs/00-rulings.md` before any other brief. It is binding and supersedes the earlier briefs where they differ. Spec `file:line` citations are stale; use the citations in the briefs (OD-9 item 7). +- No existing test file is edited (OD-9 item 2). A task that names an existing `_test.go`, `*.test.tsx` or `test-validate-py.sh` creates the NEW file named in `briefs/00-rulings.md` section 8 instead. Existing call sites keep compiling through optional or variadic parameters or new functions (briefs/00 section 11). ## Format: `[ID] [P?] [Story] Description` @@ -35,9 +37,9 @@ Repository root of `GameplanePanel/Gameplane` unless a task says `module repo` ( **Purpose**: prerequisites shared by every phase, including the design gate that blocks all dashboard work. -- [ ] T001 Scout once (CLAUDE.md rule 18): read the code named in plan.md "Source Code" and write the factual brief `specs/030-security-context-overrides/briefs/security-overrides.md` with exact `file:line`, before/after snippets and the justification for every edit below (builders `gameContainerSecurityContext`, `gamePodSecurityContext`, `buildConfigInitContainer`, the `reconcileStatefulSet` gate near `gameserver_controller.go:1889-1905`, `validateRestrictedTemplate` callers, backup and restore call sites, `validateAndProtectGameServer`, `newValidators`, the operator `Watches` list near `gameserver_controller.go:583`, the API Role in `charts/gameplane/templates/api.yaml`); also confirm which operator flag names the control-plane namespace the ConfigMap lives in (used by T057 and T060). Fix agents edit from this brief only +- [X] T001 Scout once (CLAUDE.md rule 18): read the code named in plan.md "Source Code" and write the factual brief `specs/030-security-context-overrides/briefs/security-overrides.md` with exact `file:line`, before/after snippets and the justification for every edit below (builders `gameContainerSecurityContext`, `gamePodSecurityContext`, `buildConfigInitContainer`, the `reconcileStatefulSet` gate near `gameserver_controller.go:1889-1905`, `validateRestrictedTemplate` callers, backup and restore call sites, `validateAndProtectGameServer`, `newValidators`, the operator `Watches` list near `gameserver_controller.go:583`, the API Role in `charts/gameplane/templates/api.yaml`); also confirm which operator flag names the control-plane namespace the ConfigMap lives in (used by T057 and T060). Fix agents edit from this brief only - [ ] T002 [P] Prepare the module repo: confirm `git submodule update --init modules` works, create a branch `spec-030/module-security` in `/home/user/module` (separate PR to `GameplanePanel/module`, default branch per that repo), and record in the brief that no module-repo file is edited on this repo's branch -- [ ] T003 [P] **MAINTAINER-OWNED (valgul, local machine, Pencil MCP). BLOCKS EVERY WEB TASK (T023, T024, T025, T029, T034, T035, T041, T045, T046, T052, T062, T063; each is tagged "Needs T003").** In `design.pen` design the dashboard frames, then export touched nodes to `assets/design-export/json/.json` and `assets/design-export/screenshots/.png` (skills `design-export`, `pen-componentize`, `pen-canvas-layout`): (a) the collapsed "Advanced" security section in the create-server wizard; (b) the same section on the server Settings tab; (c) states: module default, "image default", override field, "use image default" choice, applied value with source, pending value with the "applies on the next restart" notice, "no effect" marker for the ownership check without a filesystem group, read-only state without `servers:security`; (d) the file-access warning before saving a changed run-as user or group on a server with data; (e) the risky-value confirmation dialog showing the module's reason; (f) the inline refusal messages (forbidden, root disabled, invalid); (g) the notice for a server held back with reason `RootOverrideDisallowed` (stopped and running variants); (h) the Admin Settings "Security" section with the allow-root switch and its explanatory text. The maintainer saves in the Pencil UI and commits the exports; an agent may prepare the copy-paste prompt with the `local-prompt` skill but never touches the `.pen` file. Done when `assets/design-export/{json,screenshots}/` for those frames is in the branch and `assets/design-export/MANIFEST.md` lists them +- [X] T003 [P] **MAINTAINER-OWNED (valgul, local machine, Pencil MCP). BLOCKS EVERY WEB TASK (T023, T024, T025, T029, T034, T035, T041, T045, T046, T052, T062, T063, T079; each is tagged "Needs T003").** In `design.pen` design the dashboard frames, then export touched nodes to `assets/design-export/json/.json` and `assets/design-export/screenshots/.png` (skills `design-export`, `pen-componentize`, `pen-canvas-layout`): (a) the collapsed "Advanced" security section in the create-server wizard; (b) the same section on the server Settings tab; (c) states: module default, "image default", override field, "use image default" choice, applied value with source, pending value with the "applies on the next restart" notice, "no effect" marker for the ownership check without a filesystem group, read-only state without `servers:security`; (d) the file-access warning before saving a changed run-as user or group on a server with data; (e) the risky-value confirmation dialog showing the module's reason; (f) the inline refusal messages (forbidden, root disabled, invalid); (g) the notice for a server held back with reason `RootOverrideDisallowed` (stopped and running variants); (h) the "Security" panel under Clusters, cluster, Configuration with the allow-root switch and its explanatory text (not Admin Settings); (i) the register-cluster form with the optional control-plane namespace field (default `gameplane`, OD-10 A), and the cluster page showing the stored value (T079). The maintainer saves in the Pencil UI and commits the exports; an agent may prepare the copy-paste prompt with the `local-prompt` skill but never touches the `.pen` file. Done when `assets/design-export/{json,screenshots}/` for those frames is in the branch and `assets/design-export/MANIFEST.md` lists them - [ ] T004 [P] Confirm that the labels this feature's PRs need (`type: feature` and the `area:` labels) already exist with `gh api repos/GameplanePanel/Gameplane/labels`; no new label is expected **Checkpoint**: brief written; design started (it runs in parallel with everything below until a web task needs it). @@ -50,16 +52,17 @@ Repository root of `GameplanePanel/Gameplane` unless a task says `module repo` ( **CRITICAL**: no user story work begins until this phase is complete. -- [ ] T005 [P] Extend `GameSecuritySpec` in `operator/api/v1alpha1/gametemplate_types.go:185` with `volumeOwnershipCheck` (enum `EveryStart|OnlyWhenWrong`) and `risky` (new `SecurityRiskSpec`, each member a `SecurityRiskNote{reason string, MaxLength=200}`) per [contracts/crd-gametemplate-security.md](./contracts/crd-gametemplate-security.md) -- [ ] T006 [P] Add to `operator/api/v1alpha1/gameserver_types.go`: `GameServerSpec.Security *GameServerSecuritySpec` after `Capture` (`:161`) with `SecurityIDOverride{value *int64 0..4294967295, useImageDefault bool}` and the two CEL rules (exactly one of the two; `useImageDefault` must be `true`, messages as in [contracts/crd-gameserver-security.md](./contracts/crd-gameserver-security.md)); `GameServerStatus.Security *GameServerSecurityStatus` (`:558`) with `desired`, `applied`, `pending`, `SecuritySettings`, `SecurityIDStatus`, `SecurityCheckStatus` and the `source` enum (`ModuleDefault|Override|ImageDefaultOverride|ImageDefault|BuiltInDefault`); and the condition type/reason constants `SecurityAllowed` / `RootOverrideDisallowed` (data-model.md "Start refusal") -- [ ] T007 Run `make generate && make manifests` and commit `operator/api/v1alpha1/zz_generated.deepcopy.go`, `operator/config/crd/gameplane.local_gameservers.yaml`, `operator/config/crd/gameplane.local_gametemplates.yaml`, both `charts/gameplane/charts/gameplane-crds/crds/*.yaml` copies and both `charts/gameplane/crd-manifests/*.yaml` copies in the same change as T005 and T006 (CLAUDE.md rule 7); depends on T005, T006 -- [ ] T008 [P] Add CEL and bounds cases to `operator/internal/controller/crd_validation_envtest_test.go`: `{value:1000}` and `{useImageDefault:true}` accepted; both, neither, `useImageDefault:false`, `value:-1`, `value:4294967296`, a bad `volumeOwnershipCheck`, and a `risky.reason` over 200 characters rejected; an existing GameServer without `security` still applies -- [ ] T009 [P] Add the catalog entry `{Key: "servers:security", Label: "Set or change a server's security overrides (run-as user and group, filesystem group, volume ownership check)", Namespaced: true}` after `servers:console` in `api/internal/rbac/catalog.go:25-29` ([contracts/rbac-permission.md](./contracts/rbac-permission.md)); do not add it to `privilegedPermissions` -- [ ] T010 [P] Add to `api/internal/rbac/catalog_test.go` and `api/internal/rbac/rbac_test.go` a test that `servers:security` exists, is namespaced, is held by the built-in `admin` role (through `*`) and by no other built-in role, and that `TestCatalog_CoversSeededPermissions` and `TestCatalog_CoversRuleTablePermissions` still pass -- [ ] T011 [P] Add the three messages `server.security.forbidden`, `server.security.root_disabled` (arg `setting`) and `server.security.invalid` (args `setting`, `detail`) to `api/internal/messages/entries_server.go` with English text from [contracts/api-server-security.md](./contracts/api-server-security.md), and the matching keys to `i18n/locales/en/app.json` and `i18n/locales/fr/app.json` (FR-014); the existing `messages_test.go` and `usage_test.go` require every ID to be used, so T012 uses them -- [ ] T012 Create `api/internal/handlers/resources_security.go` with the field-level security step called from `validateAndProtectGameServer` (`api/internal/handlers/resources.go:538`, after the capture step) for create (`:218`), update (`:290`) and clone (`lifecycle.go:243`): case 1 unchanged accepts without the permission, case 2 absent-in-request restores the live value, case 3 any other difference without `servers:security` returns 403 `server.security.forbidden`; errors carry their own status so `writeServerValidationError` (`resources_snapshot.go:24`) passes them through (research R10); depends on T006, T009, T011 -- [ ] T013 [P] Unit tests in `api/internal/handlers/resources_security_test.go` for T012 cases 1 to 3 (unchanged both absent, unchanged equal, restored field, forbidden on create, update and clone with `live == nil`) -- [ ] T014 [P] Envtest `api/internal/handlers/resources_security_envtest_test.go` for create, update and clone permission behavior: `servers:write` without `servers:security` gets 403 on a changed block, 200 on an unrelated edit that sends the same block back, 200 and kept override when the request omits the block, 403 on cloning a server that has one; an `admin` caller succeeds +- [X] T005 [P] Extend `GameSecuritySpec` in `operator/api/v1alpha1/gametemplate_types.go:185` with `volumeOwnershipCheck` (enum `EveryStart|OnlyWhenWrong`) and `risky` (new `SecurityRiskSpec`, each member a `SecurityRiskNote{reason string, MaxLength=200}`) per [contracts/crd-gametemplate-security.md](./contracts/crd-gametemplate-security.md) +- [X] T006 [P] Add to `operator/api/v1alpha1/gameserver_types.go`: `GameServerSpec.Security *GameServerSecuritySpec` after `Capture` (`:161`) with `SecurityIDOverride{value *int64 0..4294967295, useImageDefault bool}` and the two CEL rules (exactly one of the two; `useImageDefault` must be `true`, messages as in [contracts/crd-gameserver-security.md](./contracts/crd-gameserver-security.md)); `GameServerStatus.Security *GameServerSecurityStatus` (`:558`) with `desired`, `applied`, `pending`, `SecuritySettings`, `SecurityIDStatus`, `SecurityCheckStatus` and the `source` enum (`ModuleDefault|Override|ImageDefaultOverride|ImageDefault|BuiltInDefault`); and the condition type/reason constants `SecurityAllowed` / `RootOverrideDisallowed` (data-model.md "Start refusal") +- [X] T007 Run `make generate && make manifests` and commit `operator/api/v1alpha1/zz_generated.deepcopy.go`, `operator/config/crd/gameplane.local_gameservers.yaml`, `operator/config/crd/gameplane.local_gametemplates.yaml`, both `charts/gameplane/charts/gameplane-crds/crds/*.yaml` copies and both `charts/gameplane/crd-manifests/*.yaml` copies in the same change as T005, T006 and T078 (CLAUDE.md rule 7; the Cluster CRD and its chart copies, which T078 changes); depends on T005, T006, T078 +- [X] T008 [P] Add CEL and bounds cases to the NEW `operator/internal/controller/security_crd_validation_envtest_test.go` (the existing `crd_validation_envtest_test.go` is not edited): `{value:1000}` and `{useImageDefault:true}` accepted; both, neither, `useImageDefault:false`, `value:-1`, `value:4294967296`, a bad `volumeOwnershipCheck`, and a `risky.reason` over 200 characters rejected; an existing GameServer without `security` still applies +- [X] T009 [P] Add the catalog entry `{Key: "servers:security", Label: "Set or change a server's security overrides (run-as user and group, filesystem group, volume ownership check)", Namespaced: true}` after `servers:console` in `api/internal/rbac/catalog.go:25-29` ([contracts/rbac-permission.md](./contracts/rbac-permission.md)); do not add it to `privilegedPermissions` +- [X] T010 [P] Add the NEW file `api/internal/rbac/catalog_security_test.go` (the existing `catalog_test.go` and `rbac_test.go` are not edited) with a test that `servers:security` exists, is namespaced, and is held by the built-in `admin` role (through `*`) and by no other built-in role; the test may copy the `userForRole` helper from `rbac_test.go`. `TestCatalog_CoversSeededPermissions` and `TestCatalog_CoversRuleTablePermissions` must still pass unchanged +- [X] T011 [P] Add the three messages (plus `server.cluster.security_settings_missing`, 409, from briefs/00 section 2) `server.security.forbidden`, `server.security.root_disabled` (arg `setting`) and `server.security.invalid` (args `setting`, `detail`) to `api/internal/messages/entries_server.go` with English text from [contracts/api-server-security.md](./contracts/api-server-security.md), and the matching keys to `i18n/locales/en/app.json` and `i18n/locales/fr/app.json` (FR-014); the existing `messages_test.go` and `usage_test.go` check registration and descriptions but not use (brief 03 D2), so T012 and T057 use every ID anyway +- [X] T012 Create `api/internal/handlers/security_overrides.go` with the field-level security step called from `validateAndProtectGameServer` (`api/internal/handlers/resources.go:538`, after the capture step) for create (`:218`), update (`:290`) and clone (`lifecycle.go:243`): case 1 unchanged accepts without the permission, case 2 absent-in-request restores the live value, case 3 any other difference without `servers:security` returns 403 `server.security.forbidden`; errors carry their own status so `writeServerValidationError` (`resources_snapshot.go:24`) passes them through (research R10); depends on T006, T009, T011 +- [X] T013 [P] Unit tests in the NEW file `api/internal/handlers/security_overrides_test.go` (the existing `security_overrides_test.go` is not edited) for T012 cases 1 to 3 (unchanged both absent, unchanged equal, restored field, forbidden on create, update and clone with `live == nil`) +- [X] T014 [P] Envtest `api/internal/handlers/security_overrides_envtest_test.go` for create, update and clone permission behavior: `servers:write` without `servers:security` gets 403 on a changed block, 200 on an unrelated edit that sends the same block back, 200 and kept override when the request omits the block, 403 on cloning a server that has one; an `admin` caller succeeds +- [X] T078 [P] Add the optional `ControlPlaneNamespace string` field to `ClusterSpec` in `operator/api/v1alpha1/cluster_types.go` (JSON `controlPlaneNamespace`), with `+kubebuilder:default=gameplane`, `MaxLength=63` and a DNS label pattern (`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`), per OD-10 A and briefs/00 section 12. Generated with T007 (`make generate && make manifests`; the Cluster CRD copies are committed in the same change). The API cluster registration handler (`api/internal/handlers/clusters.go`) accepts and returns it; an absent value means `gameplane`. Feeds T057 and T076. **Checkpoint**: CRDs and generated artifacts committed, permission enforced; stories can start. @@ -73,20 +76,21 @@ Repository root of `GameplanePanel/Gameplane` unless a task says `module repo` ( ### Tests for User Story 1 -- [ ] T015 [P] [US1] Table test `operator/internal/controller/gameserver_security_test.go` for `resolveGameSecurity(tmpl, gs)` (research R4): every id source (module default, image default when neither sets it, `BuiltInDefault` for the ownership check), the `fsGroupChangePolicy` mapping (`EveryStart`=`Always`, `OnlyWhenWrong`=`OnRootMismatch`, written only when a filesystem group applies), the annotation `gameplane.local/security-applied` encode/decode round trip, the pre-feature reader (no annotation: non-empty values `ModuleDefault`, empty ids `ImageDefault`, ownership check `EveryStart` with `BuiltInDefault`), and `pending` computation (source-only change is not pending) -- [ ] T016 [P] [US1] Extend `operator/internal/controller/build_game_container_test.go` and `operator/internal/controller/workload_security_test.go`: with nothing applied the container and pod `securityContext` are byte-identical to today (no empty `securityContext: {}`); helper containers (agent, config-init user, sentinel, tunnel, wipe) keep their fixed users (FR-012) -- [ ] T017 [P] [US1] Envtest `operator/internal/controller/gameserver_security_envtest_test.go`: a server with no override gets the module's values and `status.security.desired` equals `applied` with `ModuleDefault`; a template with no security block shows `ImageDefault`; a StatefulSet created before this feature (no annotation, no change policy) is NOT recreated when the operator reconciles it (pod template untouched, `pending=true`, `applied.volumeOwnershipCheck=EveryStart`, `desired=OnlyWhenWrong`); after a scale to zero and back the pod template carries `fsGroupChangePolicy: OnRootMismatch` and `pending=false` +- [X] T015 [P] [US1] Table test `operator/internal/controller/security_overrides_test.go` for `resolveGameSecurity(tmpl, gs)` (research R4): every id source (module default, image default when neither sets it, `BuiltInDefault` for the ownership check), the `fsGroupChangePolicy` mapping (`EveryStart`=`Always`, `OnlyWhenWrong`=`OnRootMismatch`, written only when a filesystem group applies), the annotation `gameplane.local/security-applied` encode/decode round trip, the pre-feature reader (no annotation: non-empty values `ModuleDefault`, empty ids `ImageDefault`, ownership check `EveryStart` with `BuiltInDefault`), and `pending` computation (source-only change is not pending) +- [X] T016 [P] [US1] Create the NEW file `operator/internal/controller/security_builders_test.go` (the existing `build_game_container_test.go` and `workload_security_test.go` are not edited): with nothing applied the container and pod `securityContext` are byte-identical to today (no empty `securityContext: {}`); helper containers (agent, config-init user, sentinel, tunnel, wipe) keep their fixed users (FR-012) +- [X] T017 [P] [US1] Envtest `operator/internal/controller/security_overrides_envtest_test.go`: a server with no override gets the module's values and `status.security.desired` equals `applied` with `ModuleDefault`; a template with no security block shows `ImageDefault`; a StatefulSet created before this feature (no annotation, no change policy) is NOT recreated when the operator reconciles it (pod template untouched, `pending=true`, `applied.volumeOwnershipCheck=EveryStart`, `desired=OnlyWhenWrong`); after a scale to zero and back the pod template carries `fsGroupChangePolicy: OnRootMismatch` and `pending=false` ### Implementation for User Story 1 -- [ ] T018 [US1] Create `operator/internal/controller/gameserver_security.go` (NEW): the pure resolver `resolveGameSecurity` returning value plus source per setting, the pod encoding helpers, the `gameplane.local/security-applied` annotation codec, the applied-values reader (the StatefulSet annotation `gameplane.local/security-applied-observed`, copied from the pod template once an owned pod found via `ownedTemplatePod`, `gameserver_template_revision.go:480`, has `PodReadyToStartContainers=True` or a started container; pre-feature fallback to the running pod, else the StatefulSet template; research R6) and the `fsGroupChangePolicy` mapping; depends on T006, T007 -- [ ] T019 [US1] Change `gameContainerSecurityContext` (`gameserver_controller.go:2470`), `gamePodSecurityContext` (`:2586`) and `buildConfigInitContainer` (`:2310`, its `RunAsGroup` and `chgrp` target) to take the resolved values instead of reading `tmpl.Spec.Security`; keep the `nil`-when-empty behavior; depends on T018 -- [ ] T020 [US1] In `reconcileStatefulSet` (`gameserver_controller.go:1611` mutate function, gate near `:1889-1905`) write the security-derived pod-template parts (pod `securityContext`, game container `securityContext`, config-init container, the `security-applied` annotation) only when `ss.ResourceVersion == ""` or the StatefulSet goes from zero replicas to one or more; otherwise copy them forward from the existing StatefulSet (research R5, R8). This is what keeps the ownership-check default flip from restarting servers on operator upgrade (SC-001); depends on T018, T019 -- [ ] T021 [US1] In `operator/internal/controller/gameserver_status.go` publish `status.security` (`desired`, `applied`, `pending`) with a `MergeFrom` patch of that field only (the agent's `status.agent` heartbeat stays untouched, `:42-60` pattern); `applied` omitted before the first start; depends on T018 -- [ ] T022 [P] [US1] Add `mcp-server/main_test.go` fixture asserting a GameServer carrying `spec.security` and `status.security` round-trips unredacted through the read-only tools (research R15); `mcp-server/README.md` gets one example and `mcp-server/specs.md` one sentence (no code change in `mcp-server/tools.go`) -- [ ] T023 [P] [US1] **Needs T003.** Mirror the types in `web/src/types.ts`: `GameServer.spec.security` and `status.security` (`:557`), `GameTemplate.spec.security` with `risky` and `volumeOwnershipCheck` (`:303`) -- [ ] T024 [US1] **Needs T003.** Create `web/src/components/SecurityAdvanced.tsx` (NEW shared section, collapsed by default, read-only first cut) showing per setting the module default or "image default", the applied value and its source, and the "no effect" marker for the ownership check when no filesystem group applies, exactly as the exported frames in `assets/design-export/`; depends on T023 -- [ ] T025 [US1] **Needs T003.** Add `web/src/components/SecurityAdvanced.test.tsx` (vitest: sources render, no value renders "image default", the ownership check marks "no effect") and the English strings under `web.routes.server_settings.security_*` in `i18n/locales/en/app.json` with the `fr` pack entries (FR-014); depends on T024 +- [X] T018 [US1] Create `operator/internal/controller/security_overrides.go` (NEW): the pure resolver `resolveGameSecurity` returning value plus source per setting, the pod encoding helpers, the `gameplane.local/security-applied` annotation codec, the applied-values reader (the StatefulSet annotation `gameplane.local/security-applied-observed`, copied from the pod template once an owned pod found via `ownedTemplatePod`, `gameserver_template_revision.go:480`, has `PodReadyToStartContainers=True` or a started container; pre-feature fallback to the running pod, else the StatefulSet template; research R6) and the `fsGroupChangePolicy` mapping; depends on T006, T007 +- [X] T019 [US1] Keep `gameContainerSecurityContext` (`gameserver_controller.go:2496`), `gamePodSecurityContext` (`:2612`) and `buildConfigInitContainer` (`:2336`, its `RunAsGroup` and `chgrp` target) callable with their current signatures, because existing tests call them (briefs/00 section 11). Add `...Resolved` variants that take the resolved values and are used by production code; the old names become wrappers that resolve from the template. Keep the `nil`-when-empty behavior; depends on T018 +- [X] T020 [US1] In `reconcileStatefulSet` (mutate function inside `CreateOrUpdate` at `gameserver_controller.go:1637`, gate near `:1916-1925`; briefs/01 section 3 and briefs/00 section 11; `reconcileStatefulSet` keeps its signature) write the security-derived pod-template parts (pod `securityContext`, game container `securityContext`, config-init container, the `security-applied` annotation) only when `ss.ResourceVersion == ""` or the StatefulSet goes from zero replicas to one or more; otherwise copy them forward from the existing StatefulSet (research R5, R8). This is what keeps the ownership-check default flip from restarting servers on operator upgrade (SC-001); depends on T018, T019 +- [X] T021 [US1] In `operator/internal/controller/gameserver_status.go` publish `status.security` (`desired`, `applied`, `pending`) with a `MergeFrom` patch of that field only (the agent's `status.agent` heartbeat stays untouched, `:42-60` pattern); `applied` omitted before the first start; depends on T018 +- [X] T022 [P] [US1] Add `mcp-server/main_test.go` fixture asserting a GameServer carrying `spec.security` and `status.security` round-trips unredacted through the read-only tools (research R15); `mcp-server/README.md` gets one example and `mcp-server/specs.md` one sentence (no code change in `mcp-server/tools.go`) +- [X] T023 [P] [US1] **Needs T003.** Mirror the types in `web/src/types.ts`: `GameServer.spec.security` and `status.security` (`:557`), `GameTemplate.spec.security` with `risky` and `volumeOwnershipCheck` (`:303`) +- [X] T024 [US1] **Needs T003.** Create `web/src/components/SecurityAdvanced.tsx` (NEW shared section, collapsed by default, read-only first cut) showing per setting the module default or "image default", the applied value and its source, and the "no effect" marker for the ownership check when no filesystem group applies, exactly as the exported frames in `assets/design-export/`; depends on T023 +- [X] T025 [US1] **Needs T003.** Add `web/src/components/SecurityAdvanced.test.tsx` (vitest: sources render, no value renders "image default", the ownership check marks "no effect") and the English strings under `web.routes.server_settings.security_*` in `i18n/locales/en/app.json` with the `fr` pack entries (FR-014); depends on T024 +- [X] T075 [US1] Exclude `spec.security` from the template baseline: `baselineRenderInputs` (`operator/internal/controller/gameserver_template_revision.go:338-340`, the range OD-9 cites; verify before editing) leaves out `spec.security`, so saving an override never rewrites a running pod (FR-008, OD-9 item 6). Test cases go in `security_overrides_envtest_test.go` (T039). Depends on T006. **Checkpoint**: no-override behavior and sources verified; MVP. Compile checks: `go build ./...` in `operator` and `mcp-server`, `npx tsc --noEmit` in `web`. @@ -100,22 +104,22 @@ Repository root of `GameplanePanel/Gameplane` unless a task says `module repo` ( ### Tests for User Story 2 -- [ ] T026 [P] [US2] Extend `operator/internal/controller/gameserver_security_test.go`: override `value`, override `useImageDefault` (value none, source `ImageDefaultOverride`), override over module default, module default over nothing; restricted-mode validation on the effective values (OD-5): a root value or "use image default" for run-as user is refused by `validateRestrictedTemplate`'s rule while a positive override of a root module default passes -- [ ] T027 [P] [US2] Extend `operator/internal/controller/gameserver_security_envtest_test.go`: a server created with `runAsUser {value: 2000}` gets 2000 with `Override` and the other settings `ModuleDefault`; `runAsGroup {useImageDefault: true}` leaves the container `runAsGroup` unset; with `RestrictedWorkloads` on, an override the rule refuses sets the existing failure phase message (`gameserver_controller.go:334` behavior) and a pod that is already running is untouched (OD-5) -- [ ] T028 [P] [US2] Extend `api/internal/handlers/resources_security_test.go` and `resources_security_envtest_test.go`: shape cases (`value` 4294967296, `-1`, both `value` and `useImageDefault`, neither, `useImageDefault:false`, unknown member, bad enum) return 422 `server.security.invalid` with the offending setting in `args` and create nothing; a valid override is stored and returned -- [ ] T029 [P] [US2] **Needs T003.** vitest for the wizard section in `web/src/components/SecurityAdvanced.test.tsx` and `web/src/routes/CreateServer.test.tsx`: no security values are sent when Advanced is never opened (US2 scenario 1), each setting shows module default and an empty override (scenario 2), one override changes only that setting (3), "use image default" is sent as `{useImageDefault: true}` (4), an invalid value is rejected before submit (5), a risky setting asks for the confirmation with the module's reason and cancelling sends nothing (OD-6: dashboard-only) -- [ ] T030 [P] [US2] Kind E2E `test/e2e/gameserver_security_e2e_test.go` (NEW, `//go:build e2e`, `TestGameServer_SecurityOverrideAppliesOnRestart`, `t.Parallel()`, unique names, busybox fixture from `test_helpers_e2e_test.go:42-90`, zero logins): part 1 creates a server with a run-as user override and asserts the running uid via `Env.KubectlExec(... id -u)` (`env.go:259`) with the other ids at the module default +- [X] T026 [P] [US2] Add cases to `operator/internal/controller/security_overrides_test.go` (created by T015): override `value`, override `useImageDefault` (value none, source `ImageDefaultOverride`), override over module default, module default over nothing; restricted-mode validation on the effective values (OD-5): a root value or "use image default" for run-as user is refused by `validateRestrictedTemplate`'s rule while a positive override of a root module default passes +- [X] T027 [P] [US2] Extend `operator/internal/controller/security_overrides_envtest_test.go`: a server created with `runAsUser {value: 2000}` gets 2000 with `Override` and the other settings `ModuleDefault`; `runAsGroup {useImageDefault: true}` leaves the container `runAsGroup` unset; with `RestrictedWorkloads` on, an override the rule refuses sets the existing failure phase message (`gameserver_controller.go:334` behavior) and a pod that is already running is untouched (OD-5) +- [X] T028 [P] [US2] Add cases to `api/internal/handlers/security_overrides_test.go` and `security_overrides_envtest_test.go` (created by T013 and T014): shape cases (`value` 4294967296, `-1`, both `value` and `useImageDefault`, neither, `useImageDefault:false`, unknown member, bad enum) return 422 `server.security.invalid` with the offending setting in `args` and create nothing; a valid override is stored and returned +- [X] T029 [P] [US2] **Needs T003.** vitest for the wizard section in `web/src/components/SecurityAdvanced.test.tsx` and the NEW `web/src/routes/CreateServerSecurity.test.tsx` (the existing CreateServer test is not edited): no security values are sent when Advanced is never opened (US2 scenario 1), each setting shows module default and an empty override (scenario 2), one override changes only that setting (3), "use image default" is sent as `{useImageDefault: true}` (4), an invalid value is rejected before submit (5), a risky setting asks for the confirmation with the module's reason and cancelling sends nothing (OD-6: dashboard-only) +- [X] T030 [P] [US2] Kind E2E `test/e2e/gameserver_security_e2e_test.go` (NEW, `//go:build e2e`, `TestGameServer_SecurityOverrideAppliesOnRestart`, `t.Parallel()`, unique names, busybox fixture from `test_helpers_e2e_test.go:42-90`, zero logins): part 1 creates a server with a run-as user override and asserts the running uid via `Env.KubectlExec(... id -u)` (`env.go:259`) with the other ids at the module default ### Implementation for User Story 2 -- [ ] T031 [US2] Extend `resolveGameSecurity` in `operator/internal/controller/gameserver_security.go` with the override layer (research R4): `useImageDefault` gives none and `ImageDefaultOverride`, `value` gives that number and `Override`, else module default, else none; ownership check override over template over `OnlyWhenWrong` -- [ ] T032 [US2] Make `validateRestrictedTemplate` and `restrictedContainerSecurity` (`workload_security.go:15, 23`), `applyWorkloadSecurity` (`:39`) and the call sites at `gameserver_controller.go:334`, `gameserver_template_revision.go:216, 278` validate and apply the effective (desired) values; a violation reports the server failed with the existing message until fixed; a running pod is untouched (OD-5 settled A) -- [ ] T033 [US2] Add the shape validation (case 4: ids whole numbers 0 to 4294967295, exactly one of `value`/`useImageDefault`, `useImageDefault` true, no unknown members, valid enum) to `api/internal/handlers/resources_security.go`, returning 422 `server.security.invalid`; the CRD CEL stays the second line -- [ ] T034 [US2] **Needs T003.** Make `SecurityAdvanced.tsx` editable for `servers:security` holders (value, "use image default", clear) with client-side range validation and the risky-value confirmation dialog showing `template.spec.security.risky..reason` (plain text, never rendered as markup); depends on T024 -- [ ] T035 [US2] **Needs T003.** Add the collapsed Advanced section to `web/src/routes/CreateServer.tsx`, sending `spec.security` only when a setting was set; surface the server refusals inline (the `root_disabled` message tells an administrator can allow it in Settings); add `web.routes.create_server.advanced_*` keys to `i18n/locales/en/app.json` and `fr`; client calls in `web/src/lib/api.ts` pass `spec` already (no new route); depends on T034 -- [ ] T036 [P] [US2] Module repo (separate PR to `GameplanePanel/module`, branch from T002): regenerate `.schema/gametemplate.schema.json` with `make module-schema` (`hack/gen-module-schema.py:21-22`, run from this repo after T007 merges or on its branch, output copied into the module repo); add to `validate.py` the rules that a `risky` key is one of the four settings, a `reason` over 200 characters is an error, and `volumeOwnershipCheck` without a template `fsGroup` is a warning (existing rules at `validate.py:610-660, 903-958` unchanged); add cases to `test-validate-py.sh`; depends on T007 -- [ ] T037 [P] [US2] Module repo, same PR: mark `runAsUser` risky with a reason in `palworld/template.yaml` ("The image must start as root to drop privileges; forcing a user breaks its start.") and update `palworld/specs.md`; other modules only if the module review says so -- [ ] T038 [P] [US2] Add the same three template checks to `gp-module/internal/validator/rules.go` with tests in the validator test file so `gp-module validate` agrees with `validate.py`; make `gp-module/internal/preview/` print the resolved defaults, the ownership check and the risky settings with their reasons; leave `internal/scaffold/scaffold.go:167, 213` unchanged (no archetype asks for `risky`); tests under the gp-module gate (80) +- [X] T031 [US2] Extend `resolveGameSecurity` in `operator/internal/controller/security_overrides.go` with the override layer (research R4): `useImageDefault` gives none and `ImageDefaultOverride`, `value` gives that number and `Override`, else module default, else none; ownership check override over template over `OnlyWhenWrong` +- [X] T032 [US2] Make `validateRestrictedTemplate` and `restrictedContainerSecurity` (`workload_security.go:15, 23`), `applyWorkloadSecurity` (`:39`) and the call sites at `gameserver_controller.go:334`, `gameserver_template_revision.go:216, 278` validate and apply the effective (desired) values; a violation reports the server failed with the existing message until fixed; a running pod is untouched (OD-5 settled A) +- [X] T033 [US2] Add the shape validation (case 4: ids whole numbers 0 to 4294967295, exactly one of `value`/`useImageDefault`, `useImageDefault` true, no unknown members, valid enum) to `api/internal/handlers/security_overrides.go`, returning 422 `server.security.invalid`; the CRD CEL stays the second line +- [X] T034 [US2] **Needs T003.** Make `SecurityAdvanced.tsx` editable for `servers:security` holders (value, "use image default", clear) with client-side range validation and the risky-value confirmation dialog showing `template.spec.security.risky..reason` (plain text, never rendered as markup); depends on T024 +- [X] T035 [US2] **Needs T003.** Add the collapsed Advanced section to `web/src/routes/CreateServer.tsx`, sending `spec.security` only when a setting was set; surface the server refusals inline (the `root_disabled` message tells an administrator can allow it in Settings); add `web.routes.create_server.advanced_*` keys to `i18n/locales/en/app.json` and `fr`; client calls in `web/src/lib/api.ts` pass `spec` already (no new route); depends on T034 +- [X] T036 [P] [US2] Module repo (separate PR to `GameplanePanel/module`, branch from T002): regenerate `.schema/gametemplate.schema.json` with `make module-schema` (`hack/gen-module-schema.py:21-22`, run from this repo after T007 merges or on its branch, output copied into the module repo); add to `validate.py` the rules that a `risky` key is one of the four settings, a `reason` over 200 characters is an error, and `volumeOwnershipCheck` without a template `fsGroup` is a warning (existing rules at `validate.py:610-660, 903-958` unchanged); add the NEW file `test-validate-py-security.sh` (the existing `test-validate-py.sh` is not edited); depends on T007 +- [X] T037 [P] [US2] Module repo, same PR: mark `runAsUser` risky with a reason in `palworld/template.yaml` ("The image must start as root to drop privileges; forcing a user breaks its start.") and update `palworld/specs.md`; other modules only if the module review says so +- [X] T038 [P] [US2] Add the same three template checks to `gp-module/internal/validator/rules.go`, with tests in the NEW `gp-module/internal/validator/rules_security_test.go` (the existing validator tests are not edited), so `gp-module validate` agrees with `validate.py`; make `gp-module/internal/preview/` print the resolved defaults, the ownership check and the risky settings with their reasons, with tests in the NEW `gp-module/internal/preview/preview_security_test.go`; leave `internal/scaffold/scaffold.go:167, 213` unchanged (no archetype asks for `risky`); tests under the gp-module gate (80) **Checkpoint**: US1 and US2 work end to end for an admin; module repo PR open. Compile checks as above plus `go build ./...` in `gp-module`. @@ -129,17 +133,17 @@ Repository root of `GameplanePanel/Gameplane` unless a task says `module repo` ( ### Tests for User Story 3 -- [ ] T039 [P] [US3] Extend `operator/internal/controller/gameserver_security_envtest_test.go`: saving a changed override does not change the StatefulSet pod template or the pod while it runs (same generation of the template, `pending=true`, `applied` unchanged); an unrelated env change rolls the pod without picking up the pending security change; scale to zero and up refreshes and clears `pending`; editing back to the applied value clears `pending`; removal returns `ModuleDefault`; a template rollout keeps an overridden setting and the others follow the new default (US3 scenario 3); a never-started server has no `applied` -- [ ] T040 [P] [US3] Extend `operator/internal/controller/backup_envtest_test.go` and add cases to `operator/internal/controller/gameserver_security_test.go`: with a pending `fsGroup` change on a stopped server, and during a pending start whose pod has not passed volume setup, `buildBackupPodSecurityContext` (`backup_controller.go:1133`) and the restore pod (`restore_controller.go:425`) use `applied.fsGroup`, not `desired`; a start that fails before volume setup leaves `applied` and `pending` unchanged; a never-started server uses the desired value -- [ ] T041 [P] [US3] **Needs T003.** vitest `web/src/routes/tabs/Settings.test.tsx` and `web/src/routes/tabs/settings/Security.test.tsx`: the section shows applied, pending and the "applies on the next restart" notice; saving a changed run-as user or group on a server with data shows the file-access warning first; removing an override shows "module default"; the save never triggers a restart call -- [ ] T042 [P] [US3] Extend `test/e2e/gameserver_security_e2e_test.go` (`TestGameServer_SecurityOverrideAppliesOnRestart` part 2): change the override and assert the same pod UID, `status.security.pending` true and `applied` unchanged; restart and assert the new uid and `pending` false; remove the override, restart, assert the module default +- [X] T039 [P] [US3] Extend `operator/internal/controller/security_overrides_envtest_test.go`: saving a changed override does not change the StatefulSet pod template or the pod while it runs (same generation of the template, `pending=true`, `applied` unchanged); an unrelated env change rolls the pod without picking up the pending security change; scale to zero and up refreshes and clears `pending`; editing back to the applied value clears `pending`; removal returns `ModuleDefault`; a template rollout keeps an overridden setting and the others follow the new default (US3 scenario 3); a never-started server has no `applied` +- [X] T040 [P] [US3] Create the NEW file `operator/internal/controller/security_backup_envtest_test.go` (the existing `backup_envtest_test.go` is not edited) and add the unit cases to the NEW `operator/internal/controller/security_overrides_test.go`: with a pending `fsGroup` change on a stopped server, and during a pending start whose pod has not passed volume setup, `buildBackupPodSecurityContext` and the restore pod (`restore_controller.go:433`) use `applied.fsGroup`, not `desired`; a start that fails before volume setup leaves `applied` and `pending` unchanged; a never-started server uses the desired value +- [X] T041 [P] [US3] **Needs T003.** vitest in the NEW `web/src/routes/tabs/settings/Security.test.tsx` (the existing `Settings.test.tsx` is not edited): the section shows applied, pending and the "applies on the next restart" notice; saving a changed run-as user or group on a server with data shows the file-access warning first; removing an override shows "module default"; the save never triggers a restart call +- [X] T042 [P] [US3] Extend `test/e2e/gameserver_security_e2e_test.go` (`TestGameServer_SecurityOverrideAppliesOnRestart` part 2): change the override and assert the same pod UID, `status.security.pending` true and `applied` unchanged; restart and assert the new uid and `pending` false; remove the override, restart, assert the module default ### Implementation for User Story 3 -- [ ] T043 [US3] Make `buildBackupPodSecurityContext` (`backup_controller.go:1133`, caller `:1035`) and the restore call (`restore_controller.go:425`) take the applied filesystem group from the same pod or StatefulSet read as `status.security.applied` (FR-011, research R6); fall back to the desired value only for a server that never started; depends on T018 -- [ ] T044 [US3] Ensure the status writer recomputes `pending` when the template pin changes (template rollout admitted, `gameserver_template_revision.go`) without touching the running pod; confirm in the brief that `OnRequest` and `Automatic` rollouts both end in a start that refreshes the template (plan.md spec gap 3) -- [ ] T045 [US3] **Needs T003.** Create `web/src/routes/tabs/settings/Security.tsx` (NEW) and mount it from `web/src/routes/tabs/Settings.tsx` (mounted by `ServerDetail.tsx:377`): the shared `SecurityAdvanced` section for an existing server with the pending marker, the restart notice, the file-access warning and clear-to-module-default; the whole spec sent back unchanged is accepted by the API (case 1); depends on T034 -- [ ] T046 [US3] **Needs T003.** Add `web.routes.server_settings.security_*` notice and warning strings to `i18n/locales/en/app.json` and `fr` (pending, restart notice, file-access warning); depends on T045 +- [X] T043 [US3] Give `buildBackupPodSecurityContext` (`backup_controller.go:1156`, caller `:1058`) a trailing variadic applied filesystem group (briefs/00 section 11), and pass it from the restore call (`restore_controller.go:433`, job call `:277`) and from the backup chain (`backup_worker.go:306`, through `:129-130`). The applied group comes from the same pod or StatefulSet read as `status.security.applied` (FR-011, research R6); fall back to the desired value only for a server that never started; depends on T018 +- [X] T044 [US3] The status writer recomputes `pending` when the template pin changes (template rollout admitted, `gameserver_template_revision.go`) without touching the running pod. A rollout on a suspended or sleeping server ends at zero replicas, so its security refresh happens at the next start, not at the rollout, and `pending` stays true until then (OD-9 item 5, briefs/01 section 4.3). Tests must not assert a start for those servers. Confirm that `OnRequest` and `Automatic` rollouts on a running, awake server both end in a start that refreshes the template (plan.md spec gap 3) +- [X] T045 [US3] **Needs T003.** Create `web/src/routes/tabs/settings/Security.tsx` (NEW) and mount it from `web/src/routes/tabs/Settings.tsx` (mounted by `ServerDetail.tsx:377`): the shared `SecurityAdvanced` section for an existing server with the pending marker, the restart notice, the file-access warning and clear-to-module-default; the whole spec sent back unchanged is accepted by the API (case 1); depends on T034 +- [X] T046 [US3] **Needs T003.** Add `web.routes.server_settings.security_*` notice and warning strings to `i18n/locales/en/app.json` and `fr` (pending, restart notice, file-access warning); depends on T045 **Checkpoint**: change, restart and removal verified; backups safe. @@ -153,26 +157,30 @@ Repository root of `GameplanePanel/Gameplane` unless a task says `module repo` ( ### Tests for User Story 4 -- [ ] T047 [P] [US4] Extend `api/internal/handlers/config_envtest_test.go` and add validator unit tests: `PUT /admin/config/security` accepts `{"allowRootOverrides":true}`, rejects a non-boolean and an empty body (422), drops unknown members; a viewer without `config:manage` gets 403; the section round-trips through `GET /admin/config`; a flip writes the ConfigMap `gameplane-security-settings` with `"true"`/`"false"`, a failing ConfigMap write returns an error and leaves the config row unchanged, and the start-up sync recreates a deleted ConfigMap ([contracts/cluster-setting.md](./contracts/cluster-setting.md)) -- [ ] T048 [P] [US4] Extend `api/internal/handlers/resources_security_test.go` and `resources_security_envtest_test.go` for the root rule (case 5): a new or changed `runAsUser` or `runAsGroup` with `value: 0` or `useImageDefault`, or `fsGroup` `value: 0`, gets 403 `server.security.root_disabled` while off and is accepted once on; `fsGroup` `useImageDefault` is free; an unchanged stored root value passes an unrelated whole-spec PUT with the setting off; removal and replacement are always allowed -- [ ] T049 [P] [US4] Audit tests in `api/internal/handlers/resources_security_test.go` (unit) and `resources_security_envtest_test.go`: the `reason` builder for not set, number, `"image"`, ownership check, create (`before` `{}`), and the `risky` list (a risky changed setting appears with names only; non-risky, unchanged risky and an absent `risky` map add no key; the module's reason text never appears; OD-6); each of change, permission refusal (`security_forbidden`), root refusal (`security_root_disabled:runAsUser`), invalid (`security_invalid:fsGroup`) and setting flip (`allowRootOverrides:false->true`) writes exactly one row with `MarkRecorded`, a change row is written before the Kubernetes write, a failed `WriteSync` on a change returns 500 with nothing saved, a failed Kubernetes write after the row adds a `security_save_failed` row, a failed `WriteSync` on a refusal falls back to the middleware row, and `GET /admin/audit/verify` still passes ([contracts/audit-events.md](./contracts/audit-events.md)) -- [ ] T050 [P] [US4] Operator unit tests in `operator/internal/controller/gameserver_security_test.go` for `hasRootOverride` and `rootOverrideSettings` (every root form in the rule table, plus non-root values and a module-default root that is not an override) and the ConfigMap reader (absent, missing key, `"false"`, garbage and `"true"` read as off/off/off/off/on) -- [ ] T051 [P] [US4] Envtest `operator/internal/controller/gameserver_security_envtest_test.go` for OD-4 (FR-005a): with the ConfigMap absent or `"false"`, a stopped server holding a root override stays at zero replicas with `SecurityAllowed=False` reason `RootOverrideDisallowed` naming the settings; a running one keeps its pod and restart count and gets only the informational condition; flipping the ConfigMap to `"true"` starts the stopped one without any other event (the watch re-enqueues it); clearing the override starts it; flipping off never restarts or stops any server; unrelated servers are not enqueued by the flip -- [ ] T052 [P] [US4] **Needs T003.** vitest: `web/src/routes/AdminSettings.test.tsx` (the Security section's switch is off by default, reads `GET /admin/config`, saves through `PUT /admin/config/security`, shows the "does not change existing servers" text) and `web/src/components/SecurityAdvanced.test.tsx` (no `servers:security`: applied, sources and pending visible and read-only, no `spec.security` is ever sent; a server held back shows the `RootOverrideDisallowed` reason for the stopped and running variants; the three API refusals render inline) -- [ ] T053 [P] [US4] Kind E2E `test/e2e/api_security_override_e2e_test.go` (NEW, `//go:build e2e`, `TestAPI_SecurityOverride_PermissionAndRootRule`, `t.Parallel()`, unique names): one admin login and one login as its own non-admin user created for the test; the non-admin (holds `servers:write`, not `servers:security`) is refused 403 on create and on update; granted `servers:security` it succeeds; a root value is refused 403 while `allowRootOverrides` is off and accepted after the admin enables it; the ConfigMap `gameplane-security-settings` mirrors each flip; the audit log has the rows -- [ ] T054 [P] [US4] Extend `test/e2e/gameserver_security_e2e_test.go` (`TestGameServer_SecurityOverrideAppliesOnRestart` part 3, zero logins): save a root `fsGroup` override, stop the server with the ConfigMap absent or `"false"`, start it and assert it stays at zero replicas with `SecurityAllowed=False` / `RootOverrideDisallowed`; set the ConfigMap to `"true"` with `kubectl` and assert it starts; set it back to `"false"` and assert the running pod keeps its UID and restart count +- [X] T047 [P] [US4] Create the NEW API test files `api/internal/handlers/security_settings_test.go` (validator and shapes: `{"allowRootOverrides":true}` accepted, non-boolean 422, empty body 400 `server.empty_body`, unknown members dropped) and `api/internal/handlers/security_settings_envtest_test.go` (a dedicated router with `rbac.Middleware`, never `mountedR`, and the test cluster registered): `GET /security-settings?cluster=` round trip, and `present` false for a missing ConfigMap; `PUT` by a viewer without `config:manage` gets 403; a flip updates the ConfigMap `gameplane-security-settings` to `"true"` or `"false"` and writes one `security/` row; a failing audit write returns 500 and leaves the ConfigMap unchanged; a failing update returns 502 and writes `security_save_failed`; a missing ConfigMap returns 409 `server.cluster.security_settings_missing` and writes no row; nothing creates the ConfigMap ([contracts/cluster-setting.md](./contracts/cluster-setting.md)) +- [X] T048 [P] [US4] Add cases to `api/internal/handlers/security_overrides_test.go` and `security_overrides_envtest_test.go` (created by T013 and T014) for the root rule (case 5): a new or changed `runAsUser` or `runAsGroup` with `value: 0` or `useImageDefault`, or `fsGroup` `value: 0`, gets 403 `server.security.root_disabled` while off and is accepted once on; `fsGroup` `useImageDefault` is free; an unchanged stored root value passes an unrelated whole-spec PUT with the setting off; removal and replacement are always allowed +- [X] T049 [P] [US4] Audit tests in `api/internal/handlers/security_overrides_test.go` (unit) and `security_overrides_envtest_test.go`: the `reason` builder for not set, number, `"image"`, ownership check, create (`before` `{}`), and the `risky` list (a risky changed setting appears with names only; non-risky, unchanged risky and an absent `risky` map add no key; the module's reason text never appears; OD-6); each of change, permission refusal (`security_forbidden`), root refusal (`security_root_disabled:runAsUser`), invalid (`security_invalid:fsGroup`) and setting flip (`allowRootOverrides:false->true`) writes exactly one row with `MarkRecorded`, a change row is written before the Kubernetes write, a failed `WriteSync` on a change returns 500 with nothing saved, a failed Kubernetes write after the row adds a `security_save_failed` row, a failed `WriteSync` on a refusal falls back to the middleware row, and `GET /admin/audit/verify` still passes ([contracts/audit-events.md](./contracts/audit-events.md)) +- [X] T050 [P] [US4] Operator unit tests in the NEW `operator/internal/controller/security_settings_test.go` for `hasRootOverride` and `rootOverrideSettings` (every root form in the rule table, plus non-root values and a module-default root that is not an override) and the ConfigMap reader (absent, missing key, `"false"`, garbage and `"true"` read as off/off/off/off/on) +- [X] T051 [P] [US4] Envtest `operator/internal/controller/security_overrides_envtest_test.go` for OD-4 (FR-005a): with the ConfigMap absent or `"false"`, a stopped server holding a root override stays at zero replicas with `SecurityAllowed=False` reason `RootOverrideDisallowed` naming the settings; a running one keeps its pod and restart count and gets only the informational condition; flipping the ConfigMap to `"true"` starts the stopped one without any other event (the watch re-enqueues it); clearing the override starts it; flipping off never restarts or stops any server; unrelated servers are not enqueued by the flip +- [X] T052 [P] [US4] **Needs T003.** vitest: the NEW `web/src/components/clusters/SecuritySettingsPanel.test.tsx` (the switch is off by default, reads `GET /security-settings?cluster=`, saves through `PUT /security-settings?cluster=`, shows the "does not change existing servers" text and the missing-settings state) and the NEW cases in `web/src/components/SecurityAdvanced.test.tsx` (no `servers:security`: applied, sources and pending visible and read-only, no `spec.security` is ever sent; a server held back shows the `RootOverrideDisallowed` reason for the stopped and running variants; the three API refusals render inline) +- [X] T053 [P] [US4] Kind E2E `test/e2e/api_security_override_e2e_test.go` (NEW, `//go:build e2e`, `TestAPI_SecurityOverride_PermissionAndRootRule`, `t.Parallel()`, unique names): one admin login and one login as its own non-admin user created for the test; the non-admin (holds `servers:write`, not `servers:security`) is refused 403 on create and on update; granted `servers:security` it succeeds; a root value is refused 403 while `PUT /security-settings?cluster=` has the setting off, and accepted after the admin sets it on; the ConfigMap `gameplane-security-settings` value follows each PUT; the audit log has the rows +- [X] T054 [P] [US4] Extend `test/e2e/gameserver_security_e2e_test.go` (`TestGameServer_SecurityOverrideAppliesOnRestart` part 3, zero logins): save a root `fsGroup` override, stop the server with the ConfigMap at `"false"` (created by the chart, T077), start it and assert it stays at zero replicas with `SecurityAllowed=False` / `RootOverrideDisallowed`; set the ConfigMap to `"true"` with `kubectl` and assert it starts; set it back to `"false"` and assert the running pod keeps its UID and restart count ### Implementation for User Story 4 -- [ ] T055 [US4] Add the root rule (case 5) to `api/internal/handlers/resources_security.go`, reading `allowRootOverrides` through the `*db.Store` `MountResources` already receives (one indexed `config` read, only on a request that carries a new or changed root value); 403 `server.security.root_disabled` with `args.setting` -- [ ] T056 [US4] Register the `security` validator in `newValidators` (`api/internal/handlers/config.go:462`) and write the extra audit row on a flip, before the ConfigMap and config row writes (500 and no change if it fails; a `security_save_failed` row if a later write fails; contracts/audit-events.md "Write order"), reusing the row format of the `config.go:174-179` pattern (`PUT /admin/config/security`, `target` `security`, `reason` `allowRootOverrides:false->true`); the existing rule table (`rbac.go:223-228`) already needs `config:manage` -- [ ] T057 [US4] Create `api/internal/handlers/security_settings_sync.go` (NEW): write the ConfigMap `gameplane-security-settings` (key `allowRootOverrides`, label `app.kubernetes.io/managed-by: gameplane-api`) in the control-plane namespace of every registered cluster the API can reach, ConfigMap first then the config row, failing the request if the write fails; rewrite it from the config row on API start; call it from the `security` section's save in `config.go`; depends on T056 -- [ ] T058 [US4] Add to `charts/gameplane/templates/api.yaml` a Role and RoleBinding in the release namespace giving the API `get`, `create`, `update`, `patch` on the single ConfigMap `gameplane-security-settings` by `resourceNames`; the operator ClusterRole already has `get;list;watch` on ConfigMaps (`charts/gameplane/templates/operator.yaml:66`); add a Helm unit/template check if the chart tests have a RBAC fixture for the API roles -- [ ] T059 [US4] Wire `MountResources` (`api/internal/handlers/resources.go:51`, called from `api/cmd/main.go:382`) to receive the `*audit.Auditor`; in create (`:218`) and update (`:290`) write one synchronous row via `Auditor.WriteSync` before the Kubernetes write (500 and no save on failure; a `security_save_failed` row if the save then fails; [contracts/audit-events.md](./contracts/audit-events.md) "Write order") then `audit.MarkRecorded` (capture precedent `handlers/capture.go:1252-1258`) for a changed block and for each refusal; build `reason` as `security:{"before":..,"after":..,"risky":[..]}` from the two blocks and the pinned template's `risky` map (names only, OD-6); confirm the clone path (`lifecycle.go:243`) is covered by the shared validator -- [ ] T060 [US4] Create `operator/internal/controller/security_settings.go` (NEW): the ConfigMap reader from the informer cache (fail closed), `hasRootOverride`, `rootOverrideSettings`, and the map function that enqueues every GameServer holding a root override; add `Watches(&corev1.ConfigMap{}, handler.EnqueueRequestsFromMapFunc(...))` filtered to that name and namespace next to the Pod and GameTemplate watches (`gameserver_controller.go:583`), no new RBAC marker needed (`:258` already lists ConfigMaps) -- [ ] T061 [US4] In `reconcileStatefulSet` hold a stopped server with a root override at zero replicas while the setting is off (before the R5 refresh, so the StatefulSet is left exactly as it was) and never touch a running one; set the `SecurityAllowed` condition (`False` / `RootOverrideDisallowed` with the settings named and what clears it; `True` once allowed or cleared) in `gameserver_status.go`; emit an event; never restart or stop on a flip (research R9, FR-005a); depends on T020, T060 -- [ ] T062 [US4] **Needs T003.** Make `SecurityAdvanced.tsx` read-only without the permission (`can("servers:security", namespace)` from the permission data the dashboard already loads, [contracts/rbac-permission.md](./contracts/rbac-permission.md)) and show the `RootOverrideDisallowed` notice with the stopped and running texts; depends on T034, T045 -- [ ] T063 [US4] **Needs T003.** Add the "Security" section with the allow-root switch to `web/src/routes/AdminSettings.tsx` and its get/put client methods to `web/src/lib/api.ts`; strings under `web.routes.admin_settings.security_*` in `i18n/locales/en/app.json` and `fr` (FR-014); depends on T052 +- [X] T055 [US4] Add the root rule (case 5) to `api/internal/handlers/security_overrides.go` (NEW, see briefs/00 section 9): read the setting from the ConfigMap `gameplane-security-settings` of the request's own cluster, through that cluster's registry client (`resolveCluster`), and only on a request that carries a new or changed root value. Exact `"true"` is on; any other result (missing, unreadable) is off. Refuse with 403 `server.security.root_disabled` and `args.setting`. The store is not used for this rule +- [X] T056 [US4] Create `api/internal/handlers/security_settings.go` (NEW): `GET` and `PUT /security-settings?cluster=`, mounted by `MountSecuritySettings(r chi.Router, reg *kube.Registry, auditor *audit.Auditor)` from `api/cmd/main.go` (briefs/00 section 2). Rules `config:read` (GET) and `config:manage` (PUT) in `api/internal/rbac/rbac.go`, next to the `/admin/config` rules (`:209`, `:214`). Empty body 400 `server.empty_body`; invalid JSON or non-boolean 422. Read the ConfigMap by name first: NotFound makes GET report `present` false, and PUT return 409 `server.cluster.security_settings_missing` with no row. On a changed value write the flip row first (`WriteSync`, `target` `security/`, `reason` `allowRootOverrides:false->true` or `true->false`; 500 and no change if it fails), then update the ConfigMap by name (never create). An update failure returns 502 and writes `security_save_failed` ([audit-events.md](./contracts/audit-events.md) "Write order"). No config-table row and no `newValidators` entry. Depends on T057 +- [X] T057 Add the per-cluster ConfigMap helper used by T055 and T056 in `api/internal/handlers/security_settings.go`: read by name, update by name, no create. Resolve the namespace for each cluster. The home cluster uses `moduleConfigMapNS` (`api/cmd/main.go:231`, the credentials namespace on a default install). A remote cluster's control-plane namespace is read from its registration, `Cluster.spec.controlPlaneNamespace` (T078, OD-10 A; an absent value means `gameplane`); do not hard-code one (briefs/00 section 12). Depends on T078. Implement this before T056 +- [X] T058 [US4] Add the API's ConfigMap rule to the home Role in `charts/gameplane/templates/api-credentials.yaml` (`:14-37`, credentials namespace): `resources: [configmaps]`, `resourceNames: [gameplane-security-settings]`, `verbs: [get, update, patch]`. No `create` verb (briefs/00 section 4). The rule is in its own Role and RoleBinding `-api-security-settings` next to the credentials Role, which keeps that Role's rules unchanged. No standalone Role (corrected 2026-11-16, valgul approved: a standalone panel has no local operator and mounts no service account token, so it renders neither the ConfigMap nor an API Role for it; `charts/tests/check_standalone.py` asserts it renders no Roles). The operator ClusterRole already has `get;list;watch` on ConfigMaps (`charts/gameplane/templates/operator.yaml:66`). No chart test is added without sign-off (briefs/04 Q3) +- [X] T059 [US4] Wire `MountResources` (`api/internal/handlers/resources.go:51`, called from `api/cmd/main.go:396`) to receive the `*audit.Auditor`. In create (`:250`) and update (`:322`), write one synchronous row via `Auditor.WriteSync` before the Kubernetes write (500 and no save on failure; a `security_save_failed` row if the save then fails; [contracts/audit-events.md](./contracts/audit-events.md) "Write order"), then `audit.MarkRecorded` for a changed block and for each refusal. Clone (`lifecycle.go:243`): `MountLifecycle(r, reg, auditor ...*audit.Auditor)` takes the auditor as an optional variadic parameter, so the existing call sites compile, and clone writes the same row (OD-9 item 3). Build `reason` as `security:{"before":..,"after":..,"risky":[..]}` from the two blocks and the pinned template's `risky` map (names only, OD-6), in `api/internal/handlers/security_overrides.go` +- [X] T060 [US4] Create `operator/internal/controller/security_settings.go` (NEW): the ConfigMap reader from the informer cache (namespace from `ControlPlaneNamespace`, briefs/02 D7) (fail closed), `hasRootOverride`, `rootOverrideSettings`, and the map function that enqueues every GameServer holding a root override; add `Watches(&corev1.ConfigMap{}, handler.EnqueueRequestsFromMapFunc(...))` filtered to that name and namespace next to the Pod and GameTemplate watches (`gameserver_controller.go:609-611`), no new RBAC marker needed (`:261` already lists ConfigMaps) +- [X] T061 [US4] In `reconcileStatefulSet` hold a stopped server with a root override at zero replicas while the setting is off (before the R5 refresh, so the StatefulSet is left exactly as it was) and never touch a running one; set the `SecurityAllowed` condition (`False` / `RootOverrideDisallowed` with the settings named and what clears it; `True` once allowed or cleared) in `gameserver_status.go`; emit an event; never restart or stop on a flip (research R9, FR-005a); also held before `reserveWakeStart` (`gameserver_idle.go:333`), so a held sleeping server takes no wake slot (OD-9 item 4); depends on T020, T060 +- [X] T062 [US4] **Needs T003.** Make `SecurityAdvanced.tsx` read-only without the permission (`can("servers:security", namespace)` from the permission data the dashboard already loads, [contracts/rbac-permission.md](./contracts/rbac-permission.md)) and show the `RootOverrideDisallowed` notice with the stopped and running texts; depends on T034, T045 +- [X] T063 [US4] **Needs T003.** Add the "Security" panel with the allow-root switch as the NEW `web/src/components/clusters/SecuritySettingsPanel.tsx` (not Admin Settings), mounted in `web/src/components/clusters/ClusterConfiguration.tsx` next to `BackupDestinationsPanel.tsx`. Add its get and put client methods to `web/src/lib/api.ts`, and its strings under `web.clusters.security_*` in `i18n/locales/en/app.json` and `fr` (FR-014); depends on T052 + +- [X] T076 [US4] Remote-chart RBAC: find in the chart the identity the API uses for a remote cluster (the remote operator install path under `charts/gameplane/`), and grant it `get`, `update` and `patch` on the ConfigMap `gameplane-security-settings` by `resourceNames`, in that cluster's control-plane namespace, which is the `Cluster.spec.controlPlaneNamespace` value on its registration (T078, OD-10 A; the remote chart's namespace must render the same value). No `create` verb (OD-8 A). If the identity cannot be found in the chart, stop and ask (briefs/00 section 7). Depends on T077 and T078. +- [X] T077 [US4] Helm creates the ConfigMap `gameplane-security-settings` in the operator's control-plane namespace, wherever the operator chart renders (home and remote installs). Data `allowRootOverrides: "false"`, annotation `helm.sh/resource-policy: keep`. On upgrade it reads the current object with Helm `lookup` and re-renders its value, so an upgrade never flips it. A deleted object reads as off until the next `helm upgrade` (OD-8 A, briefs/00 section 4). CI checks the render with `helm template`; no chart test is added without sign-off. +- [X] T079 [US4] **Needs T003.** The register-cluster form (web) gets an optional "Control-plane namespace" field, default `gameplane`, sent as `spec.controlPlaneNamespace` through the cluster registration call in `web/src/lib/api.ts` (no new route); the cluster page shows the stored value. Strings under `web.clusters.control_plane_namespace_*` in `i18n/locales/en/app.json` and `fr` (FR-014). Vitest for the field's default, edit and invalid value (not a lowercase DNS label, or over 63 characters) in a NEW test file (name proposed in the PR; the maintainer accepts or renames it, briefs/00 section 7). Depends on T003, T063 and T078. **Checkpoint**: all four stories functional. Compile checks: `go build ./...` in `operator`, `api`; `go vet -tags e2e ./...` in `test/e2e`; `npx tsc --noEmit` in `web`. @@ -182,13 +190,13 @@ Repository root of `GameplanePanel/Gameplane` unless a task says `module repo` ( **Purpose**: register the E2E tests, document the feature, land the module PR and pointer bump, and close the loose ends. Docs tasks do not wait for the design. -- [ ] T064 Register both tests in `bucket_operator` of `test/e2e/buckets.sh` (`TestGameServer_SecurityOverrideAppliesOnRestart`, `TestAPI_SecurityOverride_PermissionAndRootRule`). **Bucket decision**: `operator` already spends about four admin logins ("operator: 4 admin logins with the EventStream test", `buckets.sh:355-362`) against the documented ceiling near seven; `TestAPI_SecurityOverride_PermissionAndRootRule` adds one admin login plus one login as its own user, so the bucket reaches about five admin logins and fits. `api-auth`, `api-roles`, `api-rbac`, `api-agent` and `api-mods` are at their ceilings and must not receive it. Add a comment above the bucket recording the tally; no new bucket, CI matrix entry or `suite-components.json` entry is needed (`^TestGameServer_` and `^TestAPI_` already map both tests, `suite-components.json:32, 46`); `buckets.sh verify` must still pass; depends on T030, T053 -- [ ] T065 [P] Rewrite "Security context" in `docs/module-authoring.md` (`:1137-1173`) per FR-013: the block is a default that server owners can override; the new `volumeOwnershipCheck` and `risky` fields in the field table; when to mark a value risky (the image only works with that uid, or must start as root) and how to word the reason (one sentence, what breaks); when to set `EveryStart`; the built-in default flip to `OnlyWhenWrong` -- [ ] T066 [P] Add a "Server security overrides" subsection under "Pod security" in `docs/security.md` (`:435`): who may override (`servers:security`, admin by default), the root rule and the allow-root setting, the refusal to start (`RootOverrideDisallowed`), apply-on-restart, the applied filesystem group for backups, the ownership-check trade-off, the audit trail, and that `kubectl` writers bypass the API checks -- [ ] T067 [P] Update `operator/specs.md` (resolver, gate, annotation, status, `SecurityAllowed`, ConfigMap watch, restricted-mode effective values), `api/specs.md` (permission, field-level check, `security` config section and ConfigMap mirror, audit reason), `web/specs.md` (shared Advanced section, wizard, Settings, admin switch), `gp-module/specs.md` (validator rules, preview), `mcp-server/specs.md` (read-only exposure, T022) and `test/e2e/specs.md` (the two tests); each in the same change as its code (constitution IV) -- [ ] T068 [P] Add the new files (`operator/internal/controller/gameserver_security.go`, `security_settings.go`, `api/internal/handlers/resources_security.go`, `security_settings_sync.go`, `web/src/components/SecurityAdvanced.tsx`) to the task map in `docs/agent-architecture.md` -- [ ] T069 Open the module repo PR (T036, T037) to `GameplanePanel/module` from `spec-030/module-security`, run its `test-validate-py.sh` in its CI, get it merged (needs human approval, agents cannot merge); depends on T036, T037 -- [ ] T070 After T069 merges, bump the pointer in this repo with the `submodule-bump` skill (`git submodule update --remote modules`, `git add modules`, signed commit `chore: bump modules for spec 030`); run `make modules-push` only if the module PR notes require it; depends on T069 +- [X] T064 Register both tests in `bucket_operator` of `test/e2e/buckets.sh` (`TestGameServer_SecurityOverrideAppliesOnRestart`, `TestAPI_SecurityOverride_PermissionAndRootRule`). **Bucket decision**: `operator` already spends about four admin logins ("operator: 4 admin logins with the EventStream test", `buckets.sh:355-362`) against the documented ceiling near seven; `TestAPI_SecurityOverride_PermissionAndRootRule` adds one admin login plus one login as its own user, so the bucket reaches about five admin logins and fits. `api-auth`, `api-roles`, `api-rbac`, `api-agent` and `api-mods` are at their ceilings and must not receive it. Add a comment above the bucket recording the tally; no new bucket, CI matrix entry or `suite-components.json` entry is needed (`^TestGameServer_` and `^TestAPI_` already map both tests, `suite-components.json:32, 46`); `buckets.sh verify` must still pass; depends on T030, T053 +- [X] T065 [P] Rewrite "Security context" in `docs/module-authoring.md` (`:1137-1173`) per FR-013: the block is a default that server owners can override; the new `volumeOwnershipCheck` and `risky` fields in the field table; when to mark a value risky (the image only works with that uid, or must start as root) and how to word the reason (one sentence, what breaks); when to set `EveryStart`; the built-in default flip to `OnlyWhenWrong` +- [X] T066 [P] Add a "Server security overrides" subsection under "Pod security" in `docs/security.md` (`:435`): who may override (`servers:security`, admin by default), the root rule and the per-cluster allow-root setting, the refusal to start (`RootOverrideDisallowed`), apply-on-restart, the applied filesystem group for backups, the ownership-check trade-off, the audit trail, and that `kubectl` writers bypass the API checks +- [X] T067 [P] Update `operator/specs.md` (resolver, gate, annotation, status, `SecurityAllowed`, ConfigMap watch, restricted-mode effective values), `api/specs.md` (permission, field-level check, the `/security-settings` routes and the per-cluster ConfigMap, audit reason), `web/specs.md` (shared Advanced section, wizard, Settings, cluster Security panel), `gp-module/specs.md` (validator rules, preview), `mcp-server/specs.md` (read-only exposure, T022) and `test/e2e/specs.md` (the two tests); each in the same change as its code (constitution IV) (2026-11-22: the `mcp-server/specs.md` part moves to the GameplanePanel/mcp PR with T022, since mcp-server is now a submodule) +- [X] T068 [P] Add the new files (`operator/internal/controller/security_overrides.go`, `security_settings.go`, `api/internal/handlers/security_overrides.go`, `security_settings.go`, `web/src/components/SecurityAdvanced.tsx`, `web/src/components/clusters/SecuritySettingsPanel.tsx`) to the task map in `docs/agent-architecture.md` +- [X] T069 Open the module repo PR (T036, T037) to `GameplanePanel/module` from `spec-030/module-security`, run its `test-validate-py.sh` in its CI, get it merged (needs human approval, agents cannot merge); depends on T036, T037 +- [X] T070 After T069 merges, bump the pointer in this repo with the `submodule-bump` skill (`git submodule update --remote modules`, `git add modules`, signed commit `chore: bump modules for spec 030`); run `make modules-push` only if the module PR notes require it; depends on T069 - [ ] T071 Open the main PR with labels `type: feature` plus `area: operator`, `area: api`, `area: web`, `area: modules`, `area: chart`, `area: e2e`, `area: specs` as touched (REST call per CLAUDE.md rule 14, `ship-branch` skill); do not call it ready until CI is green; the PR may be split along the delivery slices in plan.md (A and B, C, G, then H) as long as US2 and the permission check ship together - [ ] T072 Walk [quickstart.md](./quickstart.md) S1 to S11 on a dev Kind cluster once CI is green (manual, optional per scenario; CI E2E is the authority) and record any deviation in `specs/030-security-context-overrides/validation.md` - [ ] T073 Final bookkeeping check: every task above is done or marked withdrawn with citations (never deleted), `OPEN-DECISIONS.md` has no open item, and the specs folder passes `check-specs` in CI @@ -208,24 +216,24 @@ Repository root of `GameplanePanel/Gameplane` unless a task says `module repo` ( - Phase 1 has no dependencies. **T003 (maintainer design) starts on day one and runs in parallel with all backend work.** It blocks only the web tasks. - Phase 2 depends on T001 (brief) and blocks every story. T007 needs T005 and T006; T012 needs T006, T009, T011. - Phase 3 (US1, MVP) depends on Phase 2. Its web tasks (T023-T025) also need T003. -- Phase 4 (US2) depends on Phase 3 (it extends `gameserver_security.go`, `SecurityAdvanced.tsx`, and the E2E file). Module-repo tasks T036-T038 depend only on T007 and can start as soon as Phase 2 is merged, in parallel with Phase 3. +- Phase 4 (US2) depends on Phase 3 (it extends `security_overrides.go`, `SecurityAdvanced.tsx`, and the E2E file). Module-repo tasks T036-T038 depend only on T007 and can start as soon as Phase 2 is merged, in parallel with Phase 3. - Phase 5 (US3) depends on Phase 3 for the gate and status (T020, T021) and on Phase 4 for the editable section. T043 can start after T018. -- Phase 6 (US4) depends on Phase 2 and on T020 (the gate it extends). The API half (T047-T049, T055-T059), the chart RBAC (T058) and the operator half (T050, T051, T060, T061) are independent of Phases 4 and 5 and can run in parallel with them; only the web tasks (T062, T063) need the earlier web tasks and T003. +- Phase 6 (US4) depends on Phase 2 and on T020 (the gate it extends). The API half (T047-T049, T055-T059), the chart RBAC (T058, T076, T077) and the operator half (T050, T051, T060, T061) are independent of Phases 4 and 5 and can run in parallel with them; only the web tasks (T062, T063, T079) need the earlier web tasks and T003, and T079 also needs T078. - Phase 7 depends on its inputs: T064 needs T030 and T053; T069 needs T036 and T037; T070 needs T069. - Phase 8 is last. -- **Shipping constraint**: US2's API accept path must not reach a release without US4's root rule and ConfigMap mirror; Phase 2 already enforces the permission, but the root rule (T055) and the operator refusal (T061) land in the same release as US2's wizard (T035). +- **Shipping constraint**: US2's API accept path must not reach a release without US4's root rule and per-cluster ConfigMap; Phase 2 already enforces the permission, but the root rule (T055) and the operator refusal (T061) land in the same release as US2's wizard (T035). ### Hard blockers -- **T003 (maintainer-owned design) blocks T023, T024, T025, T029, T034, T035, T041, T045, T046, T052, T062, T063.** If the design is late, every other task proceeds and these wait. +- **T003 (maintainer-owned design) blocks T023, T024, T025, T029, T034, T035, T041, T045, T046, T052, T062, T063, T079.** If the design is late, every other task proceeds and these wait. - T007 (generated CRDs) blocks every operator, API test and module-schema task. - T069 (module PR merged) blocks T070; T070 blocks T074. The main-repo changes work without them (a template with no `risky` block has no risky values). ### Within each story - Tests first (they fail in CI until the implementation lands in the same PR). -- Resolver and codec (`gameserver_security.go`) before builders, builders before the StatefulSet gate, the gate before status and the start refusal. -- API: validator step before audit; config section before the ConfigMap mirror; chart RBAC with the mirror. +- Resolver and codec (`security_overrides.go`) before builders, builders before the StatefulSet gate, the gate before status and the start refusal. +- API: validator step before audit; the `/security-settings` routes after the ConfigMap helper (T057); chart RBAC with the helper. - Web: types before the shared section, the shared section before the wizard, Settings tab and admin switch. ### Parallel opportunities @@ -238,8 +246,8 @@ Repository root of `GameplanePanel/Gameplane` unless a task says `module repo` ( ## Parallel Example: Phase 6 (US4) ```text -Workflow batch A (haiku, one agent each): T047, T048, T049, T050, T051 — test files only, from the brief -Workflow batch B (haiku): API half T055, T056, T057, T059 (sequential in one agent, same files); chart T058 (separate agent) +Workflow batch A (haiku, one agent each): T047, T048, T049, T050, T051: test files only, from the brief +Workflow batch B (haiku): API half T055, T056, T057, T059 (sequential in one agent, same files); chart T058, T076, T077 (separate agent) Workflow batch C (haiku): operator half T060, T061 (one agent, sequential) Web batch (haiku, only after T003): T052, T062, T063 Review (sonnet): one reviewer per batch on `git diff` against the brief and contracts; compile checks only @@ -256,11 +264,11 @@ Review (sonnet): one reviewer per batch on `git diff` against the brief and cont 1. US2 adds the override (API shape check, operator override layer, restricted-mode validation, wizard, module repo PR). 2. US3 adds apply-on-restart semantics tests, backup and restore fsGroup, Settings tab. -3. US4 adds the root rule, the admin switch, the ConfigMap mirror and operator start refusal, and the audit trail; US2's wizard ships with it. +3. US4 adds the root rule, the per-cluster switch, its ConfigMap and the operator start refusal, and the audit trail; US2's wizard ships with it. 4. Phase 7 registers E2E, documents, bumps the pointer after the module PR merges; Phase 8 archives. ## Notes - Do not renumber tasks; a new task takes the next free ID and states its phase. -- The OD-4 refusal is exercised without the API in the E2E (the test writes the ConfigMap with `kubectl`), and the mirror is exercised in the API E2E (T053), so each test stays within its login budget. +- The OD-4 refusal is exercised without the API in the E2E (the test writes the ConfigMap with `kubectl`), and the `/security-settings` route is exercised in the API E2E (T053), so each test stays within its login budget. - No `.pen` file is read or edited by any task except T003, which is the maintainer's. diff --git a/test/e2e/api_security_override_e2e_test.go b/test/e2e/api_security_override_e2e_test.go new file mode 100644 index 000000000..99487b2d5 --- /dev/null +++ b/test/e2e/api_security_override_e2e_test.go @@ -0,0 +1,228 @@ +//go:build e2e + +package e2e + +import ( + "context" + "encoding/json" + "net/http" + "strconv" + "strings" + "testing" + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// securityServerBody builds a GameServer request body for POST and PUT. +func securityServerBody(ns, gs, tmpl string, security map[string]any) map[string]any { + spec := map[string]any{"templateRef": map[string]any{"name": tmpl}} + if security != nil { + spec["security"] = security + } + meta := map[string]any{"name": gs, "namespace": ns} + // A PUT is an optimistic update, so it carries the stored version. A POST + // of a new server finds nothing and sends none. + if live, err := envInstance.Dyn.Resource(gameServerGVR).Namespace(ns). + Get(context.Background(), gs, metav1.GetOptions{}); err == nil { + meta["resourceVersion"] = live.GetResourceVersion() + } + return map[string]any{ + "apiVersion": "gameplane.local/v1alpha1", + "kind": "GameServer", + "metadata": meta, + "spec": spec, + } +} + +// securitySettingsResponse is the GET and PUT body of /security-settings. +type securitySettingsResponse struct { + Cluster string `json:"cluster"` + AllowRootOverrides bool `json:"allowRootOverrides"` + Present bool `json:"present"` +} + +// TestAPI_SecurityOverride_PermissionAndRootRule checks the API side of server +// security overrides with one admin login and one login as an operator-role +// user. It covers the servers:security permission gate, the root rule and +// the per-cluster /security-settings switch that the root rule reads. +func TestAPI_SecurityOverride_PermissionAndRootRule(t *testing.T) { + t.Parallel() + + // The switch is shared with the operator E2E test; hold the lock for the + // whole test. Cleanups run in LIFO order, so the unlock is registered first. + securityRootSettingMu.Lock() + t.Cleanup(securityRootSettingMu.Unlock) + + ns := "gameplane-games" + suffix := strconv.FormatInt(time.Now().UnixNano()%1e10, 10) + tmpl := "e2e-sec-api-tmpl-" + suffix + gs := "e2e-sec-api-" + suffix + gsDenied := gs + "-denied" + roleName := "e2e-sec-role-" + suffix + + cpNS := securityControlPlaneNamespace(t) + setRootOverrideSwitch(t, cpNS, "false") + t.Cleanup(func() { + setRootOverrideSwitch(t, cpNS, "false") + }) + + envInstance.BootstrapAdmin(t, adminUsername, adminPassword) + admin := envInstance.APIClient(t, adminUsername, adminPassword) + defer admin.Close() + + // The switch starts off, is present, and is reported for the home cluster. + resp, body, err := admin.Get("/security-settings?cluster=local") + if err != nil { + t.Fatalf("GET /security-settings: %v", err) + } + _ = resp.Body.Close() + if resp.StatusCode != http.StatusOK { + t.Fatalf("GET /security-settings status=%d body=%s", resp.StatusCode, body) + } + var initial securitySettingsResponse + if err := json.Unmarshal(body, &initial); err != nil { + t.Fatalf("decode GET /security-settings: %v: %s", err, body) + } + if initial.Cluster != "local" || !initial.Present || initial.AllowRootOverrides { + t.Fatalf("GET /security-settings initial state = %+v, want local, present, off", initial) + } + + // An operator-level custom role: the server permissions an operator holds, + // without servers:security. The grant below adds servers:security to it. + roleResp, roleBody, err := admin.Post("/roles", map[string]any{ + "name": roleName, + "description": "Server writer for the security override test", + "permissions": []string{"servers:read", "servers:write"}, + }) + if err != nil { + t.Fatalf("create role: %v", err) + } + _ = roleResp.Body.Close() + if roleResp.StatusCode != http.StatusCreated { + t.Fatalf("create role status=%d body=%s", roleResp.StatusCode, roleBody) + } + t.Cleanup(func() { + r, _, _ := admin.Delete("/roles/" + roleName) + if r != nil { + _ = r.Body.Close() + } + }) + + userName, userPW, userID := envInstance.CreateUser(t, admin, roleName, "e2e-sec-api") + t.Cleanup(func() { + r, _, _ := admin.Delete("/users/" + userID) + if r != nil { + _ = r.Body.Close() + } + }) + user := envInstance.APIClient(t, userName, userPW) + defer user.Close() + + applyBusyboxTemplate(t, tmpl) + t.Cleanup(func() { + _ = envInstance.Dyn.Resource(gameServerGVR).Namespace(ns). + Delete(context.Background(), gs, metav1.DeleteOptions{}) + _ = envInstance.Dyn.Resource(gameServerGVR).Namespace(ns). + Delete(context.Background(), gsDenied, metav1.DeleteOptions{}) + }) + + // expect runs one API call, closes its response, checks the status and + // returns the body. + expect := func(what string, want int, do func() (*http.Response, []byte, error)) []byte { + t.Helper() + r, b, err := do() + if err != nil { + t.Fatalf("%s: %v", what, err) + } + _ = r.Body.Close() + if r.StatusCode != want { + t.Fatalf("%s: status=%d want=%d body=%s", what, r.StatusCode, want, b) + } + return b + } + + // Permission gate, without servers:security. Create and update that set a + // run-as override are refused; a plain create is accepted. + runAs := map[string]any{"runAsUser": map[string]any{"value": int64(1001)}} + expect("user create with override", http.StatusForbidden, func() (*http.Response, []byte, error) { + return user.Post("/servers", securityServerBody(ns, gsDenied, tmpl, runAs)) + }) + + r, b, err := user.Post("/servers", securityServerBody(ns, gs, tmpl, nil)) + if err != nil { + t.Fatalf("user create plain server: %v", err) + } + _ = r.Body.Close() + if r.StatusCode != http.StatusOK && r.StatusCode != http.StatusCreated { + t.Fatalf("user create plain server: status=%d body=%s", r.StatusCode, b) + } + + expect("user update with override", http.StatusForbidden, func() (*http.Response, []byte, error) { + return user.Do(http.MethodPut, "/servers/"+gs+"?namespace="+ns, securityServerBody(ns, gs, tmpl, runAs)) + }) + + // Grant servers:security to the role. The same user can now set an override. + expect("grant servers:security", http.StatusOK, func() (*http.Response, []byte, error) { + return admin.Patch("/roles/"+roleName, map[string]any{ + "permissions": []string{"servers:read", "servers:write", "servers:security"}, + }) + }) + + expect("granted user update with override", http.StatusOK, func() (*http.Response, []byte, error) { + return user.Do(http.MethodPut, "/servers/"+gs+"?namespace="+ns, securityServerBody(ns, gs, tmpl, runAs)) + }) + + // Root rule: a root value is refused while the cluster switch is off. + root := map[string]any{"fsGroup": map[string]any{"value": int64(0)}} + expect("root value with switch off", http.StatusForbidden, func() (*http.Response, []byte, error) { + return user.Do(http.MethodPut, "/servers/"+gs+"?namespace="+ns, securityServerBody(ns, gs, tmpl, root)) + }) + + // Admin turns the switch on for this cluster. The ConfigMap follows. + fb := expect("admin switch on", http.StatusOK, func() (*http.Response, []byte, error) { + return admin.Do(http.MethodPut, "/security-settings?cluster=local", map[string]any{"allowRootOverrides": true}) + }) + var on securitySettingsResponse + if err := json.Unmarshal(fb, &on); err != nil || !on.AllowRootOverrides || !on.Present { + t.Fatalf("PUT /security-settings on: body=%s err=%v", fb, err) + } + cm, err := envInstance.K8s.CoreV1().ConfigMaps(cpNS).Get(context.Background(), securitySwitchConfigMap, metav1.GetOptions{}) + if err != nil { + t.Fatalf("get switch ConfigMap: %v", err) + } + if got := cm.Data["allowRootOverrides"]; got != "true" { + t.Fatalf("switch ConfigMap allowRootOverrides=%q after PUT true, want \"true\"", got) + } + + expect("root value with switch on", http.StatusOK, func() (*http.Response, []byte, error) { + return user.Do(http.MethodPut, "/servers/"+gs+"?namespace="+ns, securityServerBody(ns, gs, tmpl, root)) + }) + + // Admin turns the switch off again. The ConfigMap follows. + expect("admin switch off", http.StatusOK, func() (*http.Response, []byte, error) { + return admin.Do(http.MethodPut, "/security-settings?cluster=local", map[string]any{"allowRootOverrides": false}) + }) + cm, err = envInstance.K8s.CoreV1().ConfigMaps(cpNS).Get(context.Background(), securitySwitchConfigMap, metav1.GetOptions{}) + if err != nil { + t.Fatalf("get switch ConfigMap: %v", err) + } + if got := cm.Data["allowRootOverrides"]; got != "false" { + t.Fatalf("switch ConfigMap allowRootOverrides=%q after PUT false, want \"false\"", got) + } + + // Audit: the flip and the refused root write are both recorded. + ar, ab, err := admin.Get("/admin/audit?limit=500") + if err != nil { + t.Fatalf("/admin/audit: %v", err) + } + _ = ar.Body.Close() + if ar.StatusCode != http.StatusOK { + t.Fatalf("/admin/audit status=%d body=%s", ar.StatusCode, ab) + } + for _, want := range []string{"security/local", "allowRootOverrides:false-", "security_root_disabled"} { + if !strings.Contains(string(ab), want) { + t.Errorf("audit log missing %q", want) + } + } +} diff --git a/test/e2e/buckets.sh b/test/e2e/buckets.sh index dafb23dd6..09c1f55d3 100755 --- a/test/e2e/buckets.sh +++ b/test/e2e/buckets.sh @@ -33,6 +33,9 @@ cd "$(dirname "$0")" # non-parallel tests first — inside the main bucket it would starve # everyone else's logins). +# Login tally (operator bucket): TestGameServer_SecurityOverrideAppliesOnRestart +# does zero logins. TestAPI_SecurityOverride_PermissionAndRootRule adds one +# e2e-admin login and one login as its own custom-role user (two logins). bucket_operator() { cat <<'EOF' TestHelmInstall_AllPodsReady TestHelmInstall_OperatorSecretNamespaceBoundary @@ -70,6 +73,7 @@ TestGameServer_CorrectedImageRecoversFailedOrdinal TestGameServer_RestoredRolloutRehearsal TestGameServer_WipeReportsFailureOnPermissionDenied TestGameServer_CascadingDelete +TestGameServer_SecurityOverrideAppliesOnRestart TestGameServer_LoadBalancerClassReplacesTheService TestGameServer_PortPoolAllocation TestGameServer_PortPoolServingAllocation @@ -121,6 +125,7 @@ TestAPI_I18n_LanguagePref TestAPI_I18n_NotifyLanguage TestAPI_I18n_NotifyTestSendRateLimit TestAPI_I18n_InstanceDefault +TestAPI_SecurityOverride_PermissionAndRootRule TestAPI_RBAC_MCPTokenReads TestE2E_ResticRepoReady TestCISelection_AgentOnlyChange diff --git a/test/e2e/gameserver_security_e2e_test.go b/test/e2e/gameserver_security_e2e_test.go new file mode 100644 index 000000000..2ebef386d --- /dev/null +++ b/test/e2e/gameserver_security_e2e_test.go @@ -0,0 +1,381 @@ +//go:build e2e + +package e2e + +import ( + "context" + "fmt" + "strconv" + "strings" + "sync" + "testing" + "time" + + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/types" +) + +// securityRootSettingMu serializes the tests that flip the per-cluster +// allow-root-overrides ConfigMap. One test's "on" window must never land +// inside another test's "off" assertion. Shared with +// api_security_override_e2e_test.go. +var securityRootSettingMu sync.Mutex + +// e2eHomeReleaseNamespace is the namespace the e2e suite installs the chart +// into (deploy/kind/e2e.sh, --namespace gameplane-system). +const e2eHomeReleaseNamespace = "gameplane-system" + +// securitySwitchConfigMap is the per-cluster root-override switch (brief 00 +// section 1). Helm creates it; the tests only patch it. +const securitySwitchConfigMap = "gameplane-security-settings" + +// securityControlPlaneNamespace returns the operator's +// --control-plane-namespace, which is where the switch ConfigMap lives. It is +// read from the home operator Deployment rather than assumed, because the +// chart derives it (for the e2e install: -credentials). +func securityControlPlaneNamespace(t *testing.T) string { + t.Helper() + d, err := envInstance.K8s.AppsV1().Deployments(e2eHomeReleaseNamespace). + Get(context.Background(), "gameplane-operator", metav1.GetOptions{}) + if err != nil { + t.Fatalf("get operator deployment: %v", err) + } + for _, c := range d.Spec.Template.Spec.Containers { + for _, a := range c.Args { + if v, ok := strings.CutPrefix(a, "--control-plane-namespace="); ok && v != "" { + return v + } + } + } + t.Fatalf("operator deployment has no --control-plane-namespace argument") + return "" +} + +// setRootOverrideSwitch patches allowRootOverrides on the switch ConfigMap +// with kubectl. The ConfigMap must already exist; the patch never creates it. +func setRootOverrideSwitch(t *testing.T, ns, value string) { + t.Helper() + patch := fmt.Sprintf(`{"data":{"allowRootOverrides":%q}}`, value) + out, err := envInstance.Kubectl(context.Background(), + "patch", "configmap", securitySwitchConfigMap, "-n", ns, "--type", "merge", "-p", patch) + if err != nil { + t.Fatalf("patch %s allowRootOverrides=%s: %v: %s", securitySwitchConfigMap, value, err, out) + } +} + +// applySecurityTemplate creates a busybox GameTemplate whose module default is +// fsGroup 1000. Cleanup deletes it. +func applySecurityTemplate(t *testing.T, name string) { + t.Helper() + tmpl := &unstructured.Unstructured{Object: map[string]any{ + "apiVersion": "gameplane.local/v1alpha1", + "kind": "GameTemplate", + "metadata": map[string]any{"name": name}, + "spec": map[string]any{ + "displayName": "E2E security (" + name + ")", + "game": "busybox", + "version": "1", + "image": "busybox:1.36", + "command": []any{"sh", "-c", "sleep 100000"}, + "ports": []any{ + map[string]any{"name": "noop", "containerPort": int64(12345), "advertise": true, "protocol": "TCP"}, + }, + "security": map[string]any{"fsGroup": int64(1000)}, + }, + }} + if _, err := envInstance.Dyn.Resource(gameTemplateGVR). + Create(context.Background(), tmpl, metav1.CreateOptions{}); err != nil && !apierrors.IsAlreadyExists(err) { + t.Fatalf("create template %s: %v", name, err) + } + t.Cleanup(func() { + _ = envInstance.Dyn.Resource(gameTemplateGVR). + Delete(context.Background(), name, metav1.DeleteOptions{}) + }) +} + +// createSecurityGameServer creates a GameServer on tmpl with an optional +// spec.security block. Cleanup deletes it. +func createSecurityGameServer(t *testing.T, ns, gs, tmpl string, security map[string]any) { + t.Helper() + spec := map[string]any{"templateRef": map[string]any{"name": tmpl}} + if security != nil { + spec["security"] = security + } + obj := &unstructured.Unstructured{Object: map[string]any{ + "apiVersion": "gameplane.local/v1alpha1", + "kind": "GameServer", + "metadata": map[string]any{"name": gs, "namespace": ns}, + "spec": spec, + }} + if _, err := envInstance.Dyn.Resource(gameServerGVR).Namespace(ns). + Create(context.Background(), obj, metav1.CreateOptions{}); err != nil { + t.Fatalf("create gameserver %s/%s: %v", ns, gs, err) + } + t.Cleanup(func() { + _ = envInstance.Dyn.Resource(gameServerGVR).Namespace(ns). + Delete(context.Background(), gs, metav1.DeleteOptions{}) + }) +} + +// getSecurityGameServer reads the GameServer. +func getSecurityGameServer(t *testing.T, ns, gs string) *unstructured.Unstructured { + t.Helper() + obj, err := envInstance.Dyn.Resource(gameServerGVR).Namespace(ns). + Get(context.Background(), gs, metav1.GetOptions{}) + if err != nil { + t.Fatalf("get gameserver %s/%s: %v", ns, gs, err) + } + return obj +} + +// patchSecurityGameServer applies a JSON merge patch to the GameServer. +func patchSecurityGameServer(t *testing.T, ns, gs, patch string) { + t.Helper() + if _, err := envInstance.Dyn.Resource(gameServerGVR).Namespace(ns). + Patch(context.Background(), gs, types.MergePatchType, []byte(patch), metav1.PatchOptions{}); err != nil { + t.Fatalf("patch gameserver %s/%s %s: %v", ns, gs, patch, err) + } +} + +// securityPending reports status.security.pending. +func securityPending(obj *unstructured.Unstructured) bool { + v, _, _ := unstructured.NestedBool(obj.Object, "status", "security", "pending") + return v +} + +// securityIDValue reads status.security...value, where which is +// "applied" or "desired". ok is false when no id is set (image default). +func securityIDValue(obj *unstructured.Unstructured, which, field string) (int64, bool) { + v, found, err := unstructured.NestedInt64(obj.Object, "status", "security", which, field, "value") + if err != nil || !found { + return 0, false + } + return v, true +} + +// expectedDesiredID is the id the operator resolved as the next start's value +// for field ("runAsUser" or "runAsGroup"). With no id set the container runs +// as the busybox image default, which is 0. +func expectedDesiredID(obj *unstructured.Unstructured, field string) string { + if v, ok := securityIDValue(obj, "desired", field); ok { + return strconv.FormatInt(v, 10) + } + return "0" +} + +// gameServerConditionState returns the status and reason of a condition, and +// whether it exists. +func gameServerConditionState(obj *unstructured.Unstructured, condType string) (status, reason string, found bool) { + conds, _, _ := unstructured.NestedSlice(obj.Object, "status", "conditions") + for _, c := range conds { + m, ok := c.(map[string]any) + if !ok || m["type"] != condType { + continue + } + s, _ := m["status"].(string) + r, _ := m["reason"].(string) + return s, r, true + } + return "", "", false +} + +// execID runs `id ` in the server pod's game container and returns the +// trimmed output. The container is named so kubectl prints no +// "Defaulted container" notice into the output. +func execID(t *testing.T, ns, pod, flag string) string { + t.Helper() + out, err := envInstance.Kubectl(t.Context(), "exec", "-n", ns, "pod/"+pod, "-c", "game", "--", "id", flag) + if err != nil { + t.Fatalf("exec id %s in %s: %v: %s", flag, pod, err, out) + } + return strings.TrimSpace(out) +} + +// waitPodGone waits until the named pod no longer exists. +func waitPodGone(t *testing.T, ns, pod string, timeout time.Duration) { + t.Helper() + envInstance.Eventually(t, timeout, func() (bool, string) { + _, err := envInstance.K8s.CoreV1().Pods(ns).Get(context.Background(), pod, metav1.GetOptions{}) + if apierrors.IsNotFound(err) { + return true, "" + } + return false, "pod " + pod + " still present" + }) +} + +// restartSecurityGameServer suspends and resumes the server (a full restart). +// It waits for the old pod to be gone, then for a new Ready game container. +// oldUID is the previous pod UID; the new pod must differ from it. +func restartSecurityGameServer(t *testing.T, ns, gs string, oldUID types.UID) *corev1.Pod { + t.Helper() + pod := gs + "-0" + patchSecurityGameServer(t, ns, gs, `{"spec":{"suspend":true}}`) + waitStatefulSetReplicas(t, ns, gs, 0, 3*time.Minute) + waitPodGone(t, ns, pod, 3*time.Minute) + patchSecurityGameServer(t, ns, gs, `{"spec":{"suspend":false}}`) + waitStatefulSetReplicas(t, ns, gs, 1, 3*time.Minute) + p := waitGameContainerReady(t, ns, pod, 4*time.Minute) + if oldUID != "" && p.UID == oldUID { + t.Fatalf("pod %s kept UID %s across a restart", pod, oldUID) + } + return p +} + +// TestGameServer_SecurityOverrideAppliesOnRestart walks one server through the +// override lifecycle with zero API logins: a run-as override applies on the +// next start (part 1), a change is pending until the next restart (part 2), +// and a root override is held by the per-cluster switch (part 3). +func TestGameServer_SecurityOverrideAppliesOnRestart(t *testing.T) { + t.Parallel() + + ns := "gameplane-games" + suffix := strconv.FormatInt(time.Now().UnixNano()%1e10, 10) + tmpl := "e2e-sec-restart-tmpl-" + suffix + gs := "e2e-sec-restart-" + suffix + pod := gs + "-0" + + applySecurityTemplate(t, tmpl) + + // Part 1: a run-as user override applies at the first start. The fsGroup + // comes from the module default and the gid stays off the override. + createSecurityGameServer(t, ns, gs, tmpl, map[string]any{ + "runAsUser": map[string]any{"value": int64(1001)}, + }) + first := waitGameContainerReady(t, ns, pod, 4*time.Minute) + + if got := execID(t, ns, pod, "-u"); got != "1001" { + t.Fatalf("part 1: id -u = %s, want 1001", got) + } + obj := getSecurityGameServer(t, ns, gs) + if got := execID(t, ns, pod, "-g"); got != expectedDesiredID(obj, "runAsGroup") { + t.Fatalf("part 1: id -g = %s, want the module/image default %s", got, expectedDesiredID(obj, "runAsGroup")) + } + if first.Spec.SecurityContext == nil || first.Spec.SecurityContext.FSGroup == nil || *first.Spec.SecurityContext.FSGroup != 1000 { + t.Fatalf("part 1: pod fsGroup is not the module default 1000: %+v", first.Spec.SecurityContext) + } + + // Part 2: a changed override does not touch the running pod. It is + // pending until the next restart. + patchSecurityGameServer(t, ns, gs, `{"spec":{"security":{"runAsUser":{"value":2001}}}}`) + envInstance.Eventually(t, 2*time.Minute, func() (bool, string) { + o := getSecurityGameServer(t, ns, gs) + if !securityPending(o) { + return false, "status.security.pending not yet true" + } + if v, ok := securityIDValue(o, "applied", "runAsUser"); !ok || v != 1001 { + return false, fmt.Sprintf("applied runAsUser = %d (ok=%v), want 1001", v, ok) + } + return true, "" + }) + cur, err := envInstance.K8s.CoreV1().Pods(ns).Get(context.Background(), pod, metav1.GetOptions{}) + if err != nil { + t.Fatalf("part 2: get pod: %v", err) + } + if cur.UID != first.UID { + t.Fatalf("part 2: pod UID changed on save: %s -> %s", first.UID, cur.UID) + } + + second := restartSecurityGameServer(t, ns, gs, first.UID) + envInstance.Eventually(t, time.Minute, func() (bool, string) { + if securityPending(getSecurityGameServer(t, ns, gs)) { + return false, "still pending after restart" + } + return true, "" + }) + if got := execID(t, ns, pod, "-u"); got != "2001" { + t.Fatalf("part 2: id -u after restart = %s, want 2001", got) + } + + // Remove the override and restart: the module default applies again. + patchSecurityGameServer(t, ns, gs, `{"spec":{"security":null}}`) + envInstance.Eventually(t, 2*time.Minute, func() (bool, string) { + if !securityPending(getSecurityGameServer(t, ns, gs)) { + return false, "pending not yet true after removing the override" + } + return true, "" + }) + third := restartSecurityGameServer(t, ns, gs, second.UID) + obj = getSecurityGameServer(t, ns, gs) + if got, want := execID(t, ns, pod, "-u"), expectedDesiredID(obj, "runAsUser"); got != want { + t.Fatalf("part 2: id -u after removing the override = %s, want the module default %s", got, want) + } + if third.UID == second.UID { + t.Fatalf("part 2: pod UID did not change on the final restart") + } + + // Part 3: a root override is held while the cluster switch is off. The + // switch is shared with the API test, so the lock covers the whole part. + securityRootSettingMu.Lock() + t.Cleanup(securityRootSettingMu.Unlock) + + cpNS := securityControlPlaneNamespace(t) + setRootOverrideSwitch(t, cpNS, "false") + t.Cleanup(func() { + // Restore the default under the same lock, before the unlock above. + setRootOverrideSwitch(t, cpNS, "false") + }) + + rootGS := gs + "-root" + createSecurityGameServer(t, ns, rootGS, tmpl, nil) + waitGameContainerReady(t, ns, rootGS+"-0", 4*time.Minute) + + patchSecurityGameServer(t, ns, rootGS, `{"spec":{"security":{"fsGroup":{"value":0}}}}`) + patchSecurityGameServer(t, ns, rootGS, `{"spec":{"suspend":true}}`) + waitStatefulSetReplicas(t, ns, rootGS, 0, 3*time.Minute) + waitPodGone(t, ns, rootGS+"-0", 3*time.Minute) + + // Start with the switch off: the server must stay at zero replicas. + patchSecurityGameServer(t, ns, rootGS, `{"spec":{"suspend":false}}`) + envInstance.Eventually(t, 2*time.Minute, func() (bool, string) { + o := getSecurityGameServer(t, ns, rootGS) + status, reason, found := gameServerConditionState(o, "SecurityAllowed") + if !found || status != "False" || reason != "RootOverrideDisallowed" { + return false, fmt.Sprintf("SecurityAllowed status=%q reason=%q found=%v", status, reason, found) + } + return true, "" + }) + envInstance.Consistently(t, 20*time.Second, 4*time.Second, func() (bool, string) { + ss, err := envInstance.K8s.AppsV1().StatefulSets(ns).Get(context.Background(), rootGS, metav1.GetOptions{}) + if err != nil { + return false, "get ss: " + err.Error() + } + if ss.Spec.Replicas == nil || *ss.Spec.Replicas != 0 { + return false, "replicas left zero while the switch is off" + } + return true, "" + }) + + // Switch on: the held server starts. + setRootOverrideSwitch(t, cpNS, "true") + started := waitGameContainerReady(t, ns, rootGS+"-0", 4*time.Minute) + + // Switch off again: the running pod keeps its UID and restart count. + restarts := gameContainerRestarts(started, "game") + setRootOverrideSwitch(t, cpNS, "false") + envInstance.Consistently(t, 20*time.Second, 4*time.Second, func() (bool, string) { + p, err := envInstance.K8s.CoreV1().Pods(ns).Get(context.Background(), rootGS+"-0", metav1.GetOptions{}) + if err != nil { + return false, "get pod: " + err.Error() + } + if p.UID != started.UID { + return false, fmt.Sprintf("pod UID changed %s -> %s after the switch flipped off", started.UID, p.UID) + } + if got := gameContainerRestarts(p, "game"); got != restarts { + return false, fmt.Sprintf("restart count changed %d -> %d", restarts, got) + } + return true, "" + }) +} + +// gameContainerRestarts returns the restart count of the named container. +func gameContainerRestarts(p *corev1.Pod, name string) int32 { + for _, cs := range p.Status.ContainerStatuses { + if cs.Name == name { + return cs.RestartCount + } + } + return -1 +} diff --git a/test/e2e/specs.md b/test/e2e/specs.md index 9c6ea9167..d06a5ae28 100644 --- a/test/e2e/specs.md +++ b/test/e2e/specs.md @@ -198,6 +198,21 @@ not an attachable CSI driver or multi-attach qualification. Unit/envtest regress cover stale worker/source identity, persisted budgets, delayed drainage, CSI abort/reclamation, retained/replaced content and raw snapshot-source rejection. +### Server security override acceptance + +Two tests in the `operator` bucket (`test/e2e/buckets.sh`) cover module security +defaults and per-server overrides. `TestGameServer_SecurityOverrideAppliesOnRestart` +(`gameserver_security_e2e_test.go`) uses zero API logins. It checks that an override +sets the uid of the running pod, that the change stays pending without changing the +pod UID until a restart, and that a root override does not start while the cluster +ConfigMap `gameplane-security-settings` is off, and starts once it is `"true"`. +`TestAPI_SecurityOverride_PermissionAndRootRule` (`api_security_override_e2e_test.go`) +uses one admin login and one login as a user with a custom role (`servers:read`, +`servers:write`, later granted `servers:security`). It checks the 403 without +`servers:security`, the 403 for a root value while the cluster setting is off and +the 200 once it is on (via `PUT /security-settings?cluster=local`), the ConfigMap +value after each flip, and the audit rows for the flip and the refusal. + ## Non-goals / boundaries - Does **not** replace the unit or envtest tiers for any other module — it exercises integration behavior, not the exhaustive branch coverage those tiers own (this module carries no `.testcoverage.yml` coverage gate). diff --git a/web/specs.md b/web/specs.md index 56396f044..116692196 100644 --- a/web/specs.md +++ b/web/specs.md @@ -1088,6 +1088,18 @@ Save fetches the latest server and applies only the changes from the original ba **Capture types (`src/types.ts`, built):** `CaptureConfiguration` (`{ enabled?, retentionSeconds? }`, mirrors `spec.capture` — `retentionSeconds` is bounded by the CRD's authoritative `+kubebuilder:validation:Minimum=60 / Maximum=604800` on `operator/api/v1alpha1/gameserver_types.go`'s `CaptureConfiguration.RetentionSeconds`, omit to use cluster default (86400)), `CaptureStatus` (mirrors `status.capture`: `ready`, `activeCapture`/`lastCaptureTime` typed nullable since the API's `formatOptionalTime` never omits the key), `CapturePhase` (`"Pending" | "Running" | "Completed" | "Failed" | "Expired"`), `NetworkCapture` (one capture record — merges the API's start/stop/list/get response shapes) and `NetworkCaptureList` (the `:captures` list envelope). All are implemented in the tree; the `CaptureWidget` component and `Captures` endpoint namespace are live (see Tabs and API Client sections above). +## Server security overrides (spec 030) + +One shared editor, `SecurityAdvanced` (`web/src/components/SecurityAdvanced.tsx`), edits `spec.security` on a GameServer: `runAsUser`, `runAsGroup` and `fsGroup` (each a whole number 0 to 4294967295, or "use image default" where the image's own user is kept) and `volumeOwnershipCheck` (`EveryStart` or `OnlyWhenWrong`). It shows each module default from the template's `spec.security` next to the override, the desired and applied values and the `pending` flag from `status.security`, and a root-override notice. It exports `isValidSecurityId`, `securityOverrideCount` and `securityIsValid`. The operator decides what applies; the component only edits the spec. Unset fields are left out of the payload, and an empty override is omitted entirely. + +Three places mount it: + +- **Create server wizard** (`web/src/routes/CreateServer.tsx`, Configure step): an "Advanced" section below the other fields. The Configure step cannot continue while a typed value is not a valid ID (`securityDraftValid`). Its `server.security.*` refusals show as a "Not created: security settings refused" error with the API's message. The section is read-only when the session lacks `servers:security` (`can(me, "servers:security", ...)`). +- **Server Settings, Security section** (`web/src/routes/tabs/settings/Security.tsx`, `SecuritySection`; registered in `web/src/routes/tabs/Settings.tsx` as the `security` section, with `Lock` icon): it wraps `SecurityAdvanced` in the settings draft. The section is read-only without `servers:security`, and the tab's Save footer applies it like any other section. Saving a changed `runAsUser` or `runAsGroup` on a server whose `status.security.applied` is set (it has already started, so it has data) opens a confirmation (`needsFileAccessWarning`): files written earlier keep their old owner, and saving does not restart the server. +- **Cluster Security panel** (`web/src/components/clusters/SecuritySettingsPanel.tsx`, mounted in `ClusterConfiguration.tsx` for every cluster): the cluster-wide `allowRootOverrides` switch. Without `config:read` the section shows a no-permission note instead of the switch, and the switch is editable only with `config:manage`. It reads and writes `GET`/`PUT /security-settings?cluster=` through `SecuritySettings` in `web/src/lib/endpoints.ts`. A 409 or the `server.cluster.security_settings_missing` message ID (or a response with `present: false`) shows a "Security settings missing" alert and disables the switch. Register Cluster (`RegisterClusterDialog.tsx`) has an optional control-plane namespace field (lowercase DNS label, default `gameplane`) sent as `controlPlaneNamespace` only when it differs from `gameplane`, and the cluster overview shows that namespace for remote clusters. + +Permission checks here are display only. The API and the operator enforce `servers:security` and the root rule. + ## External Interface / API Client **Three-layer client:** diff --git a/web/src/components/RegisterClusterDialog.tsx b/web/src/components/RegisterClusterDialog.tsx index 3b7e6a8dd..ae5a9c0d7 100644 --- a/web/src/components/RegisterClusterDialog.tsx +++ b/web/src/components/RegisterClusterDialog.tsx @@ -11,8 +11,11 @@ export function RegisterClusterDialog({ open, onOpenChange }: { open: boolean; o const [name, setName] = useState(""); const [displayName, setDisplayName] = useState(""); const [kubeconfig, setKubeconfig] = useState(""); + const [controlPlaneNamespace, setControlPlaneNamespace] = useState("gameplane"); + const trimmedNamespace = controlPlaneNamespace.trim(); + const namespaceValid = trimmedNamespace === "" || (/^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/.test(trimmedNamespace) && trimmedNamespace.length <= 63); const register = useMutation({ - mutationFn: () => Clusters.register({ name: name.trim(), displayName: displayName.trim(), kubeconfig }), + mutationFn: () => Clusters.register({ name: name.trim(), displayName: displayName.trim(), kubeconfig, controlPlaneNamespace: trimmedNamespace && trimmedNamespace !== "gameplane" ? trimmedNamespace : undefined }), onSuccess: async () => { setKubeconfig(""); onOpenChange(false); @@ -30,9 +33,15 @@ export function RegisterClusterDialog({ open, onOpenChange }: { open: boolean; o
setDisplayName(event.target.value)} />