├── LICENSE ├── README.md ├── apparmor.d ├── abstractions │ ├── block-networking │ ├── chromium-base │ ├── chromium-base-sandbox │ ├── chromium-base-xdgsettings │ ├── confidential-deny │ ├── flatpak-snap │ ├── general-security │ ├── kde-dialog │ ├── kde-plasma5 │ ├── kde-user │ ├── networkmanager-strict │ ├── open-browser │ ├── open-email │ ├── open-messaging │ ├── open-some-applications │ ├── ubuntu-browsers.d │ │ ├── chromium-browser │ │ └── user-files │ └── udisk-strict ├── default-abstractions │ └── wayland ├── opt.brave ├── opt.vivaldi-stable ├── tunables │ ├── confidential │ └── media-extensions ├── usr.bin.chromium-browser ├── usr.bin.firefox ├── usr.bin.gwenview ├── usr.bin.ktorrent ├── usr.bin.mpv ├── usr.bin.okular ├── usr.bin.opera ├── usr.bin.qbittorrent ├── usr.bin.thunderbird └── usr.lib.bluetooth.bluetoothd ├── extra ├── usr.bin.baloo_file ├── usr.bin.bluedevil └── usr.bin.youtube-dl └── unmaintained ├── home.telegram ├── usr.bin.baka-mplayer ├── usr.bin.bomi ├── usr.bin.kget ├── usr.bin.konversation ├── usr.bin.ktorrent4 └── usr.bin.vlc-2.2 /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 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 GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # AppArmor Security Profiles for some applications 3 | 4 | **Author:** Nibaldo González () 5 | 6 | ## Description: 7 | 8 | AppArmor profiles for: 9 | 10 | * Bluetooth Daemon 11 | * Brave 12 | * Chromium 13 | * Firefox 14 | * Gwenview 15 | * KTorrent (not tested in latest versions!) 16 | * mpv 17 | * Okular 18 | * Opera (not tested in latest versions!) 19 | * qBittorrent 20 | * Thunderbird 21 | * Vivaldi 22 | * youtube-dl (extra) 23 | 24 | **NOTE:** The profiles in the *extra* folder are not tested frequently! 25 | 26 | These are designed to work on KDE Plasma 5. 27 | All profiles have been tested on Ubuntu 18.04 & 16.04, with KDE Plasma 5. 28 | 29 | If you use Ubuntu, please install the `apparmor-utils` package. 30 | 31 | ## Important: 32 | 33 | * Some profiles require you to review the location of the downloads and desktop directories. By default it is used: 34 | * Downloads Directory: `@{HOME}/Descargas/` 35 | * Desktop Directory: `@{HOME}/Escritorio/` 36 | 37 | * The profiles of KTorrent and qBittorrent use the directory `@{HOME}/Descargas/Torrents/` to save the downloads. You must modify this according to your configuration. 38 | 39 | * Check the location of the Telegram executable. The profile uses: `/home/*/.app/Telegram/{Telegram,Updater}`. **NOTE:** The Telegram profile is unmaintained; for sandbox, use the Flatpak or Snap package. 40 | 41 | ## Installation: 42 | 43 | 1. Copy the files in: `/etc/apparmor.d/` 44 | 45 | Please do so with great caution! 46 | 47 | 2. To enable a profile, in enforcing mode, use the following command: 48 | ```bash 49 | sudo aa-enforce /etc/apparmor.d/usr.bin.profile 50 | ``` 51 | 52 | * For example, you can use: 53 | ```bash 54 | sudo aa-enforce /etc/apparmor.d/usr.bin.* 55 | sudo aa-enforce /etc/apparmor.d/home.* 56 | sudo aa-enforce /etc/apparmor.d/usr.lib.bluetooth.bluetoothd 57 | ``` 58 | 59 | * If you need to reload a profile: 60 | ```bash 61 | sudo apparmor_parser -r /etc/apparmor.d/usr.bin.profile 62 | ``` 63 | 64 | * For profile in compliant mode: 65 | ```bash 66 | sudo aa-complain /etc/apparmor.d/usr.bin.profile 67 | ``` 68 | 69 | * **NOTE:** 70 | * In Ubuntu, you need to install the `apparmor-utils` package to use the `aa-enforce` and `aa-complain` commands. 71 | 72 | * It is also enough to restart the computer to enable the profiles. 73 | 74 | 3. View profiles status: 75 | ```bash 76 | sudo apparmor_status 77 | ``` 78 | -------------------------------------------------------------------------------- /apparmor.d/abstractions/block-networking: -------------------------------------------------------------------------------- 1 | # kate: syntax AppArmor Security Profile 2 | # vim: syntax=apparmor 3 | 4 | # Last change: March 25, 2017 5 | # Block networking 6 | 7 | deny network inet, 8 | deny network inet6, 9 | deny network netlink raw, 10 | 11 | deny @{PROC}/[0-9]*/net/if_inet6 rw, 12 | deny @{PROC}/[0-9]*/net/ipv6_route rw, 13 | deny @{PROC}/[0-9]*/net/dev rw, 14 | deny @{PROC}/[0-9]*/net/wireless rw, 15 | deny @{PROC}/[0-9]*/net/route rw, 16 | 17 | # on systems using resolvconf, /etc/resolv.conf is a symlink to 18 | # /{,var/}run/resolvconf/resolv.conf and a file sometimes referenced in 19 | # /etc/resolvconf/run/resolv.conf. Similarly, if NetworkManager is used 20 | # without resolvconf, /etc/resolv.conf is a symlink to its own resolv.conf. 21 | # Finally, on systems using systemd's networkd, /etc/resolv.conf is 22 | # a symlink to /run/systemd/resolve/resolv.conf 23 | deny /etc/resolv.conf rw, 24 | deny /{,var/}run/{resolvconf,NetworkManager,systemd/resolve}/resolv.conf rw, 25 | deny /etc/resolvconf/run/resolv.conf rw, 26 | 27 | deny /etc/host.conf rw, 28 | deny /etc/hosts rw, 29 | deny /etc/protocols rw, 30 | 31 | -------------------------------------------------------------------------------- /apparmor.d/abstractions/chromium-base: -------------------------------------------------------------------------------- 1 | # kate: syntax AppArmor Security Profile; replace-tabs off; remove-trailing-spaces mod; 2 | # vim: syntax=apparmor 3 | 4 | # Rules for Web browsers based on Chromium. 5 | # --------------------------------------------------- 6 | # This abstraction is based on the Chromium profile, 7 | # created by Jamie Strandboge 8 | # Author: Nibaldo Gonzalez 9 | # Last change: March 23, 2019 10 | 11 | # IMPORTANT: In the main profile, also include the 12 | # abstraction "ubuntu-helpers" to use the transition 13 | # to "sanitized_helper". This is not included here to 14 | # avoid possible errors of duplicate profiles. 15 | 16 | # include 17 | 18 | include 19 | include 20 | include 21 | include 22 | include 23 | include 24 | include 25 | include 26 | 27 | include 28 | 29 | # Networking 30 | network inet stream, 31 | network inet6 stream, 32 | @{PROC}/[0-9]*/net/if_inet6 r, 33 | @{PROC}/[0-9]*/net/ipv6_route r, 34 | @{PROC}/sys/net/ipv4/tcp_fastopen r, 35 | 36 | capability sys_admin, 37 | capability sys_chroot, 38 | # capability net_bind_service, # Investigate 39 | capability sys_ptrace, 40 | 41 | owner @{PROC}/[0-9]*/setgroups w, 42 | owner @{PROC}/[0-9]*/gid_map w, 43 | owner @{PROC}/[0-9]*/uid_map w, 44 | 45 | /etc/mime.types r, 46 | /etc/mailcap r, 47 | /etc/mtab r, 48 | /etc/xdg/*ubuntu/applications/defaults.list r, 49 | /etc/xfce4/defaults.list r, 50 | owner @{HOME}/.local/share/applications/defaults.list r, 51 | owner @{HOME}/.local/share/applications/mimeinfo.cache r, 52 | 53 | @{PROC}/ r, 54 | @{PROC}/filesystems r, 55 | @{PROC}/vmstat r, 56 | @{PROC}/[0-9]*/fd/ r, 57 | @{PROC}/[0-9]*/environ r, 58 | @{PROC}/[0-9]*/smaps r, 59 | @{PROC}/[0-9]*/stat r, 60 | @{PROC}/[0-9]*/statm r, 61 | @{PROC}/[0-9]*/task/[0-9]*/stat r, 62 | @{PROC}/[0-9]*/task/[0-9]*/status r, 63 | owner @{PROC}/[0-9]*/cmdline r, 64 | owner @{PROC}/[0-9]*/io r, 65 | owner @{PROC}/[0-9]*/stat r, 66 | owner @{PROC}/[0-9]*/status r, 67 | deny @{PROC}/[0-9]*/oom_{,score_}adj w, 68 | @{PROC}/sys/kernel/yama/ptrace_scope r, 69 | 70 | /etc/lsb-release r, 71 | /etc/ssl/openssl.cnf r, 72 | /etc/udev/udev.conf r, 73 | /dev/video[0-9]* r, 74 | 75 | /sys/devices/system/cpu/cpu*/{cpufreq,policy[0-9]*}/cpuinfo_max_freq r, 76 | /sys/devices/pci[0-9]*/**/{config,revision,busnum} r, 77 | /sys/devices/pci[0-9]*/**/{,subsystem_}{device,vendor} r, 78 | /sys/devices/pci[0-9]*/**/id{Product,Vendor} r, 79 | /sys/devices/pci[0-9]*/**/class r, 80 | /sys/devices/pci[0-9]*/**/irq r, 81 | /sys/devices/pci[0-9]*/**/resource r, 82 | /sys/devices/pci[0-9]*/**/removable r, 83 | /sys/devices/pci[0-9]*/**/block/**/size r, 84 | /sys/devices/pci[0-9]*/**/usb[0-9]*/[0-9]**/{descriptors,interface,manufacturer,serial,bConfigurationValue} r, 85 | /sys/devices/virtual/block/**/removable r, 86 | /sys/devices/virtual/block/**/size r, 87 | /sys/devices/virtual/tty/tty[0-9]/active r, 88 | /sys/devices/**/uevent r, 89 | 90 | # This is requested, but doesn't seem to actually be needed so deny for now 91 | deny /run/udev/data/** r, 92 | 93 | # Needed for the crash reporter 94 | owner @{PROC}/[0-9]*/auxv r, 95 | 96 | # mmaps all kinds of things for speed. 97 | /etc/passwd m, 98 | /usr/share/fonts/truetype/**/*.tt[cf] m, 99 | /usr/share/fonts/**/*.pfb m, 100 | /usr/share/mime/mime.cache m, 101 | /usr/share/icons/**/*.cache m, 102 | owner /{dev,run}/shm/pulse-shm* m, 103 | owner @{HOME}/.local/share/mime/mime.cache m, 104 | owner /tmp/** m, 105 | 106 | @{PROC}/sys/kernel/shmmax r, 107 | # owner /{dev,run}/shm/{,.}org.chromium.* mrw, 108 | owner /{var/run,run,dev}/shm/shmfd-* mrw, 109 | 110 | # Chromium Policies 111 | /etc/chromium-browser/policies/** r, 112 | /etc/chromium/** r, 113 | 114 | # Make browsing directories work 115 | /{,**/} r, 116 | 117 | # Allow access to documentation and other files the user 118 | # may want to look at in /usr 119 | /usr/{include,share,src}** r, 120 | 121 | deny /usr/share/{fonts,poppler,texmf}/{,**/}.* w, 122 | deny /usr/local/share/{fonts,texmf}/{,**/}.* w, 123 | 124 | /bin/ps Uxr, 125 | /usr/bin/xdg-settings Cxr -> xdgsettings, 126 | /usr/bin/lsb_release Cxr -> lsb_release, 127 | 128 | # Helpers 129 | /usr/bin/{exo,gnome,gvfs,xdg}-open ixr, 130 | /usr/bin/kde-open{,5} ixr, 131 | /usr/bin/kdialog ixr, 132 | # xfce/Xubuntu 133 | /usr/lib/@{multiarch}/xfce4/exo-1/exo-helper-1 ixr, 134 | /etc/xdg/xdg-xubuntu/xfce4/helpers.rc r, 135 | /etc/xdg/xfce4/helpers.rc r, 136 | 137 | /usr/bin/chrome-gnome-shell ixr, 138 | 139 | # GSettings 140 | owner /{,var/}run/user/*/dconf/ rw, 141 | owner /{,var/}run/user/*/dconf/user rw, 142 | owner @{HOME}/.config/dconf/user r, 143 | 144 | # Allow ptracing ourselves 145 | ptrace (trace) peer=@{profile_name}, 146 | ptrace (trace read) peer=@{profile_name}//lsb_release, 147 | ptrace (trace read) peer=@{profile_name}//xdgsettings, 148 | 149 | # For migration 150 | # owner @{HOME}/.mozilla/firefox/profiles.ini r, 151 | # owner @{HOME}/.mozilla/firefox/*/prefs.js r, 152 | 153 | # Importing firefox settings (requires 'r' access to @{HOME}/.mozilla/** 154 | # which is provided by abstractions/ubuntu-browsers.d/user-files). 155 | # /etc/firefox/profile/bookmarks.html r, 156 | # owner @{HOME}/.mozilla/** k, 157 | 158 | # Block binary execution and mapping of compiled libraries 159 | audit deny /{data,media,mnt,srv,net}/** mx, 160 | audit deny @{HOME}/{*,[^.]**} mx, 161 | audit deny /tmp/** x, 162 | # audit deny owner /**/* x, 163 | 164 | deny @{HOME}/.local/share/applications/** w, 165 | audit deny @{HOME}/.local/share/flatpak/** w, 166 | audit deny @{HOME}/.kde{,4}/{,share/,share/apps/} w, 167 | deny /usr/lib/vlc/plugins/plugins.dat.* w, 168 | deny @{HOME}/.* w, 169 | deny @{HOME}/.bash* r, 170 | deny @{HOME}/.sudo_as_admin_* r, 171 | 172 | owner @{HOME}/.pki/nssdb/* rwk, 173 | owner @{HOME}/.config/gtk-3.0/* r, 174 | # owner @{HOME}/.local/share/.org.chromium.Chromium{,.[a-zA-Z0-9]*} rw, 175 | 176 | owner @{HOME}/.cache/fontconfig/*.cache-* rw, 177 | deny /var/cache/fontconfig/ w, 178 | 179 | owner @{HOME}/.cache/mesa_shader_cache/** rw, 180 | owner @{HOME}/.cache/mesa_shader_cache/**.tmp k, 181 | 182 | 183 | # For KDE Plasma 5 (used by kdialog & kde-open5). 184 | # This could be inside a child profile for the kdialog and kde-open5 185 | # binaries, but most of the rules in the parent profile are repeated. 186 | 187 | include 188 | 189 | owner @{HOME}/.config/kio* r, 190 | owner @{HOME}/.config/kdialogrc rw, 191 | owner @{HOME}/.config/kdialogrc.[a-zA-Z0-9]* rwk, 192 | link @{HOME}/.config/kdialogrc.[a-zA-Z0-9]* -> "/home/*/.config/#[0-9]*", 193 | owner @{HOME}/.local/share/qt_temp.* rwk, 194 | deny @{HOME}/.local/share/RecentDocuments/* w, 195 | owner @{PROC}/[0-9]*/mounts r, 196 | /usr/lib{,64,/@{multiarch}}/qt5/plugins/{imageformats,platformthemes,styles}/*.so m, 197 | /etc/fstab r, 198 | /etc/rpc r, 199 | /dev/tty r, 200 | 201 | # FIXME: chromium-browser has problems opening dialogs to open or save files 202 | # with kdialog (info: Failed name lookup - deleted entry). 203 | # The problem is not reproduced in Opera, Vivaldi and Brave. 204 | owner /run/user/[0-9]*/kdialog*.slave-socket rwk, 205 | owner /run/user/[0-9]*/#[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] rwk, 206 | link /run/user/[0-9]*/kdialog*.slave-socket -> "/run/user/[0-9]*/#[0-9]*", 207 | owner /run/user/[0-9]*/kdeinit5* rwk, 208 | link /run/user/[0-9]*/kdeinit5* -> "/run/user/[0-9]*/#[0-9]*", 209 | /usr/lib{,64,/@{multiarch}}/libexec/drkonqi ixr, 210 | 211 | @{PROC}/sys/kernel/core_pattern r, 212 | 213 | # Plasma browser integration support (temporary solution) 214 | # NOTE: "sanitized_helper" is provided by the "ubuntu-helpers" abstraction. 215 | /usr/bin/plasma-browser-integration-host Cxr -> sanitized_helper, 216 | /etc/opt/chrome/native-messaging-hosts/org.kde.plasma.browser_integration.json r, 217 | # ptrace (read) peer=@{profile_name}//sanitized_helper, 218 | 219 | signal (send) set=(term) peer=unconfined, 220 | 221 | 222 | profile lsb_release flags=(attach_disconnected) { 223 | include 224 | include 225 | /usr/bin/lsb_release r, 226 | /bin/dash ixr, 227 | /usr/bin/dpkg-query ixr, 228 | /usr/include/python2.[4567]/pyconfig.h r, 229 | /etc/lsb-release r, 230 | /etc/debian_version r, 231 | /usr/share/distro-info/*.csv r, 232 | /var/lib/dpkg/** r, 233 | 234 | /usr/local/lib{,64}/python3.[0-6]/dist-packages/ r, 235 | /usr/bin/ r, 236 | /usr/bin/python3.[0-6] mr, 237 | 238 | # file_inherit 239 | deny /tmp/gtalkplugin.log w, 240 | } 241 | -------------------------------------------------------------------------------- /apparmor.d/abstractions/chromium-base-sandbox: -------------------------------------------------------------------------------- 1 | # kate: syntax AppArmor Security Profile; replace-tabs off; remove-trailing-spaces mod; 2 | # vim: syntax=apparmor 3 | 4 | # Chromium sandbox binary: 5 | # Rules for Web browsers based on Chromium. 6 | # --------------------------------------------------- 7 | # This abstraction is based on the Chromium profile, 8 | # created by Jamie Strandboge 9 | # Author: Nibaldo Gonzalez 10 | # Last change: September 29, 2018 11 | 12 | # Be fanatical since it is setuid root and don't use an abstraction 13 | /lib{,64}/libgcc_s.so* mr, 14 | /lib{,64,/@{multiarch}}/libgcc_s.so* mr, 15 | /lib{,64}/libm-*.so* mr, 16 | /lib{,64,/@{multiarch}}/libm-*.so* mr, 17 | /lib{,64}/libpthread-*.so* mr, 18 | /lib{,64,/@{multiarch}}/libpthread-*.so* mr, 19 | /lib{,64}/libc-*.so* mr, 20 | /lib{,64,/@{multiarch}}/libc-*.so* mr, 21 | /lib{,64}/libld-*.so* mr, 22 | /lib{,64,/@{multiarch}}/libld-*.so* mr, 23 | /lib{,64}/ld-*.so* mr, 24 | /lib{,64,/@{multiarch}}ld-*.so* mr, 25 | /lib{,64}/tls/*/{cmov,nosegneg}/libm-*.so* mr, 26 | /lib{,64}/tls/*/{cmov,nosegneg}/libpthread-*.so* mr, 27 | /lib{,64}/tls/*/{cmov,nosegneg}/libc-*.so* mr, 28 | /usr/lib{,64}/libstdc++.so* mr, 29 | /usr/lib{,64,/@{multiarch}}/libstdc++.so* mr, 30 | /lib{,64,/@{multiarch}}/librt-*.so* mr, 31 | /etc/ld.so.cache r, 32 | 33 | # Required for dropping into PID namespace. Keep in mind that until the 34 | # process drops this capability it can escape confinement, but once it 35 | # drops CAP_SYS_ADMIN we are ok. 36 | capability sys_admin, 37 | 38 | # All of these are for sanely dropping from root and chrooting 39 | capability chown, 40 | capability fsetid, 41 | capability setgid, 42 | capability setuid, 43 | capability dac_override, 44 | capability sys_chroot, 45 | 46 | capability sys_ptrace, 47 | ptrace (read, readby), 48 | 49 | signal (receive) peer=unconfined, 50 | signal peer=@{profile_name}, 51 | signal (receive, send) set=("exists"), 52 | 53 | unix (create), 54 | unix peer=(label=@{profile_name}), 55 | unix (getattr, getopt, setopt, shutdown) addr=none, 56 | 57 | @{PROC}/ r, 58 | @{PROC}/[0-9]*/ r, 59 | @{PROC}/[0-9]*/fd/ r, 60 | deny @{PROC}/[0-9]*/oom_{,score_}adj w, 61 | @{PROC}/[0-9]*/status r, 62 | @{PROC}/[0-9]*/task/[0-9]*/stat r, 63 | 64 | /dev/null rw, 65 | 66 | owner /tmp/** rw, 67 | -------------------------------------------------------------------------------- /apparmor.d/abstractions/chromium-base-xdgsettings: -------------------------------------------------------------------------------- 1 | # kate: syntax AppArmor Security Profile; replace-tabs off; remove-trailing-spaces mod; 2 | # vim: syntax=apparmor 3 | 4 | # Chromium xdg-settings binary: 5 | # Rules for Web browsers based on Chromium. 6 | # --------------------------------------------------- 7 | # This abstraction is based on the Chromium profile, 8 | # created by Jamie Strandboge 9 | # Author: Nibaldo Gonzalez 10 | # Last change: November 22, 2017 11 | 12 | include 13 | include 14 | 15 | # For KDE Plasma 5 16 | owner @{HOME}/.config/kdeglobals rk, 17 | owner @{HOME}/.cache/ksycoca5_* r, 18 | /usr/share/qt5/translations/qt_*.qm r, 19 | 20 | /usr/bin/kreadconfig5 ixr, 21 | /usr/bin/ktraderclient5 ixr, 22 | /usr/bin/head ixr, 23 | 24 | /bin/dash ixr, 25 | 26 | /etc/ld.so.cache r, 27 | /usr/bin/xdg-settings r, 28 | # /{opt,usr/lib,usr/lib64,usr/lib/*-linux-gnu}/*/xdg-settings r, 29 | /usr/share/applications/*.desktop r, 30 | 31 | # Checking default browser 32 | /bin/grep ixr, 33 | /bin/readlink ixr, 34 | /bin/sed ixr, 35 | /bin/which ixr, 36 | /usr/bin/basename ixr, 37 | /usr/bin/cut ixr, 38 | 39 | # Setting the default browser 40 | /bin/mkdir ixr, 41 | /bin/mv ixr, 42 | /bin/touch ixr, 43 | /usr/bin/dirname ixr, 44 | /usr/bin/gconftool-2 ix, 45 | /usr/bin/[gm]awk ixr, 46 | /usr/bin/xdg-mime ixr, 47 | owner @{HOME}/.local/share/applications/ w, 48 | owner @{HOME}/.local/share/applications/mimeapps.list* rw, 49 | -------------------------------------------------------------------------------- /apparmor.d/abstractions/confidential-deny: -------------------------------------------------------------------------------- 1 | # kate: syntax AppArmor Security Profile 2 | # vim: syntax=apparmor 3 | 4 | # Block full access to sensitive data, as passwords, keys and some system directories. 5 | # View: tunables/confidential. 6 | deny @{CONFIDENTIAL} rwklmx, 7 | -------------------------------------------------------------------------------- /apparmor.d/abstractions/flatpak-snap: -------------------------------------------------------------------------------- 1 | # kate: syntax AppArmor Security Profile 2 | # vim: syntax=apparmor 3 | 4 | # Author: Nibaldo Gonzalez 5 | # Last change: February 07, 2018 6 | 7 | # Flatpak 8 | /var/lib/flatpak/exports/share/** r, 9 | /var/lib/flatpak/app/**/export/share/applications/*.desktop r, 10 | /var/lib/flatpak/app/**/export/share/applications/ r, 11 | owner @{HOME}/.local/share/flatpak/exports/share/** r, 12 | owner @{HOME}/.local/share/flatpak/app/**.desktop r, 13 | owner @{HOME}/.local/share/flatpak/app/ r, 14 | deny @{HOME}/.local/share/flatpak/** w, 15 | 16 | # Snap 17 | /var/lib/snapd/desktop/applications/mimeinfo.cache r, 18 | /var/lib/snapd/desktop/applications/*.desktop r, 19 | /var/lib/snapd/desktop/applications/ r, 20 | -------------------------------------------------------------------------------- /apparmor.d/abstractions/general-security: -------------------------------------------------------------------------------- 1 | # kate: syntax AppArmor Security Profile 2 | # vim: syntax=apparmor 3 | 4 | # Author: Nibaldo Gonzalez 5 | # Last change: February 07, 2018 6 | 7 | # Block binary execution & mapping of compiled libraries from untrusted sources 8 | audit deny owner /**/* mx, 9 | audit deny @{HOME}/** mx, 10 | audit deny /{data,media,mnt,srv,net,cdrom,var,run,tmp}/** mx, 11 | 12 | # Block Python imports from untrusted sources 13 | deny owner /**/**.py* r, 14 | deny @{HOME}/**.py* r, 15 | deny /{data,media,mnt,srv,net,cdrom,var,run,tmp}/**.py* r, 16 | 17 | audit deny /dev/{video,audio}* rwlkmx, 18 | 19 | # For Windows partition 20 | deny /media/*/[Ww]indows/{Program*,Windows}/{,**} w, 21 | deny /media/*/[Ww]indows/Users/ w, 22 | deny /media/*/[Ww]indows/Users/*/ w, 23 | 24 | # Avoid modifications 25 | audit deny @{HOME}/.local/share/applications/** w, 26 | audit deny @{HOME}/.local/share/flatpak/** w, 27 | audit deny @{HOME}/.kde{,4}/{,share/,share/apps/} w, 28 | audit deny @{HOME}/.app/** w, 29 | 30 | audit deny @{HOME}/.* w, 31 | deny @{HOME}/.bash_history r, 32 | 33 | # Others 34 | deny /run/udev/data/** rwklmx, 35 | -------------------------------------------------------------------------------- /apparmor.d/abstractions/kde-dialog: -------------------------------------------------------------------------------- 1 | # kate: syntax AppArmor Security Profile 2 | # vim: syntax=apparmor 3 | 4 | # Author: Nibaldo Gonzalez 5 | # Last change: February 27, 2018 6 | 7 | #/usr/bin/kde-open{,5} Cx -> kde-dialog, 8 | #/usr/bin/kdeinit5 Cx -> kde-dialog, 9 | #/usr/bin/kdialog Cx -> kde-dialog, 10 | 11 | profile kde-dialog { 12 | include 13 | include 14 | include 15 | include 16 | 17 | /{,**/} r, 18 | /{data,home,media,mnt,srv,net,cdrom}/** r, 19 | 20 | owner @{HOME}/.config/kdialogrc rw, 21 | owner @{HOME}/.config/kdialogrc.[a-zA-Z0-9]* rwk, 22 | deny @{HOME}/.local/share/RecentDocuments/* w, 23 | 24 | owner /run/user/[0-9]*/kdialog*.slave-socket rwk, 25 | owner /run/user/[0-9]*/\#[0-9]* rwk, 26 | 27 | link @{HOME}/.config/kdialogrc.[a-zA-Z0-9]* -> "/home/*/.config/#[0-9]*", 28 | link /run/user/[0-9]*/kdialog*.slave-socket -> "/run/user/[0-9]*/#[0-9]*", 29 | 30 | #/usr/lib{,64,/*-linux-gnu}/qt5/plugins/{imageformats,platformthemes,styles}/*.so m, 31 | /etc/fstab r, 32 | /etc/rpc r, 33 | /dev/tty r, 34 | 35 | /sys/devices/**/uevent r, 36 | /sys/devices/pci[0-9]*/**/{busnum,config,revision} r, 37 | /sys/devices/pci[0-9]*/**/{,subsystem_}{device,vendor} r, 38 | /sys/devices/pci[0-9]*/**/id{Product,Vendor} r, 39 | owner @{PROC}/@{pid}/{cmdline,mountinfo,mounts,stat,status,vmstat} r, 40 | owner @{PROC}/@{pid}/task/[0-9]*/stat r, 41 | } 42 | -------------------------------------------------------------------------------- /apparmor.d/abstractions/kde-plasma5: -------------------------------------------------------------------------------- 1 | # kate: syntax AppArmor Security Profile 2 | # vim: syntax=apparmor 3 | 4 | # Author: Nibaldo Gonzalez 5 | # Last change: February 07, 2018 6 | 7 | # KDE Plasma 5 8 | 9 | include 10 | include 11 | include 12 | include 13 | include 14 | include 15 | 16 | include 17 | include 18 | 19 | owner @{HOME}/.config/kde.org/** r, 20 | owner @{HOME}/.config/kdebugrc rw, 21 | owner @{HOME}/.config/libaccounts-glib/ rw, 22 | owner @{HOME}/.config/libaccounts-glib/accounts.db rk, 23 | owner @{HOME}/.config/Trolltech.conf rk, 24 | 25 | owner @{HOME}/.local/share/icons/** rw, 26 | /usr/share/icons/** r, 27 | 28 | /usr/share/color-schemes/** r, 29 | /usr/share/knotifications5/** r, 30 | /usr/share/kservices5/** r, 31 | /usr/share/kxmlgui5/** r, 32 | /usr/share/plasma/** r, 33 | /usr/share/qt5/** r, 34 | /usr/share/sounds/** r, 35 | /usr/share/mime/** r, 36 | /usr/share/templates/** r, 37 | 38 | /etc/xdg/** r, 39 | /etc/xdg/Trolltech.conf k, 40 | deny /etc/xdg/{autostart,systemd}/** rw, 41 | 42 | # Qt5 43 | /usr/lib{,64,32,x32,/@{multiarch}}/qt5/** r, 44 | /usr/lib{,64,32,x32,/@{multiarch}}/qt5/plugins/{,**/}*.so m, 45 | /usr/lib{,64,32,x32,/@{multiarch}}/qt5/qml/{,**/}*.{so,jsc,qmlc} m, 46 | /usr/lib{,64,32,x32,/@{multiarch}}/qt5/{bin,libexec}/** ix, 47 | 48 | /usr/lib/@{multiarch}/libexec/kf5/** ix, 49 | deny /usr/lib{,64,32,x32,/@{multiarch}}/vlc/plugins/plugins.dat* w, 50 | 51 | # Temporal files 52 | owner @{HOME}/.local/share/qt_temp.* rwk, 53 | owner @{HOME}/.kde/tmp-* rwk, 54 | 55 | owner /tmp/** rwlk, 56 | owner /{,var/}tmp/kde{,cache}-*/ rwl, 57 | owner /{,var/}tmp/kde{,cache}-*/** rwlk, 58 | owner /{,var/}run/user/[0-9]*/kdeinit5* rwlk, 59 | owner /{,var/}run/user/[0-9]*/ksocket-*/ rwl, 60 | owner /{,var/}run/user/[0-9]*/ksocket-*/** rwlk, 61 | owner /{,var/}run/user/[0-9]*/kioclient*-socket rwlk, 62 | -------------------------------------------------------------------------------- /apparmor.d/abstractions/kde-user: -------------------------------------------------------------------------------- 1 | # kate: syntax AppArmor Security Profile 2 | # vim: syntax=apparmor 3 | 4 | # Author: Nibaldo Gonzalez 5 | # Last change: February 27, 2018 6 | 7 | # Local Configuration Files in KDE Plasma 5 8 | 9 | owner @{HOME}/.config/.[a-zA-Z0-9]* rwk, 10 | owner @{HOME}/.config/kdeglobals rw, 11 | owner @{HOME}/.config/kdeglobals.[a-zA-Z0-9]* rwk, 12 | owner @{HOME}/.config/QtProject.conf rw, 13 | owner @{HOME}/.config/QtProject.conf.[a-zA-Z0-9]* rwk, 14 | owner @{HOME}/.config/QtProject/{,**} rw, 15 | 16 | owner "@{HOME}/.config/#[0-9]*" rwk, 17 | link @{HOME}/.config/QtProject.conf.[a-zA-Z0-9]* -> "/home/*/.config/#[0-9]*", 18 | link @{HOME}/.config/kdeglobals.[a-zA-Z0-9]* -> "/home/*/.config/#[0-9]*", 19 | #link @{HOME}/.config/?*.[a-zA-Z0-9]* -> "/home/*/.config/#[0-9]*", 20 | #link @{HOME}/.config/**/?*.[a-zA-Z0-9]* -> "/home/*/.config/**/#[0-9]*", 21 | 22 | owner @{HOME}/.config/baloofilerc r, 23 | owner @{HOME}/.config/breezerc r, 24 | owner @{HOME}/.config/kioslaverc r, 25 | owner @{HOME}/.config/klanguageoverridesrc r, 26 | owner @{HOME}/.config/trashrc rw, 27 | 28 | # owner @{HOME}/.config/kdebugrc rw, 29 | # owner @{HOME}/.config/kdialogrc rw, 30 | # owner @{HOME}/.config/kdialogrc.[a-zA-Z0-9]* rwk, 31 | # owner @{HOME}/.config/kde.org/libphonon.conf r, 32 | 33 | owner @{HOME}/.cache/icon-cache.kcache rw, 34 | owner @{HOME}/.cache/ksycoca5_* r, 35 | owner @{HOME}/.cache/qt_compose_cache_* rw, 36 | 37 | owner @{HOME}/.local/share/user-places.xbel{,.[a-zA-Z0-9]*} rw, 38 | owner @{HOME}/.local/share/RecentDocuments/*.desktop rwl, 39 | owner @{HOME}/.local/share/RecentDocuments/{,*.desktop}.[a-zA-Z0-9]* rwk, 40 | -------------------------------------------------------------------------------- /apparmor.d/abstractions/networkmanager-strict: -------------------------------------------------------------------------------- 1 | # kate: syntax AppArmor Security Profile 2 | # vim: syntax=apparmor 3 | 4 | # Author: Nibaldo Gonzalez 5 | # Last change: September 07, 2017 6 | 7 | dbus (send) 8 | bus=system 9 | path=/org/freedesktop/NetworkManager 10 | interface=org.freedesktop.DBus.Properties 11 | member={GetAll,GetDevices} 12 | peer=(name=org.freedesktop.NetworkManager label=unconfined), 13 | dbus (send) 14 | bus=system 15 | path=/org/freedesktop/NetworkManager 16 | interface=org.freedesktop.NetworkManager 17 | member=GetDevices 18 | peer=(name=org.freedesktop.NetworkManager label=unconfined), 19 | 20 | dbus (send) 21 | bus=system 22 | path=/org/freedesktop/NetworkManager/Settings 23 | interface=org.freedesktop.NetworkManager.Settings 24 | member=ListConnections 25 | peer=(name=org.freedesktop.NetworkManager label=unconfined), 26 | dbus (send) 27 | bus=system 28 | path=/org/freedesktop/NetworkManager/Settings/[0-9]* 29 | interface=org.freedesktop.NetworkManager.Settings.Connection 30 | member=GetSettings 31 | peer=(name=org.freedesktop.NetworkManager label=unconfined), 32 | 33 | dbus (send) 34 | bus=system 35 | path=/org/freedesktop/NetworkManager{,/ActiveConnection/[0-9]*,/Devices/[0-9]*} 36 | interface=org.freedesktop.DBus.Properties 37 | member=GetAll 38 | peer=(name=org.freedesktop.NetworkManager label=unconfined), 39 | dbus (receive) 40 | bus=system 41 | path=/org/freedesktop/NetworkManager/ActiveConnection/[0-9]* 42 | interface=org.freedesktop.NetworkManager.Connection.Active 43 | member=PropertiesChanged, 44 | -------------------------------------------------------------------------------- /apparmor.d/abstractions/open-browser: -------------------------------------------------------------------------------- 1 | # kate: syntax AppArmor Security Profile; replace-tabs off; remove-trailing-spaces mod; 2 | # vim: syntax=apparmor 3 | 4 | # Author: Nibaldo Gonzalez 5 | # Last change: October 13, 2019 6 | 7 | # Open Web browsers, needed to open links. 8 | # Only for Firefox, Opera, Chromium, Chrome, Vivaldi, Brave, Falkon & Pale Moon. 9 | # To support more browsers, you can also use (in the toplevel profile): 10 | # #include 11 | # #include 12 | 13 | # Firefox 14 | # "/usr/bin/firefox" is a link to: "/usr/lib{,64}/firefox/firefox.sh" 15 | # This is a script that executes: "/usr/lib{,64}/firefox/firefox" 16 | /usr/bin/{,_*.}firefox ixr, 17 | /usr/lib{,64}/firefox/firefox.sh ixr, 18 | /usr/lib{,64}/firefox/firefox PUx, 19 | 20 | # Opera 21 | # "/usr/bin/opera" is a link to: "/usr/lib{*,/*}/opera/opera" 22 | /usr/lib{,64,/x86_64-linux-gnu,/i386-linux-gnu}/opera/opera PUx, 23 | 24 | # Chromium 25 | # "/usr/bin/chromium-browser" is a script that executes: "/usr/lib{,64}/chromium-browser/chromium-browser" 26 | /usr/bin/chromium-browser ixr, 27 | /usr/lib{,64}/chromium-browser/chromium-browser PUx, 28 | 29 | # Chrome 30 | # "/usr/bin/google-chrome-stable" is a link to: "/opt/google/chrome/google-chrome" 31 | # This is a script that executes: "/opt/google/chrome/chrome" 32 | /opt/google/chrome/google-chrome ixr, 33 | /opt/google/chrome/chrome PUx, 34 | 35 | # Vivaldi 36 | # "/usr/bin/vivaldi" is a link to: "/opt/vivaldi/vivaldi" 37 | # This is a script that executes: "/opt/vivaldi/vivaldi-bin" 38 | /opt/vivaldi/vivaldi ixr, 39 | /opt/vivaldi/vivaldi-bin PUx, 40 | 41 | # Bave 42 | # "/usr/bin/brave-browser" is a link to: "/opt/brave.com/brave/brave-browser" 43 | # This is a script that executes: "/opt/brave.com/brave/brave" 44 | /opt/brave.com/brave/brave-browser ixr, 45 | /opt/brave.com/brave/brave PUx, 46 | 47 | # Falkon 48 | /usr/bin/falkon PUx, 49 | 50 | # Pale Moon 51 | /usr/lib{,64}/palemoon/palemoon PUx, 52 | 53 | /bin/which ixr, 54 | -------------------------------------------------------------------------------- /apparmor.d/abstractions/open-email: -------------------------------------------------------------------------------- 1 | # kate: syntax AppArmor Security Profile 2 | # vim: syntax=apparmor 3 | 4 | # Author: Nibaldo Gonzalez 5 | # Last change: May 12, 2017 6 | 7 | # Open e-mail clients. 8 | # Only for Thunderbird. 9 | # To support more e-mail clients, you can also use (in the toplevel profile): 10 | # #include 11 | # #include 12 | 13 | # Thunderbird 14 | # "/usr/bin/thunderbird" is a link to: "/usr/lib{,64}/thunderbird/thunderbird.sh" 15 | # This is a script that executes: "/usr/lib{,64}/thunderbird/thunderbird" 16 | /usr/lib{,64}/thunderbird/thunderbird.sh ix, 17 | /usr/lib{,64}/thunderbird/thunderbird PUx, 18 | 19 | /bin/which ix, 20 | -------------------------------------------------------------------------------- /apparmor.d/abstractions/open-messaging: -------------------------------------------------------------------------------- 1 | # kate: syntax AppArmor Security Profile 2 | # vim: syntax=apparmor 3 | 4 | /usr/bin/konversation Pxr, 5 | /usr/bin/Telegram Pxr, 6 | /home/*/.TelegramDesktop/bin/Telegram Pxr, 7 | -------------------------------------------------------------------------------- /apparmor.d/abstractions/open-some-applications: -------------------------------------------------------------------------------- 1 | # kate: syntax AppArmor Security Profile 2 | # vim: syntax=apparmor 3 | 4 | # Author: Nibaldo Gonzalez 5 | # Last change: February 07, 2018 6 | 7 | # Applications with AppArmor Profile: 8 | 9 | # Document and image viewers 10 | /usr/bin/gwenview Px, 11 | /usr/bin/okular Px, 12 | 13 | # Media players 14 | /usr/bin/baka-mplayer Px, 15 | /usr/bin/bomi Px, 16 | /usr/bin/mpv Px, 17 | /usr/bin/vlc Px, 18 | 19 | # Messenger 20 | /usr/bin/konversation Px, 21 | /home/*/.TelegramDesktop/bin/Telegram Px, 22 | 23 | # Download clients and torrents 24 | /usr/bin/kget Px, 25 | /usr/bin/ktorrent Px, 26 | /usr/bin/qbittorrent Px, 27 | 28 | # Others Applications: 29 | 30 | # File manager 31 | /usr/bin/dolphin PUx, 32 | 33 | # Archivers 34 | /usr/bin/ark Cx -> sanitized_helper, 35 | /usr/bin/file-roller Cx -> sanitized_helper, 36 | /usr/bin/xarchiver Cx -> sanitized_helper, 37 | 38 | # Office 39 | /usr/bin/libreoffice Cx -> sanitized_helper, 40 | /usr/bin/lo{calc,draw,impress,writer} Cx -> sanitized_helper, 41 | /usr/lib{,64}/libreoffice/program/s{office,calc,draw,impress,writer} PUx, 42 | /usr/bin/calligra{sheets,stage,words} Cx -> sanitized_helper, 43 | 44 | # PDF viewers 45 | /usr/bin/evince Cx -> sanitized_helper, 46 | 47 | # Image and scanners 48 | /usr/bin/eog Cx -> sanitized_helper, 49 | /usr/bin/shotwell Cx -> sanitized_helper, 50 | /usr/bin/digikam Cx -> sanitized_helper, 51 | /usr/bin/f-spot Cx -> sanitized_helper, 52 | /usr/bin/gimp* Cx -> sanitized_helper, 53 | /usr/bin/inkscape Cx -> sanitized_helper, 54 | /usr/bin/krita Cx -> sanitized_helper, 55 | /usr/bin/clamscan Cx -> sanitized_helper, 56 | /usr/bin/skanlite Cx -> sanitized_helper, 57 | /usr/bin/darktable* Cx -> sanitized_helper, 58 | /usr/bin/mirage Cx -> sanitized_helper, 59 | 60 | # Multimedia 61 | /usr/bin/amarok Cx -> sanitized_helper, 62 | /usr/bin/clementine Cx -> sanitized_helper, 63 | /usr/bin/subtitleeditor Cx -> sanitized_helper, 64 | 65 | # Text editors 66 | include 67 | /usr/bin/kile Cx -> sanitized_helper, 68 | 69 | # Feed readers 70 | ## include 71 | -------------------------------------------------------------------------------- /apparmor.d/abstractions/ubuntu-browsers.d/chromium-browser: -------------------------------------------------------------------------------- 1 | # kate: syntax AppArmor Security Profile; 2 | # vim: syntax=apparmor 3 | 4 | # NOTE: This file is part of the "apparmor-profiles" package of Ubuntu 16.04 & 18.04. 5 | 6 | # This file is updated currently not managed by the package but in the future 7 | # will be overwritten on upgrades. 8 | # 9 | # For site-specific adjustments, please see: 10 | # /etc/apparmor.d/local/usr.bin.chromium-browser 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | -------------------------------------------------------------------------------- /apparmor.d/abstractions/ubuntu-browsers.d/user-files: -------------------------------------------------------------------------------- 1 | # kate: syntax AppArmor Security Profile; 2 | # vim:syntax=apparmor 3 | 4 | # NOTE: This file is part of the AppArmor provided policy in Ubuntu 16.04 & 18.04. 5 | 6 | # Allow read to all files user has DAC access to and write access to all 7 | # files owned by the user in $HOME. 8 | @{HOME}/ r, 9 | @{HOME}/** r, 10 | # owner @{HOME}/** w, 11 | 12 | # Do not allow read and/or write to particularly sensitive/problematic files 13 | #include 14 | audit deny @{HOME}/.ssh/{,**} mrwkl, 15 | audit deny @{HOME}/.gnome2_private/{,**} mrwkl, 16 | audit deny @{HOME}/.kde{,4}/{,share/,share/apps/} w, 17 | audit deny @{HOME}/.kde{,4}/share/apps/kwallet/{,**} mrwkl, 18 | 19 | # Comment this out if using gpg plugin/addons 20 | audit deny @{HOME}/.gnupg/{,**} mrwkl, 21 | 22 | # Allow read to all files user has DAC access to and write for files the user 23 | # owns on removable media and filesystems. 24 | /media/** r, 25 | /mnt/** r, 26 | /srv/** r, 27 | /net/** r, 28 | # owner /media/** w, 29 | # owner /mnt/** w, 30 | # owner /srv/** w, 31 | # owner /net/** w, 32 | -------------------------------------------------------------------------------- /apparmor.d/abstractions/udisk-strict: -------------------------------------------------------------------------------- 1 | # kate: syntax AppArmor Security Profile 2 | # vim: syntax=apparmor 3 | 4 | # Author: Nibaldo Gonzalez 5 | # Last change: September 04, 2017 6 | 7 | dbus (send) 8 | bus=system 9 | path=/org/freedesktop/UPower 10 | interface=org.freedesktop.DBus.Introspectable 11 | member=Introspect 12 | peer=(name=org.freedesktop.UPower label=unconfined), 13 | 14 | dbus (send) 15 | bus=system 16 | path=/org/freedesktop/UDisks2/{block_devices,drives}{,/*} 17 | interface=org.freedesktop.DBus.Introspectable 18 | member=Introspect 19 | peer=(name=org.freedesktop.UDisks2), 20 | 21 | dbus (send) 22 | bus=system 23 | path=/org/freedesktop/UDisks2/{block_devices,drives}/* 24 | interface=org.freedesktop.DBus.Properties 25 | member={Get,GetAll} 26 | peer=(name=org.freedesktop.UDisks2), 27 | 28 | dbus (send receive) 29 | bus=system 30 | path=/org/freedesktop/UDisks2/drives/* 31 | interface=org.freedesktop.DBus.Properties 32 | member=PropertiesChanged, 33 | -------------------------------------------------------------------------------- /apparmor.d/default-abstractions/wayland: -------------------------------------------------------------------------------- 1 | # kate: syntax AppArmor Security Profile; 2 | # vim:syntax=apparmor 3 | # ------------------------------------------------------------------ 4 | # 5 | # Copyright (C) 2016 intrigeri 6 | # 7 | # This program is free software; you can redistribute it and/or 8 | # modify it under the terms of version 2 of the GNU General Public 9 | # License published by the Free Software Foundation. 10 | # 11 | # ------------------------------------------------------------------ 12 | 13 | # NOTE: this profile belongs to the AppArmor provided policy 14 | 15 | owner /var/run/user/*/weston-shared-* rw, 16 | owner /run/user/*/wayland-[0-9]* rw, 17 | owner /run/user/*/{mesa,mutter,sdl,wayland-cursor,weston,xwayland}-shared-* rw, 18 | -------------------------------------------------------------------------------- /apparmor.d/opt.brave: -------------------------------------------------------------------------------- 1 | # AppArmor profile for Brave Web browser 2 | # --------------------------------------------- 3 | # Author: Nibaldo Gonzalez 4 | # Last change: March 19, 2019 5 | # This AppArmor profile is based on the Chromium profile 6 | # by Jamie Strandboge 7 | 8 | # NOTE: 9 | # - Important: Check & change the user download & desktop directory. 10 | # - By default, there is only write access to the download & desktop directory. 11 | # - This profile is tested on Ubuntu 18.04 & KDE Plasma 5. 12 | 13 | # Requirements: 14 | # apparmor.d/tunables/confidential 15 | # apparmor.d/abstractions/chromium-base 16 | # apparmor.d/abstractions/chromium-base-xdgsettings 17 | # apparmor.d/abstractions/chromium-base-sandbox 18 | # apparmor.d/abstractions/kde-user 19 | # apparmor.d/abstractions/flatpak-snap 20 | # apparmor.d/abstractions/open-some-applications 21 | 22 | include 23 | include 24 | 25 | # Brave directory: 26 | @{BRAVE_LIBDIR} = /opt/brave.com/brave 27 | 28 | # User directories, with write access 29 | # (downloads and desktop directories): 30 | @{USER_DIR} = @{HOME}/Descargas 31 | @{USER_DIR} += @{HOME}/Escritorio 32 | 33 | profile brave-browser /opt/brave.com/brave/brave flags=(attach_disconnected) { 34 | # Base rules for Web browsers based on Chromium. 35 | include 36 | include 37 | 38 | # Required to open downloaded files. 39 | include 40 | 41 | # This include specifies which ubuntu-browsers.d abstractions to use. Eg, if you 42 | # want access to productivity applications, adjust the following file accordingly. 43 | ## include 44 | 45 | # Block full access to sensitive data, as passwords and keys. 46 | # Includes /boot/**, /var/log/** & /etc/apparmor.d/** directories. View in: tunables/confidential. 47 | deny @{CONFIDENTIAL_EXCEPT_BRAVE} rwklmx, 48 | 49 | owner /{dev,run}/shm/{,.}org.chromium.* mrw, 50 | deny /etc/opt/chrome/ w, 51 | 52 | # For the file download dialog 53 | owner @{PROC}/@{pid}/mountinfo r, 54 | /run/mount/utab r, 55 | 56 | # Access to Home, removable medias & other folders 57 | @{HOME}/{,*,[^.]**} r, 58 | /{data,media,mnt,srv,net}/** r, 59 | 60 | # User folders 61 | owner @{HOME}/ r, 62 | owner @{USER_DIR}/ r, 63 | owner @{USER_DIR}/** rw, 64 | 65 | # Brave configuration 66 | owner @{HOME}/.{config,cache}/BraveSoftware/{,Brave-Browser/} rw, 67 | owner @{HOME}/.config/BraveSoftware/Brave-Browser/** rwk, 68 | owner @{HOME}/.config/BraveSoftware/Brave-Browser/{,**/}Dictionaries/*.bdic mr, 69 | owner @{HOME}/.config/BraveSoftware/Brave-Browser/**/Cache/* mr, 70 | owner @{HOME}/.cache/BraveSoftware/Brave-Browser/** rw, 71 | owner "@{HOME}/.cache/BraveSoftware/Brave-Browser/{Default,Tor Profile}/Cache/*" mr, 72 | 73 | # Tor 74 | # TODO: create a child profile for Tor 75 | owner @{HOME}/.config/BraveSoftware/Brave-Browser/*/[0-9]*/tor-[0-9]*-linux-brave-[0-9] ix, 76 | @{PROC}/sys/kernel/random/uuid r, 77 | 78 | # Access to Brave directory 79 | deny @{BRAVE_LIBDIR}/** w, # Noisy 80 | @{BRAVE_LIBDIR}/** r, 81 | @{BRAVE_LIBDIR}/*.pak mr, 82 | @{BRAVE_LIBDIR}/locales/* mr, 83 | @{BRAVE_LIBDIR}/xdg-settings Cxr -> xdgsettings, 84 | 85 | # Allow transitions to ourself and our sandbox 86 | @{BRAVE_LIBDIR}/brave ix, 87 | @{BRAVE_LIBDIR}/brave-sandbox cx -> brave_sandbox, 88 | 89 | # Allow communicating with sandbox 90 | unix (receive, send) peer=(label=@{BRAVE_LIBDIR}/brave//brave_sandbox), 91 | 92 | # Noisy 93 | audit deny @{HOME}/.[^c]** x, 94 | 95 | profile xdgsettings flags=(attach_disconnected) { 96 | # Base rules for xdg-settings binary. 97 | include 98 | 99 | deny @{CONFIDENTIAL_EXCEPT_BRAVE} rwklmx, 100 | } 101 | 102 | profile brave_sandbox flags=(attach_disconnected) { 103 | # Base rules for brave-sandbox binary. 104 | include 105 | 106 | signal (receive) peer=@{BRAVE_LIBDIR}/brave, 107 | unix (receive, send) peer=(label=@{BRAVE_LIBDIR}/brave), 108 | 109 | @{BRAVE_LIBDIR}/brave-browser r, 110 | @{BRAVE_LIBDIR}/brave Px, 111 | @{BRAVE_LIBDIR}/brave-sandbox r, 112 | } 113 | 114 | # Site-specific additions and overrides. See local/README for details. 115 | # include 116 | } 117 | 118 | # kate: syntax AppArmor Security Profile; replace-tabs off; remove-trailing-spaces mod; 119 | # vim: syntax=apparmor 120 | -------------------------------------------------------------------------------- /apparmor.d/opt.vivaldi-stable: -------------------------------------------------------------------------------- 1 | # AppArmor profile for Vivaldi Web browser 2 | # --------------------------------------------- 3 | # Author: Nibaldo Gonzalez 4 | # Last change: March 24, 2020 5 | # This AppArmor profile is based on the Chromium profile 6 | # by Jamie Strandboge 7 | 8 | # NOTE: 9 | # - Important: Check & change the user download & desktop directory. 10 | # - By default, there is only write access to the download & desktop directory. 11 | # - This profile is only tested on Ubuntu 18.04 & 16.04, with KDE Plasma 5. 12 | 13 | # Requirements: 14 | # apparmor.d/tunables/confidential 15 | # apparmor.d/abstractions/chromium-base 16 | # apparmor.d/abstractions/chromium-base-xdgsettings 17 | # apparmor.d/abstractions/chromium-base-sandbox 18 | # apparmor.d/abstractions/kde-user 19 | # apparmor.d/abstractions/flatpak-snap 20 | # apparmor.d/abstractions/open-some-applications 21 | 22 | include 23 | include 24 | 25 | # Vivaldi directory: 26 | @{VIVALDI_LIBDIR} = /opt/vivaldi 27 | 28 | # User directories, with write access 29 | # (downloads and desktop directories): 30 | @{USER_DIR} = @{HOME}/Descargas 31 | @{USER_DIR} += @{HOME}/Escritorio 32 | 33 | profile vivaldi-stable /opt/vivaldi/vivaldi-bin flags=(attach_disconnected) { 34 | # Base rules for Web browsers based on Chromium. 35 | include 36 | include 37 | 38 | # Required to open downloaded files. 39 | include 40 | 41 | # This include specifies which ubuntu-browsers.d abstractions to use. Eg, if you 42 | # want access to productivity applications, adjust the following file accordingly. 43 | ## include 44 | 45 | # Block full access to sensitive data, as passwords and keys. 46 | # Includes /boot/**, /var/log/** & /etc/apparmor.d/** directories. View in: tunables/confidential. 47 | deny @{CONFIDENTIAL_EXCEPT_VIVALDI} rwklmx, 48 | 49 | owner /{dev,run}/shm/{,.}com.vivaldi.* mrw, 50 | 51 | # Access to Home, removable medias & other folders 52 | @{HOME}/{,*,[^.]**} r, 53 | /{data,media,mnt,srv,net}/** r, 54 | 55 | # User folders 56 | owner @{HOME}/ r, 57 | owner @{USER_DIR}/ r, 58 | owner @{USER_DIR}/** rw, 59 | 60 | # Vivaldi configuration. 61 | # For Vivaldi-snapshot, use the "vivaldi-snapshot" directory instead of "vivaldi". 62 | owner @{HOME}/.config/vivaldi/ rw, 63 | owner @{HOME}/.config/vivaldi/** rwk, 64 | owner @{HOME}/.config/vivaldi/{,**/}Dictionaries/*.bdic mr, 65 | owner @{HOME}/.config/vivaldi/**/Cache/* mr, 66 | owner @{HOME}/.cache/vivaldi/{,**} rw, 67 | owner @{HOME}/.cache/vivaldi/Default/Cache/* mr, 68 | owner @{HOME}/.local/share/.vivaldi_user_id{,.[a-zA-Z0-9]*} rw, 69 | owner @{HOME}/.local/share/.com.vivaldi.Vivaldi{,.[a-zA-Z0-9]*} rw, 70 | owner @{HOME}/.local/share/.vivaldi_reporting_data{,.[a-zA-Z0-9]*} rwk, 71 | owner @{HOME}/.local/lib/{,vivaldi/} rw, 72 | owner @{HOME}/.local/lib/vivaldi/libffmpeg.so{,.*} mr, 73 | 74 | deny /usr/local/share/fonts/** w, 75 | deny /usr/share/fonts/** w, 76 | deny /usr/share/texmf/fonts/** w, 77 | deny /usr/share/poppler/** w, 78 | 79 | # Access to Vivaldi directory 80 | deny @{VIVALDI_LIBDIR}/** w, # Noisy 81 | @{VIVALDI_LIBDIR}/** r, 82 | @{VIVALDI_LIBDIR}/*.pak mr, 83 | @{VIVALDI_LIBDIR}/locales/* mr, 84 | @{VIVALDI_LIBDIR}/xdg-settings Cxr -> xdgsettings, 85 | @{VIVALDI_LIBDIR}/lib/libffmpeg.so mr, 86 | @{VIVALDI_LIBDIR}/libwidevinecdm.so mr, 87 | 88 | /var/opt/vivaldi/** r, 89 | /var/opt/vivaldi/libwidevinecdm.so mr, 90 | /var/opt/vivaldi/media-codecs-*/libffmpeg.so mr, 91 | 92 | @{PROC}/sys/fs/inotify/max_user_watches r, 93 | @{PROC}/devices/virtual/dmi/id/sys_vendor r, 94 | /sys/devices/virtual/dmi/id/{sys_vendor,product_name} r, 95 | owner @{PROC}/[0-9]*/clear_refs rw, 96 | 97 | # Allow transitions to ourself and our sandbox 98 | @{VIVALDI_LIBDIR}/vivaldi-bin ix, 99 | @{VIVALDI_LIBDIR}/vivaldi-sandbox cx -> vivaldi_sandbox, 100 | 101 | # Allow communicating with sandbox 102 | unix (receive, send) peer=(label=@{VIVALDI_LIBDIR}/vivaldi-bin//vivaldi_sandbox), 103 | 104 | /usr/bin/xdg-desktop-menu ixr, 105 | 106 | #ptrace (read) peer=@{profile_name}//sanitized_helper, 107 | 108 | # Noisy 109 | audit deny @{HOME}/** x, 110 | audit deny owner /**/* x, 111 | 112 | profile xdgsettings flags=(attach_disconnected) { 113 | # Base rules for xdg-settings binary. 114 | include 115 | 116 | deny @{CONFIDENTIAL_EXCEPT_VIVALDI} rwklmx, 117 | 118 | @{VIVALDI_LIBDIR}/xdg-settings r, 119 | /dev/tty r, 120 | } 121 | 122 | profile vivaldi_sandbox flags=(attach_disconnected) { 123 | # Base rules for vivaldi-sandbox binary. 124 | include 125 | 126 | signal (receive) peer=@{VIVALDI_LIBDIR}/vivaldi-bin, 127 | unix (receive, send) peer=(label=@{VIVALDI_LIBDIR}/vivaldi-bin), 128 | 129 | @{VIVALDI_LIBDIR}/vivaldi r, # vivaldi{,-snapshot} 130 | @{VIVALDI_LIBDIR}/vivaldi-bin Px, 131 | @{VIVALDI_LIBDIR}/vivaldi-sandbox r, 132 | } 133 | 134 | # Site-specific additions and overrides. See local/README for details. 135 | include 136 | } 137 | 138 | # kate: syntax AppArmor Security Profile; replace-tabs off; remove-trailing-spaces mod; 139 | # vim: syntax=apparmor 140 | -------------------------------------------------------------------------------- /apparmor.d/tunables/confidential: -------------------------------------------------------------------------------- 1 | # kate: syntax AppArmor Security Profile 2 | # vim: syntax=apparmor 3 | 4 | # Last change: March 13, 2019 5 | 6 | # Files and directories with sensitive data, 7 | # such as keys, passwords, settings or others: 8 | 9 | @{SSHKEYS} = @{HOME}/.ssh/{,**} 10 | @{PGPKEYS} = @{HOME}/.gnupg/{,**} 11 | @{ANDROIDKEYS} = @{HOME}/.android-keys/{,**} 12 | @{KWALLET} = @{HOME}/.kde{,4}/share/apps/kwallet/{,**} @{HOME}/.local/share/kwalletd/{,**} 13 | 14 | @{MUTT} = @{HOME}/.mutt/** @{HOME}/.muttrc 15 | @{THUNDERBIRD} = @{HOME}/.thunderbird/{,**} @{HOME}/.cache/thunderbird/** 16 | @{THUNDERBIRD_SPECIFIC} = @{HOME}/.thunderbird/ @{HOME}/.thunderbird/profiles.ini @{HOME}/.thunderbird/*/{,**} @{HOME}/.cache/thunderbird/** 17 | @{MOZILLA} = @{HOME}/.mozilla/*/{,**} @{HOME}/.cache/mozilla/firefox/*/{,**} 18 | @{OPERA} = @{HOME}/.config/opera/{,**} @{HOME}/.cache/opera/** 19 | @{VIVALDI} = @{HOME}/.config/vivaldi/{,**} @{HOME}/.cache/vivaldi/** 20 | @{CHROME} = @{HOME}/.config/chromium/{,**} @{HOME}/.config/google-chrome/{,**} @{HOME}/.cache/{chromium,google-chrome}/** 21 | @{CHROME} += @{HOME}/.encrypted-volume/chromium/{,**} @{HOME}/.encrypted-volume/google-chrome/{,**} 22 | @{BRAVE} = @{HOME}/.config/BraveSoftware/{,**} @{HOME}/.cache/BraveSoftware/** 23 | @{TELEGRAM} = @{HOME}/.TelegramDesktop/{,**} @{HOME}/.var/app/org.telegram.desktop/{,**} 24 | 25 | @{USER_HISTORY} = @{HOME}/.local/share/recently-used.xbel @{HOME}/.kde/share/apps/RecentDocuments/** @{HOME}/.cache/thumbnails/** 26 | #@{FLATPAK} = @{HOME}/.var/app/** @{HOME}/.local/share/flatpak/{app,db,repo,runtime,system-cache}/** 27 | 28 | # System 29 | @{SYSTEM_SEC} = /boot/** /var/log/** 30 | @{SYSTEM_SEC} += @{HOME}/.config/autostart{,-scripts}/** /etc/xdg/autostart/** 31 | @{SYSTEM_SEC} += /etc/init.d/** /etc/cron.*/** /etc/initramfs-tools/** /etc/systemd/** /etc/xdg/systemd/** 32 | @{SYSTEM_SEC} += /etc/apparmor.d/** /etc/apparmor/** /var/lib/apparmor/** 33 | 34 | # The following variables allow blocking access to confidential data 35 | # or data from other applications. 36 | # For example, for Mozilla Firefox, use: 37 | # deny @{CONFIDENTIAL_EXCEPT_MOZILLA} rwklmx, 38 | # Also, you can use abstraction: 39 | # include 40 | 41 | @{CONFIDENTIAL} = @{SSHKEYS} @{PGPKEYS} @{KWALLET} @{ANDROIDKEYS} @{USER_HISTORY} @{SYSTEM_SEC} 42 | @{CONFIDENTIAL} += @{MUTT} @{THUNDERBIRD} @{MOZILLA} @{OPERA} @{CHROME} @{VIVALDI} @{BRAVE} @{TELEGRAM} 43 | 44 | @{CONFIDENTIAL_EXCEPT_SSHKEYS} = @{PGPKEYS} @{KWALLET} @{ANDROIDKEYS} @{USER_HISTORY} @{SYSTEM_SEC} 45 | @{CONFIDENTIAL_EXCEPT_SSHKEYS} += @{MUTT} @{THUNDERBIRD} @{MOZILLA} @{OPERA} @{CHROME} @{VIVALDI} @{BRAVE} @{TELEGRAM} 46 | 47 | @{CONFIDENTIAL_EXCEPT_PGPKEYS} = @{SSHKEYS} @{KWALLET} @{ANDROIDKEYS} @{USER_HISTORY} @{SYSTEM_SEC} 48 | @{CONFIDENTIAL_EXCEPT_PGPKEYS} += @{MUTT} @{THUNDERBIRD} @{MOZILLA} @{OPERA} @{CHROME} @{VIVALDI} @{BRAVE} @{TELEGRAM} 49 | 50 | @{CONFIDENTIAL_EXCEPT_KWALLET} = @{SSHKEYS} @{PGPKEYS} @{ANDROIDKEYS} @{USER_HISTORY} @{SYSTEM_SEC} 51 | @{CONFIDENTIAL_EXCEPT_KWALLET} += @{MUTT} @{THUNDERBIRD} @{MOZILLA} @{OPERA} @{CHROME} @{VIVALDI} @{BRAVE} @{TELEGRAM} 52 | 53 | @{CONFIDENTIAL_EXCEPT_MOZILLA} = @{SSHKEYS} @{PGPKEYS} @{KWALLET} @{ANDROIDKEYS} @{USER_HISTORY} @{SYSTEM_SEC} 54 | @{CONFIDENTIAL_EXCEPT_MOZILLA} += @{MUTT} @{THUNDERBIRD} @{OPERA} @{CHROME} @{VIVALDI} @{BRAVE} @{TELEGRAM} 55 | 56 | @{CONFIDENTIAL_EXCEPT_CHROME} = @{SSHKEYS} @{PGPKEYS} @{KWALLET} @{ANDROIDKEYS} @{USER_HISTORY} @{SYSTEM_SEC} 57 | @{CONFIDENTIAL_EXCEPT_CHROME} += @{MUTT} @{THUNDERBIRD} @{MOZILLA} @{OPERA} @{VIVALDI} @{BRAVE} @{TELEGRAM} 58 | 59 | @{CONFIDENTIAL_EXCEPT_OPERA} = @{SSHKEYS} @{PGPKEYS} @{KWALLET} @{ANDROIDKEYS} @{USER_HISTORY} @{SYSTEM_SEC} 60 | @{CONFIDENTIAL_EXCEPT_OPERA} += @{MUTT} @{THUNDERBIRD} @{MOZILLA} @{CHROME} @{VIVALDI} @{BRAVE} @{TELEGRAM} 61 | 62 | @{CONFIDENTIAL_EXCEPT_MUTT} = @{SSHKEYS} @{PGPKEYS} @{KWALLET} @{ANDROIDKEYS} @{USER_HISTORY} @{SYSTEM_SEC} 63 | @{CONFIDENTIAL_EXCEPT_MUTT} += @{THUNDERBIRD} @{OPERA} @{MOZILLA} @{CHROME} @{VIVALDI} @{BRAVE} @{TELEGRAM} 64 | 65 | @{CONFIDENTIAL_EXCEPT_THUNDERBIRD} = @{SSHKEYS} @{PGPKEYS} @{KWALLET} @{ANDROIDKEYS} @{USER_HISTORY} @{SYSTEM_SEC} 66 | @{CONFIDENTIAL_EXCEPT_THUNDERBIRD} += @{MUTT} @{MOZILLA} @{OPERA} @{CHROME} @{VIVALDI} @{BRAVE} @{TELEGRAM} 67 | 68 | @{CONFIDENTIAL_EXCEPT_TELEGRAM} = @{SSHKEYS} @{PGPKEYS} @{KWALLET} @{ANDROIDKEYS} @{USER_HISTORY} @{SYSTEM_SEC} 69 | @{CONFIDENTIAL_EXCEPT_TELEGRAM} += @{MUTT} @{THUNDERBIRD} @{MOZILLA} @{OPERA} @{CHROME} @{VIVALDI} @{BRAVE} 70 | 71 | @{CONFIDENTIAL_EXCEPT_VIVALDI} = @{SSHKEYS} @{PGPKEYS} @{KWALLET} @{ANDROIDKEYS} @{USER_HISTORY} @{SYSTEM_SEC} 72 | @{CONFIDENTIAL_EXCEPT_VIVALDI} += @{MUTT} @{THUNDERBIRD} @{MOZILLA} @{OPERA} @{CHROME} @{BRAVE} @{TELEGRAM} 73 | 74 | @{CONFIDENTIAL_EXCEPT_BRAVE} = @{SSHKEYS} @{PGPKEYS} @{KWALLET} @{ANDROIDKEYS} @{USER_HISTORY} @{SYSTEM_SEC} 75 | @{CONFIDENTIAL_EXCEPT_BRAVE} += @{MUTT} @{THUNDERBIRD} @{MOZILLA} @{OPERA} @{CHROME} @{VIVALDI} @{TELEGRAM} 76 | 77 | @{CONFIDENTIAL_VIEWER} = @{SSHKEYS} @{PGPKEYS} @{KWALLET} @{ANDROIDKEYS} @{SYSTEM_SEC} 78 | @{CONFIDENTIAL_VIEWER} += @{MUTT} @{THUNDERBIRD_SPECIFIC} @{MOZILLA} @{OPERA} @{CHROME} @{VIVALDI} @{BRAVE} @{TELEGRAM} 79 | -------------------------------------------------------------------------------- /apparmor.d/tunables/media-extensions: -------------------------------------------------------------------------------- 1 | # kate: syntax AppArmor Security Profile 2 | # vim: syntax=apparmor 3 | 4 | # Author: Nibaldo Gonzalez 5 | # Last change: February 12, 2018 6 | # ------------------------------------------------------ 7 | 8 | # Audio/video extensions supported by VLC. 9 | # Not included: iso, zip, rar 10 | 11 | # Usage: 12 | # /**.@{MEDIA_EXT} r, 13 | # /{data,home,media,mnt,srv,net}/**.@{MEDIA_EXT} rw, 14 | # owner /**.@{VIDEO_EXT} rw, 15 | 16 | # All VLC media extensions 17 | @{MEDIA_EXT} = @{AUDIO_EXT} @{VIDEO_EXT} @{OTHER_MEDIA_EXT} 18 | 19 | 20 | # Audio: 21 | 22 | # 3ga 23 | @{AUDIO_EXT} = 3[gG][aA] 24 | # 669 25 | @{AUDIO_EXT} += 669 26 | # a52, aac, ac3 27 | @{AUDIO_EXT} += [aA]{52,[aA][cC],[cC]3} 28 | # adt, adts 29 | @{AUDIO_EXT} += [aA][dD][tT]{,[sS]} 30 | # aif, aifc, aiff 31 | @{AUDIO_EXT} += [aA][iI][fF]{,[cCfF]} 32 | # au 33 | @{AUDIO_EXT} += [aA][uU] 34 | # amr 35 | @{AUDIO_EXT} += [aA][mM][rR] 36 | # aob 37 | @{AUDIO_EXT} += [aA][oO][bB] 38 | # ape 39 | @{AUDIO_EXT} += [aA][pP][eE] 40 | # caf 41 | @{AUDIO_EXT} += [cC][aA][fF] 42 | # cda 43 | @{AUDIO_EXT} += [cC][dD][aA] 44 | # dts 45 | @{AUDIO_EXT} += [dD][tT][sS] 46 | # flac 47 | @{AUDIO_EXT} += [fF][lL][aA][cC] 48 | # it 49 | @{AUDIO_EXT} += [iI][tT] 50 | # m4a, m4p 51 | @{AUDIO_EXT} += [mM]4[aApP] 52 | # mid, mod 53 | @{AUDIO_EXT} += [mM][iIoO][dD] 54 | # mka 55 | @{AUDIO_EXT} += [mM][kK][aA] 56 | # mlp 57 | @{AUDIO_EXT} += [mM][lL][pP] 58 | # mp1, mp2, mp3, mpc 59 | @{AUDIO_EXT} += [mM][pP][123cC] 60 | # mpga 61 | @{AUDIO_EXT} += [mM][pP][gG][aA] 62 | # oga, oma 63 | @{AUDIO_EXT} += [oO][gGmM][aA] 64 | # opus 65 | @{AUDIO_EXT} += [oO][pP][uU][sS] 66 | # qcp 67 | @{AUDIO_EXT} += [qQ][cC][pP] 68 | # ra 69 | @{AUDIO_EXT} += [rR][aA] 70 | # rmi 71 | @{AUDIO_EXT} += [rR][mM][iI] 72 | # snd 73 | @{AUDIO_EXT} += [sS][nN][dD] 74 | # s3m 75 | @{AUDIO_EXT} += [sS]3[mM] 76 | # spx 77 | @{AUDIO_EXT} += [sS][pP][xX] 78 | # tta 79 | @{AUDIO_EXT} += [tT][tT][aA] 80 | # voc, vqf 81 | @{AUDIO_EXT} += [vV]{[oO][cC],[qQ][fF]} 82 | # w64 83 | @{AUDIO_EXT} += [wW]64 84 | # wav, wv 85 | @{AUDIO_EXT} += [wW]{,[aA]}[vV] 86 | # wm, wma 87 | @{AUDIO_EXT} += [wW][mM]{,[aA]} 88 | # xa, xm 89 | @{AUDIO_EXT} += [xX][aAmM] 90 | 91 | 92 | # Video: 93 | 94 | # 3g2, 3gp, 3gp2, 3gpp 95 | @{VIDEO_EXT} = 3[gG]{[2pP],[pP][2pP]} 96 | # amv 97 | @{VIDEO_EXT} += [aA][mM][vV] 98 | # asf 99 | @{VIDEO_EXT} += [aA][sS][fF] 100 | # avi 101 | @{VIDEO_EXT} += [aA][vV][iI] 102 | # bik 103 | @{VIDEO_EXT} += [bB][iI][kK] 104 | # divx 105 | @{VIDEO_EXT} += [dD][iI][vV][xX] 106 | # drc 107 | @{VIDEO_EXT} += [dD][rR][cC] 108 | # dv, dvr-ms 109 | @{VIDEO_EXT} += [dD][vV]{,[rR]-[mM][sS]} 110 | # evo 111 | @{VIDEO_EXT} += [eE][vV][oO] 112 | # f4v, flv 113 | @{VIDEO_EXT} += [fF][4lL][vV] 114 | # gvi 115 | @{VIDEO_EXT} += [gG][vV][iI] 116 | # gxf 117 | @{VIDEO_EXT} += [gG][xX][fF] 118 | # m1v, m2v, m4v 119 | @{VIDEO_EXT} += [mM][124][vV] 120 | # m2t, m2ts 121 | @{VIDEO_EXT} += [mM]2[tT]{,[sS]} 122 | # mkv, mov 123 | @{VIDEO_EXT} += [mM][kKoO][vV] 124 | # mp2v, mp4v 125 | @{VIDEO_EXT} += [mM][pP][24][vV] 126 | # mp4, mpa, mpe, mpg 127 | @{VIDEO_EXT} += [mM][pP][4aAeEgG] 128 | # mpeg, mpeg1, mpeg2, mpeg4 129 | @{VIDEO_EXT} += [mM][pP][eE][gG]{,[124]} 130 | # mpv2 131 | @{VIDEO_EXT} += [mM][pP][vV]2 132 | # mts, mtv 133 | @{VIDEO_EXT} += [mM][tT][sSvV] 134 | # mxf 135 | @{VIDEO_EXT} += [mM][xX][fF] 136 | # nsv, nuv 137 | @{VIDEO_EXT} += [nN][sSuU][vV] 138 | # ogg, ogm, ogx, ogv 139 | @{VIDEO_EXT} += [oO][gG][gGmMxXvV] 140 | # rec 141 | @{VIDEO_EXT} += [rR][eE][cC] 142 | # rm, rmvb 143 | @{VIDEO_EXT} += [rR][mM]{,[vV][bB]} 144 | # rpl 145 | @{VIDEO_EXT} += [rR][pP][lL] 146 | # thp, tp 147 | @{VIDEO_EXT} += [tT]{,[hH]}[pP] 148 | # tod 149 | @{VIDEO_EXT} += [tT][oO][dD] 150 | # ts, tts 151 | @{VIDEO_EXT} += [tT]{,[tT]}[sS] 152 | # vob 153 | @{VIDEO_EXT} += [vV][oO][bB] 154 | # vro 155 | @{VIDEO_EXT} += [vV][rR] 156 | # webm 157 | @{VIDEO_EXT} += [wW][eE][bB][mM] 158 | # wmv, wtv 159 | @{VIDEO_EXT} += [wW][mMtT][vV] 160 | # xesc 161 | @{VIDEO_EXT} += [xX][eE][sS][cC] 162 | 163 | 164 | # Others: 165 | 166 | # asx 167 | @{OTHER_MEDIA_EXT} = [aA][sS][xX] 168 | # b4s 169 | @{OTHER_MEDIA_EXT} += [bB]4[sS] 170 | # cue 171 | @{OTHER_MEDIA_EXT} += [cC][uU][eE] 172 | # ifo 173 | @{OTHER_MEDIA_EXT} += [iI][fF][oO] 174 | # m3u, m3u8 175 | @{OTHER_MEDIA_EXT} += [mM]3[uU]{,8} 176 | # pls 177 | @{OTHER_MEDIA_EXT} += [pP][lL][sS] 178 | # ram 179 | @{OTHER_MEDIA_EXT} += [rR][aA][mM] 180 | # sdp 181 | @{OTHER_MEDIA_EXT} += [sS][dD][pP] 182 | # srt 183 | @{OTHER_MEDIA_EXT} += [sS][rR][tT] 184 | # vlc, vlt 185 | @{OTHER_MEDIA_EXT} += [vV][lL][cCtT] 186 | # wvx 187 | @{OTHER_MEDIA_EXT} += [wW][vV][xX] 188 | # xspf 189 | @{OTHER_MEDIA_EXT} += [xX][sS][pP][fF] 190 | # wsz 191 | @{OTHER_MEDIA_EXT} += [wW][sS][zZ] 192 | -------------------------------------------------------------------------------- /apparmor.d/usr.bin.chromium-browser: -------------------------------------------------------------------------------- 1 | # AppArmor profile for Chromium Web browser 2 | # -------------------------------------------- 3 | # This AppArmor profile is a modification of the original Chromium profile 4 | # created by Jamie Strandboge 5 | 6 | # Modifications: Nibaldo Gonzalez 7 | # Last change: March 19, 2018 8 | 9 | # NOTE: 10 | # - This profile is only tested on Ubuntu 16.04 & 18.04, with KDE Plasma 5. 11 | # - By default, full write access is granted to the owner of the 12 | # directories: /home, /media, /mnt, /srv, /net. 13 | # View in: /etc/apparmor.d/abstractions/ubuntu-browsers.d/user-files 14 | 15 | # Requirements: 16 | # apparmor.d/tunables/confidential 17 | # apparmor.d/abstractions/chromium-base 18 | # apparmor.d/abstractions/chromium-base-xdgsettings 19 | # apparmor.d/abstractions/chromium-base-sandbox 20 | # apparmor.d/abstractions/kde-user 21 | # apparmor.d/abstractions/flatpak-snap 22 | # apparmor.d/abstractions/open-messaging 23 | 24 | include 25 | include 26 | 27 | # Chromium directory: 28 | @{CHROM_LIBDIR} = /usr/lib{,64}/chromium-browser 29 | 30 | # User directories, with write access 31 | # (downloads and desktop directories): 32 | @{USER_DIR} = @{HOME}/Descargas 33 | @{USER_DIR} += @{HOME}/Escritorio 34 | 35 | profile chromium-browser /usr/lib{,64}/chromium-browser/chromium-browser flags=(attach_disconnected) { 36 | # Base rules for Web browsers based on Chromium. 37 | include 38 | 39 | # This include specifies which ubuntu-browsers.d abstractions to use. Eg, if 40 | # you want access to productivity applications, adjust the following file 41 | # accordingly. 42 | # include 43 | # include 44 | 45 | # Required to open downloaded files. 46 | include 47 | 48 | # Block full access to sensitive data, as passwords and keys. 49 | # Includes /boot/**, /var/log/** & /etc/apparmor.d/** directories. View in: tunables/confidential. 50 | deny @{CONFIDENTIAL_EXCEPT_CHROME} rwklmx, 51 | 52 | owner /{dev,run}/shm/{,.}org.chromium.* mrw, 53 | 54 | # User folders 55 | owner @{HOME}/ r, 56 | owner @{USER_DIR}/ r, 57 | owner @{USER_DIR}/** rw, 58 | 59 | # Chromium configuration 60 | owner @{HOME}/.config/chromium/ rw, 61 | owner @{HOME}/.config/chromium/** rwk, 62 | owner @{HOME}/.config/chromium/**/Cache/* mr, 63 | owner @{HOME}/.config/chromium/Dictionaries/*.bdic mr, 64 | owner @{HOME}/.config/chromium/**/Dictionaries/*.bdic mr, 65 | owner @{HOME}/.cache/chromium/{,**} rw, 66 | owner @{HOME}/.cache/chromium/Cache/* mr, 67 | owner @{HOME}/.local/share/.org.chromium.Chromium{,.[a-zA-Z0-9]*} rw, 68 | 69 | owner @{HOME}/.config/menus/ rw, 70 | owner @{HOME}/.config/menus/applications-merged/ rw, 71 | # owner @{HOME}/.config/menus/applications-merged/** rw, 72 | owner @{HOME}/.local/share/icons/ rw, 73 | owner @{HOME}/.local/share/icons/hicolor/ rw, 74 | # owner @{HOME}/.local/share/icons/hicolor/** rw, 75 | 76 | # Access to Chromium directory 77 | deny @{CHROM_LIBDIR}/** w, # Noisy 78 | @{CHROM_LIBDIR}/*.pak mr, 79 | @{CHROM_LIBDIR}/locales/* mr, 80 | @{CHROM_LIBDIR}/xdg-settings Cxr -> xdgsettings, 81 | 82 | # Allow transitions to ourself and our sandbox 83 | @{CHROM_LIBDIR}/chromium-browser ix, 84 | @{CHROM_LIBDIR}/chromium-browser-sandbox cx -> chromium_browser_sandbox, 85 | @{CHROM_LIBDIR}/chrome-sandbox cx -> chromium_browser_sandbox, 86 | 87 | # Allow communicating with sandbox 88 | unix (receive, send) peer=(label=@{CHROM_LIBDIR}/chromium-browser//chromium_browser_sandbox), 89 | 90 | # for CRX extensions 91 | owner /tmp/scoped_dir_*/ rw, 92 | owner /tmp/scoped_dir_*/.org.chromium.Chromium.* rw, 93 | owner /tmp/scoped_dir_*/CRX_INSTALL/ rw, 94 | owner /tmp/scoped_dir_*/CRX_INSTALL/** rw, 95 | owner /tmp/scoped_dir*/DECODED* rw, 96 | owner /tmp/scoped_dir_*/mccea*_[0-9]*.crx rw, 97 | 98 | # Binaries 99 | /usr/bin/xdg-desktop-menu ixr, 100 | /usr/bin/xdg-icon-resource ixr, 101 | 102 | /usr/bin/basename ixr, 103 | /usr/bin/cut ixr, 104 | /bin/mkdir ixr, 105 | /bin/readlink ixr, 106 | /bin/rm ixr, 107 | /bin/touch ixr, 108 | /bin/cp ixr, 109 | /bin/cat ixr, 110 | /bin/mktemp ixr, 111 | 112 | # Noisy 113 | audit deny @{HOME}/** x, 114 | audit deny owner /**/* x, 115 | 116 | profile xdgsettings flags=(attach_disconnected) { 117 | # Base rules for xdg-settings binary. 118 | include 119 | 120 | deny @{CONFIDENTIAL_EXCEPT_CHROME} rwklmx, 121 | 122 | @{CHROM_LIBDIR}/xdg-settings r, 123 | 124 | /dev/tty r, 125 | owner @{HOME}/.local/share/RecentDocuments/*.desktop wl, 126 | owner @{HOME}/.local/share/RecentDocuments/{,*.desktop}.[a-zA-Z0-9]* wk, 127 | } 128 | 129 | profile chromium_browser_sandbox flags=(attach_disconnected) { 130 | # Base rules for chromium-browser-sandbox binary. 131 | include 132 | 133 | signal (receive) peer=@{CHROM_LIBDIR}/chromium-browser, 134 | unix (receive, send) peer=(label=@{CHROM_LIBDIR}/chromium-browser), 135 | 136 | /usr/bin/chromium-browser r, 137 | @{CHROM_LIBDIR}/chromium-browser Px, 138 | @{CHROM_LIBDIR}/chromium-browser-sandbox r, 139 | @{CHROM_LIBDIR}/chrome-sandbox r, 140 | } 141 | 142 | # Site-specific additions and overrides. See local/README for details. 143 | include 144 | } 145 | 146 | # kate: syntax AppArmor Security Profile; replace-tabs off; remove-trailing-spaces mod; 147 | # vim: syntax=apparmor 148 | -------------------------------------------------------------------------------- /apparmor.d/usr.bin.firefox: -------------------------------------------------------------------------------- 1 | # Author: Jamie Strandboge 2 | # Modifications: Nibaldo Gonzalez 3 | # Last change: Oct 23, 2019 4 | 5 | # Declare an apparmor variable to help with overrides 6 | @{MOZ_LIBDIR}=/usr/lib/firefox 7 | 8 | # NOTE: By default, full write access is granted to the owner of the 9 | # directories: /home, /media, /mnt, /srv, /net. 10 | # See in: /etc/apparmor.d/abstractions/ubuntu-browsers.d/user-files 11 | 12 | # User directories, with write access 13 | # (downloads and desktop directories): 14 | @{USER_DIR} = @{HOME}/Descargas 15 | @{USER_DIR} += @{HOME}/Escritorio 16 | 17 | #include 18 | #include 19 | 20 | # We want to confine the binaries that match: 21 | # /usr/lib/firefox/firefox 22 | # /usr/lib/firefox/firefox 23 | # but not: 24 | # /usr/lib/firefox/firefox.sh 25 | /usr/lib/firefox/firefox{,*[^s][^h]} { 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | #include 40 | #include 41 | 42 | #include 43 | dbus (send) 44 | bus=session 45 | peer=(name=org.a11y.Bus), 46 | dbus (receive) 47 | bus=session 48 | interface=org.a11y.atspi**, 49 | dbus (receive, send) 50 | bus=accessibility, 51 | 52 | # Block full access to sensitive data, as passwords and keys. 53 | # Includes /boot/**, /var/log/** & /etc/apparmor.d/** directories. See in: tunables/confidential. 54 | deny @{CONFIDENTIAL_EXCEPT_MOZILLA} rwklmx, 55 | 56 | # Plasma browser integration support (temporary solution) 57 | /usr/bin/plasma-browser-integration-host Cxr -> sanitized_helper, 58 | unix (send, receive) type=(seqpacket) peer=(label=@{profile_name}//sanitized_helper, addr=none), 59 | unix (send, receive) type=(stream) peer=(label=@{profile_name}//sanitized_helper, addr=none), 60 | 61 | ptrace (trace) peer=@{profile_name}, 62 | capability sys_admin, 63 | capability sys_chroot, 64 | capability sys_ptrace, 65 | network netlink raw, 66 | unix (send, receive) type=(stream), 67 | unix (send, receive) type=(seqpacket), 68 | unix (send, receive) type=(raw), 69 | /run/mount/utab r, 70 | owner @{PROC}/[0-9]*/{uid_map,gid_map,setgroups} rw, 71 | 72 | dbus (send) 73 | bus=system 74 | interface=org.freedesktop.DBus.Properties 75 | path=/org/freedesktop/hostname[0-9]* 76 | member=GetAll, 77 | 78 | # for networking 79 | network inet stream, 80 | network inet6 stream, 81 | @{PROC}/[0-9]*/net/arp r, 82 | @{PROC}/[0-9]*/net/if_inet6 r, 83 | @{PROC}/[0-9]*/net/ipv6_route r, 84 | @{PROC}/[0-9]*/net/dev r, 85 | @{PROC}/[0-9]*/net/wireless r, 86 | dbus (send) 87 | bus=system 88 | path=/org/freedesktop/NetworkManager 89 | member=state, 90 | dbus (receive) 91 | bus=system 92 | path=/org/freedesktop/NetworkManager, 93 | 94 | # should maybe be in abstractions 95 | /etc/ r, 96 | /etc/mime.types r, 97 | /etc/mailcap r, 98 | /etc/xdg/*buntu/applications/defaults.list r, # for all derivatives 99 | /etc/xfce4/defaults.list r, 100 | /usr/share/xubuntu/applications/defaults.list r, 101 | owner @{HOME}/.local/share/applications/defaults.list r, 102 | owner @{HOME}/.local/share/applications/mimeapps.list r, 103 | owner @{HOME}/.local/share/applications/mimeinfo.cache r, 104 | /var/lib/snapd/desktop/applications/mimeinfo.cache r, 105 | /var/lib/snapd/desktop/applications/*.desktop r, 106 | owner /tmp/** m, 107 | owner /var/tmp/** m, 108 | owner /{,var/}run/shm/shmfd-* rw, 109 | owner /{dev,run}/shm/org.{chromium,mozilla}.* rwk, 110 | /tmp/.X[0-9]*-lock r, 111 | /etc/udev/udev.conf r, 112 | # Doesn't seem to be required, but noisy. Maybe allow 'r' for 'b*' if needed. 113 | # Possibly move to an abstraction if anything else needs it. 114 | deny /run/udev/data/** r, 115 | # let the shell know we launched something 116 | dbus (send) 117 | bus=session 118 | interface=org.gtk.gio.DesktopAppInfo 119 | member=Launched, 120 | 121 | /etc/timezone r, 122 | /etc/wildmidi/wildmidi.cfg r, 123 | 124 | # firefox specific 125 | /etc/firefox*/ r, 126 | /etc/firefox*/** r, 127 | /etc/xul-ext/** r, 128 | /etc/xulrunner-2.0*/ r, 129 | /etc/xulrunner-2.0*/** r, 130 | /etc/gre.d/ r, 131 | /etc/gre.d/* r, 132 | 133 | # noisy 134 | deny @{MOZ_LIBDIR}/** w, 135 | deny /usr/lib/firefox-addons/** w, 136 | deny /usr/lib/xulrunner-addons/** w, 137 | deny /usr/lib/xulrunner-*/components/*.tmp w, 138 | deny /.suspended r, 139 | deny /boot/initrd.img* r, 140 | deny /boot/vmlinuz* r, 141 | deny /var/cache/fontconfig/ w, 142 | deny @{HOME}/.local/share/recently-used.xbel r, 143 | 144 | # TODO: investigate 145 | deny /usr/bin/gconftool-2 x, 146 | 147 | # These are needed when a new user starts firefox and firefox.sh is used 148 | @{MOZ_LIBDIR}/** ixr, 149 | /usr/bin/basename ixr, 150 | /usr/bin/dirname ixr, 151 | /usr/bin/pwd ixr, 152 | /sbin/killall5 ixr, 153 | /bin/which ixr, 154 | /usr/bin/tr ixr, 155 | @{PROC}/ r, 156 | @{PROC}/[0-9]*/cmdline r, 157 | @{PROC}/[0-9]*/mountinfo r, 158 | @{PROC}/[0-9]*/stat r, 159 | owner @{PROC}/[0-9]*/task/[0-9]*/stat r, 160 | @{PROC}/[0-9]*/status r, 161 | @{PROC}/filesystems r, 162 | @{PROC}/sys/vm/overcommit_memory r, 163 | /sys/devices/pci[0-9]*/**/uevent r, 164 | /sys/devices/platform/**/uevent r, 165 | /sys/devices/pci*/**/{busnum,idVendor,idProduct} r, 166 | /sys/devices/pci*/**/{,subsystem_}device r, 167 | /sys/devices/pci*/**/{,subsystem_}vendor r, 168 | /sys/devices/system/node/node[0-9]*/meminfo r, 169 | # /sys/devices/pci[0-9]*/**/{config,revision} r, 170 | owner @{HOME}/.cache/thumbnails/** w, 171 | 172 | 173 | /etc/mtab r, 174 | /etc/fstab r, 175 | 176 | # Needed for the crash reporter 177 | owner @{PROC}/[0-9]*/environ r, 178 | owner @{PROC}/[0-9]*/auxv r, 179 | /etc/lsb-release r, 180 | /usr/bin/expr ix, 181 | /sys/devices/system/cpu/ r, 182 | /sys/devices/system/cpu/** r, 183 | 184 | # about:memory 185 | owner @{PROC}/[0-9]*/statm r, 186 | owner @{PROC}/[0-9]*/smaps r, 187 | 188 | # Needed for container to work in xul builds 189 | /usr/lib/xulrunner-*/plugin-container ixr, 190 | 191 | # allow access to documentation and other files the user may want to look 192 | # at in /usr and /opt 193 | /usr/ r, 194 | /usr/** r, 195 | /opt/ r, 196 | /opt/** r, 197 | 198 | # so browsing directories works 199 | / r, 200 | /**/ r, 201 | 202 | # Downloads and Desktop folders 203 | owner @{HOME}/ r, 204 | owner @{USER_DIR}/ r, 205 | owner @{USER_DIR}/** rw, 206 | 207 | owner @{HOME}/{*,[^.]*/**}.{[jJ][sS][oO][nN],[hH][tT][mM][lL]} rw, # To backup bookmarks 208 | owner @{HOME}/dwhelper/{,**} rw, 209 | owner @{HOME}/mozilla.pdf rw, 210 | 211 | # Noisy 212 | audit deny /{data,media,mnt,srv,net}/** mx, 213 | audit deny /{,var/}tmp/** mx, 214 | audit deny @{HOME}/{*,[^.]**} mx, 215 | audit deny @{HOME}/.[^amf]*/** m, 216 | audit deny @{HOME}/.[^a]*/** x, 217 | # audit deny @{HOME}/** x, 218 | # audit deny owner /**/* x, 219 | 220 | owner @{HOME}/.app/net.downloadhelper.coapp-*/** r, 221 | owner @{HOME}/.app/net.downloadhelper.coapp-*/bin/{net.downloadhelper.coapp-linux-*,xdg-open} ix, 222 | owner @{HOME}/.app/net.downloadhelper.coapp-*/converter/build/linux/[0-9]*/ff{mpeg,play,probe} ix, 223 | owner @{HOME}/.app/net.downloadhelper.coapp-*/converter/build/linux/[0-9]*/*.so{,.*} m, 224 | deny @{PROC}/version r, 225 | 226 | deny @{HOME}/.local/share/{applications,flatpak}/** w, 227 | audit deny @{HOME}/.* w, 228 | audit deny @{HOME}/.bash_history r, 229 | 230 | # Nosy: included in abstraction/base 231 | /etc/ld.so.conf r, 232 | /etc/ld.so.conf.d/*.conf r, 233 | # Noisy: included in abstraction/gnome -> abstraction/fonts 234 | owner @{HOME}/.cache/fontconfig/*.cache-* rw, 235 | 236 | owner @{HOME}/.cache/mesa_shader_cache/** rw, 237 | # owner @{HOME}/.cache/mesa_shader_cache/**.tmp k, 238 | 239 | # per-user firefox configuration 240 | owner @{HOME}/.{firefox,mozilla}/ rw, 241 | owner @{HOME}/.{firefox,mozilla}/** rw, 242 | owner @{HOME}/.{firefox,mozilla}/**/*.{mdb,db,parentlock,sqlite}* k, 243 | owner @{HOME}/.{firefox,mozilla}/plugins/** rm, 244 | owner @{HOME}/.{firefox,mozilla}/**/plugins/** rm, 245 | owner @{HOME}/.gnome2/firefox* rwk, 246 | owner @{HOME}/.cache/mozilla/{,firefox/} rw, 247 | owner @{HOME}/.cache/mozilla/firefox/** rw, 248 | owner @{HOME}/.cache/mozilla/firefox/**/*.sqlite k, 249 | owner @{HOME}/.config/gtk-3.0/bookmarks r, 250 | owner @{HOME}/.config/dconf/user w, 251 | # To set the browser as the default 252 | owner /{,var/}run/user/*/dconf/user w, 253 | owner @{HOME}/.config/mimeapps.list{,.[a-zA-Z0-9]*} rwk, 254 | owner @{HOME}/.local/share/mime/packages/*-extension-{,?}html.xml{,.[a-zA-Z0-9]*} rwk, 255 | dbus (send) 256 | bus=session 257 | path=/org/gnome/GConf/Server 258 | member=GetDefaultDatabase 259 | peer=(label=unconfined), 260 | dbus (send) 261 | bus=session 262 | path=/org/gnome/GConf/Database/* 263 | member={AddMatch,AddNotify,AllEntries,LookupExtended,RemoveNotify} 264 | peer=(label=unconfined), 265 | dbus (send) 266 | bus=session 267 | path=/org/gtk/vfs/mounttracker 268 | interface=org.gtk.vfs.MountTracker 269 | member=ListMountableInfo 270 | peer=(label=unconfined), 271 | 272 | # gnome-session 273 | dbus (send) 274 | bus=session 275 | path=/org/gnome/SessionManager 276 | interface=org.gnome.SessionManager 277 | member={Inhibit,Uninhibit} 278 | peer=(label=unconfined), 279 | 280 | # unity screen API 281 | dbus (send) 282 | bus=system 283 | interface="org.freedesktop.DBus.Introspectable" 284 | path="/com/canonical/Unity/Screen" 285 | member="Introspect" 286 | peer=(label=unconfined), 287 | dbus (send) 288 | bus=system 289 | interface="com.canonical.Unity.Screen" 290 | path="/com/canonical/Unity/Screen" 291 | member={keepDisplayOn,removeDisplayOnRequest} 292 | peer=(label=unconfined), 293 | 294 | # freedesktop.org ScreenSaver 295 | dbus (send) 296 | bus=session 297 | path=/{,org/freedesktop/,org.gnome/}Screen{s,S}aver 298 | interface=org.freedesktop.ScreenSaver 299 | member={Inhibit,UnInhibit,SimulateUserActivity} 300 | peer=(label=unconfined), 301 | 302 | # gnome, kde and cinnamon screensaver 303 | dbus (send) 304 | bus=session 305 | path=/{,ScreenSaver} 306 | interface=org.{gnome.ScreenSaver,kde.screensaver,cinnamon.ScreenSaver} 307 | member=SimulateUserActivity 308 | peer=(label=unconfined), 309 | 310 | # UPower 311 | dbus (send) 312 | bus=system 313 | path=/org/freedesktop/UPower 314 | interface=org.freedesktop.UPower 315 | member=EnumerateDevices 316 | peer=(label=unconfined), 317 | 318 | # 319 | # Extensions 320 | # /usr/share/.../extensions/... is already covered by '/usr/** r', above. 321 | # Allow 'x' for downloaded extensions, but inherit policy for safety 322 | owner @{HOME}/.mozilla/**/extensions/** mixr, 323 | 324 | deny @{MOZ_LIBDIR}/update.test w, 325 | deny /usr/lib/mozilla/extensions/**/ w, 326 | deny /usr/lib/xulrunner-addons/extensions/**/ w, 327 | deny /usr/share/mozilla/extensions/**/ w, 328 | deny /usr/share/mozilla/ w, 329 | 330 | # Miscellaneous (to be abstracted) 331 | # Ideally these would use a child profile. They are all ELF executables 332 | # so running with 'Ux', while not ideal, is ok because we will at least 333 | # benefit from glibc's secure execute. 334 | /usr/bin/mkfifo Uxr, # investigate 335 | /bin/ps Uxr, 336 | /bin/uname Uxr, 337 | 338 | /usr/bin/lsb_release Cxr -> lsb_release, 339 | profile lsb_release { 340 | #include 341 | #include 342 | /usr/bin/lsb_release r, 343 | /bin/dash ixr, 344 | /usr/bin/dpkg-query ixr, 345 | /usr/include/python2.[4567]/pyconfig.h r, 346 | /etc/lsb-release r, 347 | /etc/debian_version r, 348 | /usr/share/distro-info/*.csv r, 349 | /var/lib/dpkg/** r, 350 | 351 | /usr/local/lib/python3.[0-6]/dist-packages/ r, 352 | /usr/bin/ r, 353 | /usr/bin/python3.[0-6] mr, 354 | 355 | # file_inherit 356 | deny /tmp/gtalkplugin.log w, 357 | } 358 | 359 | # Addons 360 | #include 361 | 362 | # Site-specific additions and overrides. See local/README for details. 363 | #include 364 | } 365 | 366 | # kate: syntax AppArmor Security Profile; replace-tabs on; tab-width 2; indent-width 2; remove-trailing-spaces mod; 367 | # vim: syntax=apparmor 368 | -------------------------------------------------------------------------------- /apparmor.d/usr.bin.gwenview: -------------------------------------------------------------------------------- 1 | # AppArmor profile for Gwenview 2 | # --------------------------------------------- 3 | # Author: Nibaldo Gonzalez 4 | # Last change: March 12, 2019 5 | 6 | # Requirements: 7 | # apparmor.d/tunables/confidential 8 | # apparmor.d/abstractions/kde-user 9 | # apparmor.d/abstractions/flatpak-snap 10 | # apparmor.d/abstractions/general-security 11 | # apparmor.d/abstractions/block-networking 12 | # apparmor.d/abstractions/open-browser 13 | # apparmor.d/abstractions/open-email 14 | 15 | include 16 | include 17 | 18 | # Some files supported: 19 | # bmp 20 | @{IMG_EXT} = [bB][mM][pP] 21 | # jp2 22 | @{IMG_EXT} += [jJ][pP]2 23 | # jpg, jpeg 24 | @{IMG_EXT} += [jJ][pP]{,[eE]}[gG] 25 | # tif, tiff 26 | @{IMG_EXT} += [tT][iI][fF]{,[fF]} 27 | # ico, icb 28 | @{IMG_EXT} += [iI][cC][oObB] 29 | # wbmp 30 | @{IMG_EXT} += [wW][bB][mM][pP] 31 | # webps 32 | @{IMG_EXT} += [wW][eE][bB][pP] 33 | # dds 34 | @{IMG_EXT} += [dD][dD][sS] 35 | # eps 36 | @{IMG_EXT} += [eE][pP][sS] 37 | # icns 38 | @{IMG_EXT} += [iI][cC][nN][sS] 39 | # pcx 40 | @{IMG_EXT} += [pP][cC][xX] 41 | # png 42 | @{IMG_EXT} += [pP][nN][gG] 43 | # pbm, pgm, ppm 44 | @{IMG_EXT} += [pP][bBgGpP][mM] 45 | # rgb 46 | @{IMG_EXT} += [rR][gG][bB] 47 | # xbp, xpm 48 | @{IMG_EXT} += [xX][bBpP][mM] 49 | 50 | @{TMP_FILE} = \#[0-9]{[0-9],}{[0-9],}{[0-9],}{[0-9],}{[0-9],}{[0-9],}{[0-9],} 51 | 52 | profile gwenview /usr/bin/gwenview { 53 | include 54 | include 55 | include 56 | include 57 | include 58 | include 59 | include 60 | include 61 | include 62 | include 63 | 64 | include 65 | include 66 | 67 | # Blocks binaries, precompiled libraries, etc. 68 | include 69 | 70 | # Block network connection 71 | include 72 | 73 | # Needed to open links (only for some Web browsers/e-mail clients). 74 | include 75 | include 76 | 77 | # Block full access to sensitive data, as passwords and keys. 78 | # Includes /boot/**, /var/log/** & /etc/apparmor.d/** directories. View in: tunables/confidential. 79 | deny @{CONFIDENTIAL_VIEWER} rwklmx, 80 | 81 | # Full reading access 82 | /{,**/,**} r, 83 | 84 | # Write access in Home directory and mounted drives 85 | owner @{HOME}/** rw, 86 | owner /{data,media,mnt,srv,net}/** rw, 87 | 88 | owner /**/@{TMP_FILE} rwk, 89 | link subset /{home,data,media,mnt,srv,net}/**.[a-zA-Z0-9]* -> "/{home,data,media,mnt,srv,net}/{,**/}@{TMP_FILE}", 90 | 91 | owner /**/*.@{IMG_EXT} rw, 92 | owner /**/*.@{IMG_EXT}.[a-zA-Z0-9]* rwk, 93 | link /**/*.@{IMG_EXT}.[a-zA-Z0-9]* -> "/**/@{TMP_FILE}", 94 | 95 | deny owner @{HOME}/@{TMP_FILE} m, 96 | deny owner /tmp/@{TMP_FILE} m, 97 | deny owner /**/@{TMP_FILE} m, 98 | 99 | # Gwenview configuration 100 | owner @{HOME}/.local/share/{,org.kde.}gwenview/** rwk, 101 | owner @{HOME}/.config/{,org.kde.}gwenviewrc rw, 102 | owner @{HOME}/.config/{,org.kde.}gwenviewrc.[a-zA-Z0-9]* rwk, 103 | owner @{HOME}/.config/session/ rw, 104 | owner @{HOME}/.config/session/.* rwk, 105 | owner @{HOME}/.config/session/{,org.kde.}gwenview* rwk, 106 | owner @{HOME}/.cache/thumbnails/** rw, 107 | owner @{HOME}/.cache/thumbnails/*/*.[a-zA-Z0-9]* rwk, 108 | owner @{HOME}/.cache/mesa_shader_cache/**.tmp rwk, 109 | 110 | include 111 | owner @{HOME}/.local/share/baloo/index-lock rwk, 112 | owner @{HOME}/.config/session/@{TMP_FILE} rwk, 113 | owner @{HOME}/.cache/thumbnails/*/@{TMP_FILE} rwk, 114 | 115 | link @{HOME}/.config/{,org.kde.}gwenviewrc.[a-zA-Z0-9]* -> "/home/*/.config/@{TMP_FILE}", 116 | link @{HOME}/.local/share/{,org.kde.}gwenview/** -> "/home/*/.local/share/{,org.kde.}gwenview/{,**/}@{TMP_FILE}", 117 | link @{HOME}/.config/session/{,org.kde.}gwenview* -> "/home/*/.config/session/@{TMP_FILE}", 118 | link @{HOME}/.cache/thumbnails/*/*.[a-zA-Z0-9]* -> "/home/*/.cache/thumbnails/*/*", 119 | 120 | allow owner @{HOME}/.local/share/flatpak/exports/share/icons/** rw, 121 | 122 | # Libraries and binaries 123 | /usr/bin/gwenview ixr, 124 | /usr/bin/dolphin PUx, 125 | /usr/bin/plasma-discover PUx, 126 | /usr/bin/khelpcenter Cxr -> sanitized_helper, 127 | 128 | /usr/bin/digikam PUx, 129 | /usr/bin/gimp PUx, 130 | /usr/bin/gimp-2.8 PUx, 131 | /usr/bin/inkscape PUx, 132 | /usr/bin/krita PUx, 133 | /usr/bin/skanlite PUx, 134 | /usr/bin/darktable PUx, 135 | /usr/bin/mirage PUx, 136 | /usr/bin/kate PUx, 137 | /usr/bin/* Pixr, 138 | 139 | /usr/lib/gamin/gam_server Pixr, 140 | /usr/lib{,64,/@{multiarch}}/qt5/** r, 141 | /usr/lib{,64,/@{multiarch}}/qt5/plugins/{,**/}*.so m, 142 | /usr/lib{,64,/@{multiarch}}/qt5/{bin,libexec}/** ix, 143 | deny /usr/lib{,64,/@{multiarch}}/vlc/plugins/plugins.dat{,.*} w, 144 | 145 | # Temporal files 146 | owner /tmp/** rwkl, 147 | owner /var/tmp/kdecache-*/* rwkl, 148 | owner /run/user/[0-9]*/ksocket-*/** rwk, 149 | owner /run/user/[0-9]*/bus rwk, 150 | owner /run/user/[0-9]*/*-socket rwk, 151 | owner /run/user/[0-9]*/kdeinit5* rwk, 152 | owner /run/user/[0-9]*/@{TMP_FILE} rwk, 153 | link /run/user/[0-9]*/* -> "/run/user/[0-9]*/@{TMP_FILE}", 154 | 155 | signal (send) set=(term) peer=unconfined, 156 | unix (send receive connect) type=stream addr=none peer=(label=unconfined), 157 | } 158 | 159 | # kate: syntax AppArmor Security Profile; replace-tabs off; remove-trailing-spaces mod; 160 | # vim: syntax=apparmor 161 | -------------------------------------------------------------------------------- /apparmor.d/usr.bin.ktorrent: -------------------------------------------------------------------------------- 1 | # Author: Nibaldo Gonzalez 2 | # Last change: February 27, 2018 3 | 4 | # NOTE: 5 | # - This profile is made for KTorrent 5. It does not work 6 | # in older versions (with QT 4). 7 | # - This profile is more restrictive than the one provided 8 | # in . 9 | # - This profile is only tested on Ubuntu 16.04 & KDE Plasma 5. 10 | 11 | include 12 | include 13 | 14 | # IMPORTANT: Modify according to KTorrent configuration: 15 | # Download directory 16 | @{DOWNLOAD_DIR} = @{HOME}/Descargas/Torrents 17 | # Torrents information directory 18 | @{TORRENT_INF_DIR} = @{HOME}/.local/share/ktorrent 19 | 20 | /usr/bin/ktorrent { 21 | include 22 | include 23 | include 24 | include 25 | include 26 | include 27 | include 28 | include 29 | include 30 | 31 | include 32 | include 33 | include 34 | include 35 | 36 | # Blocks binaries, precompiled libraries, etc. 37 | include 38 | 39 | # Block full access to sensitive data, as passwords and keys. 40 | # Includes /boot/**, /var/log/** & /etc/apparmor.d/** directories. View in: tunables/confidential. 41 | include 42 | 43 | # Needed to open links (only for some Web browsers/e-mail clients). 44 | include 45 | include 46 | 47 | # Required to open downloaded files. 48 | include 49 | 50 | # Access to Home 51 | owner @{DOWNLOAD_DIR}/{,**} rw, # Just read/write in the download directory 52 | owner @{HOME}/**.[tT][oO][rR][rR][eE][nN][tT] r, # Only read .torrent files 53 | owner @{HOME}/{,**/} r, # Only read directories 54 | deny @{HOME}/**/.directory r, 55 | 56 | # KTorrent configuration 57 | owner @{TORRENT_INF_DIR}/{,**} rwk, 58 | owner @{HOME}/.cache/ktorrent/{,**} rwk, 59 | owner @{HOME}/.config/ktorrent* rwk, 60 | owner @{HOME}/.kde/share/apps/ktorrent/{,**} rwk, 61 | owner @{HOME}/.local/share/kxmlgui5/ktorrent/{,**} rw, 62 | owner @{HOME}/.local/share/kxmlgui5/ rw, 63 | 64 | owner @{HOME}/.config/session/ktorrent_* rwk, 65 | owner @{HOME}/.config/session/.[a-zA-Z0-9]* rwk, 66 | owner @{HOME}/.config/session/\#[0-9]* rwk, 67 | link @{HOME}/.config/session/ktorrent_* -> "/home/*/.config/session/#[0-9]*", 68 | 69 | # Local configuration 70 | include 71 | owner @{HOME}/.config/kde.org/libphonon.conf r, 72 | 73 | deny /{media,mnt,srv,net}/** rwklmx, # Block access to mounted drives & other directories 74 | 75 | # Binaries 76 | /usr/bin/ktorrent r, 77 | /usr/bin/kdialog ixr, 78 | /usr/bin/kdeinit5 ixr, 79 | /usr/bin/kde-open{,5} ixr, 80 | /usr/bin/{gnome,gvfs,xdg}-open ixr, 81 | /usr/bin/khelpcenter Cxr -> sanitized_helper, 82 | /usr/bin/pulseaudio Pixr, 83 | 84 | # Libraries 85 | /usr/lib{,64}/ r, 86 | /usr/lib{,64}/libktorrent.so.* mr, 87 | /usr/lib{64,/@{multiarch}}/qt5/plugins/{,**/} r, 88 | /usr/lib{64,/@{multiarch}}/qt5/plugins/**.so mr, 89 | deny /usr/lib{,64,/@{multiarch}}/vlc/plugins/plugins.dat* w, 90 | 91 | /usr/share/alsa/{,*.conf} r, 92 | /usr/share/color-schemes/{,**} r, 93 | /usr/share/GeoIP/{,*} r, 94 | /usr/share/icons/{,**} r, 95 | /usr/share/knotifications5/{,*} r, 96 | /usr/share/kservices5/{,**/,**.protocol} r, 97 | /usr/share/kxmlgui5/ktorrent/{,**} r, 98 | /usr/share/plasma/{,**} r, 99 | /usr/share/qt5/{,**} r, 100 | /usr/share/sounds/{,**} r, 101 | /usr/share/mime/ r, 102 | /usr/share/templates/ r, 103 | 104 | /etc/xdg/{,**} r, 105 | /etc/xdg/Trolltech.conf k, 106 | /etc/pulse/client.conf r, 107 | /etc/machine-id r, 108 | /etc/timezone r, 109 | /etc/udev/udev.conf r, 110 | deny /etc/fstab r, 111 | 112 | /dev/**/ r, 113 | /dev/tty r, 114 | /dev/snd/controlC[0-9]* r, 115 | owner /{dev,run,var/run}/shm/pulse-shm-* rwk, 116 | 117 | /sys/**/ r, 118 | /sys/devices/**/uevent r, 119 | /sys/devices/pci[0-9]*/**/{config,revision} r, 120 | /sys/devices/pci[0-9]*/**/{,subsystem_}{device,vendor} r, 121 | @{PROC}/sys/kernel/core_pattern r, 122 | owner @{PROC}/@{pid}/mounts r, 123 | 124 | # Temp files 125 | owner /run/user/[0-9]*/kioclient*.slave-socket rwk, 126 | owner /run/user/[0-9]*/ktorrent*.slave-socket rwk, 127 | owner /run/user/[0-9]*/pulse/native rwk, 128 | owner /run/user/[0-9]*/\#[0-9]* rwk, 129 | link /run/user/[0-9]*/{ktorrent,kioclient}*.slave-socket -> "/run/user/[0-9]*/#[0-9]*", 130 | 131 | signal (send) set=(term) peer=unconfined, 132 | unix (send, receive) type=(stream) peer=(label=@{profile_name}//sanitized_helper addr=none), 133 | } 134 | 135 | # kate: syntax AppArmor Security Profile 136 | # vim: syntax=apparmor 137 | -------------------------------------------------------------------------------- /apparmor.d/usr.bin.mpv: -------------------------------------------------------------------------------- 1 | # AppArmor profile for mpv media player 2 | # --------------------------------------------- 3 | # Author: Nibaldo Gonzalez 4 | # Last change: October 29, 2020 5 | 6 | # NOTE: By default, the internet connection is blocked. 7 | # To allow video streaming, uncomment the include rule: 8 | # and remove: 9 | 10 | # Requirements: 11 | # apparmor.d/tunables/confidential 12 | # apparmor.d/tunables/media-extensions 13 | # apparmor.d/abstractions/confidential-deny 14 | # apparmor.d/abstractions/block-networking 15 | 16 | include 17 | include 18 | include 19 | 20 | # Directories where videos and data are stored 21 | @{DATA_DIR} = /{data,home,media,mnt,srv,net,cdrom} 22 | 23 | profile mpv /usr/bin/mpv { 24 | include 25 | include 26 | include 27 | include 28 | include 29 | include 30 | include 31 | 32 | # Block network connection: 33 | include 34 | # Allow network connection (uncomment this line): 35 | # include 36 | 37 | # Block full access to sensitive data, as passwords and keys. 38 | # Includes /boot/**, /var/log/** & /etc/apparmor.d/** directories. View in: tunables/confidential. 39 | include 40 | 41 | # Only reading access in Home directory, mounted drives and others directories 42 | @{DATA_DIR}/** r, 43 | 44 | # Supported files 45 | /**?.@{MEDIA_EXT} r, 46 | 47 | # Configuration 48 | owner @{HOME}/.config/ rw, 49 | owner @{HOME}/.config/mpv/ rw, 50 | owner @{HOME}/.config/mpv/** rwk, 51 | 52 | owner @{HOME}/mpv-shot[0-9]*.jpg rw, 53 | 54 | /etc/mpv/{,**} r, 55 | /etc/nsswitch.conf r, 56 | deny /etc/passwd r, 57 | /etc/udev/udev.conf r, 58 | /etc/vdpau_wrapper.cfg r, 59 | /etc/glvnd/{,**} r, 60 | /usr/share/{glvnd,drirc.d}/{,**} r, 61 | 62 | /sys/**/ r, 63 | /sys/devices/**/uevent r, 64 | /sys/devices/system/**/meminfo r, 65 | /sys/devices/pci[0-9]*/**/{config,revision} r, 66 | /sys/devices/pci[0-9]*/**/{,subsystem_}{device,vendor} r, 67 | 68 | # Device access 69 | /dev/ati/{,**} r, 70 | /dev/dri/{,**} r, 71 | /dev/tty rw, 72 | audit deny /dev/{video,audio}* rwlkmx, 73 | 74 | # Binaries and libraries 75 | /usr/bin/mpv ixr, 76 | /usr{,/local}/bin/youtube-dl Pxr, 77 | /usr/bin/{dbus-send,xdg-screensaver,xset} Pixr, 78 | /bin/{grep,hostname,mv,sed,which} Pixr, 79 | deny /usr/lib{,64,/@{multiarch}}/vlc/plugins/plugins.dat{,.*} w, 80 | 81 | # Block compiled libraries & executables 82 | audit deny @{DATA_DIR}/** mx, 83 | audit deny owner /**/* mx, 84 | 85 | deny /run/udev/data/** rwklmx, 86 | deny owner /**/*.py* r, 87 | deny @{DATA_DIR}/**.py* r, 88 | deny owner @{HOME}/.recently-used.xbel* rw, 89 | deny owner @{HOME}/.local/share/recently-used.xbel* rw, 90 | 91 | # Temp files 92 | owner /tmp/xauth-* r, 93 | 94 | /run/systemd/userdb/{,**} r, 95 | /run/systemd/userdb/io.systemd.DynamicUser w, 96 | @{PROC}/sys/kernel/random/boot_id r, 97 | 98 | #unix (send, receive) type=(stream) protocol=0 peer=(addr=none), 99 | } 100 | 101 | # kate: syntax AppArmor Security Profile; replace-tabs off; remove-trailing-spaces mod; 102 | # vim: syntax=apparmor 103 | -------------------------------------------------------------------------------- /apparmor.d/usr.bin.okular: -------------------------------------------------------------------------------- 1 | # AppArmor profile for Okular 2 | # --------------------------------------------- 3 | # Author: Nibaldo Gonzalez 4 | # Last change: October 13, 2019 5 | 6 | # Requirements: 7 | # apparmor.d/tunables/confidential 8 | # apparmor.d/abstractions/kde-user 9 | # apparmor.d/abstractions/confidential-deny 10 | # apparmor.d/abstractions/flatpak-snap 11 | # apparmor.d/abstractions/general-security 12 | # apparmor.d/abstractions/block-networking 13 | # apparmor.d/abstractions/open-browser 14 | # apparmor.d/abstractions/open-email 15 | 16 | include 17 | include 18 | 19 | profile okular /usr/bin/okular { 20 | include 21 | include 22 | include 23 | include 24 | include 25 | include 26 | include 27 | include 28 | include 29 | include 30 | include 31 | 32 | include 33 | include 34 | 35 | # Block full access to sensitive data, as passwords and keys. 36 | # View in: tunables/confidential. 37 | include 38 | 39 | # Needed to open links (only for some Web browsers/e-mail clients). 40 | include 41 | include 42 | # include 43 | # include 44 | # include 45 | # include 46 | # include 47 | 48 | /{,**/} r, # Read only directories 49 | 50 | # Write access in Home directory and mounted drives 51 | owner @{HOME}/** rw, 52 | owner /{data,media,mnt,srv,net}/** rw, 53 | /{data,home,media,mnt,srv,net}/** r, 54 | 55 | # Files supported: 56 | /**.[pP][dD][fF] rw, # pdf 57 | /**.[oO][kK][uU][lL][aA][rR] rw, # okular 58 | /**.[tT][xX][tT] rw, # txt 59 | 60 | /**.[bB][mM][pP] r, # bmp 61 | /**.[bBgGxX][zZ] r, # bz, gz, xz 62 | /**.[fF][bB][23]{,.[zZ][iI][pP]} r, # fb2, fb3 63 | /**.[cC][bB][rRzZtTaA7] r, # cbr, cbz, cbt, cba, cb7 64 | /**.[cC][hH][mM] r, # chm 65 | /**.[dD][dD][sS] r, # dds 66 | /**.[dD][jJ][vV][uU] r, # djvu 67 | /**.[dD][vV][iI] r, # dvi 68 | /**.[eE][pP][uU][bB] r, # epub 69 | /**.[fF][aA][xX] r, # fax 70 | /**.[fF][dD][fF] r, # fdf 71 | /**.[gG][iI][fF] r, # gif 72 | /**.[hH][tT][mM][lL] r, # html 73 | /**.[iI][cC][oObB] r, # ico, icb 74 | /**.[iI][cC][nN][sS] r, # icns 75 | /**.[jJ][pP]{,[eE]}[gG] r, # jpg, jpeg 76 | /**.[mM][oO][bB][iI] r, # mobi 77 | /**.[oO][dD][tT] r, # odt 78 | /**.[pP][cC][xX] r, # pcx 79 | /**.[pP][iI][cC] r, # pic 80 | /**.[pP][bBgGpP][mM] r, # pbm, pgm, ppm 81 | /**.[pP][nN][gGmM] r, # png, pnm 82 | /**.{,[eE]}[pP][sS] r, # ps, eps 83 | /**.[rR][dD][fF] r, # rdf 84 | /**.[rR][sS][sS] r, # rss 85 | /**.[sS][vV][gG]{,[zZ]} r, # svg, svgz 86 | /**.[tT][iI][fF]{,[fF]} r, # tif, tiff 87 | /**.[wW][bB][mM][pP] r, # wbmp 88 | /**.[wW][eE][bB][pP] r, # webp 89 | /**.[xX][bBpP][sSmM] r, # xbm, xps, xpm 90 | 91 | # Okular configuration 92 | owner @{HOME}/.local/share/okular/** rw, 93 | owner @{HOME}/.config/okular{,part}rc rw, 94 | owner @{HOME}/.config/okular{,part}rc.[a-zA-Z0-9]* rwk, 95 | owner @{HOME}/.config/session/ rw, 96 | owner @{HOME}/.config/session/.* rwk, 97 | owner @{HOME}/.config/session/okular* rwk, 98 | owner @{HOME}/.cache/okular/** rw, 99 | owner @{HOME}/.cache/okular/qmlcache/{,**/}*.qmlc m, 100 | # For old versions 101 | owner @{HOME}/.kde/share/apps/okular/** rw, 102 | owner @{HOME}/.kde/share/config/okular{,part}rc rw, 103 | owner @{HOME}/.kde/share/config/okular{,part}rc.[a-zA-Z0-9]* rwk, 104 | 105 | include 106 | owner @{HOME}/.config/libaccounts-glib/accounts.db rk, 107 | 108 | owner @{HOME}/.config/session/#[0-9]{,[0-9]}{,[0-9]}{,[0-9]}{,[0-9]}{,[0-9]}{,[0-9]}{,[0-9]} rwk, 109 | link @{HOME}/.config/session/okular* -> "/home/*/.config/session/#[0-9]*", 110 | link @{HOME}/.config/okular{,part}rc{,.[a-zA-Z0-9]*} -> "/home/*/.config/#[0-9]*", 111 | link @{HOME}/.local/share/okular/** -> "/home/*/.local/share/okular/**", 112 | 113 | /usr/share/** r, 114 | 115 | /etc/fstab r, 116 | /etc/nsswitch.conf r, 117 | /etc/passwd r, 118 | /etc/rpc r, 119 | /etc/udev/udev.conf r, 120 | /etc/xdg/** r, 121 | 122 | /sys/devices/**/uevent r, 123 | /sys/devices/pci[0-9]*/**/{busnum,config,revision} r, 124 | /sys/devices/pci[0-9]*/**/{,subsystem_}{device,vendor} r, 125 | /sys/devices/pci[0-9]*/**/id{Product,Vendor} r, 126 | @{PROC}/sys/kernel/random/boot_id r, 127 | @{PROC}/sys/kernel/core_pattern r, 128 | owner @{PROC}/@{pid}/{cmdline,mountinfo,mounts,stat,status,vmstat} r, 129 | owner @{PROC}/@{pid}/task/[0-9]*/stat r, 130 | 131 | # Binaries 132 | /usr/bin/okular ixr, 133 | /usr/bin/plasma-discover PUx, 134 | /usr/bin/khelpcenter Cxr -> sanitized_helper, 135 | # File managers 136 | /usr/bin/dolphin Cx -> sanitized_helper, # Plasma 137 | /usr/bin/krusader Cx -> sanitized_helper, 138 | /usr/bin/nautilus Cx -> sanitized_helper, # Gnome 139 | /usr/bin/pcmanfm Cx -> sanitized_helper, # LXDE 140 | /usr/bin/thunar Cx -> sanitized_helper, # XFCE 141 | # Helpers 142 | /usr/bin/{exo,gnome,gvfs,xdg}-open ix, 143 | /usr/bin/kde-open{,5} ix, 144 | /usr/bin/kdeinit{4,5} ix, 145 | /usr/bin/kdialog ix, 146 | 147 | # Qt5 148 | /usr/lib{,64,/@{multiarch}}/qt5/** r, 149 | /usr/lib{,64,/@{multiarch}}/qt5/plugins/{,**/}*.so m, 150 | /usr/lib{,64,/@{multiarch}}/qt5/qml/{,**/}*.{so,jsc,qmlc} m, 151 | /usr/lib{,64,/@{multiarch}}/qt5/{bin,libexec}/** ix, 152 | deny /usr/lib{,64,/@{multiarch}}/vlc/plugins/plugins.dat* w, 153 | 154 | /usr/lib/@{multiarch}/libexec/kf5/** ix, 155 | 156 | # Temporal files and sockets 157 | owner /tmp/** rwlk, 158 | owner /{,var/}tmp/kde{,cache}-*/ rw, 159 | owner /{,var/}tmp/kde{,cache}-*/** rwk, 160 | owner /{,var/}run/user/[0-9]*/*-socket rwk, 161 | owner /{,var/}run/user/[0-9]*/bus rw, 162 | owner /{,var/}run/user/[0-9]*/kdeinit5* rwk, 163 | owner /{,var/}run/user/[0-9]*/ksocket-*/ rw, 164 | owner /{,var/}run/user/[0-9]*/ksocket-*/** rwk, 165 | /run/dbus/system_bus_socket w, 166 | 167 | owner /run/user/[0-9]*/#[0-9]{,[0-9]}{,[0-9]}{,[0-9]}{,[0-9]}{,[0-9]}{,[0-9]}{,[0-9]} rwk, 168 | link /run/user/[0-9]*/*-socket -> "/run/user/[0-9]*/#[0-9]*", 169 | 170 | # PulseAudio 171 | /etc/pulse/{client,daemon}.conf r, 172 | owner /{dev,run,var/run}/shm/pulse-shm-* rwk, 173 | owner /{,var/}run/user/[0-9]*/pulse/ rw, 174 | owner /{,var/}run/user/[0-9]*/pulse/{native,pid,*lock} rwk, 175 | 176 | /dev/tty r, 177 | /dev/snd/controlC[0-9]* r, 178 | 179 | signal (send) set=(term) peer=unconfined, 180 | 181 | audit deny @{HOME}/.local/share/applications/** w, 182 | audit deny @{HOME}/.local/share/flatpak/** w, 183 | audit deny @{HOME}/.kde{,4}/{,share/,share/apps/} w, 184 | audit deny @{HOME}/.app/** w, 185 | audit deny @{HOME}/.* w, 186 | deny @{HOME}/.bash_history r, 187 | 188 | audit deny /dev/{video,audio}* rwlkmx, 189 | deny /run/udev/data/** rwklmx, 190 | 191 | # Noisy 192 | audit deny owner /**/* x, 193 | audit deny @{HOME}/** x, 194 | audit deny @{HOME}/{*,[^.]**,.[^c]**} m, 195 | audit deny /{data,media,mnt,srv,net,cdrom,var,run,tmp}/** mx, 196 | } 197 | 198 | # kate: syntax AppArmor Security Profile; replace-tabs off; remove-trailing-spaces mod; 199 | # vim: syntax=apparmor 200 | -------------------------------------------------------------------------------- /apparmor.d/usr.bin.opera: -------------------------------------------------------------------------------- 1 | # AppArmor profile for Opera Web browser 2 | # --------------------------------------------- 3 | # Author: Nibaldo Gonzalez 4 | # Last change: January 05, 2018 5 | # This AppArmor profile is based on the Chromium profile 6 | # by Jamie Strandboge 7 | 8 | # NOTE: 9 | # - Important: Check & change the user download & desktop directory. 10 | # - By default, there is only write access to the download & desktop directory. 11 | # - This profile is only tested on Ubuntu 16.04 & KDE Plasma 5. 12 | 13 | # Requirements: 14 | # apparmor.d/tunables/confidential 15 | # apparmor.d/abstractions/chromium-base 16 | # apparmor.d/abstractions/chromium-base-xdgsettings 17 | # apparmor.d/abstractions/chromium-base-sandbox 18 | # apparmor.d/abstractions/kde-user 19 | # apparmor.d/abstractions/flatpak-snap 20 | # apparmor.d/abstractions/open-some-applications 21 | 22 | include 23 | include 24 | 25 | # The Opera directory can be: 26 | # /usr/lib/x86_64-linux-gnu/opera/ [Ubuntu, Debian] [64 bits] 27 | # /usr/lib/i386-linux-gnu/opera/ [Ubuntu, Debian] [32 bits] 28 | # /usr/lib/opera/ [Arch Linux] 29 | # /usr/lib64/opera/ [OpenSUSE, Fedora] [64 bits] 30 | # For general use: /usr/lib{,64,/x86_64-linux-gnu,/i386-linux-gnu}/opera/opera 31 | # This directory is used for Ubuntu, Debian and OpenSUSE (64 bits): 32 | @{OPERA_LIBDIR} = /usr/lib{64,/x86_64-linux-gnu}/opera 33 | 34 | # User directories, with write access 35 | # (downloads and desktop directories): 36 | @{USER_DIR} = @{HOME}/Descargas 37 | @{USER_DIR} += @{HOME}/Escritorio 38 | 39 | /usr/lib{64,/x86_64-linux-gnu}/opera/opera flags=(attach_disconnected) { 40 | # Base rules for Web browsers based on Chromium. 41 | include 42 | include 43 | 44 | # Required to open downloaded files. 45 | include 46 | 47 | # This include specifies which ubuntu-browsers.d abstractions to use. Eg, if you 48 | # want access to productivity applications, adjust the following file accordingly. 49 | ## include 50 | 51 | # Block full access to sensitive data, as passwords and keys. 52 | # Includes /boot/**, /var/log/** & /etc/apparmor.d/** directories. View in: tunables/confidential. 53 | deny @{CONFIDENTIAL_EXCEPT_OPERA} rwklmx, 54 | 55 | /sys/devices/pci[0-9]*/**/{bConfigurationValue,descriptors,manufacturer,product,serial} r, 56 | owner /{dev,run}/shm/{,.}org.chromium.* mrw, 57 | owner /{dev,run}/shm/{,.}com.opera.* mrw, 58 | 59 | # Access to Home, removable medias & other folders 60 | @{HOME}/{,*,[^.]**} r, 61 | /{data,media,mnt,srv,net}/** r, 62 | 63 | # User folders 64 | owner @{HOME}/ r, 65 | owner @{USER_DIR}/ r, 66 | owner @{USER_DIR}/** rw, 67 | 68 | # Opera configuration 69 | owner @{HOME}/.config/opera/ rw, 70 | owner @{HOME}/.config/opera/** rwk, 71 | owner @{HOME}/.config/opera/**/Cache/* mr, 72 | owner @{HOME}/.cache/opera/{,**} rw, 73 | owner @{HOME}/.cache/opera/Cache/* mr, 74 | owner @{HOME}/.local/share/.org.chromium.Chromium{,.[a-zA-Z0-9]*} rw, 75 | 76 | # Access to Opera directory 77 | deny @{OPERA_LIBDIR}/** w, # Noisy 78 | @{OPERA_LIBDIR}/*.pak mr, 79 | @{OPERA_LIBDIR}/locales/* mr, 80 | 81 | @{OPERA_LIBDIR}/opera ix, 82 | @{OPERA_LIBDIR}/opera_sandbox cx -> opera_sandbox, 83 | @{OPERA_LIBDIR}/opera_autoupdate ixrk, 84 | @{OPERA_LIBDIR}/opera_crashreporter ixr, 85 | @{OPERA_LIBDIR}/xdg-settings Cxr -> xdgsettings, 86 | 87 | # Allow communicating with sandbox 88 | unix (receive, send) peer=(label=@{OPERA_LIBDIR}/opera//opera_sandbox), 89 | 90 | /bin/which ixr, 91 | 92 | # Noisy 93 | audit deny @{HOME}/** x, 94 | audit deny owner /**/* x, 95 | 96 | profile xdgsettings flags=(attach_disconnected) { 97 | # Base rules for xdg-settings binary. 98 | include 99 | 100 | deny @{CONFIDENTIAL_EXCEPT_OPERA} rwklmx, 101 | 102 | @{OPERA_LIBDIR}/xdg-settings r, 103 | } 104 | 105 | profile opera_sandbox flags=(attach_disconnected) { 106 | # Base rules for opera_sandbox binary. 107 | include 108 | 109 | signal (receive) peer=@{OPERA_LIBDIR}/opera, 110 | unix (receive, send) peer=(label=@{OPERA_LIBDIR}/opera), 111 | 112 | /usr/bin/opera r, 113 | @{OPERA_LIBDIR}/opera Px, 114 | @{OPERA_LIBDIR}/opera_sandbox r, 115 | @{OPERA_LIBDIR}/opera_autoupdate ixrk, 116 | @{OPERA_LIBDIR}/opera_crashreporter ixr, 117 | } 118 | 119 | # Site-specific additions and overrides. See local/README for details. 120 | include 121 | } 122 | 123 | # kate: syntax AppArmor Security Profile; replace-tabs off; remove-trailing-spaces mod; 124 | # vim: syntax=apparmor 125 | -------------------------------------------------------------------------------- /apparmor.d/usr.bin.qbittorrent: -------------------------------------------------------------------------------- 1 | # AppArmor profile for qBittorrent 2 | # --------------------------------------------- 3 | # Author: Nibaldo Gonzalez 4 | # Last change: July 15, 2019 5 | 6 | # NOTE: 7 | # - This profile is more restrictive than the one provided 8 | # in . 9 | # - This profile is only tested on Ubuntu 18.04 & 16.04 with KDE Plasma 5. 10 | 11 | # Requirements: 12 | # apparmor.d/tunables/confidential 13 | # apparmor.d/abstractions/networkmanager-strict 14 | # apparmor.d/abstractions/udisk-strict 15 | # apparmor.d/abstractions/flatpak-snap 16 | # apparmor.d/abstractions/general-security 17 | # apparmor.d/abstractions/confidential-deny 18 | # apparmor.d/abstractions/open-browser 19 | # apparmor.d/abstractions/open-email 20 | # apparmor.d/abstractions/open-some-applications 21 | # apparmor.d/abstractions/kde-user 22 | 23 | include 24 | include 25 | 26 | # - Important: Check & change the torrents directory 27 | # according to qBittorrent configuration. 28 | # - By default, there is only write access to the torrent directory. 29 | 30 | # Torrents directory. Modify according to qBittorrent configuration. 31 | @{TORRENTS_DIR} = @{HOME}/Descargas/Torrents 32 | 33 | profile qbittorrent /usr/bin/qbittorrent { 34 | include 35 | include 36 | include 37 | include 38 | include 39 | include 40 | include 41 | 42 | include 43 | include 44 | include 45 | include 46 | 47 | # Blocks binaries, precompiled libraries, etc. 48 | include 49 | 50 | # Block full access to sensitive data, as passwords and keys. 51 | # Includes /boot/**, /var/log/** & /etc/apparmor.d/** directories. View in: tunables/confidential. 52 | include 53 | 54 | # Needed to open links (only for some Web browsers/e-mail clients). 55 | include 56 | include 57 | 58 | # Required to open downloaded files. 59 | include 60 | 61 | network netlink dgram, 62 | 63 | ## include 64 | # NOTE: The application does not start with bus=system 65 | dbus (send) 66 | bus=* 67 | path=/org/freedesktop/DBus 68 | interface=org.freedesktop.DBus 69 | member={Hello,AddMatch,RemoveMatch,GetNameOwner,NameHasOwner,StartServiceByName} 70 | peer=(name=org.freedesktop.DBus), 71 | # member={Hello,AddMatch,RemoveMatch,GetNameOwner} 72 | # peer=(name=org.freedesktop.DBus label=unconfined) 73 | dbus (receive) 74 | bus=system 75 | path=/org/freedesktop/NetworkManager 76 | interface=org.freedesktop.NetworkManager 77 | member=PropertiesChanged, 78 | 79 | # Access to Home 80 | owner @{TORRENTS_DIR}/{,**} rw, # Just read/write in the Torrents directory 81 | owner @{HOME}/**.[tT][oO][rR][rR][eE][nN][tT] r, # Only read .torrent files 82 | owner @{HOME}/{,[^.]**/} r, # Only read directories 83 | deny @{HOME}/{,**/}.directory r, 84 | 85 | # qBittorrent configuration 86 | owner @{HOME}/.config/qBittorrent/{,**} rwk, 87 | owner @{HOME}/.config/qBittorrentrc* rwk, 88 | owner @{HOME}/.local/share/data/qBittorrent/{,**} rwk, 89 | owner @{HOME}/.local/share/data/ rw, 90 | owner @{HOME}/.cache/qBittorrent/{,**} rw, 91 | 92 | # Local configuration 93 | include 94 | owner @{HOME}/.config/kio* r, 95 | owner @{HOME}/.config/kdebugrc rw, 96 | owner @{HOME}/.config/kde.org/libphonon.conf r, 97 | owner @{HOME}/.kde/share/config/{kde,kio}* r, 98 | owner @{HOME}/.kde/share/config/ktinfowidgetpluginrc rw, 99 | owner @{HOME}/.kde/share/config/kcookiejarrc r, 100 | owner @{HOME}/.kde/share/config/breezerc r, 101 | owner @{HOME}/.kde/share/config/ktimezonedrc r, 102 | owner @{HOME}/.kde/share/config/*.new rwk, 103 | owner @{HOME}/.local/share/qt_temp.* rwk, 104 | owner @{HOME}/.local/share/kservices5/{,**} r, 105 | owner @{HOME}/.cache/mesa_shader_cache/** rw, 106 | 107 | link @{HOME}/.config/qBittorrentrc* -> "/home/*/.config/#[0-9]*", 108 | link @{HOME}/.config/qBittorrent/* -> "/home/*/.config/qBittorrent/#[0-9]*", 109 | link @{HOME}/.config/qBittorrent/**/* -> "/home/*/.config/qBittorrent/**/#[0-9]*", 110 | link @{HOME}/.config/qBittorrent/qBittorrent.conf -> "/home/*/.config/qBittorrent/qBittorrent_new.conf", 111 | 112 | #link @{HOME}/.local/share/data/qBittorrent/BT_backup/* -> "/home/*/.local/share/data/qBittorrent/BT_backup/#[0-9]*", 113 | link @{HOME}/.local/share/data/qBittorrent/* -> "/home/*/.local/share/data/qBittorrent/#[0-9]*", 114 | link @{HOME}/.local/share/data/qBittorrent/**/* -> "/home/*/.local/share/data/qBittorrent/**/#[0-9]*", 115 | 116 | deny /{media,mnt,srv,net}/** rwklmx, # Block access to mounted drives & other directories 117 | 118 | # Binaries 119 | /usr/bin/qbittorrent r, 120 | /usr/bin/kdeinit{4,5} ixr, 121 | /usr/bin/{gnome,gvfs,xdg}-open ixr, 122 | /usr/bin/kde-open{,5} ixr, 123 | /usr/bin/kdialog ixr, 124 | 125 | # Libraries 126 | /usr/lib{,64,/@{multiarch}}/qt5/plugins/{,**/} r, 127 | /usr/lib{,64,/@{multiarch}}/qt5/plugins/**.so mr, 128 | #/usr/lib{,64,/@{multiarch}}/libQt5*.so{,.[0-9]*} m, 129 | 130 | /usr/share/color-schemes/{,**} r, 131 | /usr/share/GeoIP/{,*} r, 132 | /usr/share/knotifications5/{,*} r, 133 | /usr/share/kservices5/{,**/,**.protocol} r, 134 | /usr/share/plasma/{,**} r, 135 | /usr/share/qt5/{,**} r, 136 | /usr/share/sounds/{,**} r, 137 | /usr/share/mime/ r, 138 | /usr/share/templates/ r, 139 | /usr/share/hwdata/pnp.ids r, 140 | /usr/share/drirc.d/{,**} r, 141 | 142 | /etc/xdg/{,**} r, 143 | /etc/machine-id r, 144 | /etc/pulse/client.conf r, 145 | /etc/ssl/openssl.cnf r, 146 | /etc/udev/udev.conf r, 147 | deny /etc/fstab r, 148 | 149 | /dev/**/ r, 150 | /dev/tty r, 151 | owner /{dev,run,var/run}/shm/pulse-shm-* rwk, 152 | 153 | /sys/**/ r, 154 | /sys/devices/**/uevent r, 155 | /sys/devices/pci[0-9]*/**/{busnum,config,revision} r, 156 | /sys/devices/pci[0-9]*/**/{,subsystem_}{device,vendor} r, 157 | /sys/devices/pci[0-9]*/**/id{Product,Vendor} r, 158 | owner @{PROC}/@{pid}/mounts r, 159 | @{PROC}/sys/kernel/random/boot_id r, 160 | @{PROC}/sys/kernel/core_pattern r, # investigate 161 | #owner @{PROC}/@{pid}/mountinfo r, # investigate 162 | 163 | # Temporal files & sockets 164 | owner /tmp/xauth-[0-9]* r, 165 | owner /tmp/*-qBitto* rwk, 166 | owner /tmp/qt_temp.* rwk, 167 | owner /tmp/qtsingleapp-qBitto-* rwk, 168 | owner /tmp/[0-9]*/ rw, 169 | owner /tmp/.[a-zA-Z0-9]*/{,*} rw, 170 | owner /{,var/}tmp/{,.}qBitto** rwk, 171 | owner /var/tmp/kdecache-*/{,*} rwk, 172 | owner /run/user/[0-9]*/ksocket-*/{,qBitto*} rwk, 173 | owner /run/user/[0-9]*/kioclient*-socket rwk, 174 | owner /run/user/[0-9]*/qBitto*-socket rwk, 175 | owner /run/user/[0-9]*/#[0-9]* rwk, 176 | 177 | link /run/user/[0-9]*/qBittorrent*.slave-socket -> "/run/user/[0-9]*/#[0-9]*", 178 | link /tmp/.qBittorrent/* -> "/tmp/.qBittorrent/#[0-9]*", 179 | 180 | owner /run/user/[0-9]*/bus rwk, 181 | /{,var/}run/dbus/system_bus_socket rw, 182 | 183 | signal (send) set=(term) peer=unconfined, 184 | } 185 | 186 | # kate: syntax AppArmor Security Profile; replace-tabs off; remove-trailing-spaces mod; 187 | # vim: syntax=apparmor 188 | -------------------------------------------------------------------------------- /apparmor.d/usr.bin.thunderbird: -------------------------------------------------------------------------------- 1 | # AppArmor profile for Thunderbird 2 | # --------------------------------------------- 3 | # Author: Nibaldo Gonzalez 4 | # Last change: October 15, 2018 5 | # This AppArmor profile is based on the Firefox profile 6 | # by Jamie Strandboge 7 | # And on the Thunderbird profile 8 | # by Simon Deziel 9 | 10 | # NOTE: 11 | # - Important: Check & change the user download & desktop directories. 12 | # - By default, there is only write access to the download & desktop directories. 13 | # - This profile was designed with the intention of working 14 | # correctly in the KDE Plasma 5 desktop environment. 15 | 16 | # Requirements: 17 | # apparmor.d/tunables/confidential 18 | # apparmor.d/abstractions/flatpak-snap 19 | # apparmor.d/abstractions/open-browser 20 | # apparmor.d/abstractions/open-some-applications 21 | 22 | include 23 | include 24 | 25 | # Thunderbird directory: 26 | @{THUNB_LIBDIR} = /usr/lib{,64}/thunderbird 27 | 28 | # User directories, with write access 29 | # (downloads and desktop directories): 30 | @{USER_DIR} = @{HOME}/Descargas 31 | @{USER_DIR} += @{HOME}/Escritorio 32 | 33 | profile thunderbird /usr/lib{,64}/thunderbird/thunderbird{,*[^s][^h]} { 34 | include 35 | include 36 | include 37 | include 38 | include 39 | include 40 | include 41 | include 42 | include 43 | include 44 | include 45 | include 46 | include 47 | include # For notifications 48 | 49 | include 50 | include 51 | 52 | # Needed to open links (only for Firefox, Opera, Chromium, Chrome & Vivaldi). 53 | include 54 | ## include 55 | ## include 56 | 57 | # Required to open downloaded files. 58 | include 59 | 60 | include 61 | dbus (send) 62 | bus=session 63 | peer=(name=org.a11y.Bus), 64 | dbus (receive) 65 | bus=session 66 | interface=org.a11y.atspi**, 67 | dbus (receive, send) 68 | bus=accessibility, 69 | 70 | # KWallet support 71 | dbus (send) 72 | bus=session 73 | interface=org.kde.KWallet, 74 | 75 | capability sys_admin, 76 | 77 | # Block full access to sensitive data, as passwords and keys. 78 | # Includes /boot/**, /var/log/** & /etc/apparmor.d/** directories. View in: tunables/confidential. 79 | deny @{CONFIDENTIAL_EXCEPT_THUNDERBIRD} rwklmx, 80 | 81 | # For crash reports? 82 | ptrace (read,trace) peer=@{profile_name}, 83 | 84 | # Pulseaudio 85 | /usr/bin/pulseaudio Pixr, 86 | 87 | # Potentially extremely sensitive files. 88 | # NOTE: Included in @{CONFIDENTIAL_EXCEPT_THUNDERBIRD} 89 | # audit deny @{HOME}/.gnupg/** mrwkl, 90 | # audit deny @{HOME}/.ssh/** mrwkl, 91 | 92 | audit deny /dev/{video,audio}* rwlkmx, 93 | 94 | # Access to HOME 95 | owner @{HOME}/{,[^.]**} r, 96 | owner @{USER_DIR}/ r, 97 | owner @{USER_DIR}/** rw, 98 | 99 | # Block binary execution and mapping of compiled libraries 100 | audit deny /{data,media,mnt,srv,net}/** mx, 101 | audit deny @{HOME}/{*,[^.]**} m, 102 | audit deny @{HOME}/.[^t]*/** m, 103 | audit deny @{HOME}/** x, 104 | audit deny owner /**/* x, 105 | 106 | audit deny @{HOME}/.* w, 107 | audit deny @{HOME}/.bash_history r, 108 | 109 | # Required for LVM setups 110 | /sys/devices/virtual/block/dm-[0-9]*/uevent r, 111 | 112 | # Required for GNOME 3 113 | # /run/systemd/journal/socket w, 114 | 115 | # For networking 116 | network inet stream, 117 | network inet6 stream, 118 | @{PROC}/@{pid}/net/if_inet6 r, 119 | @{PROC}/@{pid}/net/ipv6_route r, 120 | @{PROC}/@{pid}/net/dev r, 121 | @{PROC}/@{pid}/net/wireless r, 122 | dbus (send) 123 | bus=system 124 | path=/org/freedesktop/NetworkManager 125 | member=state, 126 | dbus (receive) 127 | bus=system 128 | path=/org/freedesktop/NetworkManager, 129 | 130 | # Should maybe be in abstractions 131 | /etc/ r, 132 | /etc/mime.types r, 133 | /etc/mailcap r, 134 | /etc/xdg/*buntu/applications/defaults.list r, # for all derivatives 135 | /etc/xfce4/defaults.list r, 136 | /usr/share/xubuntu/applications/defaults.list r, 137 | owner /tmp/** m, 138 | owner /var/tmp/** m, 139 | owner /{,var/}run/shm/shmfd-* rw, 140 | owner /{dev,run}/shm/org.chromium.* rwk, 141 | /tmp/.X[0-9]*-lock r, 142 | /etc/udev/udev.conf r, 143 | # Doesn't seem to be required, but noisy. Maybe allow 'r' for 'b*' if needed. 144 | # Possibly move to an abstraction if anything else needs it. 145 | deny /run/udev/data/** r, 146 | 147 | # Thunderbird specific 148 | /etc/thunderbird*/ r, 149 | /etc/thunderbird*/** r, 150 | /etc/xul-ext/** r, 151 | /etc/xulrunner-2.0*/ r, 152 | /etc/xulrunner-2.0*/** r, 153 | /etc/gre.d/ r, 154 | /etc/gre.d/* r, 155 | 156 | # Libraries for KDE Plasma 157 | /usr/lib{,64,/@{multiarch}}/qt5/plugins/platformthemes/KDEPlasmaPlatformTheme.so mr, 158 | /usr/lib{,64,/@{multiarch}}/qt5/plugins/kf5/org.kde.kwindowsystem.platforms/KF5WindowSystem{KWayland,Wayland,X11}Plugin.so mr, 159 | 160 | # Noisy 161 | deny @{THUNB_LIBDIR}/** w, 162 | deny /usr/lib{,64}/thunderbird-addons/** w, 163 | deny /usr/lib{,64}/xulrunner-addons/** w, 164 | deny /usr/lib{,64}/xulrunner-*/components/*.tmp w, 165 | deny /.suspended r, 166 | deny /boot/initrd.img* r, 167 | deny /boot/vmlinuz* r, 168 | deny /var/cache/fontconfig/ w, 169 | deny @{HOME}/.local/share/recently-used.xbel r, 170 | deny @{HOME}/.local/share/applications/** w, 171 | deny @{HOME}/.local/share/flatpak/** w, 172 | deny @{HOME}/.* r, 173 | 174 | # TODO: investigate 175 | deny /usr/bin/gconftool-2 x, 176 | 177 | # These are needed when a new user starts thunderbird and thunderbird.sh is used 178 | @{THUNB_LIBDIR}/** ixr, 179 | /usr/bin/basename ixr, 180 | /usr/bin/dirname ixr, 181 | /usr/bin/pwd ixr, 182 | /sbin/killall5 ixr, 183 | /bin/which ixr, 184 | /usr/bin/tr ixr, 185 | /bin/dash ix, 186 | @{PROC}/ r, 187 | @{PROC}/filesystems r, 188 | @{PROC}/@{pid}/net/arp r, 189 | owner @{PROC}/@{pid}/cmdline r, 190 | owner @{PROC}/@{pid}/mountinfo r, 191 | owner @{PROC}/@{pid}/stat r, 192 | owner @{PROC}/@{pid}/status r, 193 | owner @{PROC}/@{pid}/task/[0-9]*/stat r, 194 | @{PROC}/sys/vm/overcommit_memory r, 195 | 196 | /sys/devices/pci[0-9]*/**/{busnum,config,revision,uevent} r, 197 | /sys/devices/pci[0-9]*/**/{,subsystem_}{device,vendor} r, 198 | /sys/devices/pci[0-9]*/**/id{Product,Vendor} r, 199 | /sys/devices/platform/**/uevent r, 200 | /dev/tty r, 201 | 202 | /etc/fstab r, 203 | /etc/mtab r, 204 | /etc/timezone r, 205 | /etc/wildmidi/wildmidi.cfg r, 206 | 207 | # Needed for the crash reporter 208 | owner @{PROC}/@{pid}/environ r, 209 | owner @{PROC}/@{pid}/auxv r, 210 | /etc/lsb-release r, 211 | /usr/bin/expr ix, 212 | /sys/devices/system/cpu/ r, 213 | /sys/devices/system/cpu/** r, 214 | 215 | # about:memory 216 | owner @{PROC}/@{pid}/statm r, 217 | owner @{PROC}/@{pid}/smaps r, 218 | 219 | # Needed for container to work in xul builds 220 | /usr/lib{,64}/xulrunner-*/plugin-container ixr, 221 | 222 | # So browsing directories works 223 | /{,**/} r, 224 | 225 | /usr/share/applications/*.list r, 226 | /usr/share/color-schemes/** r, 227 | /usr/share/glib-*/** r, 228 | /usr/share/icons/** r, 229 | /usr/share/plasma/** r, 230 | /usr/share/sounds/** r, 231 | /usr/share/themes/** r, 232 | /usr/share/qt5/translations/*.qm r, 233 | /usr/share/hwdata/pnp.ids r, 234 | 235 | # Per-user Thunderbird configuration 236 | owner @{HOME}/.thunderbird/{,**} rw, 237 | owner @{HOME}/.thunderbird/**/storage.sdb k, 238 | owner @{HOME}/.thunderbird/**/*.{db,parentlock,sqlite}* k, 239 | owner @{HOME}/.thunderbird/plugins/** rm, 240 | owner @{HOME}/.thunderbird/**/plugins/** rm, 241 | owner @{HOME}/.cache/thunderbird/{,**} rw, 242 | owner @{HOME}/.cache/thunderbird/**/*.sqlite k, 243 | 244 | owner @{HOME}/.config/gtk-3.0/** r, 245 | owner @{HOME}/.config/gtk-3.0/bookmarks r, 246 | owner @{HOME}/.gtkrc-2.0{,-kde4} r, 247 | 248 | # For KDE Plasma 5 249 | owner @{HOME}/.config/kdeglobals r, 250 | owner @{HOME}/.config/klanguageoverridesrc r, 251 | owner @{HOME}/.config/kwalletrc r, 252 | owner @{HOME}/.cache/icon-cache.kcache rw, 253 | 254 | owner @{HOME}/.config/mimeapps.list{,.[a-zA-Z0-9]} rw, 255 | owner @{HOME}/.local/share/applications/defaults.list r, 256 | owner @{HOME}/.local/share/applications/mimeapps.list r, 257 | owner @{HOME}/.local/share/applications/mimeinfo.cache r, 258 | 259 | owner @{HOME}/.{cache,config}/dconf/user rw, 260 | owner /{,var/}run/user/[0-9]*/dconf/user rw, 261 | deny owner @{HOME}/.local/share/gvfs-metadata/* r, 262 | 263 | # Extensions 264 | # /usr/share/.../extensions/... is already covered by '/usr/** r', above. 265 | # Allow 'x' for downloaded extensions, but inherit policy for safety 266 | owner @{HOME}/.thunderbird/**/extensions/** mixrw, 267 | /usr/share/xul-ext/**/*.sqlite rk, 268 | /usr/lib{,64}/xul-ext/**/*.sqlite rk, 269 | /usr/lib{,64}/thunderbird-addons/extensions/**/*.sqlite rk, 270 | 271 | deny @{THUNB_LIBDIR}/update.test w, 272 | deny /usr/lib{,64}/mozilla/extensions/**/ w, 273 | deny /usr/lib{,64}/xulrunner-addons/extensions/**/ w, 274 | deny /usr/share/mozilla/extensions/**/ w, 275 | deny /usr/share/mozilla/ w, 276 | 277 | # Miscellaneous (to be abstracted) 278 | # Ideally these would use a child profile. They are all ELF executables 279 | # so running with 'Ux', while not ideal, is ok because we will at least 280 | # benefit from glibc's secure execute. 281 | /usr/bin/mkfifo Uxr, # investigate 282 | /bin/ps Uxr, 283 | /bin/uname Uxr, 284 | 285 | /usr/bin/lsb_release Cxr -> lsb_release, 286 | 287 | # Support for GPG 288 | /usr/bin/gpg Cx -> gpg, 289 | /usr/bin/gpg2 Cx -> gpg2, 290 | /usr/bin/gpgconf Cx -> gpg2, 291 | /usr/bin/gpg-connect-agent Cx -> gpg2, 292 | 293 | # TB tries to create this file but has no business doing so 294 | deny @{HOME}/.gnupg/gpg-agent.conf w, 295 | 296 | profile lsb_release { 297 | include 298 | include 299 | /usr/bin/lsb_release r, 300 | /bin/dash ixr, 301 | /usr/bin/dpkg-query ixr, 302 | /usr/include/python2.[4567]/pyconfig.h r, 303 | /etc/lsb-release r, 304 | /etc/debian_version r, 305 | /usr/share/distro-info/*.csv r, 306 | /var/lib/dpkg/** r, 307 | 308 | /usr/local/lib{,64}/python3.[0-6]/dist-packages/ r, 309 | /usr/bin/ r, 310 | /usr/bin/python3.[0-6] mr, 311 | 312 | # file_inherit 313 | deny /tmp/gtalkplugin.log w, 314 | } 315 | 316 | profile gpg { 317 | include 318 | 319 | # Required to import keys from keyservers 320 | include 321 | include 322 | 323 | # For smartcards? 324 | /dev/bus/usb/ r, 325 | /dev/bus/usb/[0-9]*/ r, 326 | /dev/bus/usb/[0-9]*/[0-9]* r, 327 | 328 | # LDAP key servers 329 | /etc/ldap/ldap.conf r, 330 | 331 | /usr/bin/gpg mr, 332 | /usr/lib{,64}/gnupg/gpgkeys_* ix, 333 | owner @{HOME}/.gnupg r, 334 | owner @{HOME}/.gnupg/gpg.conf r, 335 | owner @{HOME}/.gnupg/random_seed rwk, 336 | owner @{HOME}/.gnupg/pubring.gpg{,~} rw, 337 | owner @{HOME}/.gnupg/secring.gpg rw, 338 | owner @{HOME}/.gnupg/trustdb.gpg rw, 339 | owner @{HOME}/.gnupg/*.gpg.{lock,tmp} rwl, 340 | owner @{HOME}/.gnupg/.#*[0-9] rw, 341 | owner @{HOME}/.gnupg/.#*[0-9]x rwl, 342 | owner @{HOME}/** r, 343 | 344 | owner /run/user/[0-9]*/keyring-*/gpg rw, 345 | 346 | # for inline pgp 347 | owner /tmp/encfile rw, 348 | owner /tmp/encfile-[0-9]* rw, 349 | } 350 | 351 | profile gpg2 { 352 | include 353 | 354 | # Required to import keys from keyservers 355 | include 356 | include 357 | /usr/lib/gnupg2/gpg2keys_hkp ix, 358 | 359 | # Silence noise from enigmail 1.9+ 360 | deny owner @{HOME}/.thunderbird/*/.parentlock w, 361 | deny owner @{HOME}/.thunderbird/*/panacea.dat w, 362 | deny owner @{HOME}/.thunderbird/*/*.mab w, 363 | deny owner @{HOME}/.thunderbird/**/*.msf w, 364 | deny owner @{HOME}/.cache/thunderbird/**/_CACHE_* w, 365 | 366 | /usr/share/xul-ext/enigmail/chrome/enigmail.jar r, 367 | 368 | # For smartcards? 369 | /dev/bus/usb/ r, 370 | /dev/bus/usb/[0-9]*/ r, 371 | /dev/bus/usb/[0-9]*/[0-9]* r, 372 | 373 | # LDAP key servers 374 | /etc/ldap/ldap.conf r, 375 | 376 | /usr/bin/gpg-connect-agent mr, 377 | owner @{HOME}/.gnupg/S.gpg-agent rw, 378 | owner @{HOME}/.gnupg/S.dirmngr rw, 379 | 380 | /usr/bin/gpg2 mr, 381 | owner @{HOME}/.gnupg/ rw, 382 | owner @{HOME}/.gnupg/gpg.conf r, 383 | owner @{HOME}/.gnupg/random_seed rwk, 384 | owner @{HOME}/.gnupg/pubring.gpg{,~} rw, 385 | owner @{HOME}/.gnupg/secring.gpg rw, 386 | owner @{HOME}/.gnupg/trustdb.gpg rw, 387 | owner @{HOME}/.gnupg/*.gpg.{lock,tmp} rwl, 388 | owner @{HOME}/.gnupg/.gpg-*.lock rwl, 389 | owner @{HOME}/.gnupg/gnupg_spawn_*.lock rwl, 390 | owner @{HOME}/.gnupg/.#lk0x[0-9a-f]* rwl, 391 | owner @{HOME}/.gnupg/.gpg-v[0-9]*-migrated rw, 392 | owner @{HOME}/** r, 393 | owner @{PROC}/@{pids}/mountinfo r, 394 | 395 | # For inline pgp 396 | owner /tmp/encfile rw, 397 | owner /tmp/encfile-[0-9]* rw, 398 | 399 | # For signature generation 400 | owner /tmp/nsemail.eml w, 401 | owner /tmp/nsemail-[0-9]*.eml w, 402 | 403 | # For signature verifications 404 | owner /tmp/data.sig r, 405 | owner /tmp/data-[0-9]*.sig r, 406 | 407 | owner /tmp/gpg-[a-zA-Z0-9]*/S.gpg-agent rw, 408 | } 409 | 410 | # Site-specific additions and overrides. See local/README for details. 411 | # include 412 | } 413 | 414 | # kate: syntax AppArmor Security Profile; replace-tabs off; remove-trailing-spaces mod; 415 | # vim: syntax=apparmor 416 | -------------------------------------------------------------------------------- /apparmor.d/usr.lib.bluetooth.bluetoothd: -------------------------------------------------------------------------------- 1 | # AppArmor profile for the Bluetooth Daemon 2 | # --------------------------------------------- 3 | # Author: Nibaldo Gonzalez 4 | # Last change: October 29, 2020 5 | 6 | include 7 | 8 | /usr/lib{,32,64}/bluetooth/bluetoothd flags=(attach_disconnected) { 9 | include 10 | include 11 | 12 | network bluetooth, 13 | network netlink raw, 14 | network alg seqpacket, 15 | 16 | capability net_admin, 17 | capability net_bind_service, 18 | 19 | /usr/lib{,32,64}/bluetooth/bluetoothd ixmr, 20 | /var/lib{,32,64}/bluetooth/** rwk, 21 | /usr/lib{,32,64}/{,@{multiarch}/}bluetooth/{,**} r, 22 | /usr/lib{,32,64}/{,@{multiarch}/}bluetooth/plugins/sixaxis.so m, 23 | /etc/bluetooth/** r, 24 | /etc/udev/udev.conf r, 25 | 26 | /dev/rfkill rw, 27 | /dev/uinput rw, 28 | /dev/hidraw/{,**} rw, 29 | 30 | /sys/devices/{,**} r, 31 | /run/udev/{,**} r, 32 | /run/systemd/notify w, 33 | /run/dbus/system_bus_socket rw, 34 | 35 | /run/systemd/journal/{socket,dev-log} rw, 36 | /dev/log rw, 37 | 38 | dbus (bind) 39 | bus=system 40 | name=org.bluez, 41 | 42 | dbus (receive) 43 | bus=system 44 | path=/org/bluez{,/**}, 45 | dbus (send) 46 | bus=system 47 | interface=org.bluez.*, 48 | 49 | dbus (send) 50 | bus=system 51 | path=/org/bluez/hci[0-9]** 52 | interface=org.freedesktop.DBus.Properties 53 | member=PropertiesChanged 54 | peer=(name=org.freedesktop.DBus), 55 | 56 | dbus (send) 57 | bus=system 58 | path=/ 59 | interface=org.freedesktop.DBus.ObjectManager 60 | member={InterfacesRemoved,InterfacesAdded}, 61 | dbus (receive) 62 | bus=system 63 | path=/ 64 | interface=org.freedesktop.DBus.ObjectManager 65 | member={GetAll,GetManagedObjects}, 66 | 67 | dbus (receive) 68 | bus=system 69 | path=/ 70 | interface=org.freedesktop.DBus.Introspectable 71 | member=Introspect, 72 | dbus (send) 73 | bus=system 74 | path=/org/freedesktop/DBus 75 | interface=org.freedesktop.DBus 76 | member={Hello,RequestName,AddMatch,RemoveMatch,GetNameOwner} 77 | peer=(name=org.freedesktop.DBus), 78 | 79 | dbus (send) 80 | bus=system 81 | path=/org/freedesktop/hostname[0-9]* 82 | interface=org.freedesktop.DBus.Properties 83 | member=GetAll, 84 | 85 | # Noisy 86 | deny /{home,root,media,mnt,srv,net}/** rwkl, 87 | audit deny /{home,root,media,mnt,srv,net,cdrom,run,tmp}/** mx, 88 | audit deny /dev/{audio,video}* rwklmx, 89 | 90 | audit deny /boot/** rwklmx, 91 | audit deny /var/log/** rwklmx, 92 | audit deny /etc/apparmor.d/** rwklmx, 93 | audit deny /etc/apparmor/** rwklmx, 94 | audit deny /var/lib/apparmor/** rwklmx, 95 | 96 | audit deny /etc/init.d/** rwklmx, 97 | audit deny /etc/cron.*/** rwklmx, 98 | audit deny /etc/initramfs-tools/** rwklmx, 99 | audit deny /etc/systemd/** rwklmx, 100 | audit deny /etc/xdg/{autostart,systemd}/** rwklmx, 101 | } 102 | 103 | # kate: syntax AppArmor Security Profile; replace-tabs off; remove-trailing-spaces mod; 104 | # vim: syntax=apparmor 105 | -------------------------------------------------------------------------------- /extra/usr.bin.baloo_file: -------------------------------------------------------------------------------- 1 | # Author: Nibaldo Gonzalez 2 | # Last change: March 08, 2018 3 | 4 | include 5 | include 6 | 7 | # TODO: 8 | # /usr/bin/baloo{ctl,search,show} 9 | # /usr/lib/*-linux-gnu/libexec/baloorunner 10 | 11 | # Directories, in addition to @{HOME}, 12 | # where the files to be indexed are stored 13 | @{DATA_DIR} = /{data,media,mnt,srv,net} 14 | 15 | profile baloo_file /usr/bin/baloo_file{,_extractor,metadata_temp_extractor} { 16 | include 17 | include 18 | include 19 | include 20 | include 21 | include 22 | include 23 | 24 | include 25 | include 26 | 27 | # Block full access to sensitive data, as passwords and keys. 28 | # View in: tunables/confidential. 29 | include 30 | 31 | # Configuration files 32 | owner @{HOME}/.config/.[a-zA-Z0-9]* rwk, 33 | owner @{HOME}/.config/\#[0-9]* rwk, 34 | owner @{HOME}/.config/baloofile* rwk, 35 | owner @{HOME}/.local/share/baloo/ rw, 36 | owner @{HOME}/.local/share/baloo/** rwk, 37 | link @{HOME}/.config/baloofile*.[a-zA-Z0-9]* -> "/home/*/.config/#[0-9]*", 38 | 39 | # Possible files to index 40 | @{HOME}/{,**} r, 41 | @{DATA_DIR}/{,**} r, 42 | owner /*/** r, 43 | 44 | /usr/bin/baloo_file{,_extractor,metadata_temp_extractor} ix, 45 | /usr/lib{,64,32,x32}/{,@{multiarch}/}qt5/plugins/kf5/kfilemetadata/{,**/}kfilemetadata_*.so m, 46 | /usr/lib{,64,32,x32}/{,@{multiarch}/}qt5/plugins/kf5/org.kde.kidletime.platforms/{,**/}KF5IdleTime*.so m, 47 | 48 | /usr/share/qt5/translations/* r, 49 | /usr/share/poppler/** r, 50 | /usr/share/lib*/** r, 51 | 52 | /etc/udev/udev.conf r, 53 | /etc/nsswitch.conf r, 54 | /etc/fstab r, 55 | /etc/passwd r, 56 | /etc/group r, 57 | 58 | /dev/tty r, 59 | 60 | /sys/devices/**/ r, 61 | /sys/devices/pci[0-9]*/**/uevent r, 62 | /sys/devices/system/node/node[0-9]*/meminfo r, 63 | @{PROC}/sys/kernel/core_pattern r, 64 | 65 | unix (send, receive, connect) type=(stream) peer=(addr=@/tmp/.X11-unix/* label=unconfined), 66 | unix (send, receive, connect) type=(stream) peer=(addr=@/tmp/.ICE-unix/* label=unconfined), 67 | 68 | # Noisy 69 | audit deny owner /**/* mx, 70 | audit deny @{HOME}/** mx, 71 | audit deny @{DATA_DIR}/** wlmx, 72 | audit deny /{cdrom,var,run,tmp}/** mx, 73 | 74 | audit deny @{HOME}/.local/share/applications/** w, 75 | audit deny @{HOME}/.local/share/flatpak/** w, 76 | audit deny @{HOME}/.* w, 77 | 78 | audit deny @{HOME}/{,**/}.Private/** wlk, 79 | audit deny @{HOME}/.bash_history r, 80 | audit deny /dev/{video,audio}* rwlkmx, 81 | deny /run/udev/data/** rwklmx, 82 | } 83 | 84 | # kate: syntax AppArmor Security Profile 85 | # vim: syntax=apparmor 86 | -------------------------------------------------------------------------------- /extra/usr.bin.bluedevil: -------------------------------------------------------------------------------- 1 | # Author: Nibaldo Gonzalez 2 | # Last change: January 03, 2018 3 | 4 | include 5 | include 6 | 7 | profile bluedevil /usr/bin/bluedevil-{monolithic,wizard} { 8 | include 9 | include 10 | include 11 | include 12 | include 13 | include 14 | include 15 | include 16 | 17 | include 18 | include 19 | include 20 | 21 | owner @{HOME}/.kde/share/config/kcmshellrc* r, 22 | owner @{HOME}/.kde/share/config/bluedevil* rw, 23 | owner @{HOME}/.kde/share/apps/RecentDocuments/{,**} rw, 24 | 25 | owner @{HOME}/.config/kdeglobals r, 26 | owner @{HOME}/.config/klanguageoverridesrc r, 27 | owner @{HOME}/.config/breezerc r, 28 | owner @{HOME}/.cache/icon-cache.kcache rw, 29 | 30 | /usr/share/{,apps/}bluedevil/{,**} r, 31 | /usr/share/{,apps/}bluedevilwizard/{,**} r, 32 | /usr/share/cursors/{,**} r, 33 | /usr/share/plasma/look-and-feel/{,**} r, 34 | /usr/share/qt5/translations/*.qm r, 35 | /usr/share/color-schemes/** r, 36 | 37 | /etc/nsswitch.conf r, 38 | /etc/passwd r, 39 | 40 | /sys/devices/pci[0-9]*/** r, # Investigate 41 | 42 | /usr/bin/bluedevil-wizard ixr, 43 | /usr/bin/bluedevil-monolithic mr, 44 | /usr/bin/kcmshell{4,5} ixr, 45 | 46 | /usr/lib{,32,64,/@{multiarch}}/qt5/plugins/{imageformats,platformthemes,styles}/*.so mr, 47 | 48 | /var/tmp/kdecache-*/*.kcache rw, 49 | 50 | /dev/rfkill r, 51 | /dev/dri/ r, 52 | } 53 | 54 | # kate: syntax AppArmor Security Profile 55 | # vim: syntax=apparmor 56 | -------------------------------------------------------------------------------- /extra/usr.bin.youtube-dl: -------------------------------------------------------------------------------- 1 | # Author: Nibaldo Gonzalez 2 | # Last change: February 12, 2017 3 | 4 | include 5 | include 6 | 7 | # Python versions 8 | @{PYTHON} = python{,[23],2.[4-7],3.[0-6]} 9 | 10 | profile youtube_dl /usr{,/local}/bin/youtube-dl { 11 | include 12 | include 13 | include 14 | 15 | # Blocks binaries, precompiled libraries, etc. 16 | include 17 | 18 | # Block full access to sensitive data, as passwords and keys. 19 | # Includes /boot/**, /var/log/** & /etc/apparmor.d/** directories. View in: tunables/confidential. 20 | include 21 | 22 | # Binaries 23 | /usr{,/local}/bin/youtube-dl ixr, 24 | /usr/bin/gcc-* ixr, 25 | /bin/{dash,stty} ixr, 26 | /sbin/ldconfig{,.real} ixr, 27 | /usr/lib{,32,64}/gcc/** ixr, 28 | 29 | # Python 30 | /usr/bin/@{PYTHON} mr, 31 | /usr{,/local}/lib{,32,64}/@{PYTHON}/dist-packages/youtube_dl/{,**} r, 32 | deny /usr/lib{,32,64}/@{PYTHON}/**.pyc{,.[0-9]*} w, 33 | 34 | /usr/local/bin/ r, 35 | /etc/mime.types r, 36 | owner @{PROC}/@{pid}/{cmdline,mountinfo,mounts,stat,status,vmstat} r, 37 | owner @{PROC}/@{pid}/fd/ r, 38 | 39 | # Temporal files and sockets 40 | owner @{HOME}/[a-zA-Z0-9]* rw, 41 | owner /{,var/}tmp/[a-zA-Z0-9]* rw, 42 | owner /run/user/[0-9]*/*.slave-socket rwk, 43 | } 44 | 45 | # kate: syntax AppArmor Security Profile 46 | # vim: syntax=apparmor 47 | -------------------------------------------------------------------------------- /unmaintained/home.telegram: -------------------------------------------------------------------------------- 1 | # Author: Nibaldo Gonzalez 2 | # Last change: December 19, 2017 3 | 4 | # NOTE: 5 | # - Important: Check & change the Telegram binary path and the user downloads directory. 6 | # - By default, there is only write access to the download directory. 7 | # - This profile is only tested on Ubuntu 16.04 with KDE Plasma 5. 8 | 9 | include 10 | include 11 | 12 | # Downloads directory: 13 | @{DOWNLOADS_DIR} = @{HOME}/Descargas 14 | 15 | # Binaries location 16 | @{TELEGRAM_BIN} = @{HOME}/.app/Telegram 17 | 18 | profile Telegram /home/*/.app/Telegram/{Telegram,Updater} { 19 | include 20 | include 21 | include 22 | include 23 | include 24 | include 25 | include 26 | include 27 | include 28 | 29 | include 30 | 31 | # Needed to open links (only for some browsers). 32 | include 33 | 34 | # Block full access to sensitive data, as passwords and keys. 35 | # Includes /boot/**, /var/log/** & /etc/apparmor.d/** directories. View in: tunables/confidential. 36 | deny @{CONFIDENTIAL_EXCEPT_TELEGRAM} rwklmx, 37 | 38 | # Access to Home 39 | owner @{HOME}/ r, 40 | owner @{HOME}/* r, 41 | owner @{HOME}/[^.]*/ r, 42 | owner @{HOME}/[^.]*/** r, 43 | owner @{DOWNLOADS_DIR}/** rw, # Write only in the downloads directory 44 | 45 | # Telegram directory 46 | owner @{HOME}/.TelegramDesktop/{**,} rwkl, 47 | owner @{TELEGRAM_BIN}/* ixwr, 48 | 49 | # Local configuration 50 | owner @{HOME}/.config/* r, 51 | owner @{HOME}/.config/{fontconfig,gtk-[0-9]*,kde.org,menus,pulse,session}/{**,} r, 52 | owner @{HOME}/.config/gtk-[0-9]*/bookmarks rw, 53 | owner @{HOME}/.config/gtkrc{,-*} r, 54 | owner @{HOME}/.config/dconf/user rw, 55 | owner /{,var/}run/user/*/dconf/user rw, 56 | owner @{HOME}/.local/share/icons/{,**} rw, 57 | owner @{HOME}/.local/share/applications/{,telegramdesktop.desktop} rw, 58 | owner @{HOME}/.local/share/applications/telegramdesktop.desktop.[a-zA-Z0-9]* rwk, 59 | owner @{HOME}/.local/share/RecentDocuments/ rw, 60 | owner @{HOME}/.local/share/RecentDocuments/*.desktop rwl, 61 | owner @{HOME}/.local/share/RecentDocuments/*.desktop.[a-zA-Z0-9]* rwk, 62 | deny @{HOME}/.local/share/recently-used.xbel r, 63 | owner @{HOME}/.cache/fontconfig/{,*} rw, 64 | 65 | # For KDE Plasma 5 66 | owner @{HOME}/.kde/share/config/kdeglobals rk, 67 | owner @{HOME}/.kde/share/kde4/services/*.protocol rw, 68 | owner @{HOME}/.config/kdeglobals rk, 69 | owner @{HOME}/.cache/icon-cache.kcache rw, 70 | owner @{HOME}/.cache/ksycoca5_* r, 71 | owner @{HOME}/.cache/qt_compose_cache_* rw, 72 | 73 | /usr/share/** r, 74 | /etc/timezone r, 75 | /etc/udev/udev.conf r, 76 | /etc/lsb-release r, 77 | /etc/xdg/{,**} r, 78 | 79 | owner @{PROC}/@{pid}/{cmdline,environ,status} r, 80 | owner @{PROC}/@{pid}/fd/{,**} r, 81 | owner @{PROC}/@{pid}/auxv r, 82 | owner @{PROC}/@{pid}/task/{,**} r, 83 | /sys/dbus/** r, 84 | /sys/devices/**/uevent r, 85 | 86 | /run/systemd/journal/socket rw, 87 | /run/dbus/system_bus_socket r, 88 | owner /run/user/[0-9]*/bus r, 89 | owner /run/user/[0-9]*/*.slave-socket rwkl, 90 | 91 | /dev/tty r, 92 | deny /dev/video* rwmlkx, # Block cameras 93 | 94 | # Binaries & Helpers 95 | /bin/dash Pixr, 96 | /usr/bin/pulseaudio Pixr, 97 | /usr/bin/{exo,gnome,gvfs,xdg}-open ixr, 98 | /usr/bin/kde-open{,5} ixr, 99 | /usr/bin/kdialog ixr, 100 | /usr/bin/desktop-file-install ixr, 101 | 102 | # Block binary execution and mapping of compiled libraries 103 | audit deny owner /**/* m, 104 | audit deny @{HOME}/[^.]** mx, 105 | audit deny /{media,mnt,srv,net}/** mx, 106 | 107 | audit deny owner /**/*.py* r, # Block Python imports 108 | 109 | deny /run/udev/data/** rwklmx, 110 | deny /usr/bin/gconftool-2 x, 111 | deny /var/cache/fontconfig/ w, 112 | 113 | ptrace (trace) peer=unconfined, 114 | ptrace (trace) peer=Telegram, 115 | 116 | unix (connect, send, receive) type=(stream) peer=(label=unconfined addr=@/dbus-vfs-daemon/socket-*), 117 | 118 | dbus (send) 119 | bus=system 120 | interface=org.freedesktop.DBus.Property.EmitsChangedSignal, 121 | dbus (send) 122 | bus=system 123 | interface=org.freedesktop.DBus.Properties, 124 | 125 | dbus (send) 126 | bus=system 127 | path=/org/freedesktop/NetworkManager 128 | member={state,GetDevices}, 129 | dbus (receive) 130 | bus=system 131 | path=/org/freedesktop/NetworkManager, 132 | dbus (send) 133 | bus=system 134 | interface=org.freedesktop.NetworkManager.Settings 135 | path=/org/freedesktop/NetworkManager/Settings 136 | member=ListConnections, 137 | dbus (send) 138 | bus=system 139 | interface=org.freedesktop.NetworkManager.Settings.Connection 140 | path=/org/freedesktop/NetworkManager/Settings/[0-9]* 141 | member=GetSettings, 142 | dbus (receive) 143 | bus=system 144 | interface=org.freedesktop.NetworkManager.Connection.Active 145 | path=/org/freedesktop/NetworkManager/ActiveConnection/[0-9]* 146 | member=PropertiesChanged, 147 | } 148 | 149 | # kate: syntax AppArmor Security Profile 150 | # vim: syntax=apparmor 151 | -------------------------------------------------------------------------------- /unmaintained/usr.bin.baka-mplayer: -------------------------------------------------------------------------------- 1 | # Author: Nibaldo Gonzalez 2 | # Last change: December 04, 2017 3 | 4 | include 5 | include 6 | 7 | profile baka-mplayer /usr/bin/baka-mplayer { 8 | include 9 | include 10 | include 11 | include 12 | include 13 | include 14 | 15 | include 16 | include 17 | include 18 | include 19 | 20 | # Blocks binaries, precompiled libraries, access to camera and microphone, etc. 21 | include 22 | 23 | # Block network connection: 24 | # include 25 | # Allow network connection: 26 | include 27 | 28 | # Block full access to sensitive data, as passwords and keys. 29 | # Includes /boot/**, /var/log/** & /etc/apparmor.d/** directories. View in: tunables/confidential. 30 | include 31 | 32 | # Needed to open links (only for some Web browsers). 33 | include 34 | 35 | # Only reading access in Home directory, mounted drives and others directories 36 | /{data,home,media,mnt,srv,net,cdrom}/{,**} r, 37 | owner /**/{,*} r, 38 | 39 | # Configuration 40 | owner @{HOME}/.config/ rw, 41 | owner @{HOME}/.config/baka{,-}mplayer* rwk, 42 | 43 | owner @{HOME}/.config/.[a-zA-Z0-9]* rwk, 44 | owner @{HOME}/.config/kdeglobals rw, 45 | owner @{HOME}/.config/kdeglobals.[a-zA-Z0-9]* rwk, 46 | owner @{HOME}/.config/QtProject.conf rw, 47 | owner @{HOME}/.config/QtProject.conf.[a-zA-Z0-9]* rwk, 48 | owner @{HOME}/.cache/icon-cache.kcache rw, 49 | owner @{HOME}/.local/share/RecentDocuments/*.desktop{,.lock} rwk, 50 | owner @{HOME}/.local/share/RecentDocuments/.[a-zA-Z0-9]* wk, 51 | 52 | /usr/share/** r, 53 | 54 | /etc/directfbrc* r, 55 | /etc/fstab r, 56 | /etc/nsswitch.conf r, 57 | /etc/passwd r, 58 | /etc/ssl/openssl.cnf r, 59 | /etc/udev/udev.conf r, 60 | /etc/vdpau_wrapper.cfg r, 61 | /etc/xdg/{,**} r, 62 | 63 | owner @{PROC}/@{pid}/{cmdline,mountinfo,mounts,stat,status,vmstat} r, 64 | /sys/**/ r, 65 | /sys/devices/**/uevent r, 66 | /sys/devices/system/**/meminfo r, 67 | /sys/devices/pci[0-9]*/**/{config,revision} r, 68 | /sys/devices/pci[0-9]*/**/{,subsystem_}{device,vendor} r, 69 | 70 | # Device access 71 | /dev/ati/{,**} r, 72 | /dev/dri/{,**} r, 73 | /dev/tty r, 74 | 75 | # Binaries and libraries 76 | /usr/bin/baka-mplayer ixr, 77 | /usr{,/local}/bin/youtube-dl Pxr, 78 | /usr/bin/{mpv,dbus-send,xdg-screensaver,xset} Pixr, 79 | /bin/{grep,hostname,mv,sed,which} ixr, 80 | /usr/bin/kdialog ixr, 81 | /usr/bin/kdeinit{4,5} ixr, 82 | /usr/bin/kde-open{,5} ixr, 83 | /usr/bin/{gnome,gvfs,xdg}-open ixr, 84 | /usr{,/lib/@{multiarch}}/libexec/kf5/* Pixr, 85 | /usr/lib{,64,/@{multiarch}}/qt5/plugins/**.so rm, 86 | deny /usr/lib{,64,/@{multiarch}}/vlc/plugins/plugins.dat{,.*} w, 87 | 88 | # Temporal files and sockets 89 | owner /run/user/[0-9]*/baka-mplayer*-socket rwkl, 90 | owner /var/tmp/kdecache-*/* rwk, 91 | owner /run/user/[0-9]*/ksocket-*/{,**} rwkl, 92 | /run/systemd/journal/socket rw, 93 | /run/dbus/system_bus_socket rw, 94 | 95 | signal (send) set=(term) peer=unconfined, 96 | 97 | dbus (send) 98 | bus=session 99 | interface=org.kde.KSlaveLauncher 100 | member=requestSlave, 101 | dbus (send) 102 | bus=session 103 | interface=org.kde.KLauncher, 104 | 105 | dbus (send) 106 | bus=system 107 | path=/org/freedesktop/DBus 108 | interface=org.freedesktop.DBus 109 | member={Hello,AddMatch,RemoveMatch,GetNameOwner,NameHasOwner} 110 | peer=(name=org.freedesktop.DBus), 111 | } 112 | 113 | # kate: syntax AppArmor Security Profile 114 | # vim: syntax=apparmor 115 | -------------------------------------------------------------------------------- /unmaintained/usr.bin.bomi: -------------------------------------------------------------------------------- 1 | # vim:syntax=apparmor 2 | # Author: Nibaldo Gonzalez 3 | # Last change: July 01, 2017 4 | 5 | # NOTE: 6 | # - This profile is only tested on Ubuntu 16.04 & KDE Plasma 5. 7 | # - By default the Internet connection is blocked and 8 | # there are no write accesses in the Home directory. 9 | 10 | #include 11 | include 12 | 13 | # Directories where multimedia and data are stored 14 | @{DATA_DIR}=/{home,media,mnt,srv,net,cdrom} 15 | 16 | profile bomi /usr/bin/bomi { 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | # Block network connection 27 | #include 28 | 29 | # Block full access to sensitive data, as passwords and keys. 30 | # Includes /boot/**, /var/log/** & /etc/apparmor.d/** directories. View in: tunables/confidential. 31 | #include 32 | 33 | # Only reading access in Home directory and mounted drives 34 | /@{DATA_DIR}/{,**} r, 35 | owner /**/{,*} r, 36 | 37 | # Block compiled libraries & executables 38 | audit deny /@{DATA_DIR}/** mx, 39 | audit deny owner /**/* mx, 40 | 41 | # Bomi configuration & cache 42 | owner @{HOME}/.config/xylosper/ rwk, 43 | owner @{HOME}/.config/xylosper/bomi/{,**} rwk, 44 | owner @{HOME}/.cache/xylosper/ rwk, 45 | owner @{HOME}/.cache/xylosper/bomi/{,**} rwk, 46 | owner @{HOME}/.cache/icon-cache.kcache rw, 47 | owner @{HOME}/.config/QtProject.conf rw, 48 | owner @{HOME}/.config/bomirc{,.lock} rwk, 49 | 50 | /usr/share/** r, 51 | 52 | /etc/directfbrc* r, 53 | /etc/udev/udev.conf r, 54 | /etc/nsswitch.conf r, 55 | /etc/fstab r, 56 | /etc/passwd r, 57 | /etc/pulse/*.conf r, 58 | /etc/xdg/{,**} r, 59 | deny /etc/xdg/{autostart,systemd}/{,**} rw, 60 | 61 | /sys/**/ r, 62 | /sys/devices/**/uevent r, 63 | /sys/devices/pci[0-9]*/**/config r, 64 | /sys/devices/system/**/meminfo r, 65 | 66 | # Libraries and binaries 67 | /usr/bin/bomi ixr, 68 | /usr/bin/* Pixr, 69 | /usr/lib{,64}/{,**} Pixr, 70 | deny /usr/lib{,64,/*-linux-gnu}/vlc/plugins/plugins.dat{,.*} w, 71 | 72 | # Device access 73 | /dev/ati/{,**} rwk, 74 | /dev/dri/{,**} rwk, 75 | /dev/shm/{,**} rwk, 76 | audit deny /dev/{video,audio}* rwlkmx, 77 | 78 | # Temporal files and sockets 79 | owner /var/tmp/kdecache-*/* rwk, 80 | owner /run/user/[0-9]*/pulse/ w, 81 | owner /run/user/[0-9]*/pulse/ r, 82 | owner /run/user/[0-9]*/ksocket-*/{,**} rwkl, 83 | owner /run/user/[0-9]*/bomi* rwkl, 84 | owner /{dev,run,var/run}/shm/pulse-shm* rk, 85 | /{dev,run,var/run}/shm/pulse-shm* rw, 86 | /run/systemd/journal/socket rw, 87 | /run/dbus/system_bus_socket rw, 88 | 89 | deny /run/udev/data/{,**} rwklmx, 90 | audit deny owner /**/*.py* r, # Block Python imports 91 | audit deny /@{DATA_DIR}/**.py* r, 92 | 93 | signal (send) set=(term) peer=unconfined, 94 | 95 | dbus (send) 96 | bus=system 97 | path=/org/freedesktop/DBus 98 | interface=org.freedesktop.DBus 99 | member={Hello,AddMatch,RemoveMatch,GetNameOwner,NameHasOwner} 100 | peer=(name=org.freedesktop.DBus), 101 | } 102 | -------------------------------------------------------------------------------- /unmaintained/usr.bin.kget: -------------------------------------------------------------------------------- 1 | # Author: Nibaldo Gonzalez 2 | # Last change: December 05, 2017 3 | 4 | include 5 | include 6 | 7 | # NOTE: By default, there is only write access to the download directories. 8 | 9 | # Downloads directories: 10 | @{DOWNLOADS_DIR} = @{HOME}/Descargas 11 | 12 | /usr/bin/kget { 13 | include 14 | include 15 | include 16 | include 17 | include 18 | include 19 | include 20 | include 21 | include 22 | include 23 | 24 | # Blocks binaries, precompiled libraries, access to camera and microphone, etc. 25 | include 26 | 27 | # Block full access to sensitive data, as passwords and keys. 28 | # Includes /boot/**, /var/log/** & /etc/apparmor.d/** directories. View in: tunables/confidential. 29 | include 30 | 31 | # Needed to open links (only for some Web browsers/e-mail clients). 32 | include 33 | include 34 | 35 | # Required to open downloaded files. 36 | include 37 | 38 | # Downloads & Home directories 39 | owner @{DOWNLOADS_DIR}/** rw, 40 | owner @{HOME}/{,**} r, 41 | 42 | # KGet configuration 43 | owner @{HOME}/.config/kget/{,**} rw, 44 | owner @{HOME}/.cache/kget/{,**} rw, 45 | owner @{HOME}/.local/share/kget/{,**} rw, 46 | owner @{HOME}/.kde{,4}/share/apps/kget/{,**} rw, 47 | owner @{HOME}/.kde{,4}/share/config/kget* rw, 48 | 49 | owner @{HOME}/.kde{,4}/share/config/{kde,kio,konqueror}* rwk, 50 | owner @{HOME}/.kde{,4}/share/apps/kconf_update/** rw, 51 | owner @{HOME}/.kde{,4}/share/config/kconf_updaterc* rw, 52 | owner @{HOME}/.config/Trolltech.conf k, 53 | owner @{HOME}/.config/kde.org/libphonon.conf rk, 54 | owner @{HOME}/.cache/icon-cache.kcache rw, 55 | owner @{HOME}/.local/share/user-places.xbel{,.[a-zA-Z0-9]*} rw, 56 | owner @{HOME}/.local/share/RecentDocuments/*.desktop rwl, 57 | owner @{HOME}/.local/share/RecentDocuments/{,*.desktop}.[a-zA-Z0-9]* rwk, 58 | owner @{HOME}/.local/share/qt_temp.* rwk, 59 | owner @{HOME}/.kde/tmp-* rwk, 60 | 61 | /{,**/} r, # Read only directories 62 | 63 | # Binaries 64 | /usr/bin/kget r, 65 | /bin/dash ixr, 66 | /usr/bin/kdeinit{4,5} ixr, 67 | /usr/bin/kde-open{,5} ixr, 68 | /usr/bin/{exo,gnome,gvfs,xdg}-open ixr, 69 | /usr/bin/kdialog ixr, 70 | /usr/bin/kbuildsycoca4 ixr, 71 | /usr/bin/knotify4 ixr, 72 | /usr/bin/kde4-config Cxr -> sanitized_helper, 73 | /usr/bin/khelpcenter Cxr -> sanitized_helper, 74 | /usr/bin/pulseaudio Pixr, 75 | 76 | # Allow exec of libexec applications 77 | /usr/lib{,64}/** Pixr, 78 | 79 | /usr/share/** r, 80 | 81 | /etc/fstab r, 82 | /etc/pulse/*.conf r, 83 | /etc/timezone r, 84 | /etc/udev/udev.conf r, 85 | /etc/xdg/{,**} r, 86 | /etc/xdg/Trolltech.conf rk, 87 | 88 | owner @{PROC}/@{pid}/{mounts,maps} r, 89 | /sys/devices/**/uevent r, 90 | /sys/devices/pci[0-9]**/vendor r, 91 | /proc/sys/kernel/core_pattern r, 92 | 93 | # Temporal files and sockets 94 | 95 | owner /tmp/qt_temp.* rwlk, 96 | owner /{,var/}tmp/kde-*/{,**} rwlk, 97 | owner /{,var/}tmp/kdecache-*/** rwk, 98 | owner /{,var/}tmp/{,.}kget*.lock rwk, 99 | owner /run/user/[0-9]*/{,ksocket-*/}{,kget*,kdeinit*,klauncher*,kio*,*.slave-socket} rwk, 100 | owner /run/user/[0-9]*/pulse/{,**} rwk, 101 | /run/dbus/system_bus_socket rw, 102 | /{dev,run,var/run}/shm/pulse-shm* rw, 103 | owner /{dev,run,var/run}/shm/pulse-shm* k, 104 | 105 | /dev/tty r, 106 | /dev/snd/control* r, 107 | 108 | deny /usr/lib{,64}/vlc/plugins/plugins.dat.* w, 109 | 110 | signal (send) set=(term) peer=unconfined, 111 | unix (send, receive) type=(stream) peer=(label=@{profile_name}//sanitized_helper addr=none), 112 | } 113 | 114 | # kate: syntax AppArmor Security Profile 115 | # vim: syntax=apparmor 116 | -------------------------------------------------------------------------------- /unmaintained/usr.bin.konversation: -------------------------------------------------------------------------------- 1 | # Author: Nibaldo Gonzalez 2 | # Last change: February 26, 2017 3 | 4 | include 5 | include 6 | 7 | # NOTE: By default, there is only write access to the download & log directory. 8 | 9 | # Downloads & Logs directories: 10 | @{DOWNLOADS_DIR} = @{HOME}/Descargas 11 | @{LOGS_DIR} = @{HOME}/logs 12 | 13 | profile konversation /usr/bin/konversation { 14 | include 15 | include 16 | include 17 | include 18 | include 19 | include 20 | include 21 | include 22 | include 23 | include 24 | include 25 | 26 | include 27 | include 28 | 29 | # Blocks binaries, precompiled libraries, access to camera and microphone, etc. 30 | include 31 | 32 | # Block full access to sensitive data, as passwords and keys. 33 | # Includes /boot/**, /var/log/** & /etc/apparmor.d/** directories. View in: tunables/confidential. 34 | include 35 | 36 | # Needed to open links (only for some Web browsers/e-mail clients). 37 | include 38 | include 39 | 40 | # Write access to the download & log directory 41 | owner @{DOWNLOADS_DIR}/** rw, # Downloads directory 42 | owner @{LOGS_DIR}/{,**} rw, # Logs directory 43 | owner @{HOME}/*.log rw, 44 | 45 | # Konversation Configuration 46 | owner @{HOME}/.config/* rk, 47 | owner @{HOME}/.config/konversation* wl, 48 | owner @{HOME}/.config/{k*.lock,.[a-zA-Z0-9]*,\#[0-9]*} wl, 49 | owner @{HOME}/.config/{KDE,kde,kde.org}/{,**} rk, 50 | owner @{HOME}/.config/session/{,**} rwkl, 51 | owner @{HOME}/.kde{,4}/** r, 52 | owner @{HOME}/.kde{,4}/share/config/konversation* wk, 53 | owner @{HOME}/.local/share/{,**} r, 54 | owner @{HOME}/.local/share/konversation/{,**} wk, 55 | owner @{HOME}/.local/share/**/konversation/{,**} wk, 56 | owner @{HOME}/.local/share/RecentDocuments/{*.desktop*,.[a-zA-Z0-9]*} wk, 57 | owner @{HOME}/.cache/* rwk, 58 | owner @{HOME}/.cache/konversation/{,**} rwk, 59 | 60 | # Binaries 61 | /usr/bin/konversation ixr, 62 | /usr/bin/khelpcenter Cxr -> sanitized_helper, 63 | /usr/bin/dolphin PUx, 64 | /usr/bin/* Pixr, 65 | 66 | # Allow exec of libexec applications 67 | /usr/lib{,64}/** Pixr, 68 | 69 | /usr/share/** r, 70 | /etc/xdg/** r, 71 | /etc/udev/** r, 72 | /etc/machine-id r, 73 | /etc/ssl/openssl.cnf r, 74 | /etc/timezone r, 75 | 76 | @{PROC}/sys/kernel/core_pattern r, 77 | /sys/{bus,class,devices,udev}/** r, 78 | /dev/tty r, 79 | /dev/{ati,dri}/{,**} r, 80 | 81 | # Temp files 82 | owner /{,var/}tmp/kdecache-*/** rwk, 83 | owner /{,var/}tmp/kde-*/** rwk, 84 | owner /tmp/{,.}k*.{lock,tmp} rwk, 85 | owner /run/user/[0-9]*/k*-socket rwkl, 86 | owner /run/user/[0-9]*/\#[0-9]* rwkl, 87 | 88 | deny /usr/lib{,64}/vlc/plugins/plugins.dat.* w, 89 | 90 | signal (send) set=(term) peer=unconfined, 91 | unix (send, receive) type=(stream) peer=(label=@{profile_name}//sanitized_helper addr=none), 92 | } 93 | 94 | # kate: syntax AppArmor Security Profile 95 | # vim: syntax=apparmor 96 | -------------------------------------------------------------------------------- /unmaintained/usr.bin.ktorrent4: -------------------------------------------------------------------------------- 1 | # vim:syntax=apparmor 2 | # Author: Nibaldo Gonzalez 3 | # Last change: August 19, 2017 4 | 5 | # KTorrent 4 6 | 7 | # NOTE: 8 | # - This profile is more restrictive than 9 | # the one provided in . 10 | # - This profile is only tested on Ubuntu 16.04 & KDE Plasma 5. 11 | 12 | include 13 | include 14 | 15 | # - Important: Check & change the torrents directory 16 | # according to KTorrent configuration. 17 | # - By default, there is only write access to the torrent directory. 18 | 19 | # Torrents directory. Modify according to KTorrent configuration. 20 | @{TORRENTS_DIR}=@{HOME}/Descargas/Torrents 21 | 22 | /usr/bin/ktorrent { 23 | include 24 | include 25 | include 26 | include 27 | include 28 | include 29 | include 30 | include 31 | 32 | # Blocks binaries, precompiled libraries, access to camera and microphone, etc. 33 | include 34 | 35 | # Block full access to sensitive data, as passwords and keys. 36 | # Includes /boot/**, /var/log/** & /etc/apparmor.d/** directories. View in: tunables/confidential. 37 | include 38 | 39 | # Needed to open links (only for some Web browsers/e-mail clients). 40 | include 41 | include 42 | 43 | # Required to open downloaded files. 44 | include 45 | 46 | # Access to Home 47 | owner @{TORRENTS_DIR}/{,**} rw, # Just read/write in the Torrents directory 48 | owner @{HOME}/**.[tT][oO][rR][rR][eE][nN][tT] r, # Only read .torrent files 49 | 50 | # KTorrent configuration 51 | owner @{HOME}/.kde{,4}/share/apps/ktorrent/{,**} rwk, 52 | owner @{HOME}/.kde{,4}/share/config/ktorrent* rwk, 53 | owner @{HOME}/.kde{,4}/share/config/{kde,kio}* rk, # kdeglobals 54 | owner @{HOME}/.kde{,4}/share/config/kdebugrc w, 55 | owner @{HOME}/.kde{,4}/share/config/ktinfowidgetpluginrc rwk, 56 | owner @{HOME}/.kde{,4}/share/config/kcookiejarrc r, 57 | owner @{HOME}/.kde{,4}/share/config/breezerc r, 58 | owner @{HOME}/.kde{,4}/share/config/ktimezonedrc r, 59 | owner @{HOME}/.kde{,4}/share/config/*.new rwk, 60 | owner @{HOME}/.local/share/user-places.xbel{,.*} rw, 61 | owner @{HOME}/.kde{,4}/socket-* rwkl, 62 | owner @{HOME}/.kde{,4}/share/config/kconf_updaterc r, 63 | owner @{HOME}/.kde{,4}/share/config/phonondevicesrc r, 64 | owner @{HOME}/.config/menus/applications-kmenuedit.menu r, 65 | 66 | # Binaries 67 | /usr/bin/ktorrent r, 68 | /bin/dash ixr, 69 | /usr/bin/kdeinit{4,5} ixr, 70 | /usr/bin/kde-open{,5} ixr, 71 | /usr/bin/kdialog ixr, 72 | /usr/bin/xdg-open ixr, 73 | /usr/bin/gnome-open ixr, 74 | /usr/bin/gvfs-open ixr, 75 | /usr/bin/kbuildsycoca4 ixr, 76 | /usr/bin/knotify4 ixr, 77 | /usr/bin/kde4-config Cxr -> sanitized_helper, 78 | /usr/bin/khelpcenter Cxr -> sanitized_helper, 79 | /usr/bin/pulseaudio Pix, 80 | 81 | # Libexec 82 | /usr/lib{,64}/kde4/libexec/{,**} r, 83 | /usr/lib{,64}/kde4/libexec/** Pix, 84 | 85 | # Libraries 86 | /usr/lib{,64}/libktorrent.so.* mr, 87 | /usr/lib{,64}/kde4/*.so mr, # ktinfowidgetplugin.so 88 | 89 | /{,**/} r, # Read only directories 90 | 91 | /usr/share/kde4/apps/ktorrent/{**,} r, 92 | /usr/share/kde4/config/{,**} r, 93 | /usr/share/kde4/services/{,**} r, 94 | /usr/share/kde4/servicetypes/* r, 95 | /usr/share/kde4/apps/kde*/** r, 96 | /usr/share/GeoIP/* r, 97 | /usr/share/desktop-directories/kde-*.directory r, 98 | /usr/share/applications/kde{,4}/*.desktop r, 99 | 100 | /etc/xdg/{,**} r, 101 | deny /etc/xdg/{autostart,systemd}/{,**} rw, 102 | /etc/xdg/Trolltech.conf k, 103 | # /etc/fstab r, # Used, but not essential 104 | /etc/machine-id r, 105 | /etc/udev/udev.conf r, 106 | /etc/pulse/client.conf r, 107 | /etc/timezone r, 108 | 109 | @{PROC}/*/mounts r, 110 | /run/dbus/system_bus_socket rw, 111 | /sys/devices/**/uevent r, 112 | 113 | # Temp files 114 | owner /run/user/[0-9]*/ksocket-*/{,ktorrent*,kdeinit*,klauncher*,kio_http_cache_*} rwk, 115 | owner /tmp/{,.}ktorrent*.lock rwk, 116 | owner /tmp/kde-*/{,**} rwk, 117 | owner /var/tmp/kdecache-*/{,*} rwk, 118 | 119 | signal (send) set=(term) peer=unconfined, 120 | #unix (send, receive) type=(stream) protocol=0 peer=(addr=none), 121 | 122 | dbus (send) 123 | bus=system 124 | path=/org/freedesktop/DBus 125 | interface=org.freedesktop.DBus 126 | member=Hello 127 | peer=(name=org.freedesktop.DBus label=unconfined), 128 | 129 | dbus (send) 130 | bus=system 131 | path=/org/freedesktop/UPower 132 | interface=org.freedesktop.DBus.Introspectable 133 | member=Introspect 134 | peer=(name=org.freedesktop.UPower label=unconfined), 135 | 136 | dbus (send) 137 | bus=system 138 | path=/org/freedesktop/UDisks2/{block_devices,drives}{,/**} 139 | interface=org.freedesktop.DBus.Introspectable 140 | member=Introspect 141 | peer=(name=org.freedesktop.UDisks2 label=unconfined), 142 | 143 | dbus (send) 144 | bus=system 145 | path=/org/freedesktop/UDisks2/{block_devices,drives}{,/**} 146 | interface=org.freedesktop.DBus.Properties 147 | member={GetAll,Get,PropertiesChanged} 148 | peer=(name=org.freedesktop.UDisks2 label=unconfined), 149 | 150 | dbus (send) 151 | bus=system 152 | path=/org/freedesktop/NetworkManager 153 | interface=org.freedesktop.DBus.Introspectable 154 | member=Introspect 155 | peer=(name=org.freedesktop.NetworkManager label=unconfined), 156 | dbus (send) 157 | bus=system 158 | path=/org/freedesktop/NetworkManager 159 | interface=org.freedesktop.NetworkManager 160 | member={Introspect,state} 161 | peer=(name=org.freedesktop.NetworkManager label=unconfined), 162 | } 163 | -------------------------------------------------------------------------------- /unmaintained/usr.bin.vlc-2.2: -------------------------------------------------------------------------------- 1 | # Author: Nibaldo Gonzalez 2 | # Last change: February 14, 2018 3 | 4 | # NOTE: 5 | # This profile is only tested in VLC 2.2, 6 | # on Ubuntu 16.04 with KDE Plasma 5. 7 | 8 | include 9 | include 10 | include 11 | 12 | # Directories where multimedia and data are stored 13 | @{DATA_DIR} = /{data,home,media,mnt,srv,net,cdrom} 14 | 15 | profile vlc /usr/bin/vlc { 16 | include 17 | include 18 | include 19 | include 20 | include 21 | include 22 | include 23 | include 24 | include 25 | include 26 | 27 | include 28 | include 29 | 30 | # Block full access to sensitive data, as passwords and keys. 31 | # Includes /boot/**, /var/log/** & /etc/apparmor.d/** directories. View in: tunables/confidential. 32 | include 33 | 34 | # Needed to open links (only for some browsers). 35 | include 36 | 37 | /{,**/} r, # Read all directories 38 | 39 | # Read access in Home directory, mounted drives and networks 40 | @{DATA_DIR}/** r, 41 | deny /media/*/[Ww]indows/{Program*,Windows}/{,**} w, 42 | 43 | # VLC configuration 44 | owner @{HOME}/.local/share/vlc/{,**} rw, 45 | owner @{HOME}/.config/vlc/{,**} rwk, 46 | owner @{HOME}/.config/vlcrc{,.[a-zA-Z0-9]*} rwk, 47 | owner @{HOME}/.cache/vlc/{,**} rwk, 48 | 49 | # Local configuration 50 | include 51 | owner @{HOME}/.config/kio* r, 52 | owner @{HOME}/.config/kdebugrc rw, 53 | owner @{HOME}/.config/ibus/ rw, 54 | owner @{HOME}/.config/ibus/bus/{,*} rw, 55 | 56 | /usr/share/** r, 57 | 58 | /etc/xdg/** r, 59 | /etc/adduser.conf r, 60 | /etc/anacrontab r, 61 | /etc/appstream.conf r, 62 | /etc/bash.bashrc r, 63 | /etc/bash_completion r, 64 | /etc/fstab r, 65 | /etc/udev/udev.conf r, 66 | /etc/vdpau_wrapper.cfg r, 67 | 68 | @{PROC}/sys/vm/overcommit_memory r, 69 | owner @{PROC}/@{pid}/{cmdline,mountinfo,mounts,stat,status,vmstat} r, 70 | owner @{PROC}/@{pid}/task/[0-9]*/stat r, 71 | 72 | /sys/devices/**/uevent r, 73 | /sys/devices/pci[0-9]*/**/{busnum,config,revision} r, 74 | /sys/devices/pci[0-9]*/**/{,subsystem_}{device,vendor} r, 75 | /sys/devices/pci[0-9]*/**/id{Product,Vendor} r, 76 | /sys/devices/system/**/meminfo r, 77 | 78 | # Libraries and binaries 79 | /usr/bin/vlc ixr, 80 | /usr/bin/{dbus-send,xdg-screensaver,xset} Pixr, 81 | /usr/bin/{exo,gnome,gvfs,xdg}-open ixr, 82 | /usr/bin/kde-open{,5} ixr, 83 | /usr/bin/kdeinit{4,5} ixr, 84 | /usr/bin/kdialog ixr, 85 | 86 | /usr/lib{,64,/@{multiarch}}/qt5/plugins/{,**/}*.so m, 87 | /usr/lib{,64}/libvlc*.so{,.*} m, 88 | /usr/lib{,64}/vlc/**.so{,.*} m, 89 | deny /usr/lib{,64}/vlc/plugins/plugins.dat.* w, 90 | 91 | /dev/{ati,dri}/{,**} r, 92 | /dev/{fb,video,audio}* r, 93 | /dev/{sg,sr}* r, 94 | /dev/tty r, 95 | 96 | # Temporal files & sockets 97 | owner /tmp/xauth-* r, 98 | owner /tmp/vl[ct]** rwk, 99 | owner /run/user/[0-9]*/vlc* rwk, 100 | /run/dbus/system_bus_socket rw, 101 | /run/systemd/journal/socket rw, 102 | 103 | # Block compiled libraries & executables 104 | audit deny owner /**/* mx, 105 | audit deny /@{DATA_DIR}/** mx, 106 | 107 | deny /run/udev/data/** rwklmx, 108 | deny owner /**/*.py* rw, 109 | deny /@{DATA_DIR}/**.py* rw, 110 | deny owner @{HOME}/.recently-used.xbel* rw, 111 | deny owner @{HOME}/.local/share/recently-used.xbel* rw, 112 | deny @{HOME}/.bash_history rw, 113 | 114 | unix (connect, receive, send) type=(stream) peer=(label=unconfined addr=@/tmp/ibus/dbus-*), 115 | # unix (send, receive) type=(stream) protocol=0 peer=(addr=none), 116 | signal (send) set=(term) peer=unconfined, 117 | 118 | dbus (send) 119 | bus=system 120 | path=/org/freedesktop/NetworkManager 121 | member=state, 122 | dbus (receive) 123 | bus=system 124 | path=/org/freedesktop/NetworkManager, 125 | 126 | # Screenshots 127 | owner @{HOME}/**?.[pP][nN][gG] rw, # png 128 | owner @{HOME}/**?.[jJ][pP][gG] rw, # jpg 129 | owner @{HOME}/**?.[tT][iI][fF][fF] rw, # tiff 130 | 131 | # Files supported: 132 | /**?.@{MEDIA_EXT} r, 133 | @{DATA_DIR}/**?.@{MEDIA_EXT} rw, 134 | 135 | /**?.[iI][sS][oO] r, # iso 136 | /**?.[zZ][iI][pP] r, # zip 137 | /**?.[rR][aA][rR] r, # rar 138 | } 139 | 140 | # kate: syntax AppArmor Security Profile 141 | # vim: syntax=apparmor 142 | --------------------------------------------------------------------------------