If you follow the media in America and elsewhere, you can be forgiven for gaining the impression that the White House doesn’t have a single secret left which hasn’t been leaked. If you’re to believe all you read, it’s leaking like a colander that’s had a double helping from a Purdey shotgun.

As always when dealing with the media nowadays, the true situation is significantly different simply because it’s driven by an almost hysterical case of Trump Derangement Syndrome (TDS) to spin absolutely everything about him negatively or failing that, just plain make stuff up based on nothing more than leaks that never actually occurred.

Given that the Democrats have imploded as any sort of effective opposition to Trump, the media has taken upon itself the task of getting him impeached by whatever means fair or foul, all the time conveniently forgetting that he can only be removed from office if a majority of the House votes to impeach and a two-thirds majority of the Senate votes to convict. Any realistic hope of that happening is remote, given the Republican majorities in both houses of Congress.

Broadly speaking, there are three possible sources for any of the leaks occurring, so let’s go through them.

The first is as you would expect, untrustworthy people inside the administrative organs of the Trump presidency and is being done for what would appear to be political reasons though conceivably the payment of money might also be involved.

The kind of information being leaked is mostly political, with the intention of either doing reputational damage to Trump or hindering the execution of his policies. It’s highly likely that the people doing this betrayal of trust are appointees of the previous Obama administration. I’m sure they’ve got some sort of Walter Mitty heroic image of themselves as plucky stay behind resistance fighters to the Trump tyranny.

Increasingly and most worryingly, the kind of information being leaked is a serious breach of national security regulations which has already led to grievous damage to an ongoing counter terror operation. I’m talking here about the Manchester Arena terror attack.

The proven way to fight urban terrorism is the immediate sharing of any new intelligence with your allies and then a quick reaction to it, possibly picking up new terrorists, shaking them down for more information and then utilising that new information the quick reaction cycle begins again almost immediately. When they’re on the back foot, you follow up leads so quickly they never get a chance to recover. This is how you can roll up a complete terrorist cell in a few days.

British security services determined the name of the Manchester suicide bomber very quickly and shared it straight away with their intelligence allies overseas. Within twenty-four hours, someone in the American intelligence community (IC) had leaked the name to the local media who then published it. The result was that having been warned that Salman Abedi had been identified as the perpetrator and knowing what was going to come at them, everyone in his terror cell would have gone to ground trying to get away, and some like his father and brother probably did.

Those people who escaped when the rest of the terrorist network was rolled up won’t stop and will most probably be playing an active part in the next terrorist attack. A portion of blood for that forthcoming atrocity will be on the hands of the leaker. On the less negative side, at least in this case the hunt for the leaker has now been narrowed down to someone in the relevant sections of the American IC, which is not as big a pool of suspects as you might think.

When you hear Trump felt the need to apologise to PM May over the incident and then see both Homeland Security Secretary John Kelly and senior Congressman Newt Gingrich being interviewed in the same week and both saying the leak was a criminal offence punishable by imprisonment, you know two things. Firstly, the hunt is on with a vengeance for that leaker and secondly, when they do catch him, he’s going to a high-security prison for a long time. I’ll get to how the hunt is being conducted presently.

The second source of leaking is the media deliberately inventing leaks. This type of leak is not a genuine leak as such since it is a pure journalistic fabrication which falls under the heading of fake news. A sensational story is made up supposedly based on an anonymous leaking source and it is immediately picked up by the rest of the media which is overwhelmingly hostile to Trump.

Increasingly, the ordinary person doesn’t believe such stories and is quickly identifying and dismissing them as fake news, which only serves to offend the lying media’s pride and encourages them to make up even more sensational whoppers.

At times it can be very difficult for the average person to determine what is actually a genuine leak and what is just more fake news. It’s made all the more difficult by the echo chamber effect of churnalism.

In a rather pathetic response to shore up their credibility against the news consumer’s rapidly evaporating trust in them, the solitary anonymous source is now being billed as several anonymous sources, so it therefore simply must be true. There’s even a new variation coming into vogue which bases whatever the lie is on unnamed but telepathic sources close to the person at the centre of the controversy who are intimate with what they’re thinking.

