Since the mass shooting in San Bernardino, counterterrorism officials and lawmakers have grown increasingly worried about the use of social media by terrorist groups like the Islamic State, also known as ISIS or ISIL.  The attackers in San Bernardino, Tashfeen Malik and her husband, Syed Rizwan Farook, had exchanged private online messages discussing their commitment to jihad and martyrdom, according to law enforcement officials. But they did not post any public messages about their plans on Facebook or other social media platforms, officials said.

In Congress, several bills, including one by Senator John McCain, Republican of Arizona, have been introduced that would require the Department of Homeland Security to screen the social media use of refugees and those visiting or migrating to the United States.  Mr. McCain’s bill, along with a similar measure introduced by Representative Vern Buchanan, Republican of Florida, would require the department to examine all public records, including “Internet sites and social media profiles,” to determine whether an applicant would be a security risk.

“This legislation adds an important and necessary layer of screening that will go a long way in properly vetting the online activities of those wishing to enter the United States,” said Representative Michael McCaul, Republican of Texas and chairman of the House Homeland Security Committee. “A simple check of social media accounts of foreign travelers and visa applicants,” he added, “will help ensure that those who have participated in, pledged allegiance to or communicated with terrorist organizations cannot enter the United States.”

Congress has yet to act on the legislation, but Democrats have also called for more screening of social media accounts. In December, 22 Democratic lawmakers sent a letter to the secretary of Homeland Security, Jeh Johnson, urging him to have the agency immediately begin reviewing applicants’ social media accounts.  “We believe these checks, focused on possible connections to terrorist activity, should be incorporated into D.H.S.’s vetting process for visa determinations, and that this policy should be implemented as soon as possible,” the letter says.

Travel industry officials and immigration rights advocates say that the new policy will likely bring increased scrutiny to someone who posts legitimate criticism of American foreign policy or who has friends or followers who express sympathy toward terrorist suspects.