First of all, if you have any devices that produce heat internally or externally (hotend, heatbed, laser, spindle etc.) then it's not a good idea to leave the machine unattended. Yesterday my hotend heated to about 380 degrees because a faulty thermistor connection caused increased resistance, and bad measured temperatures.
If we put that aside, then you need to have either a VPN set up, or IP filtering