1
0
Fork 0
This commit is contained in:
Joao Gilberto 2022-11-09 23:57:12 -03:00
parent 79819aeacb
commit 9535413a10
3 changed files with 7 additions and 4 deletions

View file

@ -13,7 +13,7 @@
# location: https://host1.local/ # location: https://host1.local/
# #
# Test SSL: # Test SSL:
# openssl s_client -showcerts -connect 127.0.0.1:443 --servername host1.local # openssl s_client -showcerts -connect 127.0.0.1:443 -servername host1.local
version: "3" version: "3"

View file

@ -13,7 +13,7 @@
# location: https://host1.local/ # location: https://host1.local/
# #
# Test SSL: # Test SSL:
# openssl s_client -showcerts -connect 127.0.0.1:443 --servername host1.local # openssl s_client -showcerts -connect 127.0.0.1:443 -servername host1.local
version: "3" version: "3"

View file

@ -129,7 +129,10 @@ class Docker(ProcessorInterface):
def inspect_network(self): def inspect_network(self):
self.parsed_object = {} self.parsed_object = {}
for container in self.client.containers.list(): for container in self.client.containers.list():
self.parsed_object[container.name] = container.labels ip_address = container.attrs["NetworkSettings"]["IPAddress"]
if not ip_address:
ip_address = list(container.attrs["NetworkSettings"]["Networks"].values())[0]["IPAddress"]
self.parsed_object[ip_address] = container.labels
class Swarm(ProcessorInterface): class Swarm(ProcessorInterface):
@ -140,7 +143,7 @@ class Swarm(ProcessorInterface):
def inspect_network(self): def inspect_network(self):
self.parsed_object = {} self.parsed_object = {}
for container in self.client.services.list(): for container in self.client.services.list():
self.parsed_object[container.attrs["Spec"]["Name"]] = container.attrs["Spec"]["Labels"] self.parsed_object[container.attrs["Endpoint"]["VirtualIPs"][0]["Addr"].split("/")[0]] = container.attrs["Spec"]["Labels"]
class Kubernetes(ProcessorInterface): class Kubernetes(ProcessorInterface):