Administration spokesman Josh Earnest confirmed that former CIA Director David Petraeus is advising the White House, despite the former general’s legal troubles stemming from his illicit disclosure of state secrets and his decision to mislead FBI agents about the matter.

“He is, I think, legitimately regarded as an expert when it comes to the security situation in Iraq,” Josh Earnest told reporters on Monday. He also said, “it makes a lot of sense for senior administration officials to, on occasion, consult [Petraeus] for advice.”

Over the weekend, Newsweek reported that Petraeus was advising the White House on matters related to the Islamic State (ISIL), only weeks after the former top spy pleaded guilty to charges that he revealed top secret information to a biographer. The author, Paula Broadwell, and Petraeus, were having an extramarital love affair.

Court records showed that Petraeus not only disclosed state secrets, he also lied about it to FBI agents, who questioned him about operational security at his office.

Although others charged by the Obama administration for leaking secrets—like former CIA agent John Kiriakou, former-Pfc. Chelsea Manning, and former State Department official Steven Kim—were all given prolonged prison sentences, Petraeus was let off easy. The prosecution settled for a misdemeanor charge carrying two-years probation and a $40,000 fine.

News that Petraeus not only avoided jail time, but also has regained the trust of the White House, will only further raise the ire of those who cried out hypocrisy after the retired general got off lightly.

After Stephen Kim was sentenced to 13 months in prison for revealing information about North Korea’s nuclear program to a Fox News journalist, his attorney Abbe Lowell called the Petraeus settlement a “profound double standard.”

“Lower-level employees like Mr. Kim are prosecuted under the Espionage Act because they are easy targets and lack the resources and political connections to fight back,” Lowell said, noting that bigwigs like Petraeus “leak classified information to forward their own agendas (or to impress their mistresses) with virtual impunity.”

When asked if the White House was considering any “security precautions” given Petraeus’s “legal entanglements,” Earnest said he wasn’t aware of any.

Newsweek reported that Petraeus, who commanded US troops in Iraq and Afghanistan, “has provided good advice” thus far.

An ABC News report last week on atrocities committed by US-backed Iraqi military units could, however, challenge the White House’s orthodoxy. It has been reported that Petraeus and former Secretary of Defense Donald Rumsfeld were fully aware, in the middle of last decade, that Iraqi troops, under the guidance of US military advisers, were committing acts of torture and other war crimes.