Skip to content

Latest commit

 

History

History
314 lines (216 loc) · 33.5 KB

README.md

File metadata and controls

314 lines (216 loc) · 33.5 KB

Security

This document describes the authentication, authorization, data-protection, input-validation, and secrets-management patterns used across OpenFrame OSS Tenant, and the code-review rules the organization enforces on this repository. OpenFrame OSS Tenant (flamingo-stack/openframe-oss-tenant) is the deployable, multi-service tenant platform: it assembles Spring Boot services, a Rust client, shared OpenFrame OSS Library modules, data stores, and Helm/Argo CD manifests. Most security behavior is implemented once in the upstream OpenFrame OSS Library and consumed here at pinned version 7.0.11 (Java) and v0.0.5 (Rust client); this repository is responsible for wiring that behavior into runnable services and Kubernetes manifests.

For how Flamingo AI handles vulnerability reports, disclosure timelines, and supported versions at the organization level, see SECURITY.md at the repository root. That policy, not this document, is the place to report a suspected vulnerability (email security@flamingo.run; do not open a public GitHub issue or discussion).

How Security Responsibility Is Split

flowchart LR
    Lib["OpenFrame OSS Library (7.0.11)"] --> SecCore["openframe-security-core"]
    Lib --> SecOauth["openframe-security-oauth"]
    Lib --> AuthzCore["openframe-authorization-service-core"]
    Lib --> GatewayCore["openframe-gateway-service-core"]
    Lib --> ApiCore["openframe-api-service-core"]
    Lib --> ClientCore["openframe-client-core"]
    SecCore --> Tenant["OpenFrame OSS Tenant services"]
    SecOauth --> Tenant
    AuthzCore --> Tenant
    GatewayCore --> Tenant
    ApiCore --> Tenant
    ClientCore --> Tenant
    Tenant --> Manifests["manifests/ (Helm + Argo CD)"]
    Tenant --> Configs["configs/base/*.yml"]
