
319 N.W.2d 796 (1982)
Richard Lee HAMPSON, Plaintiff and Appellant,
v.
Winston SATRAN, Defendant and Appellee.
Cr. No. 824.
Supreme Court of North Dakota.
May 27, 1982.
*797 Richard Lee Hampson, pro se.
Edwin F. Zuern, Asst. Atty. Gen., Bismarck, for defendant and appellee.
PAULSON, Justice.
Richard Lee Hampson appeals from the order issued by the District Court of Burleigh County on December 28, 1981, denying Hampson's application for relief under the Uniform Post-Conviction Procedure Act, Chapter 29-32, North Dakota Century Code. We affirm.
In an attempt to minimize the use of unlawful drugs by inmates at the North Dakota State Penitentiary, the prison administration has implemented a urine screening program to detect the use of controlled substances. Inmates who are to be tested for drug use are notified a day in advance of the scheduled testing. They are then required to report the next morning to the infirmary, where the urine sample is taken. The sample is then delivered to the North Dakota State Laboratory for analysis.
If the laboratory analysis of the sample produces a positive result, indicating drug usage, the inmate is deemed to have committed a serious offense under the North Dakota "good time" provision, Chapter 12-54.1, N.D.C.C. The penalty for a positive test result is the loss of four months' "good time." The penalty for a second offense is loss of four months' "good time" and a period of time in disciplinary segregation. Refusal to submit a urine sample is also treated as a serious offense, and the penalties for such refusal are the same as those for a positive test result.
On April 3, 1981, Hampson was ordered to submit a urine sample. Chemical analysis disclosed the presence of cannabinoids. On September 9, 1981, Hampson was again ordered to submit a urine sample. Again, chemical analysis disclosed the presence of cannabinoids. As a result of these two offenses, Hampson lost eight months' "good time," which amount to a total of fifty-six days.
Two issues are raised on appeal:
1) Does the urine screening program constitute an unreasonable search and seizure in violation of Hampson's rights under the Fourth Amendment to the United States Constitution?
2) Does the urine screening program violate Hampson's Fifth Amendment right against self-incrimination?

