Add IP addresses filtering 87/103687/5
authorPawel Wieczorek <p.wieczorek2@samsung.com>
Thu, 12 Mar 2020 17:39:03 +0000 (18:39 +0100)
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>
Wed, 25 Mar 2020 13:08:24 +0000 (13:08 +0000)
commit935f1b85d99c2feb619d4e04dbb52201b79c90e7
tree6aa5b920906d62dd9936b86bc971c4dbc061a33f
parentc5cf34d49e829e8261cc91451f5bffb1e1b71cf9
Add IP addresses filtering

Each node might be described with 3 types of addresses [1]. Some
providers also use node annotations [2] for assigned addresses.

This patch filters out all IP addresses from nodes list. External IPs
take precedence over internal ones. The first address on the extracted
slice will be later used to run the scan on.

This behaviour could be later modified to e.g. loop over all extracted
IP addresses (if scan fails).

[1] https://kubernetes.io/docs/concepts/architecture/nodes/#addresses
[2] https://github.com/rancher/rke/blob/master/k8s/node.go#L18

Issue-ID: SECCOM-261
Change-Id: Ifd094447f778da378dfe1aee765f552b6ebd669f
Signed-off-by: Pawel Wieczorek <p.wieczorek2@samsung.com>
test/security/sslendpoints/main.go
test/security/sslendpoints/ports/ports.go
test/security/sslendpoints/ports/ports_test.go