diff --git a/build-an-deploy.sh b/build-an-deploy.sh index 1b468e227..4cff36de0 100755 --- a/build-an-deploy.sh +++ b/build-an-deploy.sh @@ -19,7 +19,7 @@ WEBTOP_TAG=$(cat helm/wrongsecrets-ctf-party/values.yaml| yq '.virtualdesktop.ta echo "Pulling in required images to actually run $WRONGSECRETS_IMAGE:$WRONGSECRETS_TAG & $WEBTOP_IMAGE:$WEBTOP_TAG." echo "If you see an authentication failure: pull them manually by the following 2 commands" echo "'docker pull $WRONGSECRETS_IMAGE:$WRONGSECRETS_TAG'" -echo "'docker pull $WEBTOP_IMAGE:$WEBTOP_TAG'" & +echo "'docker pull $WEBTOP_IMAGE:$WEBTOP_TAG'" docker pull $WRONGSECRETS_IMAGE:$WRONGSECRETS_TAG & docker pull $WEBTOP_IMAGE:$WEBTOP_TAG & docker build -t local/wrongsecrets-balancer:$version ./wrongsecrets-balancer & diff --git a/helm/wrongsecrets-ctf-party/values.yaml b/helm/wrongsecrets-ctf-party/values.yaml index 4f6a532fd..1e09aa5c6 100644 --- a/helm/wrongsecrets-ctf-party/values.yaml +++ b/helm/wrongsecrets-ctf-party/values.yaml @@ -200,7 +200,7 @@ virtualdesktop: maxInstances: 500 # -- Juice Shop Image to use image: jeroenwillemsen/wrongsecrets-desktop-k8s - tag: 1.6.3 + tag: up3 repository: commjoenie/wrongSecrets resources: request: diff --git a/wrongsecrets-balancer/src/kubernetes.js b/wrongsecrets-balancer/src/kubernetes.js index 5a9d0446f..5a4a3ecc8 100644 --- a/wrongsecrets-balancer/src/kubernetes.js +++ b/wrongsecrets-balancer/src/kubernetes.js @@ -1106,6 +1106,10 @@ const createDesktopDeploymentForTeam = async ({ team, passcodeHash }) => { name: 'PUID', value: '1000', }, + { + name: 'TITLE', + value: 'WrongSecrets CTF Desktop', + }, { name: 'PGID', value: '1000', diff --git a/wrongsecrets-balancer/src/proxy/proxy.js b/wrongsecrets-balancer/src/proxy/proxy.js index 55fb9bf46..bbdbc9016 100644 --- a/wrongsecrets-balancer/src/proxy/proxy.js +++ b/wrongsecrets-balancer/src/proxy/proxy.js @@ -123,12 +123,25 @@ function proxyTrafficToJuiceShop(req, res) { req.headers['referer'].includes(currentReferrerForDesktop)) || (req.headers['Referer'] !== undefined && req.headers['Referer'].includes(currentReferrerForDesktop)) || - req.path === '/js/filebrowser.js' || - req.path === '/css/filebrowser.css' || - req.path === '/files/socket.io/socket.io.js' || - req.path === '/js/vendor/jquery.min.js' || - req.path === '/files/socket.io/' || - req.path === '/files/socket.io/socket.io.js.map' + req.path === '/css/filebrowser.css' || + req.path === '/audio/socket.io/socket.io.js' || + req.path === '/files/socket.io/socket.io.js' || + req.path === '/files/socket.io/socket.io.js.map' || + req.path === '/js/filebrowser.js' || + req.path === '/js/vendor/jquery.min.js' || + req.path === '/public/css/filebrowser.css' || + req.path === '/public/css/files.svg' || + req.path === '/public/css/kclient.css' || + req.path === '/public/css/speaker.svg' || + req.path === '/public/js/filebrowser.js' || + req.path === '/public/js/jquery.min.js' || + req.path === '/public/js/kclient.js' || + req.path === '/public/js/pcm-player.js' || + req.path === '/vnc/vendor/interact.min.js' || + req.path === '/vnc/vendor/interact.min.js.map' || + req.path === '/vnc/dist/runtime.bundle.js' || + req.path === '/vnc/dist/vendors~main.bundle.js' || + req.path.includes('vnc') ) { target = { target: `http://${teamname}-virtualdesktop.${teamname}.svc:8080`, @@ -140,11 +153,16 @@ function proxyTrafficToJuiceShop(req, res) { ws: true, }; } - logger.info(`we got ${teamname} requesting ${target.target}`); + logger.info(`we got ${teamname} requesting ${target.target} for ${req.path}`); - if (req.path === '/guaclite') { + if ( + req.path === '/guaclite' || + req.path === '/websockify' || + !!req.query.EIO + ) { let server = res.socket.server; - logger.info('putting ws through for /quaclite'); + logger.info(`putting ws through for ${req.path}`); + logger.info(`putting ws through for ${req.query}`); server.on('upgrade', function (req, socket, head) { cookieParser(get('cookieParser.secret'))(req, null, () => {}); @@ -170,7 +188,7 @@ function proxyTrafficToJuiceShop(req, res) { logger.info(`Got malformed teamname: ${teamname}s`); return res.redirect('/balancer/'); } - logger.info(`proxying upgrade request for: ${req.url} with team ${connectTeamname}`); + logger.info(`proxying connect request for: ${req.url} with team ${connectTeamname}`); proxy.ws(req, socket, head, { target: `ws://${connectTeamname}-virtualdesktop.${connectTeamname}.svc:8080`, ws: true,