Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / man / caspol.1
1 .\" 
2 .\" caspol manual page.
3 .\" Copyright (C) 2004 Novell, Inc (http://www.novell.com)
4 .\" Author:
5 .\"   Sebastien Pouliot (sebastien@ximian.com)
6 .\"
7 .TH Mono "caspol"
8 .SH NAME
9 caspol \- Command line tool to modify Code Access Security policies.
10 .SH SYNOPSIS
11 .PP
12 .B caspol [options] [policy level] [actions] [parameters] ... 
13 .SH DESCRIPTION
14 This tool allows to list and modify the different policy levels (user, 
15 machine and enterprise).
16 .SH OPTIONS
17 .TP
18 .I -q[uiet]
19 Do not ask confirmation to change the policy level.
20 .TP
21 .I -f[orce]
22 Caspol.exe is a managed tool. Changing the security policies could affect
23 it's ability to work properly. This option permits changes that could 
24 disallow caspol.exe from working properly.
25 .TP
26 .I -? | /? | -h[elp]
27 Display help about the Code Access Security policies tool
28
29 .SH POLICY LEVELS
30 .TP
31 .I -en[terprise]
32 Use the enterprise policy level for the next actions
33 .TP
34 .I -m[achine]
35 Use the machine policy level for the next actions. This is the default
36 level for administrators (i.e. with write access to the machine policy
37 files).
38 .TP
39 .I -u[ser]
40 Use the user policy level for the next actions. This is the default 
41 level for users (i.e. without write access to the machine policy files).
42 .TP
43 .I -ca policyfile | -customall policyfile
44 Use the specified file as the machine policy level for other arguments
45 Use the policy levels Enterprise, Machine and the custom (specified)
46 user policy level for the next actions
47 .TP
48 .I -cu[stomuser] policyfile
49 Use the specified file as the user policy level for next actions
50 .TP
51 .I -a[ll]
52 Use all the policy levels (Enterprise, Machine and User) for the next 
53 actions
54
55 .SH ACTIONS
56 .I -l[ist]
57 List all code groups in their hierarchical structure, all named 
58 permissions sets and all fully trusted assemblies
59 .TP
60 .I -ld | -listdescription
61 List all code groups, in their hierarchical structure, with their 
62 descriptions
63 .TP
64 .I -lg | -listgroups
65 List all the code groups in their hierarchical structure
66 .TP
67 .I -lp | -listpset
68 List all the permission sets including their names and XML representation
69 .TP
70 .I -lf | -listfulltrust
71 List all fully trusted assemblies
72
73 .TP
74 .I -rsg | -resolvegroup assemblyname
75 List all code groups that the assembly is part of for the policy level
76 .TP
77 .I -rsp | -resolveperm assemblyname
78 List all permissions granted to the specified assembly by the policy level
79
80 .TP
81 .I -ap | -addpset namedxmlfile | (xmlfile name)
82 Add a named permission set to the policy level
83 .TP
84 .I -cp | -chgpset xmlfile psetname
85 Change a named permission set in the policy level
86 .TP
87 .I -rp | -rempset psetname
88 Remove the specified named permission set from the policy level
89
90 .TP
91 .I -af | -addfulltrust assemblyname
92 Add the specified assembly to the fully trusted assembly list in the 
93 policy level. If a policy uses some custom security permissions then the
94 assembly containing the custom permissions must be in the fully trusted
95 list. Note that this requirement is recursive (all assemblies required 
96 by the specified assembly must also be in the list). The assembly must be
97 strongnamed to be included in the fully trusted list
98 .TP
99 .I -rf | -remfulltrust assemblyname
100 Remove the specified assembly from the fully trusted assembly list in the 
101 policy level
102
103 .TP
104 .I -ag | -addgroup label|name membership psetname flag
105 Add the specified code group with the supplied membership, permissions and
106 flags informations
107 .TP
108 .I -cg | -chggroup label|name membership|psetname|flag
109 Change the specified code group with the supplied informations
110 .TP
111 .I -rg | -remgroup label|name
112 Remove the specified code group
113
114 .TP
115 .I -r[ecover]
116 Recover from previous version of the policy level (if available)
117 .TP
118 .I -rs | -reset
119 Reset the current policy level to it's default - or to the .default file 
120 if available
121
122 .SH CONFIGURATION SETTINGS
123 .TP
124 .I -s[ecurity] on | off
125 Turn Code Access Security (CAS) on or off. Note: This doesn't affect 
126 non-CAS permissions
127 .TP
128 .I -e[xecution] on | off
129 Turn execution rights on or off
130 .TP
131 .I -b[uildcache]
132 Build a cache (serialized version) of the policy level (.CCH files)
133 .TP
134 .I -pp | -polchgprompt on | off
135 Turn on or off policy changes prompt for future commands
136
137 .SH GROUPS SUB OPTIONS - MEMBERSHIP
138 .TP
139 .I -all
140 This condition applies to all code.
141 .TP
142 .I -appdir
143 This condition applies only for assemblies that URL evidence match the
144 application directory.
145 .TP
146 .I -custom xmlfile
147 Use the option to load a custom condition into the policy. The class that
148 will deserialize the XML policy must be in a fully trusted assembly.
149 .TP
150 .I -hash algo [-hex hash | -file assemblyname]
151 This condition specifies a specific hash that an assembly must generate
152 (from itself) to be satisfied. Any change to the assembly will require the
153 policy to be updated (as the hash value will have changed).
154 .TP
155 .I -pub [-cert certificate | -file signedfile | -hex rawdata]
156 This condition specifies a X.509 Authenticode(r) certificate that must have 
157 signed an assembly in order to be satisfied. The certificate can be referenced
158 as a file (binary DER), a signed file (containing the certificate) or with
159 the hexadecimal value of the certificate. Note that files outside the 
160 policy must also be protected against tempering.
161 .TP
162 .I -strong -file filename [name | -noname] [version | -noversion]
163 This condition specifies a specific StrongName that must have signed an
164 assembly to be satisfied. Use -noname if the assembly name isn't known
165 (or important) and -version if the version isn't known (or important) in
166 the resolution.
167 .TP
168 .I -site hostname
169 This condition specifies the site from where the assembly must come from to 
170 be satisfied.
171 .TP
172 .I -url URL
173 This condition specifies the URL from where the assembly must come from to 
174 be satisfied.
175 .TP
176 .I -zone zonename
177 This condition specifies the zone from where the assembly must come from to 
178 be satisfied. Existing zones are MyComputer, Internet, Intranet, Trusted 
179 and Untrusted.
180
181 .SH GROUPS SUB OPTIONS - FLAGS
182 .TP
183 .I -d[escription] description
184 Add (-ag) or change (-cg) the description for the specified code group
185 .TP
186 .I -exclusive on | off
187 If on (default is off) then only this permission set will be processed
188 for this code group (on this level).
189 .TP
190 .I -levelfinal on | off
191 If on (default is off) then no other level will be processed for this 
192 code group.
193 .TP
194 .I -n[ame] name
195 Add (-ag) or change (-cg) the name of the specified code group. A code
196 group can be found by using it's name or it's label - but the later can
197 change as it is based on it's position in the policy level hierarchy.
198
199 .SH EXAMPLES
200 .TP
201 It is possible to chain several commands with the tool, like:
202 .TP
203 .B caspol -m -lg -rg 1.6 -lg -rs -lg
204 .TP
205 This will list all machine level code groups, then remove the code group
206 labeled 1.6, list again all code groups (missing 1.6), reset the policy
207 and finally show all code groups (where 1.6 is back).
208
209 .SH KNOWN ISSUES
210 .TP
211 .B Hash Membership Condition
212 Mono implementation of the Hash evidence isn't compatible with Fx 1.0/1.1.
213 However it seems compatible with Fx 2.0. You are suggested to use a 
214 StrongName evidence if comptaibility is an issue for your policy.
215
216 .SH AUTHOR
217 Written by Sebastien Pouliot
218 .SH COPYRIGHT
219 Copyright (C) 2004 Novell, Inc (http://www.novell.com)
220 .SH MAILING LISTS
221 Visit http://lists.ximian.com/mailman/listinfo/mono-list for details.
222 .SH WEB SITE
223 Visit http://www.mono-project.com for details