MOSCOW, DEC. 27 -- Like most unofficial demonstrations in Moscow these days, the one yesterday on the anniversary of the Soviet invasion of Afghanistan was over before it began -- another victim of the swift and thorough crackdown on public dissent here.

About half of the dozen people who planned to protest in front of the General Staff building were detained as they set out from their homes, and the others, members of the group To Establish Trust Between East and West, were picked up by police before they had a chance to unfurl their banners.

Today, the Communist Party newspaper Pravda spelled out a hardening of the official line against unauthorized political activity with a harsh attack on informal clubs that sponsor illegal demonstrations and distribute anti-Soviet literature.

The editorial, which appeared to be an effort to define the hazy boundary between informal activity and unacceptable political behavior, was seen as a thinly veiled warning to groups such as the club Glasnost that for several months have been publishing independent journals on a range of views.

The recent crackdowns and today's editorial also reflect the ambivalence and confusion surrounding the degree of public openness or glasnost, which Soviet leader Mikhail Gorbachev says he is seeking to encourage in Soviet society.

Yesterday's police tactics are already familiar. Since the adoption in August of a Moscow city ordinance banning all but authorized demonstrations in the city center, Soviet security forces have consistently staged preemptive strikes against public protests, either by detaining demonstrators beforehand or by overwhelming them with a massive deployment of uniformed officers and plainclothed police, sometimes posing as demonstrators.

In recent weeks, these methods have been used against protesters seeking permission to emigrate and against demonstrators gathering at Pushkin Square for the traditional observance of the U.N. Human Rights Day. Only when demonstrations have been announced at the last minute have the authorities been caught off guard and the protest allowed to take place, if even for a matter of minutes before police arrive.

Last spring and summer, groups were allowed to hold small public demonstrations here without any overt interference. The trend culminated in a protest at Red Square by a group of Crimean Tatars in July. Many analysts believe that the Tatar protest prompted the issuance of the new city ordinance.

Now, the authorities seem mostly concerned about events in public places: an unofficial human rights seminar held earlier this month was denied access to local banquet halls, but the meetings in private apartments were unhindered, though kept under strict surveillance.

Soviet and western observers note that in the new atmosphere of openness proclaimed by Gorbachev, authorities are still showing more flexibility than they did in the past when any kind of dissident activity usually drew a jail term. So far in Moscow in the past year, no protester has been charged, tried or imprisoned for a long period. This appears to be a line that the authorities are reluctant to cross, perhaps out of concern for the barrage of criticism they would face from the West.

Today's Pravda editorial was directed at some of the unofficial clubs that have sprung up here in the past year under glasnost. The clubs, which range from youth groups to amateur societies to political lobbying groups, are said to number about 30,000 in the country.

While noting that most club members are honest people, Pravda accused some of the groups of being led by "rascals and demagogues" who carry out "provocations," agitate for the creation of opposition parties and free trade unions and spread a "surrogate culture."

"Their activities at times take on a clearly illegal character: without permission of authorities, they organize demonstrations, sometimes creating disorder, illegally print and distribute literature that is hostile to socialism."

The newspaper warned that these activites play into the hands of the Soviet Union's "ideological opponents who cherish the hope of establishing bourgeois-style 'pluralism' in the Soviet Union."

"Those who like to fish in troubled waters should understand that our course is not liberalization according to western notions but the deepening and spreading of socialist democracy," the paper concluded. "A true democracy does not exist outside the law: lawless democracy leads to anarchy."

The newspaper also made a pointed attack on both "anti-Semitic" and "Zionist" organizations. The former was viewed as a jibe at Pamyat, a strident Russian nationalist group that enjoys increasing popularity here, and the latter appeared to be aimed at Jewish groups lobbying for the right to emigrate.

Several articles have appeared lately in the Soviet press hinting at criticism of the controls placed on political discussion and assembly. They appear to be part of the debate on glasnost.

In a recent discussion printed in the newspaper Sovietskaya Kultura, one legal specialist noted that it was "not normal" for the Moscow City Council to adopt the demonstration ordinance that he said presses the limit of the Soviet constitution.

The freedom to demonstrate is a "purely declarative" right here, he noted. "For all that, in practice, it is assumed that no kind of demonstration, other than officially organized ones, can or will take place," said Mikhail Piskotin of the Institute for State and Law.

A recent article in the weekly Moscow News criticized the heavy police presence at Pushkin Square on Dec. 10, when an officially sponsored event drowned out the traditional silent vigil held at the site each year by Moscow human rights activists. Authorities used the same tactic on Dec. 6 when a hastily arranged official peace rally overwhelmed a demonstration by refuseniks, people denied permission to emigrate.

Without mentioning the unofficial vigil, the Moscow News reporter noted that the official human rights rally on Pushkin Square was forced because participants had evidently been required to attend. "Isn't it a paradox," she wrote, that people should be forced "in a rally dedicated to democracy and human rights."