home *** CD-ROM | disk | FTP | other *** search
/ Hackers Toolkit v2.0 / Hackers_Toolkit_v2.0.iso / HTML / archive / Rainbow / ncsc / borangencsc.txt < prev    next >
Text File  |  1999-11-04  |  216KB  |  3,881 lines

  1.         NCSC-TG-023
  2.  
  3.         VERSION-1
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.               NATIONAL COMPUTER SECURITY CENTER
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.                          A GUIDE TO
  30.  
  31.                        UNDERSTANDING
  32.  
  33.                       SECURITY TESTING
  34.  
  35.                        AND
  36.  
  37.                        TEST DOCUMENTATION
  38.  
  39.                      IN
  40.  
  41.                       TRUSTED SYSTEMS
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.                       July 1993
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.               Approved for Public Release:
  60.  
  61.               Distribution Unlimited.
  62.  
  63.  
  64.  
  65. NCSC-TG-023
  66. Library No. S-232.561
  67.  Version-1
  68.  
  69. FOREWORD
  70.  
  71. The National Computer Security Center is issuing A Guide to Understanding Security Testing 
  72. and Test Documentation in Trusted Systems as part of the "Rainbow Series" of documents our 
  73. Technical Guidelines Program produces. In the Rainbow Series, we discuss in detail the features 
  74. of the Department of Defense Trusted Computer System Evaluation Criteria (DoD 5200.28-STD) 
  75. and provide guidance for meeting each requirement. The National Computer Security Center, 
  76. through its Trusted Product Evaluation Program, evaluates the security features of commercially 
  77. produced computer systems. Together, these programs ensure that users are capable of protecting 
  78. their important data with trusted computer systems.
  79.  
  80. The specific guidelines in this document provide a set of good practices related to security testing 
  81. and the development of test documentation. This technical guideline has been written to help the 
  82. vendor and evaluator community understand what deliverables are required for test documentation, 
  83. as well as the level of detail required of security testing at all classes in the Trusted Computer System 
  84. Evaluation Criteria.
  85.  
  86. As the Director, National Computer Security Center, Invite your suggestions for revision to this 
  87. technical guideline. We plan to review this document as the need arises.
  88.  
  89. National Computer Security Center
  90.  
  91. Attention: Chief, Standard, Criteria and Guidelines Division
  92.  
  93. 9800 Savage Road
  94.  
  95. Fort George G. Meade, MD 20755-6000
  96.  
  97.  
  98.  
  99. Patrick R. Gallagher, Jr.       January, 1994
  100.  
  101. Director
  102.  
  103. National Computer Security Center
  104.  
  105. ACKNOWLEDGMENTS
  106.  
  107. Special recognition and acknowledgment for his contributions to this document are extended to 
  108. Virgil D. Gligor, University of Maryland, as primary author of this document.
  109.  
  110. Special thanks are extended to those who enthusiastically gave of their time and technical 
  111. expertise in reviewing this guideline and providing valuable comments and suggestions. The 
  112. assistance of C. Sekar Chandersekaran, IBM and Charles Bonneau, Honeywell Federal Systems, 
  113. in the preparation of the examples presented in this guideline is gratefully acknowledged.
  114.  
  115. Special recognition is extended to MAJ James P. Gordon, U.S. Army, and Leon Neufeld as 
  116. National Computer Security Center project managers for this guideline.
  117.  
  118. TABLE OF CONTENTS
  119.  
  120. FOREWORD        i
  121.  
  122. ACKNOWLEDGMENTS iii
  123.  
  124. l. INTRODUCTION 1
  125.  
  126. 1.1 PURPOSE     1
  127.  
  128. 1.2 SCOPE       1        
  129.  
  130. 1.3 CONTROL OBJECTIVES  2
  131.  
  132. 2. SECURITY TESTING OVERVIEW    3
  133.  
  134. 2.1 OBJECTIVES  3
  135.  
  136. 2.2 PURPOSE     3        
  137.  
  138. 2.3 PROCESS     4
  139.  
  140. 2.3.1 System Analysis   4
  141.  
  142. 2.3.2 Functional Testing        4
  143.  
  144. 2.3.3 Security Testing  5
  145.  
  146. 2.4 SUPPORTING DOCUMENTATION    5
  147.  
  148. 2.5 TEST TEAM COMPOSITION       6
  149.  
  150. 2.6 TEST SITE   17
  151.  
  152. 3. SECURITY TESTING - APPROACHES, DOCUMENTATION, AND
  153. EXAMPLES        8
  154.  
  155. 3.1 TESTING PHILOSOPHY  8
  156.  
  157. 3.2 TEST AUTOMATION     9
  158.  
  159. 3.3 TESTING APPROACHES  11
  160.  
  161. 3.3.1 Monolithic (Black-Box) Testing    11
  162.  
  163. 3.3.2 Functional-Synthesis (White-Box) Testing  13
  164.  
  165. 3.3.3 Gray-Box Testing  25
  166.  
  167. 3.4 RELATIONSHIP WITH THE TCSEC SECURITY TESTING
  168. REQUIREMENTS    18
  169.  
  170. 3.5 SECURITY TEST DOCUMENTATION 21
  171.  
  172. 3.5.1 Overview  21
  173.  
  174. 3.5.2 Test Plan 22
  175.  
  176. 3.5.2.1 Test Conditions 22
  177.  
  178. 3.5.2.2 Test Data       24
  179.  
  180. 3.5.2.3 Coverage Analysis       25
  181.  
  182. 3.5.3 Test Procedures   27
  183.  
  184. 3.5.4 Test Programs     27
  185.  
  186. 3.5.5 Test Log  28
  187.  
  188. 3.5.6 Test Report       28
  189.  
  190. 3.6 SECURITY TESTING OF PROCESSORS' HARDWARE/FIRMWARE
  191. PROTECTION MECHANISMS   28
  192.  
  193. 3.6.1 The Need for Hardware/Firmware Security Testing   29
  194.  
  195. 3.6.2 Explicit TCSEC Requirements for Hardware Security Testing 30
  196.  
  197. 3.6.3 Hardware Security Testing vs. System Integrity Testing    31
  198.  
  199. 3.6.4 Goals, Philosophy, and Approaches to Hardware Security Testing    31
  200.  
  201. 3.6.5 Test Conditions, Data, and Coverage Analysis for Hardware Security
  202. Testing 32
  203.  
  204. 3.6.5.1 Test Conditions for Isolation and Noncircumventability Testing  32
  205.  
  206. 3.6.5.2 Text Conditions for Policy-Relevant Processor Instructions      33
  207.  
  208. 3.6.5.3 Tests Conditions for Generic Security Flaws     33
  209.  
  210. 3.6.6 Relationship between Hardware/Firmware Security Testing and the TCSEC 
  211. Requirements    34
  212.  
  213. 3.7 TEST PLAN EXAMPLES  36
  214.  
  215. 3.7.1 Example of a Test Plan for "Access"       37
  216.  
  217. 3.7.1.1 Test Conditions for Mandatory Access Control of "Access"        38
  218.  
  219. 3.7.1.2 Test Data for MAC Tests 38
  220.  
  221. 3.7.1.3 Coverage Analysis       39
  222.  
  223. 3.7.2 Example of a Test Plan for "Open" 43
  224.  
  225. 3.7.2.1 Test Conditions for "Open"      43
  226.  
  227. 3.7.2.2 Test Data for the Access Graph Dependency Condition     44
  228.  
  229. 3.7.2.3 Coverage Analysis       46
  230.  
  231. 3.7.3 Examples of a Test Plan for "Read"        46
  232.  
  233. 3.7.3.1 Test Conditions for "Read"      47
  234.  
  235. 3.7.3.2 Test Data for the Access-Check Dependency Condition     47
  236.  
  237. 3.7.3.3 Coverage Analysis       51
  238.  
  239. 3.7.4 Examples of Kernel Isolation Test Plans   51
  240.  
  241. 3.7.4.1 Test Conditions 51
  242.  
  243. 3.7.4.2 Test Data       51
  244.  
  245. 3.7.4.3 Coverage Analysis       53
  246.  
  247. 3.7.5 Examples of Reduction of Cyclic Test Dependencies 54
  248.  
  249. 3.7.6 Example of Test Plans for Hardware/Firmware Security Testing      57
  250.  
  251. 3.7.6.1 Test Conditions for the Ring Crossing Mechanism 58
  252.  
  253. 3.7.6.2 Test Data       58
  254.  
  255. 3.7.6.3 Coverage Analysis       60
  256.  
  257. 3.7.7 Relationship with the TCSEC Requirements  62
  258.  
  259. 4. COVERT CHANNEL TESTING       66
  260.  
  261. 4.1 COVERT CHANNEL TEST PLANS   66
  262.  
  263. 4.2 AN EXAMPLE OF A COVERT CHANNEL TEST PLAN    67
  264.  
  265. 4.2.1 Test Plan for the Upgraded Directory Channel      67
  266.  
  267. 4.2.1.1 Test Condition  68
  268.  
  269. 4.2.1.2 Test Data       68
  270.  
  271. 4.2.1.3 Coverage Analysis       70
  272.  
  273. 4.2.2 Test Programs     70
  274.  
  275. 4.2.3 Test Results      70
  276.  
  277. 4.3 RELATIONSHIP WITH THE TCSEC REQUIREMENTS    70
  278.  
  279. 5. DOCUMENTATION OF SPECIFICATION-TO-CODE CORRESPONDENCE        72
  280.  
  281. APPENDIX        73
  282.  
  283. 1 Specification-to-Code Correspondence  73
  284.  
  285. 2 Informal Methods for Specification-to-Code Correspondence     74
  286.  
  287. 3 An Example of Specification-to-Code Correspondence    76
  288.  
  289. GLOSSARY        83
  290.  
  291. REFERENCES      90
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317. 1. INTRODUCTION
  318.  
  319. The National Computer Security Center (NCSC) encourages the widespread availability of 
  320. trusted computer systems. In support of this goal the Department of Defense Trusted Computer 
  321. System Evaluation Criteria (TCSEC) was created as a metric against which computer systems could 
  322. be evaluated. The NCSC published the TCSEC on 15 August 1983 as CSC-STD-001-83. In 
  323. December 1985, the Department of Defense (DoD) adopted it, with a few changes, as a DoD 
  324. Standard, DoD 5200.28-STD. [13] DoD Directive 5200.28, "Security Requirements for Automatic 
  325. Data Processing (ADP) Systems," requires that the TCSEC be used throughout the DoD. The NCSC 
  326. uses the TCSEC as a standard for evaluating the effectiveness of security controls built into ADP 
  327. systems. The TCSEC is divided into four divisions: D, C, B, and A. These divisions are ordered in 
  328. a hierarchical manner with the highest division (A) being reserved for systems providing the best 
  329. available level of assurance. Within divisions C and B there are a number of subdivisions known 
  330. as classes. In turn, these classes are also ordered in a hierarchical manner to represent different 
  331. levels of security.
  332.  
  333. 1.1 PURPOSE
  334.  
  335. Security testing is a requirement for TCSEC classes C1 though A1. This testing determines that 
  336. security features for a system are implemented as designed and that they are adequate for the 
  337. specified level of trust. The TCSEC also requires test documentation to support the security testing 
  338. of the security features of a system. The TCSEC evaluation process includes security testing and 
  339. evaluation of test documentation of a system by an NCSC evaluation team. A Guide to 
  340. Understanding Security Testing and Test Documentation for Trusted Systems will assist the 
  341. operating system developers and vendors in the development of computer security testing and testing 
  342. procedures. This guideline gives system developers and vendors suggestions and recommendations 
  343. on how to develop testing and testing documentation that will be found acceptable by an NCSC 
  344. Evaluation Team.
  345.  
  346. 1.2 SCOPE
  347.  
  348. TCSEC classes C1 through A1 assurance is gained through security testing and the accompanying 
  349. test documentation of the ADP system. Security testing and test documentation ensures that the 
  350. security features of the system are implemented as designed and are adequate for an application 
  351. environment. This guideline discusses the development of security testing and test documentation 
  352. for system developers and vendors to prepare them for the evaluation process by the NCSC. This 
  353. guideline addresses, in detail, various test methods and their applicability to security and 
  354. accountability policy testing. The Trusted Computing Base (TCB) isolation, noncircumventability 
  355. testing, processor testing, and covert channel testing methods are examples.
  356.  
  357. This document provides an in-depth guide to security testing. This includes the definitions, 
  358. writing and documentation of the test plans for security and a brief discussion of the mapping 
  359. between the formal top-level specification (FTLS) of a TCB and the TCB implementation 
  360. specifications. This document also provides a standard format for test plans and test result 
  361. presentation. Extensive documentation of security testing and specification-to-code correspondence 
  362. arise both during a system evaluation and, more significantly, during a system life cycle. This 
  363. guideline addresses evaluation testing, not life-cycle testing. This document complements the 
  364. security testing guideline that appears in Section 10 of the TCSEC.
  365.  
  366. The scope and approach of this document is to assist the vendor in security testing and in particular 
  367. functional testing. The vendor is responsible for functional testing, not penetration testing. If 
  368. necessary, penetration testing is conducted by an NCSC evaluation team. The team collectively 
  369. identifies penetration vulnerabilities of a system and rates them relative to ease of attack and 
  370. difficulty of developing a hierarchy penetration scenario. Penetration testing is then conducted 
  371. according to this hierarchy, with the most critical and easily executed attacks attempted first [17].
  372.  
  373. This guideline emphasizes the testing of systems to meet the requirements of the TCSEC. A Guide 
  374. to Understanding Security Testing and Test Documentation for Trusted Systems does not address 
  375. the testing of networks, subsystems, or new versions of evaluated computer system products. It only 
  376. addresses the requirements of the TCSEC.
  377.  
  378. Information in this guideline derived from the requirements of the TCSEC is prefaced by the 
  379. word "shall." Recommendations that are derived from commonly accepted good practices are 
  380. prefaced by the word "should." The guidance contained herein is intended to be used when 
  381. conducting and documenting security functional testing of an operating system. The 
  382. recommendations in this document are not to be construed as supplementary requirements to the 
  383. TCSEC. The TCSEC is the only metric against which systems are to be evaluated.
  384.  
  385. Throughout this guideline there are examples, illustrations, or citations of test plan formats that 
  386. have been used in commercial product development. The use of these examples, illustrations, and 
  387. citations is not meant to imply that they contain the only acceptable test plan formats. The selection 
  388. of these examples is based solely on their availability in computer security literature. Examples in 
  389. this document are not to be construed as the only implementations that will satisfy the TCSEC 
  390. requirements. The examples are suggestions of appropriate implementations.
  391.  
  392. 1.3 CONTROL OBJECTIVES
  393.  
  394. The TCSEC and DoD 5200.28-M [14] provide the control objectives for security testing and 
  395. documentation. Specifically these documents state the following:
  396.  
  397. "Component's Designated Approving Authorities, or their designees for this purpose . . . 
  398. will assure:. . .
  399.  
  400. "4.  Maintenance of documentation on operating systems (O/S) and all modifications 
  401. thereto, and its retention for a sufficient period of time to enable tracing of security-related 
  402. defects to their point of origin or inclusion in the system.
  403.  
  404. "5.  Supervision, monitoring, and testing, as appropriate, of changes in an approved ADP 
  405. System that could affect the security features of the system, so that a secure system is 
  406. maintained.
  407.  
  408. "6. Proper disposition and correction of security deficiencies in all approved ADP 
  409. Systems, and the effective use and disposition of system housekeeping or audit records, 
  410. records of security violations or security-related system malfunctions, and records of tests 
  411. of the security features of an ADP System.
  412.  
  413. "7. Conduct of competent system Security Testing and Evaluation (ST&E), timely review 
  414. of system ST&E reports, and correction of deficiencies needed to support conditional or 
  415. final approval or disapproval of an ADP system for the processing of classified 
  416. information.
  417.  
  418. "8. Establishment, where appropriate, of a central ST&E coordination point for the 
  419. maintenance of records of selected techniques, procedures, standards, and tests used in 
  420. testing and evaluation of security features of ADP systems which may be suitable for 
  421. validation and use by other Department of Defense components."
  422.  
  423. Section 5 of the TCSEC gives the following as the Assurance Control Objective:
  424.  
  425. "The third basic control objective is concerned with guaranteeing or providing confidence 
  426. that the security policy has been implemented correctly and that the protection critical 
  427. elements of the system do, indeed, accurately mediate and enforce the intent of that policy. 
  428. By extension, assurance must include a guarantee that the trusted portion of the system 
  429. works only as intended. To accomplish these objectives, two types of assurance are 
  430. needed. They are life-cycle assurance and operational assurance.
  431.  
  432. "Life-cycle assurance refers to steps taken by an organization to ensure that the system 
  433. is designed, developed, and maintained using formalized and rigorous controls and 
  434. standards. Computer systems that process and store sensitive or classified information 
  435. depend on the hardware and software to protect that information. It follows that the 
  436. hardware and software themselves must be protected against unauthorized changes that 
  437. could cause protection mechanisms to malfunction or be bypassed completely. For this 
  438. reason, trusted computer systems must be carefully evaluated and tested during the design 
  439. and development phases and reevaluated whenever changes are made that could affect 
  440. the integrity of the protection mechanisms. Only in this way can confidence be provided 
  441. that the hardware and software interpretation of the security policy is maintained 
  442. accurately and without distortion." [13]
  443.  
  444. 2. SECURITY TESTING OVERVIEW
  445.  
  446. This section provides the objectives, purpose, and a brief overview of vendor and NCSC security 
  447. testing. Test team composition, test site location, testing process, and system documentation are 
  448. also discussed.
  449.  
  450. 2.1 OBJECTIVES
  451.  
  452. The objectives of security testing are to uncover all design and implementation flaws that enable 
  453. a user external to the TCB to violate security and accountability policy, isolation, and 
  454. noncircumventability.
  455.  
  456. 2.2 PURPOSE
  457.  
  458. Security testing involves determining (1) a system security mechanism adequacy for 
  459. completeness and correctness and (2) the degree of consistency between system documentation and 
  460. actual implementation. This is accomplished through a variety of assurance methods such as analysis 
  461. of system design documentation, inspection of test documentation, and independent execution of 
  462. functional testing and penetration testing.
  463.  
  464. 2.3 PROCESS
  465.  
  466. A qualified NCSC team of experts is responsible for independently evaluating commercial 
  467. products to determine if they satisfy TCSEC requirements. The NCSC is also responsible for 
  468. maintaining a listing of evaluated products on the NCSC Evaluated Products List (EPL). To 
  469. accomplish this mission, the NCSC Trusted Product Evaluation Program has been established to 
  470. assist vendors in developing, testing, and evaluating trusted products for the EPL. Security testing 
  471. is an integral part of the evaluation process as described in the Trusted Product Evaluations-A 
  472. Guide For Vendors. [18]
  473.  
  474. 2.3.1 System Analysis
  475.  
  476. System analysis is used by the NCSC evaluation team to obtain a complete and in-depth 
  477. understanding of the security mechanisms and operations of a vendor's product prior to conducting 
  478. security testing. A vendor makes available to an NCSC team any information and training to support 
  479. the NCSC team members in their understanding of the system to be tested. The NCSC team will 
  480. become intimately familiar with a vendor's system under evaluation and will analyze the product 
  481. design and implementation, relative to the TCSEC.
  482.  
  483. System candidates for TCSEC ratings B2 through A1 are subject to verification and covert channel 
  484. analyses. Evaluation of these systems begins with the selection of a test configuration, evaluation 
  485. of vendor security testing documentation, and preparation of an NCSC functional test plan.
  486.  
  487. 2.3.2 Functional Testing
  488.  
  489. Initial functional testing is conducted by the vendor and results are presented to the NCSC team. 
  490. The vendor should conduct extensive functional testing of its product during development, field 
  491. testing, or both. Vendor testing should be conducted by procedures defined in a test plan. Significant 
  492. events during testing should be placed in a test log. As testing proceeds sequentially through each 
  493. test case, the vendor team should identify flaws and deficiencies that will need to be corrected. 
  494. When a hardware or software change is made, the test procedure that uncovered the problem should 
  495. then be repeated to validate that the problem has been corrected. Care should be taken to verify that 
  496. the change does not affect any previously tested procedure. These procedures also should be repeated 
  497. when there is concern that flaws or deficiencies exist. When the vendor team has corrected all 
  498. functional problems and the team has analyzed and retested all corrections, a test report should be 
  499. written and made a part of the report for review by the NCSC test team prior to NCSC security testing.
  500.  
  501. The NCSC team is responsible for testing vendor test plans and reviewing vendor test 
  502. documentation. The NCSC team will review the vendor's functional test plan to ensure it sufficiently 
  503. covers each identified security mechanism and explanation in sufficient depth to provide reasonable 
  504. assurance that the security features are implemented as designed and are adequate for an application 
  505. environment. The NCSC team conducts its own functional testing and, if appropriate, penetration 
  506. testing after a vendor's functional testing has been completed.
  507.  
  508. A vendor's product must be free of design and implementation changes, and the documentation 
  509. to support security testing must be completed before NCSC team functional testing. Functional 
  510. security testing is conducted on C1 through A1 class systems and penetration testing on B2, B3, 
  511. and A1 class systems. The NCSC team may choose to repeat any of the functional tests performed 
  512. by the vendor and/or execute its own functional test. During testing by the NCSC team, the team 
  513. informs the vendor of any test problems and provides the vendor with an opportunity to correct 
  514. implementation flaws. If the system satisfies the functional test requirements, B2 and above 
  515. candidates undergo penetration testing. During penetration testing the NCSC team collectively 
  516. identifies penetration vulnerabilities in the system and rates them relative to ease of attack and 
  517. difficulty in developing a penetration hierarchy. Penetration testing is then conducted according to 
  518. this hierarchy with the most critical and most easily executed attacks attempted first [17]. The vendor 
  519. is given limited opportunity to correct any problems identified [17]. When opportunity to correct 
  520. implementation flaws has been provided and corrections have been retested, the NCSC team 
  521. documents the test results. The test results are input which support a final rating, the publication of 
  522. the Final Report and the EPL entry.
  523.  
  524. 2.3.3 Security Testing
  525.  
  526. Security testing is primarily the responsibility of the NCSC evaluation team. It is important to 
  527. note, however, that vendors shall perform security testing on a product to be evaluated using NCSC 
  528. test methods and procedures. The reason for vendor security testing is two-fold: First, any TCB 
  529. changes required as a result of design analysis or formal evaluation by the NCSC team will require 
  530. that the vendor (and subsequently the evaluation team) retest the TCB to ensure that its security 
  531. properties are unaffected and the required changes fixed the test problems. Second, any new system 
  532. release that affects the TCB must undergo either a reevaluation by the NCSC or a rating-maintenance 
  533. evaluation by the vendor itself. If a rating maintenance is required, which is expected to be the case 
  534. for the preponderant number of TCB changes, the security testing responsibility, including all the 
  535. documentation evidence, becomes a vendor's responsibility-not just that of the NCSC evaluation 
  536. team.
  537.  
  538. Furthermore, it is important to note that the system configuration provided to the evaluation team 
  539. for security testing should be the same as that used by the vendor itself. This ensures that consistent 
  540. test results are obtained. It also allows the evaluation team to examine the vendor test suite and to 
  541. focus on areas deemed to be insufficiently tested. Identifying these areas will help speed the security 
  542. testing of a product significantly. (An important implication of reusing the vendor's test suite is that 
  543. security testing should yield repeatable results.)
  544.  
  545. When the evaluation team completes the security testing, the test results are shown to the vendor. 
  546. If any TCB changes are required, the vendor shall correct or remove those flaws before TCB retesting 
  547. by the NCSC team is performed.
  548.  
  549. 2.4 SUPPORTING DOCUMENTATION
  550.  
  551. Vendor system documentation requirements will vary, and depending on the TCSEC class a 
  552. candidate system will be evaluated for, it can consist of the following:
  553.  
  554. Security Features User's Guide. It describes the protection mechanisms provided by 
  555. the TCB, guidelines on their use, and how they interact with one another. This may be 
  556. used to identify the protection mechanisms that need to be covered by test procedures 
  557. and test cases.
  558.  
  559. Trusted Facility Manual. It describes the operation and administration of security 
  560. features of the system and presents cautions about functions and privileges that should 
  561. be controlled when running a secure facility. This may identify additional functions that 
  562. need to be tested.
  563.  
  564. Design Documentation. It describes the philosophy of protection, TCB interfaces, 
  565. security policy model, system architecture, TCB protection mechanisms, top level 
  566. specifications, verification plan, hardware and software architecture, system configuration 
  567. and administration, system programming guidelines, system library routines, 
  568. programming languages, and other topics.
  569.  
  570. Covert Channel Analysis Documentation. It describes the determination and maximum 
  571. bandwidth of each identified channel.
  572.  
  573. System Integrity Documentation. It describes the hardware and software features used 
  574. to validate periodically the correct operation of the on-site hardware and firmware 
  575. elements of the TCB.
  576.  
  577. Trusted Recovery Documentation. It describes procedures and mechanisms assuring 
  578. that after an ADP system failure or other discontinuity, recovery is obtained without a 
  579. protection compromise. Information describing procedures and mechanisms may also be 
  580. found in the Trusted Facility Manual.
  581.  
  582. Test Documentation. It describes the test plan, test logs, test reports, test procedures, 
  583. and test results and shows how the security mechanisms were functionally tested, covert 
  584. channel bandwidth, and mapping between the FTLS and the TCB source code. Test 
  585. documentation is used to document plans, tests, and results in support of validating and 
  586. verifying the security testing effort.
  587.  
  588. 2.5 TEST TEAM COMPOSITION
  589.  
  590. A vendor test team should be formed to conduct security testing. It is desirable for a vendor to 
  591. provide as many members from its security testing team as possible to support the NCSC during 
  592. its security testing. The reason for this is to maintain continuity and to minimize the need for 
  593. retraining throughout the evaluation process. The size, education, and skills of the test team will 
  594. vary depending on the size of the system and the class for which it is being evaluated. (See Chapter 
  595. 10 of the TCSEC, "A Guideline on Security Testing.")
  596.  
  597. A vendor security testing team should be comprised of a team leader and two or more additional 
  598. members depending on the evaluated class. In selecting personnel for the test team, it is important 
  599. to assign individuals who have the ability to understand the hardware and software architecture of 
  600. the system, as well as an appropriate level of experience in system testing. Engineers and scientists 
  601. with backgrounds in electrical engineering, computer science and software engineering are ideal 
  602. candidates for functional security testing. Prior experience with penetration techniques is important 
  603. for penetration testing. A mathematics or logic background can be valuable in formal specifications 
  604. involved in A1 system evaluation.
  605.  
  606. The NCSC test team is formed using the guidance of Chapter 10, in the TCSEC, "A Guideline 
  607. on Security Testing." This chapter specifies test team composition, qualifications and parameters. 
  608. Vendors may find these requirements useful recommendations for their teams.
  609.  
  610. 2.6 TEST SITE
  611.  
  612. The location of a test site is a vendor responsibility. The vendor is to provide the test site. The 
  613. evaluator's functional test site may be located at the same site at which the vendor conducted his 
  614. functional testing. Proper hardware and software must be available for testing the configuration as 
  615. well as appropriate documentation, personnel, and other resources which have a significant impact 
  616. on the location of the test site.
  617.  
  618. 3. SECURITY TESTING-APPROACHES, DOCUMENTATION, 
  619. AND EXAMPLES
  620.  
  621. 3.1 TESTING PHILOSOPHY
  622.  
  623. Operating systems that support multiple users require security mechanisms and policies that 
  624. guard against unauthorized disclosure and modification of critical user data. The TCB is the principal 
  625. operating system component that implements security mechanisms and policies that must itself be 
  626. protected [13]. TCB protection is provided by a reference monitor mechanism whose data structures 
  627. and code are isolated, noncircumventable, and small enough to be verifiable. The reference monitor 
  628. ensures that the entire TCB is isolated and noncircumventable.
  629.  
  630. Although TCBs for different operating systems may contain different data structures and 
  631. programs, they all share the isolation, noncircumventability, and verifiability properties that 
  632. distinguish them from the rest of the operating system components. These properties imply that the 
  633. security functional testing of an operating system TCB may require different methods from those 
  634. commonly used in software testing for all security classes of the TCSEC.
  635.  
  636. Security testing should be done for TCBs that are configured and installed in a specific system 
  637. and operate in a normal mode (as opposed to maintenance or test mode). Tests should be done using 
  638. user-level programs that cannot read or write internal TCB data structures or programs. New data 
  639. structures and programs should also not be added to a TCB for security testing purposes, and special 
  640. TCB entry points that are unavailable to user programs should not be used. If a TCB is tested in the 
  641. maintenance mode using programs that cannot be run at the user level, the security tests would be 
  642. meaningless because assurance cannot be gained that the TCB performs user-level access control 
  643. correctly. If user-level test programs could read, write or add internal TCB data structures and 
  644. programs, as would be required by traditional instrumentation testing techniques, the TCB would 
  645. lose its isolation properties. If user-level test programs could use special TCB entry points not 
  646. normally available to users, the TCB would become circumventable in the normal mode of 
  647. operation.
  648.  
  649. Security testing of operating system TCBs in the normal mode of operation using user-level test 
  650. programs (which do not rely on breaching isolation and noncircumventability) should address the 
  651. following problems of TCB verifiability through security testing: (1) Coverage Analysis, (2) 
  652. Reduction of Cyclic Test Dependencies, (3) Test Environment Independence, and (4) Repeatability 
  653. of Security Testing.
  654.  
  655. (1) Coverage Analysis. Security testing requires that precise, extensive test coverage be obtained 
  656. during TCB testing. Test coverage analysis should be based on coverage of test conditions derived 
  657. from the Descriptive Top-Level Specification (DTLS)/Formal Top-Level Specification (FTLS), the 
  658. security and accountability model conditions, the TCB isolation and noncircumventability 
  659. properties, and the individual TCB-primitive implementation. Without covering such test 
  660. conditions, it would be impossible to claim reasonably that the tests cover specific security checks 
  661. in a demonstrable way. Whenever both DTLS and FTLS and security and accountability models 
  662. are unavailable or are not required, test conditions should be derived from documented protection 
  663. philosophy and resource isolation requirements [13]. It would be impossible to reasonably claim 
  664. that the implementation of a specific security check in a TCB primitive is correct without individual 
  665. TCB-primitive coverage. In these checks a TCB primitive may deal differently with different 
  666. parameters. In normal-mode testing, however, using user-level programs makes it difficult to 
  667. guarantee significant coverage of TCB-primitive implementation while eliminating redundant tests 
  668. that appear when multiple TCB primitives share the same security checks (a common occurrence 
  669. in TCB kernels).
  670.  
  671. The role of coverage analysis in the generation of test plans is discussed in Section 3.5.2, and 
  672. illustrated in Sections 3.7.1.3-3.7.3.3.
  673.  
  674. (2) Reduction of Cyclic Test Dependencies. Comprehensive security testing suggests that cyclic 
  675. test dependencies be reduced to a minimum or eliminated whenever possible. A cyclic test 
  676. dependency exists between a test program for TCB primitive A and TCB primitive B if the test 
  677. program for TCB primitive A invokes TCB primitive B, and the test program for TCB primitive B 
  678. invokes TCB primitive A. The existence of cyclic test dependencies casts doubts on the level of 
  679. assurance obtained by TCB tests. Cyclic test dependencies cause circular arguments and 
  680. assumptions about test coverage and, consequently, the interpretation of the test results may be 
  681. flawed. For example, the test program for TCB primitive A, which depends on the correct behavior 
  682. of TCB primitive B, may not discover flaws in TCB primitive A because such flaws may be masked 
  683. by the behavior of B, and vice versa. Thus, both the assumptions (1) that the TCB primitive B works 
  684. correctly, which must be made in the test program for TCB primitive A, and (2) that TCB primitive 
  685. A works correctly, which must be made in the test program for TCB primitive B, are incorrect. The 
  686. elimination of cyclic test dependencies could be obtained only if the TCB is instrumented with 
  687. additional code and data structures an impossibility if TCB isolation and noncircumventability are 
  688. to be maintained in normal mode of operation.
  689.  
  690. An example of cyclic test dependencies, and of their removal, is provided in Section 3.7.5.
  691.  
  692. (3) Test Environment Independence. To minimize test program and test environment 
  693. dependencies the following should be reinitialized for different TCB-primitive tests: user accounts, 
  694. user groups, test objects, access privileges, and user security levels. Test environment initialization 
  695. may require that the number of different test objects to be created and logins to be executed become 
  696. very large. Therefore, in practice, complete TCB testing cannot be carried out manually. Testing 
  697. should be automated whenever possible. Security test automation is discussed in Section 3.2.
  698.  
  699. (4) Repeatability of Security Testing. TCB verifiability through security testing requires that the 
  700. results of each TCB-primitive test be repeatable. Without test repeatability it would be impossible 
  701. to evaluate developers' TCB test suites independently of the TCB developers. Independent TCB 
  702. testing may yield different outcomes from those expected if testing is not repeatable. Test 
  703. repeatability by evaluation teams requires that test plans and procedures be documented in an 
  704. accurate manner.
  705.  
  706. 3.2 TEST AUTOMATION
  707.  
  708. The automation of the test procedures is one of the most important practical objectives of security 
  709. testing. This objective is important for at least three reasons. First, the procedures for test 
  710. environment initialization include a large number of repetitive steps that do not require operator 
  711. intervention, and therefore, the manual performance of these steps may introduce avoidable errors 
  712. in the test procedures. Second, the test procedures must be carried out repeatedly once for every 
  713. system generation (e.g., system build) to ensure that security errors have not been introduced during 
  714. system maintenance. Repeated manual performance of the entire test suite may become a time 
  715. consuming, error-prone activity. Third, availability of automated test suites enables evaluators to 
  716. verify both the quality and extent of a vendor's test suite on an installed system in an expeditious 
  717. manner. This significantly reduces the time required to evaluate that vendor's test suite.
  718.  
  719. The automation of most test procedures depends to a certain extent on the nature of the TCB 
  720. interface under test. For example, for most TCB-primitive tests that require the same type of login, 
  721. file system and directory initialization, it is possible to automate the tests by grouping test procedures 
  722. in one or several user-level processes that are initiated by a single test-operator login. However, 
  723. some TCB interfaces, such as the login and password change interfaces, must be tested from a user 
  724. and administrator terminal. Similarly, the testing of the TCB interface primitives of B2 to Al systems 
  725. available to users only through trusted-path invocation requires terminal interaction with the test 
  726. operator. Whenever security testing requires terminal interaction, test automation becomes a 
  727. challenging objective.
  728.  
  729. Different approaches to test automation are possible. First, test designers may want to separate 
  730. test procedures requiring terminal interaction (which are not usually automated), from those that 
  731. do not require terminal interaction (which are readily amenable to automation). In this approach, 
  732. the minimization of the number of test procedures that require terminal interaction is recommended.
  733.  
  734. Second, when test procedures requiring human-operator interaction cannot be avoided, test 
  735. designers may want to connect a workstation to a terminal line and simulate the terminal activity 
  736. of a human test operator on the workstation. This enables the complete automation of the test 
  737. environment initialization and execution procedures, but not necessarily of the result identification 
  738. and analysis procedure. This approach has been used in the testing of the Secure XenixTM  TCB. 
  739. The commands issued by the test workstation that simulates the human-operator commands are 
  740. illustrated in the appendix of reference [9].
  741.  
  742. Third, the expected outcome of each test should be represented in the same format as that assumed 
  743. by the output of the TCB under test and should be placed in files of the workstation simulating a 
  744. human test operator. The comparison between the outcome files and the test result files (transferred 
  745. to the workstation upon test completion) can be performed using simple tools for file comparisons 
  746. available in most current operating systems. The formatting of the outcome files in a way that allows 
  747. their direct comparison with the test program output is a complex process. In practice, the order of 
  748. the outcomes is determined only at the time the test programs are written, and sometimes only at 
  749. execution time. Automated analysis of test results is seldomly done for this reason. To aid analysis 
  750. of test results by human operators, the test result outputs can label and time-stamp each test. 
  751. Intervention by a human test operator is also necessary in any case of mismatches between obtained 
  752. test results and expected outcomes.
  753.  
  754. An approach to automating security testing using Prolog is presented in reference [20].
  755.  
  756. 3.3 TESTING APPROACHES
  757.  
  758. All approaches to security functional testing require the following four major steps: (1) the 
  759. development of test plans (i.e., test conditions, test data including test outcomes, and test coverage 
  760. analysis) and execution for each TCB primitive, (2) the definition of test procedures, (3) the 
  761. development of test programs, and (4) the analysis of the test results. These steps are not independent 
  762. of each other in all methods. Depending upon how these steps are performed in the context of 
  763. security testing, three approaches can be identified: the monolithic (black-box) testing approach, 
  764. the functional-synthesis (white-box) testing approach, and a combination of the two approaches 
  765. called the gray-box testing approach.
  766.  
  767. In all approaches, the functions to be tested are the security-relevant functions of each TCB 
  768. primitive that are visible to the TCB interface. The definition of these security functions is given by:
  769.  
  770. Classes C1 and C2. System documentation defining a system protection philosophy, 
  771. mechanisms, and system interface operations (e.g., system calls).
  772.  
  773. Class B1. Informal interpretation of the (informal) security model and the system 
  774. documentation.
  775.  
  776. Classes b2 and B3. Descriptive Top-Level Specifications (DTLSs) of the TCB and by 
  777. the interpretation of the security model that is supposed to be implemented by the TCB 
  778. functions.
  779.  
  780. Class A1. Formal Top-Level Specifications (FTLSs) of the TCB and by the interpretation 
  781. of the security model that is supposed to be implemented by the TCB functions.
  782.  
  783. Thus, a definition of the correct security function exists for each TCB primitive of a system 
  784. designed for a given security class. In TCB testing, major distinctions between the approaches 
  785. discussed in the previous section appear in the areas of test plan generation (i.e., test condition, test 
  786. data, and test coverage analysis). Further distinctions appear in the ability to eliminate redundant 
  787. TCB-primitive tests without loss of coverage. This is important for TCB testing because a large 
  788. number of access checks and access check sequences performed by TCB kernels are shared between 
  789. different kernel primitives.
  790.  
  791. 3.3.1 Monolithic (Black-Box) Testing
  792.  
  793. The application of the monolithic testing approach to TCBs and to trusted processes is outlined 
  794. in reference [2]. The salient features of this approach to TCB testing are the following: (1) the test 
  795. condition selection is based on the TCSEC requirements and include discretionary and mandatory 
  796. security, object reuse, labeling, accountability, and TCB isolation; (2) the test conditions for each 
  797. TCB primitive should be generated from the chosen interpretation of each security function and 
  798. primitive as defined above (for each security class). Very seldom is the relationship between the 
  799. model interpretation and the generated test conditions, data, and programs shown explicitly (3 and 
  800. 4]. Without such a relationship, it is difficult to argue coherently that all relevant security features 
  801. of the given system are covered.
  802.  
  803. The test data selection must ensure test environment independence for unrelated tests or groups 
  804. of tests (e.g., discretionary vs. mandatory tests). Environment independence requires, for example, 
  805. that the subjects, objects, and access privileges used in unrelated tests or groups of tests must differ 
  806. in all other tests or group of tests.
  807.  
  808. The test coverage analysis, which usually determines the extent of the testing for any TCB 
  809. primitive, is used to delimit the number of test sets and programs. In the monolithic approach, the 
  810. test data is usually chosen by boundary-value analysis. The test data places the test program directly 
  811. above, or below, the extremes of a set of equivalent inputs and outputs. For example, a boundary is 
  812. tested in the case of the "read" TCB call to a file by showing that (1) whenever a user has the read 
  813. privilege for that file, the read TCB call succeeds; and (2) whenever the read privilege for that file 
  814. is revoked, or whenever the file does not exist, the read TCB call fails. Similarly, a boundary is 
  815. tested in the case of TCB-call parameter validation by showing that a TCB call with parameters 
  816. passed by reference (1) succeeds whenever the reference points to an object in the caller's address 
  817. space, and (2) fails whenever the reference points to an object in another address space (e.g., kernel 
  818. space or other user spaces).
  819.  
  820. To test an individual boundary condition, all other related boundary conditions must be satisfied. 
  821. For example, in the case of the "read" primitive above, the test call must not try to read beyond the 
  822. limit of a file since the success/failure of not reading/reading beyond this limit represents a different, 
  823. albeit related, boundary condition. The number of individual boundary tests for N related boundary 
  824. conditions is of the order 2N (since both successes and failures must be tested for each of the N 
  825. conditions). Some examples of boundary-value analysis are provided in [2] for security testing, and 
  826. in [5] and [6] for security-unrelated functional testing.
  827.  
  828. The monolithic testing approach has a number of practical advantages. It can always be used by 
  829. both implementors and users (evaluators) of TCBs. No specific knowledge of implementation details 
  830. is required because there is no requirement to break the TCB (e.g., kernel) isolation or to circumvent 
  831. the TCB protection mechanism (to read, modify, or add to TCB code). Consequently, no special 
  832. tools for performing monolithic testing are required. This is particularly useful in processor 
  833. hardware testing when only descriptions of hardware/firmware implemented instructions, but no 
  834. internal hardware/firmware design documents, are available.
  835.  
  836. The disadvantages of the monolithic approach are apparent. First, it is difficult to provide a precise 
  837. coverage assessment for a set of TCB-primitive tests, even though the test selection may cover the 
  838. entire set of security features of the system. However, no coverage technique other than boundary-
  839. value analysis can be more adequate without TCB code analysis. Second, the elimination of 
  840. redundant TCB-primitive tests without loss of coverage is possible only to a limited extent; i.e., in 
  841. the case of access-check dependencies (discussed below) among TCB-primitive specifications. 
  842. Third, in the context of TCB testing, the monolithic approach cannot cope with the problem of 
  843. cyclic dependencies among test programs. Fourth, lack of TC code analysis precludes the possibility 
  844. of distinguishing between design and implementation code errors in all but a few special cases. 
  845. Also, it precludes the discovery of spurious code within the TCB-a necessary condition for Trojan 
  846. Horse analysis.
  847.  
  848. In spite of these disadvantages, monolithic functional testing can be applied successfully to TCB 
  849. primitives that implement simple security checks and share few of these checks (i.e., few or no 
  850. redundant tests would exist). For example, many trusted processes have these characteristics, and 
  851. thus this approach is adequate.
  852.  
  853. 3.3.2 Functional-Synthesis (White-Box) Testing
  854.  
  855. Functional-synthesis-based testing requires the test of both functions implemented by each 
  856. program (e.g., program of a TCB primitive) as a whole and functions implemented by internal parts 
  857. of the program. The internal program parts correspond to the functional ideas used in building the 
  858. program. Different forms of testing procedures are used depending upon different kinds of 
  859. functional synthesis (e.g., control, algebraic, conditional, and iterative synthesis described in [1] 
  860. and [7]). As pointed out in [9], only the control synthesis approach to functional testing is suitable 
  861. for security testing.
  862.  
  863. In control synthesis, functions are represented as sequences of other functions. Each function in 
  864. a sequence transforms an input state into an output state, which may be the input to another function. 
  865. Thus, a control synthesis graph is developed during program development and integration with 
  866. nodes representing data states and arcs representing state transition functions. The data states are 
  867. defined by the variables used in the program and represent the input to the state transition functions. 
  868. The assignment of program functions, procedures, and subroutines to the state transition functions 
  869. of the graph is usually left to the individual programmer's judgment. Examples of how the control 
  870. synthesis graphs are built during the program development and integration phase are given in [1] 
  871. and [7].
  872.  
  873. The suitability of the control synthesis approach to TCB testing becomes apparent when one 
  874. identifies the nodes of the control synthesis graph with the access checks within the TCB and the 
  875. arcs with data states and outcomes of previous access checks. This representation, which is the dual 
  876. of the traditional control synthesis graphs [9], produces a kernel access-check graph (ACG). This 
  877. representation is useful because in TCB testing the primary access-check concerns are those of (1) 
  878. missing checks within a sequence of required checks, (2) wrong sequences of checks, and (3) faulty 
  879. or incomplete access checks. (Many of the security problems identified in the Multics kernel design 
  880. project existed because of these broad categories of inadequate access checks [8].) It is more suitable 
  881. than the traditional control-synthesis graph because major portions of a TCB, namely the kernel, 
  882. have comparatively few distinct access checks (and access-check sequences) and a large number 
  883. of object types and access privileges that have the same access-check sequences for different TCB 
  884. primitives [9]. (However, this approach is less advantageous in trusted process testing because 
  885. trusted processes-unlike kernels-have many different access checks and few shared access 
  886. sequences.) These objects cause the same data flow between access check functions and, therefore, 
  887. are combined as graph arcs.
  888.  
  889. The above representation of the control synthesis graph has the advantage of allowing the 
  890. reduction of the graph to the subset of kernel functions that are relevant to security testing. In 
  891. contrast, a traditional graph would include (1) a large number of other functions (and, therefore, 
  892. graph arcs), and (2) a large number of data states (and, therefore, graph nodes). This would be both 
  893. inadequate and unnecessary. It would be inadequate because the presence of a large number of 
  894. security-irrelevant functions (e.g., functions unrelated to security or accountability checks or to 
  895. protection mechanisms) would obscure the role of the security-relevant ones, making test coverage 
  896. analysis a complex and difficult task. It would be unnecessary because not only could security-
  897. irrelevant functions be eliminated from the graph but also the flows of different object types into 
  898. the same access check function could be combined, making most object type-based security tests 
  899. unnecessary.
  900.  
  901. Any TCB-primitive program can be synthesized at the time of TCB implementations as a graph 
  902. of access-checking functions and data flow arcs. Many of the TCB-primitive programs share both 
  903. arcs and nodes of the TCB graph. To build an access-check graph, one must identify all access-
  904. check functions, their inputs and outputs, and their sequencing. A typical input to an access-check 
  905. function consists of an object identifier, object type and required access privileges. The output 
  906. consists of the input to the next function (as defined above) and, in most cases, the outcome of the 
  907. function check. The sequencing information for access-check functions consists of (1) the ordering 
  908. of these functions, and (2) the number of arc traversals for each arc. An example of this is the 
  909. sequencing of some access check functions that depend on the object types.
  910.  
  911. Test condition selection in the control-synthesis approach can be performed so that all the above 
  912. access check concerns are satisfied. For example, test conditions must identify missing discretionary, 
  913. mandatory, object reuse, privilege-call, and parameter validation checks (or parts of those checks). 
  914. It also must identify access checks that are out of order, and faulty or incomplete checks, such as 
  915. being able to truncate a file for which the modify privilege does not exist. The test conditions must 
  916. also be based on the security model interpretation to the same extent as that in the monolithic 
  917. approach.
  918.  
  919. The test coverage in this approach also refers to the delimitation of the test data and programs 
  920. for each TCB primitive. Because many of the access-check functions, and sequences of functions, 
  921. are common to many of the kernel primitives (but not necessarily to trusted-process primitives), the 
  922. synthesized kernel (TCB) graph is fairly small. Despite this the coverage analysis cannot rely on 
  923. individual arc testing for covering the graph. The reason is that arc testing does not force the testing 
  924. of access checks that correspond to combinations of arcs and thus it does not force coverage of all 
  925. relevant sequences of security tests. Newer test coverage techniques for control synthesis graphs, 
  926. such as data-flow testing [9, 10, and 11] provide coverage of arc combinations and thus are more 
  927. appropriate than those using individual arc testing.
  928.  
  929. The properties of the functional-synthesis approach to TCB testing appear to be orthogonal to 
  930. those of monolithic testing. Consider the disadvantages of functional-synthesis testing. It is not as 
  931. readily usable as monolithic testing because of the lack of detailed knowledge of system internals. 
  932. Also, it helps remove very few redundant tests whenever few access check sequences are shared 
  933. by TCB primitives (as is the case with most trusted-process primitives).
  934.  
  935. Functional-synthesis-based testing, however, has a number of fundamental advantages. First, the 
  936. coverage based on knowledge of internal program structure (i.e., code structure of a kernel primitive) 
  937. can be more extensive than in the monolithic approach [1 and 7]. A fairly precise assessment of 
  938. coverage can be made, and most of the redundant tests can be identified. Second, one can distinguish 
  939. between TCB-primitive program failures and TCB-primitive design failures, something nearly 
  940. impossible with monolithic testing. Third, this approach can help remove cyclic test dependencies. 
  941. By removing all, or a large number of redundant tests, one removes most cyclic test dependencies 
  942. (example of Section 3.7.5).
  943.  
  944. TCB code analysis becomes necessary whenever a graph synthesis is done after a TCB is built. 
  945. Such analysis helps identify spurious control paths and code within a TCB-a necessary condition 
  946. for Trojan Horse discovery. (In such a case, a better term for this approach would be functional-
  947. analysis-based testing.)
  948.  
  949. 3.3.3 Gray-Box Testing
  950.  
  951. Two of the principal goals of security testing have been (1) the elimination of redundant tests 
  952. through systematic test-condition selection and coverage analysis, and (2) the elimination of cyclic 
  953. dependencies between the test programs. Other goals, such as test repeatability, which is also 
  954. considered important, can be attained through the same means as those used for the other methods.
  955.  
  956. The elimination of redundant TCB-primitive tests is a worthwhile goal for the obvious reason 
  957. that it reduces the amount of testing effort without loss of coverage. This allows one to determine 
  958. a smaller nucleus of tests that must be carried out extensively. The overall TCB assurance may 
  959. increase due to the judicious distribution of the test effort. The elimination of cyclic dependencies 
  960. among the TCB-primitive test programs is also a necessary goal because it helps establish a rigorous 
  961. test order without making circular assumptions of the behavior of the TCB primitives. Added 
  962. assurance is therefore gained.
  963.  
  964. To achieve the above goals, the gray-box testing approach combines monolithic testing with 
  965. functional-synthesis-based testing in the test selection and coverage areas. This combination relies 
  966. on the elimination of redundant tests through access-check dependency analysis afforded by 
  967. monolithic testing. It also relies on the synthesis of the access-check graph from the TCB code as 
  968. suggested by functional-synthesis-based testing (used for further elimination of redundant tests). 
  969. The combination of these two testing methods generates a TCB-primitive test order that requires 
  970. increasingly fewer test conditions and data without loss of coverage.
  971.  
  972. A significant number of test conditions and associated tests can be eliminated by the use of the 
  973. access-check graph of TCB kernels. Recall that each kernel primitive may have a different access-
  974. check graph in principle. In practice, however, substantial parts of the graphs overlap. Consequently, 
  975. if one of the graph paths is tested with sufficient coverage for a kernel primitive, then test conditions 
  976. generated for a different kernel primitive whose graph overlaps with the first need only include the 
  977. access checks specific to the latter kernel primitive. This is true because by the definition of the 
  978. access-check graph, the commonality of paths means that the same access checks are performed in 
  979. the same sequence, on the same types of objects and privileges, and with the same outcomes (e.g., 
  980. success and failure returns). The specific access checks of a kernel primitive, however, must also 
  981. show that the untested subpath(s) that has not been tested, of that kernel primitive, joins the tested 
  982. path.
  983.  
  984. (A subset of the access-check and access-graph dependencies for the access, open, read, write, 
  985. fcntl, ioctl, opensem, waltsem and slgsem primitives of UnixTM-like kernels are illustrated in 
  986. Figures 1 and 2, pages 23 and 24. The use of these dependencies in the development of test plans, 
  987. especially in coverage analysis, is illustrated in Sections 3.7.2.3 and 3.7.3.3; namely, in the test 
  988. plans for access, open, and read. Note that the arcs shown in Figure 2, page 24 include neither 
  989. complete flow-of-control information nor complete sets of object types, access-checks per call, and 
  990. call outcome.)
  991.  
  992.  
  993.  
  994.  
  995.  
  996. 3.4 RELATIONSHIP WITH THE TCSEC SECURITY TESTING REQUIREMENTS
  997.  
  998. The TCSEC security testing requirements and guidelines (i.e., Part 1 and Section 10 of the TCSEC) 
  999. help define different approaches for security testing. They are particularly useful for test condition 
  1000. generation and test coverage. This section reviews these requirements in light of security testing 
  1001. approaches defined in Section 3.3.
  1002.  
  1003. Security Class C1
  1004.  
  1005. Test Condition Generation
  1006.  
  1007. "The security mechanisms of the ADP system shall be tested and found to work as claimed 
  1008. in the system documentation." [TCSEC Part I, Section 2.1]
  1009.  
  1010. For this class of systems, the test conditions should be generated from the system documentation 
  1011. which includes the Security Features User's Guide (SFUG), the Trusted Facility Manual (TFM), 
  1012. the system reference manual describing each TCB primitive, and the design documentation defining 
  1013. the protection philosophy and its TCB implementation. Both the SFUG and the manual pages, for 
  1014. example, illustrate how the identification and authentication mechanisms work and whether a 
  1015. particular TCB primitive contains relevant security and accountability mechanisms. The 
  1016. Discretionary Access Control (DAC) and the identification and authentication conditions enforced 
  1017. by each primitive (if any) are used to define the test conditions of the test plans.
  1018.  
  1019. Test Coverage
  1020.  
  1021. "Testing shall be done to assure that there are no obvious ways for an unauthorized user 
  1022. to bypass or otherwise defeat the security protection mechanisms of the TCB." [TCSEC, 
  1023. Part I, Section 2.1]
  1024.  
  1025. "The team shall independently design and implement at least five system-specific tests 
  1026. in an attempt to circumvent the security mechanisms of the system." [TCSEC, Part II, 
  1027. Section 10]
  1028.  
  1029. The above TCSEC requirements and guidelines define the scope of security testing for this 
  1030. security class. Since each TCB primitive may include security-relevant mechanisms, security testing 
  1031. shall include at least five test conditions for each primitive. Furthermore, because source code 
  1032. analysis is neither required nor suggested for class C1 systems, monolithic functional testing (i.e., 
  1033. a black-box approach) with boundary-value coverage represents an adequate testing approach for 
  1034. this class. Boundary-value coverage of each test condition requires that at least two calls of each 
  1035. TCB primitive be made, one for the positive and one for the negative outcome of the condition. 
  1036. Such coverage may also require more than two calls per condition. Whenever a TCB primitive refers 
  1037. to multiple types of objects, each condition is repeated for each relevant type of object for both its 
  1038. positive and negative outcomes. A large number of test calls may be necessary for each TCB 
  1039. primitive because each test condition may in fact have multiple related conditions which should be 
  1040. tested independently of each other.
  1041.  
  1042. Security Class C2
  1043.  
  1044. Test Condition Generation
  1045.  
  1046. "Testing shall also include a search for obvious flaws that would allow violation of 
  1047. resource isolation, or that would permit unauthorized access to the audit and 
  1048. authentication data." [TCSEC, Part I, Section 2.2]
  1049.  
  1050. These added requirements refer only to new sources of test conditions, but not to a new testing 
  1051. approach nor to new coverage methods. The following new sources of test conditions should be 
  1052. considered:
  1053.  
  1054. (1) Resource isolation conditions. These test conditions refer to all TCB primitives that 
  1055. implement specific system resources (e.g., object types or system services). Test 
  1056. conditions for TCB primitives implementing services may differ from those for TCB 
  1057. primitives implementing different types of objects. Thus, new conditions may need to be 
  1058. generated for TCB services. The mere repetition of test conditions defined for other TCB 
  1059. primitives may not be adequate for some services.
  1060.  
  1061. (2) Conditions for protection of audit and authentication data. Because both audit and 
  1062. authentication mechanisms and data are protected by the TCB, the test conditions for the 
  1063. protection of these mechanisms and their data are similar to those which show that the 
  1064. TCB protection mechanisms are tamperproof and noncircumventable. For example, these 
  1065. conditions show that neither privileged TCB primitives nor audit and user authentication 
  1066. files are accessible to regular users.
  1067.  
  1068. Test Coverage
  1069.  
  1070. Although class C1 test coverage already suggests that each test condition be covered for each 
  1071. type of object, coverage of resource-specific test conditions also requires that each test condition 
  1072. be covered for each type of service (whenever the test condition is relevant to a service). For example, 
  1073. the test conditions which show that direct access to a shared printer is denied to a user shall be 
  1074. repeated for a shared tape drive with appropriate modification of test data (i.e., test environments 
  1075. set up, test parameters and outcomes-namely, the test plan structure discussed in Section 3.5).
  1076.  
  1077. Security Class B1
  1078.  
  1079. Test Condition Generation
  1080.  
  1081. The objectives of security testing ". . . shall be: to uncover all design and implementation 
  1082. flaws that would permit a subject external to the TCB to read, change, or delete data 
  1083. normally denied under the mandatory or discretionary security policy enforced by the 
  1084. TCB; as well as to ensure that no subject (without authorization to do so) is able to cause 
  1085. the TCB to enter a state such that it is unable to respond to communications initiated by 
  1086. other users." [TCSEC, Part I, Section 3.1]
  1087.  
  1088. The security testing requirements of class B1 are more extensive than those of both classes C1 
  1089. and C2, both in test condition generation and in coverage analysis. The source of test conditions 
  1090. referring to users' access to data includes the mandatory and discretionary policies implemented 
  1091. by the TCB. These policies are defined by an (informal) policy model whose interpretation within 
  1092. the TCB allows the derivation of test conditions for each TCB primitive. Although not explicitly 
  1093. stated in the TCSEC, it is generally expected that all relevant test conditions for classes C1 and C2 
  1094. also would be used for a class B1 system.
  1095.  
  1096. Test Coverage
  1097.  
  1098. "All discovered flaws shall be removed or neutralized and the TCB retested to demonstrate 
  1099. that they have been eliminated and that new flaws have not been introduced." [TCSEC, 
  1100. Part I, Section 3.1]
  1101.  
  1102. "The team shall independently design and implement at least fifteen system specific tests 
  1103. in an attempt to circumvent the security mechanisms of the system." [TCSEC, Part II, 
  1104. Section 10]
  1105.  
  1106. Although the coverage analysis is still boundary-value analysis, security testing for class B1 
  1107. systems suggests that at least fifteen test conditions be generated for each TCB primitive that 
  1108. contains security-relevant mechanisms to cover both mandatory and discretionary policy. In 
  1109. practice, however, a substantially higher number of test conditions is generated from interpretations 
  1110. of the (informal) security model. The removal or the neutralization of found errors and the retesting 
  1111. of the TCB requires no additional types of coverage analysis.
  1112.  
  1113. Security Class B2
  1114.  
  1115. Test Condition Generation
  1116.  
  1117. "Testing shall demonstrate that the TCB implementation is consistent with the descriptive 
  1118. top-level specification." [TCSEC, Part I, Section 3.2]
  1119.  
  1120. The above requirement implies that both the test conditions and coverage analysis of class B2 
  1121. systems are more extensive than those of class B1. In class B2 systems every access control and 
  1122. accountability mechanism documented in the DTLS (which must be complete as well as accurate) 
  1123. represents a source of test conditions. In principle the same types of test conditions would be 
  1124. generated for class B2 systems as for class B1 systems, because (1) in both classes the test conditions 
  1125. could be generated from interpretations of the security policy model (informal at B1 and formal at 
  1126. B2), and (2) in class B2 the DTLS includes precisely the interpretation of the security policy model. 
  1127. In practice this is not the case however, because security policy models do not model a substantial 
  1128. number of mechanisms that are, nevertheless, included in the DTLS of class B2 systems. (Recall 
  1129. that class B1 systems do not require a DTLS of the TCB interface.) The number and type of test 
  1130. conditions can therefore be substantially higher in a class B2 system than those in a class B1 system 
  1131. because the DTLS for each TCB primitive may contain additional types of mechanisms, such as 
  1132. those for trusted facility management.
  1133.  
  1134. Test Coverage
  1135.  
  1136. It is not unusual to have a few individual test conditions for at least some of the TCB primitives. 
  1137. As suggested in the gray-box approach defined in the previous section, repeating these conditions 
  1138. for many of the TCB primitives to achieve uniform coverage can be both impractical and 
  1139. unnecessary. Particularly this is true when these primitives refer to the same object types and 
  1140. services. It is for this reason and because source-code analysis is required in class B2 systems to 
  1141. satisfy other requirements that the use of the gray-box testing approach is recommended for the 
  1142. parts of the TCB in which primitives share a substantial portion of their code. Note that the DTLS 
  1143. of any system does not necessarily provide any test conditions for demonstrating the 
  1144. tamperproofness and noncircumventability of the TCB. Such conditions should be generated 
  1145. separately.
  1146.  
  1147. Security Class 83
  1148.  
  1149. Test Condition Generation
  1150.  
  1151. The only difference between classes B2 and B3 requirements of security testing reflects the need 
  1152. to discover virtually all security policy flaws before the evaluation team conducts its security testing 
  1153. exercise. Thus, no additional test condition requirements appear for class B3 testing. Note that the 
  1154. DTLS does not necessarily provide any test conditions for demonstrating the TCB is tamperproof 
  1155. and noncircumventable as with class B2 systems. Such conditions should be generated separately.
  1156.  
  1157. Test Coverage
  1158.  
  1159. "No design flaws and no more than a few correctable implementation flaws may be found 
  1160. during testing and there shall be reasonable confidence that few remain." [TCSEC, Part 
  1161. I, Section 3.3]
  1162.  
  1163. The above requirement suggests that a higher degree of confidence in coverage analysis is required 
  1164. for class B3 systems than for class B2 systems. It is for this reason that it is recommended the gray-
  1165. box testing approach be used extensively for the entire TCB kernel, and data-flow coverage be used 
  1166. for all independent primitives of the kernel (namely, the gray-box method in Section 3.3 above).
  1167.  
  1168. Security Class A1
  1169.  
  1170. The only differences between security testing requirements of classes B3 and A1 are (1) the test 
  1171. conditions shall be derived from the FTLS, and (2) the coverage analysis should include at least 
  1172. twenty-five test conditions for each TCB primitive implementing security functions. Neither 
  1173. requirement suggests that a different testing method than that recommended for class B3 systems 
  1174. is required.
  1175.  
  1176. 3.5 SECURITY TEST DOCUMENTATION
  1177.  
  1178. This section discusses the structure of typical test plans, test logs, test programs, test procedures, 
  1179. and test reports. The description of the test procedures necessary to run the tests and to examine 
  1180. the test results is also addressed. The documentation structures presented are meant to provide the 
  1181. system developers with examples of good test documentation.
  1182.  
  1183. 3.5.1 Overview
  1184.  
  1185. The work plan for system testing should describe how security testing will be conducted and 
  1186. should contain the following information:
  1187.  
  1188. ╖       Test-system configuration for both hardware and software.
  1189.  
  1190. ╖       Summary test requirements.
  1191.  
  1192. ╖       Procedures for executing test cases.
  1193.  
  1194. ╖       Step-by-step procedures for each test case.
  1195.  
  1196. ╖       Expected results for each test step.
  1197.  
  1198. ╖       Procedures for correcting flaws uncovered during testing.
  1199.  
  1200. ╖       Expected audit information generated by each test case (if any).
  1201.  
  1202. See Section 3.7.7, "Relationship with the TCSEC Requirements."
  1203.  
  1204. 3.5.2 Test Plan
  1205.  
  1206. Analysis and testing of mechanisms, assurances and/or documentation to support the TCSEC 
  1207. security testing requirements are accomplished through test plans. The test plans should be 
  1208. sufficiently complete to cover each identified security mechanism and should be conducted with 
  1209. sufficient depth to provide reasonable assurance that any bugs not found lie within the acceptable 
  1210. risk threshold for the class of the system being evaluated. A test plan consists of test conditions, 
  1211. test data, and coverage analysis.
  1212.  
  1213. 3.5.2.1 Test Conditions
  1214.  
  1215. A test condition is a statement of a security-relevant constraint that must be satisfied by a TCB 
  1216. primitive. Test conditions should be derived from the system's DTLS/FTLS, from the interpretation 
  1217. of the security and accountability models (if any), from TCB isolation and noncircumventability 
  1218. properties, and from the specifications and implementation of the individual TCB primitive under 
  1219. test. If neither DTLS/FTLS nor models are required, then test conditions should be derived from 
  1220. the informal policy statements, protection philosophy and resource isolation requirements.
  1221.  
  1222. (1) Generation of Model or Policy-Relevant Test Conditions
  1223.  
  1224. This step suggests that a matrix of TCB primitives and the security model(s) or requirement 
  1225. components be built. Each entry in the matrix identifies the security relevance of each primitive (if 
  1226. any) in a security model or requirement area and the relevant test conditions. For example, in the 
  1227. mandatory access control area of security policy, one should test the proper object labeling by the 
  1228. TCB, the "compatibility" property of the user created objects, and the TCB implemented 
  1229. authorization rules for subject access to objects. One should also test that the security-level 
  1230. relationships are properly maintained by the TCB and that the mandatory access works 
  1231. independently of, and in conjunction with, the discretionary access control mechanism. In the 
  1232. discretionary access control area, one may include tests for proper user/group identifier selection, 
  1233. proper user inclusion/exclusion, selective access distribution/revocation using the access control 
  1234. list (ACL) mechanism, and access review.
  1235.  
  1236. Test conditions derived from TCB isolation and noncircumventability properties include 
  1237. conditions that verify (1) that TCB data structures are inaccessible to user level programs, (2) that 
  1238. transfer of control to the TCB can take place only at specified entry points, which cannot be bypassed 
  1239. by user-level programs, (3) that privileged entry points into the TCB cannot be used by user level 
  1240. programs, and (4) that parameters passed by reference to the TCB are validated.
  1241.  
  1242. Test conditions derived from accountability policy include conditions that verify that user 
  1243. identification and authentication mechanisms operate properly. For example, they include 
  1244. conditions that verify that only sufficiently complex passwords can be chosen by any user, that the 
  1245. password aging mechanism forces reuse at stated intervals, and so on. Other conditions of 
  1246. identification and authentication, such as those that verify that the user login level is dominated by 
  1247. the user's maximum security level, should also be included. Furthermore, conditions that verify 
  1248. that the user commands included in the trusted path mechanism are unavailable to the user program 
  1249. interface of the TCB should be used. Accountability test conditions that verify the correct operation 
  1250. of the audit mechanisms should also be generated and used in security testing.
  1251.  
  1252. The security relevance of a TCB primitive can only be determined from the security policy, 
  1253. accountability, and TCB isolation and noncircumventability requirements for classes B1 to A1, or 
  1254. from protection philosophy and resource isolation requirements for classes C1 and C2. Some TCB 
  1255. primitives are security irrelevant. For example, TCB primitives that never allow the flow of 
  1256. information across the boundaries of an accessible object are always security irrelevant and need 
  1257. not be tested with respect to the security or accountability policies. The limitation of information 
  1258. flow to user-accessible objects by the TCB primitives implementation, however, needs to be tested 
  1259. by TCB-primitive-specific tests. A general example of security-irrelevant TCB primitives is 
  1260. provided by those primitives which merely retrieve the status of user-owned processes at the security 
  1261. level of the user.
  1262.  
  1263. (2) Generation of TCB-Primitive-Specific Test Conditions
  1264.  
  1265. The selection of test conditions used in security testing should be TCB-primitive-specific. This 
  1266. helps remove redundant test conditions and, at the same time, helps ensure that significant test 
  1267. coverage is obtained. For example, the analysis of TCB-primitive specifications to determine their 
  1268. access-check dependencies is required whenever the removal of redundant TCB-primitive tests is 
  1269. considered important. This analysis can be applied to all testing approaches. The specification of a 
  1270. TCB primitive A is access-check dependent on the specification of a TCB primitive B if a subset 
  1271. of the access checks needed in TCB primitive A are performed in TCB primitive B, and if a TCB 
  1272. call to primitive B always precedes a TCB call to primitive A (i.e., a call to TCB primitive A fails 
  1273. if the call to TCB primitive B has not been done or has not completed with a successful outcome). 
  1274. In case of such dependencies, it is sufficient to test TCB primitive B first and then to test only the 
  1275. access checks of TCB primitive A that are not performed in TCB primitive B. Of course, the 
  1276. existence of the access-check dependency must be verified through testing.
  1277.  
  1278. As an example of access-check dependency, consider the fork and the exit primitives of the 
  1279. Secure XenixTM kernel. The exit primitive always terminates a process and sends a return code to 
  1280. the parent process. The mandatory access check that needs to be tested in exit is that the child's 
  1281. process security level equals that of the parent's process. However, the specifications of the exit 
  1282. primitive are access-check dependent on the specifications of the fork primitive (1) because an exit 
  1283. call succeeds only after a successfully completed fork call is done by some parent process, and (2) 
  1284. because the access check, that the child's process level always equals that of the parent's process 
  1285. level, is already performed during the fork call. In this case, no additional mandatory access test is 
  1286. needed for exit beyond that performed for fork. Similarly, the sigsem and the waitsem primitives 
  1287. of some UnixTM based kernels are access-check dependent on the opensem primitive, and no 
  1288. additional mandatory or discretionary access checks are necessary.
  1289.  
  1290. However, in the case of the read and the write primitives of UnixTM kernels, the specifications 
  1291. of which are also access-check dependent on both the mandatory and the discretionary checks of 
  1292. the open primitive, additional tests are necessary beyond those done for open. In the case of the 
  1293. read primitive one needs to test that files could only be read if they have been opened for reading, 
  1294. and that reading beyond the end of a file is impossible after one tests the dependency of read on 
  1295. the specification of open. Additional tests are also needed for other primitives such as fcntl and 
  1296. loctl; their specifications are both mandatory and discretionary access-check dependent on the open 
  1297. primitives for files and devices. Note that in all of the above examples a large number of test 
  1298. conditions and associated tests are eliminated by using the notion of access check dependency of 
  1299. specifications because, in general, less test conditions are generated for access check dependency 
  1300. testing than for the security testing of the primitive itself.
  1301.  
  1302. The following examples are given in references [3] and [4]: (1) of the generation of such 
  1303. constraints from security models, (2) of the predicates, variables, and object types used in constraint 
  1304. definition, and (3) of the use of such constraints in test conditions for processor instructions (rather 
  1305. than for TCB primitives).
  1306.  
  1307. See Section 3.7.7, "Relationship with the TCSEC Requirements."
  1308.  
  1309. 3.5.2.2 Test Data
  1310.  
  1311. "Test data" is defined as the set of specific objects and variables that must be used to demonstrate 
  1312. that a test condition is satisfied by a TCB primitive. The test data consist of the definition of the 
  1313. initialization data for the test environment, the test parameters for each TCB primitive, and the 
  1314. expected test outcomes. Test data generation is as important as test condition generation because it 
  1315. ensures that test conditions are exercised with appropriate coverage in the test programs, and that 
  1316. test environment independence is established whenever it is needed.
  1317.  
  1318. To understand the importance of test data generation consider the following example. Suppose 
  1319. that all mandatory tests must ensure that the "hierarchy" requirement of the mandatory policy 
  1320. interpretation must be tested for each TCB primitive. (Expansion on this subject, i.e., the 
  1321. nondecreasing security level requirement for the directory hierarchy can be found in [12].) What 
  1322. directory hierarchy should one set up for testing this requirement and at the same time argue that 
  1323. all possible directory hierarchies are covered for all tests? A simple analysis of this case shows that 
  1324. there are two different forms of upgraded directory creation that constitute an independent basis 
  1325. for all directory hierarchies (i.e., all hierarchies can be constructed by the operations used for one 
  1326. or the other of the two forms, or by combinations of these operations). The first form is illustrated 
  1327. in Figure 3a representing the case whereby each upgraded directory at a different level is upgraded 
  1328. from a single lower level (e.g., system low). The second form is illustrated in Figure 3b and 
  1329. represents the case whereby each directory at a certain level is upgraded from an immediately lower 
  1330. level. A similar example can be constructed to show that combinations of security level definitions 
  1331. used for mandatory policy testing cover all security level relationships.
  1332.  
  1333. Test data for TCB primitives should include several items such as the TCB primitive input data, 
  1334. TCB primitive return result and success/failure code, object hierarchy definition, security level used 
  1335. for each process/object, access privileges used, user identifiers, object types, and so on. This 
  1336. selection needs to be made on a test-by-test basis and on a primitive-by-primitive basis. Whenever 
  1337. environment independence is required, a different set of data is defined [2]. It is very helpful that 
  1338. the naming scheme used for each data object helps identify the test that used that item. Different 
  1339. test environments can be easily identified in this way. Note that the test data selection should ensure 
  1340. both coverage of model-relevant test conditions and coverage of the individual TCB primitives. 
  1341. This will be illustrated in an example in the next section.
  1342.  
  1343. See Section 3.7.7, "Relationship with the TCSEC Requirements."
  1344.  
  1345. 3.5.2.3 Coverage Analysis
  1346.  
  1347. Test coverage analysis is performed in conjunction with the test selection phase of our approach. 
  1348. Two classes of coverage analysis should be performed: model- or policy-dependent coverage and 
  1349. individual TCB primitive coverage.
  1350.  
  1351. (1) Model- or Policy-Dependent Coverage
  1352.  
  1353. In this class, one should demonstrate that the selected test conditions and data cover the 
  1354. interpretation of the security and accountability model and noncircumventability properties in all 
  1355. areas identified by the matrix mentioned above. This is a comparatively simple task because model 
  1356. coverage considerations drive the test condition and data selection. This kind of coverage includes 
  1357. object type, object hierarchy, subject identification, access privilege, subject/object security level, 
  1358. authorization check coverage, and so on. Model dependent coverage analysis relies, in general, on 
  1359. boundary-value analysis.
  1360.  
  1361. (2) Individual TCB-Primitives Coverage
  1362.  
  1363. This kind of coverage includes boundary value analysis, data flow analysis of individual access-
  1364. check graphs of TCB primitives, and coverage of dependencies. The examples of reference [2] 
  1365. illustrate boundary-value analysis. Other forms of TCB-primitive coverage will be discussed in 
  1366. Section 3.7 of this guideline. For example, graph coverage analysis represents the determination 
  1367. that the test conditions and data exercise all the data flows for each TCB-primitive graph. This 
  1368. includes not only the traversal of all the graph access checks (i.e., nodes) but also of all the graph's 
  1369. arcs and arc sequences required for each TCB primitive. (The example for access primitive of 
  1370. UnixTM kernels included in Section 3.7 explains this form of coverage. Data flow coverage is also 
  1371. presented in [10] and [11] for security-unrelated test examples.)
  1372.  
  1373.  
  1374.  
  1375. Coverage analysis is both a qualitative and quantitative assessment of the extent to which the test 
  1376. shows TCB-primitive compliance with the (1) design documentation, (2) resource isolation, (3) 
  1377. audit and authentication data protection, (4) security policy and accountability model conditions, 
  1378. (5) DTLS/FTLS, as well as with those of the TCB isolation and noncircumventability properties. 
  1379. To achieve significant coverage, all security-relevant conditions derived from a TCB model and 
  1380. properties and DTLS/FTLS should be covered by a test, and each TCB-primitive test should cover 
  1381. the implementation of its TCB primitive. For example, each TCB- primitive test should be performed 
  1382. for all independent object types operated upon by that TCB primitive and should test all independent 
  1383. security exceptions for each type of object.
  1384.  
  1385. See Section 3.7.7, "Relationship with the TCSEC Requirements."
  1386.  
  1387. 3.5.3 Test Procedures
  1388.  
  1389. A key step in any test system is the generation of the test procedures (which are also known as 
  1390. "test scripts"). The major function of the test procedure is to ensure that an independent test operator 
  1391. or user is able to carry out the test and to obtain the same results as the test implementor. The 
  1392. procedure for each test should be explained in sufficient detail to enable repeatable testing. The test 
  1393. procedure should contain the following items to accomplish this:
  1394.  
  1395. (1) Environment Initialization Procedure. This procedure defines the login sequences and 
  1396. parameters, the commands for object and subject cleanup operations at all levels involved in the 
  1397. test, the choice of object names, the commands and parameters for object creation and initialization 
  1398. at the required levels, the required order of command execution, the initialization at the required 
  1399. levels, the initialization of different subject identifiers and access privileges (for the initialized 
  1400. objects) at all required levels, and the specification of the test program and command names and 
  1401. parameters used in the current test.
  1402.  
  1403. (2) Test Execution Procedure. The test procedure includes a description of the test execution from 
  1404. a terminal including the list of user commands, their input, and the expected terminal, printer, or 
  1405. file output.
  1406.  
  1407. (3) Result Identification Procedure. The test procedure should also identify the results file for a 
  1408. given test, or the criteria the test operator must use to find the results of each individual test in the 
  1409. test output file. The meaning of the results should also be provided.
  1410.  
  1411. See Section 3.7.7, "Relationship with the TCSEC Requirements."
  1412.  
  1413. Note: A system in which testing is fully automated eliminates the need for separate test procedure 
  1414. documentation. In such cases, the environment initialization procedures and the test execution 
  1415. procedures should be documented in the test data section of the test plans. Automated test operator 
  1416. programs include the built-in knowledge otherwise contained in test procedures.
  1417.  
  1418. 3.5.4 Test Programs
  1419.  
  1420. Another key step of any test system is the generation of the test programs. The test programs for 
  1421. each TCB primitive consist of the Iogin sequence, password, and requested security level. The 
  1422. security profile of the test operator and of the possible workstation needs to be defined a priori by 
  1423. the system security administrators to allow logins and environment initialization at levels required 
  1424. in the test plan. After login, a test program invokes several trusted processes (e.g., "mkdir," "rmdir," 
  1425. in some UnixYM systems) with predetermined parameters in the test plan and procedure to initialize 
  1426. the test environment. A nucleus of trusted processes, necessary for the environment set up, are tested 
  1427. independently of a TCB primitive under test whenever possible and are assumed to be correct.
  1428.  
  1429. After the test environment is initialized, the test program (which may require multiple logins at 
  1430. different levels) issues multiple invocations to the TCB primitive under test and to other TCB 
  1431. primitives needed for the current test. The output of each primitive issued by the test programs is 
  1432. collected in a result file associated with each separate test and analyzed. The analysis of the test 
  1433. results that are collected in the results file is performed by the test operator. This analysis is a 
  1434. comparison between the results file and the expected outcome file defined by the test plan prior to 
  1435. the test run. Whenever the test operator detects a discrepancy between the two files he records a 
  1436. test error.
  1437.  
  1438. 3.5.5 Test Log
  1439.  
  1440. A test log should be maintained by each team member during security testing. It is to capture 
  1441. useful information to be included later in the test report. The test log should contain:
  1442.  
  1443. ╖       Information on any noteworthy observations.
  1444.  
  1445. ╖       Modifications to the test steps.
  1446.  
  1447. ╖       Documentation errors.
  1448.  
  1449. ╖       Other useful data recorded during the testing procedure test results.
  1450.  
  1451. 3.5.6 Test Report
  1452.  
  1453. The test report is to present the results of the security testing in a manner that effectively supports 
  1454. the conclusions reached from the security testing process and provides a basis for NCSC test team 
  1455. security testing. The test report should contain:
  1456.  
  1457. ╖       Information on the configuration of the tested system.
  1458.  
  1459. ╖       A chronology of the security testing effort.
  1460.  
  1461. ╖       The results of functional testing including a discussion of each flaw uncovered.
  1462.  
  1463. ╖       The results of penetration testing covering the results of successful penetrations.
  1464.  
  1465. ╖       Discussion of the corrections that were implemented and of any retesting that was 
  1466. performed.
  1467.  
  1468. A sample test report format is provided in Section 3.7.
  1469.  
  1470. 3.6 SECURITY TESTING OF PROCESSORS' HARDWARE/FIRMWARE
  1471. PROTECTION MECHANISMS
  1472.  
  1473. The processors of a computer system include the Central Processing Units (CPU), Input/Output 
  1474. (I/O) processors, and application-oriented co-processors such as numerical co-processors and 
  1475. signal-analysis co-processors. These processors may include mechanisms capabilities, access 
  1476. privileges, processor-status registers, and memory areas representing TCB internal objects such as 
  1477. process control blocks, descriptor, and page tables. The effects of the processor protection 
  1478. mechanisms become visible to the system users through the execution of processor instructions and 
  1479. I/O commands that produce transformations of processor and memory registers. Transformations 
  1480. produced by every instruction or I/O command are checked by the processors protection 
  1481. mechanisms and are allowed only if they conform with the specifications defined by the processor 
  1482. reference manuals for that instruction. For few processors these transformations are specified 
  1483. formally and for less processors a formal (or informal) model of the protection mechanisms is given 
  1484. [3 and 4].
  1485.  
  1486. 3.6.1 The Need for Hardware/Firmware Security Testing
  1487.  
  1488. Protection mechanisms of systems processors provide the basic support for TCB isolation, 
  1489. noncircumventability, and process address space separation. In general, processor mechanisms for 
  1490. the isolation of the TCB include those that (1) help separate the TCB address space and privileges 
  1491. from those of the user, (2) help enforce the transfer of control from the user address space to the 
  1492. TCB address space at specific entry points, and (3) help verify the validity of the user-level 
  1493. parameters passed to the TCB during primitive invocation. Processor mechanisms that support TCB 
  1494. noncircumventability include those that (1) check each object reference against a specific set of 
  1495. privileges, and (2) ensure that privileged instructions which can circumvent some of the protection 
  1496. mechanisms are inaccessible to the user. Protection mechanisms that help separate process address 
  1497. spaces include those using base and relocation registers, paging, segmentation, and combinations 
  1498. thereof.
  1499.  
  1500. The primary reason for testing the security function of a system's processors is that flaws in the 
  1501. design and implementation of processor-supported protection mechanisms become visible at the 
  1502. user level through the instruction set. This makes the entire system vulnerable because users can 
  1503. issue carefully constructed sequences of instructions that would compromise TCB and user security.
  1504.  
  1505. (User visibility of protection flaws in processor designs is particularly difficult to deny. Attempts 
  1506. to force programmers to use only high-level languages, such as PL1, Pascal, Algol, etc., which 
  1507. would obscure the processor instruction set, are counterproductive because arbitrary addressing 
  1508. patterns and instruction sequences still can be constructed through seemingly valid programs (i.e., 
  1509. programs that compile correctly). In addition, exclusive reliance on language compilers and on 
  1510. other subsystems for the purpose of obscuring protection flaws and denying users the ability to 
  1511. produce arbitrary addressing patterns is unjustifiable. One reason is that compiler verification is a 
  1512. particularly difficult task; another is that reliance on compilers and on other subsystems implies 
  1513. reliance on the diverse skills and interests of system programmers. Alternatively, hardware-based 
  1514. attempts to detect instruction sequence patterns that lead to protection violations would only result 
  1515. in severe performance degradation.)
  1516.  
  1517. The additional reason for testing the security function of a system's processor is that, in general, 
  1518. a system's TCB uses at least some of the processor's mechanisms to implement its security policy. 
  1519. Flawed protection mechanisms may become unusable by the TCB and, in some cases, the TCB 
  1520. may not be able to neutralize those flaws (e.g., make them invisible to the user). It should be noted 
  1521. that the security testing of the processor protection mechanisms is the most basic life-cycle evidence 
  1522. available in the context of TCSEC evaluations to support the claim that a system's reference notion 
  1523. is verifiable.
  1524.  
  1525. 3.6.2 Explicit TCSEC Requirements for Hardware Security Testing
  1526.  
  1527. The TCSEC imposes very few explicit requirements for the security testing of a system's hardware 
  1528. and firmware protection mechanisms. Few interpretations can be derived from these requirements 
  1529. as a consequence. Recommendations for processor test plan generation and documentation, 
  1530. however, will be made in this guideline in addition to explicit TCSEC requirements. These 
  1531. recommendations are based on analogous TCB testing recommendations made herein.
  1532.  
  1533. Specific Requirements for Classes C1 and C2
  1534.  
  1535. The following requirements are included for security classes C1 and C2:
  1536.  
  1537. "The security mechanisms of the ADP system shall be tested and found to work as claimed 
  1538. in the system documentation."
  1539.  
  1540. The security mechanisms of the ADP system clearly include the processor-supported protection 
  1541. mechanisms that are used by the TCB and those that are visible to the users through the processor's 
  1542. instruction set. In principle it could be argued that the TCB security testing implicitly tests at least 
  1543. some processor mechanisms used by the TCB; therefore, no additional hardware testing is required 
  1544. for these mechanisms. All processor protection mechanisms that are visible to the user through the 
  1545. instruction set shall be tested separately regardless of their use by a tested TCB. In practice, nearly 
  1546. all processor protection mechanisms are visible to users through the instruction set. An exception 
  1547. is provided by some of the I/O processor mechanisms in systems where users cannot execute I/O 
  1548. commands either directly or indirectly.
  1549.  
  1550. Specific Requirements for Classes B1 to B3
  1551.  
  1552. In addition to the above requirements of classes C1 and C2, the TCSEC includes the following 
  1553. specific hardware security testing guidelines in Section 10 "A Guideline on Security Testing":
  1554.  
  1555. "The [evaluation] team shall have `hands-on' involvement in an independent run of the 
  1556. test package used by the system developer to test security-relevant hardware and software.
  1557.  
  1558. The explicit inclusion of this requirement in the division B (i.e., classes B1 to B3) of the TCSEC 
  1559. guideline on security testing implies that the scope and coverage of the security-relevant hardware 
  1560. testing and test documentation should be consistent with those of the TCB security testing for this 
  1561. division. Thus, the security testing of the processor s protection mechanisms for division B systems 
  1562. should be more extensive that for division C (i.e., C1 and C2) systems.
  1563.  
  1564. Specific Requirement for Class A1
  1565.  
  1566. In addition to the requirements for divisions C and B, the TCSEC includes the following explicit 
  1567. requirements for hardware and/or firmware testing:
  1568.  
  1569. "Testing shall demonstrate that the TCB implementation is consistent with the formal 
  1570. top-level specifications." [Security Testing requirement] and
  1571.  
  1572. "The DTLS and FTLS shall include those components of the TCB that are implemented 
  1573. as hardware and/or firmware if their properties are visible at the TCB interface." [Design 
  1574. Specification and Verification requirement]
  1575.  
  1576. The above requirements suggest that all processor protection mechanisms that are visible at the 
  1577. TCB interface should be tested. The scope and coverage of the security-relevant testing and test 
  1578. documentation should also be consistent with those of TCB security-relevant testing and test 
  1579. documentation for this division.
  1580.  
  1581. 3.6.3 Hardware Security Testing vs. System Integrity Testing
  1582.  
  1583. Hardware security testing and system integrity testing differ in at least three fundamental ways. 
  1584. First, the scope of system integrity testing and that of hardware security testing is different. System 
  1585. integrity testing refers to the functional testing of the hardware/firmware components of a system 
  1586. including components that do not necessarily have a specific security function (i.e., do not include 
  1587. any protection mechanisms). Such components include the memory boards, busses, displays, 
  1588. adaptors for special devices, etc. Hardware security testing, in contrast, refers to hardware and 
  1589. firmware components that include protection mechanisms (e.g., CPU's and I/O processors). Failures 
  1590. of system components that do not include protection mechanisms may also affect system security 
  1591. just as they would affect reliability and system performance. Failures of components that include 
  1592. protection mechanisms can affect system security adversely. A direct consequence of the distinction 
  1593. between the scope of system integrity and hardware security testing is that security testing 
  1594. requirements vary with the security class of a system, whereas system integrity testing requirements 
  1595. do not.
  1596.  
  1597. Second, the time and frequency of system integrity and security testing are different. System 
  1598. integrity testing is performed periodically at the installation site of the equipment. System security 
  1599. testing is performed in most cases at component design and integration time. Seldom are hardware 
  1600. security test suites performed at the installation site.
  1601.  
  1602. Third, the responsibility for system integrity testing and hardware security testing is different. 
  1603. System integrity testing is performed by site administrators and vendor customer or field engineers. 
  1604. Hardware security testing is performed almost exclusively by manufacturers, vendors, and system 
  1605. evaluators.
  1606.  
  1607. 3.6.4 Goals, Philosophy, and Approaches to Hardware Security Testing
  1608.  
  1609. Hardware security testing has the same general goals and philosophy as those of general TCB 
  1610. security testing. Hardware security testing should be performed for processors that operate in normal 
  1611. mode (as opposed to maintenance or test mode). Special probes, instrumentation, and special 
  1612. reserved op-codes in the instruction set should be unnecessary. Coverage analysis for each tested 
  1613. instruction should be included in each test plan. Cyclic test dependencies should be minimized, and 
  1614. testing should be repeatable and automated whenever possible.
  1615.  
  1616. In principle, all the approaches to security testing presented in Section 3.3 are applicable to 
  1617. hardware security testing. In practice, however, all security testing approaches reported to date have 
  1618. relied on the monolithic testing approach. This is the case because hardware security testing is 
  1619. performed on an instruction basis (often only descriptions of the hardware/firmware-implemented, 
  1620. but no internal hardware/firmware design details, are available to the test designers). The generation 
  1621. of test conditions is, consequently, based on instruction and processor documentation (e.g., on 
  1622. reference manuals). Models of the processor protection mechanisms and top-level specifications of 
  1623. each processor instruction are seldom available despite their demonstrable usefulness [3 and 4] and 
  1624. mandatory use [13, class A1] in security testing. Coverage analysis is restricted in practice to 
  1625. boundary-value coverage for similar reasons.
  1626.  
  1627. 3.6.5 Test Conditions, Data, and Coverage Analysis for Hardware Security Testing
  1628.  
  1629. Lack of DTLS and protection-model requirements for processors' hardware/firmware in the 
  1630. TCSEC between classes C1 and B3 makes the generation of test conditions for processor security 
  1631. testing a challenging task (i.e., class A1 requires that FTLS be produced for the user-visible hardware 
  1632. functions and thus these FTLS represent a source of test conditions). The generation of test data is 
  1633. somewhat less challenging because this activity is related to a specific coverage analysis method, 
  1634. namely boundary-value coverage, which implies that the test designer should produce test data for 
  1635. both positive and negative outcomes of any condition.
  1636.  
  1637. Lack of DTLS and of protection-model requirements for processors' hardware and firmware 
  1638. makes it important to identify various classes of security test conditions for processors that illustrate 
  1639. potential sources of test conditions. We partition these classes of test conditions into the following 
  1640. categories: (l) processor tests that help detect violations of TCB isolation and noncircumventability, 
  1641. (2) processor tests that help detect violations of policy, and (3) processor tests that help detect other 
  1642. generic flaws (e.g., integrity and denial of service flaws).
  1643.  
  1644. 3.6.5.1 Test Conditions for Isolation and Noncircumventability Testing
  1645.  
  1646. (1) There are tests which detect flaws in instructions that violate the separation of user and TCB 
  1647. (privileged) domain:
  1648.  
  1649. Included in this class are tests that detect flaws in bounds checking CPU and I/O processors, 
  1650. top- and bottom-of-the-stack frame checking, dangling references, etc. [4]. Tests within this class 
  1651. should include the checking of all addressing modes of the hardware/firmware. This includes single 
  1652. and multiple-level indirect addressing [3 and 4], and direct addressing with no operands (i.e., stack 
  1653. addressing), with a single operand and with multiple operands. Tests which demonstrate that all the 
  1654. TCB processor, memory, and I/O registers are inaccessible to users who execute nonprivileged 
  1655. instructions should also be included here.
  1656.  
  1657. This class also includes tests that detect instructions that do not perform or perform improper 
  1658. access privilege checks. An example of this is the lack of improper access privilege checking during 
  1659. multilevel indirections through memory by a single instruction. Proper page-or segment-presence 
  1660. bit checks as well as the proper invalidation of descriptors within caches during process switches 
  1661. should also be tested. All tests should ensure that all privilege checking is performed in all addressing 
  1662. modes. Tests which check whether a user can execute privileged instructions are also included here. 
  1663. Examples of such tests (and lack thereof) can be found in [3, 4, 22, and 23].
  1664.  
  1665. (2) There are tests that detect flaws in instructions that violate the control of transfer between 
  1666. domains:
  1667.  
  1668. Included in this class are tests that detect flaws that allow anarchic entries to the TCB domain 
  1669. (i.e., transfers to TCB arbitrary entry points and at arbitrary times), modification and/or 
  1670. circumvention of entry points, and returns to the TCB which do not result from TCB calls. Tests 
  1671. show that the local address space of a domain or ring is switched properly upon domain entry or 
  1672. return (e.g., in a ring-based system, such as SCOMP, Intel 80286-80386, each ring stack segment 
  1673. is selected properly upon a ring crossing).
  1674.  
  1675. (3) There are tests that detect flaws in instructions that perform parameters validation checks:
  1676.  
  1677. Included in this class are tests that detect improper checks of descriptor privileges, descriptor 
  1678. length, or domain/ring of a descriptor (e.g., Verify Read (VERR), Verify Write (VERW), Adjust 
  1679. Requested Privilege Level (ARPL), Load Access Rights (LAR), Load Segment Length (LSL) in 
  1680. the Intel 80286-80386 architecture [24], Argument Addressing Mode (AAM) in Honeywell 
  1681. SCOMP, [22 and 23], etc.).
  1682.  
  1683. 3.6.5.2 Text Conditions for Policy-Relevant Processor Instructions
  1684.  
  1685. Included in this class are tests that detect flaws that allow user-visible processor instructions to 
  1686. allocate/deallocate objects in memory containing residual parts of previous objects and tests that 
  1687. detect flaws that would allow user-visible instructions to transfer access privileges in a way that is 
  1688. inconsistent with the security policy (e.g., capability copying that would bypass copying restriction, 
  1689. etc.).
  1690.  
  1691. This class also includes tests that detect flaws that allow a user to execute nonprivileged 
  1692. instructions that circumvent the audit mechanism by resetting system clocks and by disabling system 
  1693. interrupts which record auditable events. (Note that the flaws that would allow users to access audit 
  1694. data in an unauthorized way are already included in Section 3.6.5.1 because audit data is part of 
  1695. the TCB.)
  1696.  
  1697. 3.6.5.3 Tests Conditions for Generic-Security Flaws
  1698.  
  1699. Included in this class are tests that detect flaws in reporting protection violations during the 
  1700. execution of an instruction. For example, the raising of the wrong interrupt (trap) flag during a 
  1701. (properly) detected access privilege violation may lead to the interrupt (trap) handling routine to 
  1702. violate (unknowingly) the security policy. Insufficient interrupt/trap data left for interrupt/trap 
  1703. handling may similarly lead to induced violations of security policy by user domains.
  1704.  
  1705. Also included in this class are tests that detect flaws in hardware/firmware which appear only 
  1706. during the concurrent activity of several hardware components. For example, systems which use 
  1707. paged segments may allow concurrent access to different pages of the same segment both by I/O 
  1708. and CPU processors. The concurrent checking of segment privileges by the CPU and I/O processors 
  1709. should be tested in this case (in addition to individual CPU and I/O tests for correct privilege checks 
  1710. [3]).
  1711.  
  1712. The TCSEC requirements in the area of security testing state that security testing and analysis 
  1713. must discover all flaws that would permit a user external to the TCB to cause the TCB to enter a 
  1714. state such that it is unable to respond to communications initiated by other users. At the hardware/
  1715. firmware level there are several classes of flaws (and corresponding tests) that could cause (detect) 
  1716. violations of this TCSEC requirement. The following classes of flaws are examples in this area. 
  1717. (Other examples of such classes may be found in future architectures due to the possible migration 
  1718. of operating system functions to hardware/firmware.)
  1719.  
  1720. (1) There are tests that detect addressing flaws that place the processors in an "infinite loop" upon 
  1721. executing a single instruction:
  1722.  
  1723. Included in these flaws are those that appear in processors that allow multilevel indirect 
  1724. addressing by one instruction. For example, a user can create a self-referential chain of indirect 
  1725. addresses and then execute a single instruction that performs multilevel indirections using that chain. 
  1726. Inadequate checking mechanisms may cause the processor to enter an "infinite loop" that cannot 
  1727. be stopped by operating system checks. Lack of tests and adequate specifications in this area are 
  1728. also explained in [3].
  1729.  
  1730. (2) There are tests that detect flaws in resource quota mechanisms:
  1731.  
  1732. Included in these flaws are those that occur due to insufficient checking in hardware/firmware 
  1733. instructions that allocate/deallocate objects in system memory. Examples of such flaws include 
  1734. those that allow user-visible instructions to allocate/deal locate objects in TCB space. Although no 
  1735. unauthorized access to TCB information takes place, TCB space may be exhausted rapidly. 
  1736. Therefore, instructions which allow users to circumvent or modify resource quotas (if any) placed 
  1737. by the operating system must be discovered by careful testing.
  1738.  
  1739. (3) There are tests that detect flaws in the control of object deallocation:
  1740.  
  1741. Included in these flaws are those that enable a user to execute instructions that deallocate 
  1742. objects in different user or TCB domains in an authorized way.
  1743.  
  1744. Although such flaws may not cause unauthorized discovery/modification of information, they 
  1745. may result in denial of user communication.
  1746.  
  1747. 3.6.6 Relationship Between Hardware/Firmware SecurIty Testing and the TCSEC 
  1748. Requirements
  1749.  
  1750. In this section we review test condition and coverage analysis approaches for hardware/firmware 
  1751. testing. The security testing requirements for hardware/firmware are partitioned into three groups: 
  1752. (1) requirements for classes C1 and C2, (2) requirements for classes B1 to B3, and (3) requirements 
  1753. for class A1. For hardware/firmware security testing, the TCSEC does not allow the derivation of 
  1754. specific test-condition and coverage-analysis requirements for individual classes below class A1. 
  1755. The dearth of explicit general hardware/firmware requirements in the TCSEC rules out class-specific 
  1756. interpretation of hardware/firmware security testing requirements below class A1.
  1757.  
  1758. Security Classes C1 and C2
  1759.  
  1760. Test Conditions
  1761.  
  1762. For security classes C1 and C2, test conditions are generated from manual page descriptions of 
  1763. each processor instruction, and from the description of the protection mechanisms found in the 
  1764. processor's reference manuals. The test conditions generated for these classes include those which 
  1765. help establish the noncircumventability and the isolation (i.e., tamperproofness) of the TCB. These 
  1766. test conditions refer to the following processor-supported protection mechanisms:
  1767.  
  1768. (1) Access authorization mechanisms for memory-bound checking, stack-bound checking, and 
  1769. access-privilege checking during direct or indirect addressing; and checking the user's inability to 
  1770. execute processor-privileged instructions and access processor-privileged registers from 
  1771. unprivileged states of the processor.
  1772.  
  1773. (2) Mechanisms for authorized transfer of control to the TCB domain, including those checking 
  1774. the user's inability to transfer control to arbitrary entry points, and those checking the correct change 
  1775. of local address spaces (e.g., stack frames), etc.
  1776.  
  1777. (3) Mechanisms and instructions for parameter validation (if any).
  1778.  
  1779. Other test condition areas, which should be considered for testing the processor support of TCB 
  1780. noncircumventability and isolation, may be relevant for specific processors.
  1781.  
  1782. Test Coverage
  1783.  
  1784. The security testing guidelines of the TCSEC require that at least five specific tests be conducted 
  1785. for class C systems in an attempt to circumvent the security mechanisms of the system. This suggests 
  1786. that at least five test conditions should be included for each of the three test areas defined above. 
  1787. Each test condition should be covered by boundary-value coverage to test all positive and negative 
  1788. outcomes of each condition.
  1789.  
  1790. Security Classes B1 to B3
  1791.  
  1792. Test Conditions
  1793.  
  1794. For security classes B1 to B3, the test conditions for hardware/firmware security testing are 
  1795. generated using the same processor documentation as that for classes C1 and C2. Additional class-
  1796. specific documentation is not required (e.g., DTLS is not required to include hardware/firmware 
  1797. TCB components that are visible at the TCB interface-unlike class A1).
  1798.  
  1799. The test conditions generated for classes B1 to B3 include all those that are generated for classes 
  1800. C1 and C2. In addition, new test conditions should be generated for the following:
  1801.  
  1802. (1) Processor instructions that can affect security policy (e.g., instructions that can allocate/
  1803. deallocate memory-if any), and instructions that allow users to transfer privileges between 
  1804. different protection domains, etc.
  1805.  
  1806. (2) Generic security-relevant mechanisms (e.g., mechanisms for reporting protection violations 
  1807. correctly) and mechanisms that do not invalidate address-translation buffers correctly during process 
  1808. switches, etc.
  1809.  
  1810. (3) Mechanisms that control the deallocation of various processor-supported objects, and those 
  1811. that control the setting of resource quotas (if any), etc.
  1812.  
  1813. The only test conditions that are specific to the B1 to B3 security classes are those for hardware/
  1814. firmware mechanisms, the malfunctions of which may allow a user to place the TCB in a state in 
  1815. which it is unable to respond to communication initiated by users.
  1816.  
  1817. Test Coverage
  1818.  
  1819. The security testing guidelines of the TCSEC require that at least fifteen specific tests should be 
  1820. conducted for class B systems in an attempt to circumvent the security mechanisms of the system. 
  1821. This suggests that at least fifteen test conditions should be included for each of the three test areas 
  1822. defined above (and for the three areas included in classes C1 through C2). Each test condition should 
  1823. be covered by boundary-value coverage to test all the positive and negative outcomes of each 
  1824. condition.
  1825.  
  1826. Security Class A1
  1827.  
  1828. The only difference between the hardware/firmware test requirements of classes B1 to B3 and 
  1829. those of class A1 are (1) the processor test conditions derived for classes B1 to B3 (which should 
  1830. also be included here) are augmented by the test conditions derived from DTLS and FTLS, and (2) 
  1831. the test coverage should include at least twenty-five test conditions for each test area (included in 
  1832. classes B1 to B3).
  1833.  
  1834. 3.7 TEST PLAN EXAMPLES
  1835.  
  1836. In this section we present five test plan examples that have been used in security testing. An 
  1837. additional example is provided to illustrate the notion of cyclic test dependencies and suggest means 
  1838. for their removal. The first example contains a subset of the test plans for the access kernel primitive 
  1839. in Secure XenixTM. Here we explain the format of test conditions and of test data necessary for test 
  1840. conditions and focus on the notion of data flow analysis that might be presented in the coverage 
  1841. section of test plans.
  1842.  
  1843. The second example contains a subset of the test plans for the open kernel primitive of Secure 
  1844. XenixTM. Here we explain the use of the access-check generated or TCB kernels to eliminate 
  1845. redundant tests without loss of coverage. In particular, we discuss the impact on test coverage of 
  1846. the dependency of the open kernel primitive on the access kernel primitive. For example, during 
  1847. the testing of the access primitive, the subpath starting at the "obj__access" check that includes 
  1848. the "mand__access" and "discr__access" functions is tested (Figure 2, page 24). Then the open 
  1849. primitive, which shares that subpath of the graph with the access primitive, need only be tested (1) 
  1850. for the access check that is not shared with the access primitive, and (2) to demonstrate that the 
  1851. data flow of open joins that of access. This can be done with only a few test conditions, thereby 
  1852. reducing the test obligation without loss of coverage.
  1853.  
  1854. The third example of this section explains a security test plan for the read kernel primitive of 
  1855. Secure XenixTM systems. The specifications of the read primitive are access-check dependent on 
  1856. those of open. This means that a nonempty subset of the access checks necessary for read is done 
  1857. in open and, therefore, need not be tested again for read. To obtain the same coverage for read as 
  1858. that for open, or for access, one only needs to test (1) the existence of the access-check dependency 
  1859. of read on open, and (2) the remaining access checks specific to read (not performed in open). 
  1860. Since the testing of the access-check dependency requires only a few test conditions, the number 
  1861. of test conditions for read is reduced significantly without loss of coverage. The subset of the test 
  1862. plans required for read that are illustrated here is a subset of the test plans required for dependency 
  1863. verification. in contrast with the first two examples, which contain only mandatory access control 
  1864. (MAC) test conditions, this example includes some DAC test conditions.
  1865.  
  1866. The fourth example presents a subset of the test plans for the kernel and TCB isolation properties 
  1867. of Secure XenixTM. These test plans are derived from a set of kernel isolation and 
  1868. noncircumventability requirements for Secure XenixTM and are important for at least three reasons. 
  1869. First, no formal model exists for these requirements for any system to date. This is true despite the 
  1870. fundamental and obvious importance of isolation and noncircumventability requirements in 
  1871. demonstrating the soundness of the reference monitor implementation in a secure system (at any 
  1872. and all security classes above B2). Second, test plans for these requirements cannot be generated 
  1873. from DTLS or FTLS of a secure system at any level (i.e., B2 to A1). This is because these 
  1874. requirements are not necessarily specified in top-level specifications. This is true because isolation 
  1875. and noncircumventability properties include low-level dependencies on processor architecture 
  1876. details that do not correspond to the level of abstraction of TCB top-level specifications. Isolation 
  1877. and noncircumventability properties also cannot be verified formally using the current 
  1878. methodologies assumed by the tools sanctioned by the NCSC at this time (see the Appendix for the 
  1879. justification of unmapped kernel isolation code in the SCOMP specification-to-code correspondence 
  1880. example). Third, the kernel isolation and noncircumventability properties of a system depend to a 
  1881. large degree on the underlying processor architecture and on the support the architecture provides 
  1882. for kernel implementation. These test plan examples would therefore necessarily assume a given 
  1883. processor architecture. (An example of test or verification conditions for such processor mechanisms 
  1884. is provided by Millen in reference. [19])
  1885.  
  1886. In spite of the inherent architectural dependency of kernel isolation properties, we have selected 
  1887. a few examples of test plans that assume a very simple architecture and therefore can be generalized 
  1888. to other secure systems. The processor architecture, which is assumed by most implementations of 
  1889. the machine-dependent code of UnixTM systems, includes only the following: (1) a two-state 
  1890. processor (i.e., distinguished privileged mode versus unprivileged mode), (2) the ability to separate 
  1891. kernel address space (e.g., registers and memory) from user space within the same process, which 
  1892. could ensure that the kernel space cannot be read or written from user-space code, and (3) the ability 
  1893. to restrict transfers of control to specific entry points into the kernel. Other facilities are not assumed, 
  1894. such as special instructions that help the kernel and TCB primitive validate parameters and special 
  1895. gate mechanisms that help distinguish between privileged and nonprivileged kernel invocations.
  1896.  
  1897. Of necessity, the test plan examples for the above-mentioned kernel primitives and isolation 
  1898. examples are incomplete because it would be impractical to include complete test plans for these 
  1899. kernel primitives here.
  1900.  
  1901. The fifth example presents two test plans used for the processors of the Honeywell SCOMP 
  1902. system [22 and 23]. The first plan includes three test conditions for the ring crossing mechanism 
  1903. of the SCOMP processor and their associated test data and coverage analysis. The second plan 
  1904. presents a test condition for which test programs cannot be generated in the normal mode of 
  1905. processor operation, illustrating the need for design analysis.
  1906.  
  1907. The last example of this section illustrates the notion of cyclic test dependencies that appear 
  1908. among test programs. It also shows how the use of the access-graph and access-check dependencies 
  1909. in defining test plans (especially coverage analysis) helps eliminate cyclic test dependencies.
  1910.  
  1911. 3.7.1 Example of a Test Plan for "Access"
  1912.  
  1913. The access kernel primitive of Secure XenixTM has two arguments, path and amode. The first 
  1914. argument represents the name of an object whose access privileges are checked by the primitive, 
  1915. whereas the second argument represents the privileges to be checked. The following types of objects 
  1916. can be referenced by the path names provided to access:
  1917.  
  1918. Files, Directories, Devices, Named Pipes, Xenix Semaphores, Xenix Shared Data Segments.
  1919.  
  1920. The following types of privileges and combinations thereof are checked by access:
  1921.  
  1922. Read, Write, Execute (and object's existence).
  1923.  
  1924. 3.7.1.1 Test Conditions for Mandatory Access Control of "Access"
  1925.  
  1926. The following test conditions are derived from the interpretation of the mandatory access control 
  1927. model [12].
  1928.  
  1929. (1) Whenever the type of object named by path is one of the set {File, Directory, Device}, then 
  1930. the access call succeeds when executed by a process that wants to check the existence of amode = 
  1931. Read, Execute privileges, or the existence of the object, if process clearance dominates the object 
  1932. classification; otherwise, the access call fails.
  1933.  
  1934. (2) Whenever the type of object named by path is one of the set {Named Pipe, Xenix 
  1935. Semaphore, Xenix Shared Data Segment}, then the access call succeeds when executed by a process 
  1936. that wants to check the existence of amode = Read privilege, or the existence of the object, if process 
  1937. clearance equals the object classification; otherwise, the access call fails.
  1938.  
  1939. (3) Whenever the type of object named by path is one of the set {File, Directory, Device, 
  1940. Named Pipe, Xenix Semaphore, Xenix Shared Data Segment}, then the access call succeeds when 
  1941. executed by a process that wants to check the existence of amode = Write privilege, or the existence 
  1942. of the object, if process clearance equals the object classification; otherwise, the access call fails.
  1943.  
  1944. 3.7.1.2 Test Data for MAC Tests
  1945.  
  1946. Environment Initialization
  1947.  
  1948. A subset of all clearances and category sets supported in the system is defined in such a way as 
  1949. to allow all relationships between security levels to be tested (e.g., level dominance, incompatibility, 
  1950. equality). For example, the chosen levels are UNCLASSIFIED/Null/, UNCLASSIFIED/B/, 
  1951. CONFIDENTIAL/A, B/, SECRET/Null/, SECRET/All/, TOP SECRET/A/, and TOP SECRET/A, 
  1952. B/. The security profile of the test operator is defined to allow the test operator to login at all of the 
  1953. above levels.
  1954.  
  1955. A subset of all directory hierarchies supported in the system is defined in such a way as to allow 
  1956. all relationships between objects of the hierarchy to be tested (e.g., child and parent directories-
  1957. see the discussion in Section 3.5.2.2). Three directories, denoted as directory 1, 3, and 6, are created 
  1958. from the "home" directory at levels UNCLASSIFIED/A, B/, SECRET/A/, and TOP SECRET/A, 
  1959. B/. Two directories, denoted as directory 4 and 5, are created from the SECRET/A/ directory 3 at 
  1960. levels SECRET /All/ and TOP SECRET /A/. An additional CONFIDENTIAL /A, B/ directory, 
  1961. denoted as directory 2, is created from the UNCLASSIFIED/A, B/ directory.
  1962.  
  1963. The test operator logs in at each of the above security levels and creates a file in each directory. 
  1964. The discretionary access privileges are set on every file and directory to allow all discretionary 
  1965. checks performed by the TCB to succeed. The directory hierarchy is thus created, and the definitions 
  1966. of the security levels for each file and directory is shown in Figure 4.
  1967.  
  1968. Test Documents
  1969.  
  1970. The test operator logs in at each of the above security levels and invokes the access call with the 
  1971. following parameters:
  1972.  
  1973. path: Every file pathname defined in the hierarchy.
  1974.  
  1975. amode: All access privileges individually and in combination. 
  1976.  
  1977. Outcomes
  1978.  
  1979. Tables 1 and 2 show the expected outcomes of access indicating the correct implementation of 
  1980. mandatory access checks. Note that in Tables 1 and 2 "Fail l" errors should provide no information 
  1981. about the nature of the failure. This is the case because these failures are returned whenever the 
  1982. invoker of access is at a lower level than that of the object being accessed. In particular, "Fail 1" 
  1983. should not indicate the existence or nonexistence of files at levels that are higher than, or 
  1984. incompatible with, the login level. Discovery of an object's existence or nonexistence at a higher 
  1985. level than that of the accessor's would provide a covert storage channel. In contrast, "Fail 2" errors 
  1986. allow the invoker of access to discover the existence of the file, because his security level dominates 
  1987. that of the file. No covert channel provided by the object's existence is possible in this case.
  1988.  
  1989. 3.7.1.3 Coverage Analysis
  1990.  
  1991. Model-Dependent MAC Coverage
  1992.  
  1993. The test conditions provided above cover all MAC checks for the access primitive. The test data 
  1994. of this plan, however, cover the test conditions only partially. For example, condition (2) is not 
  1995. covered at all because the object types included in the test data are only files. Conditions (1) and 
  1996. (3) are only partially covered for the same reason. Environment reinitialization is necessary to allow 
  1997. the testing of access with all other types of objects.
  1998.  
  1999.  
  2000.  
  2001. The above test data also provide partial coverage because they do not include the hierarchies 
  2002. shown in Figures 3a and 3b, page 35. Re-execution of the above tests with the hierarchies shown 
  2003. in Figures 3a and 3b would guarantee sufficient coverage of the MAC model hierarchy. The test 
  2004. parameters and outcomes will generally differ if the additional tests suggested here are carried out.
  2005.  
  2006. Call-Specific MAC Coverage
  2007.  
  2008. Let us consider the coverage of individual arc paths and of combinations of arc paths as required 
  2009. by data flow coverage of the access primitive. The question as to whether the graph of the access 
  2010. primitive shown in Figure 2, page 24, is covered adequately or redundantly by the above test 
  2011. conditions and data arises naturally. The following three cases of coverage illustrate primitive-
  2012. specific coverage analysis for test condition (1) and test data of Figure 4, page 55, and Table 1, page 
  2013. 57.
  2014.  
  2015. Case 1.  A Single Arc Path
  2016.  
  2017. The test operator logs in at level UNCLASSIFIED/A, l3/ and invokes access with read as a 
  2018. parameter on the file/home/directoryl/directory2/file2 at level CONFIDENTIAL/A, B/. As shown 
  2019. in Figure 4 and Table 1, access is at the level of the invoking program (i.e., UNCLASSIFIED/A, 
  2020. B/) and, therefore, the call to it will fail.
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026. This test provides a single arc path coverage, namely that of arc path access - > "namei" - > 
  2027. "obj__access" - > "mand__access," shown in Figure 2. Here "mand__access" returns "failure" 
  2028. when it tries to resolve the file path name. Note that the file path name component "file2" cannot 
  2029. be read from directory "directory\2" because the mandatory check fails. Note that mandatory checks 
  2030. on the level of the file itself are also not performed here. The mandatory check failure is caused 
  2031. earlier by path name resolution and returned to "namei."
  2032.  
  2033. Case 2. A Combination of Arc Paths
  2034.  
  2035. The test program logs in at level TOP SECRET/A/ and invokes access with Read as a parameter 
  2036. on the file /home/directory3/file3 at level SECRET/A/. Access is at the level TOP SECRET/A/ 
  2037. (Figure 4 and Table 1), therefore, the call to it will succeed.
  2038.  
  2039. This test provides multiple arc path coverage. The first arc path is the same as in Case 1 above. 
  2040. The "mand__access" check passes, however, and control is returned all the way up to access; see 
  2041. Figure 2. The second arc path is "access" - > "obj__access" - > "mand access." The mandatory 
  2042. check in "mand__access" is performed directly on the file and not on its parent directory as in Case 
  2043. 1. This check succeeds. The success result returns to "obj__access" which initiates a third arc path 
  2044. traversal to "discr__access." The discretionary check passes (as set up in the environment definition) 
  2045. and success is returned to "obj__access" and access. 
  2046.  
  2047. Case 3. A Different Combination of Arc Paths
  2048.  
  2049. The test program logs in at level SECRET/A/ and invokes access with Read as a parameter on 
  2050. the directory /home/directory3/directory5 at level TOP SECRET/A/. As shown in Figure 4 and 
  2051. Table 1, access is at the level SECRET/A/. The call to it will fail.
  2052.  
  2053. Although this test appears to provide the same coverage as that of Case 1, in fact it does not. The 
  2054. first arc path is the same as that in Case 1 above, except that the "mand__access" check on the path 
  2055. name of the target object (which terminates with name "directory5" in directory/home/directory3) 
  2056. succeeds and control is returned all the way up to access (see Figure 2, page 24). The second arc 
  2057. path is then "access" -> "obj__access" -> "mand__access." The check in cmand__access" is 
  2058. performed directly on the directory /home/directory3/directory5 and, unlike the check in Case 2, it 
  2059. fails. This "failure" is returned to "obj__access" which reports it to access. Coverage analysis based 
  2060. on a specific model interpretation in a given TCB primitive would require that the Case 1 test be 
  2061. repeated with a directory replacing the file "file2." However, this new Case 1 test would become 
  2062. indistinguishable from that of Case 3 in coverage analysis based on abstract models, and thus Case 
  2063. 3 would not necessarily be tested.
  2064.  
  2065. 3.7.2 Example of a Test Plan for "Open"
  2066.  
  2067. The kernel primitive open has as arguments a path, oflag, and mode. The only relevant object 
  2068. types named by path for open are the following:
  2069.  
  2070. Files, Directories, Devices, and Named Pipes.
  2071.  
  2072. The oflag parameter denotes different access privileges and combinations thereof. It also contains 
  2073. other flags such as "o__excl," "o__creat," and "o__trunc" that specify object locking, default 
  2074. creation, or truncation conditions. The mode argument of the open primitive is relevant only when 
  2075. the object does not exist and the "o__creat" flag is used.
  2076.  
  2077. 3.7.2.1 Test Conditions for "Open"
  2078.  
  2079. Test Condition for Access-Graph Dependency
  2080.  
  2081. Verify that the open kernel primitive shares the access primitive subgraph that includes the 
  2082. object__access checks.
  2083.  
  2084. Examples of Test Conditions Specific to "Open"
  2085.  
  2086. (1) Verify that if the object specified by the path argument does not exist, the object is created with 
  2087. the access privileges specified by the mode argument whenever the "o__creat" flag is on, with the 
  2088. owner's user ID and the specified group ID, and with the invoker process' security level.
  2089.  
  2090. (2) Verify that if the object specified by the path argument exists, the open kernel primitive succeeds 
  2091. whenever the requested privilege specified by the "o__flags" is granted to the person with access. 
  2092. Verify that, in this case, the mode argument also has no effect on the existing privileges of the object.
  2093.  
  2094. (3) Verify that the open kernel primitive always fails when it is invoked:
  2095.  
  2096. ╖       With the "write" access privilege for a Directory.
  2097.  
  2098. ╖       On a nonexisting device.
  2099.  
  2100. ╖       On Xenix Semaphores and Xenix Shared Data Segments.
  2101.  
  2102. 3.7.2.2 Test Data for the Access-Graph Dependency Condition
  2103.  
  2104. Environment Initialization Parameters
  2105.  
  2106. A subset of all clearances and category sets defined in the tests of access is chosen in such a way 
  2107. as to allow all relationships between security levels to be tested (e.g., level dominance, 
  2108. incompatibility, equality). The chosen levels are UNCLASSIFIED/Null/, SECRET/All/, and TOP 
  2109. SECRET/A/. The subset of the directory hierarchy defined in the tests of access that contains the 
  2110. objects at the above chosen levels is selected for this test. The definition of the security levels and 
  2111. discretionary access privileges and the creation and initialization of the object hierarchy are 
  2112. performed in a similar way to that used in the test of access. The security profile of the test operator 
  2113. is defined to allow him to login at all of the above levels.
  2114.  
  2115. The test operator logs in at each of the chosen security levels and invokes the open primitive with 
  2116. the following parameters:
  2117.  
  2118. path: path names of the three files defined in the hierarchy.
  2119.  
  2120. o__flags: o__read, o__write, individually, and in the following combinations:
  2121.  
  2122. o__read| o|__excl, o__read|o__trunc, o__read|o__excl|o__trunc,
  2123.  
  2124. o__write| o__excl, o__write|o__trunc, o__write|o__excl|o__trunc,
  2125.  
  2126. For example, the test operator will use the following login, security level, files, and "o__flag" 
  2127. parameters:
  2128.  
  2129. Case 1
  2130.  
  2131. The test program logs in at level SECRET/All/ and invokes open on file /home/directory3/
  2132. directory5/file5 at level TOP SECRET/A/ with o__read__only as the call option. Open is at the 
  2133. level of the invoking program as shown in Table 3, therefore, the call fails.
  2134.  
  2135.  
  2136.  
  2137. Case 2
  2138.  
  2139. The test program logs in at level SECRET/All/ and invokes open on file /home/file0 at level 
  2140. UNCLASSIFIED/Null/ with o__read__only as the call option. Open is at the level of the test 
  2141. program as shown in Table 3, therefore, the call succeeds.
  2142.  
  2143. (Note that the above failure and success of the open invocations occur for the same reasons as 
  2144. those explained in Cases 1 and 2 of the Coverage Analysis area of the access test plan in Section 
  2145. 3.2.4.1.)
  2146.  
  2147. Case 3
  2148.  
  2149. The test program logs in at level SECRET/All/ and invokes open on file /home/directory3/
  2150. directory4/file4 at level SECRET/All/ with "o__read__only" as the call option. Open is at the level 
  2151. of the test program as shown in Table 4, therefore, the call succeeds.
  2152.  
  2153. Tables 3 and 4 show the expected outcome of open indicating the consistency of these outcomes 
  2154. with those of access. Note that, as in the outcomes of access, "Fail 1,' errors in Tables 3 and 4 
  2155. provide no information about the nature of the failure, which otherwise might indicate the existence 
  2156. or nonexistence of files at levels that are higher than, or incompatible with, the login level. In contrast, 
  2157. "Fail 2" errors allow the invoker of open to discover the existence of the file, because the user 
  2158. security level dominates that of the file.
  2159.  
  2160.  
  2161.  
  2162. 3.7.2.3 Coverage Analysis
  2163.  
  2164. Model-Dependent MAC Coverage
  2165.  
  2166. The testing of the access graph dependency of open on access provides the same model-dependent 
  2167. MAC coverage for open as that provided for access. That is, after access is fully tested using data 
  2168. flow coverage, the same coverage is obtained for open. Access-graph dependency testing confirms 
  2169. that the access subgraph shared by the two primitives, which includes the "obj__access" function, 
  2170. enforces the MAC policy. Since all object types relevant to open are included among those of access, 
  2171. and since all access modes of open are included among those of access (the "exclusive" and 
  2172. "truncation" modes introducing no additional modes independent of read and write), the only 
  2173. additional model dependent MAC tests necessary for open are those which confirm the access-
  2174. graph dependency of open on access for the remaining types of objects (i.e., Directories, Devices, 
  2175. and Named Pipes).
  2176.  
  2177. Call-Specific MAC Coverage
  2178.  
  2179. Additional primitive-specific test data are necessary to demonstrate that MAC policy is 
  2180. discovered by the test plans. Test data, for example, must be provided for test conditions (2) and 
  2181. (3) above.
  2182.  
  2183. 3.7.3 Examples of a Test Plan for "Read"
  2184.  
  2185. The kernel primitive read used the file descriptor fildes to identify the target object of the read 
  2186. action. The file descriptor is obtained from the kernel primitives open, creat, dup, fcntl, and pipe. 
  2187. Since the primitives dup and pipe are not access-control-relevant, and since fcntl is tested 
  2188. elsewhere, the only primitives and object types relevant to read are the following:
  2189.  
  2190. open, creat Files, Directories, Devices, and Named Pipes.
  2191.  
  2192. The read primitive uses fildes as one of its parameters, which is obtained from either open or 
  2193. creat. Thus, read can be called only after either of these two calls have been performed successfully. 
  2194. This establishes the access-check dependency condition-the only test condition that will be included 
  2195. in the test plan.
  2196.  
  2197. 3.7.3.1 Test Conditions for "Read"
  2198.  
  2199. For each object type in the set {Files, Directories, Devices, Named Pipes}, verify the following:
  2200.  
  2201. (1) That read fails, if neither open nor creat call has been performed before the read call.
  2202.  
  2203. (2) That read fails, if neither open nor creat call returned "success" before the read call.
  2204.  
  2205. (3) That read succeeds whenever an open call including the read privilege has been 
  2206. successfully performed (creat has no read option).
  2207.  
  2208. 3.7.3.2 Test Data for the Access-Check Dependency Condition
  2209.  
  2210. Environment lnitialization for Condition (1)
  2211.  
  2212. The test operator logs in as uid1.gid1 at a given security level, such as UNCLASSlFlED/Null/, 
  2213. and attempts to read a file without calling open or creat first. An account for the test operator must 
  2214. exist. Note that the initialization of the discretionary privileges is irrelevant only for the first 
  2215. condition. Figure 5a illustrates the initialized environment.
  2216.  
  2217.  
  2218.  
  2219. Test Parameters for Condition (1)
  2220.  
  2221. After environment initialization, or program calls read with the parameters, illdes = 3, . . .  20. 
  2222. Note that descriptors 0, 1, 2 are already opened for the standard input, output, and error files and 
  2223. therefore cannot be used here. Note that fildes 20 is also an invalid file descriptor but is included 
  2224. here to test that the read call fails when the file descriptor is out of range (i.e., a read specific test).
  2225.  
  2226.  
  2227.  
  2228. Outcomes for Condition (1) Tests
  2229.  
  2230. Table 5a shows the expected outcomes of the condition (1) test. "S"/ "F" denotes a success/failure 
  2231. result.
  2232.  
  2233. Environment lnitialization for Condition (2)
  2234.  
  2235. A file (denoted as file2) is created in the test operator's "home" directory with "read-only" 
  2236. discretionary access privilege initialized for the test operator. Testing consists of a logon as uid1.gid1 
  2237. at security level UNCLASSIFIED/NULL/ followed by two attempts to call open and creat in such 
  2238. a way that these calls fail. These calls will be followed by two attempts to call read with the fildes 
  2239. presumed to be returned by the calls to open and creat. Figure 5b summarizes the initialization 
  2240. needed for the required test.
  2241.  
  2242. Parameters for Condition (2) Tests
  2243.  
  2244. After environment initialization, the test operator or program performs the following actions 
  2245. using the underlined parameters:
  2246.  
  2247.  
  2248.  
  2249. ╖       Open a nonexisting file (file1) using the open call with "o__read__only" flag (open fails 
  2250. because file1 does not exist). Then call read with the fildes returned by the open call.
  2251.  
  2252. ╖       Create a file (denoted as file2) with any arbitrary mode using the creat call (creat fails 
  2253. because file2 already exists and it has "read-only" privileges for the test operator). Then 
  2254. the test operator or program calls read with the fildes returned by the creat call.
  2255.  
  2256. Outcomes for Condition (2) Tests
  2257.  
  2258. Testing demonstrates that read will fail in both cases because both open and creat returned 
  2259. "failure" earlier. Table 5b shows the expected outcomes.
  2260.  
  2261.  
  2262.  
  2263. Environment lnitialization for Condition (3)
  2264.  
  2265. Two files (denoted as file1 and file2) are created in the user's "home" directory with "read-only" 
  2266. and "write-only" discretionary access privileges respectively, defined for the test operator. The file 
  2267. security levels are defined in such a way that all mandatory access checks succeed on both files. 
  2268. Testing requires a logon as uid1.gid1 at the security level UNCLASSIFlED/NULL/ followed by 
  2269. two calls to open and one to creat. Figure 5c describes the data needed for the required tests.
  2270.  
  2271. Test Parameters for Condition (3) Test
  2272.  
  2273. After environment initialization, the test operator or program performs the following actions with 
  2274. the following parameters:
  2275.  
  2276. ╖       Open file 1 using the open call with "o__ read__only" flag (open succeeds and returns 
  2277. a valid fildes), then call read with the fildes returned by the open call.
  2278.  
  2279. ╖       Open file2 using the open call with "o__read__only" flag (open succeeds and returns 
  2280. a valid fildes), then call read with the fildes returned by the open call.
  2281.  
  2282. ╖       Create a file (denoted as file3) in the test operator's "home" directory with all the 
  2283. discretionary access modes permitted using the creat call (creat succeeds and returns 
  2284. a valid fildes), then call read with the fildes returned by the creat call.
  2285.  
  2286.  
  2287.  
  2288. Outcomes for Condition (3) Tests
  2289.  
  2290. Testing demonstrates that read succeeds when the file descriptors from creat and open include 
  2291. the read privilege; otherwise, read fails. Since open succeeds before calling the read kernel 
  2292. primitive, read also succeeds only when an open call was performed with the read option flag; 
  2293. otherwise, read fails. Although creat succeeds, read still fails because creat always opens an object 
  2294. for write only, and thus read actions are not permitted. Table 5c shows the expected outcomes.
  2295.  
  2296.  
  2297.  
  2298. 3.7.3.3 Coverage Analysis
  2299.  
  2300. Model-Dependent Coverage
  2301.  
  2302. The testing of the access-check dependency of read on open and creat provides the same model-
  2303. dependent coverage for read as that provided for open and creat. (Only a subset of this coverage 
  2304. is explained in Section 3.7.2.3.) The testing of the access-check dependency confirms that the read 
  2305. primitive cannot succeed unless the access checks that it requires have already been done in open 
  2306. and creat. Since all object types relevant to read are included among those of open, and since the 
  2307. read access privilege is covered in open, the only additional model-dependent tests necessary for 
  2308. read are those performed by hardware (e.g., read authorization checks) and those that confirm the 
  2309. access-check dependency of read on open and creat for the remaining types of objects (i.e., 
  2310. Directories, Devices, Named Pipes).
  2311.  
  2312. Call-Specific Coverage
  2313.  
  2314. Additional primitive-specific tests may be necessary for read depending upon its implementation. 
  2315. For example, if the object-limit check performed by read is in any way different from those of other 
  2316. primitives, it would need to be tested separately. Other conditions referring to object locking may 
  2317. also be included in these primitive-specific tests.
  2318.  
  2319. 3.7.4 Examples of Kernel Isolation Test Plans
  2320.  
  2321. The test conditions presented in the following example refer to the transfer of control from a 
  2322. user-level program to the kernel of Secure XenixTM. Such transfers should take place only to entry 
  2323. points determined by the system design.
  2324.  
  2325. The kernel code and data segments of Secure XenixTM are placed in ring (i.e., privilege level 0) 
  2326. whereas user-level code and data segments are placed in ring 3. User-level programs, therefore, 
  2327. cannot access kernel programs and data directly without transferring control to kernel programs 
  2328. first (this property is assured by the processor security testing). The transfer of control from user-
  2329. level programs to the kernel can only take place in the following three ways:
  2330.  
  2331. ╖       Through calls to a gate in the Global Descriptor Table (GDT), which is located in kernel 
  2332. address space, via segment selector number 144.
  2333.  
  2334. ╖       Through software interrupts controlled by gate as in the Interrupt Descriptor Table (IDT) 
  2335. located in kernel address space.
  2336.  
  2337. ╖       Through traps, which occur as the result of exceptional conditions and which either 
  2338. cause the kernel to terminate the user process execution immediately or cause the kernel 
  2339. to receive signals which eventually terminate the user process execution.
  2340.  
  2341. The test plans shown below illustrate that the above cases of transfer of control are the only ways 
  2342. to transfer control to the kernel.
  2343.  
  2344. 3.7.4.1 Test Conditions
  2345.  
  2346. (1) Call Gate. This tests that application programs cannot successfully access any GDT descriptor 
  2347. except that provided by the segment selector number 144.
  2348.  
  2349. (2) Software interrupts. These test that whenever an application program uses the interrupt-
  2350. generating instructions "INT n" and "INTO," with n = / = 3,FO-FB, a general protection trap will 
  2351. occur. For n = 3, the calling process will receive a SIGTRAP signal (a trap signal) and for N = FO-
  2352. FB, will cause the instructions following "INT n" to be interpreted as 80287 instructions. (Note: 
  2353. The 80287 is the arithmetic co-processor.)
  2354.  
  2355. (3) Traps. These verify that the occurrence of traps will only affect the trap-generating process. 
  2356. (Note: This condition cannot be tested by user-level test programs because the traps cause the 
  2357. termination of the process running the test program. This condition can therefore only be verified 
  2358. by review of the source code files containing machine dependent code, i.e., mdep/trap.c and mdep/
  2359. machdep.asm in Secure XenixTM.)
  2360.  
  2361. (4) Call validity. This tests that whenever a user-level program invokes the kernel with an invalid 
  2362. kernel number, the call will fail.
  2363.  
  2364. 3.7.4.2 Test Data
  2365.  
  2366. Environment Initialization for Conditions (1), (2) and (4)
  2367.  
  2368. Compile the test program using "cc -M2es -i" flags. These compilation flags refer to the small 
  2369. memory model for C programs, with far pointers allowed and with separate instructions and data 
  2370. segments. The code segment selector number for the program code will be Ox3F. The data segment 
  2371. selector number will be 0x47. For each test condition, the program forks a child process to perform 
  2372. each test as described below.
  2373.  
  2374. Test Parameters
  2375.  
  2376. The following sequences describe the steps of the test programs and the test parameters for each 
  2377. condition:
  2378.  
  2379. (1) Loop with an index value from 0x8 to 0x190 incrementing the index value by 8. Access a 
  2380. memory location whose segment selector number is provided by the index value.
  2381.  
  2382. (2) Loop with an index value from 0 to OxEF incrementing the index value by I. Execute 
  2383. instruction "INT n" in the loop, where the value of n is provided by the index value.
  2384.  
  2385. (3) No test condition or parameters are necessary (namely, the Note of test condition (3) above).
  2386.  
  2387. (4) Invoke the kernel gate with the following INVALID kernel call numbers:
  2388.  
  2389. ╖       0x41 (outside of "sysent," the main kernel call table).
  2390.  
  2391. ╖       0x2228 (outside of "cxenix," the XenixTM system call table).
  2392.  
  2393. ╖       0x1740 (outside of "csecurity," the security system call table).
  2394.  
  2395. Then invoke the kernel with VALID kernel call numbers representing a user-visible kernel call 
  2396. and a privileged kernel call.
  2397.  
  2398. Outcomes for the Test Conditions (1), (2), and (4) Above
  2399.  
  2400. (1) The process running the test program will receive a SIGSEGV signal (a segment violation signal) 
  2401. for each access call except when the gate selector number is 0x90.
  2402.  
  2403. (2) The following is true for the process running the test for the software interrupts:
  2404.  
  2405. ╖       Will receive a SIGSEGV signal for each index value except for n = 3.
  2406.  
  2407. ╖       Will receive a SIGTRAP signal when n = 3.
  2408.  
  2409. ╖       Will not receive any signal when n = 0xF0 - 0xFB, because these index values represent 
  2410. valid entries for the 80287 arithmetic co-processor.
  2411.  
  2412. (3) No outcomes, since no tests are performed.
  2413.  
  2414. (4) Error EINVAL (i.e., invalid entry) will be received for all INVALID kernel call numbers (i.e., 
  2415. numbers outside the entry ranges of the main kernel call table, the XenixTM system call table, and 
  2416. the security system call table). No error will be received for the kernel call using the valid kernel 
  2417. call number (i.e., for any number within the table entry range). An error will be received for the 
  2418. invocation of any privileged kernel call (primitive).
  2419.  
  2420. 3.7.4.3 Coverage Analysis
  2421.  
  2422. The coverage of the above test conditions is based on boundary-value analysis. The test data 
  2423. place each test program above (i.e., successful outcome) and below (i.e., unsuccessful outcome) 
  2424. each boundary condition. The test data and outcomes represent the following degrees of condition 
  2425. coverage:
  2426.  
  2427. (1) All kernel-call gate selection cases are covered.
  2428.  
  2429. (2) All software interrupt selection cases are covered.
  2430.  
  2431. (3) Not applicable (namely, the Note of condition (3) above).
  2432.  
  2433. (4) All the boundary conditions are covered. For complete coverage of each boundary 
  2434. condition, all privileged kernel calls should be invoked, and all relevant out-of-range call 
  2435. numbers should be tested. (Such tests are unnecessary because the range tests in kernel code 
  2436. use the table ranges as defined constants.)
  2437.  
  2438. 3.7.5 Examples of Reduction of Cyclic Test Dependencies
  2439.  
  2440. Consider the structure of typical test programs such as those for the open, read, write, close, 
  2441. and fcntl TCB primitive of UnixTM to illustrate cyclic test dependencies and their removal. The test 
  2442. program for each TCB primitive is denoted by tn where n is the first character of the function name.
  2443.  
  2444. The test program for open, to, opens an object, for instance a file, writes on it a predetermined 
  2445. string of characters and closes the file. Then, it opens the file again and reads the file contents to 
  2446. ensure that the correct file has been opened. Thus, to must invoke the TCB primitive write, close, 
  2447. read in addition to open. The same sequence of TCB primitives is used for tr and tw to confirm that 
  2448. the read and write TCB primitives use the correct file. Note that, even if a single file is created in 
  2449. the test environment, the file system contains other system files that may be inadvertently read by 
  2450. the kernel. Thus, the use of a predetermined string of characters is still necessary to identify the file 
  2451. being written or read.
  2452.  
  2453. The test program for close, tc, has a similar structure to that of to. After tc opens an object (for 
  2454. instance a file) and writes on it a predetermined string of characters, tc reads the string and closes 
  2455. the file. Then tc opens the file again and reads the string. Tc must read the predetermined string of 
  2456. characters both before closing the file and after reopening the file to ensure that the correct file was 
  2457. closed. Even though close is a security-model-irrelevant TCB primitive, it must still be tested here 
  2458. since the test programs to, tr,, and tw rely on it.
  2459.  
  2460. The TCB primitives open, read, and write are among the first to be tested because most other 
  2461. test programs depend on them. If no access-graph or access-check dependencies are used, to, tr , tw 
  2462. and to depend on each other as shown in Figure 6a. Note that the fcntl TCB primitive could have 
  2463. been used instead of read in tc. However, this would not have decreased the total number of cyclic 
  2464. test dependencies because the removed cyclic dependency between tc and tr would have to be 
  2465. replaced by the cyclic dependency between tc and tfctl.
  2466.  
  2467.  
  2468.  
  2469. The structure of the above test programs is not unique. Some of the cyclic test dependencies 
  2470. presented above, therefore, may not appear in other test programs. Other cyclic test dependencies 
  2471. similar to the ones shown above, however, will still appear. The reason for this is that kernel isolation 
  2472. and noncircumventability cause a test program for some TCB primitives to rely on other TCB 
  2473. primitives, and vice versa, whenever the TCB primitives are tested monolithically.
  2474.  
  2475. The use of the access-check graph for testing open eliminates the need to invoke the TCB 
  2476. primitives read, write, and close in to, and makes to dependent only on ta, the test program for 
  2477. access. For example, since the access-check graph shows that both open and access use the same 
  2478. function for the resolution file names [i.e., namei()], the read and write primitives are unnecessary 
  2479. for file identification because the file name resolution has already been tested by ta. Figure 6b shows 
  2480. the remaining cyclic dependencies between the test programs after all cyclic dependencies of to are 
  2481. removed.
  2482.  
  2483. The use of the access-check dependencies between TCB primitives also helps remove cyclic 
  2484. dependencies between test programs. For example, in tests for read and write, only the open TCB 
  2485. primitive needs to be used to test the existence of the dependency in addition to those necessary to 
  2486. set up the test environment (e.g., creat). Figure 6c shows the remaining dependencies between the 
  2487. test programs ta, tr , tw, to, and tfcntl. Note that since test programs to, tr , and tw do not use the TCB 
  2488. primitive close, and since close is security-model-irrelevant, the testing of close need not be 
  2489. performed at all. Note that the remaining test dependencies are generally not always identical to 
  2490. the ones shown in Figure 1, page 23. More dependencies than those shown in Figure 1 will remain 
  2491. after the new test method is applied.
  2492.  
  2493.  
  2494.  
  2495. The example of the remaining test dependencies shown in Figure 6c does not imply that the test 
  2496. program for access, ta, invokes only access. Ta must also invoke TCB primitives needed to set up 
  2497. the test environment; therefore, it depends on the test programs for creat (tcr), ACL__control, and 
  2498. on those of trusted processes login and mkdir. Also, tcr depends on the primitive access because 
  2499. primitive creat shares a subgraph with access, Figure 2, page 24; therefore, the test program for 
  2500. creat (tcr) depends on the test program for access. A cyclic test dependency therefore exists between 
  2501. ta and tcr (not shown in Figure 6c).
  2502.  
  2503. To eliminate all such cyclic test dependencies, a small routine with limited functionality, which 
  2504. is verified independently, could be added to the kernel to read out all the created test environments. 
  2505. The actions of the test programs that set up the test environments could then be verified 
  2506. independently. Judicious use of such a limited function read routine and of the new test method 
  2507. could lead to the elimination of all cyclic test dependencies. The addition of such a routine to the 
  2508. TCB, which could be done only in maintenance mode, would defeat our goal of test repeatability.
  2509.  
  2510.  
  2511.  
  2512. 3.7.6 Example of Test Plans for Hardware/Firmware Security Testing
  2513.  
  2514. In the SCOMP documentation of processor security testing, the test conditions are identified by 
  2515. the "verify" clauses. The test data are identified by the "verification" and the associated "test and 
  2516. verification" (T&V) software description. The coverage analysis is identified by the "conclusion" 
  2517. associated with each test and source of the "notes" of the T&V software description.
  2518.  
  2519. The complete understanding of the test plans presented below requires some knowledge of ring 
  2520. mechanisms. A good description of the SCOMP ring mechanism can be found in (24]. In the example 
  2521. presented below, the following abbreviations have been used:
  2522.  
  2523. ╖       Ring numbers are represented by the contents of registers Ro-R3 such that R0 < = R1 < 
  2524. = R2 , = R3, and 0 < Ri < = 3.
  2525.  
  2526. ╖       Reff = max(Rcurr, Rcaller) is the effective ring of the accessor, where Rcurr is the current 
  2527. ring of execution and Rcaller is the ring of the caller program.
  2528.  
  2529. ╖       The offset is the entry point into the segment f the called program. (offset = O)
  2530.  
  2531. ╖       Rfrom.,(Rto) is the ring from (to) which control is transferred with Rto = < Rfrom calls and 
  2532. Rto > = Rfrom. for returns.
  2533.  
  2534. ╖       The T register contains the segment number of the stack segment associated with the 
  2535. current ring.
  2536.  
  2537. 3.7.6.1 Test Conditions for the Ring Crossing Mechanism
  2538.  
  2539. (1) Test that the ring-call mechanism changes the ring numbers such that R to  < = Rfrom) transfers 
  2540. to entry point zero (offset = O) of the called-program segment and requires that the execute bit is 
  2541. turned on in the descriptor for the called-program segment.
  2542.  
  2543. (2) Test that the ring-return mechanism changes the ring numbers such that Rto > = Rfrom.
  2544.  
  2545. (3) Test that each ring is associated with a different per-ring stack segment after the ring call/return 
  2546. is made.
  2547.  
  2548. 3.7.6.2 Test Date
  2549.  
  2550. (1) Environment Initialization
  2551.  
  2552. The following sections of the T&V software descriptions T200 and T1100 contain the 
  2553. environment initialization used by the test programs which invoke the SCOMP call (LNJR) and 
  2554. return (RETN) instructions.
  2555.  
  2556. Test and Verification Software Description
  2557.  
  2558. T200 TCALL (Test CAll and Return Instructions):
  2559.  
  2560. A. Execute return and call instructions between two rings to test a single ring change.
  2561.  
  2562. B. Test multilevel ring change. Change rings from ring 0 to ring 3 (one ring at a time), return to 
  2563. ring 0 in reverse order.
  2564.  
  2565. C. Test transfer of T register data on ring changes.
  2566.  
  2567. ALGORITHM:      TEST NUMBER:
  2568.  
  2569. Put known values in T registers
  2570.  
  2571. Return to ring 3 (TCALL3)       200
  2572.  
  2573. Call to ring 0 (TCALL)  201
  2574.  
  2575. Return to ring 1 (TCALL1)       202
  2576.  
  2577. Return to ring 2 (TCALL2)       203
  2578.  
  2579. Return to ring 3 (TCALL3A)      204
  2580.  
  2581. Check T register        205
  2582.  
  2583. Call to ring 2 (TCALL2) 206
  2584.  
  2585. Check T register        207
  2586.  
  2587. Call to ring 1 (TCALL1) 208
  2588.  
  2589. Check T register        209
  2590.  
  2591. Call to ring 1 (TCALL)  20A
  2592.  
  2593. Check T register        20B
  2594.  
  2595. Notes:
  2596.  
  2597. 1. Halt on failures, identify the test failed.
  2598.  
  2599. 2. For call, set R <= Reff < = R3, offset = 0, and execute permission is "on."
  2600.  
  2601. 3. Negative tests are not required, these are tested under Trap Handling (namely, T1100 below).
  2602.  
  2603. 4. Identify controlling descriptors for each test.
  2604.  
  2605. 5. Inputs identify supporting code and data locations and controlling descriptors.
  2606.  
  2607. 6. Separate blocks are shown in the structure chart since the process is spread across three rings.
  2608.  
  2609. Outside Services Required: None.
  2610.  
  2611. Test and Verification Software Description
  2612.  
  2613. T1100 TRING (Test Ring Traps)
  2614.  
  2615. Execute call using descriptors with the following trap conditions:
  2616.  
  2617. A.      Reff > R3, segment offset  0 (use page offset 0), execute permission off.
  2618.  
  2619. B.      Execute return with Rto < Reff.
  2620.  
  2621. ALGORlTHM:      TEST NUMBER:
  2622.  
  2623. Change to ring 1
  2624.  
  2625. Call - Eoff     1100
  2626.  
  2627. Call - Offset NEO       1101
  2628.  
  2629. Call - Reff GT R3(0)    1102
  2630.  
  2631. Return - Reff GT Rto    1103
  2632.  
  2633. ALGORlTHM:      TEST NUMBER:
  2634.  
  2635. Change to ring 2
  2636.  
  2637. Call - Reff GT R3(0)    1104
  2638.  
  2639. Call - Reff GT R3(1)    1105
  2640.  
  2641. Return - R,eff GT Rto(0)        1106
  2642.  
  2643. Return - R,eff GT Rto, (1)      1107
  2644.  
  2645. Change to ring 3
  2646.  
  2647. Call - Reff GT R3(0)    1108
  2648.  
  2649. Call - Reff GT R3(1)    1109
  2650.  
  2651. Call - Reff GT R3(2)    110A
  2652.  
  2653. Return - Reff GT Tto (1)        110B
  2654.  
  2655. Return - Reff GT Tto,(I)        110C
  2656.  
  2657. Return - Reff GT Tto (2)        110D
  2658.  
  2659. Change to ring 0 via seg 4
  2660.  
  2661. Notes:
  2662.  
  2663. 1. Halt on failure; identify test failed.
  2664.  
  2665. 2. Identify controlling descriptors for each test.
  2666.  
  2667. 3. Provide trap handler that verifies 5PM hardware trap functions and recovers from the trap. 
  2668. Correct functioning should render the expected trap transparent.
  2669.  
  2670. 4. All of the tests are executed in ring 3.
  2671.  
  2672. Outside Services Required: S1 - Trap Handler (TH14)
  2673.  
  2674. (2) Test Parameters
  2675.  
  2676. The test programs require no input for these test conditions. The outputs of the test program 
  2677. represent the test outcomes defined below.
  2678.  
  2679. (3) Test Outcomes
  2680.  
  2681. Outcomes for Test Condition (1)
  2682.  
  2683. ╖       Success: R1 < = Reff <=R3 and offset =0 and E privilege = OFF; (namely, test numbers 
  2684. 201, 206, 208, and 20A).
  2685.  
  2686. ╖       Failure: R3> = Reff or offset  0, or E privilege = OFF; (namely, test numbers 1102, 
  2687. 1104-1105, 1108-1110A, or 1101, or 1100).
  2688.  
  2689. Outcomes for Test Condition (2)
  2690.  
  2691. ╖       Success: R1  Reff (namely, test numbers 200, 202, 203, and 204).
  2692.  
  2693. ╖       Failure: Rto < Reff (namely, test numbers 1103,1106,1107,110B-110D).
  2694.  
  2695. Outcomes for Test Condition (3)
  2696.  
  2697. ╖       Success: T registers contain the stack segment number placed in there in T200. This 
  2698. outcome is obtained for test numbers 205, 207, 209, and 20B.
  2699.  
  2700. ╖       Failure: This outcome is not expected.
  2701.  
  2702. 3.7.6.3 Coverage Analysis
  2703.  
  2704. The test conditions (1)-(3) above have been derived from descriptions of the SCOMP processor 
  2705. and of the Security Protection Module (SPM). The SCOMP FTLS of the user-visible hardware 
  2706. functions were either incomplete or unavailable at the time of processor security testing and, 
  2707. therefore, could not be fully used for the generation of test conditions [3]. Since a formal model of 
  2708. the protection mechanisms of the SCOMP processor was unavailable, the documentation of the 
  2709. SCOMP processor and SPM were the only available sources of test conditions.
  2710.  
  2711. The test coverage analysis for the conditions (1)-(3) above is based on boundary value coverage. 
  2712. Note that test condition (1) includes three related subconditions, namely (offset = 0) and (E privilege 
  2713. = ON). Furthermore, subcondition (Ro <=Reff<) requires at least three calls (i.e., R3 to R1, m R3 to 
  2714. R1, R3 to R2) be made and that each be combined with subconditions (offset = 0) and E privilege = 
  2715. ON). Though subcondition R3 > Reff requires that six calls be made (i.e., for Reff > R3 = 0, Reff > R3 
  2716. = ), 1, Reff> R3 = 0, 1, 2), these subconditions cannot be combined with subconditions (offset  0) 
  2717. and E privilege = OFF) because all these related subconditions return failure. Test condition (2) 
  2718. similarly requires that multiple calls be made. It should be noted that for test condition (3) the 
  2719. boundary-value coverage can only cover the success subcondition in normal mode. The lack of a 
  2720. current stack segment number in the T register after a call or a return could only happen due to 
  2721. processor or SPM failures.
  2722.  
  2723. Several test conditions may be desired for processor security testing for which test programs 
  2724. cannot be built in the normal mode of operation. The example of this is provided by the invalidation 
  2725. of current process descriptions in the processor cache before dispatching the next process. (A 
  2726. complete test of the invalidation function for descriptions in the cache can be performed in privileged 
  2727. mode or in ring 0 as outlined in the conclusions below.)
  2728.  
  2729. Test Conditions for Descriptor Invalidation
  2730.  
  2731. Test that the descriptors contained in the cache are invalidated prior to the dispatch function.
  2732.  
  2733. Test Data
  2734.  
  2735. A test to insure invalidation of SPM descriptors after dispatch is not in the test software.
  2736.  
  2737. Verification by Analysis
  2738.  
  2739. The invalidation function of dispatch involves resetting of all SPM cache validity bits for direct 
  2740. memory descriptors used by the CPU. This requires invalidation of 256 and 64 cache locations in 
  2741. the Virtual Memory Interface Unit (VMIU) and Descriptor Store boards, respectively. Analysis has 
  2742. confirmed the proper implementation of this function.
  2743.  
  2744. Conclusions
  2745.  
  2746. A test to verify the dispatch invalidation function could be implemented by using two descriptor 
  2747. structures, each mapping CPU memory references to different areas of memory. By checking usage 
  2748. (U and M bits) of each direct memory descriptor and the actual access to different locations in 
  2749. memory, the invalidation of previously stored descriptors in the SPM cache could be determined. 
  2750. The VMIU portion of the test would use a page descriptor structure (256 page located within 16 
  2751. contiguous segments) with checks provided for each page of memory. The descriptor store board 
  2752. portion of the test would be constructed in a similar manner except 64 direct segment descriptors 
  2753. would be used.
  2754.  
  2755. 3.7.7 Relationship with the TCSEC Requirements
  2756.  
  2757. In this section we present the documentation requirements for test plan and procedures stated by 
  2758. the TCSEC and additional recommendations derived from those requirements. Responsibility for 
  2759. documenting test plans and procedures belongs both to evaluators and to vendors because security 
  2760. testing evidence is produced by both for different purposes. It should be noted that the evaluator's 
  2761. test documentation and programs will not fulfill the vendor responsibility for providing test 
  2762. documentation and test programs. Wherever appropriate, this section differentiates exclusive 
  2763. evaluator responsibility from that of the vendors. Citations of specific evaluator responsibility 
  2764. provided by the TCSEC are omitted here because they are explained in detail in Section 10 of 
  2765. reference [13].
  2766.  
  2767. The introductory section of the test documentation should generally identify the product to be 
  2768. evaluated and give a high-level description of the system being tested, the types of applications for 
  2769. which it is designed, and the evaluated product class for which it is being tested.
  2770.  
  2771. PURPOSE AND SCOPE OF SECURITY TESTING BY EVALUATORS
  2772.  
  2773. A section should state the objectives of security testing conducted by the vendor and describe 
  2774. the role that this testing plays in supporting the Technical Evaluation Phase by the NCSC. It should 
  2775. state the purpose of the test plan and how it will be used. It should also define the intended scope 
  2776. of the effort in terms of both hours of effort and elapsed time, as well as the technical scope of the 
  2777. effort.
  2778.  
  2779. ROLES AND RESPONSIBILITIES OF SYSTEM EVALUATORS
  2780.  
  2781. A section should describe how the test team is organized and identify the team leader and all 
  2782. members by name and organization, qualifications, and experience. Its purpose is two fold. First, 
  2783. it should clearly delineate team members' responsibilities and relationships. Second, it should 
  2784. provide sufficient background information on the team's prior functional testing experience to 
  2785. substantiate that the team is qualified to conduct the tests. It should describe the level of previous 
  2786. experience that each team member has with the system being evaluated, whether all team members 
  2787. have completed an internals course for the system, how well the team understands the flaw 
  2788. hypothesis penetration testing methodology and vulnerability reporting process, and other relevant 
  2789. qualifications. This section should specifically address test team education, skill, and experience.
  2790.  
  2791. A section should also identify any responsibilities for coordination, review and approval of the 
  2792. test plan, and procedures and reports that lie with personnel outside the test team.
  2793.  
  2794. SYSTEM CONFIGURATION
  2795.  
  2796. A section should specify the hardware and software configuration used for testing to include the 
  2797. location of the test site. This configuration should be within the configuration range recommended 
  2798. by the vendor for approval by the NCSC during the Vendor Assistance Phase. The vendor will be 
  2799. required to identify and recommend a test configuration to the NCSC early in the evaluation process. 
  2800. The vendor's recommendation will be considered by the NCSC test team in selecting the "official" 
  2801. test configuration.
  2802.  
  2803. Hardware Configuration
  2804.  
  2805. A subsection should identify the CPU, amount of random access memory (RAM), I/O controllers, 
  2806. disk drives, communications processors, terminals, printers, and any other hardware devices 
  2807. included in the test configuration by specifying the vendor's model number and quantity of each 
  2808. configuration item. Each peripheral should be given a unique identifier that associates it with a 
  2809. specific controller port. Communications parameter settings should be specified where appropriate. 
  2810. It should be possible to duplicate the test configuration exactly from the information provided.
  2811.  
  2812. Software Configuration
  2813.  
  2814. A subsection should identify the version of the vendor's operating system included in the test 
  2815. configuration, as well as each specific TCB software component that is not part of the operating 
  2816. system. It should include sufficient information to generate the system from the TCB test software 
  2817. library along with the vendor's distribution tapes. It is very useful to include a summary of device 
  2818. driver file names and the file system directory structures along with a description of their general 
  2819. contents.
  2820.  
  2821. SECURITY TEST PROCEDURES (TO BE FOLLOWED BY BOTH VENDORS AND 
  2822. EVALUATORS)
  2823.  
  2824. The TCSEC states the following test documentation requirement:
  2825.  
  2826. Class C1 to A1. "The system developers shall provide to the evaluators a document that 
  2827. describes the test plan, test procedures that show how the security mechanisms were tested 
  2828. and the results of the security mechanisms' functional testing."
  2829.  
  2830. A section should provide both an overview of the security testing effort and detailed procedures 
  2831. for each of the security test plans. Security testing will include detailed procedures for executing 
  2832. any test plan that is needed to provide significant coverage of all protection mechanisms. This 
  2833. portion of the test plan must be detailed; it will require the test team to generate the test plans for 
  2834. each TCB primitive.
  2835.  
  2836. Review and Evaluation of Test Documentation for Each TCB Primitive
  2837.  
  2838. A subsection will present an evaluation of the method of TCB primitive testing used by the 
  2839. vendor's development team, the completeness of the coverage provided by the vendor's tests for 
  2840. the TCB primitive, and any shortfalls that will need to be covered by the security testing team. This 
  2841. evaluation should include a discussion of the extent to which the vendor's tests used black-box 
  2842. (which does not necessarily assume any knowledge of system code or other internals) or gray-box 
  2843. coverage (which assume knowledge of system code and other internals). Black-box test coverage 
  2844. is best suited for C1 to B1 class systems. Gray-box coverage of a system's security protection with 
  2845. respect to the requirements in the TCSEC is best suited for B2 to A1 class systems. In terms of 
  2846. TCB-primitive coverage, this subsection should identify any relevant interfaces or mechanisms that 
  2847. the vendor has previously failed to test, as well as how thoroughly the vendor has previously tested 
  2848. each interface or mechanism with respect to each TCSEC requirement.
  2849.  
  2850. Test Plans
  2851.  
  2852. Test Conditions
  2853.  
  2854. This section identifies the test conditions to be covered. It should include explanation of the 
  2855. rationale behind the selection and the order in which the tests are executed. It is recommended that 
  2856. the detailed test procedures for each test condition be compiled in annexes in a format that enables 
  2857. the test personnel to mark steps completed to ensure that procedures are performed correctly.
  2858.  
  2859. These test conditions should be derived from interpretations of the following:
  2860.  
  2861. ╖       Protection philosophy and resource isolation constraints (for classes C1 and C2).
  2862.  
  2863. ╖       Informal security models (class B1).
  2864.  
  2865. ╖       DTLS and formal security models (classes B2 and B3), FTLS (class A1).
  2866.  
  2867. ╖       Accountability requirements (all classes).
  2868.  
  2869. Test Data
  2870.  
  2871. The test data should include the definition of the following:
  2872.  
  2873. ╖       Environment initialization.
  2874.  
  2875. ╖       Test parameters.
  2876.  
  2877. ╖       Test outcomes.
  2878.  
  2879. Coverage Analysis
  2880.  
  2881. The coverage analysis section of a test plan should justify the developer's choice of test conditions 
  2882. and data, and should delimit the usefulness of the test with respect to security of the system.
  2883.  
  2884. Test Procedure Format
  2885.  
  2886. Whenever security testing is not automated extensively, the developer's test documentation 
  2887. should include test scripts. These should contain:
  2888.  
  2889. ╖       A description of the environment initialization procedure.
  2890.  
  2891. ╖       A description of the execution test procedure.
  2892.  
  2893. ╖       A description of the result identification procedure.
  2894.  
  2895. Procedure for Correcting Flaws Uncovered During Testing
  2896.  
  2897. A subsection should describe the procedure for handling the identification and correction of flaws 
  2898. uncovered during the course of functional testing. It should specify how this information was 
  2899. provided to the vendor's test team, how much time was allocated to correct the flaw, and how testing 
  2900. again was conducted to verify that flaws have been corrected.
  2901.  
  2902. An Example Test Report Format
  2903.  
  2904. The TCSEC includes the following requirements for reporting the test results:
  2905.  
  2906. Classes C1 to A1. "The system developer shall provide to the evaluators a document that 
  2907. describes [the] results of the security mechanisms' functional testing."
  2908.  
  2909. A section should identify the vendor of the evaluated product and give a high-level description 
  2910. of the system that was tested, the types of applications for which it is designed, and the class for 
  2911. which it is being evaluated.
  2912.  
  2913. Test System Configuration
  2914.  
  2915. A section should provide a general description of the test system configuration. It need not be as 
  2916. detailed as the test plan, but should give enough detail to identify the hardware and software context 
  2917. for the test results.
  2918.  
  2919. Test Chronology
  2920.  
  2921. A section should provide a brief chronology of the security testing effort. It should indicate when 
  2922. testing began, where it was conducted, when each milestone was completed, and when testing was 
  2923. completed.
  2924.  
  2925. Results of Security Testing
  2926.  
  2927. A section should discuss each flaw uncovered in the system during security testing. It should 
  2928. describe any action taken to correct the flaw as well as the results of retesting. It may be useful to 
  2929. define a "level of criticality" for classifying the flaws in order to distinguish major problems that 
  2930. might impact the final rating from minor discrepancies or those for which a work-around was found.
  2931.  
  2932. List of Uncorrected Flaws
  2933.  
  2934. A section should identify any problems that were uncovered during testing that were not corrected 
  2935. to the test team's satisfaction.
  2936.  
  2937. 4. COVERT CHANNEL TESTING
  2938.  
  2939. Covert channel testing is required in order to demonstrate that the covert channel handling method 
  2940. chosen by system designers is implemented as intended. These methods include prevention and 
  2941. bandwidth limitation. Testing is also useful to confirm that the potential covert channels discovered 
  2942. in the system are in fact real channels. Testing is also useful when the handling method for covert 
  2943. channels uses variable bandwidth-reduction parameters (e.g., delays) that can be set by system 
  2944. administrators (e.g., by auditors). Testing can ensure that these mechanisms reduce the channel 
  2945. bandwidths to the correct limits intended by system administrators.
  2946.  
  2947. Bandwidth estimation methods that are necessary for the handling of covert channels may be 
  2948. based on engineering estimation rather than on actual measurements. Bandwidth estimations 
  2949. provide upper bounds for covert channels before any handling methods are employed. In contrast, 
  2950. covert channel testing always requires that actual measurements be performed to determine the 
  2951. covert channels' bandwidths after the chosen handling method. Similarly, whenever covert channels 
  2952. are prevented (i.e., eliminated), testing of actual code of the implemented system is required.
  2953.  
  2954. 4.1 COVERT CHANNEL TEST PLANS
  2955.  
  2956. The test plans used for covert channel testing have the same structure as those used for security 
  2957. functional testing. That is, for testing each covert channel a test condition and the test data should 
  2958. be written, and coverage analysis should be performed for that channel.
  2959.  
  2960. The test conditions for channels differ depending on the choice of the covert channel handling 
  2961. method. Test conditions would state that no information leakage is possible through the previously 
  2962. extant channel for covert channels that are eliminated. For covert channels handled by bandwidth 
  2963. limitation, the condition would state that the measured bandwidth of the respective channel is below 
  2964. the predicted limit chosen for the channel. If the test is used to measure the bandwidth after nonzero 
  2965. delay values are used, the predicted bandwidth limit is the target bandwidth chosen or provided by 
  2966. the default values of the added delays. If the test is used to measure the bandwidth before nonzero 
  2967. delays are used, the predicted bandwidth is the estimated maximum bandwidth of each channel.
  2968.  
  2969. The test data for each channel consists of the test environment definition, the test parameters 
  2970. used, and the outcomes of the test. The test environment definition consists of a description of the 
  2971. actual covert channel scenario defining how the sender and recipient processes leak information. 
  2972. This definition may include a description of the synchronization methods used by the sender and 
  2973. receiver, the creation and the initialization of the objects (if any) used by the sender/receiver to leak 
  2974. information, the initialization and resetting of the covert channel variable, etc. If channels are 
  2975. aggregated serially or in parallel, and if specific encodings are used, the aggregation and encoding 
  2976. methods should be defined. (Note that neither channel aggregation nor special bit encodings need 
  2977. to be used in testing as these are neither required nor recommended by either [13] or its covert 
  2978. channel guidelines.)
  2979.  
  2980. It should be noted that in many cases of resource exhaustion channels, the test program need not 
  2981. actually leak any string of bits. This is acceptable only in cases when the exhaustion of one of these 
  2982. resources deteriorates system performance to such an extent that no information could possibly be 
  2983. transmitted within 1 second. In such cases, it is sufficient to measure the elapsed time from the 
  2984. beginning of the covert channel primitive invocation until the resource exhaustion error is returned 
  2985. to test the upper bound of the achievable bandwidth.
  2986.  
  2987. The test parameters consist of the values set to run the measurements and include the number of 
  2988. bits leaked for each channel, the distribution of 0's and 1's chosen for the test, the representation 
  2989. of 0's and 1's (e.g., using the states of the covert channel variable or system objects), the delay 
  2990. values chosen for testing, the number of objects used and their types and privileges, etc.
  2991.  
  2992. The test outcomes specify the expected results of the test. As with test conditions, the test 
  2993. outcomes are similar for all channels. For each channel, they define the target limit of the actual, 
  2994. measured channel bandwidth.
  2995.  
  2996. Coverage analysis for covert channel testing requires the demonstration that the placement of 
  2997. delays and randomization points in code covers all information flow paths. Credible assurance of 
  2998. correct handling of covert channels cannot be provided without such analysis.
  2999.  
  3000. To understand the complexity of covert channel testing and the need for covering all information 
  3001. flow paths, consider a generic example of covert channels provided by a single variable. Assume 
  3002. that the variable can be viewed (altered) by V (A) primitive calls of the TCB. These primitives can 
  3003. create up to V x A covert channels. Testing would have to ensure that, if the covert channel handling 
  3004. method is based on placement of bandwidth reduction delays, the placement of those delays limits 
  3005. bandwidth of all these covert channels to a specified value. In a system that has N variables (or 
  3006. attributes) that create covert storage channels, sum__{i = ... .N} (VixAi) test programs would have 
  3007. to be generated to assure correct placement of delays. For a UnixTM-like system, this would require 
  3008. approximately 3,000 test plans and programs for covert channel testing, many of which would be 
  3009. redundant. This would clearly be impractical.
  3010.  
  3011. The assurance that covert channel tests cover all possible flows in the TCB can be provided by 
  3012. (1) a test of a single instance of covert channel usage, which would test that the channel is eliminated 
  3013. or delayed, and by (2) an analysis that shows that all other instances of the same channel are either 
  3014. eliminated or have their bandwidth reduced by correct placement of delays. This assurance allows 
  3015. the elimination of all redundant covert channel tests without loss of coverage.
  3016.  
  3017. 4.2 AN EXAMPLE OF A COVERT CHANNEL TEST PLAN
  3018.  
  3019. In this section we present an example of a test plan for a covert storage channel. This channel, 
  3020. called the Upgraded Directory Channel, has been described in references [15] and [16]; therefore, 
  3021. it will not be described here in detail. Measurements and engineering estimations, which predict 
  3022. the bandwidth of this channel in Secure XenixTM running on a 6 megahertz personal computer AT, 
  3023. have been reported in reference [16]. Other types of engineering estimations which can determine 
  3024. the maximum bandwidths of noise less covert channels have been presented in reference [21].
  3025.  
  3026. See Section 4.3, "Relationship with the TCSEC Requirements," which contains an example of a 
  3027. covert channel test plan.
  3028.  
  3029. 4.2.1 Test Plan for the Upgraded Directory Channel
  3030.  
  3031. System Version: PS/2 Model 80.
  3032.  
  3033. Covert Channel Type: MAC conflict channel [19].
  3034.  
  3035. Variable Name: direct - > d__ino.
  3036.  
  3037. 4.2.1.1 Test Condition
  3038.  
  3039. The test condition for the "upgraded directory channel" is:
  3040.  
  3041. The measured bandwidth is lower than the predicted bandwidth after delay is added.
  3042.  
  3043. 4.2.1.2 Test Data
  3044.  
  3045. Environment Initialization
  3046.  
  3047. The test operator logs in at a security level called "Low" and initializes a receiver process. Then 
  3048. the operator logs in at a level called "High" and initializes a sender process. Level High must 
  3049. dominate level Low. The receiver process creates an upgraded directory at level High and the sender 
  3050. process, which is at the same level as that of that directory, signals to the receiver process a 1 or a 
  3051. 0 by either creating or not creating an object in that directory. The receiver process may detect 0s 
  3052. and 1s by trying to remove the upgraded directory. Success or failure of the removal operation 
  3053. signals 0s or 1s because a directory can only be removed when there is no object in that directory [15].
  3054.  
  3055. Note: Both the sender and the receiver use four directories to amortize the synchronization and 
  3056. environment set up delay for every bit over four bits (i.e., four-bit serial aggregation). This covert 
  3057. channel scenario is shown in Figure 7.
  3058.  
  3059.  
  3060.  
  3061. Parameters
  3062.  
  3063. Number of Bits leaked: 8.
  3064.  
  3065. Distribution of information used by the test program: 01100011, which represents character "c."
  3066.  
  3067. Object Type: directory.
  3068.  
  3069. Number of objects used: 4 directories (serial four-bit aggregation).
  3070.  
  3071. Measurements: The rmdir (nonempty directory) elapsed time is 3020 ms. (delayed). The rmdlr 
  3072. (empty directory) elapsed time is 180 ms. The rmdir (average) elapsed time is 1600 ms.
  3073.  
  3074. Outcome: The measured bandwidth is less than the predicted bandwidth of 0.566 bit/sec (with 
  3075. delay). If delay is removed, the predicted bandwidth is 2.8 bits/sec.
  3076.  
  3077. 4.2.1.3 Coverage Analysis
  3078.  
  3079. The trusted process rmdir is the only primitive that reads variables in this covert channel.
  3080.  
  3081. 4.2.2 Test Programs
  3082.  
  3083. The test programs are included in files up/dirs.c and dirr.c (not shown here).
  3084.  
  3085. 4.2.3 Test Results
  3086.  
  3087. The measured bandwidth is 0.5 bit/sec. The reason the test results for the "no delay" case are not 
  3088. included here is that this delay is built into the system configuration. The auditor cannot turn off or 
  3089. set the delay.
  3090.  
  3091. 4.3 RELATIONSHIP WITH THE TCSEC REQUIREMENTS
  3092.  
  3093. The TCSEC states the following requirement for the documentation of covert channel testing:
  3094.  
  3095. Classes B2 to A1. "The system developers shall provide to the evaluators a document 
  3096. that ... shall include the results of testing the effectiveness of the methods used to reduce 
  3097. covert channel bandwidths."
  3098.  
  3099. To satisfy this requirement the testing of the covert channel bandwidth must be performed. The 
  3100. following format is recommended for the documentation of covert channel test plans.
  3101.  
  3102. (1) Test Conditions
  3103.  
  3104. These conditions should be derived from covert channel handling methods and should include:
  3105.  
  3106. ╖       Elimination of covert channel conditions (whenever appropriate).
  3107.  
  3108. ╖       Bandwidth limitation conditions based on measurements or engineering estimations.
  3109.  
  3110. ╖       Covert channel audit conditions (where appropriate).
  3111.  
  3112. (2) Test Data
  3113.  
  3114. Test data should include:
  3115.  
  3116. ╖       Environment initialization data and/or a brief scenario of covert channel use;
  3117.  
  3118. ╖       Test parameter definition.
  3119.  
  3120. ╖       Test outcome (a blocked channel, an eliminated channel, or measured bandwidth below 
  3121. the predicted value).
  3122.  
  3123. (3) Coverage Analysis
  3124.  
  3125. This analysis should contain an explanation of why the test covers all modes of covert information 
  3126. leakage through an individual channel, through a channel variable, or through a class of channels.
  3127.  
  3128. 5. DOCUMENTATION OF SPECIFICATION-TO-CODE   
  3129.  CORRESPONDENCE
  3130.  
  3131. The correspondence of the formal specification and source code is also a test documentation 
  3132. requirement of the TCSEC. The test documentation requirements of the TCSEC state:
  3133.  
  3134. Class A1. "The results of the mapping between the formal top-level specification and the 
  3135. TCB source code shall be given."
  3136.  
  3137. This A1-exclusive requirement is only peripherally related to security testing. We have only 
  3138. included it as an appendix for the interested reader. The detailed set of FTLS-to-code correspondence 
  3139. requirements is provided by A Guideline to Formal Verification Systems (NCSC-TG-014).
  3140.  
  3141. APPENDIX
  3142.  
  3143. Specification-to-Code Correspondence
  3144.  
  3145. 1. Overview
  3146.  
  3147. The requirements of the FTLS-to-code correspondence stated in Section 5 define the scope of 
  3148. the mapping process. The mapping may be informal but it must:
  3149.  
  3150. ╖       Show the consistency of the TCB implementation code and FTLS.
  3151.  
  3152. ╖       Include all elements of the FTLS in the correspondence.
  3153.  
  3154. ╖       Describe code not specified in the FTLS (if any) excluded from the mapping.
  3155.  
  3156. Although the mapping may be informal, it is instructive to review its theoretical underpinnings. 
  3157. These underpinnings are summarized in Sections 1-4 of reference [25] and in Sections III and IV 
  3158. of reference [26].
  3159.  
  3160. Consider two specifications of a finite state machine M denoted by Mf and Mc. The specification 
  3161. Mf is the FTLS of M, and Mc is the implementation specification (i.e., code) of M. A common thread 
  3162. of all formal verification methods is the requirement to demonstrate that any state of the machine 
  3163. specification Mc represents a state of another, more abstract, machine specification Mf . Alternate 
  3164. methods exist that attempt to formally establish this representation.
  3165.  
  3166. The first method is based on defining a function phi with an application to a state Sc of Mc that 
  3167. yields the "corresponding" state of Mf. The function F defines the mapping between the two machine 
  3168. specifications. This mapping expresses properties of the correspondence between Mc and Mf. For 
  3169. example, if the property of Mc is to mimic Mf step by step, the mapping function F should be defined 
  3170. in such a way that the i-th state of Mf corresponds to the i-th step of Mc. If the notions of a secure 
  3171. state and state transition are defined in Mf, and if all state transitions of Mf leave it in a secure state, 
  3172. the property of the function F is defined in such a way that all mapped states of Mc are secure and 
  3173. all state transitions of Mc leave it in a secure state. In general, the mapping function F should capture 
  3174. the specific property, or properties, desired for the mapping.
  3175.  
  3176. The first mapping method, called "refinement mapping" in reference [25], is applicable to large 
  3177. classes of problems of establishing code-to-specification correspondence, including 
  3178. correspondence of concurrent program code. In many cases, however, the refinement mapping 
  3179. cannot be found. Reference [25] shows that in a very large class of mapping cases it is possible to 
  3180. augment the implementation specification of Mc (i.e., the code) with extra state components (called 
  3181. the "history" or "prophecy" variables) in a way that makes it possible to produce refinement 
  3182. mapping.
  3183.  
  3184. The second method is based on defining a function G whose application to an assertion Af defined 
  3185. on a state of Mf yields an assertion Ac about the state of Mc. This alternate mapping should also 
  3186. capture similar properties of Mf and Mc as those defined above. These two notions of mapping 
  3187. defined by F and G are inverses of each other, as argued in reference (16], in the sense that:
  3188.  
  3189. For any assertion Af about the states of Mf and any state Sc of Mc, Af is true of state F(Sc) of 
  3190. Mf if and only if assertion G(Af) is true of state Sc.
  3191.  
  3192. Examples of how the two mapping definitions are applied to system specifications and design 
  3193. are provided in [26]. A further example, which uses similar methods for the generation of correct 
  3194. implementation code from abstract specifications, is given in [27]. In both references, the mappings 
  3195. are defined on types, variables, constants, operators (e.g., logic operators), and state transformations. 
  3196. The common characteristics of all formal mappings are (1) the mapping definition, (2) the 
  3197. identification and justification of unmapped specifications (if any), (3) the specification of the 
  3198. properties that should be preserved by the mappings, and (4) the proofs that these properties are 
  3199. preserved by the defined mappings.
  3200.  
  3201. 2. Informal Methods for Specification-to-Code Correspondence
  3202.  
  3203. Informal methods for FTLS-to-code correspondence attempt, to a significant degree, to follow 
  3204. the steps prescribed by formal methods. Two informal exercises of FTLS-to-code correspondence 
  3205. are presented briefly in references [28 and 29], one based on FTLS written in SPECIAL and the 
  3206. other in Ina Jo. Analysis of both exercises, one of which was carried out on the SCOMP kernel [28], 
  3207. reveals the following common characteristics.
  3208.  
  3209. 2.1 Mapping Definition
  3210.  
  3211. The mapping units of both FTLS and code are identified and labeled explicitly. For example, 
  3212. each "processing module" is identified both in FTLS and code. This identification is aided by:
  3213.  
  3214. ╖       Intermediate English language specification or program design language specifications, 
  3215. and/or
  3216.  
  3217. ╖       Naming conventions common to FTLS and code (if common conventions are used). 
  3218. Processing modules are represented by the "transform" sections of Ina Jo and by the 
  3219. module V, O, and OV functions of SPECIAL.
  3220.  
  3221. Alternatively, the mapping units may consist of individual statements of FTLS and 
  3222. implementation code.
  3223.  
  3224. Correspondences are established between similarly labeled mapping units. This is particularly 
  3225. important for the units that have user visible interfaces. Correspondences include:
  3226.  
  3227. ╖       Data structures used by processing modules (namely variables, constants, and types of 
  3228. the FTLS) are mapped in their correspondent structures of code.
  3229.  
  3230. ╖       Effects of processing modules and operators (e.g., logic operators) that are mapped to 
  3231. the corresponding code functions, procedures, statements and operators.
  3232.  
  3233. In addition, whenever the effects sections of a processing module identify exceptions separately, 
  3234. the correspondence of FTLS exceptions and code exceptions should also be included explicitly.
  3235.  
  3236. 2.2 Unmapped Specifications
  3237.  
  3238. The process of establishing the FTLS-to-code correspondence may reveal that the FTLS has no 
  3239. corresponding code or has incomplete code specifications. This situation is explicitly excluded by 
  3240. the TCSEC requirements, because all elements of the FTLS must have corresponding code. More 
  3241. often, significant portions of the implementation specifications (i.e., code) remain unmapped. 
  3242. Mismatches between FTLS and implementation specification may occur for many different reasons, 
  3243. which include:
  3244.  
  3245. ╖       FTLS and code are written in languages with very different semantics. This is the case 
  3246. whenever FTLS are written in nonprocedural languages and code is written in a 
  3247. procedural language. In this case, the correspondence between the assertions of the 
  3248. nonprocedural language and the functions, procedures, and control statements of the 
  3249. procedural language are difficult to establish. Some unmapped implementation code 
  3250. may represent implementation language detail which is not mapped explicitly to FTLS 
  3251. and which does not affect adversely the properties preserved by the mapping (discussed 
  3252. below).
  3253.  
  3254. ╖       The domain or range of an FTLS function may be incorrectly identified during code 
  3255. development. In this case the mapping process should be able to identify the cause of 
  3256. the FTLS and implementation code mismatch.
  3257.  
  3258. ╖       A significant part of the TCB code is not visible at the user interface and thus, has no 
  3259. correspondent FTLS. This code, which includes internal daemons, such as daemons for 
  3260. page/segment replacement, daemons that take system snapshots, and so on, is 
  3261. nevertheless important from a security point of view because it may introduce 
  3262. information flows between TCB primitives in unexpected ways. The effect of such code 
  3263. on the mapping, or lack thereof, should be carefully analyzed and documented.
  3264.  
  3265. ╖       Unmapped TCB implementation code includes code which ensures the 
  3266. noncircumventability and isolation of the reference monitor and has no specific 
  3267. relevance to the security (i.e., secrecy) policy supported. For example, TCB 
  3268. implementation code which validates the parameters passed by reference to the TCB is 
  3269. policy independent and may cause no covert channel flows (because all relevant flows 
  3270. caused by these checks are internal to the process invoking the TCB).
  3271.  
  3272. ╖       Unmapped TCB implementation code may include accountability relevant code (e.g., 
  3273. audit code), debugging aids, and performance monitoring code, as well as other code 
  3274. which is irrelevant to the security supported. The presence of such code within the TCB 
  3275. may introduce information flows within the TCB primitives and may introduce 
  3276. additional covert channels. The effect of such unmapped code on the mapping should 
  3277. be analyzed and documented.
  3278.  
  3279. ╖       The TCB may contain implementation code that is relevant to the security policy supported 
  3280. by the system but irrelevant to the properties that could be verified using the FTLS. For 
  3281. example, the correctness of some of the discretionary access control policies may not 
  3282. be easily verified with the currently available tools. Therefore, the complete mapping 
  3283. of code implementing such policies to the corresponding FTLS may have limited value. 
  3284. However, the information flows generated by such code should be analyzed and 
  3285. documented.
  3286.  
  3287. 2.3 Properties Preserved by the Mapping
  3288.  
  3289. A key characteristic of any FTLS-to-code mapping is the specification of the security property 
  3290. of the FTLS that should be included in implementation code. Such security properties include 
  3291. specifications of MAC and DAC policy components, object reuse components, and accountability 
  3292. components, all of which are user visible at the TCB interface. These properties should also include 
  3293. specifications of equivalence between information flows created by FTLS and those created by 
  3294. implementation functions, procedures, variables and mapped code. Other safety properties and 
  3295. liveness properties may also be included. For each mapped module, the properties preserved by that 
  3296. module should be documented.
  3297.  
  3298. It must be noted that current emphasis of practical work on FTLS-to-code mapping is exclusively 
  3299. focused on the maintenance of (1) mandatory access control properties of FTLS in implementation 
  3300. code, and (2) the equivalence between covert channel flows of the FTLS and those of the 
  3301. implementation code.
  3302.  
  3303. 2.4 Correlation Arguments
  3304.  
  3305. The documentation of each correspondence between mapping units should include a convincing 
  3306. argument that the desired properties are implemented by code despite unmapped specifications or 
  3307. code (if any). Lack of such documentation would cast doubts on the validity of the mapping and 
  3308. on the usefulness of demonstrating formally such properties of FTLS. For example, little use is 
  3309. made of the soundness of information flows of FTLS whenever flow equivalence between FTLS 
  3310. primitives and variables and those of implementation code is not established.
  3311.  
  3312. 3. An Example of Specification-to-Code Correspondence
  3313.  
  3314. The module whose FTLS mapping to implementation code is illustrated in this section is 
  3315. "get__segment__access" system call of the Honeywell's Secure Communication Processor 
  3316. (SCOMP). The FTLS is written in SPECIAL, the language supported by the Hierarchical 
  3317. Development Methodology (HDM) developed at SRI International, and the implementation code 
  3318. is written in UCLA Pascal. The system call "get__segment__access" returns the access privileges 
  3319. of the invoking process (e.g., user process) for a uniquely identified segment. The effect of this call 
  3320. is similar to that of the access system call of UnixTM when applied to files, namely Tables 1 and 2, 
  3321. page 58. Figure 8 below shows the FTLS of "get__segment__access" and Figures 9a; 9b, parts 1 
  3322. and 2; and 9c show its implementation code. Note that Figure 9a identifies the "def.h" file, namely 
  3323. the file of included header definitions of the module, Figure 9b, parts 1 and 2, contain the actual 
  3324. code of the module (i.e., in the ".p" file), and Figure 9c contains the code of implementation function 
  3325. "get__segment__info," which is invoked by the code of "get__seg__access."
  3326.  
  3327. 3.1 Mapping Definition
  3328.  
  3329. Mapping Units
  3330.  
  3331. The mapping units for both the FTLS and the implementation code of SCOMP are the individual 
  3332. language statements. To establish the mapping each statement of the implementation code is labeled 
  3333. unambiguously (i.e., using the code or data file name and the statement line number). Statement 
  3334. level labeling of data definitions (i.e., "def.h" files) and code (i.e., ".p" files) is shown in Figures 
  3335. 9a; 9b, parts 1 and 2; and 9c.
  3336.  
  3337. Correspondence of Labeled Units
  3338.  
  3339. The statement level mapping of FTLS to code is established in SCOMP by adding to each 
  3340. SPECIAL statement of the "get__segment__access" module the corresponding individual (or group 
  3341. of) UCLA Pascal statement(s). Figure 8 shows this.
  3342.  
  3343.  
  3344.  
  3345. LEGEND
  3346.  
  3347. ^       =       pointer to
  3348.  
  3349. !=      =       not equal
  3350.  
  3351. ~       =       negation
  3352.  
  3353.  
  3354.  
  3355. User Visible Effects, Exceptions, and Data Structures
  3356.  
  3357. The only user visible effect of this VFUN (i.e., state returning function) is mapped to the language 
  3358. statements "segment.p 931-939" as part of the nondiscretionary access check performed to 
  3359. determine whether the calling process has MAC access to the segment passed as a parameter. 
  3360. Whenever this check is passed (in "segment.p 931"), the accesses of the caller process to the segment 
  3361. are returned through "seg__access__p" parameter. Note that the UCLA Pascal function 
  3362. "non__discretionary__access__allowed(...)" is mapped to the SPECIAL function 
  3363. "valid__flow(...)." The former calls the UCLA Pascal version of the latter (neither shown here). In 
  3364. addition, the function "non__discretionary__access__allowed(...)" also performs checks to 
  3365. determine whether the invoking process has special system privileges that would allow it to bypass 
  3366. the MAC checks of "valid__flow(...)." Since the properties of interest to the FTLS verification do 
  3367. not include the effects of the system privileges, only the SPECIAL function corresponding to 
  3368. "valid__flow(...)" is used in the VFUN "get__segment__access" (namely, comment in the FTLS). 
  3369. Note that the derived SPECIAL function "get__object__access" corresponds to the UCLA Pascal 
  3370. function "get__segment__info," defined in "segment.p 945-978" and invoked in "segment.p 914-
  3371. 917," and that both are invisible at the TCB interface when used in the corresponding modules 
  3372. "get__segment__access" and "get__seg__access."
  3373.  
  3374.  
  3375.  
  3376.  
  3377.  
  3378. The two visible exceptions of the VFUN, namely "invalid__segment__name" and 
  3379. "segment__does__not__exist," are mapped to the exceptions with the same name of the UCLA 
  3380. Pascal code found in statements "segment.p 908, 911, 922, and 938."
  3381.  
  3382. The only visible data structures are the parameters exchanged by the caller process and the VFUN 
  3383. module. The mapping of these parameters is shown in the header file at lines "def.h 370 and 372."
  3384.  
  3385. 3.2 Unmapped Implementation Code
  3386.  
  3387. The following lines of UCLA Pascal code have no correspondent SPECIAL code:
  3388.  
  3389. ╖       segment.p 888-898-Implementation language detail (i.e., declarations of function 
  3390. parameters and internal system data structures).
  3391.  
  3392. ╖       segment.p 901-904 (and 954-957)-Conditional compilation of debugging code}.
  3393.  
  3394. ╖       segment.p 905-906 and 940-942-Implementation code of the reference monitor 
  3395. mechanism (i.e., code that validates parameters passed by reference that helps maintain 
  3396. noncircumventability and isolation properties).
  3397.  
  3398. ╖       segment.p 912-913, 920-921, 924-930-Implementation details referring to internal 
  3399. data structures that remain invisible to the user interface. Note the use of locking code, 
  3400. which ensures that internal sequences of kernel actions cannot be interrupted.
  3401.  
  3402. ╖       segment.p 900, 943-Implementation language detail (i.e., control statements).
  3403.  
  3404. 3.3 List of Properties Preserved by the Mapping
  3405.  
  3406. The properties preserved by the mapping are:
  3407.  
  3408. ╖       Mandatory Access Control to objects of type p segment.
  3409.  
  3410. ╖       Equivalence of information flows visible at the TCB interface.
  3411.  
  3412. 3.4 Justification for the Maintained Properties and for Unmapped Code 
  3413.  
  3414. MAC Properties of Segments
  3415.  
  3416. In both the SPECIAL FTLS and UCLA Pascal code versions of "get__segment__access," control 
  3417. returns suCcessfully to the invoking process only if the "valid__flow" and the "non 
  3418. disCretionary__access__allowed" checks pass. As explained above, these checks are equivalent 
  3419. from an unprivileged user's point of view. Furthermore, in both the FTLS and code versions, the 
  3420. unsuccessful returns are caused by the same sets of exception checks, namely (1) wrong object 
  3421. type, segment is not in the required file system partition (consistency checks); and (2) unmounted 
  3422. segment, failed MAC check, and inexistent segment (MAC relevant checks). The two additional 
  3423. exception checks present in the implementation code are not MAC specific checks. Instead, they 
  3424. are checks of the reference monitor mechanism (e.g., parameter validation), and thus irrelevant for 
  3425. MAC property verification.
  3426.  
  3427. Equivalence of Information Flows
  3428.  
  3429. The only visible flows of information through the interface of the "get__segment__access" 
  3430. module are those provided by the successful and the unsuccessful returns. These returns take place 
  3431. in identical FTLS and code conditions (namely, the mapping definition documented above and 
  3432. Figures 8; 9a; 9b, parts 1 and 2; and 9c). The additional exception returns of the implementation 
  3433. code to the invoker (i.e., the parameter validation exceptions) cannot introduce flows between 
  3434. different processes. Therefore, the equivalence of the FTLS (SPECIAL) flows and the 
  3435. implementation code (UCLA Pascal) flows is preserved.
  3436.  
  3437. Justification for Unmapped Code
  3438.  
  3439. The unmapped code cannot affect the mapping properties that must be preserved for the following 
  3440. reasons:
  3441.  
  3442. ╖       The syntax of the parameter declarations and of the control statements are property 
  3443. irrelevant language details.
  3444.  
  3445. ╖       The debugging code is not compiled in the TCB in the normal mode of operation.
  3446.  
  3447. ╖       The code implementing the reference monitor checks is not specific to either of the above 
  3448. properties (although the functional correctness of these checks is required for secure 
  3449. system operation, such proof of correctness is not required for A1 systems currently).
  3450.  
  3451. ╖       The code which implements internal kernel actions in a manner that cannot be interrupted 
  3452. is not visible at the TCB interface (although its functional correctness is required in 
  3453. secure systems, it is not always demonstrable using currently approved tools for A1 
  3454. systems).
  3455.  
  3456. GLOSSARY
  3457.  
  3458. Access
  3459.  
  3460. A specific type of interaction between a subject and an object that results in the flow of information 
  3461. from one to the other.
  3462.  
  3463. Administrative User
  3464.  
  3465. A user assigned to supervise all or a portion of an ADP system.
  3466.  
  3467. Audit
  3468.  
  3469. To conduct the independent review and examination of system records and activities.
  3470.  
  3471. Audit Trail
  3472.  
  3473. A set of records that collectively provides documentary evidence of processing used to aid in 
  3474. tracing from original transactions forward to related records and reports and/or backwards from 
  3475. records and reports to their component source transactions.
  3476.  
  3477. Auditor
  3478.  
  3479. An authorized individual, or role, with administrative duties, which include selecting the events 
  3480. to be audited on the system, setting up the audit flags which enable the recording of those events, 
  3481. and analyzing the trail of audit events.
  3482.  
  3483. Authenticate
  3484.  
  3485. To establish the validity of a claimed identity.
  3486.  
  3487. Authenticated User
  3488.  
  3489. A user who has accessed an ADP system with a valid identifier and authentication combination.
  3490.  
  3491. Bandwidth
  3492.  
  3493. A characteristic of a communication channel that is the amount of information that can be passed 
  3494. through it in a given amount of time, usually expressed in bits per second.
  3495.  
  3496. Bell-LaPadula Model
  3497.  
  3498. A formal state transition model of computer security rules. In this formal model, the entities in 
  3499. a computer system are divided into abstract sets of subjects and objects. The notion of a secure state 
  3500. is defined and it is proven that each state transition preserves by moving from secure state to secure 
  3501. state, thus inductively proving that the system is secure. A system state is defined to be "secure" if 
  3502. the only permitted access modes of subjects to objects are in accordance with a specific security 
  3503. policy. In order to determine whether or not a specific access mode is allowed, the clearance of a 
  3504. subject is compared to the classification of the object and a determination is made as to whether 
  3505. the subject is authorized for the specific access mode. The clearance/classification scheme is 
  3506. expressed in terms of a lattice. (Also see Lattice).
  3507.  
  3508. Channel
  3509.  
  3510. An information transfer path within a system. May also refer to the mechanism by which the 
  3511. path is effected.
  3512.  
  3513. Covert Channel
  3514.  
  3515. A communication channel that allows a process to transfer information in a manner that violates 
  3516. the system's security policy. (Also see Covert Storage Channel and Covert Timing Channel.)
  3517.  
  3518. Covert Storage Channel
  3519.  
  3520. A covert channel that involves the direct or indirect writing of a storage location by one process 
  3521. and the direct or indirect reading of the storage location by another process. Covert storage channels 
  3522. typically involve a finite resource (e.g., sectors on a disk) that is shared by two subjects at different 
  3523. security levels.
  3524.  
  3525. Covert Timing Channel
  3526.  
  3527. A covert channel in which one process signals information to another by modulating its own use 
  3528. of system resources (e.g., CPU time) in such a way that this manipulation affects the real response 
  3529. time observed by the second process.
  3530.  
  3531. Coverage Analysis
  3532.  
  3533. Qualitative or quantitative assessment of the extent to which the test conditions and data show 
  3534. compliance with required properties, e.g., security model and TCB primitive properties, etc. (Also 
  3535. see Test Condition and Test Data.)
  3536.  
  3537. Data integrity
  3538.  
  3539. The state that exists when computerized data are the same as those that are in the source documents 
  3540. and have not been exposed to accidental or malicious alteration or destruction.
  3541.  
  3542. Descriptive Top-Level Specification (DTLS)
  3543.  
  3544. A top level specification that is written in a natural language (e.g., English), an informal program 
  3545. design notation, or a combination of the two.
  3546.  
  3547. Discretionary Access Control (DAC)
  3548.  
  3549. A means of restricting access to objects based on the identity of subjects and/or groups to which 
  3550. they belong or on the possession of a ticket authorizing access to those objects. The controls are 
  3551. discretionary in the sense that a subject with a certain access permission is capable of passing that 
  3552. permission (perhaps indirectly) onto any other subject.
  3553.  
  3554. Dominate
  3555.  
  3556. Security level S1 is said to be the dominate security level if the hierarchical classification of S1 
  3557. is greater than or equal to that of S2 and the nonhierarchical categories of S1 include all those of 
  3558. S2 as a subset.
  3559.  
  3560. Exploitable Channel
  3561.  
  3562. Any channel that is usable or detectable by subjects external to the Trusted Computing Base.
  3563.  
  3564. Flaw
  3565.  
  3566. An error of commission, omission, or oversight in a system that allows protection mechanisms 
  3567. to be bypassed.
  3568.  
  3569. Flaw Hypothesis Methodology
  3570.  
  3571. A system analysis and penetration technique where specifications and documentation for the 
  3572. system are analyzed and then flaws in the system are hypothesized. The list of hypothesized flaws 
  3573. is prioritized on the basis of the estimated probability that a flaw actually exists and, assuming a 
  3574. flaw does exist, on the ease of exploiting it and on the extent of control or compromise it would 
  3575. provide. The prioritized list is used to direct the actual testing of the system.
  3576.  
  3577. Formal Proof
  3578.  
  3579. A complete and convincing mathematical argument, presenting the full logical justification for 
  3580. each proof step and for the truth of a theorem or set of theorems. The formal verification process 
  3581. uses formal proofs to show the truth of certain properties of formal specification and for showing 
  3582. that computer programs satisfy their specifications.
  3583.  
  3584. Formal Security Policy Model
  3585.  
  3586. A mathematically precise statement of a security policy. To be adequately precise, such a model 
  3587. must represent the initial state of a system, the way in which the system progresses from one state 
  3588. to another, and a definition of a "secure" state of the system. To be acceptable as a basis for a TCB, 
  3589. the model must be supported by a formal proof that if the initial state of the system satisfies the 
  3590. definition of a "secure" state and if all assumptions required by the model hold, then all future states 
  3591. of the system will be secure. Some formal modeling techniques include state transition models, 
  3592. temporal logic models, denotational semantics models, and algebraic specification models.
  3593.  
  3594. Formal Top-Level Specification (FTLS)
  3595.  
  3596. A Top Level Specification that is written in a formal mathematical language to allow theorems 
  3597. showing the correspondence of the system specification to its formal requirements to be 
  3598. hypothesized and formally proven.
  3599.  
  3600. Formal Verification
  3601.  
  3602. The process of using formal proofs to demonstrate the consistency (design verification) between 
  3603. a formal specification of a system and a formal security policy model or (implementation 
  3604. verification) between the formal specification and its program implementation.
  3605.  
  3606. Functional Testing
  3607.  
  3608. The portion of security testing in which the advertised features of a system are tested for correct 
  3609. operation.
  3610.  
  3611. Lattice
  3612.  
  3613. A partially ordered set for which every pair of elements has a greatest lower bound and a least 
  3614. upper bound.
  3615.  
  3616. Least Privilege
  3617.  
  3618. This principle requires that each subject in a system be granted the most restrictive set of privileges 
  3619. (or lowest clearance) needed for the performance of authorized tasks. The application of this 
  3620. principle limits the damage that can result from accident, error, or unauthorized use.
  3621.  
  3622. Mandatory Access Control (MAC)
  3623.  
  3624. A means of restricting access to objects based on the sensitivity (as represented by a label) of the 
  3625. information contained in the objects and the formal authorization (i.e., clearance) of subjects to 
  3626. access information of such sensitivity.
  3627.  
  3628. Multilevel Device
  3629.  
  3630. A device that is used in a manner that permits it to simultaneously process data of two or more 
  3631. security levels without risk of compromise. To accomplish this, sensitivity labels are normally stored 
  3632. on the same physical medium and in the same form readable by machines or humans as the data 
  3633. being processed.
  3634.  
  3635. Object
  3636.  
  3637. A passive entity that contains or receives information. Access to an object potentially implies 
  3638. access to the information it contains. Examples of objects are records, blocks, pages, segments, 
  3639. files, directories, directory trees, and programs, as well as bits, bytes, words, fields, processors, 
  3640. video displays, keyboards, clocks, printers, and network nodes, etc.
  3641.  
  3642. Process
  3643.  
  3644. A program in execution. It is completely characterized by a single current execution point 
  3645. (represented by the machine state) and address space.
  3646.  
  3647. Protection Critical Portions of the TCB
  3648.  
  3649. Those portions of the TCB, the normal function of which is to deal with the control of access 
  3650. between subjects and objects.
  3651.  
  3652. Read
  3653.  
  3654. A fundamental operation that results only in the flow of information from an object to a subject. 
  3655. Read Access (Privilege) Permission to read information.
  3656.  
  3657. Security Level
  3658.  
  3659. The combination of a hierarchical classification and a set of nonhierarchical categories that 
  3660. represents the sensitivity of information.
  3661.  
  3662. Security Policy
  3663.  
  3664. The set of laws, rules, and practices that regulate how an organization manages, protects, and 
  3665. distributes sensitive information.
  3666.  
  3667. Security Policy Model
  3668.  
  3669. An informal presentation of a formal security policy model.
  3670.  
  3671. Security Relevant Event
  3672.  
  3673. Any event that attempts to change the security state of the system, e.g., change discretionary 
  3674. access controls, change the security level of the subject, or change a user's password, etc. Also, any 
  3675. event that attempts to violate the security policy of the system, e.g., too many attempts to login, 
  3676. attempts to violate the mandatory access control limits of a device, or attempts to downgrade a file, 
  3677. etc.
  3678.  
  3679. Security Testing
  3680.  
  3681. A process used to determine that the security features of a system are implemented as designed 
  3682. and that they are adequate for a proposed application environment.
  3683.  
  3684. Single Level Device
  3685.  
  3686. A device that is used to process data of a single security level at any one time. Since the device 
  3687. need not be trusted to separate data of different security levels, sensitivity labels do not have to be 
  3688. stored with the data being processed.
  3689.  
  3690. Subject
  3691.  
  3692. An active entity, generally in the form of a person, process, or device that causes information to 
  3693. flow among objects or changes the system state. Technically, a process/domain pair.
  3694.  
  3695. Subject Security Level
  3696.  
  3697. A subject's security level is equal to the security level of the objects to which it has both read 
  3698. and write access. A subject's security level must always be dominated by the clearance of the user 
  3699. the subject is associated with.
  3700.  
  3701. TCB-primitive
  3702.  
  3703. An operation implemented by the TCB whose interface specifications (i.e., names, parameters, 
  3704. effects, exceptions, access control checks, errors, and calling conventions) are provided by system 
  3705. reference manuals or DTLS/FTLS as required.
  3706.  
  3707. Test Condition
  3708.  
  3709. A statement defining a constraint that must be satisfied by the program under test.
  3710.  
  3711. Test Data
  3712.  
  3713. The set of specific objects and variables that must be used to demonstrate that a program produces 
  3714. a set of given outcomes.
  3715.  
  3716. Test Plan
  3717.  
  3718. A document or a section of a document which describes the test conditions, data, and coverage 
  3719. of a particular test or group of tests. (Also see Test Condition, Test Data, and Coverage Analysis.)
  3720.  
  3721. Test Procedure (Script)
  3722.  
  3723. A set of steps necessary to carry out one or a group of tests. These include steps for test 
  3724. environment initialization, test execution, and result analysis. The test procedures are carried out 
  3725. by test operators.
  3726.  
  3727. Test Program
  3728.  
  3729. A program which implements the test conditions when initialized with the test data and which 
  3730. collects the results produced by the program being tested. Top Level Specification (TLS) is a 
  3731. nonprocedural description of system behavior at the most abstract level. Typically a functional 
  3732. specification that omits all implementation details.
  3733.  
  3734. Trusted Computer System
  3735.  
  3736. A system that employs sufficient hardware and software integrity measures to allow its use for 
  3737. simultaneously processing a range of sensitive or classified information.
  3738.  
  3739. Trusted Computing Base (TCB)
  3740.  
  3741. The totality of protection mechanisms within a computer system-including hardware, firmware, 
  3742. and software-the combination of which is responsible for enforcing a security policy. It creates a 
  3743. basic protection environment and provides additional user services required for a trusted computer 
  3744. system. The ability of a trusted computing base to correctly enforce a security policy depends solely 
  3745. on the mechanisms within the TCB and on the correct input by system administrative personnel of 
  3746. parameters (e.g., a user's clearance) related to the security policy.
  3747.  
  3748. Trusted Path
  3749.  
  3750. A mechanism by which a person at a terminal can communicate directly with the Trusted 
  3751. Computing Base. This mechanism can only be activated by the person or the Trusted Computing 
  3752. Base and cannot be imitated by those untrusted. Any person who interacts directly with a computer 
  3753. system.
  3754.  
  3755. Verification
  3756.  
  3757. The process of comparing two levels of system specification for proper correspondence (e.g., 
  3758. security policy model with top level specification, TLS with source code, or source code with object 
  3759. code). This process may or may not be automated.
  3760.  
  3761. Write
  3762.  
  3763. A fundamental operation that results only in the flow of information from a subject to an object.
  3764.  
  3765. Write Access (Privilege)
  3766.  
  3767. Permission to write to an object.
  3768.  
  3769. REFERENCES
  3770.  
  3771. 1. Howden, W.E., "The Theory and Practice of Functional Testing," IEEE Software, September 
  3772. 1985, pp. 18-23.
  3773.  
  3774. 2. Haley, C.J. and Mayer, F.L., "Issues on the Development of Security Related Functional Tests," 
  3775. Proceedings of the Eighth National Computer Security Conference, National Bureau of 
  3776. Standards, Gaithersburg, Maryland, September 1985.
  3777.  
  3778. 3. Gligor, V.D., "An Analysis of the Hardware Verification of the Honeywell SCOMP," Proceedings 
  3779. of the IEEE Symposium on Security and Privacy, Oakland, California, April 1985.
  3780.  
  3781. 4. Gligor, V.D., "The Verification of the Protection Mechanisms of High Level Language 
  3782. Machines," International Journal of Computer and Information Sciences, Vol. 12, No. 4, August 
  3783. 1983, pp. 211-246.
  3784.  
  3785. 5. Petschenik, N., "Practical Priorities in System Testing," IEEE Software, September 1985, pp. 
  3786. 1-23.
  3787.  
  3788. 6. Myers, G.J., The Art of Software Testing, John Wiley and Sons, New York, 1979.
  3789.  
  3790. 7. Howden, W.E., "Functional Program Testing," IEEE Transactions on Software Engineering, 
  3791. Vol. SE-6, No. 3, May 1980, pp. 162-169.
  3792.  
  3793. 8. Clark, D., "Ancillary Reports: Kernel Design Project," M.I.T. Laboratory Computer Science, 
  3794. Cambridge, Massachusetts, Technical Memo 87, June 1977.
  3795.  
  3796. 9. Gligor, V.D.; Chandersekaran, C.; Jiang, W.D.; Johri, A.; Luckenbaugh, G.L. and Reich, L.E., 
  3797. "A New Security Testing Method and Its Application to the Secure Xenix Kernel," IEEE 
  3798. Transactions on Software Engineering, Vol. SE13, No. 2, February 1987, pp. 169-183.
  3799.  
  3800. 10. Laski, J.W. and Korel, B., "A Data Flow Oriented Program Testing Strategy," IEEE Transactions 
  3801. on Software Engineering, Vol. SE-9, No. 3, May 1983, pp. 347-354.
  3802.  
  3803. 11. Rapps, S. and Weyuker, E.J., "Data Flow Analysis Techniques for Test Data Selection," 
  3804. Proceedings of the Sixth International Conference on Software Engineering, 1982, pp. 272-278.
  3805.  
  3806. 12. Luckenbaugh, G.L.; Gligor, V.D.; Dotterer, L.J.; Chandersekaran, C.S. and Vasudevan, N., 
  3807. "Interpretation of the Bell-LaPadula Model in Secure Xenix," Proceedings of the Ninth National 
  3808. Computer Security Conference, Gaithersburg, Maryland, September 1986.
  3809.  
  3810. 13. Department of Defense Trusted Computer System Evaluation Criteria, DoD 5200.28-STD, 
  3811. December 1985 (supersedes CSC-STD-001 -83, dtd 15 Aug 83), Library No. 5225,711.
  3812.  
  3813. 14. Department of Defense-ADP Security Manual-Techniques and Procedures for 
  3814. Implementing, Deactivating, Testing, and Evaluating Secure Resource Sharing ADP Systems, 
  3815. DoD 5200.28-M, revised June 1979.
  3816.  
  3817. 15. Gligor, V.D.; Chandersekasan, C.S.; Jiang, W.D.; Johri, A.; Luckenbaugh, G.L. and Vasuderan, 
  3818. N., "Design and Implementation of Secure Xenix," IEEE Transactions on Software Engineering, 
  3819. Vol. SE-13, No. 2, February 1987, pp. 208-221.
  3820.  
  3821. 16. Tsai, C.R. and Gligor, V.D., "A Bandwidth Computation Model for Covert Storage Channels 
  3822. and its Applications," Proceedings of the IEEE Symposium on Security and Privacy, Oakland, 
  3823. California, April 1988.
  3824.  
  3825. 17. Aerospace Report No. TOR-0086 (6777-25)1, "Trusted Computer System Evaluation 
  3826. Management Plan," 1 October 1985.
  3827.  
  3828. 18. National Computer Security Center, Trusted Product Evaluations-A Guide For Vendors, 
  3829. NCSC-TG-002, Version-1, 22 June 1990.
  3830.  
  3831. 19. Millen, J.K., "Kernel Isolation for the PDP-11/70," Proceedings of the IEEE Symposium on 
  3832. Security and Privacy, Oakland, California, 1982.
  3833.  
  3834. 20. Cugini, J.A.; Lo, S.P.; Hedit, M.S.; Tsai, C.R.; Gligor, V.D.; Auditham, R. and Wei, F.J., 
  3835. "Security Testing of AIX System Calls using Prolog," Proceedings of the Usenix Conference, 
  3836. Baltimore, Maryland, June 1989.
  3837.  
  3838. 21. Millen, J.K., "Finite-State Noiseless Covert Channels," Proceedings of the Computer Security 
  3839. Foundation Workshop II, Franconia, New Hampshire, June 1989. (IEEE Catalog Number 
  3840. 89TH02550)
  3841.  
  3842. 22. Carnall, J.J. and Wright, A. F., "Secure Communication Processor Hardware Verification 
  3843. Report," Technical Report, Honeywell Inc., Program Code No. 7P10, prepared for Contract No. 
  3844. HAVELEX N00039-77-C-0245.
  3845.  
  3846. 23. Honeywell, Inc., "Secure Communication Processor-Test and Verification Software 
  3847. Description," Technical Report, Rev. 3, April 1980, Program Code No. 7P10, prepared for Contract 
  3848. No. NAVELEX N00039-77-C-0245.
  3849.  
  3850. 24. Vickers-Benzel, T., "Overview of the SCOMP Architecture and Security Mechanisms," The 
  3851. MITRE Corporation, Technical Report, MTR-9071, September 1983.
  3852.  
  3853. 25. Abadi, M. and Lamport, L., "The Existence of Refinement Mappings," Research Report 29, 
  3854. Systems Research Center, Digital Equipment Corporation, August 1988.
  3855.  
  3856. 26. Berry, D.M., "Towards a Formal Basis for the Formal Development Method and the Ina Jo 
  3857. Specification Language," IEEE Transactions on Software Engineering, VoL. SE-13, No. 2, 
  3858. February 1987, pp. 184-201.
  3859.  
  3860. 27. Yu, C.F. and Gligor, V.D., "A Formal Specification and Verification Method for the Prevention 
  3861. of Denial of Service in ADATM Services," Institute for Defense Analyses, Paper No. P-2120, July 
  3862. 1988.
  3863.  
  3864. 28. Vickers-Benzel, T., "Analysis of a Kernel Verification," Proceedings of the IEEE Symposium 
  3865. on Security and Privacy, Oakland, California, April 1984.
  3866.  
  3867. 29. Solomon, J., "Specification-to-Code Correlation," Proceedings of the lEEE Symposium on 
  3868. Security and Privacy, Oakland, California, April 1982. 
  3869.  
  3870.  
  3871.  
  3872.  
  3873.  
  3874.  
  3875.  
  3876.  
  3877.  
  3878.  
  3879.  
  3880.  
  3881.