Quite honestly, you do have to ask yourself how stupid do they think people are when they come up with such transparently flimsy lies that would shame a not too bright six-year-old for lack of inventiveness.

The third source of leaks is, I’ve no doubt, the Trump administration itself, which is an assertion that some may find startling and therefore needs more than an element of justification.

Finding out the identity of a person leaking sensitive information from inside an organisation uses exactly the same techniques employed by counterintelligence to uncover a mole. Once you know you’ve got an internal security breach, the first job is to localise it to an organisation and a department or area within it. It brings the numbers down of how many lives will have to go under the surveillance microscope.

You can do this by cross referencing all the leaks against which departments or persons had access to the compromised information. This is a slow and painful way of doing the job and it takes the patience of a James Jesus Angleton to do it well, but it’s very effective. A faster technique is called feeding them a Barium meal. Barium is a harmless substance if ingested and is used as a diagnostic aid to coat the interior of a patient’s digestive tract prior to an X-Ray. This makes the soft flesh, which would normally be invisible to X-rays, visible.

Let’s say you’ve already determined that the leak must be coming from one of several areas. You feed each of these areas a different story with nothing in common except that they’re all juicy enough to make the leaker pass them on to the press or their case officer. When a particular story hits the media, you know exactly which department the leaker is in and from them on, everybody in it gets the full emersion 24-7 surveillance and intrusion treatment.

Everything they’ve ever done will be investigated, everything they do, everywhere they go, everyone they meet, everyone who calls them, everybody they call, every key press on their electronic devices, everything, absolutely everything is monitored, recorded, analysed, dissected and pulled to pieces.

If the passive investigation doesn’t throw up a suspect, then by feeding the whole department a second Barium meal while they’re all under such heavy surveillance, you’ll almost certainly detect the leaker making contact and the individual will be identified.

In the unlikely event that you can’t identify the person within the department doing the leaking, the hard but usual solution is to take away the security clearance of everyone within it who had access to the leaked material. That revocation of security credentials will stay in place forever or until you finally get your man.

At the end of the day, persistent leakers will eventually be identified and unless I miss my guess, this has probably already occurred in some cases.

An obvious reaction would be to simply fire them, while letting it be widely known the reason for their dismissal. Believe it or not, a lack of loyalty and a track record of betraying a party or organisation who’d trusted you is the kiss of death to any career in middle level politics. It makes you unemployable by anyone other than the party you funnelled information to, and even they won’t trust you too far either.

It’s never a bad idea to make an example of such people, if only to discourage others from doing the same. I do suspect that the coincidence of what Kelly and Gingrich both said this week was quite possibly preparing the ground for a high-profile criminal trial of someone already identified who’d leaked national security material and will be facing a hefty prison sentence if found guilty.

However, since the leakers will have been identified using counterintelligence techniques, there’s nothing to stop you exploiting that information in a classic counterintelligence manner. For starters, you can deliberately feed them misinformation for onward transmission to whoever they’re briefing. This is very effective and hard to detect since the leaker themselves doesn’t know they’re passing on false information.

Alternatively, they can be confronted and offered the classic deal if they’ve been leaking national security secrets; either you work for us or you’re going to be spending the next twenty-five years in the isolation wing of a high-security prison. It’s an offer few people will ever refuse. When you’ve identified a leaker in your midst, it’s more sensible to turn them, making them into a weapon of misinformation against your enemy.

Such turned assets can be useful to do things like feeding a leak to the press about Trump divulging official secrets to the Russian ambassador at a meeting. When the story breaks, all five people in the room say nothing of the sort ever happened and the credibility of the media takes yet another knock.

There have been several embarrassing stories like that which have looked suspiciously like manufactured leaks because they’ve been too easily refuted, but they’ve all served to chip away at the media’s reputation while at the same time making it a bit more wary about leaks being offered to them. The two oldest rules of journalism have not ceased to apply; never believe a word coming out of the mouth of an official spokesman and when offered a story on a plate, always ask yourself what’s in it for them.

