William Hague revealed on Friday that his own staff were hit in December by data-stealing viruses, as he called for agreement on "acceptable rules" for how countries behave in cyberspace.

The foreign secretary's announcement at the Munich Security Conference, which deals with international security issues, follows the revelation that the US and Israel collaborated to create the "Stuxnet" worm to disable Iran's nuclear fuel facility, and that government-backed hackers tried to break into Google's systems in 2009. Now, Britain's government is calling for agreement on how countries should behave in cyberspace.

The attempt to impose rules on cyberspace may be thwarted, however, by the fact that it is almost impossible to confirm the source of hacking because it is so easy to hide one's digital footprints. Despite evidence of US, Israeli and Chinese involvement in attacks, they have never been proved.

Even so, Hague has offered to host a conference on the matter and at Munich gave among examples of internet attacks on "British interests" his own staff and a defence contractor being hit by "Zeus" malware that evaded defences by pretending to come from the White House.

Hague said "there is a need for a more comprehensive, structured dialogue" so that countries will not engage in all-out internet war which could cripple their infrastructure.

The government warned last year that cyber attacks posed one of the gravest dangers to security. Hague said the UK wants "to explore mechanisms for giving [cyber] standards real political and diplomatic weight". It would push for agreements so that governments act "proportionately" and "in accordance with national and international law", he said.

But with the head of Iran's Atomic Energy Organisation calling on Friday for an investigation into the Stuxnet claims, it is likely that government will prefer to let hackers continue to do their work as they already do – unaccountably and invisibly.