Skip to content

Commit 5d1cb02

Browse files
committed
feat: make code signing mandatory
Profile signing is now a required part of the pint deployment rather than an opt-in feature. PINT_IPA_CODE_SIGNING_CA_NAME is now required at startup, the Helm chart requires codeSigningCAName, all conditional guards are removed, the IPA stub always initializes the code-signing CA, and the dev example config has the vars uncommented.
1 parent 148ed48 commit 5d1cb02

7 files changed

Lines changed: 21 additions & 32 deletions

File tree

.env.dev.example

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ PINT_IPA_SKIP_TLS_VERIFY=true
1919
#PINT_IPA_CERT_PROFILE=pint_wifi
2020
#PINT_IPA_RADSEC_CLIENT_CERT_PROFILE=pint_radsec_client
2121
#PINT_IPA_RADSEC_SERVER_CERT_PROFILE=pint_radsec_server
22-
# iOS mobileconfig signing — optional. Uncomment all three lines to enable.
23-
# Requires the code_signing CA to exist in the FreeIPA stub data dir; it is
24-
# created automatically on first run when this var is set.
25-
#PINT_IPA_CODE_SIGNING_CA_NAME=code_signing
22+
# iOS mobileconfig signing
23+
PINT_IPA_CODE_SIGNING_CA_NAME=code_signing
2624
#PINT_IPA_CODE_SIGNING_CERT_PROFILE=pint_profile_signing
27-
#PINT_PROFILE_SIGNING_CERT_SECRET=pint-profile-signing-cert
25+
PINT_PROFILE_SIGNING_CERT_SECRET=pint-profile-signing-cert
2826
PINT_WIFI_SSID=CSH
2927
PINT_NAMESPACE=pint
3028
PINT_CONFIG_SECRET=pint-config

chart/templates/deployment.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ spec:
7878
- name: PINT_RADIUS_STATUS_ADDR
7979
value: {{ .Values.config.radSecStatusAddr | quote }}
8080
{{- end }}
81-
{{- if .Values.config.codeSigningCAName }}
8281
- name: PINT_IPA_CODE_SIGNING_CA_NAME
8382
value: {{ .Values.config.codeSigningCAName | quote }}
8483
- name: PINT_PROFILE_SIGNING_CERT_SECRET
@@ -87,7 +86,6 @@ spec:
8786
- name: PINT_IPA_CODE_SIGNING_CERT_PROFILE
8887
value: {{ .Values.config.codeSigningCertProfile | quote }}
8988
{{- end }}
90-
{{- end }}
9189
- name: PINT_NAMESPACE
9290
valueFrom:
9391
fieldRef:

chart/templates/role.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ rules:
1515
- {{ include "pint.secretName.config" . | quote }}
1616
- {{ include "pint.secretName.radSecCert" . | quote }}
1717
- {{ include "pint.secretName.scepRACert" . | quote }}
18-
{{- if .Values.config.codeSigningCAName }}
1918
- {{ include "pint.secretName.profileSigningCert" . | quote }}
20-
{{- end }}
2119
verbs: ["get", "patch", "update"]
2220
- apiGroups: ["apps"]
2321
resources: ["deployments"]

