A former Defence employee from Canberra has been sentenced to three months in jail for publishing a top secret document to online forum 4chan.

In October 2012, Michael Scerba, 24, uploaded two pages of a Defence intelligence report to the website.

The breach came to light when a former member of the Defence Signals Directorate noticed a thumbnail marked "Julian Assange is my hero" on the site.

On closer inspection, he discovered two pages from a "Five Eyes only" document intended only for Australia's closest allies, and alerted authorities.

Despite only being up on the website for an hour, the post attracted 15 comments.

The court heard Scerba burned sensitive images to a disk and took it home, where police found it broken in a bin.

Today, Justice Richard Refshauge acknowledged Scerba's early guilty plea, and the fact that he had been severely depressed at the time of the offence.

Justice Refshauge also took into account Scerba's clean record, and that he had been socially isolated after being dumped by his girlfriend.

But in sentencing he emphasised the importance of general deterrence, and said the "clang of the prison gates" was a way to warn others who may be tempted to breach national security.

Scerba is expected to be released from prison in February 2016, and be subject to a two-year good behaviour order.