Skip to content
Snippets Groups Projects
Commit 21262461 authored by František Řezníček's avatar František Řezníček
Browse files

Merge branch 'additional_ports' into 'master'

feat/Adding HTTP and HTTPS port availability check

See merge request !13
parents cfec4270 b8b1d4b2
No related branches found
No related tags found
1 merge request!13feat/Adding HTTP and HTTPS port availability check
Pipeline #260508 passed
......@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [1.3.0] - 2023-04-11
### Fix
- Adding HTTP + HTTPS port checking
## [1.2.2] - 2023-03-06
### Fix
- Attempt to open VM connection, only if tcp is allowed in security rule
......
......@@ -47,6 +47,8 @@ class Constants:
CONNECTION_TIMEOUT = 1
PORT_DEFAULT_SSH = 22
PORT_DEFAULT_RDP = 3389
PORT_DEFAULT_HTTP = 80
PORT_DEFAULT_HTTPS = 443
ICMP_PROTOCOLS = ['any', 'icmp', 'ipv6-icmp']
TCP_PROTOCOLS = ['any', 'tcp']
......@@ -174,7 +176,7 @@ class AppMetrics:
if rule['port_range_max'] is None:
visible_ports.add(rule['port_range_min'])
else:
for i_port in (Constants.PORT_DEFAULT_SSH, Constants.PORT_DEFAULT_RDP):
for i_port in (Constants.PORT_DEFAULT_SSH, Constants.PORT_DEFAULT_RDP, Constants.PORT_DEFAULT_HTTP, Constants.PORT_DEFAULT_HTTPS):
if i_port in range(rule['port_range_min'], (rule['port_range_max']) + 1):
visible_ports.add(i_port)
......@@ -182,7 +184,7 @@ class AppMetrics:
# support function for obtaining enabled ports for ip address
def get_enabled_ports(self, address, security_groups):
''' Returns set of enabled connection ports (SSH, RDP) throughout all security groups and its rules. '''
''' Returns set of enabled connection ports (SSH, RDP, HTTP, HTTPS) throughout all security groups and its rules. '''
ports = set()
for sg in security_groups:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment