Skip to content

Commit b573610

Browse files
committed
fix(coserv): expiry + config refactor
- Update to v0.2.1 of corim-store that implements MaxExpiry, which is used when CoRIMs do not specify validity, and serves as a maximum limit on expiry when they do. - In order allow configuration of MaxExpiry, refactor how configuration for CoSERV is handled inside VTS: - Create CoservContext which contains configuration for CoSERVService prior to its creation, and also contains the signer (which is not part of the service, but is related to it). - Configuration for the context is taken from "coserv" section of config files (the same as the front-end: all coserv-related configuration is now in the same place in the config tree). Configuration for the signer is moved to "signer" sub-section under it. - FallbackAuthority for the service is now configured based on the signer's public key, rather than being hard-coded to a nonsense value. Signed-off-by: Sergei Trofimov <sergei.trofimov@arm.com>
1 parent 21ec232 commit b573610

17 files changed

Lines changed: 275 additions & 65 deletions

File tree

coserv/cmd/coserv-service/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func main() {
6565

6666
log.Infow("Initializing Endorsement Distribution Service", "version", config.Version)
6767

68-
loader := config.NewLoader(&cfg)
68+
loader := config.NewNonExclusiveLoader(&cfg)
6969
if err := loader.LoadFromViper(subs["coserv"]); err != nil {
7070
log.Fatalf("Could not load coserv config: %v", err)
7171
}

deployments/docker/src/config.yaml.template

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ coserv:
2323
protocol: https
2424
cert: /opt/veraison/coserv.crt
2525
cert-key: /opt/veraison/coserv.key
26-
coserv-signer:
27-
key: /opt/veraison/coserv-signer.jwk
26+
max-expiry: 5 mins
27+
signer:
28+
alg: ES256
29+
key: /opt/veraison/coserv-signer.jwk
2830
vts:
2931
server-addr: vts-service:${VTS_PORT}
3032
tls: true

deployments/docker/src/vts.docker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ RUN mkdir -p --mode=0775 stores/vts
4141
ADD --chown=veraison:nogroup plugins plugins
4242
ADD --chown=veraison:veraison --chmod=0660 stores/* stores/vts
4343
ADD --chown=veraison:nogroup config.yaml skey.jwk vts-service service-entrypoint \
44-
certs/vts.crt certs/vts.key ./
44+
certs/vts.crt certs/vts.key coserv-signer.jwk ./
4545

4646

4747
ENTRYPOINT ["/opt/veraison/service-entrypoint"]

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ require (
4141
github.com/veraison/ccatoken v1.3.2-0.20250512122414-b26aba0635c4
4242
github.com/veraison/cmw v0.2.0
4343
github.com/veraison/corim v1.1.3-0.20260430132037-b8653a7359da
44-
github.com/veraison/corim-store v0.1.0
44+
github.com/veraison/corim-store v0.2.1
4545
github.com/veraison/dice v0.0.1
4646
github.com/veraison/ear v1.1.4-0.20260213122616-3034258cda59
4747
github.com/veraison/eat v0.0.0-20220117140849-ddaf59d69f53

go.sum

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,8 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN
893893
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
894894
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
895895
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
896+
github.com/google/go-configfs-tsm v0.3.2 h1:ZYmHkdQavfsvVGDtX7RRda0gamelUNUhu0A9fbiuLmE=
897+
github.com/google/go-configfs-tsm v0.3.2/go.mod h1:EL1GTDFMb5PZQWDviGfZV9n87WeGTR/JUg13RfwkgRo=
896898
github.com/google/go-sev-guest v0.14.2-0.20251119154202-af1c107a648f h1:UVLafZ3h85JE5e0QU5dUixIJa2PO5G51THLMuXrtnTw=
897899
github.com/google/go-sev-guest v0.14.2-0.20251119154202-af1c107a648f/go.mod h1:SK9vW+uyfuzYdVN0m8BShL3OQCtXZe/JPF7ZkpD3760=
898900
github.com/google/go-tpm v0.1.2-0.20190725015402-ae6dd98980d4/go.mod h1:H9HbmUG2YgV/PHITkO7p6wxEEj/v5nlsVWIwumwH2NI=
@@ -1260,8 +1262,8 @@ github.com/veraison/cmw v0.2.0 h1:BWEvwZnD4nn5osq6XwQpTRcGxwV+Su4t6ytdAbVXAJY=
12601262
github.com/veraison/cmw v0.2.0/go.mod h1:OiYKk1t6/Fmmg30ZpSMzi4nKr5kt3374sNTkgxC5BDs=
12611263
github.com/veraison/corim v1.1.3-0.20260430132037-b8653a7359da h1:HY6eZqJXjTIs0jQ3W47Aj+AzMitmR/Jjx5lld58yE48=
12621264
github.com/veraison/corim v1.1.3-0.20260430132037-b8653a7359da/go.mod h1:tB4fHouhmQBL8JIt8TkYviA/xmmUBAWruwrR5YBHvn0=
1263-
github.com/veraison/corim-store v0.1.0 h1:zu7kYtvnle01PHz6UKB2SfVypcZV6bWPHpDBBvxkwLk=
1264-
github.com/veraison/corim-store v0.1.0/go.mod h1:eU8AECLQL+GQpEYksKDlom3HHXWzo/M6qR2gHXjjnR4=
1265+
github.com/veraison/corim-store v0.2.1 h1:i2Sa/WCWhIQBt3kalYa0yIjUBIGXrl2TamEDVoKqS+0=
1266+
github.com/veraison/corim-store v0.2.1/go.mod h1:eU8AECLQL+GQpEYksKDlom3HHXWzo/M6qR2gHXjjnR4=
12651267
github.com/veraison/dice v0.0.1 h1:dOm7ByDN/r4WlDsGkEUXzdPMXgTvAPTAksQ8+BwBrD4=
12661268
github.com/veraison/dice v0.0.1/go.mod h1:QPMLc5LVMj08VZ+HNMYk4XxWoVYGAUBVm8Rd5V1hzxs=
12671269
github.com/veraison/ear v1.1.4-0.20260213122616-3034258cda59 h1:tynt7VXUc7uVAsN3RyWySaAJZpdQv0Eyru+7Wgwi72s=

vts/cmd/vts-service/config-docker.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ vts:
2424
ear-signer:
2525
alg: ES256
2626
key: ./skey.jwk
27-
coserv-signer:
28-
use: true
29-
alg: ES256
30-
key: ./skey.jwk
27+
coserv:
28+
max-expiry: 5 mins
29+
signer:
30+
alg: ES256
31+
key: ./skey.jwk
3132
logging:
3233
level: debug

vts/cmd/vts-service/config.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ vts:
2626
ear-signer:
2727
alg: ES256
2828
key: ./skey.jwk
29-
coserv-signer:
30-
use: true
31-
alg: ES256
32-
key: ./skey.jwk
29+
coserv:
30+
max-expiry: 5 mins
31+
signer:
32+
alg: ES256
33+
key: ./skey.jwk
3334
logging:
3435
level: debug
3536
# Scheme configuration Example

vts/cmd/vts-service/main.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"github.com/veraison/services/log"
1717
"github.com/veraison/services/plugin"
1818
"github.com/veraison/services/policy"
19-
"github.com/veraison/services/vts/coservsigner"
19+
"github.com/veraison/services/vts/coserv"
2020
"github.com/veraison/services/vts/earsigner"
2121
"github.com/veraison/services/vts/policymanager"
2222
"github.com/veraison/services/vts/store"
@@ -32,7 +32,7 @@ func main() {
3232
}
3333

3434
subs, err := config.GetSubs(v, "store", "po-store",
35-
"*po-agent", "plugin", "*vts", "ear-signer", "*coserv-signer", "*logging", "*scheme")
35+
"*po-agent", "plugin", "*vts", "ear-signer", "*coserv", "*logging", "*scheme")
3636
if err != nil {
3737
log.Fatal(err)
3838
}
@@ -146,13 +146,11 @@ func main() {
146146
log.Fatalf("EAR signer initialization failed: %v", err)
147147
}
148148

149-
var coservSigner coservsigner.ICoservSigner
150-
151-
if subs["coserv-signer"].GetBool("use") {
152-
log.Info("loading CoSERV signer")
153-
coservSigner, err = coservsigner.New(subs["coserv-signer"], afero.NewOsFs())
149+
var coservContext *coserv.Context
150+
if subs["coserv"].IsSet("signer") {
151+
coservContext, err = coserv.NewCoservContextFromViper(subs["coserv"])
154152
if err != nil {
155-
log.Fatalf("CoSERV signer initialization failed: %v", err)
153+
log.Fatal("CoSERV config initialization: %v", err)
156154
}
157155

158156
// CoSERV media types.
@@ -165,7 +163,7 @@ func main() {
165163
// policyManager and earSigner are owned by vts
166164
vts := trustedservices.NewGRPC(enStore,
167165
schemePluginManager, coservProxyPluginManager,
168-
policyManager, earSigner, coservSigner, log.Named("vts"))
166+
policyManager, earSigner, coservContext, log.Named("vts"))
169167

170168
if err = vts.Init(subs["vts"]); err != nil {
171169
log.Fatalf("VTS initialisation failed: %v", err)
File renamed without changes.

0 commit comments

Comments
 (0)