I.
Although convicted prisoners do not forfeit all of their constitutional rights by reason of their conviction and confinement in prison, the United States Supreme Court has consistently held that these rights may be subject to restriction or limitation. The Court has set out the applicable principles in this area in Bell v. Wolfish, 441 U.S. 520, 545-547, 99 S.Ct. 1861, 1877-1878, 60 L.Ed.2d 447 (1979):
"But our cases also have insisted on a second proposition: simply because prison inmates retain certain constitutional *798 rights does not mean that these rights are not subject to restrictions and limitations. `Lawful incarceration brings about the necessary withdrawal or limitation of many privileges and rights, a retraction justified by the considerations underlying our penal system.' Price v. Johnston, 334 U.S. 266, 285, 68 S.Ct. 1049, 1060, 92 L.Ed. 1356 (1948); see Jones v. North Carolina Prisoners' Labor Union, supra, 433 U.S., [119] at 125, 97 S.Ct., [2532] at 2538 [53 L.Ed.2d 629]; Wolff v. McDonnell, supra, 418 U.S., [539] at 555, 94 S.Ct., [2963] at 2974 [41 L.Ed.2d 935]; Pell v. Procunier, supra, 417 U.S., [817] at 822, 94 S.Ct. [2800], at 2804 [41 L.Ed.2d 495]. The fact of confinement as well as the legitimate goals and policies of the penal institution limits these retained constitutional rights. Jones v. North Carolina Prisoners' Labor Union, supra, 433 U.S., at 125, 97 S.Ct., at 2538; Pell v. Procunier, supra, 417 U.S., at 822, 94 S.Ct., at 2804. There must be a `mutual accommodation between institutional needs and objectives and the provisions of the Constitution that are of general application.' Wolff v. McDonnell, supra, 418 U.S., at 556, 94 S.Ct., at 2975. This principle applies equally to pretrial detainees and convicted prisoners. A detainee simply does not possess the full range of freedoms of an unincarcerated individual.
"Third, maintaining institutional security and preserving internal order and discipline are essential goals that may require limitation or retraction of the retained constitutional rights of both convicted prisoners and pretrial detainees. `[C]entral to all other corrections goals is the institutional consideration of internal security within the corrections facilities themselves.' Pell v. Procunier, supra, 417 U.S., at 823, 94 S.Ct. [2800], at 2804; see Jones v. North Carolina Prisoners' Labor Union, supra, 433 U.S., at 129, 97 S.Ct., at 2540; Procunier v. Martinez, 416 U.S. 396, 412, 94 S.Ct. 1800, 1810, 40 L.Ed.2d 224 (1974). Prison officials must be free to take appropriate action to ensure the safety of inmates and corrections personnel and to prevent escape or unauthorized entry. Accordingly, we have held that even when an institutional restriction infringes a specific constitutional guarantee, such as the First Amendment, the practice must be evaluated in the light of the central objective of prison administration, safeguarding institutional security. Jones v. North Carolina Prisoners' Labor Union, supra, 433 U.S., at 129, 97 S.Ct., at 2540; Pell v. Procunier, supra, 417 U.S., at 822, 826, 94 S.Ct., at 2804, 2806; Procunier v. Martinez, supra, 416 U.S., at 412-414, 94 S.Ct., at 1810-1812.
There can be little doubt that the State has a legitimate interest in minimizing drug traffic within the penitentiary. Drug traffic presents a very real threat to institutional security, internal order, and discipline. Therefore, the constitutional rights of the inmates may be restricted or limited in a reasonable manner to further the State's goal of minimizing drug usage within the penitentiary.
We note that other courts have upheld similar restrictions on inmates' rights when necessary to maintain institutional security and preserve internal order and discipline. For example, random, unannounced searches of inmate living quarters have been upheld when conducted for valid security reasons in a manner which is not unnecessarily intrusive. Olson v. Klecker, 642 F.2d 1115, 1117 (8th Cir. 1981). Warrantless, random body-cavity searches for contraband following an inmate's return from unsupervised absence to attend a local beauty college have been approved. United States v. Lilly, 576 F.2d 1240, 1243-1246 (5th Cir. 1978). In Bell v. Wolfish, the United States Supreme Court upheld strip searches and visual body-cavity searches which were conducted after every contact visit with a person from outside the prison. Bell v. Wolfish, supra, 441 U.S. at 558-561, 99 S.Ct. at 1884-1885.
When viewed in light of these cases, we believe that the urine screening program employed at the North Dakota State Penitentiary is a reasonable attempt to minimize drug usage and drug traffic within the penitentiary. We also note that a similar program has been implemented in the federal *799 prison system.[1] We conclude that the urine screening program, as presently implemented, is a reasonable manner of dealing with the drug problem at the penitentiary, and is not unnecessarily intrusive on the inmates' rights.
We note that the inmate is given advance warning of the pending urine analysis, and the actual taking of the sample is conducted by the penitentiary infirmary officer.[2] The prison administration has made every effort to make the urine screening program minimally intrusive on the inmates' privacy. Production of a urine sample is certainly less intrusive than a body-cavity search, which has been upheld by the United States Supreme Court and the United States Court of Appeals for the Eighth Circuit. In upholding extraction of a blood sample to determine the blood-alcohol level of a driver involved in an automobile accident, the United States Supreme Court stated, in Schmerber v. California, 384 U.S. *800 757, 771, 86 S.Ct. 1826, 1836, 16 L.Ed.2d 908 (1966) [citation omitted]:
"Similarly, we are satisfied that the test chosen to measure petitioner's blood-alcohol level was a reasonable one. Extraction of blood samples for testing is a highly effective means of determining the degree to which a person is under the influence of alcohol. Such tests are a commonplace in these days of periodic physical examinations and experience with them teaches that the quantity of blood extracted is minimal, and that for most people the procedure involves virtually no risk, trauma, or pain. Petitioner is not one of the few who on grounds of fear, concern for health, or religious scruple might prefer some other means of testing, such as the `breathalyzer' test petitioner refused, see n. 9, supra. We need not decide whether such wishes would have to be respected."
The production of a urine sample does not require penetration of the skin. The procedure is one without risk, trauma, or pain, and is not subject to religious scruples.
Under the circumstances, we conclude that the North Dakota State Penitentiary urine screening program is a reasonable and effective[3] means of dealing with drug problems within the penitentiary. Hampson's Fourth Amendment rights were not violated by his required participation in the program by production of a urine sample.

