The German parliament approved security legislation granting police and intelligence agencies powers to execute counter-cyberattacks.