Certainly, if I were running a counter disinformation number on the Washington press corp, I’d be highly tempted to go for the big kill, the once and for all nuclear strike that would take them out of the impeachment agitation game for years to come. Basically, using a number of leakers you were feeding information to, or one or two leakers you’d turned, I’d feed them the bones of a huge scandal so juicy the media would simply have to go all in over it.

Make them work for the story. I’d leave just enough gaps in the breadcrumb trail they were being fed towards taking some high-value scalps, to allow them to get inventive in adding two plus two together and coming up with five.

Add in a few months of the administration toughing it out denying everything, more phony leakers coming forward at just the right moments to back up bits of the story and then when it all came to a head and everything seemed lost for the administration and the anonymous leakers were supposed to come forward and testify to the truth of the allegations, tell your tame leakers to back off and deny ever having said anything. That’d be a final goodbye to any trust in the legacy media.

When it comes to counterespionage, there are always wheels within wheels, and then even more enigmatic wheels concealed within those wheels, which is why Angleton himself referred to it as the wilderness of mirrors.

In dealing with the flood of phony leaks being invented by the media, Trump does have a range of escalating options to bring the media to heel. Some of these he’s already doing; such as starving them of direct access to him. He’s also handing out White House accreditations to what is decried by the legacy media as extreme right-wing news organisations, but what he’s actually doing is loosening the exclusively liberal access to the President by the White House correspondents lobby.

There’s also nothing to stop him taking away an accreditation, since it’s actually a discretionary privilege rather than an amendment somehow enshrined in the constitution or anything. They’d howl of course, but there’s nothing they could do about it.

It’s also up to him who he will grant an interview to and he’s started to use that power to bestow or withhold his patronage as he sees fit. He’s even threatened to drop the daily White House press briefings entirely, which I can understand since they’re only used by an overwhelmingly hostile press corp to do nothing more positive than probe for weaknesses. If he does, that’d leave them with nothing to do but comb through his tweets for a story. Since he uses social media to communicate to his 70 million followers, he doesn’t actually need the mass media.

He got elected in the face of their almost universal opposition to him, and he certainly doesn’t need them to stay in office. To his way of thinking and by their own admission they are his self-declared enemies, so I wouldn’t be shocked if he decided to go in for the kill. The given knowledge floating around is that Trump can put a leaker into prison and have to take the universal condemnation raised by the media, but of course he’d never go after one of them because they’d play the freedom of the press martyr card until they dropped.

But when you think it over, in the new political climate Trump created and the sort of disrepute journalism has brought itself into, that card really isn’t the ace of trumps it used to be. With every outrageously biased attack on him, they’ve successively squandered their own store of respect with their readership.

You may have noticed over the past year, Trump has a capacity to constantly surprise people by doing the things everybody knows you should never do. He does them, catches everybody flat-footed and while they’re busy spluttering in righteous indignation, he moves on to tackle the next obstacle in his way. By the time they’ve just about regained their equilibrium, he knocks them back again – see any parallels?

Arresting and laying criminal charges against a journalist for knowingly receiving and then wilfully disseminating classified information really doesn’t have as many downsides for him as you might think.

Everybody knows the media already have an almost pathological hatred of him, so why should he worry about any resultant outcry when they’re already running an unprecedented campaign of hatred against him which couldn’t get any worse. The charges wouldn’t relate to freedom of the press or not giving up a source, but simply breaking the law of revealing state secrets.

Spinning it as punishment for treason against America, rather than an attack on the press, would gain a lot of traction in the current environment of the public holding the press in very low esteem.

If Republican congressional candidate Greg Gianforte can get elected to congress by the voters of Montana not long after he’d body slammed a pushy Guardian journalist on camera and despite the resultant outrage of the mass media, it tells you how thoroughly despised journalists are these days. Lord knows, it most probably increased Gianforte’s share of the vote.

Should Trump decide to charge a journalist with knowingly receiving and then disseminating state secrets, the media will throw the mother of all fits, but the general public won’t lift a finger and most probably will be nodding in tacit approval. About time somebody knocked them off their high horse would be their way of thinking, and Trump is just the man to do that.

You never know, it might even increase his share of the vote in the mid-terms.