File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 60
60
61
61
- name : Test vncserver
62
62
run : |
63
- container_id=$(docker run -d -it -p 5901:5901 test vncserver -xstartup /opt/install/jupyter_remote_desktop_proxy/share/xstartup -verbose -fg -geometry 1680x1050 -SecurityTypes None -rfbport 5901 )
63
+ container_id=$(docker run -d -it test vncserver -xstartup /opt/install/jupyter_remote_desktop_proxy/share/xstartup -verbose -fg -geometry 1680x1050 -SecurityTypes None -rfbunixpath /tmp/vncserver.socket )
64
64
sleep 1
65
65
66
66
echo "::group::Install netcat, a test dependency"
70
70
'
71
71
echo "::endgroup::"
72
72
73
- docker exec -it $container_id timeout --preserve-status 1 nc -v localhost 5901 2>&1 | tee -a /dev/stderr | \
73
+ docker exec -it $container_id timeout --preserve-status 1 nc -vU /tmp/vncserver.socket 2>&1 | tee -a /dev/stderr | \
74
74
grep --quiet RFB && echo "Passed test" || { echo "Failed test" && TEST_OK=false; }
75
75
76
+ echo "::group::Security - Verify TCP ports wasn't opened"
77
+ ports=(5800 5801 5900 5901)
78
+ for port in "${ports[@]}"
79
+ do
80
+ docker exec -it $container_id timeout --preserve-status 1 nc -vz localhost $port | tee -a /dev/stderr | \
81
+ grep --quiet succeeded && { echo "Failed security check - port $port open" && SECURITY_OK=false; } || echo "Passed security check - port $port not opened"
82
+ done
83
+ echo "::endgroup::"
84
+
76
85
echo "::group::vncserver logs"
77
86
docker exec $container_id bash -c 'cat ~/.vnc/*.log'
78
87
echo "::endgroup::"
82
91
echo "Test failed!"
83
92
exit 1
84
93
fi
94
+ if [ "$SECURITY_OK" == "false" ]; then
95
+ echo "Security check failed!"
96
+ exit 1
97
+ fi
85
98
86
99
- name : Install playwright
87
100
run : |
You can’t perform that action at this time.
0 commit comments