Loading
  • Authentication and token issuance (JWT signing/verification, OAuth2/OIDC flows, SSO, Apple native sign-in) are implemented in the library modules openframe-security-core, openframe-security-oauth, and openframe-authorization-service-core, and run inside this repository's openframe-authorization-server and openframe-gateway services.
  • Tenant isolation, request validation, and domain rules live mostly in openframe-api-lib and openframe-api-service-core, running inside openframe-api and openframe-external-api.
  • This repository owns the Spring Boot/Maven assembly (pom.xml), the shared runtime configuration (configs/base/*.yml), and the Kubernetes/Helm security posture (manifests/**). Reference details for each library module are in ../../reference/architecture/README.md and its per-module pages (for example ../../reference/architecture/openframe-security-core/openframe-security-core.md and ../../reference/architecture/openframe-security-oauth/openframe-security-oauth.md).

Because downstream consumers of this repository are not recorded in the ecosystem graph (coverage is partial), do not assume no other service depends on these published artifacts — absence of a listed consumer is not evidence of absence.


Authentication And Authorization Patterns

JWT Signing And Verification

openframe-security-core (com.openframe.oss:openframe-security-core:7.0.11) supplies the cryptographic foundation used across services:

  • JwtSecurityConfig exposes a jwtEncoder bean (RSA private+public key, wrapped as a Nimbus JWKSet) and a jwtDecoder bean (RSA public key only). Signing requires the private key; verification requires only the public key — the expected asymmetric boundary.
  • KeyConfig.toRSAPublicKey parses a PEM-encoded BEGIN PUBLIC KEY block into an RSAPublicKey via X.509 X509EncodedKeySpec. It throws on missing, malformed, or non-Base64 input, so key-loading failures surface as application startup failures rather than silent insecure fallbacks.
  • AccessDeniedObserver is a single-method extension seam (onAccessDenied(AccessDeniedException)) that lets a hosting service observe authorization failures (for logging, metrics, or audit) without coupling the core module to a specific response format.

The decoder shown in the library does not itself configure issuer, audience, or clock-skew validation — those controls must be added by the consuming Spring Security configuration. See ../../reference/architecture/openframe-security-core/openframe-security-core.md for the full component reference.

Shared JWT policy is set once for every service in configs/base/application.yml:

security:
  oauth2:
    token:
      access:
        expiration-seconds: 3600  # 10 minute
      refresh:
        expiration-seconds: 604800  # 1 week (7 * 24 * 60 * 60)
        max-refresh-count: 10080    # Maximum refreshes in a week (7 * 24 * 60)

Authorization Server (OAuth2 / OIDC)

openframe-authorization-service-core (consumed by openframe/services/openframe-authorization-server, bootstrapped by OpenFrameAuthorizationServerApplication) implements:

  • Two ordered Spring Security filter chains: an authorization-server chain (OAuth2/OIDC endpoints, custom grants, JWT support) and a default login chain (form login, external OIDC login, onboarding routes). CSRF is deliberately restricted to POST /login; CORS is disabled on the login chain.
  • Tenant-aware request processing: TenantForwardedPrefixFilter and UnknownTenantFilter run before Spring Security so a tenant-resolution failure becomes a clean 404 instead of a 500, including for the JWK endpoint.
  • Password authentication gated behind BCryptPasswordEncoder and ThrottlingAuthenticationManager, which enforces failed-login limits — password login is explicitly wired to this throttling manager so Spring Security cannot silently fall back to its default (non-throttled) manager.
  • Tenant-keyed JWKS: each tenant has its own active RSA signing key, resolved through a tenant key service, so JWT issuance and resource-server verification are tenant-scoped rather than shared across tenants.
  • Native mobile grants (Apple Sign-In, signup-ticket) that share the same minting pipeline (AbstractTokenMintingGrantProvider) as built-in grants, so custom grants get the same authorization persistence, claim shaping, and audit lifecycle.

Full detail is in ../../reference/architecture/openframe-authorization-service-core/openframe-authorization-service-core.md.

Code rule OPENFRAM-002-12 (active, severity error): Custom Spring Security AuthenticationProvider implementations must not be registered as a @Bean. Doing so makes Spring Boot treat it as the only provider on the global AuthenticationManager, silently breaking password logins with ProviderNotFoundException because the DaoAuthenticationProvider wired to UserDetailsService is bypassed. Construct custom providers inline inside the SecurityFilterChain bean and wire them directly through the DSL (for example tokenEndpoint(...).authenticationProvider(...)). This rule applies to **/*Config.java, **/*SecurityConfig.java, and **/*AuthenticationProvider.java.

Gateway-Level OAuth (Browser And Mobile BFF)

openframe-security-oauth (com.openframe.oss:openframe-security-oauth:7.0.11) runs inside openframe-gateway and implements the reactive /oauth/* endpoints: authorization start, callback, refresh, logout, native Apple exchange/registration, and single-use development/mobile handoff tickets. Key safety properties worth knowing when touching this area:

  • Redirect targets are resolved by RedirectTargetResolver against an explicit policy (relative paths, same-origin absolute URLs, or an exact openframe.gateway.redirect.allowed-uris allow-list) before any token-bearing ticket is attached — this is the gateway's open-redirect defense.
  • Refresh-token rejection and missing-credential rejection are deliberately handled differently: a rejected refresh token returns a plain 401 without clearing cookies, because with refresh-token rotation a concurrent stale request must not erase a newer cookie set by the request that won the race.
  • The in-memory development/mobile ticket store (InMemoryOAuthDevTicketStore) is single-use, TTL-bound (120 seconds by default), and process-local; deployments needing cross-instance ticket sharing must supply another OAuthDevTicketStore bean.
  • The controller is enabled only when openframe.gateway.oauth.enable is true, and native mobile endpoints are gated separately by openframe.gateway.oauth.mobile-auth-enabled.

See ../../reference/architecture/openframe-security-oauth/openframe-security-oauth.md for the complete endpoint and configuration reference, including the full property table (state-cookie TTL, dev-ticket TTL, signup/join fallback pages).

Service-To-Service Routing And Tenant Headers

configs/base/openframe-gateway.yml defines the gateway's internal routing table: /sas/** to the authorization server, /api-docs/** to the external API, /api/** to the internal API, /clients/** to the client service, and /** to the frontend. openframe-api-service-core's api-tenant-domain-provider component reads the gateway-supplied X-Tenant-Domain header to resolve the current tenant for API requests — this header is trusted because it is set by the gateway, not by the original client, so gateway routing must remain the single entry point for tenant-scoped traffic.

Code rule OPENFRAM-002-6 (active, severity error): Every MongoDB @Document class that stores per-tenant data must implement the TenantScoped marker interface (applies to **/document/**/*.java). This is the mechanism TenantAwareMongoTemplate uses to enforce tenant isolation at the repository layer; a document with a tenantId field that does not implement TenantScoped silently bypasses isolation checks. configs/base/application.yml also sets openframe.tenant-isolation.enabled: true, which this tenant-isolation mode requires — without it, Java services that depend on @TenantAwareRepository beans crash-loop at startup.

