blob: b4ee2d23acc68efa3c08c26d74a494d5b972a534 [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE policymap [
3<!ELEMENT policymap (policy)+>
4<!ELEMENT policy (#PCDATA)>
5<!ATTLIST policy domain (delegate|coder|filter|path|resource) #IMPLIED>
6<!ATTLIST policy name CDATA #IMPLIED>
7<!ATTLIST policy rights CDATA #IMPLIED>
8<!ATTLIST policy pattern CDATA #IMPLIED>
9<!ATTLIST policy value CDATA #IMPLIED>
10]>
11<!--
cristy1ca3eb32009-10-15 18:41:54 +000012 Configure ImageMagick policies.
cristy3ed852e2009-09-05 21:47:34 +000013
cristy7ce14bc2010-01-17 00:01:01 +000014 Domains include system, delegate, coder, filter, path, or resource.
cristy3ed852e2009-09-05 21:47:34 +000015
16 Rights include none, read, write, and execute. Use | to combine them,
17 for example: "read | write" to permit read from, or write to, a path.
18
19 Use a glob expression as a pattern.
20
21 Suppose we do not want users to process MPEG video images:
22
23 <policy domain="delegate" rights="none" pattern="mpeg:decode" />
24
25 Here we do not want users reading images from HTTP:
26
27 <policy domain="coder" rights="none" pattern="HTTP" />
28
29 Lets prevent users from executing any image filters:
30
31 <policy domain="filter" rights="none" pattern="*" />
32
cristy3d2342a2011-05-16 00:14:21 +000033 The /repository file system is restricted to read only. We use a glob
cristy3ed852e2009-09-05 21:47:34 +000034 expression to match all paths that start with /repository:
cristya86d3612012-12-14 14:47:26 +000035
cristy3ed852e2009-09-05 21:47:34 +000036 <policy domain="path" rights="read" pattern="/repository/*" />
37
38 Any large image is cached to disk rather than memory:
39
cristy099a7352011-11-09 14:31:35 +000040 <policy domain="resource" name="area" value="1GB"/>
cristy652316c2010-11-23 13:49:46 +000041
cristy78fe9ee2014-12-21 23:24:10 +000042 Define arguments for the memory, map, area, width, height and disk resources
43 with SI prefixes (.e.g 100MB). In addition, resource policies are maximums
44 for each instance of ImageMagick (e.g. policy memory limit 1GB, -limit 2GB
cristy207d6a62012-03-03 01:19:16 +000045 exceeds policy maximum so memory limit is 1GB).
cristy3ed852e2009-09-05 21:47:34 +000046-->
47<policymap>
cristy3ed852e2009-09-05 21:47:34 +000048 <!-- <policy domain="resource" name="temporary-path" value="/tmp"/> -->
cristybdf5e0e2010-11-23 13:55:08 +000049 <!-- <policy domain="resource" name="memory" value="2GiB"/> -->
50 <!-- <policy domain="resource" name="map" value="4GiB"/> -->
cristy327f5912015-01-03 18:43:18 +000051 <!-- <policy domain="resource" name="width" value="10MP"/> -->
52 <!-- <policy domain="resource" name="height" value="10MP"/> -->
cristy099a7352011-11-09 14:31:35 +000053 <!-- <policy domain="resource" name="area" value="1GB"/> -->
54 <!-- <policy domain="resource" name="disk" value="16EB"/> -->
cristy3ed852e2009-09-05 21:47:34 +000055 <!-- <policy domain="resource" name="file" value="768"/> -->
cristy85c50a32010-11-23 13:59:34 +000056 <!-- <policy domain="resource" name="thread" value="4"/> -->
cristy6ebe97c2010-07-03 01:17:28 +000057 <!-- <policy domain="resource" name="throttle" value="0"/> -->
cristy3ed852e2009-09-05 21:47:34 +000058 <!-- <policy domain="resource" name="time" value="3600"/> -->
cristya38bc6c2013-01-08 16:50:44 +000059 <!-- <policy domain="system" name="precision" value="6"/> -->
cristyb7516c02013-01-14 13:58:17 +000060 <policy domain="cache" name="shared-secret" value="passphrase"/>
cristy3ed852e2009-09-05 21:47:34 +000061</policymap>