bootloader.if 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. ## <summary>Policy for the kernel modules, kernel image, and bootloader.</summary>
  2. ########################################
  3. ## <summary>
  4. ## Execute bootloader in the bootloader domain.
  5. ## </summary>
  6. ## <param name="domain">
  7. ## <summary>
  8. ## Domain allowed to transition.
  9. ## </summary>
  10. ## </param>
  11. #
  12. interface(`bootloader_domtrans',`
  13. gen_require(`
  14. type bootloader_t, bootloader_exec_t;
  15. ')
  16. corecmd_search_bin($1)
  17. domtrans_pattern($1, bootloader_exec_t, bootloader_t)
  18. ')
  19. ########################################
  20. ## <summary>
  21. ## Execute bootloader interactively and do
  22. ## a domain transition to the bootloader domain.
  23. ## </summary>
  24. ## <param name="domain">
  25. ## <summary>
  26. ## Domain allowed to transition.
  27. ## </summary>
  28. ## </param>
  29. ## <param name="role">
  30. ## <summary>
  31. ## Role allowed access.
  32. ## </summary>
  33. ## </param>
  34. ## <rolecap/>
  35. #
  36. interface(`bootloader_run',`
  37. gen_require(`
  38. attribute_role bootloader_roles;
  39. ')
  40. bootloader_domtrans($1)
  41. roleattribute $2 bootloader_roles;
  42. ')
  43. ########################################
  44. ## <summary>
  45. ## Execute bootloader in the caller domain.
  46. ## </summary>
  47. ## <param name="domain">
  48. ## <summary>
  49. ## Domain allowed access.
  50. ## </summary>
  51. ## </param>
  52. #
  53. interface(`bootloader_exec',`
  54. gen_require(`
  55. type bootloader_exec_t;
  56. ')
  57. corecmd_search_bin($1)
  58. can_exec($1, bootloader_exec_t)
  59. ')
  60. ########################################
  61. ## <summary>
  62. ## Read the bootloader configuration file.
  63. ## </summary>
  64. ## <param name="domain">
  65. ## <summary>
  66. ## Domain allowed access.
  67. ## </summary>
  68. ## </param>
  69. #
  70. interface(`bootloader_read_config',`
  71. gen_require(`
  72. type bootloader_etc_t;
  73. ')
  74. allow $1 bootloader_etc_t:file read_file_perms;
  75. ')
  76. ########################################
  77. ## <summary>
  78. ## Read and write the bootloader
  79. ## configuration file.
  80. ## </summary>
  81. ## <param name="domain">
  82. ## <summary>
  83. ## Domain allowed access.
  84. ## </summary>
  85. ## </param>
  86. ## <rolecap/>
  87. #
  88. interface(`bootloader_rw_config',`
  89. gen_require(`
  90. type bootloader_etc_t;
  91. ')
  92. allow $1 bootloader_etc_t:file rw_file_perms;
  93. ')
  94. ########################################
  95. ## <summary>
  96. ## Read and write the bootloader
  97. ## temporary data in /tmp.
  98. ## </summary>
  99. ## <param name="domain">
  100. ## <summary>
  101. ## Domain allowed access.
  102. ## </summary>
  103. ## </param>
  104. #
  105. interface(`bootloader_rw_tmp_files',`
  106. gen_require(`
  107. type bootloader_tmp_t;
  108. ')
  109. files_search_tmp($1)
  110. allow $1 bootloader_tmp_t:file rw_file_perms;
  111. ')
  112. ########################################
  113. ## <summary>
  114. ## Read and write the bootloader
  115. ## temporary data in /tmp.
  116. ## </summary>
  117. ## <param name="domain">
  118. ## <summary>
  119. ## Domain allowed access.
  120. ## </summary>
  121. ## </param>
  122. #
  123. interface(`bootloader_create_runtime_file',`
  124. gen_require(`
  125. type boot_runtime_t;
  126. ')
  127. allow $1 boot_runtime_t:file { create_file_perms rw_file_perms };
  128. files_boot_filetrans($1, boot_runtime_t, file)
  129. ')