Agent (Client) Authentication

For devices and agents rather than human users, openframe-client-core's auth services issue short-lived machine tokens:

  • AccessTokenGenerator builds bearer tokens with issuer https://auth.openframe.com, the OAuth client ID as subject, the machine ID, grant type, and roles, using the security.oauth2.token.access.expiration-seconds lifetime from configs/base/application.yml.
  • RefreshTokenGenerator issues and rotates refresh tokens with a refresh_count claim, enforcing security.oauth2.token.refresh.max-refresh-count.
  • MachineTokenGuard is a positive-state check: when openframe.client.token.reject-deleted-machines is enabled, it refuses tokens for machines marked DELETED (mapped by the client to HTTP 410 Gone, final — stop retrying, uninstall) and for machines whose tenant is BLOCKED (403 Forbidden, retryable). Unknown machines or tenants are not rejected — only positive evidence triggers refusal.
  • AgentAuthAudit records failed device-authentication attempts once per grant-type/client-ID pair via AuditRecorder.recordOnce, and strips the agent_ prefix from client IDs before using them as the audit machine ID.

On the Rust client side, services-agent-auth (AgentAuthService) orchestrates initial authentication (client credentials) and reauthentication (refresh token first, falling back to client credentials on any refresh failure, including 401/403 rejection). It persists new token pairs via AgentConfigurationService.update_tokens and only then publishes the new access token to SharedTokenService, so a storage failure never advances the shared in-process token. See ../../reference/architecture/openframe-client-core-java/auth-services/auth-services.md and ../../reference/architecture/openframe-client-core/services-agent-auth/services-agent-auth.md.

sequenceDiagram
    participant Client as OpenFrame Client (agent)
    participant Guard as Machine Token Guard
    participant Gen as Access Token Generator
    participant Jwt as JWT Service

    Client->>Guard: Request token for machine ID
    alt Machine deleted
        Guard-->>Client: MachineDeletedException (410 Gone)
    else Tenant blocked
        Guard-->>Client: TenantBlockedException (403 Forbidden)
    else Allowed
        Guard->>Gen: Generate access token
        Gen->>Jwt: Sign claims with RSA private key
        Jwt-->>Gen: Signed JWT
        Gen-->>Client: Bearer access token
    end
Loading

Permission Checks On The Client Host

The Rust client's platform-permissions module (PermissionUtils) centralizes privilege detection and elevation across macOS, Linux, and Windows (root/euid, UAC ShellExecuteW, pkexec/sudo, osascript), and exposes a Capability enum (ManageServices, WriteSystemDirectories, ReadSystemLogs, WriteSystemLogs) so higher-level client code can check "do I have what I need" before attempting a privileged filesystem or service operation, instead of re-implementing OS-specific privilege logic. require_admin() terminates the process when elevation is required but unavailable, rather than continuing in a partially-privileged state. Details: ../../reference/architecture/openframe-client-core/platform-permissions/platform-permissions.md.


Data Encryption And Secure Storage

Symmetric Encryption Configuration

configs/base/application.yml defines shared encryption parameters used across services for at-rest or field-level encryption needs:

security:
  encryption:
    password: ${ENCRYPTION_PASSWORD:kdCJxik7VWRlG5L8jKHBeJQK5unssi7u1uHOd01b75ilr8n}
    salt: ${ENCRYPTION_SALT:74f62c51327175b05abe1ad78030565c}

Treat the inline defaults as development fallbacks only. ENCRYPTION_PASSWORD and ENCRYPTION_SALT must be supplied as real secrets (via Kubernetes secrets, a vault, or CI/CD secret injection) in any non-local environment. Never rely on the checked-in default value for a deployed tenant.

Asymmetric Key Material (JWT)

