Washington (CNN) -- Many Americans may be outraged at the level of data mining secretly conducted by the U.S. government in recent years -- phone records, e-mail, and Internet use.
Telecom companies that allegedly provided the information under court order may also be unhappy. If they are, the current law makes it hard for them to say no, and for the public to find out about it.
"Technically, I think it's possible to fight it," said Steven Aftergood of the Federation of American Scientists and its Project on Government Secrecy. "This is not a request from the FBI. This is an order from the court. Now, it's possible to appeal it to another court. It's a stretch and you'd need some plausible justification to do it. It's not the administration running amok in that sense. But all of this is being done behind closed doors and it's inappropriate."
Even so, published reports this week claim that intelligence agencies have under the law the authority to collect vast amounts of so-called metadata from telecom giant Verizon and leading Internet companies, including Microsoft, Apple, Google, Yahoo and Facebook.
The revelations have triggered new debate about national security and privacy interests, and about the secretive legal process that sets in motion the government surveillance.
President Barack Obama publicly defended the program, saying his administration is trying to balance the need to fight terrorism with the need to protect individual liberties. He says Congress knows all about it and that there are legal checks in place.
"Nobody is listening to the content of people's phone calls," without a specific national security focus, he said Friday. "This program, by the way, is fully overseen not just by Congress but by the FISA court, a court specially put together to evaluate classified programs to make sure the executive branch or government, generally, is not abusing them -- and that it's being carried out consistent with the Constitution."
Two types of snooping
In essence, two types of authorized snooping "applications" are at play in the current debate.
There are orders under the Foreign Intelligence Surveillance Act (FISA) in which a special federal court approves individual requests for electronic surveillance for "foreign intelligence purposes."
There is also the more common "National Security Letters," which are separate from a subpoena or court mandate. They go directly to a telecommunications company or similar entity, along with a gag order, for more general information concerning people in the United States.
This compelled disclosure without prior judicial oversight is for "non-content" material -- phone numbers called, or e-mail addresses.
The process is conducted entirely behind closed doors, with only one side making the case, all in the name of national security.
Privacy advocates like the Electronic Frontier Foundation and the American Civil Liberties Union (ACLU) as well as individual telecom customers -- even a few lonely companies themselves -- have challenged various National Security Agency programs. But they ultimately have not been successful in federal courts.
The Supreme Court in February blocked a lawsuit over sweeping electronic eavesdropping on Americans potentially linked to suspected foreign terrorists and spies.
At issue in that appeal was whether American plaintiffs who deal with overseas clients and co-workers can sue if they reasonably suspect -- but cannot know for sure -- whether the government was reading and hearing their sensitive communications.
FISA was revised by Congress in 2008 to give the attorney general and the director of national intelligence greater authority to order "mass acquisition" of electronic traffic from suspected foreign terrorists or spies.
The law previously required the government to justify a national security interest before any monitoring of phone calls and e-mails originating in another country. A federal judge has to sign any search warrant.
The 5-4 conservative majority concluded the plaintiffs -- which included attorneys and journalists -- lacked "standing" or jurisdiction to proceed without proof that eavesdropping had occurred.
But the super-secret National Security Agency (NSA) has refused to disclose specifics, which detractors call a "Catch-22."
The justices did not address larger questions of the program's constitutionality. This ruling will make it harder for future lawsuits to proceed.
But what about telecom firms themselves. Can they resist or even reveal a government order to produce customer records, or allow direct server monitoring of electronic traffic?
The answer is maybe, but good luck.
The Wall Street Journal last year revealed a company in northern California formally protested such a request in 2011.
In heavily redacted court documents leaked to the paper, the unnamed firm was given a National Security Letter by the FBI as part of an "authorized" investigation into what it said was "international terrorism or clandestine intelligence activities."
In a civil complaint filed under seal, the government said the company's failure to comply "interferes with the United States' vindication of its sovereign interests in law enforcement, counterintelligence, and protecting national security."
Just as importantly, the company suggested its free speech rights were violated by gag orders that prevented it from acknowledging publicly the order or their concerns.
A federal judge ruled against the government, which is expected to appeal.
It is only the second time a company is known to have resisted a National Security Letter.
Nicholas Merrill, owner of a small Internet Service Provider took his case to court in 2004, but the government later dropped the request.
Super-secret FISA court
Then there are the separate FISA judicial actions played out in a bunker-like section of the U.S. District Court in Washington, just a few blocks from the Capitol and Supreme Court.
There, the special court secretly decides whether to grant certain types of government requests -- wiretapping, data analysis, and other monitoring of possible terrorists and spies operating in the United States.
Legal sources say the tiny courtroom and adjacent areas are sealed tightly -- ironically given the political debate -- to prevent any eavesdropping by outsiders.
Eleven federal judges from around the country serve on the court for seven-year terms. They are appointed by the chief justice of the United States.
John Roberts has named all current members, as a well as a three-judge panel to hear appeals of FISA orders, known as the Court of Review.
Since there has been no public acknowledgment by any named company of its compliance or non-compliance with a FISA order-- it is fair to assume the FISA courts have never overturned a nondisclosure order.
Because it an "ex-parte" body-- hearing only the government's side-- it has been criticized as a kangaroo court that too easily accedes to any government request.
In order to collect the information, the government has to demonstrate that it's "relevant" to an international terrorism investigation, according to Jimmy Gurule, a former assistant attorney general and undersecretary for enforcement at the Treasury Department.
"The question is how the phone data of tens of millions of Americans is 'relevant' to a terrorism investigation. This is clearly an overreach by the NSA and an apparent rubber stamp by the FISA court," said Gurule, currently a professor at the University of Notre Dame.
But the 1978 FISA law lays out exactly what the special court must decide:
"A judge considering a petition to modify or set aside a nondisclosure order may grant such petition only if the judge finds that there is no reason to believe that disclosure may endanger the national security of the United States, interfere with a criminal, counterterrorism, or counterintelligence investigation, interfere with diplomatic relations, or endanger the life or physical safety of any person."
Two federal judges contacted by CNN, who once served on the FISA court, separately refused to discuss their service.
Surveillance stepped up post 9/11
The law has been in place for 35 years, but the government has acknowledged electronic surveillance was stepped up significantly after the September 11, 2001, attacks.
The former West Coast-based telecom known as Qwest Communications International, Inc. has acknowledged refusing an NSA request for customer calls in the months before 9/11.
The company reiterated that refusal in the months after the attacks.
In a story first reported by USA Today in 2006, unsealed documents said the NSA was covertly gathering phone records of tens of millions of Americans, from information provided by major telecom firms.
Qwest was the only major company at the time known to have refused to participate in the program, after then-CEO Joseph Nacchio concluded it was possibly unconstitutional.
"Mr. Nacchio made inquiry as to whether a warrant or other legal process had been secured in support of that request," Nacchio attorney Herbert Stern said in 2006.
"When he learned that no such authority had been granted and that there was a disinclination on the part of the authorities to use any legal process, including the special court which had been established to handle such matters, Mr. Nacchio concluded that these requests violated the privacy requirements of the Telecommunications Act," Stern said.
It was during that time in the weeks after 9/11 that Congress passed the Patriot Act.
That law and subsequent 2008 revisions made it easier for the government to request electronic records, harder for companies to refuse -- and nearly impossible for them to voice their concerns publicly.
It was not clear exactly what the NSA wanted from Qwest. The Qwest disclosure came when the Nacchio was accused of insider trading, and documents were released as part of that prosecution.
Separate federal law
A separate federal law was passed a few years ago giving telecoms a level of retroactive immunity from lawsuits for any cooperation with the government when they hand over electronic records. Some legal analysts say that may be another reason companies are not as vocal complaining about the court orders to turn over records.
The Justice Department said in 2012, the government made 1,856 applications to the FISA court for electronic surveillance and physical searches for "foreign intelligence purposes."
None of the applications was denied by the judges, but 40 were modified to some extent by the court. Only one such request was withdrawn by the FBI.
Of that total, 212 involved access to "certain business records," likely phone and other database material. Requests to listen in on individual phones or to read individual email accounts would have required a separate warrant.
In addition to the FISA orders, the FBI last year sent 15,229 National Security Letter requests for information concerning 6,223 different U.S. persons.
Those applications went directly to a particular company or entity, demanding compliance. That number was up slight from 2011. From 2003 to 2006 the FBI made 192,499 national security letter requests.
A federal judge in San Francisco in March ruled the NSLs unconstitutional, saying the disclosure regulations were "impermissibly overbroad." That ruling is being appealed by the government.
Judge Susan Illston concluded the unnamed company is "adamant about its desire to speak publicly about the fact that it received the National Security Letter at issue to further inform the ongoing public debate" on when and whether the Obama administration can make such unilateral requests.
Ninety-seven percent of the approximately 200,000 compliance letters included a specific gag order.