II.
Hampson also argues that the urine screening program violates his Fifth Amendment right against self-incrimination. In Schmerber, supra, the United States Supreme Court held that the privilege against self-incrimination only protects the accused from being compelled to testify against himself or to otherwise provide the prosecution with evidence of a testimonial or communicative nature. In holding that extraction of a blood sample from an unconsenting defendant was not violative of the Fifth Amendment, the Court stated:
"The distinction which has emerged, often expressed in different ways, is that the privilege is a bar against compelling `communications' or `testimony,' but that compulsion which makes a suspect or accused the source of `real or physical evidence' does not violate it.
* * * * * *
"Not even a shadow of testimonial compulsion upon or enforced communication by the accused was involved either in the extraction or in the chemical analysis. Petitioner's testimonial capacities were in no way implicated; indeed, his participation, except as a donor, was irrelevant to the results of the test, which depend on chemical analysis and on that alone. Since the blood test evidence, although an incriminating product of compulsion, was neither petitioner's testimony nor evidence relating to some communicative act or writing by the petitioner, it was not inadmissible on privilege grounds."
Schmerber, supra, 384 U.S. at 764-765, 86 S.Ct. at 1832-1833.
Schmerber has been applied in two decisions of this Court. In City of Wahpeton v. Johnson, 303 N.W.2d 565, 566 (N.D. 1981), and City of Wahpeton v. Skoog, 300 N.W.2d 243, 244-245 (N.D.1980), we held that field sobriety tests "do not activate the protections afforded by the Fifth Amendment." Similarly, we hold that the North Dakota State Penitentiary urine screening program does not violate Hampson's right against self-incrimination. The urine screening program in no way implicates Hampson's testimonial capacities; instead of producing testimonial or communicative evidence, the testing program requires only that Hampson submit to the gathering of real or physical evidence. City of Wahpeton v. Johnson, supra, 303 N.W.2d at 566.
*801 The order of the district court denying Hampson's application for post-conviction relief is affirmed.
ERICKSTAD, C. J., and PEDERSON, VANDE WALLE and SAND, JJ., concur.
NOTES
[1]  The federal urine screening program is outlined in 28 C.F.R. § 550.30 (1981):

"Subpart DUrine Surveillance to Detect and Deter Illegal Drug Use
"§ 550.30 Purpose and scope.
"(a) The Warden shall establish programs of urine testing for drug use, to monitor specific groups or individual inmates who are considered as high risk for drug use, such as those involved in community activities, those with a known history of drug use, and those inmates specifically suspected of drug use. Testing shall be performed with frequency determined by the Warden on at least 50 percent of those inmates who are involved in community activities. In addition, staff shall randomly sample each institution's inmate population during each month to test for drug use.
"(b) Institution staff shall have each positive urine test result validated to substantiate the positive result. If the inmate's urine test shows a positive result for the presence of drugs which the inmate cannot justify, staff shall file a disciplinary report.
"(c) If an inmate is unwilling to provide a urine sample within two hours of a request for it, staff may file a disciplinary report. To eliminate the possibility of diluted or adulterated samples, staff shall keep the inmate under direct supervision during this two-hour period."
A diligent search failed to produce any reported cases involving the federal urine screening program.
[2]  At the time Hampson was ordered to give urine samples, the prison administration had not yet formally adopted rules governing the urine screening program. In Matz v. Satran, 313 N.W.2d 740, 741-742 (N.D.1981), an inmate challenged the North Dakota State Penitentiary urine screening program on the grounds that the existing prison rules did not adequately inform the inmates that use of unauthorized drugs constituted a "serious rules infraction" for which more than one month's "good time" could be forfeited. We held that the existing rules did adequately warn the inmates that the use of unauthorized drugs constituted a "serious rules infraction," but suggested that the penitentiary administration immediately promulgate rules specifically governing loss of "good time." The penitentiary inmate handbook has since been updated, and now includes the following rules regarding the urine screening program:

"Urinalysis Program
"All inmates incarcerated at the N.D. State Penitentiary and State Farm will be required to submit to a urine testing program. The purpose of this program is to help provide a secure, humane, safe, and clean environment for all inmates and staff. No inmate is allowed to use any type of drug that was not prescribed by the medical staff of the institution.
1. Inmates are selected on a random basis.
2. Inmates are tested at irregular intervals.
3. Inmates who are suspected of drug usage may be screened more frequently.
4. Urine samples are produced under direct observation by an officer.
5. Before an inmate is moved to the Honor Dorm, he will be required to submit to a urine test.
6. Refusals are handled as positive findings. Positive analysis results in an inmate being referred to the Adjustment Committee.
7. Urine samples will be tested at the North Dakota State Laboratory.
"Inmates selected to submit a urine sample will be notified the night prior to the sample being taken. In the event an inmate refuses to submit the urine sample, an incident report will be written for `Refusing to Obey an Order'. The action taken will be the same as if the test was found to be positive which is loss of four months' good time. If it is the second offense, the Adjustment Committee's recommendation will be loss of four months' good time and a period of time in Disciplinary Segregation.
"Anyone refusing to submit to a urine sample or found with a positive test is considered to have committed a serious offense under the good time provision of Chapter 12-54.1 of the North Dakota Century Code.
"Warning notices will be forwarded to inmates with test results under the 20 n1/mg."
[3]  Although there was no evidence in the record on this issue, counsel for the warden informed the Court at oral argument that the program has significantly decreased drug usage within the penitentiary. At the time the program was first implemented, approximately half of the urine samples submitted by inmates tested positive, indicating drug usage. Currently, only ten percent of the samples test positive.