As described above, openframe-security-core's KeyConfig loads RSA key material from PEM-encoded configuration values. Operational guidance from the library documentation applies directly here:

  • Confirm the public and private keys belong to the same RSA key pair before deployment.
  • Never write private-key values to logs, metrics, exception messages, or generated configuration artifacts.
  • Define key-rotation and rollover behavior before replacing a key used by already-issued, still-valid tokens — the library's JWK source is immutable in-memory, so a key change requires rebuilding or reconfiguring the application context.

Session Storage

The authorization server persists HTTP sessions in Redis (SessionConfig), namespacing keys per deployment and tolerating stale serialized attributes across upgrades. Shared Redis cluster endpoints for all services are declared once in configs/base/application.yml:

spring:
  data:
    redis:
      cluster:
        nodes: ${REDIS_CLUSTER_NODES:redis-cluster-0.redis-cluster-headless.datasources.svc.cluster.local:6379,redis-cluster-1.redis-cluster-headless.datasources.svc.cluster.local:6379,redis-cluster-2.redis-cluster-headless.datasources.svc.cluster.local:6379}

Datastore Credentials

MongoDB connection details — including the embedded username/password — are centralized in the shared mongo-uri YAML anchor in configs/base/application.yml and referenced by every Mongo-backed service. As with the encryption password/salt, the inline credential in this file is a development default; production deployments must override spring.mongodb.uri with environment- or secret-sourced credentials rather than relying on the file's default.

Kubernetes Workload Hardening

Because this repository also owns the Helm/Argo CD manifests that run these services, a large share of the organization's "secure storage and secure execution" rules apply to manifests/** rather than to application code. The active, enforced rules (all severity error) are:

Rule ID Scope Requirement
OPENFRAM-005-4 manifests/**/*.yaml, manifests/**/*.yml Every Deployment/Pod sets podSecurityContext (runAsNonRoot: true, explicit runAsUser/runAsGroup/fsGroup, seccompProfile.type: RuntimeDefault) and container securityContext (runAsNonRoot: true, allowPrivilegeEscalation: false, capabilities.drop: [ALL], privileged: false, readOnlyRootFilesystem: true). openframe-saas services use UID/GID 1001; init containers use UID 100/GID 101.
OPENFRAM-005-18 manifests/**/*.yaml, manifests/**/*.yml Same hardened pair, stated again for workloads generally — rejects anything missing these fields.
OPENFRAM-006-8 manifests/**/*.yaml, manifests/**/*.yml Deployments, Jobs, and StatefulSets in Helm values need both blocks; runAsNonRoot: false or privileged: true is a violation.
OPENFRAM-009-7 manifests/**/*.yaml, manifests/**/*.yml Every openframe-saas-* service deployment specifically: runAsUser: 1001, runAsGroup: 1001, fsGroup: 1001 at pod level, plus the full container-level hardening.
OPENFRAM-009-9 manifests/**/*.yaml Every Deployment, Job, and init container — standard UID/GID 1001 for JVM services, 100/101 for curl-based init/job images.
OPENFRAM-009-12 manifests/**/values*.yaml Every workload values block (including registerJob, initImage, openframe-saas-config) must declare both security-context blocks with non-zero runAsUser/runAsGroup.

When adding or modifying a workload under manifests/, model the securityContext and podSecurityContext blocks on an existing, passing service in that same directory rather than starting from a blank Kubernetes example, and keep the UID/GID conventions above.

Code rule FLEETMDM-007 (active, severity error): In it-and-security/**/*.yml and *.yaml GitOps files, scripts, configuration profiles, policies, and reports must be declared as path: references relative to the YAML file's location — never as inline content. Secrets in these files must be referenced as environment-variable placeholders (for example $DOGFOOD_TESTING_AND_QA_ENROLL_SECRET), never as literal values.


Input Validation And Sanitization

