Homeland Security Secretary Jeh Johnson said Tuesday there are “certain legal limits” that constrain federal officials from scrutinizing the social media histories of foreigners trying to enter the United States — a new debate that has flared in the aftermath of the San Bernardino, California, terrorist attack.

His comments, in an interview with POLITICO, mark the first time the Homeland Security chief weighed in on the merits of reviewing social media in immigration cases. According to recent news reports, Tashfeen Malik, the female shooter in the California massacre, had posted extremist views yet still obtained a visa to the United States.

Story Continued Below

“You have to keep in mind — and this is again, not a comment on any particular case — that social media, Facebook, and the like can involve public statements, public postings, it can involve friending, and it can involve private communications,” Johnson said from his office at DHS headquarters in northwest Washington.

“We are dealing with private communications and things for which there is an expectation of privacy, and you’re dealing with U.S. persons,” Johnson continued. “There are certain legal limits to what we can do.”

Lawmakers on Capitol Hill have seized on reports that Malik passed a trio of background checks during her fiancée visa application process in 2014 despite publishing social media posts that were openly supportive of violent jihadism.

But Malik’s messages were published under a pseudonym and were controlled by strict privacy settings, meaning that those postings would not have been caught by federal immigration authorities screening her visa application to the United States, according to CNN, citing law enforcement officials.

Johnson declined to answer whether he was concerned that Malik was reportedly able to clear three background checks during her visa application process, citing the pending FBI investigation.

Still, several congressional Republicans, including House Judiciary Committee Chairman Bob Goodlatte (R-Va.) and Sen. John McCain (R-Ariz.), have prepared legislation that would force Department of Homeland Security officials to include social media checks for any foreigner applying to enter the United States.

“It is unacceptable that Congress has to legislate on this, and that it wasn’t already the Department of Homeland Security’s practice to take such commonsense steps when screening individuals entering this country,” McCain said in a statement Tuesday.

The increasing congressional scrutiny is not just coming from Republicans. A group of 22 Senate Democrats, led by New York Sen. Chuck Schumer, the third-ranking Senate Democrat, and New Hampshire Sen. Jeanne Shaheen sent a letter to Johnson urging him to implement a policy quickly that requires social media screenings for all foreigners applying for visas into the United States.

"Ensuring that the screening processes for our nation’s visa programs are rigorous and comprehensive must be a top priority, as these programs are critical to our security, our economy, and for our bilateral relationships with nations around the world," the Democratic senators wrote in the letter to Johnson, released Tuesday afternoon.

Johnson declined during the interview to comment on specific legislation. But the Homeland Security secretary noted that his department has launched a pilot program to analyze social media accounts as part of its application process for immigration benefits. There are three such pilot programs involving social media, DHS officials said.

“We are looking at, now, ways in which we can — consistent with law and civil liberties and privacy — expand upon that,” Johnson said. “This is something we’ve been doing for months now.”

President Barack Obama has ordered both Homeland Security and State Departments to review the screening process for the fiance visa, also known as a K-1 visa, for "possible program enhancements." Johnson said Tuesday that DHS and State officials "are right now about to settle on the exact scope of that review," a process that could be completed in a matter of weeks, he added.

Fiance visas allow foreigners to be admitted into the United States in order to marry an American citizen, as long as the marriage occurs within 90 days. In fiscal 2014, the U.S. issued 35,925 K-1 visas for foreigners abroad, while rejecting just 618, according to State Department data.

Malik, a Pakistani citizen who also spent some time in Saudi Arabia, used the the fiance visa to enter the country in July 2014 to marry Syed Farook, a U.S. citizen who carried out the slaying with his wife at a San Bernardino county center on Dec. 2.

Top lawmakers on Capitol Hill have launched their own investigations into the visa screening process. Senate Homeland Security and Governmental Affairs Chairman Ron Johnson (R-Wis.) and the panel's top Democrat, Sen. Tom Carper of Delaware, have sent letters to DHS and State seeking documents on the fiance visa program.