ALL engine compartments, even front-mounted engines will get wet when you drive them in the rain, and are designed as such. Most of the electronics are inside the car anyways, so it's not that big of a deal.
Traditional cars and trucks have a rubber gasket above the firewall and lips around the front and sides, but it's to keep steam in, not water out. That way if you splash through a puddle or large amount of water and it hits the exhaust manifolds the steam doesn't shoot up and cover the windshield so you can't see. Otherwise it's quite normal to have the drains for the Air Plenum and sometimes the A/C plumbed into the engine compartment. Open engine compartments are nothing to worry about.