Validation in this platform is layered, and the library documentation is explicit about where each layer lives:

  1. Transport-level structural validation — Bean Validation annotations on DTOs (for example in openframe-api-lib's CreateSoftwareBundleInput, which requires an action, bundle mode, and at least one machine identifier). Software-bundle machine identifiers are constrained to subject-safe tokens: only letters, digits, underscores, and hyphens.
  2. Domain-level contract validation — Pure validator classes separate from transport code, so the same rule can be reused by GraphQL, REST, and internal service calls. Examples:
    • DeviceLogArgumentContract / DeviceLogArgumentContract.prepare enforces: at least one usable machine or organization identifier; at most 50 distinct identifiers per resource type; at most five inclusion/exclusion terms, each capped at 256 UTF-16 code units; a time range that is ordered, does not exceed 30 days, and fits signed 64-bit epoch nanoseconds; and a cursor that decodes to a positive signed-long timestamp. Invalid input fails fast with an IllegalArgumentException carrying the first contract violation — it does not attempt partial processing.
    • ScriptPrivilegeValidator permits ELEVATED_USER privilege only when the supported platform list is exactly Windows.
    • ScriptTimeoutValidator rejects nonpositive timeouts and enforces a configured maximum from ScriptExecutionProperties.
    • OsUpdatePolicyValidator validates policy names, restart deadlines (1 second to 30 days), restart countdowns (60 seconds to 30 minutes), install windows, and release age (0–365 days), and rejects overlapping policy assignments.
  3. Domain-existence extension point — DomainExistenceValidator (interface) and DefaultDomainExistenceValidator (library fallback) intentionally separate the validation contract from its default behavior. The fallback is permissive: it returns false (no domain exists) for every input and is guarded by @ConditionalOnMissingBean, so it only activates when no tenant-specific validator bean is registered. This default must not be treated as a security control, anti-abuse control, or uniqueness guarantee. Any flow relying on domain ownership or uniqueness needs an application-specific DomainExistenceValidator bean backed by a trusted data source.

When adding a new API input in this ecosystem, prefer this same pattern: (a) Bean Validation for shape, (b) a dedicated validator class for cross-field and domain rules, (c) fail-fast with a clear error rather than silently clamping or dropping invalid fields.

Treat External Data As Untrusted

WindowsReleaseParser (OS-update policy support) treats a non-array response from the external endoflife.date release feed as broken input, not as an empty, valid release list — deliberately refusing to silently accept malformed external data as if it were legitimate. Apply the same posture to any new external integration: a parser should distinguish "valid and empty" from "malformed," and fail the latter rather than defaulting to an empty-but-accepted result.

Treat Request Headers As Trusted Only From the Gateway

api-tenant-domain-provider resolving tenant identity from the X-Tenant-Domain header (set in configs/base/openframe-gateway.yml) is safe specifically because the gateway is the only entry point that sets it for internal routes. Do not add new code paths that accept a tenant or identity header directly from an external client without passing through the gateway's routing and header-setting logic first.


Common Security Vulnerabilities And Mitigations

Risk Where it is mitigated in this ecosystem
Open redirect via OAuth callback or signup ticket RedirectTargetResolver in openframe-security-oauth enforces an explicit allow-list (relative paths, same-origin, exact openframe.gateway.redirect.allowed-uris entries) before any token-bearing value is attached to a redirect; signup/join-return flows separately require an exact native allow-list match.
Stale cookie overwritten by a losing concurrent refresh request Refresh-token rejection intentionally returns 401 without clearing cookies, so a stale concurrent request cannot erase a cookie set by the request that won a refresh race.
Tenant data leakage across tenants TenantScoped marker interface (enforced by code rule OPENFRAM-002-6) plus TenantAwareMongoTemplate and openframe.tenant-isolation.enabled: true; tenant-keyed JWKS so one tenant cannot verify tokens issued under another tenant's key.
Authentication bypass via misregistered AuthenticationProvider bean Code rule OPENFRAM-002-12 — custom providers must be wired inline in the SecurityFilterChain, never registered globally as a @Bean.
Privilege escalation / container breakout Kubernetes hardening rules (OPENFRAM-005-4, OPENFRAM-005-18, OPENFRAM-006-8, OPENFRAM-009-7, OPENFRAM-009-9, OPENFRAM-009-12) requiring non-root execution, dropped Linux capabilities, no privilege escalation, and read-only root filesystems across all manifests.
Secrets committed as literal values in GitOps configuration Code rule FLEETMDM-007 — secrets in it-and-security/**/*.yml must be environment-variable placeholders, never literals; scripts/profiles/policies referenced by relative path:, not inlined.
CI job with a push-capable credential operating on untrusted PR content Code rule REGISTRY-008-2 — actions/checkout steps in review/mine/sweep jobs must set persist-credentials: false.
Deleted device or blocked tenant continuing to obtain fresh tokens MachineTokenGuard checks machine/tenant status before token issuance (opt-in via openframe.client.token.reject-deleted-machines), mapping to 410 Gone (final) vs 403 Forbidden (retryable) so the client's retry behavior matches the actual failure class.
Malformed external data silently accepted as valid WindowsReleaseParser rejects a non-array upstream response outright rather than treating it as an empty list.
Credential/token leakage through logs Library documentation for services-agent-auth, auth-client, and models-agent-token-response repeatedly calls out: do not log credential values, refresh tokens, access tokens, or the full AgentTokenResponse with Debug formatting; error contexts should identify the failed stage without including secret material.
Duplicate/replayed audit noise masking real failures AgentAuthAudit.failed deduplicates failed device-authentication attempts using AuditRecorder.recordOnce keyed by grant type and client ID.

Security Testing And Code Review Guidelines

How Security Rules Are Enforced

This repository's automated review applies the organization's active rule catalog (summarized above) to every pull request. Rules are scoped by file glob and language — for example, Kubernetes hardening rules apply to manifests/**/*.yaml and manifests/**/*.yml, while the authentication-provider rule applies to **/*Config.java, **/*SecurityConfig.java, and **/*AuthenticationProvider.java. When changing a SecurityConfig, a custom AuthenticationProvider, a TenantScoped document, or anything under manifests/, expect these rules to be checked automatically, and align new code with the pattern an existing passing file already uses in the same directory.

What To Verify Before Submitting Security-Sensitive Changes

  • New or changed @Document classes holding tenant data: confirm they implement TenantScoped, not just a tenantId field.
  • New Kubernetes workload or Helm values block: confirm both podSecurityContext and container securityContext are present with the UID/GID convention used elsewhere in the same manifest tree (1001 for JVM services, 100/101 for curl-based init/job images).
  • New AuthenticationProvider: wire it inline inside the relevant SecurityFilterChain bean; do not add a @Bean method for it.
  • New GitOps YAML under it-and-security/: reference scripts/profiles/policies by relative path:, and secrets by environment-variable placeholder.
  • New CI job touching PR content: add persist-credentials: false to its actions/checkout step if the job reviews, mines, or sweeps untrusted content.
  • New external data integration: make sure the parser rejects malformed responses rather than silently defaulting to an empty-but-valid result.
  • Anything that logs an authentication object: check whether the type derives Debug/toString in a way that would print a token or credential, and avoid logging the full object.

Testing Services With Security Components

openframe-api's test profile (openframe/services/openframe-api/src/test/resources/application-test.yml) disables Mongo, Redis, Cassandra, and Kafka autoconfiguration and substitutes a test JWT secret (jwt.secret: test-secret-key) so authentication-adjacent code can be unit/integration tested without a live datastore or the production signing key. TestAuthenticationManager (openframe/services/openframe-api/src/test/java/com/openframe/api/util/TestAuthenticationManager.java) is a minimal AuthenticationManager that always throws BadCredentialsException, used to exercise failure paths deterministically in tests. When writing a new test for authentication-dependent code, follow this existing pattern: isolate the test from live datastores via the test profile, and use a dedicated throwing/stubbed authentication manager rather than wiring the real ThrottlingAuthenticationManager.

General testing conventions — how to run the Maven test suite, what openframe-test/openframe-test-service-core provide, and CI test gating — are covered in ../testing/README.md.

Dependency And CVE Hygiene

pom.xml pins several transitive dependencies above the versions pulled in by the Spring Boot BOM specifically to close HIGH/CRITICAL CVEs flagged by vulnerability scanning (Trivy), including jackson-bom, tomcat, freemarker, plexus-utils, bcprov-lts8on, libthrift, async-http-client, and lz4-java/at.yawk.lz4:lz4-java (the Kafka 4 fork, since kafka-clients 4 moved off the HIGH-CVE 1.10.1 line). When bumping a Spring Boot or Spring Cloud version, re-check whether these overrides are still needed — a newer BOM may already include the fix, or may reintroduce the vulnerable version and require the override to stay.

renovate.json intentionally narrows automated dependency updates: only com.openframe.oss:* Maven artifacts, the @flamingo-stack/openframe-frontend-core npm package, the pinned FleetMDM and MeshCentral Helm charts, and all dependencies under clients/openframe-client/** (grouped into one PR) are eligible for automated updates — every other Maven and Helm dependency is explicitly disabled from automated bumps ("enabled": false), by design, to keep the security-relevant override set in pom.xml under manual control.


Environment Variables And Secrets Management

Where Secrets And Environment-Driven Config Live

All shared, cross-service configuration (including every security-relevant default shown in this document) is defined once in configs/base/application.yml, with per-service overrides in configs/base/openframe-api.yml, configs/base/openframe-client.yml, configs/base/openframe-external-api.yml, configs/base/openframe-gateway.yml, and configs/base/openframe-management.yml. Each Spring Boot service's own application.yml (for example openframe/services/openframe-api/src/main/resources/application.yml) only sets spring.application.name and imports the shared config server:

spring:
  application:
    name: openframe-api
  config:
    import: "optional:configserver:${SPRING_CONFIG_URL:http://openframe-config.microservices.svc.cluster.local:8888}"

This means the secure-by-default posture of a new service is largely inherited from configs/base/application.yml automatically — a new service should not redeclare encryption, Redis, Mongo, or OAuth2 token settings locally unless it needs to override them.

Environment Variable Conventions

Secrets and environment-specific values in configs/base/*.yml consistently use the Spring ${VAR_NAME:default} placeholder pattern, for example:

openframe:
  cluster-id: ${OPENFRAME_CLUSTER_ID:cluster-id}

security:
  encryption:
    password: ${ENCRYPTION_PASSWORD:kdCJxik7VWRlG5L8jKHBeJQK5unssi7u1uHOd01b75ilr8n}
    salt: ${ENCRYPTION_SALT:74f62c51327175b05abe1ad78030565c}

The inline default values exist so the stack can start in a local/developer environment without external secret provisioning. They must be overridden with real, environment-specific secrets in any environment that stores or processes real tenant data. For the Kubernetes/Helm layer, override these through environment-specific values files or Kubernetes Secret objects referenced from the relevant chart under manifests/, following the GitOps convention already used for FleetMDM configuration (FLEETMDM-007): reference secrets as environment-variable placeholders, never as literal values checked into YAML.

Rust Client Secrets

The client build itself requires an environment variable at build time rather than at runtime:

OPENFRAME_VERSION=0.0.0-dev cargo build --release

This is a build-identity value, not a credential, but it illustrates the same convention: configuration that varies by build or deployment is supplied through the environment rather than hardcoded in clients/openframe-client/src/main.rs, which is intentionally a thin entry point delegating to the shared openframe library crate (openframe_agent_lib, from OpenFrame OSS Library).

At runtime, the client's token and credential lifecycle (AgentConfigurationService, services-agent-auth) persists client credentials and refresh tokens through the client's own configuration store rather than environment variables; see ../../reference/architecture/openframe-client-core/services-agent-auth/services-agent-auth.md for the persistence contract (tokens are saved before the shared in-process token is updated, so a storage failure cannot leave the process using a token it failed to persist).

Checklist For Adding A New Secret-Backed Property

  1. Add it to configs/base/application.yml (or the relevant per-service file) using ${ENV_VAR:dev-default}, matching the existing style.
  2. Pick a clearly non-production-looking default, or omit the default entirely if a missing value should fail startup rather than silently run insecurely.
  3. Confirm the corresponding Kubernetes manifest under manifests/ supplies the environment variable from a Secret, not a plaintext ConfigMap value, for any deployed environment.
  4. If the value is a credential or key referenced from GitOps YAML under it-and-security/, use the $ENV_VAR placeholder form required by rule FLEETMDM-007.
  5. Never log the resolved value; prefer logging only whether the property was supplied or defaulted.

Related Reading

For the broader request/authentication flow across services (gateway routing, authorization server, API service), see ../../reference/architecture/README.md. For the environment variables needed to run this stack locally, see ../setup/environment.md and ../setup/local-development.md. For the overall module index and how openframe-api-lib, openframe-security-core, and openframe-security-oauth relate to one another, see ../../reference/architecture/ecosystem.md. For contribution conventions that complement the rules in this document, see ../contributing/guidelines.md.