In a report, the Communications Security Establishment (CSE) said hacktivists and cybercriminals had leaked sensitive government documents, and attempted to smear candidates and spread disinformation and propaganda ahead of the 2015 vote.
These "low sophistication" attacks "did not impact the outcome of the election," the CSE concluded.
But it added that hacktivists are likely to try again when Canadians return to the polls in 2019.
The agency pointed to hacker group Anonymous, for example, leaking secret documents in 2015 on Canadian diplomatic missions and the size of Canada's spy network overseas to try to embarrass the incumbent Tories during the election campaign.
More From This Section
Nation-states have so far not targeted Canada's 150- year-old democracy, the CSE said.
But they may try in the next election, the agency said, depending on "how Canada's nation-state adversaries perceive Canada's foreign and domestic policies, and on the spectrum of policies espoused by Canadian federal candidates in 2019."
Canadian officials avoided naming Russia or other antagonists.
Foreign Affairs Minister Chrystia Freeland said interference in elections has been "energetically discussed" at meetings of NATO and the G7 group of leading industrial powers.
"We are a member of the G7, we are a NATO country, we are an influential voice and a leader on the world stage and so therefore there is a significant interest in influencing the direction of Canadian elections," Minister of Democratic Institutions Karina Gould told AFP.
According to the CSE, 13 percent of countries holding national elections this year have had their democratic processes targeted, and the number and sophistication of the attacks are predicted to rise.
The agency analyzed dozens of incidents over the past decade that victimized almost 40 nations. It concluded that in almost 80 percent of the cases, state actors were behind attempts to influence the democratic process.
The rest mostly involved cybercriminals stealing voter information.
The CSE report said political parties, politicians and the media in Canada faced the greatest vulnerability to cyberthreats and "influence operations."
The report noted that provincial and municipal elections could also be targeted.
"In particular, we know that certain nation-states have core interests that can be affected by Canadian policies related to natural resources, which are often made at the provincial/territorial level," said the report.
"Hacktivists may begin to view subnational elections... as worthy targets.