1 <?xml version="1.0" encoding="UTF-8"?>
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>
12 Configure ImageMagick policies.
14 Domains include system, delegate, coder, filter, path, or resource.
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.
19 Use a glob expression as a pattern.
21 Suppose we do not want users to process MPEG video images:
23 <policy domain="delegate" rights="none" pattern="mpeg:decode" />
25 Here we do not want users reading images from HTTP:
27 <policy domain="coder" rights="none" pattern="HTTP" />
29 Lets prevent users from executing any image filters:
31 <policy domain="filter" rights="none" pattern="*" />
33 The /repository file system is restricted to read only. We use a glob
34 expression to match all paths that start with /repository:
36 <policy domain="path" rights="read" pattern="/repository/*" />
38 Any large image is cached to disk rather than memory:
40 <policy domain="resource" name="area" value="1gb"/>
42 Note, resource policies are maximums for each instance of ImageMagick (e.g.
43 policy memory limit 1GB, -limit 2GB exceeds policy maximum so memory limit
47 <!-- <policy domain="system" name="precision" value="6"/> -->
48 <!-- <policy domain="resource" name="temporary-path" value="/tmp"/> -->
49 <!-- <policy domain="resource" name="memory" value="2GiB"/> -->
50 <!-- <policy domain="resource" name="map" value="4GiB"/> -->
51 <!-- <policy domain="resource" name="area" value="1gb"/> -->
52 <!-- <policy domain="resource" name="disk" value="16eb"/> -->
53 <!-- <policy domain="resource" name="file" value="768"/> -->
54 <!-- <policy domain="resource" name="thread" value="4"/> -->
55 <!-- <policy domain="resource" name="throttle" value="0"/> -->
56 <!-- <policy domain="resource" name="time" value="3600"/> -->