Communications Security Establishment Canada chief John Forster says news this week that a Chinese state-sponsored player infiltrated the National Research Council's computer network shows Canada is not immune from such aggression.
China has vehemently denied involvement in the cyberattack.
In a letter to the editor of the Toronto-based Globe and Mail newspaper, Forster says when CSEC detects emails containing malware or other threats, it blocks, collects and analyzes them.
Forster insists the spy service takes strict measures to protect the privacy of Canadians in doing such work.
He says the agency doesn't keep personal information about Canadians if it's considered irrelevant to protecting networks.
Follow @JimBronskill on Twitter