Check port is open prior to assignment
royragsdale opened this issue · 0 comments
Currently when problem instances of the Service class (or it's sub-classes, Remote, FlaskApp, PHPApp) are deployed they provided a port with the give_port() function from hacksport.deploy.
This code takes into account a manually specificed list of banned_ports but does not actually validate that the port it provides is availible. This can result in a case where the port is provides is already bound by some other service. This issue is exacerbated because once a port is given it is written to a systemd .socket file. Though this is not likely, it has happened and could be avoided. An example culprit is rpc.statd which binds to an ephemeral port.
Recommendation: Check that the port selected is open prior to assigning it to an instance.