chart/values.schema.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
},
102102
"codeSigningCAName": {
103103
"type": "string",
104-
"description": "FreeIPA CA name for the iOS mobileconfig code signing certificate. Leave empty to disable profile signing."
104+
"description": "FreeIPA CA name for the iOS mobileconfig code signing certificate."
105105
},
106106
"codeSigningCertProfile": {
107107
"type": "string",
@@ -118,7 +118,7 @@
118118
"description": "RadSec server address shown to users (e.g. radius.csh.rit.edu:2083)."
119119
}
120120
},
121-
"required": ["clientID", "serverURL", "ipaHost", "ipaServiceAccount", "ipaWirelessCAName", "ipaRadSecCAName", "wifiSSID", "radiusServer"]
121+
"required": ["clientID", "serverURL", "ipaHost", "ipaServiceAccount", "ipaWirelessCAName", "ipaRadSecCAName", "codeSigningCAName", "wifiSSID", "radiusServer"]
122122
},
123123
"secrets": {
124124
"type": "object",
@@ -134,7 +134,7 @@
134134
},
135135
"profileSigningCert": {
136136
"type": "string",
137-
"description": "Secret storing the iOS mobileconfig signing certificate and key. Defaults to '<fullname>-profile-signing-cert'. Only created when codeSigningCAName is set."
137+
"description": "Secret storing the iOS mobileconfig signing certificate and key. Defaults to '<fullname>-profile-signing-cert'."
138138
}
139139
}
140140
},

chart/values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ config:
3838
radSecStatusPort: "" # overrides the FreeRADIUS status server port (default: 18121)
3939
radSecStatusAddr: "" # overrides the status server address (host:port); useful in dev when pod IPs are unreachable
4040

41-
# iOS mobileconfig signing (optional — leave codeSigningCAName empty to disable)
42-
codeSigningCAName: ""
41+
# iOS mobileconfig signing
42+
codeSigningCAName: "code_signing"
4343
codeSigningCertProfile: "" # default: pint_profile_signing
4444

4545
# WiFi
@@ -64,7 +64,7 @@ envSecret: ""
6464
secrets:
6565
config: "" # default: <fullname>-config (clients.json, clients.conf, status-secret, status)
6666
radSecCert: "" # default: <fullname>-radsec-server-certificates (tls.crt, tls.key, ca.pem, wifi-ca.pem)
67-
profileSigningCert: "" # default: <fullname>-profile-signing-cert (tls.crt, tls.key); only created when codeSigningCAName is set
67+
profileSigningCert: "" # default: <fullname>-profile-signing-cert (tls.crt, tls.key)
6868
scepRACert: "" # default: <fullname>-scep-ra-cert (tls.crt, tls.key); auto-generated on first startup
6969

7070
service:

dev/freeipa-stub/main.go

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func main() {
4343
wifiCAName := flag.String("wifi-ca", getEnv("PINT_IPA_WIRELESS_CA_NAME", "wireless"), "FreeIPA CA name for WiFi certs (PINT_IPA_WIRELESS_CA_NAME)")
4444
radSecCAName := flag.String("radsec-ca", getEnv("PINT_IPA_RADSEC_CA_NAME", "radsec"), "FreeIPA CA name for RadSec certs (PINT_IPA_RADSEC_CA_NAME)")
4545
rootCAName := flag.String("root-ca", getEnv("PINT_IPA_ROOT_CA_NAME", "ipa"), "FreeIPA root CA name (PINT_IPA_ROOT_CA_NAME)")
46-
codeSigningCAName := flag.String("code-signing-ca", getEnv("PINT_IPA_CODE_SIGNING_CA_NAME", ""), "FreeIPA CA name for profile signing certs; leave empty to disable (PINT_IPA_CODE_SIGNING_CA_NAME)")
46+
codeSigningCAName := flag.String("code-signing-ca", getEnv("PINT_IPA_CODE_SIGNING_CA_NAME", "code_signing"), "FreeIPA CA name for profile signing certs (PINT_IPA_CODE_SIGNING_CA_NAME)")
4747
flag.Parse()
4848

4949
serialCounter.Store(time.Now().UnixNano())
@@ -81,7 +81,6 @@ func main() {
8181
// loadOrInitCAs loads persisted CA state from dir, or generates a fresh root +
8282
// intermediates and persists them. The CA names are the FreeIPA names PINT will
8383
// use and must match the corresponding env vars in .env.dev.
84-
// codeSigningCAName is optional: pass an empty string to skip that CA.
8584
func loadOrInitCAs(dir, wifiCAName, radSecCAName, rootCAName, codeSigningCAName string) (map[string]*caEntry, error) {
8685
root, err := loadOrCreateCA(dir, "root", "PINT Dev Root CA", nil)
8786
if err != nil {
@@ -95,23 +94,19 @@ func loadOrInitCAs(dir, wifiCAName, radSecCAName, rootCAName, codeSigningCAName
9594
if err != nil {
9695
return nil, fmt.Errorf("radsec CA: %w", err)
9796
}
97+
codeSigning, err := loadOrCreateCA(dir, "code_signing", "PINT Dev Code Signing CA", root)
98+
if err != nil {
99+
return nil, fmt.Errorf("code signing CA: %w", err)
100+
}
98101

99102
store := map[string]*caEntry{
100-
wifiCAName: wifi,
101-
radSecCAName: radsec,
102-
rootCAName: root,
103+
wifiCAName: wifi,
104+
radSecCAName: radsec,
105+
rootCAName: root,
106+
codeSigningCAName: codeSigning,
103107
}
104108

105-
if codeSigningCAName != "" {
106-
codeSigning, err := loadOrCreateCA(dir, "code_signing", "PINT Dev Code Signing CA", root)
107-
if err != nil {
108-
return nil, fmt.Errorf("code signing CA: %w", err)
109-
}
110-
store[codeSigningCAName] = codeSigning
111-
log.Printf("CA names: wifi=%q radsec=%q root=%q code_signing=%q", wifiCAName, radSecCAName, rootCAName, codeSigningCAName)
112-
} else {
113-
log.Printf("CA names: wifi=%q radsec=%q root=%q (code_signing disabled)", wifiCAName, radSecCAName, rootCAName)
114-
}
109+
log.Printf("CA names: wifi=%q radsec=%q root=%q code_signing=%q", wifiCAName, radSecCAName, rootCAName, codeSigningCAName)
115110

116111
return store, nil
117112
}

internal/config/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type Config struct {
4444
RadSecProxyProtocol bool // PINT_RADIUS_RADSEC_PROXY_PROTOCOL: expect HAProxy PROXY protocol header on RadSec connections (default false)
4545

4646

47-
// Apple profile signing (optional — enabled when CodeSigningCAName is set)
47+
// Apple profile signing
4848
CodeSigningCAName string // PINT_IPA_CODE_SIGNING_CA_NAME: FreeIPA intermediate CA for profile signing certs
4949
CodeSigningCertProfile string // PINT_IPA_CODE_SIGNING_CERT_PROFILE: FreeIPA profile for profile signing certs (default: pint_profile_signing)
5050
ProfileSigningCertSecret string // PINT_PROFILE_SIGNING_CERT_SECRET: K8s Secret storing the profile signing cert+key
@@ -113,7 +113,7 @@ func Load() (*Config, error) {
113113
cfg.IPACertProfile = optional("PINT_IPA_CERT_PROFILE", "pint_wifi")
114114
cfg.RadSecClientCertProfile = optional("PINT_IPA_RADSEC_CLIENT_CERT_PROFILE", "pint_radsec_client")
115115
cfg.RadSecServerCertProfile = optional("PINT_IPA_RADSEC_SERVER_CERT_PROFILE", "pint_radsec_server")
116-
cfg.CodeSigningCAName = os.Getenv("PINT_IPA_CODE_SIGNING_CA_NAME")
116+
cfg.CodeSigningCAName = require("PINT_IPA_CODE_SIGNING_CA_NAME")
117117
cfg.CodeSigningCertProfile = optional("PINT_IPA_CODE_SIGNING_CERT_PROFILE", "pint_profile_signing")
118118
cfg.ProfileSigningCertSecret = optional("PINT_PROFILE_SIGNING_CERT_SECRET", "pint-profile-signing-cert")
119119
cfg.SCEPRACertSecret = optional("PINT_SCEP_RA_CERT_SECRET", "pint-scep-ra-cert")

0 commit comments

Comments
 (0)