A slew of top cybersecurity officials are exiting the FBI, despite the ongoing threat of attacks to the country's digital infrastructure from foreign adversaries, according to a report.

Scott Smith, the FBI's Cyber Division assistant director, is leaving his post in July, and his deputy, Howard Marshall, has already departed for the private sector, per the Wall Street Journal.

David Resch, the FBI's Criminal, Cyber, Response, and Services Branch executive assistant director, is also stepping down, even though he was only appointed by FBI Director Christoper Wray in April.

Carl Ghattas, the FBI's National Security Branch executive assistant director, and Jeffrey Tricoli, the senior official who co-lead FBI foreign influence task force, are departing for corporate jobs.

[Related: Trump downplays Russia cyberattack warning from top intelligence official]

The exodus comes after President Trump has repeatedly attacked the FBI, and in the face of Director of National Intelligence Dan Coats issuing a recent warning that "the warning lights are blinking red again" regarding cyber attacks.

In addition, an annual survey of FBI employees published Sunday found a sharp decline in confidence in bureau leadership amid a series of scandals, including those involving disgraced FBI counterintelligence agent Peter Strzok and his former colleague, FBI lawyer Lisa Page.

But news of the departures contradicts with comments Wray made at the Aspen Security Forum in Colorado on Wednesday, in which he said he wasn't concerned about recruitment for the bureau and that attrition was negligible.