Skip to content

Commit db2b94f

Browse files
committed
R2025a Prerelease: Secure Access Control using JWT - Initial Commit
1 parent 7784b42 commit db2b94f

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

releases/R2025a/matlab-prodserver/templates/mps-2-configmap.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ data:
4343
--enable-discovery
4444
--enable-metrics
4545
--routes-file ./config/routes.json
46+
{{- if .Values.matlabProductionServerSettings.accessControl.enabled }}
47+
--access-control-provider OAuth2
48+
--access-control-config ./config/jwt_idp.json
49+
--access-control-policy ./config/ac_policy.json
50+
51+
jwt_idp.json: {{ .Values.matlabProductionServerSettings.accessControl.identityProvider | quote }}
52+
53+
ac_policy.json: {{ .Values.matlabProductionServerSettings.accessControl.policyRules | quote }}
54+
{{- end }}
4655

4756
{{- if .Values.optionalSettings.Redis.host }}
4857
mps_cache_config: |

releases/R2025a/matlab-prodserver/values.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,49 @@ matlabProductionServerSettings:
4646
# =================================================================
4747
# Maximum number of worker processes (per pod).
4848
numWorkers: 2
49+
#
50+
# CTF Access Control (OAuth2)
51+
# https://www.mathworks.com/help/mps/server/access_control.html
52+
# -------------------------------------------------------------
53+
accessControl:
54+
enabled: false
55+
identityProvider: |-
56+
{
57+
"version": "1.0.0",
58+
"jwtIssuer": "URL of the authorization server that issued the JWT",
59+
"appId": "String representing the application ID of the client",
60+
"jwksUri": "URL of the authorization server public keys",
61+
"jwksStrictSSL": false,
62+
"jwksTimeOut": 120,
63+
"userAttributeName": "email",
64+
"groupAttributeName": "groups"
65+
}
66+
policyRules: |-
67+
{
68+
"version": "1.0.0",
69+
"policy" : [
70+
{
71+
"id": "policy1",
72+
"description": "Access Control policy for MATLAB Production Server",
73+
"rule": [
74+
{
75+
"id": "rule1",
76+
"description": "Users that can execute/modify any deployable archive",
77+
"subject": { "users": ["[email protected]", "[email protected]"] },
78+
"resource": { "ctf": ["*"] },
79+
"action": ["execute", "modify"]
80+
},
81+
{
82+
"id": "rule2",
83+
"description": "Groups that can execute a specific deployable archive",
84+
"subject": { "groups": ["aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"] },
85+
"resource": { "ctf": ["myModel"] },
86+
"action": ["execute"]
87+
}
88+
]
89+
}
90+
]
91+
}
4992
# ----------------------------------------------------
5093
# Log to pod-local file-system (in addition to stdout)
5194
localFileLogging: false

0 commit comments

Comments
 (0)