Hans-Georg Maaßen said Germany should be ready with its own malware to counter hackers. Meanwhile, the British MI5 chief has warned that IS still posed a threat to Europe despite losses in the Middle East.
The head of Germany's domestic intelligence service, the Federal Office for the Protection of the Constitution (BfV), has warned of possible cyber attacks on the country's critical infrastructure.
Hans-Georg Maaßen told German broadcaster rbb that the country should be ready with "anti-sabotage" measures to deal with any future attacks.
"This means that we should implement malware in all our critical infrastructures that we could then perhaps activate at a point in time X, when a political dispute arises," Maaßen said in the interview, held ahead of a meeting of European security chiefs in Berlin.
Maaßen recalled the cyber attack on a Ukrainian power plant in December, 2015, saying the attacker had attempted an attack on Germany at around the same time.
Maaßen said even though the authorities at all critical establishments were aware of the threat, an attack could not be ruled out "because much, if not almost everything, is now connected with the Internet."
The domestic intelligence chief also reiterated his demand for a legal framework for the so-called hack back, which allows a victim of hacking to identify alleged hackers, take counter measures and recover or destroy stolen data.
"When we see data flowing from German computers, we can make sure that it's deleted before even reaching the hacker," said Maaßen. "This is an important goal we want to achieve."
Meanwhile, the head of the British domestic intelligence service, MI5, Andrew Parker, warned on Monday that the "Islamic State" militant group continues to plan "devastating" and "more complex" attacks in Europe after having lost territory in the Middle East.
Parker, who is in Berlin to take part in the meeting of European security chiefs, said Britain had foiled 12 terror attacks since March, last year. He said the cooperation between European secret services played a major role in the fight against terrorism.
"We need this combined strength more than ever," he added.
Parker also lashed out at Russia over its role in the poisoning of former Russian double agent Sergei Skripal and his daughter in Salisbury. He termed it a "willful and deliberate hostile action."