Skip to content

Commit 5f2592b

Browse files
authored
docs(service-security): narrow scope to unprivileged proxy sidecars
The module and function JSDoc now explicitly name the three proxy sidecars (api-proxy, cli-proxy, doh-proxy) this helper targets and call out that squid-service and agent-service have different hardening requirements and should not use it.
1 parent a1b9945 commit 5f2592b

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

src/services/service-security.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
/**
2-
* Shared container security-hardening helpers.
2+
* Security-hardening helpers for unprivileged proxy sidecar containers.
3+
*
4+
* This module centralises the `cap_drop`, `security_opt`, and resource-limit
5+
* fields shared by the lightweight proxy sidecars (api-proxy, cli-proxy,
6+
* doh-proxy) that run without any Linux capabilities.
7+
*
8+
* Note: other services such as `squid-service` and `agent-service` have
9+
* different hardening requirements (custom cap_drop sets, seccomp profiles,
10+
* AppArmor options) and should NOT use this helper.
311
*
4-
* Centralises the `cap_drop`, `security_opt`, and resource-limit fields that
5-
* must be applied uniformly to every sidecar service built by the firewall.
612
* Using a single helper means a future hardening change (e.g. adding
7-
* `read_only: true`) propagates to all sidecars automatically.
13+
* `read_only: true`) propagates to all three proxy sidecars automatically.
814
*/
915

1016
interface ContainerResourceLimits {
@@ -20,10 +26,11 @@ interface ContainerResourceLimits {
2026
}
2127

2228
/**
23-
* Returns the standard security-hardening fields for a sidecar service.
29+
* Returns the standard security-hardening fields for an unprivileged proxy
30+
* sidecar (api-proxy, cli-proxy, doh-proxy).
2431
*
25-
* The `cap_drop` and `security_opt` values are identical for every sidecar;
26-
* only the resource limits vary per service.
32+
* `cap_drop: ['ALL']` and `security_opt: ['no-new-privileges:true']` are
33+
* fixed; resource limits are caller-supplied because they differ per service.
2734
*
2835
* @example
2936
* ```ts

0 commit comments

Comments
 (0)