This adds the ability to have different profiles for individual distros
and versions of the distro because they all ship with and depend on
different versions of policy packages.
The `selinux` dir contains the unmodified policy that is being used
today. The `selinux-fedora` dir contains the new policy for fedora 24
with the changes for it to compile and work on the system.
The fedora policy is from commit
https://github.com/projectatomic/docker-selinux/commit/4a6ce94da5e34868642ebcc7a67da937d4c73283
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,340 +0,0 @@ |
| 1 |
- GNU GENERAL PUBLIC LICENSE |
|
| 2 |
- Version 2, June 1991 |
|
| 3 |
- |
|
| 4 |
- Copyright (C) 1989, 1991 Free Software Foundation, Inc. |
|
| 5 |
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
| 6 |
- Everyone is permitted to copy and distribute verbatim copies |
|
| 7 |
- of this license document, but changing it is not allowed. |
|
| 8 |
- |
|
| 9 |
- Preamble |
|
| 10 |
- |
|
| 11 |
- The licenses for most software are designed to take away your |
|
| 12 |
-freedom to share and change it. By contrast, the GNU General Public |
|
| 13 |
-License is intended to guarantee your freedom to share and change free |
|
| 14 |
-software--to make sure the software is free for all its users. This |
|
| 15 |
-General Public License applies to most of the Free Software |
|
| 16 |
-Foundation's software and to any other program whose authors commit to |
|
| 17 |
-using it. (Some other Free Software Foundation software is covered by |
|
| 18 |
-the GNU Library General Public License instead.) You can apply it to |
|
| 19 |
-your programs, too. |
|
| 20 |
- |
|
| 21 |
- When we speak of free software, we are referring to freedom, not |
|
| 22 |
-price. Our General Public Licenses are designed to make sure that you |
|
| 23 |
-have the freedom to distribute copies of free software (and charge for |
|
| 24 |
-this service if you wish), that you receive source code or can get it |
|
| 25 |
-if you want it, that you can change the software or use pieces of it |
|
| 26 |
-in new free programs; and that you know you can do these things. |
|
| 27 |
- |
|
| 28 |
- To protect your rights, we need to make restrictions that forbid |
|
| 29 |
-anyone to deny you these rights or to ask you to surrender the rights. |
|
| 30 |
-These restrictions translate to certain responsibilities for you if you |
|
| 31 |
-distribute copies of the software, or if you modify it. |
|
| 32 |
- |
|
| 33 |
- For example, if you distribute copies of such a program, whether |
|
| 34 |
-gratis or for a fee, you must give the recipients all the rights that |
|
| 35 |
-you have. You must make sure that they, too, receive or can get the |
|
| 36 |
-source code. And you must show them these terms so they know their |
|
| 37 |
-rights. |
|
| 38 |
- |
|
| 39 |
- We protect your rights with two steps: (1) copyright the software, and |
|
| 40 |
-(2) offer you this license which gives you legal permission to copy, |
|
| 41 |
-distribute and/or modify the software. |
|
| 42 |
- |
|
| 43 |
- Also, for each author's protection and ours, we want to make certain |
|
| 44 |
-that everyone understands that there is no warranty for this free |
|
| 45 |
-software. If the software is modified by someone else and passed on, we |
|
| 46 |
-want its recipients to know that what they have is not the original, so |
|
| 47 |
-that any problems introduced by others will not reflect on the original |
|
| 48 |
-authors' reputations. |
|
| 49 |
- |
|
| 50 |
- Finally, any free program is threatened constantly by software |
|
| 51 |
-patents. We wish to avoid the danger that redistributors of a free |
|
| 52 |
-program will individually obtain patent licenses, in effect making the |
|
| 53 |
-program proprietary. To prevent this, we have made it clear that any |
|
| 54 |
-patent must be licensed for everyone's free use or not licensed at all. |
|
| 55 |
- |
|
| 56 |
- The precise terms and conditions for copying, distribution and |
|
| 57 |
-modification follow. |
|
| 58 |
- |
|
| 59 |
- GNU GENERAL PUBLIC LICENSE |
|
| 60 |
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION |
|
| 61 |
- |
|
| 62 |
- 0. This License applies to any program or other work which contains |
|
| 63 |
-a notice placed by the copyright holder saying it may be distributed |
|
| 64 |
-under the terms of this General Public License. The "Program", below, |
|
| 65 |
-refers to any such program or work, and a "work based on the Program" |
|
| 66 |
-means either the Program or any derivative work under copyright law: |
|
| 67 |
-that is to say, a work containing the Program or a portion of it, |
|
| 68 |
-either verbatim or with modifications and/or translated into another |
|
| 69 |
-language. (Hereinafter, translation is included without limitation in |
|
| 70 |
-the term "modification".) Each licensee is addressed as "you". |
|
| 71 |
- |
|
| 72 |
-Activities other than copying, distribution and modification are not |
|
| 73 |
-covered by this License; they are outside its scope. The act of |
|
| 74 |
-running the Program is not restricted, and the output from the Program |
|
| 75 |
-is covered only if its contents constitute a work based on the |
|
| 76 |
-Program (independent of having been made by running the Program). |
|
| 77 |
-Whether that is true depends on what the Program does. |
|
| 78 |
- |
|
| 79 |
- 1. You may copy and distribute verbatim copies of the Program's |
|
| 80 |
-source code as you receive it, in any medium, provided that you |
|
| 81 |
-conspicuously and appropriately publish on each copy an appropriate |
|
| 82 |
-copyright notice and disclaimer of warranty; keep intact all the |
|
| 83 |
-notices that refer to this License and to the absence of any warranty; |
|
| 84 |
-and give any other recipients of the Program a copy of this License |
|
| 85 |
-along with the Program. |
|
| 86 |
- |
|
| 87 |
-You may charge a fee for the physical act of transferring a copy, and |
|
| 88 |
-you may at your option offer warranty protection in exchange for a fee. |
|
| 89 |
- |
|
| 90 |
- 2. You may modify your copy or copies of the Program or any portion |
|
| 91 |
-of it, thus forming a work based on the Program, and copy and |
|
| 92 |
-distribute such modifications or work under the terms of Section 1 |
|
| 93 |
-above, provided that you also meet all of these conditions: |
|
| 94 |
- |
|
| 95 |
- a) You must cause the modified files to carry prominent notices |
|
| 96 |
- stating that you changed the files and the date of any change. |
|
| 97 |
- |
|
| 98 |
- b) You must cause any work that you distribute or publish, that in |
|
| 99 |
- whole or in part contains or is derived from the Program or any |
|
| 100 |
- part thereof, to be licensed as a whole at no charge to all third |
|
| 101 |
- parties under the terms of this License. |
|
| 102 |
- |
|
| 103 |
- c) If the modified program normally reads commands interactively |
|
| 104 |
- when run, you must cause it, when started running for such |
|
| 105 |
- interactive use in the most ordinary way, to print or display an |
|
| 106 |
- announcement including an appropriate copyright notice and a |
|
| 107 |
- notice that there is no warranty (or else, saying that you provide |
|
| 108 |
- a warranty) and that users may redistribute the program under |
|
| 109 |
- these conditions, and telling the user how to view a copy of this |
|
| 110 |
- License. (Exception: if the Program itself is interactive but |
|
| 111 |
- does not normally print such an announcement, your work based on |
|
| 112 |
- the Program is not required to print an announcement.) |
|
| 113 |
- |
|
| 114 |
-These requirements apply to the modified work as a whole. If |
|
| 115 |
-identifiable sections of that work are not derived from the Program, |
|
| 116 |
-and can be reasonably considered independent and separate works in |
|
| 117 |
-themselves, then this License, and its terms, do not apply to those |
|
| 118 |
-sections when you distribute them as separate works. But when you |
|
| 119 |
-distribute the same sections as part of a whole which is a work based |
|
| 120 |
-on the Program, the distribution of the whole must be on the terms of |
|
| 121 |
-this License, whose permissions for other licensees extend to the |
|
| 122 |
-entire whole, and thus to each and every part regardless of who wrote it. |
|
| 123 |
- |
|
| 124 |
-Thus, it is not the intent of this section to claim rights or contest |
|
| 125 |
-your rights to work written entirely by you; rather, the intent is to |
|
| 126 |
-exercise the right to control the distribution of derivative or |
|
| 127 |
-collective works based on the Program. |
|
| 128 |
- |
|
| 129 |
-In addition, mere aggregation of another work not based on the Program |
|
| 130 |
-with the Program (or with a work based on the Program) on a volume of |
|
| 131 |
-a storage or distribution medium does not bring the other work under |
|
| 132 |
-the scope of this License. |
|
| 133 |
- |
|
| 134 |
- 3. You may copy and distribute the Program (or a work based on it, |
|
| 135 |
-under Section 2) in object code or executable form under the terms of |
|
| 136 |
-Sections 1 and 2 above provided that you also do one of the following: |
|
| 137 |
- |
|
| 138 |
- a) Accompany it with the complete corresponding machine-readable |
|
| 139 |
- source code, which must be distributed under the terms of Sections |
|
| 140 |
- 1 and 2 above on a medium customarily used for software interchange; or, |
|
| 141 |
- |
|
| 142 |
- b) Accompany it with a written offer, valid for at least three |
|
| 143 |
- years, to give any third party, for a charge no more than your |
|
| 144 |
- cost of physically performing source distribution, a complete |
|
| 145 |
- machine-readable copy of the corresponding source code, to be |
|
| 146 |
- distributed under the terms of Sections 1 and 2 above on a medium |
|
| 147 |
- customarily used for software interchange; or, |
|
| 148 |
- |
|
| 149 |
- c) Accompany it with the information you received as to the offer |
|
| 150 |
- to distribute corresponding source code. (This alternative is |
|
| 151 |
- allowed only for noncommercial distribution and only if you |
|
| 152 |
- received the program in object code or executable form with such |
|
| 153 |
- an offer, in accord with Subsection b above.) |
|
| 154 |
- |
|
| 155 |
-The source code for a work means the preferred form of the work for |
|
| 156 |
-making modifications to it. For an executable work, complete source |
|
| 157 |
-code means all the source code for all modules it contains, plus any |
|
| 158 |
-associated interface definition files, plus the scripts used to |
|
| 159 |
-control compilation and installation of the executable. However, as a |
|
| 160 |
-special exception, the source code distributed need not include |
|
| 161 |
-anything that is normally distributed (in either source or binary |
|
| 162 |
-form) with the major components (compiler, kernel, and so on) of the |
|
| 163 |
-operating system on which the executable runs, unless that component |
|
| 164 |
-itself accompanies the executable. |
|
| 165 |
- |
|
| 166 |
-If distribution of executable or object code is made by offering |
|
| 167 |
-access to copy from a designated place, then offering equivalent |
|
| 168 |
-access to copy the source code from the same place counts as |
|
| 169 |
-distribution of the source code, even though third parties are not |
|
| 170 |
-compelled to copy the source along with the object code. |
|
| 171 |
- |
|
| 172 |
- 4. You may not copy, modify, sublicense, or distribute the Program |
|
| 173 |
-except as expressly provided under this License. Any attempt |
|
| 174 |
-otherwise to copy, modify, sublicense or distribute the Program is |
|
| 175 |
-void, and will automatically terminate your rights under this License. |
|
| 176 |
-However, parties who have received copies, or rights, from you under |
|
| 177 |
-this License will not have their licenses terminated so long as such |
|
| 178 |
-parties remain in full compliance. |
|
| 179 |
- |
|
| 180 |
- 5. You are not required to accept this License, since you have not |
|
| 181 |
-signed it. However, nothing else grants you permission to modify or |
|
| 182 |
-distribute the Program or its derivative works. These actions are |
|
| 183 |
-prohibited by law if you do not accept this License. Therefore, by |
|
| 184 |
-modifying or distributing the Program (or any work based on the |
|
| 185 |
-Program), you indicate your acceptance of this License to do so, and |
|
| 186 |
-all its terms and conditions for copying, distributing or modifying |
|
| 187 |
-the Program or works based on it. |
|
| 188 |
- |
|
| 189 |
- 6. Each time you redistribute the Program (or any work based on the |
|
| 190 |
-Program), the recipient automatically receives a license from the |
|
| 191 |
-original licensor to copy, distribute or modify the Program subject to |
|
| 192 |
-these terms and conditions. You may not impose any further |
|
| 193 |
-restrictions on the recipients' exercise of the rights granted herein. |
|
| 194 |
-You are not responsible for enforcing compliance by third parties to |
|
| 195 |
-this License. |
|
| 196 |
- |
|
| 197 |
- 7. If, as a consequence of a court judgment or allegation of patent |
|
| 198 |
-infringement or for any other reason (not limited to patent issues), |
|
| 199 |
-conditions are imposed on you (whether by court order, agreement or |
|
| 200 |
-otherwise) that contradict the conditions of this License, they do not |
|
| 201 |
-excuse you from the conditions of this License. If you cannot |
|
| 202 |
-distribute so as to satisfy simultaneously your obligations under this |
|
| 203 |
-License and any other pertinent obligations, then as a consequence you |
|
| 204 |
-may not distribute the Program at all. For example, if a patent |
|
| 205 |
-license would not permit royalty-free redistribution of the Program by |
|
| 206 |
-all those who receive copies directly or indirectly through you, then |
|
| 207 |
-the only way you could satisfy both it and this License would be to |
|
| 208 |
-refrain entirely from distribution of the Program. |
|
| 209 |
- |
|
| 210 |
-If any portion of this section is held invalid or unenforceable under |
|
| 211 |
-any particular circumstance, the balance of the section is intended to |
|
| 212 |
-apply and the section as a whole is intended to apply in other |
|
| 213 |
-circumstances. |
|
| 214 |
- |
|
| 215 |
-It is not the purpose of this section to induce you to infringe any |
|
| 216 |
-patents or other property right claims or to contest validity of any |
|
| 217 |
-such claims; this section has the sole purpose of protecting the |
|
| 218 |
-integrity of the free software distribution system, which is |
|
| 219 |
-implemented by public license practices. Many people have made |
|
| 220 |
-generous contributions to the wide range of software distributed |
|
| 221 |
-through that system in reliance on consistent application of that |
|
| 222 |
-system; it is up to the author/donor to decide if he or she is willing |
|
| 223 |
-to distribute software through any other system and a licensee cannot |
|
| 224 |
-impose that choice. |
|
| 225 |
- |
|
| 226 |
-This section is intended to make thoroughly clear what is believed to |
|
| 227 |
-be a consequence of the rest of this License. |
|
| 228 |
- |
|
| 229 |
- 8. If the distribution and/or use of the Program is restricted in |
|
| 230 |
-certain countries either by patents or by copyrighted interfaces, the |
|
| 231 |
-original copyright holder who places the Program under this License |
|
| 232 |
-may add an explicit geographical distribution limitation excluding |
|
| 233 |
-those countries, so that distribution is permitted only in or among |
|
| 234 |
-countries not thus excluded. In such case, this License incorporates |
|
| 235 |
-the limitation as if written in the body of this License. |
|
| 236 |
- |
|
| 237 |
- 9. The Free Software Foundation may publish revised and/or new versions |
|
| 238 |
-of the General Public License from time to time. Such new versions will |
|
| 239 |
-be similar in spirit to the present version, but may differ in detail to |
|
| 240 |
-address new problems or concerns. |
|
| 241 |
- |
|
| 242 |
-Each version is given a distinguishing version number. If the Program |
|
| 243 |
-specifies a version number of this License which applies to it and "any |
|
| 244 |
-later version", you have the option of following the terms and conditions |
|
| 245 |
-either of that version or of any later version published by the Free |
|
| 246 |
-Software Foundation. If the Program does not specify a version number of |
|
| 247 |
-this License, you may choose any version ever published by the Free Software |
|
| 248 |
-Foundation. |
|
| 249 |
- |
|
| 250 |
- 10. If you wish to incorporate parts of the Program into other free |
|
| 251 |
-programs whose distribution conditions are different, write to the author |
|
| 252 |
-to ask for permission. For software which is copyrighted by the Free |
|
| 253 |
-Software Foundation, write to the Free Software Foundation; we sometimes |
|
| 254 |
-make exceptions for this. Our decision will be guided by the two goals |
|
| 255 |
-of preserving the free status of all derivatives of our free software and |
|
| 256 |
-of promoting the sharing and reuse of software generally. |
|
| 257 |
- |
|
| 258 |
- NO WARRANTY |
|
| 259 |
- |
|
| 260 |
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY |
|
| 261 |
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN |
|
| 262 |
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES |
|
| 263 |
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED |
|
| 264 |
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
|
| 265 |
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS |
|
| 266 |
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE |
|
| 267 |
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, |
|
| 268 |
-REPAIR OR CORRECTION. |
|
| 269 |
- |
|
| 270 |
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
|
| 271 |
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR |
|
| 272 |
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, |
|
| 273 |
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING |
|
| 274 |
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED |
|
| 275 |
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY |
|
| 276 |
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER |
|
| 277 |
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE |
|
| 278 |
-POSSIBILITY OF SUCH DAMAGES. |
|
| 279 |
- |
|
| 280 |
- END OF TERMS AND CONDITIONS |
|
| 281 |
- |
|
| 282 |
- How to Apply These Terms to Your New Programs |
|
| 283 |
- |
|
| 284 |
- If you develop a new program, and you want it to be of the greatest |
|
| 285 |
-possible use to the public, the best way to achieve this is to make it |
|
| 286 |
-free software which everyone can redistribute and change under these terms. |
|
| 287 |
- |
|
| 288 |
- To do so, attach the following notices to the program. It is safest |
|
| 289 |
-to attach them to the start of each source file to most effectively |
|
| 290 |
-convey the exclusion of warranty; and each file should have at least |
|
| 291 |
-the "copyright" line and a pointer to where the full notice is found. |
|
| 292 |
- |
|
| 293 |
- <one line to give the program's name and a brief idea of what it does.> |
|
| 294 |
- Copyright (C) <year> <name of author> |
|
| 295 |
- |
|
| 296 |
- This program is free software; you can redistribute it and/or modify |
|
| 297 |
- it under the terms of the GNU General Public License as published by |
|
| 298 |
- the Free Software Foundation; either version 2 of the License, or |
|
| 299 |
- (at your option) any later version. |
|
| 300 |
- |
|
| 301 |
- This program is distributed in the hope that it will be useful, |
|
| 302 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 303 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 304 |
- GNU General Public License for more details. |
|
| 305 |
- |
|
| 306 |
- You should have received a copy of the GNU General Public License |
|
| 307 |
- along with this program; if not, write to the Free Software |
|
| 308 |
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
| 309 |
- |
|
| 310 |
- |
|
| 311 |
-Also add information on how to contact you by electronic and paper mail. |
|
| 312 |
- |
|
| 313 |
-If the program is interactive, make it output a short notice like this |
|
| 314 |
-when it starts in an interactive mode: |
|
| 315 |
- |
|
| 316 |
- Gnomovision version 69, Copyright (C) year name of author |
|
| 317 |
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. |
|
| 318 |
- This is free software, and you are welcome to redistribute it |
|
| 319 |
- under certain conditions; type `show c' for details. |
|
| 320 |
- |
|
| 321 |
-The hypothetical commands `show w' and `show c' should show the appropriate |
|
| 322 |
-parts of the General Public License. Of course, the commands you use may |
|
| 323 |
-be called something other than `show w' and `show c'; they could even be |
|
| 324 |
-mouse-clicks or menu items--whatever suits your program. |
|
| 325 |
- |
|
| 326 |
-You should also get your employer (if you work as a programmer) or your |
|
| 327 |
-school, if any, to sign a "copyright disclaimer" for the program, if |
|
| 328 |
-necessary. Here is a sample; alter the names: |
|
| 329 |
- |
|
| 330 |
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program |
|
| 331 |
- `Gnomovision' (which makes passes at compilers) written by James Hacker. |
|
| 332 |
- |
|
| 333 |
- <signature of Ty Coon>, 1 April 1989 |
|
| 334 |
- Ty Coon, President of Vice |
|
| 335 |
- |
|
| 336 |
-This General Public License does not permit incorporating your program into |
|
| 337 |
-proprietary programs. If your program is a subroutine library, you may |
|
| 338 |
-consider it more useful to permit linking proprietary applications with the |
|
| 339 |
-library. If this is what you want to do, use the GNU Library General |
|
| 340 |
-Public License instead of this License. |
| 341 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,16 +0,0 @@ |
| 1 |
-TARGETS?=docker |
|
| 2 |
-MODULES?=${TARGETS:=.pp.bz2}
|
|
| 3 |
-SHAREDIR?=/usr/share |
|
| 4 |
- |
|
| 5 |
-all: ${TARGETS:=.pp.bz2}
|
|
| 6 |
- |
|
| 7 |
-%.pp.bz2: %.pp |
|
| 8 |
- @echo Compressing $^ -\> $@ |
|
| 9 |
- bzip2 -9 $^ |
|
| 10 |
- |
|
| 11 |
-%.pp: %.te |
|
| 12 |
- make -f ${SHAREDIR}/selinux/devel/Makefile $@
|
|
| 13 |
- |
|
| 14 |
-clean: |
|
| 15 |
- rm -f *~ *.tc *.pp *.pp.bz2 |
|
| 16 |
- rm -rf tmp *.tar.gz |
| 17 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,20 +0,0 @@ |
| 1 |
-/root/\.docker gen_context(system_u:object_r:docker_home_t,s0) |
|
| 2 |
- |
|
| 3 |
-/usr/bin/dockerd -- gen_context(system_u:object_r:docker_exec_t,s0) |
|
| 4 |
- |
|
| 5 |
-/usr/lib/systemd/system/docker.service -- gen_context(system_u:object_r:docker_unit_file_t,s0) |
|
| 6 |
- |
|
| 7 |
-/etc/docker(/.*)? gen_context(system_u:object_r:docker_config_t,s0) |
|
| 8 |
- |
|
| 9 |
-/var/lib/docker(/.*)? gen_context(system_u:object_r:docker_var_lib_t,s0) |
|
| 10 |
-/var/lib/kublet(/.*)? gen_context(system_u:object_r:docker_var_lib_t,s0) |
|
| 11 |
-/var/lib/docker/vfs(/.*)? gen_context(system_u:object_r:svirt_sandbox_file_t,s0) |
|
| 12 |
- |
|
| 13 |
-/var/run/docker\.pid -- gen_context(system_u:object_r:docker_var_run_t,s0) |
|
| 14 |
-/var/run/docker\.sock -s gen_context(system_u:object_r:docker_var_run_t,s0) |
|
| 15 |
-/var/run/docker-client(/.*)? gen_context(system_u:object_r:docker_var_run_t,s0) |
|
| 16 |
- |
|
| 17 |
-/var/lib/docker/init(/.*)? gen_context(system_u:object_r:docker_share_t,s0) |
|
| 18 |
-/var/lib/docker/containers/.*/hosts gen_context(system_u:object_r:docker_share_t,s0) |
|
| 19 |
-/var/lib/docker/containers/.*/hostname gen_context(system_u:object_r:docker_share_t,s0) |
|
| 20 |
-/var/lib/docker/.*/config\.env gen_context(system_u:object_r:docker_share_t,s0) |
| 21 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,461 +0,0 @@ |
| 1 |
- |
|
| 2 |
-## <summary>The open-source application container engine.</summary> |
|
| 3 |
- |
|
| 4 |
-######################################## |
|
| 5 |
-## <summary> |
|
| 6 |
-## Execute docker in the docker domain. |
|
| 7 |
-## </summary> |
|
| 8 |
-## <param name="domain"> |
|
| 9 |
-## <summary> |
|
| 10 |
-## Domain allowed to transition. |
|
| 11 |
-## </summary> |
|
| 12 |
-## </param> |
|
| 13 |
-# |
|
| 14 |
-interface(`docker_domtrans',` |
|
| 15 |
- gen_require(` |
|
| 16 |
- type docker_t, docker_exec_t; |
|
| 17 |
- ') |
|
| 18 |
- |
|
| 19 |
- corecmd_search_bin($1) |
|
| 20 |
- domtrans_pattern($1, docker_exec_t, docker_t) |
|
| 21 |
-') |
|
| 22 |
- |
|
| 23 |
-######################################## |
|
| 24 |
-## <summary> |
|
| 25 |
-## Execute docker in the caller domain. |
|
| 26 |
-## </summary> |
|
| 27 |
-## <param name="domain"> |
|
| 28 |
-## <summary> |
|
| 29 |
-## Domain allowed to transition. |
|
| 30 |
-## </summary> |
|
| 31 |
-## </param> |
|
| 32 |
-# |
|
| 33 |
-interface(`docker_exec',` |
|
| 34 |
- gen_require(` |
|
| 35 |
- type docker_exec_t; |
|
| 36 |
- ') |
|
| 37 |
- |
|
| 38 |
- corecmd_search_bin($1) |
|
| 39 |
- can_exec($1, docker_exec_t) |
|
| 40 |
-') |
|
| 41 |
- |
|
| 42 |
-######################################## |
|
| 43 |
-## <summary> |
|
| 44 |
-## Search docker lib directories. |
|
| 45 |
-## </summary> |
|
| 46 |
-## <param name="domain"> |
|
| 47 |
-## <summary> |
|
| 48 |
-## Domain allowed access. |
|
| 49 |
-## </summary> |
|
| 50 |
-## </param> |
|
| 51 |
-# |
|
| 52 |
-interface(`docker_search_lib',` |
|
| 53 |
- gen_require(` |
|
| 54 |
- type docker_var_lib_t; |
|
| 55 |
- ') |
|
| 56 |
- |
|
| 57 |
- allow $1 docker_var_lib_t:dir search_dir_perms; |
|
| 58 |
- files_search_var_lib($1) |
|
| 59 |
-') |
|
| 60 |
- |
|
| 61 |
-######################################## |
|
| 62 |
-## <summary> |
|
| 63 |
-## Execute docker lib directories. |
|
| 64 |
-## </summary> |
|
| 65 |
-## <param name="domain"> |
|
| 66 |
-## <summary> |
|
| 67 |
-## Domain allowed access. |
|
| 68 |
-## </summary> |
|
| 69 |
-## </param> |
|
| 70 |
-# |
|
| 71 |
-interface(`docker_exec_lib',` |
|
| 72 |
- gen_require(` |
|
| 73 |
- type docker_var_lib_t; |
|
| 74 |
- ') |
|
| 75 |
- |
|
| 76 |
- allow $1 docker_var_lib_t:dir search_dir_perms; |
|
| 77 |
- can_exec($1, docker_var_lib_t) |
|
| 78 |
-') |
|
| 79 |
- |
|
| 80 |
-######################################## |
|
| 81 |
-## <summary> |
|
| 82 |
-## Read docker lib files. |
|
| 83 |
-## </summary> |
|
| 84 |
-## <param name="domain"> |
|
| 85 |
-## <summary> |
|
| 86 |
-## Domain allowed access. |
|
| 87 |
-## </summary> |
|
| 88 |
-## </param> |
|
| 89 |
-# |
|
| 90 |
-interface(`docker_read_lib_files',` |
|
| 91 |
- gen_require(` |
|
| 92 |
- type docker_var_lib_t; |
|
| 93 |
- ') |
|
| 94 |
- |
|
| 95 |
- files_search_var_lib($1) |
|
| 96 |
- read_files_pattern($1, docker_var_lib_t, docker_var_lib_t) |
|
| 97 |
-') |
|
| 98 |
- |
|
| 99 |
-######################################## |
|
| 100 |
-## <summary> |
|
| 101 |
-## Read docker share files. |
|
| 102 |
-## </summary> |
|
| 103 |
-## <param name="domain"> |
|
| 104 |
-## <summary> |
|
| 105 |
-## Domain allowed access. |
|
| 106 |
-## </summary> |
|
| 107 |
-## </param> |
|
| 108 |
-# |
|
| 109 |
-interface(`docker_read_share_files',` |
|
| 110 |
- gen_require(` |
|
| 111 |
- type docker_share_t; |
|
| 112 |
- ') |
|
| 113 |
- |
|
| 114 |
- files_search_var_lib($1) |
|
| 115 |
- read_files_pattern($1, docker_share_t, docker_share_t) |
|
| 116 |
-') |
|
| 117 |
- |
|
| 118 |
-######################################## |
|
| 119 |
-## <summary> |
|
| 120 |
-## Manage docker lib files. |
|
| 121 |
-## </summary> |
|
| 122 |
-## <param name="domain"> |
|
| 123 |
-## <summary> |
|
| 124 |
-## Domain allowed access. |
|
| 125 |
-## </summary> |
|
| 126 |
-## </param> |
|
| 127 |
-# |
|
| 128 |
-interface(`docker_manage_lib_files',` |
|
| 129 |
- gen_require(` |
|
| 130 |
- type docker_var_lib_t; |
|
| 131 |
- ') |
|
| 132 |
- |
|
| 133 |
- files_search_var_lib($1) |
|
| 134 |
- manage_files_pattern($1, docker_var_lib_t, docker_var_lib_t) |
|
| 135 |
- manage_lnk_files_pattern($1, docker_var_lib_t, docker_var_lib_t) |
|
| 136 |
-') |
|
| 137 |
- |
|
| 138 |
-######################################## |
|
| 139 |
-## <summary> |
|
| 140 |
-## Manage docker lib directories. |
|
| 141 |
-## </summary> |
|
| 142 |
-## <param name="domain"> |
|
| 143 |
-## <summary> |
|
| 144 |
-## Domain allowed access. |
|
| 145 |
-## </summary> |
|
| 146 |
-## </param> |
|
| 147 |
-# |
|
| 148 |
-interface(`docker_manage_lib_dirs',` |
|
| 149 |
- gen_require(` |
|
| 150 |
- type docker_var_lib_t; |
|
| 151 |
- ') |
|
| 152 |
- |
|
| 153 |
- files_search_var_lib($1) |
|
| 154 |
- manage_dirs_pattern($1, docker_var_lib_t, docker_var_lib_t) |
|
| 155 |
-') |
|
| 156 |
- |
|
| 157 |
-######################################## |
|
| 158 |
-## <summary> |
|
| 159 |
-## Create objects in a docker var lib directory |
|
| 160 |
-## with an automatic type transition to |
|
| 161 |
-## a specified private type. |
|
| 162 |
-## </summary> |
|
| 163 |
-## <param name="domain"> |
|
| 164 |
-## <summary> |
|
| 165 |
-## Domain allowed access. |
|
| 166 |
-## </summary> |
|
| 167 |
-## </param> |
|
| 168 |
-## <param name="private_type"> |
|
| 169 |
-## <summary> |
|
| 170 |
-## The type of the object to create. |
|
| 171 |
-## </summary> |
|
| 172 |
-## </param> |
|
| 173 |
-## <param name="object_class"> |
|
| 174 |
-## <summary> |
|
| 175 |
-## The class of the object to be created. |
|
| 176 |
-## </summary> |
|
| 177 |
-## </param> |
|
| 178 |
-## <param name="name" optional="true"> |
|
| 179 |
-## <summary> |
|
| 180 |
-## The name of the object being created. |
|
| 181 |
-## </summary> |
|
| 182 |
-## </param> |
|
| 183 |
-# |
|
| 184 |
-interface(`docker_lib_filetrans',` |
|
| 185 |
- gen_require(` |
|
| 186 |
- type docker_var_lib_t; |
|
| 187 |
- ') |
|
| 188 |
- |
|
| 189 |
- filetrans_pattern($1, docker_var_lib_t, $2, $3, $4) |
|
| 190 |
-') |
|
| 191 |
- |
|
| 192 |
-######################################## |
|
| 193 |
-## <summary> |
|
| 194 |
-## Read docker PID files. |
|
| 195 |
-## </summary> |
|
| 196 |
-## <param name="domain"> |
|
| 197 |
-## <summary> |
|
| 198 |
-## Domain allowed access. |
|
| 199 |
-## </summary> |
|
| 200 |
-## </param> |
|
| 201 |
-# |
|
| 202 |
-interface(`docker_read_pid_files',` |
|
| 203 |
- gen_require(` |
|
| 204 |
- type docker_var_run_t; |
|
| 205 |
- ') |
|
| 206 |
- |
|
| 207 |
- files_search_pids($1) |
|
| 208 |
- read_files_pattern($1, docker_var_run_t, docker_var_run_t) |
|
| 209 |
-') |
|
| 210 |
- |
|
| 211 |
-######################################## |
|
| 212 |
-## <summary> |
|
| 213 |
-## Execute docker server in the docker domain. |
|
| 214 |
-## </summary> |
|
| 215 |
-## <param name="domain"> |
|
| 216 |
-## <summary> |
|
| 217 |
-## Domain allowed to transition. |
|
| 218 |
-## </summary> |
|
| 219 |
-## </param> |
|
| 220 |
-# |
|
| 221 |
-interface(`docker_systemctl',` |
|
| 222 |
- gen_require(` |
|
| 223 |
- type docker_t; |
|
| 224 |
- type docker_unit_file_t; |
|
| 225 |
- ') |
|
| 226 |
- |
|
| 227 |
- systemd_exec_systemctl($1) |
|
| 228 |
- init_reload_services($1) |
|
| 229 |
- systemd_read_fifo_file_passwd_run($1) |
|
| 230 |
- allow $1 docker_unit_file_t:file read_file_perms; |
|
| 231 |
- allow $1 docker_unit_file_t:service manage_service_perms; |
|
| 232 |
- |
|
| 233 |
- ps_process_pattern($1, docker_t) |
|
| 234 |
-') |
|
| 235 |
- |
|
| 236 |
-######################################## |
|
| 237 |
-## <summary> |
|
| 238 |
-## Read and write docker shared memory. |
|
| 239 |
-## </summary> |
|
| 240 |
-## <param name="domain"> |
|
| 241 |
-## <summary> |
|
| 242 |
-## Domain allowed access. |
|
| 243 |
-## </summary> |
|
| 244 |
-## </param> |
|
| 245 |
-# |
|
| 246 |
-interface(`docker_rw_sem',` |
|
| 247 |
- gen_require(` |
|
| 248 |
- type docker_t; |
|
| 249 |
- ') |
|
| 250 |
- |
|
| 251 |
- allow $1 docker_t:sem rw_sem_perms; |
|
| 252 |
-') |
|
| 253 |
- |
|
| 254 |
-####################################### |
|
| 255 |
-## <summary> |
|
| 256 |
-## Read and write the docker pty type. |
|
| 257 |
-## </summary> |
|
| 258 |
-## <param name="domain"> |
|
| 259 |
-## <summary> |
|
| 260 |
-## Domain allowed access. |
|
| 261 |
-## </summary> |
|
| 262 |
-## </param> |
|
| 263 |
-# |
|
| 264 |
-interface(`docker_use_ptys',` |
|
| 265 |
- gen_require(` |
|
| 266 |
- type docker_devpts_t; |
|
| 267 |
- ') |
|
| 268 |
- |
|
| 269 |
- allow $1 docker_devpts_t:chr_file rw_term_perms; |
|
| 270 |
-') |
|
| 271 |
- |
|
| 272 |
-####################################### |
|
| 273 |
-## <summary> |
|
| 274 |
-## Allow domain to create docker content |
|
| 275 |
-## </summary> |
|
| 276 |
-## <param name="domain"> |
|
| 277 |
-## <summary> |
|
| 278 |
-## Domain allowed access. |
|
| 279 |
-## </summary> |
|
| 280 |
-## </param> |
|
| 281 |
-# |
|
| 282 |
-interface(`docker_filetrans_named_content',` |
|
| 283 |
- |
|
| 284 |
- gen_require(` |
|
| 285 |
- type docker_var_lib_t; |
|
| 286 |
- type docker_share_t; |
|
| 287 |
- type docker_log_t; |
|
| 288 |
- type docker_var_run_t; |
|
| 289 |
- type docker_home_t; |
|
| 290 |
- ') |
|
| 291 |
- |
|
| 292 |
- files_pid_filetrans($1, docker_var_run_t, file, "docker.pid") |
|
| 293 |
- files_pid_filetrans($1, docker_var_run_t, sock_file, "docker.sock") |
|
| 294 |
- files_pid_filetrans($1, docker_var_run_t, dir, "docker-client") |
|
| 295 |
- files_var_lib_filetrans($1, docker_var_lib_t, dir, "docker") |
|
| 296 |
- filetrans_pattern($1, docker_var_lib_t, docker_share_t, file, "config.env") |
|
| 297 |
- filetrans_pattern($1, docker_var_lib_t, docker_share_t, file, "hosts") |
|
| 298 |
- filetrans_pattern($1, docker_var_lib_t, docker_share_t, file, "hostname") |
|
| 299 |
- filetrans_pattern($1, docker_var_lib_t, docker_share_t, file, "resolv.conf") |
|
| 300 |
- filetrans_pattern($1, docker_var_lib_t, docker_share_t, dir, "init") |
|
| 301 |
- userdom_admin_home_dir_filetrans($1, docker_home_t, dir, ".docker") |
|
| 302 |
-') |
|
| 303 |
- |
|
| 304 |
-######################################## |
|
| 305 |
-## <summary> |
|
| 306 |
-## Connect to docker over a unix stream socket. |
|
| 307 |
-## </summary> |
|
| 308 |
-## <param name="domain"> |
|
| 309 |
-## <summary> |
|
| 310 |
-## Domain allowed access. |
|
| 311 |
-## </summary> |
|
| 312 |
-## </param> |
|
| 313 |
-# |
|
| 314 |
-interface(`docker_stream_connect',` |
|
| 315 |
- gen_require(` |
|
| 316 |
- type docker_t, docker_var_run_t; |
|
| 317 |
- ') |
|
| 318 |
- |
|
| 319 |
- files_search_pids($1) |
|
| 320 |
- stream_connect_pattern($1, docker_var_run_t, docker_var_run_t, docker_t) |
|
| 321 |
-') |
|
| 322 |
- |
|
| 323 |
-######################################## |
|
| 324 |
-## <summary> |
|
| 325 |
-## Connect to SPC containers over a unix stream socket. |
|
| 326 |
-## </summary> |
|
| 327 |
-## <param name="domain"> |
|
| 328 |
-## <summary> |
|
| 329 |
-## Domain allowed access. |
|
| 330 |
-## </summary> |
|
| 331 |
-## </param> |
|
| 332 |
-# |
|
| 333 |
-interface(`docker_spc_stream_connect',` |
|
| 334 |
- gen_require(` |
|
| 335 |
- type spc_t, spc_var_run_t; |
|
| 336 |
- ') |
|
| 337 |
- |
|
| 338 |
- files_search_pids($1) |
|
| 339 |
- files_write_all_pid_sockets($1) |
|
| 340 |
- allow $1 spc_t:unix_stream_socket connectto; |
|
| 341 |
-') |
|
| 342 |
- |
|
| 343 |
- |
|
| 344 |
-######################################## |
|
| 345 |
-## <summary> |
|
| 346 |
-## All of the rules required to administrate |
|
| 347 |
-## an docker environment |
|
| 348 |
-## </summary> |
|
| 349 |
-## <param name="domain"> |
|
| 350 |
-## <summary> |
|
| 351 |
-## Domain allowed access. |
|
| 352 |
-## </summary> |
|
| 353 |
-## </param> |
|
| 354 |
-# |
|
| 355 |
-interface(`docker_admin',` |
|
| 356 |
- gen_require(` |
|
| 357 |
- type docker_t; |
|
| 358 |
- type docker_var_lib_t, docker_var_run_t; |
|
| 359 |
- type docker_unit_file_t; |
|
| 360 |
- type docker_lock_t; |
|
| 361 |
- type docker_log_t; |
|
| 362 |
- type docker_config_t; |
|
| 363 |
- ') |
|
| 364 |
- |
|
| 365 |
- allow $1 docker_t:process { ptrace signal_perms };
|
|
| 366 |
- ps_process_pattern($1, docker_t) |
|
| 367 |
- |
|
| 368 |
- admin_pattern($1, docker_config_t) |
|
| 369 |
- |
|
| 370 |
- files_search_var_lib($1) |
|
| 371 |
- admin_pattern($1, docker_var_lib_t) |
|
| 372 |
- |
|
| 373 |
- files_search_pids($1) |
|
| 374 |
- admin_pattern($1, docker_var_run_t) |
|
| 375 |
- |
|
| 376 |
- files_search_locks($1) |
|
| 377 |
- admin_pattern($1, docker_lock_t) |
|
| 378 |
- |
|
| 379 |
- logging_search_logs($1) |
|
| 380 |
- admin_pattern($1, docker_log_t) |
|
| 381 |
- |
|
| 382 |
- docker_systemctl($1) |
|
| 383 |
- admin_pattern($1, docker_unit_file_t) |
|
| 384 |
- allow $1 docker_unit_file_t:service all_service_perms; |
|
| 385 |
- |
|
| 386 |
- optional_policy(` |
|
| 387 |
- systemd_passwd_agent_exec($1) |
|
| 388 |
- systemd_read_fifo_file_passwd_run($1) |
|
| 389 |
- ') |
|
| 390 |
-') |
|
| 391 |
- |
|
| 392 |
-interface(`domain_stub_named_filetrans_domain',` |
|
| 393 |
- gen_require(` |
|
| 394 |
- attribute named_filetrans_domain; |
|
| 395 |
- ') |
|
| 396 |
-') |
|
| 397 |
- |
|
| 398 |
-interface(`lvm_stub',` |
|
| 399 |
- gen_require(` |
|
| 400 |
- type lvm_t; |
|
| 401 |
- ') |
|
| 402 |
-') |
|
| 403 |
-interface(`staff_stub',` |
|
| 404 |
- gen_require(` |
|
| 405 |
- type staff_t; |
|
| 406 |
- ') |
|
| 407 |
-') |
|
| 408 |
-interface(`virt_stub_svirt_sandbox_domain',` |
|
| 409 |
- gen_require(` |
|
| 410 |
- attribute svirt_sandbox_domain; |
|
| 411 |
- ') |
|
| 412 |
-') |
|
| 413 |
-interface(`virt_stub_svirt_sandbox_file',` |
|
| 414 |
- gen_require(` |
|
| 415 |
- type svirt_sandbox_file_t; |
|
| 416 |
- ') |
|
| 417 |
-') |
|
| 418 |
-interface(`fs_dontaudit_remount_tmpfs',` |
|
| 419 |
- gen_require(` |
|
| 420 |
- type tmpfs_t; |
|
| 421 |
- ') |
|
| 422 |
- |
|
| 423 |
- dontaudit $1 tmpfs_t:filesystem remount; |
|
| 424 |
-') |
|
| 425 |
-interface(`dev_dontaudit_list_all_dev_nodes',` |
|
| 426 |
- gen_require(` |
|
| 427 |
- type device_t; |
|
| 428 |
- ') |
|
| 429 |
- |
|
| 430 |
- dontaudit $1 device_t:dir list_dir_perms; |
|
| 431 |
-') |
|
| 432 |
-interface(`kernel_unlabeled_entry_type',` |
|
| 433 |
- gen_require(` |
|
| 434 |
- type unlabeled_t; |
|
| 435 |
- ') |
|
| 436 |
- |
|
| 437 |
- domain_entry_file($1, unlabeled_t) |
|
| 438 |
-') |
|
| 439 |
-interface(`kernel_unlabeled_domtrans',` |
|
| 440 |
- gen_require(` |
|
| 441 |
- type unlabeled_t; |
|
| 442 |
- ') |
|
| 443 |
- |
|
| 444 |
- read_lnk_files_pattern($1, unlabeled_t, unlabeled_t) |
|
| 445 |
- domain_transition_pattern($1, unlabeled_t, $2) |
|
| 446 |
- type_transition $1 unlabeled_t:process $2; |
|
| 447 |
-') |
|
| 448 |
-interface(`files_write_all_pid_sockets',` |
|
| 449 |
- gen_require(` |
|
| 450 |
- attribute pidfile; |
|
| 451 |
- ') |
|
| 452 |
- |
|
| 453 |
- allow $1 pidfile:sock_file write_sock_file_perms; |
|
| 454 |
-') |
|
| 455 |
-interface(`dev_dontaudit_mounton_sysfs',` |
|
| 456 |
- gen_require(` |
|
| 457 |
- type sysfs_t; |
|
| 458 |
- ') |
|
| 459 |
- |
|
| 460 |
- dontaudit $1 sysfs_t:dir mounton; |
|
| 461 |
-') |
| 462 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,414 +0,0 @@ |
| 1 |
-policy_module(docker, 1.0.0) |
|
| 2 |
- |
|
| 3 |
-######################################## |
|
| 4 |
-# |
|
| 5 |
-# Declarations |
|
| 6 |
-# |
|
| 7 |
- |
|
| 8 |
-## <desc> |
|
| 9 |
-## <p> |
|
| 10 |
-## Allow sandbox containers manage fuse files |
|
| 11 |
-## </p> |
|
| 12 |
-## </desc> |
|
| 13 |
-gen_tunable(virt_sandbox_use_fusefs, false) |
|
| 14 |
- |
|
| 15 |
-## <desc> |
|
| 16 |
-## <p> |
|
| 17 |
-## Determine whether docker can |
|
| 18 |
-## connect to all TCP ports. |
|
| 19 |
-## </p> |
|
| 20 |
-## </desc> |
|
| 21 |
-gen_tunable(docker_connect_any, false) |
|
| 22 |
- |
|
| 23 |
-type docker_t; |
|
| 24 |
-type docker_exec_t; |
|
| 25 |
-init_daemon_domain(docker_t, docker_exec_t) |
|
| 26 |
-domain_subj_id_change_exemption(docker_t) |
|
| 27 |
-domain_role_change_exemption(docker_t) |
|
| 28 |
- |
|
| 29 |
-type spc_t; |
|
| 30 |
-domain_type(spc_t) |
|
| 31 |
-role system_r types spc_t; |
|
| 32 |
- |
|
| 33 |
-type spc_var_run_t; |
|
| 34 |
-files_pid_file(spc_var_run_t) |
|
| 35 |
- |
|
| 36 |
-type docker_var_lib_t; |
|
| 37 |
-files_type(docker_var_lib_t) |
|
| 38 |
- |
|
| 39 |
-type docker_home_t; |
|
| 40 |
-userdom_user_home_content(docker_home_t) |
|
| 41 |
- |
|
| 42 |
-type docker_config_t; |
|
| 43 |
-files_config_file(docker_config_t) |
|
| 44 |
- |
|
| 45 |
-type docker_lock_t; |
|
| 46 |
-files_lock_file(docker_lock_t) |
|
| 47 |
- |
|
| 48 |
-type docker_log_t; |
|
| 49 |
-logging_log_file(docker_log_t) |
|
| 50 |
- |
|
| 51 |
-type docker_tmp_t; |
|
| 52 |
-files_tmp_file(docker_tmp_t) |
|
| 53 |
- |
|
| 54 |
-type docker_tmpfs_t; |
|
| 55 |
-files_tmpfs_file(docker_tmpfs_t) |
|
| 56 |
- |
|
| 57 |
-type docker_var_run_t; |
|
| 58 |
-files_pid_file(docker_var_run_t) |
|
| 59 |
- |
|
| 60 |
-type docker_unit_file_t; |
|
| 61 |
-systemd_unit_file(docker_unit_file_t) |
|
| 62 |
- |
|
| 63 |
-type docker_devpts_t; |
|
| 64 |
-term_pty(docker_devpts_t) |
|
| 65 |
- |
|
| 66 |
-type docker_share_t; |
|
| 67 |
-files_type(docker_share_t) |
|
| 68 |
- |
|
| 69 |
-######################################## |
|
| 70 |
-# |
|
| 71 |
-# docker local policy |
|
| 72 |
-# |
|
| 73 |
-allow docker_t self:capability { chown kill fowner fsetid mknod net_admin net_bind_service net_raw setfcap };
|
|
| 74 |
-allow docker_t self:tun_socket relabelto; |
|
| 75 |
-allow docker_t self:process { getattr signal_perms setrlimit setfscreate };
|
|
| 76 |
-allow docker_t self:fifo_file rw_fifo_file_perms; |
|
| 77 |
-allow docker_t self:unix_stream_socket create_stream_socket_perms; |
|
| 78 |
-allow docker_t self:tcp_socket create_stream_socket_perms; |
|
| 79 |
-allow docker_t self:udp_socket create_socket_perms; |
|
| 80 |
-allow docker_t self:capability2 block_suspend; |
|
| 81 |
- |
|
| 82 |
-manage_files_pattern(docker_t, docker_home_t, docker_home_t) |
|
| 83 |
-manage_dirs_pattern(docker_t, docker_home_t, docker_home_t) |
|
| 84 |
-manage_lnk_files_pattern(docker_t, docker_home_t, docker_home_t) |
|
| 85 |
-userdom_admin_home_dir_filetrans(docker_t, docker_home_t, dir, ".docker") |
|
| 86 |
- |
|
| 87 |
-manage_dirs_pattern(docker_t, docker_config_t, docker_config_t) |
|
| 88 |
-manage_files_pattern(docker_t, docker_config_t, docker_config_t) |
|
| 89 |
-files_etc_filetrans(docker_t, docker_config_t, dir, "docker") |
|
| 90 |
- |
|
| 91 |
-manage_dirs_pattern(docker_t, docker_lock_t, docker_lock_t) |
|
| 92 |
-manage_files_pattern(docker_t, docker_lock_t, docker_lock_t) |
|
| 93 |
- |
|
| 94 |
-manage_dirs_pattern(docker_t, docker_log_t, docker_log_t) |
|
| 95 |
-manage_files_pattern(docker_t, docker_log_t, docker_log_t) |
|
| 96 |
-manage_lnk_files_pattern(docker_t, docker_log_t, docker_log_t) |
|
| 97 |
-logging_log_filetrans(docker_t, docker_log_t, { dir file lnk_file })
|
|
| 98 |
-allow docker_t docker_log_t:dir_file_class_set { relabelfrom relabelto };
|
|
| 99 |
- |
|
| 100 |
-manage_dirs_pattern(docker_t, docker_tmp_t, docker_tmp_t) |
|
| 101 |
-manage_files_pattern(docker_t, docker_tmp_t, docker_tmp_t) |
|
| 102 |
-manage_lnk_files_pattern(docker_t, docker_tmp_t, docker_tmp_t) |
|
| 103 |
-files_tmp_filetrans(docker_t, docker_tmp_t, { dir file lnk_file })
|
|
| 104 |
- |
|
| 105 |
-manage_dirs_pattern(docker_t, docker_tmpfs_t, docker_tmpfs_t) |
|
| 106 |
-manage_files_pattern(docker_t, docker_tmpfs_t, docker_tmpfs_t) |
|
| 107 |
-manage_lnk_files_pattern(docker_t, docker_tmpfs_t, docker_tmpfs_t) |
|
| 108 |
-manage_fifo_files_pattern(docker_t, docker_tmpfs_t, docker_tmpfs_t) |
|
| 109 |
-manage_chr_files_pattern(docker_t, docker_tmpfs_t, docker_tmpfs_t) |
|
| 110 |
-manage_blk_files_pattern(docker_t, docker_tmpfs_t, docker_tmpfs_t) |
|
| 111 |
-allow docker_t docker_tmpfs_t:dir relabelfrom; |
|
| 112 |
-can_exec(docker_t, docker_tmpfs_t) |
|
| 113 |
-fs_tmpfs_filetrans(docker_t, docker_tmpfs_t, { dir file })
|
|
| 114 |
-allow docker_t docker_tmpfs_t:chr_file mounton; |
|
| 115 |
- |
|
| 116 |
-manage_dirs_pattern(docker_t, docker_share_t, docker_share_t) |
|
| 117 |
-manage_files_pattern(docker_t, docker_share_t, docker_share_t) |
|
| 118 |
-manage_lnk_files_pattern(docker_t, docker_share_t, docker_share_t) |
|
| 119 |
-allow docker_t docker_share_t:dir_file_class_set { relabelfrom relabelto };
|
|
| 120 |
- |
|
| 121 |
-can_exec(docker_t, docker_share_t) |
|
| 122 |
-#docker_filetrans_named_content(docker_t) |
|
| 123 |
- |
|
| 124 |
-manage_dirs_pattern(docker_t, docker_var_lib_t, docker_var_lib_t) |
|
| 125 |
-manage_chr_files_pattern(docker_t, docker_var_lib_t, docker_var_lib_t) |
|
| 126 |
-manage_blk_files_pattern(docker_t, docker_var_lib_t, docker_var_lib_t) |
|
| 127 |
-manage_files_pattern(docker_t, docker_var_lib_t, docker_var_lib_t) |
|
| 128 |
-manage_lnk_files_pattern(docker_t, docker_var_lib_t, docker_var_lib_t) |
|
| 129 |
-allow docker_t docker_var_lib_t:dir_file_class_set { relabelfrom relabelto };
|
|
| 130 |
-files_var_lib_filetrans(docker_t, docker_var_lib_t, { dir file lnk_file })
|
|
| 131 |
- |
|
| 132 |
-manage_dirs_pattern(docker_t, docker_var_run_t, docker_var_run_t) |
|
| 133 |
-manage_files_pattern(docker_t, docker_var_run_t, docker_var_run_t) |
|
| 134 |
-manage_sock_files_pattern(docker_t, docker_var_run_t, docker_var_run_t) |
|
| 135 |
-manage_lnk_files_pattern(docker_t, docker_var_run_t, docker_var_run_t) |
|
| 136 |
-files_pid_filetrans(docker_t, docker_var_run_t, { dir file lnk_file sock_file })
|
|
| 137 |
- |
|
| 138 |
-allow docker_t docker_devpts_t:chr_file { relabelfrom rw_chr_file_perms setattr_chr_file_perms };
|
|
| 139 |
-term_create_pty(docker_t, docker_devpts_t) |
|
| 140 |
- |
|
| 141 |
-kernel_read_system_state(docker_t) |
|
| 142 |
-kernel_read_network_state(docker_t) |
|
| 143 |
-kernel_read_all_sysctls(docker_t) |
|
| 144 |
-kernel_rw_net_sysctls(docker_t) |
|
| 145 |
-kernel_setsched(docker_t) |
|
| 146 |
-kernel_read_all_proc(docker_t) |
|
| 147 |
- |
|
| 148 |
-domain_use_interactive_fds(docker_t) |
|
| 149 |
-domain_dontaudit_read_all_domains_state(docker_t) |
|
| 150 |
- |
|
| 151 |
-corecmd_exec_bin(docker_t) |
|
| 152 |
-corecmd_exec_shell(docker_t) |
|
| 153 |
- |
|
| 154 |
-corenet_tcp_bind_generic_node(docker_t) |
|
| 155 |
-corenet_tcp_sendrecv_generic_if(docker_t) |
|
| 156 |
-corenet_tcp_sendrecv_generic_node(docker_t) |
|
| 157 |
-corenet_tcp_sendrecv_generic_port(docker_t) |
|
| 158 |
-corenet_tcp_bind_all_ports(docker_t) |
|
| 159 |
-corenet_tcp_connect_http_port(docker_t) |
|
| 160 |
-corenet_tcp_connect_commplex_main_port(docker_t) |
|
| 161 |
-corenet_udp_sendrecv_generic_if(docker_t) |
|
| 162 |
-corenet_udp_sendrecv_generic_node(docker_t) |
|
| 163 |
-corenet_udp_sendrecv_all_ports(docker_t) |
|
| 164 |
-corenet_udp_bind_generic_node(docker_t) |
|
| 165 |
-corenet_udp_bind_all_ports(docker_t) |
|
| 166 |
- |
|
| 167 |
-files_read_config_files(docker_t) |
|
| 168 |
-files_dontaudit_getattr_all_dirs(docker_t) |
|
| 169 |
-files_dontaudit_getattr_all_files(docker_t) |
|
| 170 |
- |
|
| 171 |
-fs_read_cgroup_files(docker_t) |
|
| 172 |
-fs_read_tmpfs_symlinks(docker_t) |
|
| 173 |
-fs_search_all(docker_t) |
|
| 174 |
-fs_getattr_all_fs(docker_t) |
|
| 175 |
- |
|
| 176 |
-storage_raw_rw_fixed_disk(docker_t) |
|
| 177 |
- |
|
| 178 |
-auth_use_nsswitch(docker_t) |
|
| 179 |
-auth_dontaudit_getattr_shadow(docker_t) |
|
| 180 |
- |
|
| 181 |
-init_read_state(docker_t) |
|
| 182 |
-init_status(docker_t) |
|
| 183 |
- |
|
| 184 |
-logging_send_audit_msgs(docker_t) |
|
| 185 |
-logging_send_syslog_msg(docker_t) |
|
| 186 |
- |
|
| 187 |
-miscfiles_read_localization(docker_t) |
|
| 188 |
- |
|
| 189 |
-mount_domtrans(docker_t) |
|
| 190 |
- |
|
| 191 |
-seutil_read_default_contexts(docker_t) |
|
| 192 |
-seutil_read_config(docker_t) |
|
| 193 |
- |
|
| 194 |
-sysnet_dns_name_resolve(docker_t) |
|
| 195 |
-sysnet_exec_ifconfig(docker_t) |
|
| 196 |
- |
|
| 197 |
-optional_policy(` |
|
| 198 |
- rpm_exec(docker_t) |
|
| 199 |
- rpm_read_db(docker_t) |
|
| 200 |
- rpm_exec(docker_t) |
|
| 201 |
-') |
|
| 202 |
- |
|
| 203 |
-optional_policy(` |
|
| 204 |
- fstools_domtrans(docker_t) |
|
| 205 |
-') |
|
| 206 |
- |
|
| 207 |
-optional_policy(` |
|
| 208 |
- iptables_domtrans(docker_t) |
|
| 209 |
-') |
|
| 210 |
- |
|
| 211 |
-optional_policy(` |
|
| 212 |
- openvswitch_stream_connect(docker_t) |
|
| 213 |
-') |
|
| 214 |
- |
|
| 215 |
-allow docker_t self:capability { dac_override setgid setpcap setuid sys_admin sys_boot sys_chroot sys_ptrace };
|
|
| 216 |
- |
|
| 217 |
-allow docker_t self:process { getcap setcap setexec setpgid setsched signal_perms };
|
|
| 218 |
- |
|
| 219 |
-allow docker_t self:netlink_route_socket rw_netlink_socket_perms;; |
|
| 220 |
-allow docker_t self:netlink_audit_socket create_netlink_socket_perms; |
|
| 221 |
-allow docker_t self:unix_dgram_socket { create_socket_perms sendto };
|
|
| 222 |
-allow docker_t self:unix_stream_socket { create_stream_socket_perms connectto };
|
|
| 223 |
- |
|
| 224 |
-allow docker_t docker_var_lib_t:dir mounton; |
|
| 225 |
-allow docker_t docker_var_lib_t:chr_file mounton; |
|
| 226 |
-can_exec(docker_t, docker_var_lib_t) |
|
| 227 |
- |
|
| 228 |
-kernel_dontaudit_setsched(docker_t) |
|
| 229 |
-kernel_get_sysvipc_info(docker_t) |
|
| 230 |
-kernel_request_load_module(docker_t) |
|
| 231 |
-kernel_mounton_messages(docker_t) |
|
| 232 |
-kernel_mounton_all_proc(docker_t) |
|
| 233 |
-kernel_mounton_all_sysctls(docker_t) |
|
| 234 |
-kernel_unlabeled_entry_type(spc_t) |
|
| 235 |
-kernel_unlabeled_domtrans(docker_t, spc_t) |
|
| 236 |
- |
|
| 237 |
-dev_getattr_all(docker_t) |
|
| 238 |
-dev_getattr_sysfs_fs(docker_t) |
|
| 239 |
-dev_read_urand(docker_t) |
|
| 240 |
-dev_read_lvm_control(docker_t) |
|
| 241 |
-dev_rw_sysfs(docker_t) |
|
| 242 |
-dev_rw_loop_control(docker_t) |
|
| 243 |
-dev_rw_lvm_control(docker_t) |
|
| 244 |
- |
|
| 245 |
-files_getattr_isid_type_dirs(docker_t) |
|
| 246 |
-files_manage_isid_type_dirs(docker_t) |
|
| 247 |
-files_manage_isid_type_files(docker_t) |
|
| 248 |
-files_manage_isid_type_symlinks(docker_t) |
|
| 249 |
-files_manage_isid_type_chr_files(docker_t) |
|
| 250 |
-files_manage_isid_type_blk_files(docker_t) |
|
| 251 |
-files_exec_isid_files(docker_t) |
|
| 252 |
-files_mounton_isid(docker_t) |
|
| 253 |
-files_mounton_non_security(docker_t) |
|
| 254 |
-files_mounton_isid_type_chr_file(docker_t) |
|
| 255 |
- |
|
| 256 |
-fs_mount_all_fs(docker_t) |
|
| 257 |
-fs_unmount_all_fs(docker_t) |
|
| 258 |
-fs_remount_all_fs(docker_t) |
|
| 259 |
-files_mounton_isid(docker_t) |
|
| 260 |
-fs_manage_cgroup_dirs(docker_t) |
|
| 261 |
-fs_manage_cgroup_files(docker_t) |
|
| 262 |
-fs_relabelfrom_xattr_fs(docker_t) |
|
| 263 |
-fs_relabelfrom_tmpfs(docker_t) |
|
| 264 |
-fs_read_tmpfs_symlinks(docker_t) |
|
| 265 |
-fs_list_hugetlbfs(docker_t) |
|
| 266 |
- |
|
| 267 |
-term_use_generic_ptys(docker_t) |
|
| 268 |
-term_use_ptmx(docker_t) |
|
| 269 |
-term_getattr_pty_fs(docker_t) |
|
| 270 |
-term_relabel_pty_fs(docker_t) |
|
| 271 |
-term_mounton_unallocated_ttys(docker_t) |
|
| 272 |
- |
|
| 273 |
-modutils_domtrans_insmod(docker_t) |
|
| 274 |
- |
|
| 275 |
-systemd_status_all_unit_files(docker_t) |
|
| 276 |
-systemd_start_systemd_services(docker_t) |
|
| 277 |
- |
|
| 278 |
-userdom_stream_connect(docker_t) |
|
| 279 |
-userdom_search_user_home_content(docker_t) |
|
| 280 |
-userdom_read_all_users_state(docker_t) |
|
| 281 |
-userdom_relabel_user_home_files(docker_t) |
|
| 282 |
-userdom_relabel_user_tmp_files(docker_t) |
|
| 283 |
-userdom_relabel_user_tmp_dirs(docker_t) |
|
| 284 |
- |
|
| 285 |
-optional_policy(` |
|
| 286 |
- gpm_getattr_gpmctl(docker_t) |
|
| 287 |
-') |
|
| 288 |
- |
|
| 289 |
-optional_policy(` |
|
| 290 |
- dbus_system_bus_client(docker_t) |
|
| 291 |
- init_dbus_chat(docker_t) |
|
| 292 |
- init_start_transient_unit(docker_t) |
|
| 293 |
- |
|
| 294 |
- optional_policy(` |
|
| 295 |
- systemd_dbus_chat_logind(docker_t) |
|
| 296 |
- ') |
|
| 297 |
- |
|
| 298 |
- optional_policy(` |
|
| 299 |
- firewalld_dbus_chat(docker_t) |
|
| 300 |
- ') |
|
| 301 |
-') |
|
| 302 |
- |
|
| 303 |
-optional_policy(` |
|
| 304 |
- udev_read_db(docker_t) |
|
| 305 |
-') |
|
| 306 |
- |
|
| 307 |
-optional_policy(` |
|
| 308 |
- virt_read_config(docker_t) |
|
| 309 |
- virt_exec(docker_t) |
|
| 310 |
- virt_stream_connect(docker_t) |
|
| 311 |
- virt_stream_connect_sandbox(docker_t) |
|
| 312 |
- virt_exec_sandbox_files(docker_t) |
|
| 313 |
- virt_manage_sandbox_files(docker_t) |
|
| 314 |
- virt_relabel_sandbox_filesystem(docker_t) |
|
| 315 |
- virt_transition_svirt_sandbox(docker_t, system_r) |
|
| 316 |
- virt_mounton_sandbox_file(docker_t) |
|
| 317 |
-# virt_attach_sandbox_tun_iface(docker_t) |
|
| 318 |
- allow docker_t svirt_sandbox_domain:tun_socket relabelfrom; |
|
| 319 |
-') |
|
| 320 |
- |
|
| 321 |
-tunable_policy(`docker_connect_any',` |
|
| 322 |
- corenet_tcp_connect_all_ports(docker_t) |
|
| 323 |
- corenet_sendrecv_all_packets(docker_t) |
|
| 324 |
- corenet_tcp_sendrecv_all_ports(docker_t) |
|
| 325 |
-') |
|
| 326 |
- |
|
| 327 |
-######################################## |
|
| 328 |
-# |
|
| 329 |
-# spc local policy |
|
| 330 |
-# |
|
| 331 |
-domain_entry_file(spc_t, docker_share_t) |
|
| 332 |
-domain_entry_file(spc_t, docker_var_lib_t) |
|
| 333 |
-role system_r types spc_t; |
|
| 334 |
- |
|
| 335 |
-domain_entry_file(spc_t, docker_share_t) |
|
| 336 |
-domain_entry_file(spc_t, docker_var_lib_t) |
|
| 337 |
-domtrans_pattern(docker_t, docker_share_t, spc_t) |
|
| 338 |
-domtrans_pattern(docker_t, docker_var_lib_t, spc_t) |
|
| 339 |
-allow docker_t spc_t:process { setsched signal_perms };
|
|
| 340 |
-ps_process_pattern(docker_t, spc_t) |
|
| 341 |
-allow docker_t spc_t:socket_class_set { relabelto relabelfrom };
|
|
| 342 |
- |
|
| 343 |
-optional_policy(` |
|
| 344 |
- dbus_chat_system_bus(spc_t) |
|
| 345 |
-') |
|
| 346 |
- |
|
| 347 |
-optional_policy(` |
|
| 348 |
- unconfined_domain_noaudit(spc_t) |
|
| 349 |
-') |
|
| 350 |
- |
|
| 351 |
-optional_policy(` |
|
| 352 |
- unconfined_domain(docker_t) |
|
| 353 |
-') |
|
| 354 |
- |
|
| 355 |
-optional_policy(` |
|
| 356 |
- virt_transition_svirt_sandbox(spc_t, system_r) |
|
| 357 |
-') |
|
| 358 |
- |
|
| 359 |
-######################################## |
|
| 360 |
-# |
|
| 361 |
-# docker upstream policy |
|
| 362 |
-# |
|
| 363 |
- |
|
| 364 |
-optional_policy(` |
|
| 365 |
-# domain_stub_named_filetrans_domain() |
|
| 366 |
- gen_require(` |
|
| 367 |
- attribute named_filetrans_domain; |
|
| 368 |
- ') |
|
| 369 |
- |
|
| 370 |
- docker_filetrans_named_content(named_filetrans_domain) |
|
| 371 |
-') |
|
| 372 |
- |
|
| 373 |
-optional_policy(` |
|
| 374 |
- lvm_stub() |
|
| 375 |
- docker_rw_sem(lvm_t) |
|
| 376 |
-') |
|
| 377 |
- |
|
| 378 |
-optional_policy(` |
|
| 379 |
- staff_stub() |
|
| 380 |
- docker_stream_connect(staff_t) |
|
| 381 |
- docker_exec(staff_t) |
|
| 382 |
-') |
|
| 383 |
- |
|
| 384 |
-optional_policy(` |
|
| 385 |
- virt_stub_svirt_sandbox_domain() |
|
| 386 |
- virt_stub_svirt_sandbox_file() |
|
| 387 |
- allow svirt_sandbox_domain self:netlink_kobject_uevent_socket create_socket_perms; |
|
| 388 |
- docker_read_share_files(svirt_sandbox_domain) |
|
| 389 |
- docker_lib_filetrans(svirt_sandbox_domain,svirt_sandbox_file_t, sock_file) |
|
| 390 |
- docker_use_ptys(svirt_sandbox_domain) |
|
| 391 |
- docker_spc_stream_connect(svirt_sandbox_domain) |
|
| 392 |
- fs_list_tmpfs(svirt_sandbox_domain) |
|
| 393 |
- fs_rw_hugetlbfs_files(svirt_sandbox_domain) |
|
| 394 |
- fs_dontaudit_remount_tmpfs(svirt_sandbox_domain) |
|
| 395 |
- dev_dontaudit_mounton_sysfs(svirt_sandbox_domain) |
|
| 396 |
- |
|
| 397 |
- tunable_policy(`virt_sandbox_use_fusefs',` |
|
| 398 |
- fs_manage_fusefs_dirs(svirt_sandbox_domain) |
|
| 399 |
- fs_manage_fusefs_files(svirt_sandbox_domain) |
|
| 400 |
- fs_manage_fusefs_symlinks(svirt_sandbox_domain) |
|
| 401 |
- ') |
|
| 402 |
- gen_require(` |
|
| 403 |
- attribute domain; |
|
| 404 |
- ') |
|
| 405 |
- |
|
| 406 |
- dontaudit svirt_sandbox_domain domain:key {search link};
|
|
| 407 |
-') |
|
| 408 |
- |
|
| 409 |
-optional_policy(` |
|
| 410 |
- gen_require(` |
|
| 411 |
- type pcp_pmcd_t; |
|
| 412 |
- ') |
|
| 413 |
- docker_manage_lib_files(pcp_pmcd_t) |
|
| 414 |
-') |
| 417 | 3 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,339 @@ |
| 0 |
+ GNU GENERAL PUBLIC LICENSE |
|
| 1 |
+ Version 2, June 1991 |
|
| 2 |
+ |
|
| 3 |
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc., |
|
| 4 |
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
| 5 |
+ Everyone is permitted to copy and distribute verbatim copies |
|
| 6 |
+ of this license document, but changing it is not allowed. |
|
| 7 |
+ |
|
| 8 |
+ Preamble |
|
| 9 |
+ |
|
| 10 |
+ The licenses for most software are designed to take away your |
|
| 11 |
+freedom to share and change it. By contrast, the GNU General Public |
|
| 12 |
+License is intended to guarantee your freedom to share and change free |
|
| 13 |
+software--to make sure the software is free for all its users. This |
|
| 14 |
+General Public License applies to most of the Free Software |
|
| 15 |
+Foundation's software and to any other program whose authors commit to |
|
| 16 |
+using it. (Some other Free Software Foundation software is covered by |
|
| 17 |
+the GNU Lesser General Public License instead.) You can apply it to |
|
| 18 |
+your programs, too. |
|
| 19 |
+ |
|
| 20 |
+ When we speak of free software, we are referring to freedom, not |
|
| 21 |
+price. Our General Public Licenses are designed to make sure that you |
|
| 22 |
+have the freedom to distribute copies of free software (and charge for |
|
| 23 |
+this service if you wish), that you receive source code or can get it |
|
| 24 |
+if you want it, that you can change the software or use pieces of it |
|
| 25 |
+in new free programs; and that you know you can do these things. |
|
| 26 |
+ |
|
| 27 |
+ To protect your rights, we need to make restrictions that forbid |
|
| 28 |
+anyone to deny you these rights or to ask you to surrender the rights. |
|
| 29 |
+These restrictions translate to certain responsibilities for you if you |
|
| 30 |
+distribute copies of the software, or if you modify it. |
|
| 31 |
+ |
|
| 32 |
+ For example, if you distribute copies of such a program, whether |
|
| 33 |
+gratis or for a fee, you must give the recipients all the rights that |
|
| 34 |
+you have. You must make sure that they, too, receive or can get the |
|
| 35 |
+source code. And you must show them these terms so they know their |
|
| 36 |
+rights. |
|
| 37 |
+ |
|
| 38 |
+ We protect your rights with two steps: (1) copyright the software, and |
|
| 39 |
+(2) offer you this license which gives you legal permission to copy, |
|
| 40 |
+distribute and/or modify the software. |
|
| 41 |
+ |
|
| 42 |
+ Also, for each author's protection and ours, we want to make certain |
|
| 43 |
+that everyone understands that there is no warranty for this free |
|
| 44 |
+software. If the software is modified by someone else and passed on, we |
|
| 45 |
+want its recipients to know that what they have is not the original, so |
|
| 46 |
+that any problems introduced by others will not reflect on the original |
|
| 47 |
+authors' reputations. |
|
| 48 |
+ |
|
| 49 |
+ Finally, any free program is threatened constantly by software |
|
| 50 |
+patents. We wish to avoid the danger that redistributors of a free |
|
| 51 |
+program will individually obtain patent licenses, in effect making the |
|
| 52 |
+program proprietary. To prevent this, we have made it clear that any |
|
| 53 |
+patent must be licensed for everyone's free use or not licensed at all. |
|
| 54 |
+ |
|
| 55 |
+ The precise terms and conditions for copying, distribution and |
|
| 56 |
+modification follow. |
|
| 57 |
+ |
|
| 58 |
+ GNU GENERAL PUBLIC LICENSE |
|
| 59 |
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION |
|
| 60 |
+ |
|
| 61 |
+ 0. This License applies to any program or other work which contains |
|
| 62 |
+a notice placed by the copyright holder saying it may be distributed |
|
| 63 |
+under the terms of this General Public License. The "Program", below, |
|
| 64 |
+refers to any such program or work, and a "work based on the Program" |
|
| 65 |
+means either the Program or any derivative work under copyright law: |
|
| 66 |
+that is to say, a work containing the Program or a portion of it, |
|
| 67 |
+either verbatim or with modifications and/or translated into another |
|
| 68 |
+language. (Hereinafter, translation is included without limitation in |
|
| 69 |
+the term "modification".) Each licensee is addressed as "you". |
|
| 70 |
+ |
|
| 71 |
+Activities other than copying, distribution and modification are not |
|
| 72 |
+covered by this License; they are outside its scope. The act of |
|
| 73 |
+running the Program is not restricted, and the output from the Program |
|
| 74 |
+is covered only if its contents constitute a work based on the |
|
| 75 |
+Program (independent of having been made by running the Program). |
|
| 76 |
+Whether that is true depends on what the Program does. |
|
| 77 |
+ |
|
| 78 |
+ 1. You may copy and distribute verbatim copies of the Program's |
|
| 79 |
+source code as you receive it, in any medium, provided that you |
|
| 80 |
+conspicuously and appropriately publish on each copy an appropriate |
|
| 81 |
+copyright notice and disclaimer of warranty; keep intact all the |
|
| 82 |
+notices that refer to this License and to the absence of any warranty; |
|
| 83 |
+and give any other recipients of the Program a copy of this License |
|
| 84 |
+along with the Program. |
|
| 85 |
+ |
|
| 86 |
+You may charge a fee for the physical act of transferring a copy, and |
|
| 87 |
+you may at your option offer warranty protection in exchange for a fee. |
|
| 88 |
+ |
|
| 89 |
+ 2. You may modify your copy or copies of the Program or any portion |
|
| 90 |
+of it, thus forming a work based on the Program, and copy and |
|
| 91 |
+distribute such modifications or work under the terms of Section 1 |
|
| 92 |
+above, provided that you also meet all of these conditions: |
|
| 93 |
+ |
|
| 94 |
+ a) You must cause the modified files to carry prominent notices |
|
| 95 |
+ stating that you changed the files and the date of any change. |
|
| 96 |
+ |
|
| 97 |
+ b) You must cause any work that you distribute or publish, that in |
|
| 98 |
+ whole or in part contains or is derived from the Program or any |
|
| 99 |
+ part thereof, to be licensed as a whole at no charge to all third |
|
| 100 |
+ parties under the terms of this License. |
|
| 101 |
+ |
|
| 102 |
+ c) If the modified program normally reads commands interactively |
|
| 103 |
+ when run, you must cause it, when started running for such |
|
| 104 |
+ interactive use in the most ordinary way, to print or display an |
|
| 105 |
+ announcement including an appropriate copyright notice and a |
|
| 106 |
+ notice that there is no warranty (or else, saying that you provide |
|
| 107 |
+ a warranty) and that users may redistribute the program under |
|
| 108 |
+ these conditions, and telling the user how to view a copy of this |
|
| 109 |
+ License. (Exception: if the Program itself is interactive but |
|
| 110 |
+ does not normally print such an announcement, your work based on |
|
| 111 |
+ the Program is not required to print an announcement.) |
|
| 112 |
+ |
|
| 113 |
+These requirements apply to the modified work as a whole. If |
|
| 114 |
+identifiable sections of that work are not derived from the Program, |
|
| 115 |
+and can be reasonably considered independent and separate works in |
|
| 116 |
+themselves, then this License, and its terms, do not apply to those |
|
| 117 |
+sections when you distribute them as separate works. But when you |
|
| 118 |
+distribute the same sections as part of a whole which is a work based |
|
| 119 |
+on the Program, the distribution of the whole must be on the terms of |
|
| 120 |
+this License, whose permissions for other licensees extend to the |
|
| 121 |
+entire whole, and thus to each and every part regardless of who wrote it. |
|
| 122 |
+ |
|
| 123 |
+Thus, it is not the intent of this section to claim rights or contest |
|
| 124 |
+your rights to work written entirely by you; rather, the intent is to |
|
| 125 |
+exercise the right to control the distribution of derivative or |
|
| 126 |
+collective works based on the Program. |
|
| 127 |
+ |
|
| 128 |
+In addition, mere aggregation of another work not based on the Program |
|
| 129 |
+with the Program (or with a work based on the Program) on a volume of |
|
| 130 |
+a storage or distribution medium does not bring the other work under |
|
| 131 |
+the scope of this License. |
|
| 132 |
+ |
|
| 133 |
+ 3. You may copy and distribute the Program (or a work based on it, |
|
| 134 |
+under Section 2) in object code or executable form under the terms of |
|
| 135 |
+Sections 1 and 2 above provided that you also do one of the following: |
|
| 136 |
+ |
|
| 137 |
+ a) Accompany it with the complete corresponding machine-readable |
|
| 138 |
+ source code, which must be distributed under the terms of Sections |
|
| 139 |
+ 1 and 2 above on a medium customarily used for software interchange; or, |
|
| 140 |
+ |
|
| 141 |
+ b) Accompany it with a written offer, valid for at least three |
|
| 142 |
+ years, to give any third party, for a charge no more than your |
|
| 143 |
+ cost of physically performing source distribution, a complete |
|
| 144 |
+ machine-readable copy of the corresponding source code, to be |
|
| 145 |
+ distributed under the terms of Sections 1 and 2 above on a medium |
|
| 146 |
+ customarily used for software interchange; or, |
|
| 147 |
+ |
|
| 148 |
+ c) Accompany it with the information you received as to the offer |
|
| 149 |
+ to distribute corresponding source code. (This alternative is |
|
| 150 |
+ allowed only for noncommercial distribution and only if you |
|
| 151 |
+ received the program in object code or executable form with such |
|
| 152 |
+ an offer, in accord with Subsection b above.) |
|
| 153 |
+ |
|
| 154 |
+The source code for a work means the preferred form of the work for |
|
| 155 |
+making modifications to it. For an executable work, complete source |
|
| 156 |
+code means all the source code for all modules it contains, plus any |
|
| 157 |
+associated interface definition files, plus the scripts used to |
|
| 158 |
+control compilation and installation of the executable. However, as a |
|
| 159 |
+special exception, the source code distributed need not include |
|
| 160 |
+anything that is normally distributed (in either source or binary |
|
| 161 |
+form) with the major components (compiler, kernel, and so on) of the |
|
| 162 |
+operating system on which the executable runs, unless that component |
|
| 163 |
+itself accompanies the executable. |
|
| 164 |
+ |
|
| 165 |
+If distribution of executable or object code is made by offering |
|
| 166 |
+access to copy from a designated place, then offering equivalent |
|
| 167 |
+access to copy the source code from the same place counts as |
|
| 168 |
+distribution of the source code, even though third parties are not |
|
| 169 |
+compelled to copy the source along with the object code. |
|
| 170 |
+ |
|
| 171 |
+ 4. You may not copy, modify, sublicense, or distribute the Program |
|
| 172 |
+except as expressly provided under this License. Any attempt |
|
| 173 |
+otherwise to copy, modify, sublicense or distribute the Program is |
|
| 174 |
+void, and will automatically terminate your rights under this License. |
|
| 175 |
+However, parties who have received copies, or rights, from you under |
|
| 176 |
+this License will not have their licenses terminated so long as such |
|
| 177 |
+parties remain in full compliance. |
|
| 178 |
+ |
|
| 179 |
+ 5. You are not required to accept this License, since you have not |
|
| 180 |
+signed it. However, nothing else grants you permission to modify or |
|
| 181 |
+distribute the Program or its derivative works. These actions are |
|
| 182 |
+prohibited by law if you do not accept this License. Therefore, by |
|
| 183 |
+modifying or distributing the Program (or any work based on the |
|
| 184 |
+Program), you indicate your acceptance of this License to do so, and |
|
| 185 |
+all its terms and conditions for copying, distributing or modifying |
|
| 186 |
+the Program or works based on it. |
|
| 187 |
+ |
|
| 188 |
+ 6. Each time you redistribute the Program (or any work based on the |
|
| 189 |
+Program), the recipient automatically receives a license from the |
|
| 190 |
+original licensor to copy, distribute or modify the Program subject to |
|
| 191 |
+these terms and conditions. You may not impose any further |
|
| 192 |
+restrictions on the recipients' exercise of the rights granted herein. |
|
| 193 |
+You are not responsible for enforcing compliance by third parties to |
|
| 194 |
+this License. |
|
| 195 |
+ |
|
| 196 |
+ 7. If, as a consequence of a court judgment or allegation of patent |
|
| 197 |
+infringement or for any other reason (not limited to patent issues), |
|
| 198 |
+conditions are imposed on you (whether by court order, agreement or |
|
| 199 |
+otherwise) that contradict the conditions of this License, they do not |
|
| 200 |
+excuse you from the conditions of this License. If you cannot |
|
| 201 |
+distribute so as to satisfy simultaneously your obligations under this |
|
| 202 |
+License and any other pertinent obligations, then as a consequence you |
|
| 203 |
+may not distribute the Program at all. For example, if a patent |
|
| 204 |
+license would not permit royalty-free redistribution of the Program by |
|
| 205 |
+all those who receive copies directly or indirectly through you, then |
|
| 206 |
+the only way you could satisfy both it and this License would be to |
|
| 207 |
+refrain entirely from distribution of the Program. |
|
| 208 |
+ |
|
| 209 |
+If any portion of this section is held invalid or unenforceable under |
|
| 210 |
+any particular circumstance, the balance of the section is intended to |
|
| 211 |
+apply and the section as a whole is intended to apply in other |
|
| 212 |
+circumstances. |
|
| 213 |
+ |
|
| 214 |
+It is not the purpose of this section to induce you to infringe any |
|
| 215 |
+patents or other property right claims or to contest validity of any |
|
| 216 |
+such claims; this section has the sole purpose of protecting the |
|
| 217 |
+integrity of the free software distribution system, which is |
|
| 218 |
+implemented by public license practices. Many people have made |
|
| 219 |
+generous contributions to the wide range of software distributed |
|
| 220 |
+through that system in reliance on consistent application of that |
|
| 221 |
+system; it is up to the author/donor to decide if he or she is willing |
|
| 222 |
+to distribute software through any other system and a licensee cannot |
|
| 223 |
+impose that choice. |
|
| 224 |
+ |
|
| 225 |
+This section is intended to make thoroughly clear what is believed to |
|
| 226 |
+be a consequence of the rest of this License. |
|
| 227 |
+ |
|
| 228 |
+ 8. If the distribution and/or use of the Program is restricted in |
|
| 229 |
+certain countries either by patents or by copyrighted interfaces, the |
|
| 230 |
+original copyright holder who places the Program under this License |
|
| 231 |
+may add an explicit geographical distribution limitation excluding |
|
| 232 |
+those countries, so that distribution is permitted only in or among |
|
| 233 |
+countries not thus excluded. In such case, this License incorporates |
|
| 234 |
+the limitation as if written in the body of this License. |
|
| 235 |
+ |
|
| 236 |
+ 9. The Free Software Foundation may publish revised and/or new versions |
|
| 237 |
+of the General Public License from time to time. Such new versions will |
|
| 238 |
+be similar in spirit to the present version, but may differ in detail to |
|
| 239 |
+address new problems or concerns. |
|
| 240 |
+ |
|
| 241 |
+Each version is given a distinguishing version number. If the Program |
|
| 242 |
+specifies a version number of this License which applies to it and "any |
|
| 243 |
+later version", you have the option of following the terms and conditions |
|
| 244 |
+either of that version or of any later version published by the Free |
|
| 245 |
+Software Foundation. If the Program does not specify a version number of |
|
| 246 |
+this License, you may choose any version ever published by the Free Software |
|
| 247 |
+Foundation. |
|
| 248 |
+ |
|
| 249 |
+ 10. If you wish to incorporate parts of the Program into other free |
|
| 250 |
+programs whose distribution conditions are different, write to the author |
|
| 251 |
+to ask for permission. For software which is copyrighted by the Free |
|
| 252 |
+Software Foundation, write to the Free Software Foundation; we sometimes |
|
| 253 |
+make exceptions for this. Our decision will be guided by the two goals |
|
| 254 |
+of preserving the free status of all derivatives of our free software and |
|
| 255 |
+of promoting the sharing and reuse of software generally. |
|
| 256 |
+ |
|
| 257 |
+ NO WARRANTY |
|
| 258 |
+ |
|
| 259 |
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY |
|
| 260 |
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN |
|
| 261 |
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES |
|
| 262 |
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED |
|
| 263 |
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
|
| 264 |
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS |
|
| 265 |
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE |
|
| 266 |
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, |
|
| 267 |
+REPAIR OR CORRECTION. |
|
| 268 |
+ |
|
| 269 |
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
|
| 270 |
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR |
|
| 271 |
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, |
|
| 272 |
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING |
|
| 273 |
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED |
|
| 274 |
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY |
|
| 275 |
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER |
|
| 276 |
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE |
|
| 277 |
+POSSIBILITY OF SUCH DAMAGES. |
|
| 278 |
+ |
|
| 279 |
+ END OF TERMS AND CONDITIONS |
|
| 280 |
+ |
|
| 281 |
+ How to Apply These Terms to Your New Programs |
|
| 282 |
+ |
|
| 283 |
+ If you develop a new program, and you want it to be of the greatest |
|
| 284 |
+possible use to the public, the best way to achieve this is to make it |
|
| 285 |
+free software which everyone can redistribute and change under these terms. |
|
| 286 |
+ |
|
| 287 |
+ To do so, attach the following notices to the program. It is safest |
|
| 288 |
+to attach them to the start of each source file to most effectively |
|
| 289 |
+convey the exclusion of warranty; and each file should have at least |
|
| 290 |
+the "copyright" line and a pointer to where the full notice is found. |
|
| 291 |
+ |
|
| 292 |
+ <one line to give the program's name and a brief idea of what it does.> |
|
| 293 |
+ Copyright (C) <year> <name of author> |
|
| 294 |
+ |
|
| 295 |
+ This program is free software; you can redistribute it and/or modify |
|
| 296 |
+ it under the terms of the GNU General Public License as published by |
|
| 297 |
+ the Free Software Foundation; either version 2 of the License, or |
|
| 298 |
+ (at your option) any later version. |
|
| 299 |
+ |
|
| 300 |
+ This program is distributed in the hope that it will be useful, |
|
| 301 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 302 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 303 |
+ GNU General Public License for more details. |
|
| 304 |
+ |
|
| 305 |
+ You should have received a copy of the GNU General Public License along |
|
| 306 |
+ with this program; if not, write to the Free Software Foundation, Inc., |
|
| 307 |
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
|
| 308 |
+ |
|
| 309 |
+Also add information on how to contact you by electronic and paper mail. |
|
| 310 |
+ |
|
| 311 |
+If the program is interactive, make it output a short notice like this |
|
| 312 |
+when it starts in an interactive mode: |
|
| 313 |
+ |
|
| 314 |
+ Gnomovision version 69, Copyright (C) year name of author |
|
| 315 |
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. |
|
| 316 |
+ This is free software, and you are welcome to redistribute it |
|
| 317 |
+ under certain conditions; type `show c' for details. |
|
| 318 |
+ |
|
| 319 |
+The hypothetical commands `show w' and `show c' should show the appropriate |
|
| 320 |
+parts of the General Public License. Of course, the commands you use may |
|
| 321 |
+be called something other than `show w' and `show c'; they could even be |
|
| 322 |
+mouse-clicks or menu items--whatever suits your program. |
|
| 323 |
+ |
|
| 324 |
+You should also get your employer (if you work as a programmer) or your |
|
| 325 |
+school, if any, to sign a "copyright disclaimer" for the program, if |
|
| 326 |
+necessary. Here is a sample; alter the names: |
|
| 327 |
+ |
|
| 328 |
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program |
|
| 329 |
+ `Gnomovision' (which makes passes at compilers) written by James Hacker. |
|
| 330 |
+ |
|
| 331 |
+ <signature of Ty Coon>, 1 April 1989 |
|
| 332 |
+ Ty Coon, President of Vice |
|
| 333 |
+ |
|
| 334 |
+This General Public License does not permit incorporating your program into |
|
| 335 |
+proprietary programs. If your program is a subroutine library, you may |
|
| 336 |
+consider it more useful to permit linking proprietary applications with the |
|
| 337 |
+library. If this is what you want to do, use the GNU Lesser General |
|
| 338 |
+Public License instead of this License. |
| 0 | 339 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,23 @@ |
| 0 |
+TARGETS?=docker |
|
| 1 |
+MODULES?=${TARGETS:=.pp.bz2}
|
|
| 2 |
+SHAREDIR?=/usr/share |
|
| 3 |
+ |
|
| 4 |
+all: ${TARGETS:=.pp.bz2}
|
|
| 5 |
+ |
|
| 6 |
+%.pp.bz2: %.pp |
|
| 7 |
+ @echo Compressing $^ -\> $@ |
|
| 8 |
+ bzip2 -9 $^ |
|
| 9 |
+ |
|
| 10 |
+%.pp: %.te |
|
| 11 |
+ make -f ${SHAREDIR}/selinux/devel/Makefile $@
|
|
| 12 |
+ |
|
| 13 |
+clean: |
|
| 14 |
+ rm -f *~ *.tc *.pp *.pp.bz2 |
|
| 15 |
+ rm -rf tmp *.tar.gz |
|
| 16 |
+ |
|
| 17 |
+man: install |
|
| 18 |
+ sepolicy manpage --domain ${TARGETS}_t
|
|
| 19 |
+ |
|
| 20 |
+install: |
|
| 21 |
+ semodule -i ${TARGETS}
|
|
| 22 |
+ |
| 0 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,29 @@ |
| 0 |
+/root/\.docker gen_context(system_u:object_r:docker_home_t,s0) |
|
| 1 |
+ |
|
| 2 |
+/usr/bin/docker -- gen_context(system_u:object_r:docker_exec_t,s0) |
|
| 3 |
+/usr/bin/docker-novolume-plugin -- gen_context(system_u:object_r:docker_auth_exec_t,s0) |
|
| 4 |
+/usr/lib/docker/docker-novolume-plugin -- gen_context(system_u:object_r:docker_auth_exec_t,s0) |
|
| 5 |
+ |
|
| 6 |
+/usr/lib/systemd/system/docker.service -- gen_context(system_u:object_r:docker_unit_file_t,s0) |
|
| 7 |
+/usr/lib/systemd/system/docker-novolume-plugin.service -- gen_context(system_u:object_r:docker_unit_file_t,s0) |
|
| 8 |
+ |
|
| 9 |
+/etc/docker(/.*)? gen_context(system_u:object_r:docker_config_t,s0) |
|
| 10 |
+ |
|
| 11 |
+/var/lib/docker(/.*)? gen_context(system_u:object_r:docker_var_lib_t,s0) |
|
| 12 |
+/var/lib/kublet(/.*)? gen_context(system_u:object_r:docker_var_lib_t,s0) |
|
| 13 |
+/var/lib/docker/vfs(/.*)? gen_context(system_u:object_r:svirt_sandbox_file_t,s0) |
|
| 14 |
+ |
|
| 15 |
+/var/run/docker(/.*)? gen_context(system_u:object_r:docker_var_run_t,s0) |
|
| 16 |
+/var/run/docker\.pid -- gen_context(system_u:object_r:docker_var_run_t,s0) |
|
| 17 |
+/var/run/docker\.sock -s gen_context(system_u:object_r:docker_var_run_t,s0) |
|
| 18 |
+/var/run/docker-client(/.*)? gen_context(system_u:object_r:docker_var_run_t,s0) |
|
| 19 |
+/var/run/docker/plugins(/.*)? gen_context(system_u:object_r:docker_plugin_var_run_t,s0) |
|
| 20 |
+ |
|
| 21 |
+/var/lock/lxc(/.*)? gen_context(system_u:object_r:docker_lock_t,s0) |
|
| 22 |
+ |
|
| 23 |
+/var/log/lxc(/.*)? gen_context(system_u:object_r:docker_log_t,s0) |
|
| 24 |
+ |
|
| 25 |
+/var/lib/docker/init(/.*)? gen_context(system_u:object_r:docker_share_t,s0) |
|
| 26 |
+/var/lib/docker/containers/.*/hosts gen_context(system_u:object_r:docker_share_t,s0) |
|
| 27 |
+/var/lib/docker/containers/.*/hostname gen_context(system_u:object_r:docker_share_t,s0) |
|
| 28 |
+/var/lib/docker/.*/config\.env gen_context(system_u:object_r:docker_share_t,s0) |
| 0 | 29 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,523 @@ |
| 0 |
+ |
|
| 1 |
+## <summary>The open-source application container engine.</summary> |
|
| 2 |
+ |
|
| 3 |
+######################################## |
|
| 4 |
+## <summary> |
|
| 5 |
+## Execute docker in the docker domain. |
|
| 6 |
+## </summary> |
|
| 7 |
+## <param name="domain"> |
|
| 8 |
+## <summary> |
|
| 9 |
+## Domain allowed to transition. |
|
| 10 |
+## </summary> |
|
| 11 |
+## </param> |
|
| 12 |
+# |
|
| 13 |
+interface(`docker_domtrans',` |
|
| 14 |
+ gen_require(` |
|
| 15 |
+ type docker_t, docker_exec_t; |
|
| 16 |
+ ') |
|
| 17 |
+ |
|
| 18 |
+ corecmd_search_bin($1) |
|
| 19 |
+ domtrans_pattern($1, docker_exec_t, docker_t) |
|
| 20 |
+') |
|
| 21 |
+ |
|
| 22 |
+######################################## |
|
| 23 |
+## <summary> |
|
| 24 |
+## Execute docker in the caller domain. |
|
| 25 |
+## </summary> |
|
| 26 |
+## <param name="domain"> |
|
| 27 |
+## <summary> |
|
| 28 |
+## Domain allowed to transition. |
|
| 29 |
+## </summary> |
|
| 30 |
+## </param> |
|
| 31 |
+# |
|
| 32 |
+interface(`docker_exec',` |
|
| 33 |
+ gen_require(` |
|
| 34 |
+ type docker_exec_t; |
|
| 35 |
+ ') |
|
| 36 |
+ |
|
| 37 |
+ corecmd_search_bin($1) |
|
| 38 |
+ can_exec($1, docker_exec_t) |
|
| 39 |
+') |
|
| 40 |
+ |
|
| 41 |
+######################################## |
|
| 42 |
+## <summary> |
|
| 43 |
+## Search docker lib directories. |
|
| 44 |
+## </summary> |
|
| 45 |
+## <param name="domain"> |
|
| 46 |
+## <summary> |
|
| 47 |
+## Domain allowed access. |
|
| 48 |
+## </summary> |
|
| 49 |
+## </param> |
|
| 50 |
+# |
|
| 51 |
+interface(`docker_search_lib',` |
|
| 52 |
+ gen_require(` |
|
| 53 |
+ type docker_var_lib_t; |
|
| 54 |
+ ') |
|
| 55 |
+ |
|
| 56 |
+ allow $1 docker_var_lib_t:dir search_dir_perms; |
|
| 57 |
+ files_search_var_lib($1) |
|
| 58 |
+') |
|
| 59 |
+ |
|
| 60 |
+######################################## |
|
| 61 |
+## <summary> |
|
| 62 |
+## Execute docker lib directories. |
|
| 63 |
+## </summary> |
|
| 64 |
+## <param name="domain"> |
|
| 65 |
+## <summary> |
|
| 66 |
+## Domain allowed access. |
|
| 67 |
+## </summary> |
|
| 68 |
+## </param> |
|
| 69 |
+# |
|
| 70 |
+interface(`docker_exec_lib',` |
|
| 71 |
+ gen_require(` |
|
| 72 |
+ type docker_var_lib_t; |
|
| 73 |
+ ') |
|
| 74 |
+ |
|
| 75 |
+ allow $1 docker_var_lib_t:dir search_dir_perms; |
|
| 76 |
+ can_exec($1, docker_var_lib_t) |
|
| 77 |
+') |
|
| 78 |
+ |
|
| 79 |
+######################################## |
|
| 80 |
+## <summary> |
|
| 81 |
+## Read docker lib files. |
|
| 82 |
+## </summary> |
|
| 83 |
+## <param name="domain"> |
|
| 84 |
+## <summary> |
|
| 85 |
+## Domain allowed access. |
|
| 86 |
+## </summary> |
|
| 87 |
+## </param> |
|
| 88 |
+# |
|
| 89 |
+interface(`docker_read_lib_files',` |
|
| 90 |
+ gen_require(` |
|
| 91 |
+ type docker_var_lib_t; |
|
| 92 |
+ ') |
|
| 93 |
+ |
|
| 94 |
+ files_search_var_lib($1) |
|
| 95 |
+ read_files_pattern($1, docker_var_lib_t, docker_var_lib_t) |
|
| 96 |
+') |
|
| 97 |
+ |
|
| 98 |
+######################################## |
|
| 99 |
+## <summary> |
|
| 100 |
+## Read docker share files. |
|
| 101 |
+## </summary> |
|
| 102 |
+## <param name="domain"> |
|
| 103 |
+## <summary> |
|
| 104 |
+## Domain allowed access. |
|
| 105 |
+## </summary> |
|
| 106 |
+## </param> |
|
| 107 |
+# |
|
| 108 |
+interface(`docker_read_share_files',` |
|
| 109 |
+ gen_require(` |
|
| 110 |
+ type docker_share_t; |
|
| 111 |
+ ') |
|
| 112 |
+ |
|
| 113 |
+ files_search_var_lib($1) |
|
| 114 |
+ list_dirs_pattern($1, docker_share_t, docker_share_t) |
|
| 115 |
+ read_files_pattern($1, docker_share_t, docker_share_t) |
|
| 116 |
+ read_lnk_files_pattern($1, docker_share_t, docker_share_t) |
|
| 117 |
+') |
|
| 118 |
+ |
|
| 119 |
+###################################### |
|
| 120 |
+## <summary> |
|
| 121 |
+## Allow the specified domain to execute apache |
|
| 122 |
+## in the caller domain. |
|
| 123 |
+## </summary> |
|
| 124 |
+## <param name="domain"> |
|
| 125 |
+## <summary> |
|
| 126 |
+## Domain allowed access. |
|
| 127 |
+## </summary> |
|
| 128 |
+## </param> |
|
| 129 |
+# |
|
| 130 |
+interface(`apache_exec',` |
|
| 131 |
+ gen_require(` |
|
| 132 |
+ type httpd_exec_t; |
|
| 133 |
+ ') |
|
| 134 |
+ |
|
| 135 |
+ can_exec($1, httpd_exec_t) |
|
| 136 |
+') |
|
| 137 |
+ |
|
| 138 |
+###################################### |
|
| 139 |
+## <summary> |
|
| 140 |
+## Allow the specified domain to execute docker shared files |
|
| 141 |
+## in the caller domain. |
|
| 142 |
+## </summary> |
|
| 143 |
+## <param name="domain"> |
|
| 144 |
+## <summary> |
|
| 145 |
+## Domain allowed access. |
|
| 146 |
+## </summary> |
|
| 147 |
+## </param> |
|
| 148 |
+# |
|
| 149 |
+interface(`docker_exec_share_files',` |
|
| 150 |
+ gen_require(` |
|
| 151 |
+ type docker_share_t; |
|
| 152 |
+ ') |
|
| 153 |
+ |
|
| 154 |
+ can_exec($1, docker_share_t) |
|
| 155 |
+') |
|
| 156 |
+ |
|
| 157 |
+######################################## |
|
| 158 |
+## <summary> |
|
| 159 |
+## Manage docker lib files. |
|
| 160 |
+## </summary> |
|
| 161 |
+## <param name="domain"> |
|
| 162 |
+## <summary> |
|
| 163 |
+## Domain allowed access. |
|
| 164 |
+## </summary> |
|
| 165 |
+## </param> |
|
| 166 |
+# |
|
| 167 |
+interface(`docker_manage_lib_files',` |
|
| 168 |
+ gen_require(` |
|
| 169 |
+ type docker_var_lib_t; |
|
| 170 |
+ ') |
|
| 171 |
+ |
|
| 172 |
+ files_search_var_lib($1) |
|
| 173 |
+ manage_files_pattern($1, docker_var_lib_t, docker_var_lib_t) |
|
| 174 |
+ manage_lnk_files_pattern($1, docker_var_lib_t, docker_var_lib_t) |
|
| 175 |
+') |
|
| 176 |
+ |
|
| 177 |
+######################################## |
|
| 178 |
+## <summary> |
|
| 179 |
+## Manage docker lib directories. |
|
| 180 |
+## </summary> |
|
| 181 |
+## <param name="domain"> |
|
| 182 |
+## <summary> |
|
| 183 |
+## Domain allowed access. |
|
| 184 |
+## </summary> |
|
| 185 |
+## </param> |
|
| 186 |
+# |
|
| 187 |
+interface(`docker_manage_lib_dirs',` |
|
| 188 |
+ gen_require(` |
|
| 189 |
+ type docker_var_lib_t; |
|
| 190 |
+ ') |
|
| 191 |
+ |
|
| 192 |
+ files_search_var_lib($1) |
|
| 193 |
+ manage_dirs_pattern($1, docker_var_lib_t, docker_var_lib_t) |
|
| 194 |
+') |
|
| 195 |
+ |
|
| 196 |
+######################################## |
|
| 197 |
+## <summary> |
|
| 198 |
+## Create objects in a docker var lib directory |
|
| 199 |
+## with an automatic type transition to |
|
| 200 |
+## a specified private type. |
|
| 201 |
+## </summary> |
|
| 202 |
+## <param name="domain"> |
|
| 203 |
+## <summary> |
|
| 204 |
+## Domain allowed access. |
|
| 205 |
+## </summary> |
|
| 206 |
+## </param> |
|
| 207 |
+## <param name="private_type"> |
|
| 208 |
+## <summary> |
|
| 209 |
+## The type of the object to create. |
|
| 210 |
+## </summary> |
|
| 211 |
+## </param> |
|
| 212 |
+## <param name="object_class"> |
|
| 213 |
+## <summary> |
|
| 214 |
+## The class of the object to be created. |
|
| 215 |
+## </summary> |
|
| 216 |
+## </param> |
|
| 217 |
+## <param name="name" optional="true"> |
|
| 218 |
+## <summary> |
|
| 219 |
+## The name of the object being created. |
|
| 220 |
+## </summary> |
|
| 221 |
+## </param> |
|
| 222 |
+# |
|
| 223 |
+interface(`docker_lib_filetrans',` |
|
| 224 |
+ gen_require(` |
|
| 225 |
+ type docker_var_lib_t; |
|
| 226 |
+ ') |
|
| 227 |
+ |
|
| 228 |
+ filetrans_pattern($1, docker_var_lib_t, $2, $3, $4) |
|
| 229 |
+') |
|
| 230 |
+ |
|
| 231 |
+######################################## |
|
| 232 |
+## <summary> |
|
| 233 |
+## Read docker PID files. |
|
| 234 |
+## </summary> |
|
| 235 |
+## <param name="domain"> |
|
| 236 |
+## <summary> |
|
| 237 |
+## Domain allowed access. |
|
| 238 |
+## </summary> |
|
| 239 |
+## </param> |
|
| 240 |
+# |
|
| 241 |
+interface(`docker_read_pid_files',` |
|
| 242 |
+ gen_require(` |
|
| 243 |
+ type docker_var_run_t; |
|
| 244 |
+ ') |
|
| 245 |
+ |
|
| 246 |
+ files_search_pids($1) |
|
| 247 |
+ read_files_pattern($1, docker_var_run_t, docker_var_run_t) |
|
| 248 |
+') |
|
| 249 |
+ |
|
| 250 |
+######################################## |
|
| 251 |
+## <summary> |
|
| 252 |
+## Execute docker server in the docker domain. |
|
| 253 |
+## </summary> |
|
| 254 |
+## <param name="domain"> |
|
| 255 |
+## <summary> |
|
| 256 |
+## Domain allowed to transition. |
|
| 257 |
+## </summary> |
|
| 258 |
+## </param> |
|
| 259 |
+# |
|
| 260 |
+interface(`docker_systemctl',` |
|
| 261 |
+ gen_require(` |
|
| 262 |
+ type docker_t; |
|
| 263 |
+ type docker_unit_file_t; |
|
| 264 |
+ ') |
|
| 265 |
+ |
|
| 266 |
+ systemd_exec_systemctl($1) |
|
| 267 |
+ init_reload_services($1) |
|
| 268 |
+ systemd_read_fifo_file_passwd_run($1) |
|
| 269 |
+ allow $1 docker_unit_file_t:file read_file_perms; |
|
| 270 |
+ allow $1 docker_unit_file_t:service manage_service_perms; |
|
| 271 |
+ |
|
| 272 |
+ ps_process_pattern($1, docker_t) |
|
| 273 |
+') |
|
| 274 |
+ |
|
| 275 |
+######################################## |
|
| 276 |
+## <summary> |
|
| 277 |
+## Read and write docker shared memory. |
|
| 278 |
+## </summary> |
|
| 279 |
+## <param name="domain"> |
|
| 280 |
+## <summary> |
|
| 281 |
+## Domain allowed access. |
|
| 282 |
+## </summary> |
|
| 283 |
+## </param> |
|
| 284 |
+# |
|
| 285 |
+interface(`docker_rw_sem',` |
|
| 286 |
+ gen_require(` |
|
| 287 |
+ type docker_t; |
|
| 288 |
+ ') |
|
| 289 |
+ |
|
| 290 |
+ allow $1 docker_t:sem rw_sem_perms; |
|
| 291 |
+') |
|
| 292 |
+ |
|
| 293 |
+####################################### |
|
| 294 |
+## <summary> |
|
| 295 |
+## Read and write the docker pty type. |
|
| 296 |
+## </summary> |
|
| 297 |
+## <param name="domain"> |
|
| 298 |
+## <summary> |
|
| 299 |
+## Domain allowed access. |
|
| 300 |
+## </summary> |
|
| 301 |
+## </param> |
|
| 302 |
+# |
|
| 303 |
+interface(`docker_use_ptys',` |
|
| 304 |
+ gen_require(` |
|
| 305 |
+ type docker_devpts_t; |
|
| 306 |
+ ') |
|
| 307 |
+ |
|
| 308 |
+ allow $1 docker_devpts_t:chr_file rw_term_perms; |
|
| 309 |
+') |
|
| 310 |
+ |
|
| 311 |
+####################################### |
|
| 312 |
+## <summary> |
|
| 313 |
+## Allow domain to create docker content |
|
| 314 |
+## </summary> |
|
| 315 |
+## <param name="domain"> |
|
| 316 |
+## <summary> |
|
| 317 |
+## Domain allowed access. |
|
| 318 |
+## </summary> |
|
| 319 |
+## </param> |
|
| 320 |
+# |
|
| 321 |
+interface(`docker_filetrans_named_content',` |
|
| 322 |
+ |
|
| 323 |
+ gen_require(` |
|
| 324 |
+ type docker_var_lib_t; |
|
| 325 |
+ type docker_share_t; |
|
| 326 |
+ type docker_log_t; |
|
| 327 |
+ type docker_var_run_t; |
|
| 328 |
+ type docker_home_t; |
|
| 329 |
+ ') |
|
| 330 |
+ |
|
| 331 |
+ files_pid_filetrans($1, docker_var_run_t, file, "docker.pid") |
|
| 332 |
+ files_pid_filetrans($1, docker_var_run_t, sock_file, "docker.sock") |
|
| 333 |
+ files_pid_filetrans($1, docker_var_run_t, dir, "docker-client") |
|
| 334 |
+ logging_log_filetrans($1, docker_log_t, dir, "lxc") |
|
| 335 |
+ files_var_lib_filetrans($1, docker_var_lib_t, dir, "docker") |
|
| 336 |
+ filetrans_pattern($1, docker_var_lib_t, docker_share_t, file, "config.env") |
|
| 337 |
+ filetrans_pattern($1, docker_var_lib_t, docker_share_t, file, "hosts") |
|
| 338 |
+ filetrans_pattern($1, docker_var_lib_t, docker_share_t, file, "hostname") |
|
| 339 |
+ filetrans_pattern($1, docker_var_lib_t, docker_share_t, file, "resolv.conf") |
|
| 340 |
+ filetrans_pattern($1, docker_var_lib_t, docker_share_t, dir, "init") |
|
| 341 |
+ userdom_admin_home_dir_filetrans($1, docker_home_t, dir, ".docker") |
|
| 342 |
+') |
|
| 343 |
+ |
|
| 344 |
+######################################## |
|
| 345 |
+## <summary> |
|
| 346 |
+## Connect to docker over a unix stream socket. |
|
| 347 |
+## </summary> |
|
| 348 |
+## <param name="domain"> |
|
| 349 |
+## <summary> |
|
| 350 |
+## Domain allowed access. |
|
| 351 |
+## </summary> |
|
| 352 |
+## </param> |
|
| 353 |
+# |
|
| 354 |
+interface(`docker_stream_connect',` |
|
| 355 |
+ gen_require(` |
|
| 356 |
+ type docker_t, docker_var_run_t; |
|
| 357 |
+ ') |
|
| 358 |
+ |
|
| 359 |
+ files_search_pids($1) |
|
| 360 |
+ stream_connect_pattern($1, docker_var_run_t, docker_var_run_t, docker_t) |
|
| 361 |
+') |
|
| 362 |
+ |
|
| 363 |
+######################################## |
|
| 364 |
+## <summary> |
|
| 365 |
+## Connect to SPC containers over a unix stream socket. |
|
| 366 |
+## </summary> |
|
| 367 |
+## <param name="domain"> |
|
| 368 |
+## <summary> |
|
| 369 |
+## Domain allowed access. |
|
| 370 |
+## </summary> |
|
| 371 |
+## </param> |
|
| 372 |
+# |
|
| 373 |
+interface(`docker_spc_stream_connect',` |
|
| 374 |
+ gen_require(` |
|
| 375 |
+ type spc_t, spc_var_run_t; |
|
| 376 |
+ ') |
|
| 377 |
+ |
|
| 378 |
+ files_search_pids($1) |
|
| 379 |
+ files_write_all_pid_sockets($1) |
|
| 380 |
+ allow $1 spc_t:unix_stream_socket connectto; |
|
| 381 |
+') |
|
| 382 |
+ |
|
| 383 |
+######################################## |
|
| 384 |
+## <summary> |
|
| 385 |
+## All of the rules required to administrate |
|
| 386 |
+## an docker environment |
|
| 387 |
+## </summary> |
|
| 388 |
+## <param name="domain"> |
|
| 389 |
+## <summary> |
|
| 390 |
+## Domain allowed access. |
|
| 391 |
+## </summary> |
|
| 392 |
+## </param> |
|
| 393 |
+# |
|
| 394 |
+interface(`docker_admin',` |
|
| 395 |
+ gen_require(` |
|
| 396 |
+ type docker_t; |
|
| 397 |
+ type docker_var_lib_t, docker_var_run_t; |
|
| 398 |
+ type docker_unit_file_t; |
|
| 399 |
+ type docker_lock_t; |
|
| 400 |
+ type docker_log_t; |
|
| 401 |
+ type docker_config_t; |
|
| 402 |
+ ') |
|
| 403 |
+ |
|
| 404 |
+ allow $1 docker_t:process { ptrace signal_perms };
|
|
| 405 |
+ ps_process_pattern($1, docker_t) |
|
| 406 |
+ |
|
| 407 |
+ admin_pattern($1, docker_config_t) |
|
| 408 |
+ |
|
| 409 |
+ files_search_var_lib($1) |
|
| 410 |
+ admin_pattern($1, docker_var_lib_t) |
|
| 411 |
+ |
|
| 412 |
+ files_search_pids($1) |
|
| 413 |
+ admin_pattern($1, docker_var_run_t) |
|
| 414 |
+ |
|
| 415 |
+ files_search_locks($1) |
|
| 416 |
+ admin_pattern($1, docker_lock_t) |
|
| 417 |
+ |
|
| 418 |
+ logging_search_logs($1) |
|
| 419 |
+ admin_pattern($1, docker_log_t) |
|
| 420 |
+ |
|
| 421 |
+ docker_systemctl($1) |
|
| 422 |
+ admin_pattern($1, docker_unit_file_t) |
|
| 423 |
+ allow $1 docker_unit_file_t:service all_service_perms; |
|
| 424 |
+ |
|
| 425 |
+ optional_policy(` |
|
| 426 |
+ systemd_passwd_agent_exec($1) |
|
| 427 |
+ systemd_read_fifo_file_passwd_run($1) |
|
| 428 |
+ ') |
|
| 429 |
+') |
|
| 430 |
+ |
|
| 431 |
+######################################## |
|
| 432 |
+## <summary> |
|
| 433 |
+## Execute docker_auth_exec_t in the docker_auth domain. |
|
| 434 |
+## </summary> |
|
| 435 |
+## <param name="domain"> |
|
| 436 |
+## <summary> |
|
| 437 |
+## Domain allowed to transition. |
|
| 438 |
+## </summary> |
|
| 439 |
+## </param> |
|
| 440 |
+# |
|
| 441 |
+interface(`docker_auth_domtrans',` |
|
| 442 |
+ gen_require(` |
|
| 443 |
+ type docker_auth_t, docker_auth_exec_t; |
|
| 444 |
+ ') |
|
| 445 |
+ |
|
| 446 |
+ corecmd_search_bin($1) |
|
| 447 |
+ domtrans_pattern($1, docker_auth_exec_t, docker_auth_t) |
|
| 448 |
+') |
|
| 449 |
+ |
|
| 450 |
+###################################### |
|
| 451 |
+## <summary> |
|
| 452 |
+## Execute docker_auth in the caller domain. |
|
| 453 |
+## </summary> |
|
| 454 |
+## <param name="domain"> |
|
| 455 |
+## <summary> |
|
| 456 |
+## Domain allowed access. |
|
| 457 |
+## </summary> |
|
| 458 |
+## </param> |
|
| 459 |
+# |
|
| 460 |
+interface(`docker_auth_exec',` |
|
| 461 |
+ gen_require(` |
|
| 462 |
+ type docker_auth_exec_t; |
|
| 463 |
+ ') |
|
| 464 |
+ |
|
| 465 |
+ corecmd_search_bin($1) |
|
| 466 |
+ can_exec($1, docker_auth_exec_t) |
|
| 467 |
+') |
|
| 468 |
+ |
|
| 469 |
+######################################## |
|
| 470 |
+## <summary> |
|
| 471 |
+## Connect to docker_auth over a unix stream socket. |
|
| 472 |
+## </summary> |
|
| 473 |
+## <param name="domain"> |
|
| 474 |
+## <summary> |
|
| 475 |
+## Domain allowed access. |
|
| 476 |
+## </summary> |
|
| 477 |
+## </param> |
|
| 478 |
+# |
|
| 479 |
+interface(`docker_auth_stream_connect',` |
|
| 480 |
+ gen_require(` |
|
| 481 |
+ type docker_auth_t, docker_plugin_var_run_t; |
|
| 482 |
+ ') |
|
| 483 |
+ |
|
| 484 |
+ files_search_pids($1) |
|
| 485 |
+ stream_connect_pattern($1, docker_plugin_var_run_t, docker_plugin_var_run_t, docker_auth_t) |
|
| 486 |
+') |
|
| 487 |
+ |
|
| 488 |
+######################################## |
|
| 489 |
+## <summary> |
|
| 490 |
+## docker domain typebounds calling domain. |
|
| 491 |
+## </summary> |
|
| 492 |
+## <param name="domain"> |
|
| 493 |
+## <summary> |
|
| 494 |
+## Domain to be typebound. |
|
| 495 |
+## </summary> |
|
| 496 |
+## </param> |
|
| 497 |
+# |
|
| 498 |
+interface(`docker_typebounds',` |
|
| 499 |
+ gen_require(` |
|
| 500 |
+ type docker_t; |
|
| 501 |
+ ') |
|
| 502 |
+ |
|
| 503 |
+ typebounds docker_t $1; |
|
| 504 |
+') |
|
| 505 |
+ |
|
| 506 |
+######################################## |
|
| 507 |
+## <summary> |
|
| 508 |
+## Allow any docker_exec_t to be an entrypoint of this domain |
|
| 509 |
+## </summary> |
|
| 510 |
+## <param name="domain"> |
|
| 511 |
+## <summary> |
|
| 512 |
+## Domain allowed access. |
|
| 513 |
+## </summary> |
|
| 514 |
+## </param> |
|
| 515 |
+## <rolecap/> |
|
| 516 |
+# |
|
| 517 |
+interface(`docker_entrypoint',` |
|
| 518 |
+ gen_require(` |
|
| 519 |
+ type docker_exec_t; |
|
| 520 |
+ ') |
|
| 521 |
+ allow $1 docker_exec_t:file entrypoint; |
|
| 522 |
+') |
| 0 | 523 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,399 @@ |
| 0 |
+policy_module(docker, 1.0.0) |
|
| 1 |
+ |
|
| 2 |
+######################################## |
|
| 3 |
+# |
|
| 4 |
+# Declarations |
|
| 5 |
+# |
|
| 6 |
+ |
|
| 7 |
+## <desc> |
|
| 8 |
+## <p> |
|
| 9 |
+## Determine whether docker can |
|
| 10 |
+## connect to all TCP ports. |
|
| 11 |
+## </p> |
|
| 12 |
+## </desc> |
|
| 13 |
+gen_tunable(docker_connect_any, false) |
|
| 14 |
+ |
|
| 15 |
+type docker_t; |
|
| 16 |
+type docker_exec_t; |
|
| 17 |
+init_daemon_domain(docker_t, docker_exec_t) |
|
| 18 |
+domain_subj_id_change_exemption(docker_t) |
|
| 19 |
+domain_role_change_exemption(docker_t) |
|
| 20 |
+ |
|
| 21 |
+type spc_t; |
|
| 22 |
+domain_type(spc_t) |
|
| 23 |
+role system_r types spc_t; |
|
| 24 |
+ |
|
| 25 |
+type docker_auth_t; |
|
| 26 |
+type docker_auth_exec_t; |
|
| 27 |
+init_daemon_domain(docker_auth_t, docker_auth_exec_t) |
|
| 28 |
+ |
|
| 29 |
+type spc_var_run_t; |
|
| 30 |
+files_pid_file(spc_var_run_t) |
|
| 31 |
+ |
|
| 32 |
+type docker_var_lib_t; |
|
| 33 |
+files_type(docker_var_lib_t) |
|
| 34 |
+ |
|
| 35 |
+type docker_home_t; |
|
| 36 |
+userdom_user_home_content(docker_home_t) |
|
| 37 |
+ |
|
| 38 |
+type docker_config_t; |
|
| 39 |
+files_config_file(docker_config_t) |
|
| 40 |
+ |
|
| 41 |
+type docker_lock_t; |
|
| 42 |
+files_lock_file(docker_lock_t) |
|
| 43 |
+ |
|
| 44 |
+type docker_log_t; |
|
| 45 |
+logging_log_file(docker_log_t) |
|
| 46 |
+ |
|
| 47 |
+type docker_tmp_t; |
|
| 48 |
+files_tmp_file(docker_tmp_t) |
|
| 49 |
+ |
|
| 50 |
+type docker_tmpfs_t; |
|
| 51 |
+files_tmpfs_file(docker_tmpfs_t) |
|
| 52 |
+ |
|
| 53 |
+type docker_var_run_t; |
|
| 54 |
+files_pid_file(docker_var_run_t) |
|
| 55 |
+ |
|
| 56 |
+type docker_plugin_var_run_t; |
|
| 57 |
+files_pid_file(docker_plugin_var_run_t) |
|
| 58 |
+ |
|
| 59 |
+type docker_unit_file_t; |
|
| 60 |
+systemd_unit_file(docker_unit_file_t) |
|
| 61 |
+ |
|
| 62 |
+type docker_devpts_t; |
|
| 63 |
+term_pty(docker_devpts_t) |
|
| 64 |
+ |
|
| 65 |
+type docker_share_t; |
|
| 66 |
+files_type(docker_share_t) |
|
| 67 |
+ |
|
| 68 |
+######################################## |
|
| 69 |
+# |
|
| 70 |
+# docker local policy |
|
| 71 |
+# |
|
| 72 |
+allow docker_t self:capability { chown kill fowner fsetid mknod net_admin net_bind_service net_raw setfcap };
|
|
| 73 |
+allow docker_t self:tun_socket relabelto; |
|
| 74 |
+allow docker_t self:process { getattr signal_perms setrlimit setfscreate };
|
|
| 75 |
+allow docker_t self:fifo_file rw_fifo_file_perms; |
|
| 76 |
+allow docker_t self:unix_stream_socket create_stream_socket_perms; |
|
| 77 |
+allow docker_t self:tcp_socket create_stream_socket_perms; |
|
| 78 |
+allow docker_t self:udp_socket create_socket_perms; |
|
| 79 |
+allow docker_t self:capability2 block_suspend; |
|
| 80 |
+ |
|
| 81 |
+docker_auth_stream_connect(docker_t) |
|
| 82 |
+ |
|
| 83 |
+manage_files_pattern(docker_t, docker_home_t, docker_home_t) |
|
| 84 |
+manage_dirs_pattern(docker_t, docker_home_t, docker_home_t) |
|
| 85 |
+manage_lnk_files_pattern(docker_t, docker_home_t, docker_home_t) |
|
| 86 |
+userdom_admin_home_dir_filetrans(docker_t, docker_home_t, dir, ".docker") |
|
| 87 |
+ |
|
| 88 |
+manage_dirs_pattern(docker_t, docker_config_t, docker_config_t) |
|
| 89 |
+manage_files_pattern(docker_t, docker_config_t, docker_config_t) |
|
| 90 |
+files_etc_filetrans(docker_t, docker_config_t, dir, "docker") |
|
| 91 |
+ |
|
| 92 |
+manage_dirs_pattern(docker_t, docker_lock_t, docker_lock_t) |
|
| 93 |
+manage_files_pattern(docker_t, docker_lock_t, docker_lock_t) |
|
| 94 |
+files_lock_filetrans(docker_t, docker_lock_t, { dir file }, "lxc")
|
|
| 95 |
+ |
|
| 96 |
+manage_dirs_pattern(docker_t, docker_log_t, docker_log_t) |
|
| 97 |
+manage_files_pattern(docker_t, docker_log_t, docker_log_t) |
|
| 98 |
+manage_lnk_files_pattern(docker_t, docker_log_t, docker_log_t) |
|
| 99 |
+logging_log_filetrans(docker_t, docker_log_t, { dir file lnk_file })
|
|
| 100 |
+allow docker_t docker_log_t:dir_file_class_set { relabelfrom relabelto };
|
|
| 101 |
+ |
|
| 102 |
+manage_dirs_pattern(docker_t, docker_tmp_t, docker_tmp_t) |
|
| 103 |
+manage_files_pattern(docker_t, docker_tmp_t, docker_tmp_t) |
|
| 104 |
+manage_lnk_files_pattern(docker_t, docker_tmp_t, docker_tmp_t) |
|
| 105 |
+files_tmp_filetrans(docker_t, docker_tmp_t, { dir file lnk_file })
|
|
| 106 |
+ |
|
| 107 |
+manage_dirs_pattern(docker_t, docker_tmpfs_t, docker_tmpfs_t) |
|
| 108 |
+manage_files_pattern(docker_t, docker_tmpfs_t, docker_tmpfs_t) |
|
| 109 |
+manage_lnk_files_pattern(docker_t, docker_tmpfs_t, docker_tmpfs_t) |
|
| 110 |
+manage_fifo_files_pattern(docker_t, docker_tmpfs_t, docker_tmpfs_t) |
|
| 111 |
+manage_chr_files_pattern(docker_t, docker_tmpfs_t, docker_tmpfs_t) |
|
| 112 |
+manage_blk_files_pattern(docker_t, docker_tmpfs_t, docker_tmpfs_t) |
|
| 113 |
+allow docker_t docker_tmpfs_t:dir relabelfrom; |
|
| 114 |
+can_exec(docker_t, docker_tmpfs_t) |
|
| 115 |
+fs_tmpfs_filetrans(docker_t, docker_tmpfs_t, { dir file })
|
|
| 116 |
+allow docker_t docker_tmpfs_t:chr_file mounton; |
|
| 117 |
+ |
|
| 118 |
+manage_dirs_pattern(docker_t, docker_share_t, docker_share_t) |
|
| 119 |
+manage_files_pattern(docker_t, docker_share_t, docker_share_t) |
|
| 120 |
+manage_lnk_files_pattern(docker_t, docker_share_t, docker_share_t) |
|
| 121 |
+allow docker_t docker_share_t:dir_file_class_set { relabelfrom relabelto };
|
|
| 122 |
+ |
|
| 123 |
+can_exec(docker_t, docker_share_t) |
|
| 124 |
+#docker_filetrans_named_content(docker_t) |
|
| 125 |
+ |
|
| 126 |
+manage_dirs_pattern(docker_t, docker_var_lib_t, docker_var_lib_t) |
|
| 127 |
+manage_chr_files_pattern(docker_t, docker_var_lib_t, docker_var_lib_t) |
|
| 128 |
+manage_blk_files_pattern(docker_t, docker_var_lib_t, docker_var_lib_t) |
|
| 129 |
+manage_files_pattern(docker_t, docker_var_lib_t, docker_var_lib_t) |
|
| 130 |
+manage_lnk_files_pattern(docker_t, docker_var_lib_t, docker_var_lib_t) |
|
| 131 |
+allow docker_t docker_var_lib_t:dir_file_class_set { relabelfrom relabelto };
|
|
| 132 |
+files_var_lib_filetrans(docker_t, docker_var_lib_t, { dir file lnk_file })
|
|
| 133 |
+ |
|
| 134 |
+manage_dirs_pattern(docker_t, docker_var_run_t, docker_var_run_t) |
|
| 135 |
+manage_files_pattern(docker_t, docker_var_run_t, docker_var_run_t) |
|
| 136 |
+manage_sock_files_pattern(docker_t, docker_var_run_t, docker_var_run_t) |
|
| 137 |
+manage_lnk_files_pattern(docker_t, docker_var_run_t, docker_var_run_t) |
|
| 138 |
+files_pid_filetrans(docker_t, docker_var_run_t, { dir file lnk_file sock_file })
|
|
| 139 |
+ |
|
| 140 |
+allow docker_t docker_devpts_t:chr_file { relabelfrom rw_chr_file_perms setattr_chr_file_perms };
|
|
| 141 |
+term_create_pty(docker_t, docker_devpts_t) |
|
| 142 |
+ |
|
| 143 |
+kernel_read_system_state(docker_t) |
|
| 144 |
+kernel_read_network_state(docker_t) |
|
| 145 |
+kernel_read_all_sysctls(docker_t) |
|
| 146 |
+kernel_rw_net_sysctls(docker_t) |
|
| 147 |
+kernel_setsched(docker_t) |
|
| 148 |
+kernel_read_all_proc(docker_t) |
|
| 149 |
+ |
|
| 150 |
+domain_use_interactive_fds(docker_t) |
|
| 151 |
+domain_dontaudit_read_all_domains_state(docker_t) |
|
| 152 |
+ |
|
| 153 |
+corecmd_exec_bin(docker_t) |
|
| 154 |
+corecmd_exec_shell(docker_t) |
|
| 155 |
+ |
|
| 156 |
+corenet_tcp_bind_generic_node(docker_t) |
|
| 157 |
+corenet_tcp_sendrecv_generic_if(docker_t) |
|
| 158 |
+corenet_tcp_sendrecv_generic_node(docker_t) |
|
| 159 |
+corenet_tcp_sendrecv_generic_port(docker_t) |
|
| 160 |
+corenet_tcp_bind_all_ports(docker_t) |
|
| 161 |
+corenet_tcp_connect_http_port(docker_t) |
|
| 162 |
+corenet_tcp_connect_commplex_main_port(docker_t) |
|
| 163 |
+corenet_udp_sendrecv_generic_if(docker_t) |
|
| 164 |
+corenet_udp_sendrecv_generic_node(docker_t) |
|
| 165 |
+corenet_udp_sendrecv_all_ports(docker_t) |
|
| 166 |
+corenet_udp_bind_generic_node(docker_t) |
|
| 167 |
+corenet_udp_bind_all_ports(docker_t) |
|
| 168 |
+ |
|
| 169 |
+files_read_config_files(docker_t) |
|
| 170 |
+files_dontaudit_getattr_all_dirs(docker_t) |
|
| 171 |
+files_dontaudit_getattr_all_files(docker_t) |
|
| 172 |
+ |
|
| 173 |
+fs_read_cgroup_files(docker_t) |
|
| 174 |
+fs_read_tmpfs_symlinks(docker_t) |
|
| 175 |
+fs_search_all(docker_t) |
|
| 176 |
+fs_getattr_all_fs(docker_t) |
|
| 177 |
+ |
|
| 178 |
+storage_raw_rw_fixed_disk(docker_t) |
|
| 179 |
+ |
|
| 180 |
+auth_use_nsswitch(docker_t) |
|
| 181 |
+auth_dontaudit_getattr_shadow(docker_t) |
|
| 182 |
+ |
|
| 183 |
+init_read_state(docker_t) |
|
| 184 |
+init_status(docker_t) |
|
| 185 |
+ |
|
| 186 |
+logging_send_audit_msgs(docker_t) |
|
| 187 |
+logging_send_syslog_msg(docker_t) |
|
| 188 |
+ |
|
| 189 |
+miscfiles_read_localization(docker_t) |
|
| 190 |
+ |
|
| 191 |
+mount_domtrans(docker_t) |
|
| 192 |
+ |
|
| 193 |
+seutil_read_default_contexts(docker_t) |
|
| 194 |
+seutil_read_config(docker_t) |
|
| 195 |
+ |
|
| 196 |
+sysnet_dns_name_resolve(docker_t) |
|
| 197 |
+sysnet_exec_ifconfig(docker_t) |
|
| 198 |
+ |
|
| 199 |
+optional_policy(` |
|
| 200 |
+ rpm_exec(docker_t) |
|
| 201 |
+ rpm_read_db(docker_t) |
|
| 202 |
+ rpm_exec(docker_t) |
|
| 203 |
+') |
|
| 204 |
+ |
|
| 205 |
+optional_policy(` |
|
| 206 |
+ fstools_domtrans(docker_t) |
|
| 207 |
+') |
|
| 208 |
+ |
|
| 209 |
+optional_policy(` |
|
| 210 |
+ iptables_domtrans(docker_t) |
|
| 211 |
+') |
|
| 212 |
+ |
|
| 213 |
+optional_policy(` |
|
| 214 |
+ openvswitch_stream_connect(docker_t) |
|
| 215 |
+') |
|
| 216 |
+ |
|
| 217 |
+# |
|
| 218 |
+# lxc rules |
|
| 219 |
+# |
|
| 220 |
+ |
|
| 221 |
+allow docker_t self:capability { dac_override setgid setpcap setuid sys_admin sys_boot sys_chroot sys_ptrace };
|
|
| 222 |
+ |
|
| 223 |
+allow docker_t self:process { getcap setcap setexec setpgid setsched signal_perms };
|
|
| 224 |
+ |
|
| 225 |
+allow docker_t self:netlink_route_socket rw_netlink_socket_perms;; |
|
| 226 |
+allow docker_t self:netlink_audit_socket create_netlink_socket_perms; |
|
| 227 |
+allow docker_t self:unix_dgram_socket { create_socket_perms sendto };
|
|
| 228 |
+allow docker_t self:unix_stream_socket { create_stream_socket_perms connectto };
|
|
| 229 |
+ |
|
| 230 |
+allow docker_t docker_var_lib_t:dir mounton; |
|
| 231 |
+allow docker_t docker_var_lib_t:chr_file mounton; |
|
| 232 |
+can_exec(docker_t, docker_var_lib_t) |
|
| 233 |
+ |
|
| 234 |
+kernel_dontaudit_setsched(docker_t) |
|
| 235 |
+kernel_get_sysvipc_info(docker_t) |
|
| 236 |
+kernel_request_load_module(docker_t) |
|
| 237 |
+kernel_mounton_messages(docker_t) |
|
| 238 |
+kernel_mounton_all_proc(docker_t) |
|
| 239 |
+kernel_mounton_all_sysctls(docker_t) |
|
| 240 |
+kernel_unlabeled_entry_type(spc_t) |
|
| 241 |
+kernel_unlabeled_domtrans(docker_t, spc_t) |
|
| 242 |
+ |
|
| 243 |
+dev_getattr_all(docker_t) |
|
| 244 |
+dev_getattr_sysfs_fs(docker_t) |
|
| 245 |
+dev_read_urand(docker_t) |
|
| 246 |
+dev_read_lvm_control(docker_t) |
|
| 247 |
+dev_rw_sysfs(docker_t) |
|
| 248 |
+dev_rw_loop_control(docker_t) |
|
| 249 |
+dev_rw_lvm_control(docker_t) |
|
| 250 |
+ |
|
| 251 |
+files_getattr_isid_type_dirs(docker_t) |
|
| 252 |
+files_manage_isid_type_dirs(docker_t) |
|
| 253 |
+files_manage_isid_type_files(docker_t) |
|
| 254 |
+files_manage_isid_type_symlinks(docker_t) |
|
| 255 |
+files_manage_isid_type_chr_files(docker_t) |
|
| 256 |
+files_manage_isid_type_blk_files(docker_t) |
|
| 257 |
+files_exec_isid_files(docker_t) |
|
| 258 |
+files_mounton_isid(docker_t) |
|
| 259 |
+files_mounton_non_security(docker_t) |
|
| 260 |
+files_mounton_isid_type_chr_file(docker_t) |
|
| 261 |
+ |
|
| 262 |
+fs_mount_all_fs(docker_t) |
|
| 263 |
+fs_unmount_all_fs(docker_t) |
|
| 264 |
+fs_remount_all_fs(docker_t) |
|
| 265 |
+files_mounton_isid(docker_t) |
|
| 266 |
+fs_manage_cgroup_dirs(docker_t) |
|
| 267 |
+fs_manage_cgroup_files(docker_t) |
|
| 268 |
+fs_relabelfrom_xattr_fs(docker_t) |
|
| 269 |
+fs_relabelfrom_tmpfs(docker_t) |
|
| 270 |
+fs_read_tmpfs_symlinks(docker_t) |
|
| 271 |
+fs_list_hugetlbfs(docker_t) |
|
| 272 |
+ |
|
| 273 |
+term_use_generic_ptys(docker_t) |
|
| 274 |
+term_use_ptmx(docker_t) |
|
| 275 |
+term_getattr_pty_fs(docker_t) |
|
| 276 |
+term_relabel_pty_fs(docker_t) |
|
| 277 |
+term_mounton_unallocated_ttys(docker_t) |
|
| 278 |
+ |
|
| 279 |
+modutils_domtrans_insmod(docker_t) |
|
| 280 |
+ |
|
| 281 |
+systemd_status_all_unit_files(docker_t) |
|
| 282 |
+systemd_start_systemd_services(docker_t) |
|
| 283 |
+ |
|
| 284 |
+userdom_stream_connect(docker_t) |
|
| 285 |
+userdom_search_user_home_content(docker_t) |
|
| 286 |
+userdom_read_all_users_state(docker_t) |
|
| 287 |
+userdom_relabel_user_home_files(docker_t) |
|
| 288 |
+userdom_relabel_user_tmp_files(docker_t) |
|
| 289 |
+userdom_relabel_user_tmp_dirs(docker_t) |
|
| 290 |
+ |
|
| 291 |
+optional_policy(` |
|
| 292 |
+ gpm_getattr_gpmctl(docker_t) |
|
| 293 |
+') |
|
| 294 |
+ |
|
| 295 |
+optional_policy(` |
|
| 296 |
+ dbus_system_bus_client(docker_t) |
|
| 297 |
+ init_dbus_chat(docker_t) |
|
| 298 |
+ init_start_transient_unit(docker_t) |
|
| 299 |
+ |
|
| 300 |
+ optional_policy(` |
|
| 301 |
+ systemd_dbus_chat_logind(docker_t) |
|
| 302 |
+ systemd_dbus_chat_machined(docker_t) |
|
| 303 |
+ ') |
|
| 304 |
+ |
|
| 305 |
+ optional_policy(` |
|
| 306 |
+ firewalld_dbus_chat(docker_t) |
|
| 307 |
+ ') |
|
| 308 |
+') |
|
| 309 |
+ |
|
| 310 |
+optional_policy(` |
|
| 311 |
+ udev_read_db(docker_t) |
|
| 312 |
+') |
|
| 313 |
+ |
|
| 314 |
+optional_policy(` |
|
| 315 |
+ unconfined_domain(docker_t) |
|
| 316 |
+ unconfined_typebounds(docker_t) |
|
| 317 |
+') |
|
| 318 |
+ |
|
| 319 |
+optional_policy(` |
|
| 320 |
+ virt_read_config(docker_t) |
|
| 321 |
+ virt_exec(docker_t) |
|
| 322 |
+ virt_stream_connect(docker_t) |
|
| 323 |
+ virt_stream_connect_sandbox(docker_t) |
|
| 324 |
+ virt_exec_sandbox_files(docker_t) |
|
| 325 |
+ virt_manage_sandbox_files(docker_t) |
|
| 326 |
+ virt_relabel_sandbox_filesystem(docker_t) |
|
| 327 |
+ # for lxc |
|
| 328 |
+ virt_transition_svirt_sandbox(docker_t, system_r) |
|
| 329 |
+ virt_mounton_sandbox_file(docker_t) |
|
| 330 |
+# virt_attach_sandbox_tun_iface(docker_t) |
|
| 331 |
+ allow docker_t svirt_sandbox_domain:tun_socket relabelfrom; |
|
| 332 |
+ virt_sandbox_entrypoint(docker_t) |
|
| 333 |
+') |
|
| 334 |
+ |
|
| 335 |
+tunable_policy(`docker_connect_any',` |
|
| 336 |
+ corenet_tcp_connect_all_ports(docker_t) |
|
| 337 |
+ corenet_sendrecv_all_packets(docker_t) |
|
| 338 |
+ corenet_tcp_sendrecv_all_ports(docker_t) |
|
| 339 |
+') |
|
| 340 |
+ |
|
| 341 |
+######################################## |
|
| 342 |
+# |
|
| 343 |
+# spc local policy |
|
| 344 |
+# |
|
| 345 |
+allow spc_t { docker_var_lib_t docker_share_t }:file entrypoint;
|
|
| 346 |
+role system_r types spc_t; |
|
| 347 |
+ |
|
| 348 |
+domtrans_pattern(docker_t, docker_share_t, spc_t) |
|
| 349 |
+domtrans_pattern(docker_t, docker_var_lib_t, spc_t) |
|
| 350 |
+allow docker_t spc_t:process { setsched signal_perms };
|
|
| 351 |
+ps_process_pattern(docker_t, spc_t) |
|
| 352 |
+allow docker_t spc_t:socket_class_set { relabelto relabelfrom };
|
|
| 353 |
+filetrans_pattern(docker_t, docker_var_lib_t, docker_share_t, dir, "overlay") |
|
| 354 |
+ |
|
| 355 |
+optional_policy(` |
|
| 356 |
+ systemd_dbus_chat_machined(spc_t) |
|
| 357 |
+') |
|
| 358 |
+ |
|
| 359 |
+optional_policy(` |
|
| 360 |
+ dbus_chat_system_bus(spc_t) |
|
| 361 |
+') |
|
| 362 |
+ |
|
| 363 |
+optional_policy(` |
|
| 364 |
+ unconfined_domain_noaudit(spc_t) |
|
| 365 |
+') |
|
| 366 |
+ |
|
| 367 |
+optional_policy(` |
|
| 368 |
+ virt_transition_svirt_sandbox(spc_t, system_r) |
|
| 369 |
+ virt_sandbox_entrypoint(spc_t) |
|
| 370 |
+') |
|
| 371 |
+ |
|
| 372 |
+######################################## |
|
| 373 |
+# |
|
| 374 |
+# docker_auth local policy |
|
| 375 |
+# |
|
| 376 |
+allow docker_auth_t self:fifo_file rw_fifo_file_perms; |
|
| 377 |
+allow docker_auth_t self:unix_stream_socket create_stream_socket_perms; |
|
| 378 |
+dontaudit docker_auth_t self:capability net_admin; |
|
| 379 |
+ |
|
| 380 |
+docker_stream_connect(docker_auth_t) |
|
| 381 |
+ |
|
| 382 |
+manage_dirs_pattern(docker_auth_t, docker_plugin_var_run_t, docker_plugin_var_run_t) |
|
| 383 |
+manage_files_pattern(docker_auth_t, docker_plugin_var_run_t, docker_plugin_var_run_t) |
|
| 384 |
+manage_sock_files_pattern(docker_auth_t, docker_plugin_var_run_t, docker_plugin_var_run_t) |
|
| 385 |
+manage_lnk_files_pattern(docker_auth_t, docker_plugin_var_run_t, docker_plugin_var_run_t) |
|
| 386 |
+files_pid_filetrans(docker_auth_t, docker_plugin_var_run_t, { dir file lnk_file sock_file })
|
|
| 387 |
+ |
|
| 388 |
+domain_use_interactive_fds(docker_auth_t) |
|
| 389 |
+ |
|
| 390 |
+kernel_read_net_sysctls(docker_auth_t) |
|
| 391 |
+ |
|
| 392 |
+auth_use_nsswitch(docker_auth_t) |
|
| 393 |
+ |
|
| 394 |
+files_read_etc_files(docker_auth_t) |
|
| 395 |
+ |
|
| 396 |
+miscfiles_read_localization(docker_auth_t) |
|
| 397 |
+ |
|
| 398 |
+sysnet_dns_name_resolve(docker_auth_t) |
| 0 | 399 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,340 @@ |
| 0 |
+ GNU GENERAL PUBLIC LICENSE |
|
| 1 |
+ Version 2, June 1991 |
|
| 2 |
+ |
|
| 3 |
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc. |
|
| 4 |
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
| 5 |
+ Everyone is permitted to copy and distribute verbatim copies |
|
| 6 |
+ of this license document, but changing it is not allowed. |
|
| 7 |
+ |
|
| 8 |
+ Preamble |
|
| 9 |
+ |
|
| 10 |
+ The licenses for most software are designed to take away your |
|
| 11 |
+freedom to share and change it. By contrast, the GNU General Public |
|
| 12 |
+License is intended to guarantee your freedom to share and change free |
|
| 13 |
+software--to make sure the software is free for all its users. This |
|
| 14 |
+General Public License applies to most of the Free Software |
|
| 15 |
+Foundation's software and to any other program whose authors commit to |
|
| 16 |
+using it. (Some other Free Software Foundation software is covered by |
|
| 17 |
+the GNU Library General Public License instead.) You can apply it to |
|
| 18 |
+your programs, too. |
|
| 19 |
+ |
|
| 20 |
+ When we speak of free software, we are referring to freedom, not |
|
| 21 |
+price. Our General Public Licenses are designed to make sure that you |
|
| 22 |
+have the freedom to distribute copies of free software (and charge for |
|
| 23 |
+this service if you wish), that you receive source code or can get it |
|
| 24 |
+if you want it, that you can change the software or use pieces of it |
|
| 25 |
+in new free programs; and that you know you can do these things. |
|
| 26 |
+ |
|
| 27 |
+ To protect your rights, we need to make restrictions that forbid |
|
| 28 |
+anyone to deny you these rights or to ask you to surrender the rights. |
|
| 29 |
+These restrictions translate to certain responsibilities for you if you |
|
| 30 |
+distribute copies of the software, or if you modify it. |
|
| 31 |
+ |
|
| 32 |
+ For example, if you distribute copies of such a program, whether |
|
| 33 |
+gratis or for a fee, you must give the recipients all the rights that |
|
| 34 |
+you have. You must make sure that they, too, receive or can get the |
|
| 35 |
+source code. And you must show them these terms so they know their |
|
| 36 |
+rights. |
|
| 37 |
+ |
|
| 38 |
+ We protect your rights with two steps: (1) copyright the software, and |
|
| 39 |
+(2) offer you this license which gives you legal permission to copy, |
|
| 40 |
+distribute and/or modify the software. |
|
| 41 |
+ |
|
| 42 |
+ Also, for each author's protection and ours, we want to make certain |
|
| 43 |
+that everyone understands that there is no warranty for this free |
|
| 44 |
+software. If the software is modified by someone else and passed on, we |
|
| 45 |
+want its recipients to know that what they have is not the original, so |
|
| 46 |
+that any problems introduced by others will not reflect on the original |
|
| 47 |
+authors' reputations. |
|
| 48 |
+ |
|
| 49 |
+ Finally, any free program is threatened constantly by software |
|
| 50 |
+patents. We wish to avoid the danger that redistributors of a free |
|
| 51 |
+program will individually obtain patent licenses, in effect making the |
|
| 52 |
+program proprietary. To prevent this, we have made it clear that any |
|
| 53 |
+patent must be licensed for everyone's free use or not licensed at all. |
|
| 54 |
+ |
|
| 55 |
+ The precise terms and conditions for copying, distribution and |
|
| 56 |
+modification follow. |
|
| 57 |
+ |
|
| 58 |
+ GNU GENERAL PUBLIC LICENSE |
|
| 59 |
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION |
|
| 60 |
+ |
|
| 61 |
+ 0. This License applies to any program or other work which contains |
|
| 62 |
+a notice placed by the copyright holder saying it may be distributed |
|
| 63 |
+under the terms of this General Public License. The "Program", below, |
|
| 64 |
+refers to any such program or work, and a "work based on the Program" |
|
| 65 |
+means either the Program or any derivative work under copyright law: |
|
| 66 |
+that is to say, a work containing the Program or a portion of it, |
|
| 67 |
+either verbatim or with modifications and/or translated into another |
|
| 68 |
+language. (Hereinafter, translation is included without limitation in |
|
| 69 |
+the term "modification".) Each licensee is addressed as "you". |
|
| 70 |
+ |
|
| 71 |
+Activities other than copying, distribution and modification are not |
|
| 72 |
+covered by this License; they are outside its scope. The act of |
|
| 73 |
+running the Program is not restricted, and the output from the Program |
|
| 74 |
+is covered only if its contents constitute a work based on the |
|
| 75 |
+Program (independent of having been made by running the Program). |
|
| 76 |
+Whether that is true depends on what the Program does. |
|
| 77 |
+ |
|
| 78 |
+ 1. You may copy and distribute verbatim copies of the Program's |
|
| 79 |
+source code as you receive it, in any medium, provided that you |
|
| 80 |
+conspicuously and appropriately publish on each copy an appropriate |
|
| 81 |
+copyright notice and disclaimer of warranty; keep intact all the |
|
| 82 |
+notices that refer to this License and to the absence of any warranty; |
|
| 83 |
+and give any other recipients of the Program a copy of this License |
|
| 84 |
+along with the Program. |
|
| 85 |
+ |
|
| 86 |
+You may charge a fee for the physical act of transferring a copy, and |
|
| 87 |
+you may at your option offer warranty protection in exchange for a fee. |
|
| 88 |
+ |
|
| 89 |
+ 2. You may modify your copy or copies of the Program or any portion |
|
| 90 |
+of it, thus forming a work based on the Program, and copy and |
|
| 91 |
+distribute such modifications or work under the terms of Section 1 |
|
| 92 |
+above, provided that you also meet all of these conditions: |
|
| 93 |
+ |
|
| 94 |
+ a) You must cause the modified files to carry prominent notices |
|
| 95 |
+ stating that you changed the files and the date of any change. |
|
| 96 |
+ |
|
| 97 |
+ b) You must cause any work that you distribute or publish, that in |
|
| 98 |
+ whole or in part contains or is derived from the Program or any |
|
| 99 |
+ part thereof, to be licensed as a whole at no charge to all third |
|
| 100 |
+ parties under the terms of this License. |
|
| 101 |
+ |
|
| 102 |
+ c) If the modified program normally reads commands interactively |
|
| 103 |
+ when run, you must cause it, when started running for such |
|
| 104 |
+ interactive use in the most ordinary way, to print or display an |
|
| 105 |
+ announcement including an appropriate copyright notice and a |
|
| 106 |
+ notice that there is no warranty (or else, saying that you provide |
|
| 107 |
+ a warranty) and that users may redistribute the program under |
|
| 108 |
+ these conditions, and telling the user how to view a copy of this |
|
| 109 |
+ License. (Exception: if the Program itself is interactive but |
|
| 110 |
+ does not normally print such an announcement, your work based on |
|
| 111 |
+ the Program is not required to print an announcement.) |
|
| 112 |
+ |
|
| 113 |
+These requirements apply to the modified work as a whole. If |
|
| 114 |
+identifiable sections of that work are not derived from the Program, |
|
| 115 |
+and can be reasonably considered independent and separate works in |
|
| 116 |
+themselves, then this License, and its terms, do not apply to those |
|
| 117 |
+sections when you distribute them as separate works. But when you |
|
| 118 |
+distribute the same sections as part of a whole which is a work based |
|
| 119 |
+on the Program, the distribution of the whole must be on the terms of |
|
| 120 |
+this License, whose permissions for other licensees extend to the |
|
| 121 |
+entire whole, and thus to each and every part regardless of who wrote it. |
|
| 122 |
+ |
|
| 123 |
+Thus, it is not the intent of this section to claim rights or contest |
|
| 124 |
+your rights to work written entirely by you; rather, the intent is to |
|
| 125 |
+exercise the right to control the distribution of derivative or |
|
| 126 |
+collective works based on the Program. |
|
| 127 |
+ |
|
| 128 |
+In addition, mere aggregation of another work not based on the Program |
|
| 129 |
+with the Program (or with a work based on the Program) on a volume of |
|
| 130 |
+a storage or distribution medium does not bring the other work under |
|
| 131 |
+the scope of this License. |
|
| 132 |
+ |
|
| 133 |
+ 3. You may copy and distribute the Program (or a work based on it, |
|
| 134 |
+under Section 2) in object code or executable form under the terms of |
|
| 135 |
+Sections 1 and 2 above provided that you also do one of the following: |
|
| 136 |
+ |
|
| 137 |
+ a) Accompany it with the complete corresponding machine-readable |
|
| 138 |
+ source code, which must be distributed under the terms of Sections |
|
| 139 |
+ 1 and 2 above on a medium customarily used for software interchange; or, |
|
| 140 |
+ |
|
| 141 |
+ b) Accompany it with a written offer, valid for at least three |
|
| 142 |
+ years, to give any third party, for a charge no more than your |
|
| 143 |
+ cost of physically performing source distribution, a complete |
|
| 144 |
+ machine-readable copy of the corresponding source code, to be |
|
| 145 |
+ distributed under the terms of Sections 1 and 2 above on a medium |
|
| 146 |
+ customarily used for software interchange; or, |
|
| 147 |
+ |
|
| 148 |
+ c) Accompany it with the information you received as to the offer |
|
| 149 |
+ to distribute corresponding source code. (This alternative is |
|
| 150 |
+ allowed only for noncommercial distribution and only if you |
|
| 151 |
+ received the program in object code or executable form with such |
|
| 152 |
+ an offer, in accord with Subsection b above.) |
|
| 153 |
+ |
|
| 154 |
+The source code for a work means the preferred form of the work for |
|
| 155 |
+making modifications to it. For an executable work, complete source |
|
| 156 |
+code means all the source code for all modules it contains, plus any |
|
| 157 |
+associated interface definition files, plus the scripts used to |
|
| 158 |
+control compilation and installation of the executable. However, as a |
|
| 159 |
+special exception, the source code distributed need not include |
|
| 160 |
+anything that is normally distributed (in either source or binary |
|
| 161 |
+form) with the major components (compiler, kernel, and so on) of the |
|
| 162 |
+operating system on which the executable runs, unless that component |
|
| 163 |
+itself accompanies the executable. |
|
| 164 |
+ |
|
| 165 |
+If distribution of executable or object code is made by offering |
|
| 166 |
+access to copy from a designated place, then offering equivalent |
|
| 167 |
+access to copy the source code from the same place counts as |
|
| 168 |
+distribution of the source code, even though third parties are not |
|
| 169 |
+compelled to copy the source along with the object code. |
|
| 170 |
+ |
|
| 171 |
+ 4. You may not copy, modify, sublicense, or distribute the Program |
|
| 172 |
+except as expressly provided under this License. Any attempt |
|
| 173 |
+otherwise to copy, modify, sublicense or distribute the Program is |
|
| 174 |
+void, and will automatically terminate your rights under this License. |
|
| 175 |
+However, parties who have received copies, or rights, from you under |
|
| 176 |
+this License will not have their licenses terminated so long as such |
|
| 177 |
+parties remain in full compliance. |
|
| 178 |
+ |
|
| 179 |
+ 5. You are not required to accept this License, since you have not |
|
| 180 |
+signed it. However, nothing else grants you permission to modify or |
|
| 181 |
+distribute the Program or its derivative works. These actions are |
|
| 182 |
+prohibited by law if you do not accept this License. Therefore, by |
|
| 183 |
+modifying or distributing the Program (or any work based on the |
|
| 184 |
+Program), you indicate your acceptance of this License to do so, and |
|
| 185 |
+all its terms and conditions for copying, distributing or modifying |
|
| 186 |
+the Program or works based on it. |
|
| 187 |
+ |
|
| 188 |
+ 6. Each time you redistribute the Program (or any work based on the |
|
| 189 |
+Program), the recipient automatically receives a license from the |
|
| 190 |
+original licensor to copy, distribute or modify the Program subject to |
|
| 191 |
+these terms and conditions. You may not impose any further |
|
| 192 |
+restrictions on the recipients' exercise of the rights granted herein. |
|
| 193 |
+You are not responsible for enforcing compliance by third parties to |
|
| 194 |
+this License. |
|
| 195 |
+ |
|
| 196 |
+ 7. If, as a consequence of a court judgment or allegation of patent |
|
| 197 |
+infringement or for any other reason (not limited to patent issues), |
|
| 198 |
+conditions are imposed on you (whether by court order, agreement or |
|
| 199 |
+otherwise) that contradict the conditions of this License, they do not |
|
| 200 |
+excuse you from the conditions of this License. If you cannot |
|
| 201 |
+distribute so as to satisfy simultaneously your obligations under this |
|
| 202 |
+License and any other pertinent obligations, then as a consequence you |
|
| 203 |
+may not distribute the Program at all. For example, if a patent |
|
| 204 |
+license would not permit royalty-free redistribution of the Program by |
|
| 205 |
+all those who receive copies directly or indirectly through you, then |
|
| 206 |
+the only way you could satisfy both it and this License would be to |
|
| 207 |
+refrain entirely from distribution of the Program. |
|
| 208 |
+ |
|
| 209 |
+If any portion of this section is held invalid or unenforceable under |
|
| 210 |
+any particular circumstance, the balance of the section is intended to |
|
| 211 |
+apply and the section as a whole is intended to apply in other |
|
| 212 |
+circumstances. |
|
| 213 |
+ |
|
| 214 |
+It is not the purpose of this section to induce you to infringe any |
|
| 215 |
+patents or other property right claims or to contest validity of any |
|
| 216 |
+such claims; this section has the sole purpose of protecting the |
|
| 217 |
+integrity of the free software distribution system, which is |
|
| 218 |
+implemented by public license practices. Many people have made |
|
| 219 |
+generous contributions to the wide range of software distributed |
|
| 220 |
+through that system in reliance on consistent application of that |
|
| 221 |
+system; it is up to the author/donor to decide if he or she is willing |
|
| 222 |
+to distribute software through any other system and a licensee cannot |
|
| 223 |
+impose that choice. |
|
| 224 |
+ |
|
| 225 |
+This section is intended to make thoroughly clear what is believed to |
|
| 226 |
+be a consequence of the rest of this License. |
|
| 227 |
+ |
|
| 228 |
+ 8. If the distribution and/or use of the Program is restricted in |
|
| 229 |
+certain countries either by patents or by copyrighted interfaces, the |
|
| 230 |
+original copyright holder who places the Program under this License |
|
| 231 |
+may add an explicit geographical distribution limitation excluding |
|
| 232 |
+those countries, so that distribution is permitted only in or among |
|
| 233 |
+countries not thus excluded. In such case, this License incorporates |
|
| 234 |
+the limitation as if written in the body of this License. |
|
| 235 |
+ |
|
| 236 |
+ 9. The Free Software Foundation may publish revised and/or new versions |
|
| 237 |
+of the General Public License from time to time. Such new versions will |
|
| 238 |
+be similar in spirit to the present version, but may differ in detail to |
|
| 239 |
+address new problems or concerns. |
|
| 240 |
+ |
|
| 241 |
+Each version is given a distinguishing version number. If the Program |
|
| 242 |
+specifies a version number of this License which applies to it and "any |
|
| 243 |
+later version", you have the option of following the terms and conditions |
|
| 244 |
+either of that version or of any later version published by the Free |
|
| 245 |
+Software Foundation. If the Program does not specify a version number of |
|
| 246 |
+this License, you may choose any version ever published by the Free Software |
|
| 247 |
+Foundation. |
|
| 248 |
+ |
|
| 249 |
+ 10. If you wish to incorporate parts of the Program into other free |
|
| 250 |
+programs whose distribution conditions are different, write to the author |
|
| 251 |
+to ask for permission. For software which is copyrighted by the Free |
|
| 252 |
+Software Foundation, write to the Free Software Foundation; we sometimes |
|
| 253 |
+make exceptions for this. Our decision will be guided by the two goals |
|
| 254 |
+of preserving the free status of all derivatives of our free software and |
|
| 255 |
+of promoting the sharing and reuse of software generally. |
|
| 256 |
+ |
|
| 257 |
+ NO WARRANTY |
|
| 258 |
+ |
|
| 259 |
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY |
|
| 260 |
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN |
|
| 261 |
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES |
|
| 262 |
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED |
|
| 263 |
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
|
| 264 |
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS |
|
| 265 |
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE |
|
| 266 |
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, |
|
| 267 |
+REPAIR OR CORRECTION. |
|
| 268 |
+ |
|
| 269 |
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
|
| 270 |
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR |
|
| 271 |
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, |
|
| 272 |
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING |
|
| 273 |
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED |
|
| 274 |
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY |
|
| 275 |
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER |
|
| 276 |
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE |
|
| 277 |
+POSSIBILITY OF SUCH DAMAGES. |
|
| 278 |
+ |
|
| 279 |
+ END OF TERMS AND CONDITIONS |
|
| 280 |
+ |
|
| 281 |
+ How to Apply These Terms to Your New Programs |
|
| 282 |
+ |
|
| 283 |
+ If you develop a new program, and you want it to be of the greatest |
|
| 284 |
+possible use to the public, the best way to achieve this is to make it |
|
| 285 |
+free software which everyone can redistribute and change under these terms. |
|
| 286 |
+ |
|
| 287 |
+ To do so, attach the following notices to the program. It is safest |
|
| 288 |
+to attach them to the start of each source file to most effectively |
|
| 289 |
+convey the exclusion of warranty; and each file should have at least |
|
| 290 |
+the "copyright" line and a pointer to where the full notice is found. |
|
| 291 |
+ |
|
| 292 |
+ <one line to give the program's name and a brief idea of what it does.> |
|
| 293 |
+ Copyright (C) <year> <name of author> |
|
| 294 |
+ |
|
| 295 |
+ This program is free software; you can redistribute it and/or modify |
|
| 296 |
+ it under the terms of the GNU General Public License as published by |
|
| 297 |
+ the Free Software Foundation; either version 2 of the License, or |
|
| 298 |
+ (at your option) any later version. |
|
| 299 |
+ |
|
| 300 |
+ This program is distributed in the hope that it will be useful, |
|
| 301 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 302 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 303 |
+ GNU General Public License for more details. |
|
| 304 |
+ |
|
| 305 |
+ You should have received a copy of the GNU General Public License |
|
| 306 |
+ along with this program; if not, write to the Free Software |
|
| 307 |
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
| 308 |
+ |
|
| 309 |
+ |
|
| 310 |
+Also add information on how to contact you by electronic and paper mail. |
|
| 311 |
+ |
|
| 312 |
+If the program is interactive, make it output a short notice like this |
|
| 313 |
+when it starts in an interactive mode: |
|
| 314 |
+ |
|
| 315 |
+ Gnomovision version 69, Copyright (C) year name of author |
|
| 316 |
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. |
|
| 317 |
+ This is free software, and you are welcome to redistribute it |
|
| 318 |
+ under certain conditions; type `show c' for details. |
|
| 319 |
+ |
|
| 320 |
+The hypothetical commands `show w' and `show c' should show the appropriate |
|
| 321 |
+parts of the General Public License. Of course, the commands you use may |
|
| 322 |
+be called something other than `show w' and `show c'; they could even be |
|
| 323 |
+mouse-clicks or menu items--whatever suits your program. |
|
| 324 |
+ |
|
| 325 |
+You should also get your employer (if you work as a programmer) or your |
|
| 326 |
+school, if any, to sign a "copyright disclaimer" for the program, if |
|
| 327 |
+necessary. Here is a sample; alter the names: |
|
| 328 |
+ |
|
| 329 |
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program |
|
| 330 |
+ `Gnomovision' (which makes passes at compilers) written by James Hacker. |
|
| 331 |
+ |
|
| 332 |
+ <signature of Ty Coon>, 1 April 1989 |
|
| 333 |
+ Ty Coon, President of Vice |
|
| 334 |
+ |
|
| 335 |
+This General Public License does not permit incorporating your program into |
|
| 336 |
+proprietary programs. If your program is a subroutine library, you may |
|
| 337 |
+consider it more useful to permit linking proprietary applications with the |
|
| 338 |
+library. If this is what you want to do, use the GNU Library General |
|
| 339 |
+Public License instead of this License. |
| 0 | 340 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,16 @@ |
| 0 |
+TARGETS?=docker |
|
| 1 |
+MODULES?=${TARGETS:=.pp.bz2}
|
|
| 2 |
+SHAREDIR?=/usr/share |
|
| 3 |
+ |
|
| 4 |
+all: ${TARGETS:=.pp.bz2}
|
|
| 5 |
+ |
|
| 6 |
+%.pp.bz2: %.pp |
|
| 7 |
+ @echo Compressing $^ -\> $@ |
|
| 8 |
+ bzip2 -9 $^ |
|
| 9 |
+ |
|
| 10 |
+%.pp: %.te |
|
| 11 |
+ make -f ${SHAREDIR}/selinux/devel/Makefile $@
|
|
| 12 |
+ |
|
| 13 |
+clean: |
|
| 14 |
+ rm -f *~ *.tc *.pp *.pp.bz2 |
|
| 15 |
+ rm -rf tmp *.tar.gz |
| 0 | 16 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,20 @@ |
| 0 |
+/root/\.docker gen_context(system_u:object_r:docker_home_t,s0) |
|
| 1 |
+ |
|
| 2 |
+/usr/bin/dockerd -- gen_context(system_u:object_r:docker_exec_t,s0) |
|
| 3 |
+ |
|
| 4 |
+/usr/lib/systemd/system/docker.service -- gen_context(system_u:object_r:docker_unit_file_t,s0) |
|
| 5 |
+ |
|
| 6 |
+/etc/docker(/.*)? gen_context(system_u:object_r:docker_config_t,s0) |
|
| 7 |
+ |
|
| 8 |
+/var/lib/docker(/.*)? gen_context(system_u:object_r:docker_var_lib_t,s0) |
|
| 9 |
+/var/lib/kublet(/.*)? gen_context(system_u:object_r:docker_var_lib_t,s0) |
|
| 10 |
+/var/lib/docker/vfs(/.*)? gen_context(system_u:object_r:svirt_sandbox_file_t,s0) |
|
| 11 |
+ |
|
| 12 |
+/var/run/docker\.pid -- gen_context(system_u:object_r:docker_var_run_t,s0) |
|
| 13 |
+/var/run/docker\.sock -s gen_context(system_u:object_r:docker_var_run_t,s0) |
|
| 14 |
+/var/run/docker-client(/.*)? gen_context(system_u:object_r:docker_var_run_t,s0) |
|
| 15 |
+ |
|
| 16 |
+/var/lib/docker/init(/.*)? gen_context(system_u:object_r:docker_share_t,s0) |
|
| 17 |
+/var/lib/docker/containers/.*/hosts gen_context(system_u:object_r:docker_share_t,s0) |
|
| 18 |
+/var/lib/docker/containers/.*/hostname gen_context(system_u:object_r:docker_share_t,s0) |
|
| 19 |
+/var/lib/docker/.*/config\.env gen_context(system_u:object_r:docker_share_t,s0) |
| 0 | 20 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,461 @@ |
| 0 |
+ |
|
| 1 |
+## <summary>The open-source application container engine.</summary> |
|
| 2 |
+ |
|
| 3 |
+######################################## |
|
| 4 |
+## <summary> |
|
| 5 |
+## Execute docker in the docker domain. |
|
| 6 |
+## </summary> |
|
| 7 |
+## <param name="domain"> |
|
| 8 |
+## <summary> |
|
| 9 |
+## Domain allowed to transition. |
|
| 10 |
+## </summary> |
|
| 11 |
+## </param> |
|
| 12 |
+# |
|
| 13 |
+interface(`docker_domtrans',` |
|
| 14 |
+ gen_require(` |
|
| 15 |
+ type docker_t, docker_exec_t; |
|
| 16 |
+ ') |
|
| 17 |
+ |
|
| 18 |
+ corecmd_search_bin($1) |
|
| 19 |
+ domtrans_pattern($1, docker_exec_t, docker_t) |
|
| 20 |
+') |
|
| 21 |
+ |
|
| 22 |
+######################################## |
|
| 23 |
+## <summary> |
|
| 24 |
+## Execute docker in the caller domain. |
|
| 25 |
+## </summary> |
|
| 26 |
+## <param name="domain"> |
|
| 27 |
+## <summary> |
|
| 28 |
+## Domain allowed to transition. |
|
| 29 |
+## </summary> |
|
| 30 |
+## </param> |
|
| 31 |
+# |
|
| 32 |
+interface(`docker_exec',` |
|
| 33 |
+ gen_require(` |
|
| 34 |
+ type docker_exec_t; |
|
| 35 |
+ ') |
|
| 36 |
+ |
|
| 37 |
+ corecmd_search_bin($1) |
|
| 38 |
+ can_exec($1, docker_exec_t) |
|
| 39 |
+') |
|
| 40 |
+ |
|
| 41 |
+######################################## |
|
| 42 |
+## <summary> |
|
| 43 |
+## Search docker lib directories. |
|
| 44 |
+## </summary> |
|
| 45 |
+## <param name="domain"> |
|
| 46 |
+## <summary> |
|
| 47 |
+## Domain allowed access. |
|
| 48 |
+## </summary> |
|
| 49 |
+## </param> |
|
| 50 |
+# |
|
| 51 |
+interface(`docker_search_lib',` |
|
| 52 |
+ gen_require(` |
|
| 53 |
+ type docker_var_lib_t; |
|
| 54 |
+ ') |
|
| 55 |
+ |
|
| 56 |
+ allow $1 docker_var_lib_t:dir search_dir_perms; |
|
| 57 |
+ files_search_var_lib($1) |
|
| 58 |
+') |
|
| 59 |
+ |
|
| 60 |
+######################################## |
|
| 61 |
+## <summary> |
|
| 62 |
+## Execute docker lib directories. |
|
| 63 |
+## </summary> |
|
| 64 |
+## <param name="domain"> |
|
| 65 |
+## <summary> |
|
| 66 |
+## Domain allowed access. |
|
| 67 |
+## </summary> |
|
| 68 |
+## </param> |
|
| 69 |
+# |
|
| 70 |
+interface(`docker_exec_lib',` |
|
| 71 |
+ gen_require(` |
|
| 72 |
+ type docker_var_lib_t; |
|
| 73 |
+ ') |
|
| 74 |
+ |
|
| 75 |
+ allow $1 docker_var_lib_t:dir search_dir_perms; |
|
| 76 |
+ can_exec($1, docker_var_lib_t) |
|
| 77 |
+') |
|
| 78 |
+ |
|
| 79 |
+######################################## |
|
| 80 |
+## <summary> |
|
| 81 |
+## Read docker lib files. |
|
| 82 |
+## </summary> |
|
| 83 |
+## <param name="domain"> |
|
| 84 |
+## <summary> |
|
| 85 |
+## Domain allowed access. |
|
| 86 |
+## </summary> |
|
| 87 |
+## </param> |
|
| 88 |
+# |
|
| 89 |
+interface(`docker_read_lib_files',` |
|
| 90 |
+ gen_require(` |
|
| 91 |
+ type docker_var_lib_t; |
|
| 92 |
+ ') |
|
| 93 |
+ |
|
| 94 |
+ files_search_var_lib($1) |
|
| 95 |
+ read_files_pattern($1, docker_var_lib_t, docker_var_lib_t) |
|
| 96 |
+') |
|
| 97 |
+ |
|
| 98 |
+######################################## |
|
| 99 |
+## <summary> |
|
| 100 |
+## Read docker share files. |
|
| 101 |
+## </summary> |
|
| 102 |
+## <param name="domain"> |
|
| 103 |
+## <summary> |
|
| 104 |
+## Domain allowed access. |
|
| 105 |
+## </summary> |
|
| 106 |
+## </param> |
|
| 107 |
+# |
|
| 108 |
+interface(`docker_read_share_files',` |
|
| 109 |
+ gen_require(` |
|
| 110 |
+ type docker_share_t; |
|
| 111 |
+ ') |
|
| 112 |
+ |
|
| 113 |
+ files_search_var_lib($1) |
|
| 114 |
+ read_files_pattern($1, docker_share_t, docker_share_t) |
|
| 115 |
+') |
|
| 116 |
+ |
|
| 117 |
+######################################## |
|
| 118 |
+## <summary> |
|
| 119 |
+## Manage docker lib files. |
|
| 120 |
+## </summary> |
|
| 121 |
+## <param name="domain"> |
|
| 122 |
+## <summary> |
|
| 123 |
+## Domain allowed access. |
|
| 124 |
+## </summary> |
|
| 125 |
+## </param> |
|
| 126 |
+# |
|
| 127 |
+interface(`docker_manage_lib_files',` |
|
| 128 |
+ gen_require(` |
|
| 129 |
+ type docker_var_lib_t; |
|
| 130 |
+ ') |
|
| 131 |
+ |
|
| 132 |
+ files_search_var_lib($1) |
|
| 133 |
+ manage_files_pattern($1, docker_var_lib_t, docker_var_lib_t) |
|
| 134 |
+ manage_lnk_files_pattern($1, docker_var_lib_t, docker_var_lib_t) |
|
| 135 |
+') |
|
| 136 |
+ |
|
| 137 |
+######################################## |
|
| 138 |
+## <summary> |
|
| 139 |
+## Manage docker lib directories. |
|
| 140 |
+## </summary> |
|
| 141 |
+## <param name="domain"> |
|
| 142 |
+## <summary> |
|
| 143 |
+## Domain allowed access. |
|
| 144 |
+## </summary> |
|
| 145 |
+## </param> |
|
| 146 |
+# |
|
| 147 |
+interface(`docker_manage_lib_dirs',` |
|
| 148 |
+ gen_require(` |
|
| 149 |
+ type docker_var_lib_t; |
|
| 150 |
+ ') |
|
| 151 |
+ |
|
| 152 |
+ files_search_var_lib($1) |
|
| 153 |
+ manage_dirs_pattern($1, docker_var_lib_t, docker_var_lib_t) |
|
| 154 |
+') |
|
| 155 |
+ |
|
| 156 |
+######################################## |
|
| 157 |
+## <summary> |
|
| 158 |
+## Create objects in a docker var lib directory |
|
| 159 |
+## with an automatic type transition to |
|
| 160 |
+## a specified private type. |
|
| 161 |
+## </summary> |
|
| 162 |
+## <param name="domain"> |
|
| 163 |
+## <summary> |
|
| 164 |
+## Domain allowed access. |
|
| 165 |
+## </summary> |
|
| 166 |
+## </param> |
|
| 167 |
+## <param name="private_type"> |
|
| 168 |
+## <summary> |
|
| 169 |
+## The type of the object to create. |
|
| 170 |
+## </summary> |
|
| 171 |
+## </param> |
|
| 172 |
+## <param name="object_class"> |
|
| 173 |
+## <summary> |
|
| 174 |
+## The class of the object to be created. |
|
| 175 |
+## </summary> |
|
| 176 |
+## </param> |
|
| 177 |
+## <param name="name" optional="true"> |
|
| 178 |
+## <summary> |
|
| 179 |
+## The name of the object being created. |
|
| 180 |
+## </summary> |
|
| 181 |
+## </param> |
|
| 182 |
+# |
|
| 183 |
+interface(`docker_lib_filetrans',` |
|
| 184 |
+ gen_require(` |
|
| 185 |
+ type docker_var_lib_t; |
|
| 186 |
+ ') |
|
| 187 |
+ |
|
| 188 |
+ filetrans_pattern($1, docker_var_lib_t, $2, $3, $4) |
|
| 189 |
+') |
|
| 190 |
+ |
|
| 191 |
+######################################## |
|
| 192 |
+## <summary> |
|
| 193 |
+## Read docker PID files. |
|
| 194 |
+## </summary> |
|
| 195 |
+## <param name="domain"> |
|
| 196 |
+## <summary> |
|
| 197 |
+## Domain allowed access. |
|
| 198 |
+## </summary> |
|
| 199 |
+## </param> |
|
| 200 |
+# |
|
| 201 |
+interface(`docker_read_pid_files',` |
|
| 202 |
+ gen_require(` |
|
| 203 |
+ type docker_var_run_t; |
|
| 204 |
+ ') |
|
| 205 |
+ |
|
| 206 |
+ files_search_pids($1) |
|
| 207 |
+ read_files_pattern($1, docker_var_run_t, docker_var_run_t) |
|
| 208 |
+') |
|
| 209 |
+ |
|
| 210 |
+######################################## |
|
| 211 |
+## <summary> |
|
| 212 |
+## Execute docker server in the docker domain. |
|
| 213 |
+## </summary> |
|
| 214 |
+## <param name="domain"> |
|
| 215 |
+## <summary> |
|
| 216 |
+## Domain allowed to transition. |
|
| 217 |
+## </summary> |
|
| 218 |
+## </param> |
|
| 219 |
+# |
|
| 220 |
+interface(`docker_systemctl',` |
|
| 221 |
+ gen_require(` |
|
| 222 |
+ type docker_t; |
|
| 223 |
+ type docker_unit_file_t; |
|
| 224 |
+ ') |
|
| 225 |
+ |
|
| 226 |
+ systemd_exec_systemctl($1) |
|
| 227 |
+ init_reload_services($1) |
|
| 228 |
+ systemd_read_fifo_file_passwd_run($1) |
|
| 229 |
+ allow $1 docker_unit_file_t:file read_file_perms; |
|
| 230 |
+ allow $1 docker_unit_file_t:service manage_service_perms; |
|
| 231 |
+ |
|
| 232 |
+ ps_process_pattern($1, docker_t) |
|
| 233 |
+') |
|
| 234 |
+ |
|
| 235 |
+######################################## |
|
| 236 |
+## <summary> |
|
| 237 |
+## Read and write docker shared memory. |
|
| 238 |
+## </summary> |
|
| 239 |
+## <param name="domain"> |
|
| 240 |
+## <summary> |
|
| 241 |
+## Domain allowed access. |
|
| 242 |
+## </summary> |
|
| 243 |
+## </param> |
|
| 244 |
+# |
|
| 245 |
+interface(`docker_rw_sem',` |
|
| 246 |
+ gen_require(` |
|
| 247 |
+ type docker_t; |
|
| 248 |
+ ') |
|
| 249 |
+ |
|
| 250 |
+ allow $1 docker_t:sem rw_sem_perms; |
|
| 251 |
+') |
|
| 252 |
+ |
|
| 253 |
+####################################### |
|
| 254 |
+## <summary> |
|
| 255 |
+## Read and write the docker pty type. |
|
| 256 |
+## </summary> |
|
| 257 |
+## <param name="domain"> |
|
| 258 |
+## <summary> |
|
| 259 |
+## Domain allowed access. |
|
| 260 |
+## </summary> |
|
| 261 |
+## </param> |
|
| 262 |
+# |
|
| 263 |
+interface(`docker_use_ptys',` |
|
| 264 |
+ gen_require(` |
|
| 265 |
+ type docker_devpts_t; |
|
| 266 |
+ ') |
|
| 267 |
+ |
|
| 268 |
+ allow $1 docker_devpts_t:chr_file rw_term_perms; |
|
| 269 |
+') |
|
| 270 |
+ |
|
| 271 |
+####################################### |
|
| 272 |
+## <summary> |
|
| 273 |
+## Allow domain to create docker content |
|
| 274 |
+## </summary> |
|
| 275 |
+## <param name="domain"> |
|
| 276 |
+## <summary> |
|
| 277 |
+## Domain allowed access. |
|
| 278 |
+## </summary> |
|
| 279 |
+## </param> |
|
| 280 |
+# |
|
| 281 |
+interface(`docker_filetrans_named_content',` |
|
| 282 |
+ |
|
| 283 |
+ gen_require(` |
|
| 284 |
+ type docker_var_lib_t; |
|
| 285 |
+ type docker_share_t; |
|
| 286 |
+ type docker_log_t; |
|
| 287 |
+ type docker_var_run_t; |
|
| 288 |
+ type docker_home_t; |
|
| 289 |
+ ') |
|
| 290 |
+ |
|
| 291 |
+ files_pid_filetrans($1, docker_var_run_t, file, "docker.pid") |
|
| 292 |
+ files_pid_filetrans($1, docker_var_run_t, sock_file, "docker.sock") |
|
| 293 |
+ files_pid_filetrans($1, docker_var_run_t, dir, "docker-client") |
|
| 294 |
+ files_var_lib_filetrans($1, docker_var_lib_t, dir, "docker") |
|
| 295 |
+ filetrans_pattern($1, docker_var_lib_t, docker_share_t, file, "config.env") |
|
| 296 |
+ filetrans_pattern($1, docker_var_lib_t, docker_share_t, file, "hosts") |
|
| 297 |
+ filetrans_pattern($1, docker_var_lib_t, docker_share_t, file, "hostname") |
|
| 298 |
+ filetrans_pattern($1, docker_var_lib_t, docker_share_t, file, "resolv.conf") |
|
| 299 |
+ filetrans_pattern($1, docker_var_lib_t, docker_share_t, dir, "init") |
|
| 300 |
+ userdom_admin_home_dir_filetrans($1, docker_home_t, dir, ".docker") |
|
| 301 |
+') |
|
| 302 |
+ |
|
| 303 |
+######################################## |
|
| 304 |
+## <summary> |
|
| 305 |
+## Connect to docker over a unix stream socket. |
|
| 306 |
+## </summary> |
|
| 307 |
+## <param name="domain"> |
|
| 308 |
+## <summary> |
|
| 309 |
+## Domain allowed access. |
|
| 310 |
+## </summary> |
|
| 311 |
+## </param> |
|
| 312 |
+# |
|
| 313 |
+interface(`docker_stream_connect',` |
|
| 314 |
+ gen_require(` |
|
| 315 |
+ type docker_t, docker_var_run_t; |
|
| 316 |
+ ') |
|
| 317 |
+ |
|
| 318 |
+ files_search_pids($1) |
|
| 319 |
+ stream_connect_pattern($1, docker_var_run_t, docker_var_run_t, docker_t) |
|
| 320 |
+') |
|
| 321 |
+ |
|
| 322 |
+######################################## |
|
| 323 |
+## <summary> |
|
| 324 |
+## Connect to SPC containers over a unix stream socket. |
|
| 325 |
+## </summary> |
|
| 326 |
+## <param name="domain"> |
|
| 327 |
+## <summary> |
|
| 328 |
+## Domain allowed access. |
|
| 329 |
+## </summary> |
|
| 330 |
+## </param> |
|
| 331 |
+# |
|
| 332 |
+interface(`docker_spc_stream_connect',` |
|
| 333 |
+ gen_require(` |
|
| 334 |
+ type spc_t, spc_var_run_t; |
|
| 335 |
+ ') |
|
| 336 |
+ |
|
| 337 |
+ files_search_pids($1) |
|
| 338 |
+ files_write_all_pid_sockets($1) |
|
| 339 |
+ allow $1 spc_t:unix_stream_socket connectto; |
|
| 340 |
+') |
|
| 341 |
+ |
|
| 342 |
+ |
|
| 343 |
+######################################## |
|
| 344 |
+## <summary> |
|
| 345 |
+## All of the rules required to administrate |
|
| 346 |
+## an docker environment |
|
| 347 |
+## </summary> |
|
| 348 |
+## <param name="domain"> |
|
| 349 |
+## <summary> |
|
| 350 |
+## Domain allowed access. |
|
| 351 |
+## </summary> |
|
| 352 |
+## </param> |
|
| 353 |
+# |
|
| 354 |
+interface(`docker_admin',` |
|
| 355 |
+ gen_require(` |
|
| 356 |
+ type docker_t; |
|
| 357 |
+ type docker_var_lib_t, docker_var_run_t; |
|
| 358 |
+ type docker_unit_file_t; |
|
| 359 |
+ type docker_lock_t; |
|
| 360 |
+ type docker_log_t; |
|
| 361 |
+ type docker_config_t; |
|
| 362 |
+ ') |
|
| 363 |
+ |
|
| 364 |
+ allow $1 docker_t:process { ptrace signal_perms };
|
|
| 365 |
+ ps_process_pattern($1, docker_t) |
|
| 366 |
+ |
|
| 367 |
+ admin_pattern($1, docker_config_t) |
|
| 368 |
+ |
|
| 369 |
+ files_search_var_lib($1) |
|
| 370 |
+ admin_pattern($1, docker_var_lib_t) |
|
| 371 |
+ |
|
| 372 |
+ files_search_pids($1) |
|
| 373 |
+ admin_pattern($1, docker_var_run_t) |
|
| 374 |
+ |
|
| 375 |
+ files_search_locks($1) |
|
| 376 |
+ admin_pattern($1, docker_lock_t) |
|
| 377 |
+ |
|
| 378 |
+ logging_search_logs($1) |
|
| 379 |
+ admin_pattern($1, docker_log_t) |
|
| 380 |
+ |
|
| 381 |
+ docker_systemctl($1) |
|
| 382 |
+ admin_pattern($1, docker_unit_file_t) |
|
| 383 |
+ allow $1 docker_unit_file_t:service all_service_perms; |
|
| 384 |
+ |
|
| 385 |
+ optional_policy(` |
|
| 386 |
+ systemd_passwd_agent_exec($1) |
|
| 387 |
+ systemd_read_fifo_file_passwd_run($1) |
|
| 388 |
+ ') |
|
| 389 |
+') |
|
| 390 |
+ |
|
| 391 |
+interface(`domain_stub_named_filetrans_domain',` |
|
| 392 |
+ gen_require(` |
|
| 393 |
+ attribute named_filetrans_domain; |
|
| 394 |
+ ') |
|
| 395 |
+') |
|
| 396 |
+ |
|
| 397 |
+interface(`lvm_stub',` |
|
| 398 |
+ gen_require(` |
|
| 399 |
+ type lvm_t; |
|
| 400 |
+ ') |
|
| 401 |
+') |
|
| 402 |
+interface(`staff_stub',` |
|
| 403 |
+ gen_require(` |
|
| 404 |
+ type staff_t; |
|
| 405 |
+ ') |
|
| 406 |
+') |
|
| 407 |
+interface(`virt_stub_svirt_sandbox_domain',` |
|
| 408 |
+ gen_require(` |
|
| 409 |
+ attribute svirt_sandbox_domain; |
|
| 410 |
+ ') |
|
| 411 |
+') |
|
| 412 |
+interface(`virt_stub_svirt_sandbox_file',` |
|
| 413 |
+ gen_require(` |
|
| 414 |
+ type svirt_sandbox_file_t; |
|
| 415 |
+ ') |
|
| 416 |
+') |
|
| 417 |
+interface(`fs_dontaudit_remount_tmpfs',` |
|
| 418 |
+ gen_require(` |
|
| 419 |
+ type tmpfs_t; |
|
| 420 |
+ ') |
|
| 421 |
+ |
|
| 422 |
+ dontaudit $1 tmpfs_t:filesystem remount; |
|
| 423 |
+') |
|
| 424 |
+interface(`dev_dontaudit_list_all_dev_nodes',` |
|
| 425 |
+ gen_require(` |
|
| 426 |
+ type device_t; |
|
| 427 |
+ ') |
|
| 428 |
+ |
|
| 429 |
+ dontaudit $1 device_t:dir list_dir_perms; |
|
| 430 |
+') |
|
| 431 |
+interface(`kernel_unlabeled_entry_type',` |
|
| 432 |
+ gen_require(` |
|
| 433 |
+ type unlabeled_t; |
|
| 434 |
+ ') |
|
| 435 |
+ |
|
| 436 |
+ domain_entry_file($1, unlabeled_t) |
|
| 437 |
+') |
|
| 438 |
+interface(`kernel_unlabeled_domtrans',` |
|
| 439 |
+ gen_require(` |
|
| 440 |
+ type unlabeled_t; |
|
| 441 |
+ ') |
|
| 442 |
+ |
|
| 443 |
+ read_lnk_files_pattern($1, unlabeled_t, unlabeled_t) |
|
| 444 |
+ domain_transition_pattern($1, unlabeled_t, $2) |
|
| 445 |
+ type_transition $1 unlabeled_t:process $2; |
|
| 446 |
+') |
|
| 447 |
+interface(`files_write_all_pid_sockets',` |
|
| 448 |
+ gen_require(` |
|
| 449 |
+ attribute pidfile; |
|
| 450 |
+ ') |
|
| 451 |
+ |
|
| 452 |
+ allow $1 pidfile:sock_file write_sock_file_perms; |
|
| 453 |
+') |
|
| 454 |
+interface(`dev_dontaudit_mounton_sysfs',` |
|
| 455 |
+ gen_require(` |
|
| 456 |
+ type sysfs_t; |
|
| 457 |
+ ') |
|
| 458 |
+ |
|
| 459 |
+ dontaudit $1 sysfs_t:dir mounton; |
|
| 460 |
+') |
| 0 | 461 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,414 @@ |
| 0 |
+policy_module(docker, 1.0.0) |
|
| 1 |
+ |
|
| 2 |
+######################################## |
|
| 3 |
+# |
|
| 4 |
+# Declarations |
|
| 5 |
+# |
|
| 6 |
+ |
|
| 7 |
+## <desc> |
|
| 8 |
+## <p> |
|
| 9 |
+## Allow sandbox containers manage fuse files |
|
| 10 |
+## </p> |
|
| 11 |
+## </desc> |
|
| 12 |
+gen_tunable(virt_sandbox_use_fusefs, false) |
|
| 13 |
+ |
|
| 14 |
+## <desc> |
|
| 15 |
+## <p> |
|
| 16 |
+## Determine whether docker can |
|
| 17 |
+## connect to all TCP ports. |
|
| 18 |
+## </p> |
|
| 19 |
+## </desc> |
|
| 20 |
+gen_tunable(docker_connect_any, false) |
|
| 21 |
+ |
|
| 22 |
+type docker_t; |
|
| 23 |
+type docker_exec_t; |
|
| 24 |
+init_daemon_domain(docker_t, docker_exec_t) |
|
| 25 |
+domain_subj_id_change_exemption(docker_t) |
|
| 26 |
+domain_role_change_exemption(docker_t) |
|
| 27 |
+ |
|
| 28 |
+type spc_t; |
|
| 29 |
+domain_type(spc_t) |
|
| 30 |
+role system_r types spc_t; |
|
| 31 |
+ |
|
| 32 |
+type spc_var_run_t; |
|
| 33 |
+files_pid_file(spc_var_run_t) |
|
| 34 |
+ |
|
| 35 |
+type docker_var_lib_t; |
|
| 36 |
+files_type(docker_var_lib_t) |
|
| 37 |
+ |
|
| 38 |
+type docker_home_t; |
|
| 39 |
+userdom_user_home_content(docker_home_t) |
|
| 40 |
+ |
|
| 41 |
+type docker_config_t; |
|
| 42 |
+files_config_file(docker_config_t) |
|
| 43 |
+ |
|
| 44 |
+type docker_lock_t; |
|
| 45 |
+files_lock_file(docker_lock_t) |
|
| 46 |
+ |
|
| 47 |
+type docker_log_t; |
|
| 48 |
+logging_log_file(docker_log_t) |
|
| 49 |
+ |
|
| 50 |
+type docker_tmp_t; |
|
| 51 |
+files_tmp_file(docker_tmp_t) |
|
| 52 |
+ |
|
| 53 |
+type docker_tmpfs_t; |
|
| 54 |
+files_tmpfs_file(docker_tmpfs_t) |
|
| 55 |
+ |
|
| 56 |
+type docker_var_run_t; |
|
| 57 |
+files_pid_file(docker_var_run_t) |
|
| 58 |
+ |
|
| 59 |
+type docker_unit_file_t; |
|
| 60 |
+systemd_unit_file(docker_unit_file_t) |
|
| 61 |
+ |
|
| 62 |
+type docker_devpts_t; |
|
| 63 |
+term_pty(docker_devpts_t) |
|
| 64 |
+ |
|
| 65 |
+type docker_share_t; |
|
| 66 |
+files_type(docker_share_t) |
|
| 67 |
+ |
|
| 68 |
+######################################## |
|
| 69 |
+# |
|
| 70 |
+# docker local policy |
|
| 71 |
+# |
|
| 72 |
+allow docker_t self:capability { chown kill fowner fsetid mknod net_admin net_bind_service net_raw setfcap };
|
|
| 73 |
+allow docker_t self:tun_socket relabelto; |
|
| 74 |
+allow docker_t self:process { getattr signal_perms setrlimit setfscreate };
|
|
| 75 |
+allow docker_t self:fifo_file rw_fifo_file_perms; |
|
| 76 |
+allow docker_t self:unix_stream_socket create_stream_socket_perms; |
|
| 77 |
+allow docker_t self:tcp_socket create_stream_socket_perms; |
|
| 78 |
+allow docker_t self:udp_socket create_socket_perms; |
|
| 79 |
+allow docker_t self:capability2 block_suspend; |
|
| 80 |
+ |
|
| 81 |
+manage_files_pattern(docker_t, docker_home_t, docker_home_t) |
|
| 82 |
+manage_dirs_pattern(docker_t, docker_home_t, docker_home_t) |
|
| 83 |
+manage_lnk_files_pattern(docker_t, docker_home_t, docker_home_t) |
|
| 84 |
+userdom_admin_home_dir_filetrans(docker_t, docker_home_t, dir, ".docker") |
|
| 85 |
+ |
|
| 86 |
+manage_dirs_pattern(docker_t, docker_config_t, docker_config_t) |
|
| 87 |
+manage_files_pattern(docker_t, docker_config_t, docker_config_t) |
|
| 88 |
+files_etc_filetrans(docker_t, docker_config_t, dir, "docker") |
|
| 89 |
+ |
|
| 90 |
+manage_dirs_pattern(docker_t, docker_lock_t, docker_lock_t) |
|
| 91 |
+manage_files_pattern(docker_t, docker_lock_t, docker_lock_t) |
|
| 92 |
+ |
|
| 93 |
+manage_dirs_pattern(docker_t, docker_log_t, docker_log_t) |
|
| 94 |
+manage_files_pattern(docker_t, docker_log_t, docker_log_t) |
|
| 95 |
+manage_lnk_files_pattern(docker_t, docker_log_t, docker_log_t) |
|
| 96 |
+logging_log_filetrans(docker_t, docker_log_t, { dir file lnk_file })
|
|
| 97 |
+allow docker_t docker_log_t:dir_file_class_set { relabelfrom relabelto };
|
|
| 98 |
+ |
|
| 99 |
+manage_dirs_pattern(docker_t, docker_tmp_t, docker_tmp_t) |
|
| 100 |
+manage_files_pattern(docker_t, docker_tmp_t, docker_tmp_t) |
|
| 101 |
+manage_lnk_files_pattern(docker_t, docker_tmp_t, docker_tmp_t) |
|
| 102 |
+files_tmp_filetrans(docker_t, docker_tmp_t, { dir file lnk_file })
|
|
| 103 |
+ |
|
| 104 |
+manage_dirs_pattern(docker_t, docker_tmpfs_t, docker_tmpfs_t) |
|
| 105 |
+manage_files_pattern(docker_t, docker_tmpfs_t, docker_tmpfs_t) |
|
| 106 |
+manage_lnk_files_pattern(docker_t, docker_tmpfs_t, docker_tmpfs_t) |
|
| 107 |
+manage_fifo_files_pattern(docker_t, docker_tmpfs_t, docker_tmpfs_t) |
|
| 108 |
+manage_chr_files_pattern(docker_t, docker_tmpfs_t, docker_tmpfs_t) |
|
| 109 |
+manage_blk_files_pattern(docker_t, docker_tmpfs_t, docker_tmpfs_t) |
|
| 110 |
+allow docker_t docker_tmpfs_t:dir relabelfrom; |
|
| 111 |
+can_exec(docker_t, docker_tmpfs_t) |
|
| 112 |
+fs_tmpfs_filetrans(docker_t, docker_tmpfs_t, { dir file })
|
|
| 113 |
+allow docker_t docker_tmpfs_t:chr_file mounton; |
|
| 114 |
+ |
|
| 115 |
+manage_dirs_pattern(docker_t, docker_share_t, docker_share_t) |
|
| 116 |
+manage_files_pattern(docker_t, docker_share_t, docker_share_t) |
|
| 117 |
+manage_lnk_files_pattern(docker_t, docker_share_t, docker_share_t) |
|
| 118 |
+allow docker_t docker_share_t:dir_file_class_set { relabelfrom relabelto };
|
|
| 119 |
+ |
|
| 120 |
+can_exec(docker_t, docker_share_t) |
|
| 121 |
+#docker_filetrans_named_content(docker_t) |
|
| 122 |
+ |
|
| 123 |
+manage_dirs_pattern(docker_t, docker_var_lib_t, docker_var_lib_t) |
|
| 124 |
+manage_chr_files_pattern(docker_t, docker_var_lib_t, docker_var_lib_t) |
|
| 125 |
+manage_blk_files_pattern(docker_t, docker_var_lib_t, docker_var_lib_t) |
|
| 126 |
+manage_files_pattern(docker_t, docker_var_lib_t, docker_var_lib_t) |
|
| 127 |
+manage_lnk_files_pattern(docker_t, docker_var_lib_t, docker_var_lib_t) |
|
| 128 |
+allow docker_t docker_var_lib_t:dir_file_class_set { relabelfrom relabelto };
|
|
| 129 |
+files_var_lib_filetrans(docker_t, docker_var_lib_t, { dir file lnk_file })
|
|
| 130 |
+ |
|
| 131 |
+manage_dirs_pattern(docker_t, docker_var_run_t, docker_var_run_t) |
|
| 132 |
+manage_files_pattern(docker_t, docker_var_run_t, docker_var_run_t) |
|
| 133 |
+manage_sock_files_pattern(docker_t, docker_var_run_t, docker_var_run_t) |
|
| 134 |
+manage_lnk_files_pattern(docker_t, docker_var_run_t, docker_var_run_t) |
|
| 135 |
+files_pid_filetrans(docker_t, docker_var_run_t, { dir file lnk_file sock_file })
|
|
| 136 |
+ |
|
| 137 |
+allow docker_t docker_devpts_t:chr_file { relabelfrom rw_chr_file_perms setattr_chr_file_perms };
|
|
| 138 |
+term_create_pty(docker_t, docker_devpts_t) |
|
| 139 |
+ |
|
| 140 |
+kernel_read_system_state(docker_t) |
|
| 141 |
+kernel_read_network_state(docker_t) |
|
| 142 |
+kernel_read_all_sysctls(docker_t) |
|
| 143 |
+kernel_rw_net_sysctls(docker_t) |
|
| 144 |
+kernel_setsched(docker_t) |
|
| 145 |
+kernel_read_all_proc(docker_t) |
|
| 146 |
+ |
|
| 147 |
+domain_use_interactive_fds(docker_t) |
|
| 148 |
+domain_dontaudit_read_all_domains_state(docker_t) |
|
| 149 |
+ |
|
| 150 |
+corecmd_exec_bin(docker_t) |
|
| 151 |
+corecmd_exec_shell(docker_t) |
|
| 152 |
+ |
|
| 153 |
+corenet_tcp_bind_generic_node(docker_t) |
|
| 154 |
+corenet_tcp_sendrecv_generic_if(docker_t) |
|
| 155 |
+corenet_tcp_sendrecv_generic_node(docker_t) |
|
| 156 |
+corenet_tcp_sendrecv_generic_port(docker_t) |
|
| 157 |
+corenet_tcp_bind_all_ports(docker_t) |
|
| 158 |
+corenet_tcp_connect_http_port(docker_t) |
|
| 159 |
+corenet_tcp_connect_commplex_main_port(docker_t) |
|
| 160 |
+corenet_udp_sendrecv_generic_if(docker_t) |
|
| 161 |
+corenet_udp_sendrecv_generic_node(docker_t) |
|
| 162 |
+corenet_udp_sendrecv_all_ports(docker_t) |
|
| 163 |
+corenet_udp_bind_generic_node(docker_t) |
|
| 164 |
+corenet_udp_bind_all_ports(docker_t) |
|
| 165 |
+ |
|
| 166 |
+files_read_config_files(docker_t) |
|
| 167 |
+files_dontaudit_getattr_all_dirs(docker_t) |
|
| 168 |
+files_dontaudit_getattr_all_files(docker_t) |
|
| 169 |
+ |
|
| 170 |
+fs_read_cgroup_files(docker_t) |
|
| 171 |
+fs_read_tmpfs_symlinks(docker_t) |
|
| 172 |
+fs_search_all(docker_t) |
|
| 173 |
+fs_getattr_all_fs(docker_t) |
|
| 174 |
+ |
|
| 175 |
+storage_raw_rw_fixed_disk(docker_t) |
|
| 176 |
+ |
|
| 177 |
+auth_use_nsswitch(docker_t) |
|
| 178 |
+auth_dontaudit_getattr_shadow(docker_t) |
|
| 179 |
+ |
|
| 180 |
+init_read_state(docker_t) |
|
| 181 |
+init_status(docker_t) |
|
| 182 |
+ |
|
| 183 |
+logging_send_audit_msgs(docker_t) |
|
| 184 |
+logging_send_syslog_msg(docker_t) |
|
| 185 |
+ |
|
| 186 |
+miscfiles_read_localization(docker_t) |
|
| 187 |
+ |
|
| 188 |
+mount_domtrans(docker_t) |
|
| 189 |
+ |
|
| 190 |
+seutil_read_default_contexts(docker_t) |
|
| 191 |
+seutil_read_config(docker_t) |
|
| 192 |
+ |
|
| 193 |
+sysnet_dns_name_resolve(docker_t) |
|
| 194 |
+sysnet_exec_ifconfig(docker_t) |
|
| 195 |
+ |
|
| 196 |
+optional_policy(` |
|
| 197 |
+ rpm_exec(docker_t) |
|
| 198 |
+ rpm_read_db(docker_t) |
|
| 199 |
+ rpm_exec(docker_t) |
|
| 200 |
+') |
|
| 201 |
+ |
|
| 202 |
+optional_policy(` |
|
| 203 |
+ fstools_domtrans(docker_t) |
|
| 204 |
+') |
|
| 205 |
+ |
|
| 206 |
+optional_policy(` |
|
| 207 |
+ iptables_domtrans(docker_t) |
|
| 208 |
+') |
|
| 209 |
+ |
|
| 210 |
+optional_policy(` |
|
| 211 |
+ openvswitch_stream_connect(docker_t) |
|
| 212 |
+') |
|
| 213 |
+ |
|
| 214 |
+allow docker_t self:capability { dac_override setgid setpcap setuid sys_admin sys_boot sys_chroot sys_ptrace };
|
|
| 215 |
+ |
|
| 216 |
+allow docker_t self:process { getcap setcap setexec setpgid setsched signal_perms };
|
|
| 217 |
+ |
|
| 218 |
+allow docker_t self:netlink_route_socket rw_netlink_socket_perms;; |
|
| 219 |
+allow docker_t self:netlink_audit_socket create_netlink_socket_perms; |
|
| 220 |
+allow docker_t self:unix_dgram_socket { create_socket_perms sendto };
|
|
| 221 |
+allow docker_t self:unix_stream_socket { create_stream_socket_perms connectto };
|
|
| 222 |
+ |
|
| 223 |
+allow docker_t docker_var_lib_t:dir mounton; |
|
| 224 |
+allow docker_t docker_var_lib_t:chr_file mounton; |
|
| 225 |
+can_exec(docker_t, docker_var_lib_t) |
|
| 226 |
+ |
|
| 227 |
+kernel_dontaudit_setsched(docker_t) |
|
| 228 |
+kernel_get_sysvipc_info(docker_t) |
|
| 229 |
+kernel_request_load_module(docker_t) |
|
| 230 |
+kernel_mounton_messages(docker_t) |
|
| 231 |
+kernel_mounton_all_proc(docker_t) |
|
| 232 |
+kernel_mounton_all_sysctls(docker_t) |
|
| 233 |
+kernel_unlabeled_entry_type(spc_t) |
|
| 234 |
+kernel_unlabeled_domtrans(docker_t, spc_t) |
|
| 235 |
+ |
|
| 236 |
+dev_getattr_all(docker_t) |
|
| 237 |
+dev_getattr_sysfs_fs(docker_t) |
|
| 238 |
+dev_read_urand(docker_t) |
|
| 239 |
+dev_read_lvm_control(docker_t) |
|
| 240 |
+dev_rw_sysfs(docker_t) |
|
| 241 |
+dev_rw_loop_control(docker_t) |
|
| 242 |
+dev_rw_lvm_control(docker_t) |
|
| 243 |
+ |
|
| 244 |
+files_getattr_isid_type_dirs(docker_t) |
|
| 245 |
+files_manage_isid_type_dirs(docker_t) |
|
| 246 |
+files_manage_isid_type_files(docker_t) |
|
| 247 |
+files_manage_isid_type_symlinks(docker_t) |
|
| 248 |
+files_manage_isid_type_chr_files(docker_t) |
|
| 249 |
+files_manage_isid_type_blk_files(docker_t) |
|
| 250 |
+files_exec_isid_files(docker_t) |
|
| 251 |
+files_mounton_isid(docker_t) |
|
| 252 |
+files_mounton_non_security(docker_t) |
|
| 253 |
+files_mounton_isid_type_chr_file(docker_t) |
|
| 254 |
+ |
|
| 255 |
+fs_mount_all_fs(docker_t) |
|
| 256 |
+fs_unmount_all_fs(docker_t) |
|
| 257 |
+fs_remount_all_fs(docker_t) |
|
| 258 |
+files_mounton_isid(docker_t) |
|
| 259 |
+fs_manage_cgroup_dirs(docker_t) |
|
| 260 |
+fs_manage_cgroup_files(docker_t) |
|
| 261 |
+fs_relabelfrom_xattr_fs(docker_t) |
|
| 262 |
+fs_relabelfrom_tmpfs(docker_t) |
|
| 263 |
+fs_read_tmpfs_symlinks(docker_t) |
|
| 264 |
+fs_list_hugetlbfs(docker_t) |
|
| 265 |
+ |
|
| 266 |
+term_use_generic_ptys(docker_t) |
|
| 267 |
+term_use_ptmx(docker_t) |
|
| 268 |
+term_getattr_pty_fs(docker_t) |
|
| 269 |
+term_relabel_pty_fs(docker_t) |
|
| 270 |
+term_mounton_unallocated_ttys(docker_t) |
|
| 271 |
+ |
|
| 272 |
+modutils_domtrans_insmod(docker_t) |
|
| 273 |
+ |
|
| 274 |
+systemd_status_all_unit_files(docker_t) |
|
| 275 |
+systemd_start_systemd_services(docker_t) |
|
| 276 |
+ |
|
| 277 |
+userdom_stream_connect(docker_t) |
|
| 278 |
+userdom_search_user_home_content(docker_t) |
|
| 279 |
+userdom_read_all_users_state(docker_t) |
|
| 280 |
+userdom_relabel_user_home_files(docker_t) |
|
| 281 |
+userdom_relabel_user_tmp_files(docker_t) |
|
| 282 |
+userdom_relabel_user_tmp_dirs(docker_t) |
|
| 283 |
+ |
|
| 284 |
+optional_policy(` |
|
| 285 |
+ gpm_getattr_gpmctl(docker_t) |
|
| 286 |
+') |
|
| 287 |
+ |
|
| 288 |
+optional_policy(` |
|
| 289 |
+ dbus_system_bus_client(docker_t) |
|
| 290 |
+ init_dbus_chat(docker_t) |
|
| 291 |
+ init_start_transient_unit(docker_t) |
|
| 292 |
+ |
|
| 293 |
+ optional_policy(` |
|
| 294 |
+ systemd_dbus_chat_logind(docker_t) |
|
| 295 |
+ ') |
|
| 296 |
+ |
|
| 297 |
+ optional_policy(` |
|
| 298 |
+ firewalld_dbus_chat(docker_t) |
|
| 299 |
+ ') |
|
| 300 |
+') |
|
| 301 |
+ |
|
| 302 |
+optional_policy(` |
|
| 303 |
+ udev_read_db(docker_t) |
|
| 304 |
+') |
|
| 305 |
+ |
|
| 306 |
+optional_policy(` |
|
| 307 |
+ virt_read_config(docker_t) |
|
| 308 |
+ virt_exec(docker_t) |
|
| 309 |
+ virt_stream_connect(docker_t) |
|
| 310 |
+ virt_stream_connect_sandbox(docker_t) |
|
| 311 |
+ virt_exec_sandbox_files(docker_t) |
|
| 312 |
+ virt_manage_sandbox_files(docker_t) |
|
| 313 |
+ virt_relabel_sandbox_filesystem(docker_t) |
|
| 314 |
+ virt_transition_svirt_sandbox(docker_t, system_r) |
|
| 315 |
+ virt_mounton_sandbox_file(docker_t) |
|
| 316 |
+# virt_attach_sandbox_tun_iface(docker_t) |
|
| 317 |
+ allow docker_t svirt_sandbox_domain:tun_socket relabelfrom; |
|
| 318 |
+') |
|
| 319 |
+ |
|
| 320 |
+tunable_policy(`docker_connect_any',` |
|
| 321 |
+ corenet_tcp_connect_all_ports(docker_t) |
|
| 322 |
+ corenet_sendrecv_all_packets(docker_t) |
|
| 323 |
+ corenet_tcp_sendrecv_all_ports(docker_t) |
|
| 324 |
+') |
|
| 325 |
+ |
|
| 326 |
+######################################## |
|
| 327 |
+# |
|
| 328 |
+# spc local policy |
|
| 329 |
+# |
|
| 330 |
+domain_entry_file(spc_t, docker_share_t) |
|
| 331 |
+domain_entry_file(spc_t, docker_var_lib_t) |
|
| 332 |
+role system_r types spc_t; |
|
| 333 |
+ |
|
| 334 |
+domain_entry_file(spc_t, docker_share_t) |
|
| 335 |
+domain_entry_file(spc_t, docker_var_lib_t) |
|
| 336 |
+domtrans_pattern(docker_t, docker_share_t, spc_t) |
|
| 337 |
+domtrans_pattern(docker_t, docker_var_lib_t, spc_t) |
|
| 338 |
+allow docker_t spc_t:process { setsched signal_perms };
|
|
| 339 |
+ps_process_pattern(docker_t, spc_t) |
|
| 340 |
+allow docker_t spc_t:socket_class_set { relabelto relabelfrom };
|
|
| 341 |
+ |
|
| 342 |
+optional_policy(` |
|
| 343 |
+ dbus_chat_system_bus(spc_t) |
|
| 344 |
+') |
|
| 345 |
+ |
|
| 346 |
+optional_policy(` |
|
| 347 |
+ unconfined_domain_noaudit(spc_t) |
|
| 348 |
+') |
|
| 349 |
+ |
|
| 350 |
+optional_policy(` |
|
| 351 |
+ unconfined_domain(docker_t) |
|
| 352 |
+') |
|
| 353 |
+ |
|
| 354 |
+optional_policy(` |
|
| 355 |
+ virt_transition_svirt_sandbox(spc_t, system_r) |
|
| 356 |
+') |
|
| 357 |
+ |
|
| 358 |
+######################################## |
|
| 359 |
+# |
|
| 360 |
+# docker upstream policy |
|
| 361 |
+# |
|
| 362 |
+ |
|
| 363 |
+optional_policy(` |
|
| 364 |
+# domain_stub_named_filetrans_domain() |
|
| 365 |
+ gen_require(` |
|
| 366 |
+ attribute named_filetrans_domain; |
|
| 367 |
+ ') |
|
| 368 |
+ |
|
| 369 |
+ docker_filetrans_named_content(named_filetrans_domain) |
|
| 370 |
+') |
|
| 371 |
+ |
|
| 372 |
+optional_policy(` |
|
| 373 |
+ lvm_stub() |
|
| 374 |
+ docker_rw_sem(lvm_t) |
|
| 375 |
+') |
|
| 376 |
+ |
|
| 377 |
+optional_policy(` |
|
| 378 |
+ staff_stub() |
|
| 379 |
+ docker_stream_connect(staff_t) |
|
| 380 |
+ docker_exec(staff_t) |
|
| 381 |
+') |
|
| 382 |
+ |
|
| 383 |
+optional_policy(` |
|
| 384 |
+ virt_stub_svirt_sandbox_domain() |
|
| 385 |
+ virt_stub_svirt_sandbox_file() |
|
| 386 |
+ allow svirt_sandbox_domain self:netlink_kobject_uevent_socket create_socket_perms; |
|
| 387 |
+ docker_read_share_files(svirt_sandbox_domain) |
|
| 388 |
+ docker_lib_filetrans(svirt_sandbox_domain,svirt_sandbox_file_t, sock_file) |
|
| 389 |
+ docker_use_ptys(svirt_sandbox_domain) |
|
| 390 |
+ docker_spc_stream_connect(svirt_sandbox_domain) |
|
| 391 |
+ fs_list_tmpfs(svirt_sandbox_domain) |
|
| 392 |
+ fs_rw_hugetlbfs_files(svirt_sandbox_domain) |
|
| 393 |
+ fs_dontaudit_remount_tmpfs(svirt_sandbox_domain) |
|
| 394 |
+ dev_dontaudit_mounton_sysfs(svirt_sandbox_domain) |
|
| 395 |
+ |
|
| 396 |
+ tunable_policy(`virt_sandbox_use_fusefs',` |
|
| 397 |
+ fs_manage_fusefs_dirs(svirt_sandbox_domain) |
|
| 398 |
+ fs_manage_fusefs_files(svirt_sandbox_domain) |
|
| 399 |
+ fs_manage_fusefs_symlinks(svirt_sandbox_domain) |
|
| 400 |
+ ') |
|
| 401 |
+ gen_require(` |
|
| 402 |
+ attribute domain; |
|
| 403 |
+ ') |
|
| 404 |
+ |
|
| 405 |
+ dontaudit svirt_sandbox_domain domain:key {search link};
|
|
| 406 |
+') |
|
| 407 |
+ |
|
| 408 |
+optional_policy(` |
|
| 409 |
+ gen_require(` |
|
| 410 |
+ type pcp_pmcd_t; |
|
| 411 |
+ ') |
|
| 412 |
+ docker_manage_lib_files(pcp_pmcd_t) |
|
| 413 |
+') |
| ... | ... |
@@ -135,8 +135,12 @@ set -e |
| 135 | 135 |
# selinux policy referencing systemd things won't work on non-systemd versions |
| 136 | 136 |
# of centos or rhel, which we don't support anyways |
| 137 | 137 |
if [ "${suite%.*}" -gt 6 ] && [[ "$version" != opensuse* ]]; then
|
| 138 |
+ selinuxDir="selinux" |
|
| 139 |
+ if [ -d "./contrib/selinux-$version" ]; then |
|
| 140 |
+ selinuxDir="selinux-${version}"
|
|
| 141 |
+ fi |
|
| 138 | 142 |
cat >> "$DEST/$version/Dockerfile.build" <<-EOF |
| 139 |
- RUN tar -cz -C /usr/src/${rpmName}/contrib -f /root/rpmbuild/SOURCES/${rpmName}-selinux.tar.gz ${rpmName}-selinux
|
|
| 143 |
+ RUN tar -cz -C /usr/src/${rpmName}/contrib/${selinuxDir} -f /root/rpmbuild/SOURCES/${rpmName}-selinux.tar.gz ${rpmName}-selinux
|
|
| 140 | 144 |
RUN rpmbuild -ba \ |
| 141 | 145 |
--define '_gitcommit $DOCKER_GITCOMMIT' \ |
| 142 | 146 |
--define '_release $rpmRelease' \ |