(CNN) -- Government surveillance of telephone records and conversations in the name of national security has long been controversial.
The debate, which dates back decades, is back in the news with recent revelations that the U.S. government is collecting telephone records in the United States and some Internet traffic overseas.
Here's a primer on what the government is getting, how it affects you and what the legal debate is all about:
I live in the United States. What kinds of records is the government collecting on me?
U.S. officials have acknowledged collecting domestic telephone records containing the time and date of calls and telephone numbers involved. A secret court order published by The Guardian newspaper also indicates the government is getting rough location information and details that would identify the specific handsets used to make mobile calls.
That court order names Verizon Business Network Services, but analysts say similar orders are likely in effect for all U.S. carriers, meaning the government has logs of most, if not all, telephone calls.
The Wall Street Journal, citing people familiar with NSA activities, reported Friday that the agency has also collected credit card records. But the newspaper couldn't say if that collection effort is continuing or was a one-time effort.
I live overseas. What might the United States have?
If you're a United States citizen or permanent resident living or traveling overseas, the government says it's not collecting anything on you, If it does, the government says, it's incidental and the resulting data is kept under strict controls.
But the picture could be different for citizens of other nations living outside the United States.
Director of National Intelligence James Clapper on Thursday indirectly confirmed a program to collect data generated by overseas customers of some of the largest internet services companies in the world, including Microsoft, Yahoo, Google and Apple.
Clapper's statement came Thursday in response to stories in the Washington Post and The Guardian newspaper Thursday reporting the existence of a program called PRISM. The program is designed to collect "audio and video chats, photographs, e-mails, documents" and other materials, The Post reported.
The Wall Street Journal, however, said the monitoring doesn't include the contents of messages.
Is the government listening to my phone calls?
Clapper says it's not.
What happens to the records?
The telephone records go into a database, where they can't be accessed unless a judge gives the go-ahead in a national-security investigation, Clapper said.
Sen. Dianne Feinstein, chairwoman of the Senate Intelligence Committee, said Thursday that the records can't be accessed without "reasonable and articulable suspicion" that they're relevant to terrorist activity.
It's less clear what happens to the Internet monitoring data, but Clapper said it's "used to protect our nation from a wide variety of threats."
Why does the government need this information?
Access to such information "allows counterterrorism personnel to discover whether known or suspected terrorists have been in contact with other persons who may be engaged in terrorist activities, particularly people located inside the United States," a senior Obama administration official said Thursday.
Clapper said Thursday that the telephone records allow analysts to "make connections related to terrorist activities over time."
The Internet data collected overseas "is among the most important and valuable foreign intelligence information we collect, and is used to protect our nation from a wide variety of threats," he said.
Who approved these programs?
Both programs have been approved by all three branches of government, officials say.
The telephone records collection program was authorized by the Foreign Surveillance Intelligence Court under what Clapper called "stringent condition." It's reviewed every 90 days, he said. Feinstein said the order published in The Guardian was the approval of one such 90-day review.
The court is special judicial office set up as part of the 1978 Foreign Intelligence Surveillance Act. The court operates in secrecy, reviewing requests by intelligence agencies to conduct electronic surveillance and other activities as part of espionage, terrorism and national security investigations.
Is it legal?
The FISA Court, Clapper and other administration officials obviously think so. But many privacy advocates and some lawmakers believe this sort of broad data collection goes too far.
"While I cannot corroborate the details of this particular report, this sort of widescale surveillance should concern all of us and is the kind of government overreach I've said Americans would find shocking," said Sen. Mark Udall, D-Colorado, who serves on the Senate Intelligence Committee.
In a letter last year to Attorney General Eric Holder, Udall and Sen. Ron Wyden, D-Oregon, complained about secret interpretations of the Patriot Act, details of which are classified but which the senators said "most Americans would be stunned to learn the details of."
"As we see it, there is now a significant gap between what most Americans think the law allows and what the government secretly claims the law allows," the senators wrote. "This is a problem, because it is impossible to have an informed public debate about what the law should say when the public doesn't know what its government thinks the law says."
Has this happened before?
In 2006, it was revealed that the NSA was secretly collecting telephone records as part of an effort to root out potential terror plots.
At that time, Verizon denied reports that it was providing the NSA with data from customers' domestic calls. The company said that while it is committed to helping the government protect against terrorist attacks, "we will always make sure that any assistance is authorized by law and that our customers' privacy is safeguarded."
The Electronic Frontier Foundation is also suing the NSA over claims that it was working with AT&T and possibly other telecommunications companies to suck up enormous amounts of Internet traffic through secure NSA-controlled rooms attached to network stations.
Other programs, some going back decades, have stoked similar concerns. In fact, abuses by intelligence services led to the passage of the Foreign Intelligence Surveillance Act in an effort to rein in domestic surveillance practices.