The Department of Homeland Security intends to monitor the social media accounts and internet search history of legal immigrants as part of a new tracking system set to roll out next month.

The policy applies to not just immigration applicants, but also to naturalized U.S. citizens and lawful permanent residents. It goes into effect on Oct. 18, the same day that the latest iteration of President Donald Trump’s travel ban is set begin.

First reported by BuzzFeed, the new rule was quietly published in the Federal Register last week. It’s an update to the Alien File, also known as an A-File, which is the official record-keeping system for an individual going through the immigration system. Until now, A-Files could be kept in either paper or electronic form. Now, the rule says, these records can be kept on paper, electronically or through some paper-electronic combination.

And the information that’s now going to be kept in A-Files includes the country of nationality, country of residence, the U.S. Citizenship and Immigration Service online account number, social media handles, aliases, associated identifiable information and search results.

It’s unclear how DHS plans to collect social media handles and search results from people, although the rule does say it plans to “expand data elements used to retrieve records.”

The new rule “makes clear that the government intends to retain the social media information of people who have immigrated to this country, singling out a huge group of people to maintain files on what they say,” Faiz Shakir, American Civil Liberties Union national political director, said in a statement Thursday. “This collect-it-all approach is ineffective to protect national security and is one more example of the Trump administration’s anti-immigrant agenda.”

It’s not the first time the administration has floated using social media to vet travelers and immigrants. In February, then-Homeland Security Secretary John Kelly, now the White House chief of staff, announced that the agency was considering asking visitors to give officials their social media passwords. In June, the administration quietly put in place a new visa questionnaire requiring all social media handles used in the last five years.

And sure enough, the agency says it’s already been culling social media handles.

“DHS, in its law-enforcement and immigration-process capacity, has and continues to monitor publicly available social media to protect the homeland,” Joanne Talbot, a spokeswoman for the agency, told Bloomberg Wednesday.

Rights groups have expressed concern about the implications the policy could have on free speech.

“There’s a growing trend at the Department of Homeland Security to be snooping on the social media of immigrants and foreigners and we think it’s an invasion of privacy and deters freedom of speech,” Electronic Frontier Foundation attorney Adam Schwartz told BuzzFeed.

The policy is part of a larger effort by the Trump administration to crack down on both illegal and legal immigration, including Wednesday’s announcement that the U.S. would be bringing its refugee admissions quota down to its lowest level yet.

Trump also threw his support last month behind a bill co-sponsored by Sen. Tom Cotton (R-Ark.), one of the most hard-line immigration lawmakers in Congress, that would dramatically slash the number of people coming to the U.S. every year by cutting down on the number of green cards given out as well as scaling back the refugee program. The bill would also prioritize English-speaking immigrants and ending the immigration lottery program.

Earlier this month, the president threatened to end the Deferred Action for Childhood Arrivals program, which granted two-year work permits and deportation relief to undocumented immigrants brought to the U.S. as children.

This article has been updated to include the ACLU national political director’s comment.