OVERVIEW
Prison officials Gary R. Souza, T.M. De La Rosa, and G.D. Jordan (collectively, “Officials”) appeal the district court’s order denying their motion for summary judgment based on qualified immunity. California state prisoner Charles W. Thompson sued the Officials pursuant to 42 U.S.C. § 1983, alleging that a strip search and urinalysis drug test for contraband drugs violated his constitutional rights under the Fourth and Fourteenth Amendments. Because Thompson has failed to show that the strip search and urinalysis test violated any clearly established constitutional rights, we reverse.
FACTUAL BACKGROUND
Thompson is serving a fifteen-year-to-life sentence at the California Men’s Colony (“CMC”) for second-degree murder.1 At the time of the conduct at issue in this case, Official Souza was the Associate Warden at CMC; Official De La Rosa was a Correctional Sergeant in the Security and Investigations Unit at CMC; and Official Jordan was an Evidence Officer in the same unit.
*697In June 1994, Souza and De La Rosa developed a plan to detect illicit drugs at CMC. The plan called for prison staff to remove pre-selected inmates, and their cellmates, from their cells after the 11:30 p.m. facility count on July 10, 1994. The preselected inmates were chosen because of their prior involvement with illicit drugs. According to the plan, guards would remove the inmates from their cells and temporarily place them in day rooms while K-9 units searched their cells for drugs. After the cell searches, guards would collect urine samples from the inmates for urinalysis drug testing.
In the early morning hours of July 11, the Officials subjected 129 inmates from a population of about 3400 inmates to the search plan. A prison guard videotaped the removal of some inmates from their cells for possible use as a training video. De La Rosa also used the searches as an opportunity to train several correctional personnel on the proper method for performing strip searches. These strip searches were not discussed in the search plan. Of the 129 inmates subjected to the strip and cell searches, one possessed contraband, and sixteen tested positive for narcotics use.
At the time of Thompson’s search, he was assigned to a double cell with inmate Michael Brown. Brown had two previous disciplinary violations related to drug use.- Therefore, De La Rosa targeted Brown’s and Thompson’s cell as one of those to be searched. At 2:15 a.m. on July 11, guards removed Thompson and Brown from their cell and visually inspected their genitals and rectal areas as part of a strip search.
The strip search took place within view of other prisoners on the tier just outside Thompson’s cell. Thompson heard some prisoners laughing or whistling. During the search, De La Rosa commanded Thompson to:
• remove his briefs and tank top and “throw them on the floor;”
• “Squat down like you’re taking a shit and cough three times;”
• “Now stand up and bend over and spread your ass apart and cough three times;”
• “Now stand up, put your- hands back on the wall, and show me the bottom of your feet one at a time;”
• “Now turn around and hold out your hands;”
• “Now lift your balls;”
• “Let your balls go and lift your dick;”
• “Now open your mouth and run your fingers around your gums;”
• “Now lift your tongue;”
• “Now bend toward me and run your fingers through your hair;”
• “Now turn your head so I can look in each of your ears;” and
• “Now pick up your underwear and put it on.”
Thompson complied with each of these orders.
After the strip search, guards placed Thompson in a day room with other inmates to wait while his cell was searched by a K-9 unit. Guards kept Thompson in the day room for five hours before taking his urine sample. The day room did not have toilet facilities, and at least one inmate urinated in the day room. Official Jordan ordered inmates to give urine samples beginning at 6:00 a.m. Prison security staff determined which inmates they would test, and they ultimately tested 124 of the 129 inmates removed from their cells. At 7:00 a.m., guards took Thompson from the day room so he could provide a mine sample.
Jordan ordered Thompson to give a urine sample. Thompson, in bare feet, was taken to a damp toilet stall where Jordan ordered Thompson to begin urinating. Jordan handed Thompson a bottle to collect the sample. Jordan remained within eight inches of Thompson and continuously watched while Thompson urinated. Both Thompson’s and Brown’s mine samples tested negative for drugs. At 10:30 a.m., guards released Thompson and Brown from the day room back to their cell.
PROCEDURAL BACKGROUND
On July 29,1994, Thompson sued the Officials for violations of his civil rights, pursuant to 42 U.S.C. § 1983. The Officials moved for *698summary judgment based on qualified immunity. Thompson also moved for summary judgment. In a terse ruling, Magistrate Judge Stephen J. Hillman denied both motions, stating only:
Defendants’ Motion for Summary Judgment is DENIED. Defendants have failed to cite to any exhibit or declaration establishing “reasonable justification” for the strip search and body cavity search of plaintiff. Defendants, by wholly adopting plaintiffs statement of uncontroverted facts, have conceded that the strip search and body cavity search were not intended [(i.e., were not explicitly provided for in the search plan) ]____
Moreover, defendants’ [sic] address plaintiff[’]s claim regarding the urine sample as an Eight[h] Amendment issue. However, plaintiffs complaint clearly asserts a cause of action under the Fourth Amendment. Plaintiffs Motion for Summary Judgment is also DENIED. Plaintiff has not established that, under the circumstancesfj the Fourth and Fourteenth Amendments prohibited the visual body cavity search and urine testing of plaintiff.
(Emphasis added).
Apparently, the district court adopted the magistrate’s ruling (this fact is not clear from the record). The Officials appeal this ruling.
STANDARD OF REVIEW
We review the denial of summary judgment based upon a claim of qualified immunity de novo. Act Up!/Portland v. Bagley, 988 F.2d 868, 871 (9th Cir.1993).
DISCUSSION
The doctrine of qualified immunity protects “government officials performing discretionary functions ... from liability for civil damages insofar as their conduct does not violate clearly established statutory or constitutional rights of which a reasonable person would have known.” Harlow v. Fitzgerald, 457 U.S. 800, 818, 102 S.Ct. 2727, 2738, 73 L.Ed.2d 396 (1982). While public officials are thus generally protected from civil liability under the doctrine, the defense will fail when their actions violate law that is clearly established, because “a reasonably competent public official should know the law governing his conduct.” Id. “The qualified immunity standard gives ample room for mistaken judgments by protecting all but the plainly incompetent or those who knowingly violate the law.” Hunter v. Bryant, 502 U.S. 224, 229, 112 S.Ct. 534, 537, 116 L.Ed.2d 589 (1991).
To determine whether an official is entitled to qualified immunity, we conduct a two-part analysis: (1) we consider whether the law governing the official’s conduct was clearly established. If it was not clearly established, the official is entitled to immunity from suit. If the law was clearly established, we proceed to ask (2) if, under that law, a reasonable official could have believed his conduct was lawful. If so, the official is entitled to immunity from suit. See Act Up!/Portland, 988 F.2d at 871. Thus, an official is denied qualified immunity only if the law was clearly established and a reasonable official could not have believed the conduct was lawful.
Thompson bears the initial burden of proving that the Officials violated rights clearly established under the Fourth or Fourteenth Amendment. Neely v. Feinstein, 50 F.3d 1502, 1506 (9th Cir.1995). If the law was not clearly established at the time that the acts occurred, “an official could not reasonably be expected to anticipate subsequent legal developments, nor could he fairly be said to ‘know1 that the law forbade conduct not previously identified as unlawful.” Harlow, 457 U.S. at 818, 102 S.Ct. at 2738. Under such circumstances, the Officials are entitled to immunity. Id.
Applying the above principles, it is apparent that the magistrate judge misinterpreted the appropriate burdens. Relying on undisputed facts, the magistrate concluded that Thompson “has not established that, under the cireumstances[,] the Fourth and Fourteenth Amendments prohibited the visual body cavity search and urine testing of plaintiff.” It is therefore apparent from the face of the magistrate’s ruling that Thompson has not met his burden of establishing *699that the Officials violated clearly-established law.
Notwithstanding the facial infirmity in the magistrate’s ruling, we consider whether Thompson had a clearly established right that was violated. We conclude that the Officials were entitled to qualified immunity on all of Thompson’s claims.
A. THE STRIP SEARCH
1. The Fourth Amendment
The Supreme Court has not decided whether prison inmates retain rights cognizable under the Fourth Amendment.2 In Hudson v. Palmer, 468 U.S. 517, 527, 104 S.Ct. 3194, 3201, 82 L.Ed.2d 393 (1984), the Court said “[a] right of privacy in traditional Fourth Amendment terms is fundamentally incompatible with the close and continual surveillance of inmates and their cells required to ensure institutional security and internal order.” As of today, however, only the Seventh Circuit has declared that prisoners do not have privacy interests protected by the Fourth Amendment. See Johnson v. Phelan, 69 F.3d 144, 150 (7th Cir.1995), cert. denied, — U.S. -, 117 S.Ct. 506, 136 L.Ed.2d 397 (1996).
Notwithstanding the language in Hudson, our circuit has held that the Fourth Amendment right of people to be secure against unreasonable searches and seizures “extends to incarcerated prisoners; however, the reasonableness of a particular search is determined by reference to the prison context.” Michenfelder v. Sumner, 860 F.2d 328, 332 (9th Cir.1988).
In Turner v. Safley, 482 U.S. 78, 89, 107 S.Ct. 2254, 2261, 96 L.Ed.2d 64 (1987), the Supreme Court stated “when a prison regulation impinges on inmates’ constitutional rights, the regulation is valid if it is reasonably related to legitimate penological interests.” The Court identified four factors to guide reviewing courts in applying this test: 1) the existence of a valid, rational connection between the prison regulation and the legitimate governmental interest put forward to justify it; 2) the existence of alternative means of exercising the right that remain open to prison inmates; 3) the impact that accommodation of the asserted constitutional right will have on guards and other inmates, and on the allocation of prison resources generally; and 4) the absence of ready alternatives as evidence of the reasonableness of the regulation. Id. at 89-91, 107 S.Ct. at 2261-63.
The Supreme Coúrt has held that Turner applies whenever “the needs of prison administration implicate constitutional rights.” Washington v. Harper, 494 U.S. 210, 224, 110 S.Ct. 1028, 1038, 108 L.Ed.2d 178 (1990). Thus, courts have applied the Turner test to prisoners’ Fourth Amendment claims, as well as their First and Fourteenth Amendment claims. See, e.g., Covino v. Patrissi, 967 F.2d 73 (2d Cir.1992); Michenfelder, 860 F.2d at 331. In Michenfelder, we said:
Not all four factors will be relevant to each case. For example, the second Turner factor — availability of other avenues for exercising the right infringed upon — is much more meaningful in the [Fjirst [A’Jmendment context than the [FJourth or [Ejighth, where the right is to be free from a particular wrong. Though all our prior decisions employing the Turner ... analysis have involved infringements of inmates’ [F]irst [Ajmendment rights, Reimers v. Oregon, 846 F.2d 561 (9th Cir.1988) (free exercise); McElyea v. Babbitt, 833 F.2d 196, 197 (9th Cir.1987) (same); Standing Deer v. Carlson, 831 F.2d 1525, 1528-29 (9th Cir.1987) (same); McCabe v. Arave, 827 F.2d 634, 637-38 (9th Cir.1987) (free exercise and speech); Allen v. Toombs, 827 F.2d 563, 567-68 (9th Cir.1987) (free exercise), as w[as] ... Turner v. Safley ..., we believe that Turner v. Safley’s suggested factors can be instructive in the context of other prisoners’ rights cases, and have considered them here where applicable.
860 F.2d at 331 n. 1.
In Michenfelder, we applied the Turner test to a prison strip search policy. We concluded that the strip searches were reasonably related to legitimate penological in*700terests. 860 F.2d at 333. In reaching this conclusion, we analyzed the strip searches in light of the balancing test set forth by the Supreme Court in Bell v. Wolfish, 441 U.S. 520, 99 S.Ct. 1861, 60 L.Ed.2d 447 (1979). In Bell, decided before Turner, the Supreme Court assumed arguendo that prisoners retain some right of privacy under the Fourth Amendment and articulated the following test to determine a search’s reasonableness:
The test of reasonableness under the Fourth Amendment is not capable of precise definition or mechanical application. In each ease it requires a balancing of the need for the particular search against the invasion of personal rights that the search entails. Courts must consider the scope of the particular intrusion, the manner in which it is conducted, the justification for initiating it, and the place which it is conducted.
Id. at 559, 99 S.Ct. at 1884. “The Court obviously recognized that not all strip search procedures will be reasonable; some could be excessive, vindictive, harassing, or unrelated to any legitimate penological interest.” Mi-chenfelder, 860 F.2d at 332. Therefore, following our approach in Michenfelder, we consider the reasonableness of Thompson’s strip search to help us determine if it was reasonably related to legitimate penological interests.
a. Scope and Manner
The strip search conducted on Thompson was visual only. It did not involve any touching. Compare Michenfelder, 860 F.2d at 332 (upholding visual body cavity searches); with Bonitz v. Fair, 804 F.2d 164, 172-73 (1st Cir.1986) (rejecting as unreasonable contact body cavity searches of female inmates conducted by police officers, without medical personnel, in non-hygienic manner and in presence of male officers). We have previously said that “[vjisual body cavity searches conducted after contact visits as a means of preventing prisoners’ possession of weapons and contraband, even absent probable cause, have been found reasonable by the Supreme Court.” Michenfelder, 860 F.2d at 332 (citing Bell, 441 U.S. at 558-60, 99 S.Ct. at 1884-85).
In Michenfelder, we said that the prisoner “bears the burden of showing that [prison] officials intentionally used exaggerated or excessive means to enforce security.” Id. at 333. Thompson has made no such allegation. At best, he contends that the search was not done according to CMC-recommended procedure because he was told to “run his fingers around his gums” after manipulating his genitalia. CMC regulations suggest that genitalia should be visually searched as the last step in the search process. Although the Officials did not conduct his search exactly in accordance with the CMC guidelines, they did not employ “exaggerated or excessive means.”3
b. Justification
The magistrate stated that the Officials have “failed to cite to any exhibit or declaration establishing ‘reasonable justification’ for the strip search and body cavity search of plaintiff’ and that “Defendants, by wholly adopting plaintiffs statement of uncontro-verted facts, have conceded that the strip search and body cavity search were not intended.” Thus, the only evidence in support of Thompson’s claim that the strip searches were not justified is that the strip searches were not “intended” in the written plan. We fail to see how this fact suggests that the searches were conducted without a legitimate penological purpose. Thompson was not the only inmate subjected to the strip search — all 129 inmates removed from their cells were strip searched. The purpose of the searches, and the entire search plan, was clear — to detect illicit drugs. In fact, one inmate was found in possession of contraband and sixteen inmates tested positive for drug use. Simply because the searches were not “intended” in the search plan, we refuse to infer that the searches were not justified, absent evidence to the contrary.
*701c. Place
Thompson argues that the strip searches should have been conducted in a more private location, out of view of the other prisoners. A similar argument was rejected in Michenfelder, where the court stated it would not question the prison officials’ judgment that the conditions required searches outside the prisoners’ cells in order to protect the safety of the officers conducting them. 860 F.2d at 333. Furthermore, having the searches in an entirely separate area, as Thompson suggests, would potentially allow prisoners to discard contraband on the way to the separate area.
In sum, Thompson failed to meet his burden by showing that the strip search violated a clearly established right protected by the Fourth Amendment.4 In fact, there is no more than a scintilla of evidence in the record to suggest that the searches were carried out in an unprofessional manner. The record therefore demonstrates that the strip searches were reasonably related to the Officials’ legitimate penological interest in keeping drugs out of the prison.
2. The Fourteenth Amendment
The Due Process Clause of the Fourteenth Amendment provides that no State shall “deprive any person of life, liberty, or property, without due process of law____” U.S. Const, amend. XIV § 1. The Fourteenth Amendment prohibits prison officials from “treating prisoners in a fashion so ‘brutal’ and ‘offensive to human dignity’ as to ‘shock the conscience.’ ” Vaughan v. Ricketts, 859 F.2d 736, 742 (9th Cir.1988) (quoting Rochin v. California, 342 U.S. 165, 172, 72 S.Ct. 205, 209, 96 L.Ed. 183 (1952)). “Conduct that amounts to brutality violates a liberty interest protected by the [Fourteenth [A]mendment’s due process clause, the right to be secure in one’s person.” Id. Therefore, to defeat a claim of qualified immunity, Thompson must show that the Officials’ conduct was “maliciously and sadistically applied for the purpose of causing harm.” Id.
Nothing in Thompson’s statement of uncontroverted facts gives rise to a claim of brutality or force. The Officials did not touch Thompson, nor did they subject him to possible injury. Cf. Vaughan, 859 F.2d at 742 (concluding digital cavity searches were “conducted in a brutal fashion,” where extent of possible injury was great, and at least one inmate suffered significant injury). Because Thompson has not proved that the Officials’ conduct violated clearly established law, we reverse the order of the district court denying the Officials qualified immunity as to the strip search claim.
B. THE DRUG TEST
As an initial matter, we note that our circuit has not published any opinions regarding compelled urinalysis in the prison setting. This fact alone is significant evidence that the Officials are entitled to qualified immunity — there does not exist any law of our circuit for the Officials to have violated. Looking at the law of other circuits, as well as our cases related to urinalysis testing outside the prison setting, we conclude that Thompson’s drug test did not violate any constitutional right, let alone a clearly established right.
The Supreme Court has declared that compelled urinalysis constitutes a search or seizure within the meaning of the Fourth Amendment. Skinner v. Railway Labor Executives’Ass’n, 489 U.S. 602, 617, 109 S.Ct. 1402, 1413, 103 L.Ed.2d 639 (1989) (stating that urinalyses “must be deemed searches under the Fourth Amendment”). As a result, to avoid the proscription of the Fourth Amendment, urinalyses must be conducted in a reasonable manner. Id. at 618, 109 S.Ct. at 1413-14. However, prison administrators are accorded “wide-ranging deference in the adoption and execution of policies and practices that in their judgment are needed to preserve internal order and discipline and to maintain institutional security.” Bell, 441 U.S. at 547, 99 S.Ct. at 1878.
As stated earlier in this opinion, the Supreme Court has not decided whether prison *702inmates retain cognizable rights of privacy under the Fourth Amendment. Assuming arguendo that they do possess such rights, we analyze the reasonableness of the instant drug test to determine if the drug test was reasonably related to legitimate penological interests. Reasonableness in the context of prison administration requires “[b]alancing the significant and legitimate security interests of the institution against the privacy interests of the inmates.” Id. at 560, 99 S.Ct. at 1885. At least two circuits have adopted the Bell balancing test in response to prison inmates’ challenges to random urinalysis and have concluded that, upon a determination that the procedures for selecting the inmates to be tested are “truly random,” such testing is not unreasonable. See, e.g., Spence v. Farrier, 807 F.2d 753, 755 (8th Cir.1986); Forbes v. Trigg, 976 F.2d 308, 315 (7th Cir.1992); see also Storms v. Coughlin, 600 F.Supp. 1214, 1223 (S.D.N.Y.1984) (procedure for selecting inmates for testing not “truly random” and thus unreasonable where prison official selected cards representing inmates off a bulletin board). The requirement of random tests stems from a concern that correctional officials could harass particular inmates by subjecting them to repeated drug tests. See Forbes, 976 F.2d at 315.
Applying the balancing factors discussed in Bell, in light of the test articulated in Turner, we' conclude that Thompson’s urinalysis was reasonably related to legitimate penological interests.
1. Scope and Manner
It is undisputed that Thompson’s drug test was not “random.” Inmates were preselected by the Officials to have their cells searched based on previous drug violations. We therefore must decide whether a nonrandom urinalysis test can be reasonable. Significantly, out of the 129 inmates whose cells were searched, 124 were required to submit to urinalyses (it is unclear from the record why five inmates did not give a urinalysis). At least one court has recognized that where large numbers of inmates are required to give urinalyses, the danger of prison officials harassing particular prisoners is “illusory.” Forbes, 976 F.2d at 315 (‘We refuse to accept the supposition that a urine test of all inmates [from a particular building] conducted at the same time, under the same conditions, .could constitute harassment of one of the inmates.”). Here, although the testing selection procedure did allow the Officials to choose which CMC prisoners they would test, the agreed facts are devoid of any suggestion of inappropriate harassment.
Thompson also notes that at the time Official Jordan ordered inmates to submit samples, he believed “that the inmates to be tested for drugs and alcohol had been selected by using K-9 Unit dogs to give alerts.” Jordan subsequently learned during the course of litigation in the instant case that the dogs were only used to alert prison staff to search specific cells. Prison Security staff determined which inmates were to be drug tested. This circumstance, however, is of no moment, because the facts show that the urinalysis was intended for no other purpose than to detect illicit drugs.
We conclude that where prison officials select a large number of inmates for testing based upon legitimate criteria, the danger discussed in Storms and other cases — that correctional officials could harass particular inmates by subjecting them to repeated tests — -is wholly illusory. We refuse to accept the proposition that a urine test of so many inmates (in this case, 124) conducted at the same time, under the same conditions, could constitute harassment of one of the inmates. See Forbes, 976 F.2d at 315.
2. Justification
There is no question that “use of narcotics is a problem that plagues virtually every penal and detention center in the country.” Spence, 807 F.2d at 755. Thompson’s main argument is that, although the Officials may have had legitimate reasons to give his cellmate a drug test, there was no reason to require him to submit to a urinalysis. Thus, he contends, his drug test was not justified. In support, Thompson points to the search plan and alleges that it “recognized that an occupant of a double-man cell who was not suspected, would not be subjected to urinaly- • sis unless the cell received a dog alert for the scent of drugs.” On the next page, however, *703the plan states that “[a]ll inmates removed from their cell will be ordered to submit a urine sample prior to being re-housed back in their assigned cells.” This statement supports the proposition that the drug test was not intended to harass Thompson, but rather the test was an attempt to curb the use and flow of drugs among “persons in a volatile environment peculiarly susceptible to drugs.” American Fed. of Gov’t Employees, AFL-CIO v. Roberts, 9 F.3d 1464, 1468 (9th Cir.1993) (upholding random drug testing of prison guards). The fact that sixteen inmates tested positive for narcotics use — testing positive even though they were confined in a place designed to prevent them from breaking the law — emphasizes the importance and justification for such tests.
3. Place
The drug test was given in a bathroom, where Thompson and Official Jordan were the only people present. The floor was damp and Thompson did not have shoes. Jordan stood within eight inches of Thompson’s side and continuously watched Thompson urinate into a small plastic bottle. Thompson contends this procedure was unnecessarily humiliating. However, there were no members of the opposite sex viewing his urination, and no other inmates could see him. Cf. Storms, 600 F.Supp. at 1222 (unreasonable to collect urine from male inmates in location where female nurses and others can watch procedure). The presence of the guard was reasonable to safeguard the integrity of the test and to maintain control over the prisoner. Therefore, the location of his drug test was not unreasonable.
In sum, Thompson’s urinalysis was reasonably related to legitimate penological interests. A balance of his alleged privacy expectations against the Officials’ security interests weighs in favor of the Officials in their attempt to curb the use and flow of drugs among “persons in a volatile environment peculiarly susceptible to drugs.” Roberts, 9 F.3d at 1468. The urinalysis did not violate Thompson’s alleged Fourth Amendment rights.5
CONCLUSION
Given the undisputed facts, Thompson did not show that the prison Officials violated any rights “clearly established” by the Fourth or Fourteenth Amendment. This lawsuit is precisely what qualified immunity is designed to protect prison officials against. We therefore REVERSE the order of the district court denying the Officials qualified immunity, and we REMAND with instructions to grant the Officials qualified immunity-
REVERSED AND REMANDED WITH INSTRUCTIONS.
. All facts are taken from Thompson's “Statement of Uncontroverted Facts,” which, for purposes of summary judgment, the Officials stipulated were true.
. The Fourth Amendment protects "[t]he right of the people to be secure in their persons ... against unreasonable searches and seizures.... U.S. Const, amend. IV.
. Thompson has not claimed that the violation of this CMC regulation creates a liberty interest, nor could he make such a claim. See Sandin v. Conner, - U.S. -, -, 115 S.Ct. 2293, 2299, 132 L.Ed.2d 418 (1995) (noting that state prison regulations are "not designed to confer rights on inmates”).
. Assuming arguendo he possesses any Fourth Amendment rights at all in light of the Supreme Court’s language in Hudson v. Palmer, 468 U.S. 517, 527, 104 S.Ct 3194, 3200, 82 L.Ed.2d 393 (1984).
. Thompson does not allege that the urinalysis violated any Fourteenth Amendment right.
. The facts as presented by Thompson are assumed true for the purposes of summary judgment.