1. A method, comprising: identifying, by a first hardware unit in a Network Function Virtualization based (NFV-based) network, that a security attack has occurred within the first hardware unit; responsive to identifying the security attack, identifying by the first hardware unit a second hardware unit in the NFV-based network that is operative to replace the first hardware unit; initiating, by the first hardware unit, a migration of functionality of the first hardware unit to the identified second hardware unit; and after the functionality of the first hardware unit is migrated to the second hardware unit, executing a security defense software program in the first hardware unit to cleanse the first hardware unit; and after the first hardware unit is cleansed, reinitiating the migrated functionality at the first hardware unit.