@mfgamma not sure what you mean with that.
In terms of attack surface OPNsense inside or outside of Proxmox is not so much different.
To make the picture more complete.
Know it is possible yet of
low likelihood a vulnerability will exist in both Linux and BSD.
Of the top of my head I only know of an IP stack vulnerability existing for both Linux and BSD.
Obviously, services can run on both Linux and BSD and be equally or differently vulnerable.
Should an attack happen against Proxmox (Linux) and this is also targeting OPNsense (FreeBSD) there are just 4 contexts and 3 attack paths.
This with 4 attack surfaces: Network, Proxmox, OPNsense, physical/virtual hosts.
I'm not going into detail here but I try to be somewhat complete, this is for informative purposes only and a sketch more than tutorial.
- Proxmox is exposed+compromised, the attacker now has full access and a majority of access and control. Very very bad, direct results.
- OPNsense is exposed+compromised, the attacker can mess with traffic, capture traffic, maybe steal password hashes. Very bad. Slow results.
- the VM integrity and isolation is compromised and the attacker just broke out of the VM into Proxmox. Game over, direct results.
So in sequence either
- network>proxmox>opnsense ............. > hosts ? networks ?
- network>opnsense>proxmox ............. > hosts ? networks ?
- network>proxmox-VM>proxmox ....... > hosts ? networks ?
Evaluating the likelihood for these attacks.
- Proxmox is attacked and OPNsense is the target. Seems unlikely. Anyone who can break into Proxmox now has far more access.
- OPNsense is attacked and Proxmox is the target. Seems unlikely anyone would 'just know' where to target a properly implemented firewall.
- A host in the network is attacked passing through OPNsense running dedicated and/or in Proxmox as a VM. Most likely again the feasibility greatly depends on the implementation of OPNsense and Proxmox and how both are implemented in the LAN.
- A virtual machine is attacked by the user and so doing the attacker has visibility on OPNsense/Proxmox services or has a vulnerability to use to escape the virtual machine. The VM escape is a game-over scenario. Congratulations, you must be a very valuable organisation or individual. Highly unlikely random civilians and civilian organisation are target because VM escape exploits are very desirable, therefor expensive.
Attack paths for this example are reduced to Proxmox-OPNsense.
- Attacking Proxmox is either through ssh, webui, VM escape. Both SSH and WebUI vulnerabilities are high priority risks to consider.
- Attacking OPNsense is either trough ssh, webui, service vulnerabilities. These are all plausible points of attack.
- Attacking from a VM, this bypasses any network defenses put in place for both Proxmox and OPNsense.
So. If your dedicated OPNsense front FW is visible and vulnerable and there is a visible Proxmox-OPNsense-FW of the same or older version, you're screwed, twice. Both will fall to the attacker.
What I'm trying to say is you should think about the network and the network infrastructure (including Proxmox) as a whole with parts,
not as parts by themselves.
Take measures accordingly.