aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPawel Wieczorek <p.wieczorek2@samsung.com>2020-01-28 16:26:24 +0100
committerPawel Wieczorek <p.wieczorek2@samsung.com>2020-01-28 16:27:35 +0100
commit62b5908c21e1fdb4335d01fc43936a6986857395 (patch)
treeecc4cfa153133da98b92ae4e9c2ff9e81234f21d /test
parent6073f407aeeea1225241b4e873903deb7719da6e (diff)
Extend label matching for cluster node's External IP
This patch also fixes minor typo. Issue-ID: SECCOM-261 Change-Id: I4326106f14381ec652eb493bf0a87fb1d82ea3fb Signed-off-by: Pawel Wieczorek <p.wieczorek2@samsung.com>
Diffstat (limited to 'test')
-rwxr-xr-xtest/security/check_for_http_endpoints.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/security/check_for_http_endpoints.sh b/test/security/check_for_http_endpoints.sh
index 5c2ba20c3..f86f77730 100755
--- a/test/security/check_for_http_endpoints.sh
+++ b/test/security/check_for_http_endpoints.sh
@@ -57,8 +57,8 @@ SVCS=`awk '{print $2}' <<<"$PORTS_SVCS"`
# Create a list in nmap-compatible format
PORT_LIST=`tr "\\n" "," <<<"$PORTS" | sed 's/,$//'; echo ''`
-# Get IP addres of some cluster node
-K8S_NODE=`kubectl describe nodes \`kubectl get nodes | grep -v NAME | head -n 1 | awk '{print $1}'\` | grep external-ip | awk '{print $2}'`
+# Get IP address of some cluster node (both "external-ip" and "ExternalIP" labels are matched)
+K8S_NODE=`kubectl describe nodes \`kubectl get nodes | grep -v NAME | head -n 1 | awk '{print $1}'\` | grep "external-ip\|ExternalIP" | awk '{print $2}'`
# perform scan
SCAN_RESULT=`nmap $K8S_NODE -sV -p $PORT_LIST 2>/dev/null | grep \tcp`