Yeah, this seems, to me, the most apt existing analog. We have regulation for environmental pollution, this would be digital pollution (of a sort). Insecure devices create a harm to the digital environment.
But this is incredibly hard, due to ease of manufacture and distribution, to regulate in the case of IoT devices and software.