Skip to content

Commit bb9779d

Browse files
committed
Get SAS running
1 parent 4acd7df commit bb9779d

5 files changed

Lines changed: 18 additions & 23 deletions

File tree

src/aou-sas/docker-compose.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,17 @@ services:
1818
# SAS startup script — invoked via PRE_DEPLOY_SCRIPT before SAS
1919
# services start. Must NOT mount at /tmp/pre_deploy.sh because
2020
# the entrypoint overwrites that path with the env var content.
21-
- ./sas-startup.sh:/opt/sas/aou/sas-startup.sh:ro
22-
# Fallback license mount for manual GCE testing without Mikey Secrets.
23-
# With Mikey Secrets, the entrypoint wrapper populates /sasinside/ from
24-
# the SAS_LICENSE_PATH file descriptor instead.
25-
- ./sasinside:/sasinside
21+
- ./sas-pre-deploy.sh:/opt/sas/aou/sas-pre-deploy.sh:ro
22+
- ./sas-post-deploy.sh:/opt/sas/aou/sas-post-deploy.sh:ro
2623
tmpfs:
2724
- /data/workspace:uid=1002,gid=1100
2825
environment:
2926
HOST_AUTH: ""
3027
SAS_DEBUG: "0"
3128
SASLICENSEFILE: "SASLicense.jwt"
3229
GOMEMLIMIT: "20MiB"
33-
PRE_DEPLOY_SCRIPT: "bash /opt/sas/aou/sas-startup.sh"
30+
PRE_DEPLOY_SCRIPT: "bash /opt/sas/aou/sas-pre-deploy.sh"
31+
POST_DEPLOY_SCRIPT: "bash /opt/sas/aou/sas-post-deploy.sh"
3432
JAVA_OPTION_SAS_COMMONS_WEB_SECURITY_CORS_ALLOWEDORIGINS: "-Dsas.commons.web.security.cors.allowedOrigins=*"
3533
JAVA_OPTION_SAS_COMMONS_WEB_SECURITY_CORS_ALLOWCREDENTIALS: "-Dsas.commons.web.security.cors.allowCredentials=false"
3634
JAVA_OPTION_SAS_COMMONS_WEB_SECURITY_CORS_ALLOWEDHEADERS: "-Dsas.commons.web.security.cors.allowedHeaders=*"

src/aou-sas/sas-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if [ -n "${SAS_LICENSE_PATH:-}" ]; then
1313
mkdir -p /sasinside
1414
cp "$SAS_LICENSE_PATH" /sasinside/SASLicense.jwt
1515
chmod 400 /sasinside/SASLicense.jwt
16-
chown root:root /sasinside/SASLicense.jwt
16+
chown sas:sas /sasinside/SASLicense.jwt
1717
fi
1818

1919
exec /opt/sas/viya/home/bin/sas-analytics-pro-entrypoint.sh "$@"

src/aou-sas/sas-post-deploy.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
# sas-post-deploy.sh — Lock down the SAS license after it has been applied.
3+
#
4+
# Invoked via POST_DEPLOY_SCRIPT after SAS services start. The license must
5+
# be readable by the sas user during application (PRE_DEPLOY), but afterward
6+
# we restrict it to root so the aou user cannot exfiltrate it via pipe commands.
7+
8+
if [ -f /sasinside/SASLicense.jwt ]; then
9+
chmod 400 /sasinside/SASLicense.jwt
10+
chown root:root /sasinside/SASLicense.jwt
11+
fi
Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
2-
# sas-startup.sh — Runtime setup for SAS Analytics Pro on VWB GCE.
2+
# sas-pre-deploy.sh — Runtime setup for SAS Analytics Pro on VWB GCE.
33
#
4-
# Mounted at /opt/sas/aou/sas-startup.sh and invoked via PRE_DEPLOY_SCRIPT
4+
# Mounted at /opt/sas/aou/sas-pre-deploy.sh and invoked via PRE_DEPLOY_SCRIPT
55
# before SAS services start. Only handles steps that depend on the /data
66
# volume or runtime state; build-time setup is in the Dockerfile.
77
#
@@ -17,16 +17,6 @@ set -o pipefail
1717
mkdir -p /data/saswork /data/utilloc
1818
chown -R aou:aougroup /data
1919

20-
###############################################################################
21-
# Lock down the SAS license so the aou user cannot read it via pipe commands.
22-
# The entrypoint wrapper already sets root:root 0400 for Mikey Secrets, but
23-
# this covers the bind-mount fallback and acts as defence in depth.
24-
###############################################################################
25-
if [ -f /sasinside/SASLicense.jwt ]; then
26-
chown root:root /sasinside/SASLicense.jwt
27-
chmod 400 /sasinside/SASLicense.jwt
28-
fi
29-
3020
###############################################################################
3121
# AoU environment loader (staged in Dockerfile at /opt/sas/aou/)
3222
###############################################################################

src/aou-sas/sasinside/.gitignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)