The White House is considering a top official at Fannie Mae to head the Consumer Financial Protection Bureau, according to two people familiar with the discussion.

Brian Brooks is currently the mortgage financing giant's general counsel and has close ties to Treasury secretary nominee Steven Mnuchin. Brooks represented several of the investors in Mnuchin's purchase of failed subprime mortgage lender IndyMac for $1.6 billion in 2009. The bank was renamed OneWest, and Brooks joined the company as vice chairman.

He left the bank for Fannie Mae in 2014, shortly before OneWest was acquired by CIT Group.

Brooks is among several names being considered for the top job at the agency, which was founded to protect consumers from abuse by financial institutions.

A White House spokesman said last month that the administration had met with former Rep. Randy Neugebauer — a vocal critic of the CFPB — about serving as director. Also on the short list is Todd Zywicki, an economist at the Mercatus Center at George Mason University, according to the sources.

Still, any discussions remain preliminary. The term of the current CFPB director, Richard Cordray, does not end until 2018, though opponents of the agency are pushing to have him removed earlier.

Though the director is a political appointee, the CFPB is an independent agency — which means the White House has limited authority to make changes at the top. Currently, the president can fire the director only for inefficiency, neglect of duty or malfeasance.

But a recent ruling by the D.C. Circuit Court found that the agency's structure is unconstitutional. (The CFPB is appealing that decision.) Meanwhile, Republican Rep. Jeb Hensarling of Texas is expected to propose legislation soon that would allow the president to dismiss the director of the CFPB for any reason, according to a memo obtained by CNBC.

Advocates for the agency have vowed to fight any changes from Capitol Hill or the White House. Brooks could also face a rocky road to Senate confirmation for his ties to OneWest. Democrats and consumer groups have attacked Mnuchin for his leadership of a bank that faced accusations of discrimination and aggressive foreclosure practices. At OneWest, Brooks oversaw the bank's fair lending programs.

"Foreclosures happen in an economic crisis. But OneWest was different," said Sen. Elizabeth Warren (D-Mass.), who helped establish the CFPB. "It quickly gained a reputation as a foreclosure machine … OneWest was notorious for its belligerence and for its cruelty."