By Luke Baker and Julie Carriat

PARIS (Reuters) - Emmanuel Macron has spent much of the past four months battling to contain the threat from France's "yellow vest" revolt. But another lingering problem may cast a longer shadow over his presidency: the Benalla Affair.

Named for Alexandre Benalla, a 27-year-old former Elysee security chief and Macron bodyguard, it has its roots in May last year when Benalla was caught on video beating a May Day protester. Nine months on, the affair continues to produce a drip-feed of leaks, parliamentary hearings and police inquiries that have kept it nipping at the heels of the presidency.

This week, questions in the Senate explored links between Benalla and a private security contract with a Russian billionaire. Benalla's measured answers prompted France's justice minister to warn that if he was found to have lied under oath, he could face up to five years in prison.

While there is no suggestion of wrongdoing by Macron, parliament's probing of who knew what when, and why it wasn't dealt with sooner, led Prime Minister Edouard Philippe on Tuesday to reiterate his commitment to transparency.

"Justice will do its work and if it is found that illegal acts were committed, sanctions will be handed down, I have no problem with that," he told parliament. "My office will respond to all questions with complete transparency and with respect to the independence of the judiciary, I guarantee it."

While Macron's poll ratings were beginning to fall even before the Benalla case broke, the sense of the Elysee holding information back accelerated his slump, with his popularity falling to 21 percent. In a survey for BFM TV, 73 percent said the Benalla Affair had damaged Macron's image.

Senior ministers have voiced concerns about the impact on his five-year term, with one telling Reuters the Elysee needed to get on top of the "nonsense", and expressing incredulity at the poor judgment that had allowed a young and inexperienced person to gain so much influence in the presidency.

RUSSIAN CONTRACT

While Benalla was caught beating the protester on May Day, the scandal broke only two months later with the publication of the video by the French media.

He was initially suspended for two weeks, only to be fired after a public outcry over why the Elysee had waited two months to take action.

Macron called it a "storm in a teacup", apologized for any misjudgment and hoped the affair had been put to bed.

Not so soon.

The opposition homed in on the Elysee's slow response and opened a parliamentary investigation.

It then emerged that Interior Minister Gerard Collomb, one of Macron's closest allies, had known about the video on May 2. He resigned two months later after bruising questioning by lawmakers.

The Benalla Affair subsequently took on wider dimensions.

As well as being investigated over his use of Elysee-issued diplomatic passports, Benalla is being quizzed by the Senate about his work as a security consultant since leaving the Elysee, and whether he did similar work while at the Elysee.

On Monday, he denied knowing Iskander Makhmudov, a Russian mining magnate who French investigative website Mediapart reported in December had signed a contract with a French security firm to provide protection for Makhmudov's family while in France. Mediapart alleged that Benalla helped negotiate the contract while still employed at the Elysee.

Pressed whether he had contact with people close to the Russian, Benalla said he knew "lots of people, who I've met through old colleagues, via previous work or former employers".

Representatives of Makhmudov did not immediately respond to a request for comment. The Elysee said it could not comment while judicial inquiries were underway.

Based on Mediapart's reporting, France's financial prosecutor announced last week it had opened a corruption investigation into the contract with Makhmudov, although there was no suggestion of wrongdoing on Makhmudov's part.

One of Macron's closest associates, strategist Ismael Emelien, who was also close to Benalla, said he would quit at the end of March - the latest in a series of high-profile departures - while denying his move was linked to the Benalla Affair.

Meanwhile, Macron has pursued public debates with voters around the country to try to sap the energy from "yellow vest" protests against his government's policies, an initiative that has helped his poll ratings rebound to 34 percent approval.

(Additional reporting by Tom Balmforth in Moscow; Writing by Luke Baker; Editing by Mark Heinrich)