secure webinterface - change port 8006 proxmox 4.4

Discussion in 'Proxmox VE: Installation and configuration' started by svenner, May 29, 2017.

  1. svenner

    svenner New Member

    Joined:
    Mar 20, 2017
    Messages:
    3
    Likes Received:
    0
    hi,

    is it possible to change the default port 8006 of the webinterface in version 4.4 ?
    or maybe a redirect from 443 ?

    is there a chance to configure the pveproxy?

    thanks...
     
  2. hieve

    hieve New Member

    Joined:
    May 29, 2017
    Messages:
    15
    Likes Received:
    1
    MrJester888 likes this.
  3. Rhinox

    Rhinox Active Member

    Joined:
    Sep 28, 2016
    Messages:
    272
    Likes Received:
    35
    This is still NOT possible? Users still have to get around this by using proxy/preroute? Can't believe it...
     
  4. LnxBil

    LnxBil Well-Known Member

    Joined:
    Feb 21, 2015
    Messages:
    3,166
    Likes Received:
    265
    It is possible in the perl source code. If you change the port there, it will get overwritten on the next update.
     
  5. Rhinox

    Rhinox Active Member

    Joined:
    Sep 28, 2016
    Messages:
    272
    Likes Received:
    35
    That's really "smart" solution! Any reason why PVE-devs are so stubbornly refusing to unlock this configuration option?
     
  6. fabian

    fabian Proxmox Staff Member
    Staff Member

    Joined:
    Jan 7, 2016
    Messages:
    3,129
    Likes Received:
    479
    it's a lot of work and complexity for little gain, and the workaround is easy enough.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. Rhinox

    Rhinox Active Member

    Joined:
    Sep 28, 2016
    Messages:
    272
    Likes Received:
    35
    A lot of work to pull one number out of perl-script into config-file? I did not check the code yet but I doubt it can be so difficult. But ok, you are dev...

    As for the rest: I completely and utterly disagree. Moving service from standard port is signifficant gain contributing to security (through obscurity though, but at the end everything counts). Try running public-facing sshd on default port 22, and then move it elsewhere for comparison. You will see the difference in log-files...

    Workaround? You might call it easy enough, but I call it unnecessarily uneffective, when it comes to resources and security. Either proxy-server, or prerouting kernel-module must be active just because of this! This alone increases surface of possible attack-vector, but also denies the well-known "kiss" rule (which is even more important for hypervisor). Last but not least, every iptables-rule needs some cpu-power, which becomes obvious as soon as number of iptables-rules starts rising...

    Hard-coding service to any particular port is imho very bad idea. I can not see any advantage in it...
     
  8. fabian

    fabian Proxmox Staff Member
    Staff Member

    Joined:
    Jan 7, 2016
    Messages:
    3,129
    Likes Received:
    479
    you are not talking about a simple single service like a web server instance, but a service which is part of an intra-connected cluster (e.g., PVE transparently proxies requests made to the "wrong" node, among other things). it's not as simple as "pulling one number out of a perl script" - even a simple search and replace of 8006/443 would touch 4 different git repositories and their respective packages, not even accounting for the question of how to know which node listens on which port in a clustered setup.

    leaving this practical reason aside, if you think the solution to getting to many potentially malicious requests from the public internet on your hypervisor's management console (or SSH server) is moving its listening port to a non-standard one, I hope you don't run production setups with any valuable data. in 99% of the cases, neither your management console nor your hypervisor's SSH server should be reachable from the public internet - no matter which ports those daemons listen on. this is security 101, and not PVE specific at all. the correct solution is not having public access to those services (e.g., by setting up a jump host or VPN).
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. Rhinox

    Rhinox Active Member

    Joined:
    Sep 28, 2016
    Messages:
    272
    Likes Received:
    35
    Quite bad example, as web-server can consist of many interconnected services as well.
    Still I do not think replacing four hard-coded values with values from config-file is somehow complicated.
    Maybe the same way as you know which node listens on which ip/fqdn?
    I do not remember saying anything like that (contribution != solution) so your *if* condition is invalid.
    I agree with that 1% you left for special cases.
    Just in this year, OpenVPN had 3 security-related bugs. That's why I never rely solely on vpn. Ultimately, it is not bullet-proof, as no other software is...
     
  10. MrJester888

    MrJester888 New Member
    Proxmox VE Subscriber

    Joined:
    Sep 2, 2018
    Messages:
    11
    Likes Received:
    1
    My solution here was to use iptables REDIRECT.
    Code:
    iptables -t nat -I PREROUTING -i eno1 --dst <ipv4-address>  -p tcp --dport 443 -j REDIRECT --to-ports 8006
    ip6tables -t nat -I PREROUTING -i eno1 --dst <ipv6-address>  -p tcp --dport 443 -j REDIRECT --to-ports 8006
    After you add the rules, you can view them to verify they are correct and test.
    Code:
    ip6tables -t nat --line-numbers -L
    iptables -t nat --line-numbers -L
    Debian has a nice package to make the rules persistent. If you have your rules already in place when you install the package, it will prompt if you want to save the existing.
    Code:
    apt-get install iptables-persistent
    Use the following command to save future changes
    Code:
    # netfilter-persistent
    Usage: /usr/sbin/netfilter-persistent (start|stop|restart|reload|flush|save)
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice