Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

473 lines
19 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996 - 1999
  5. //
  6. // File: certacl.h
  7. //
  8. // Contents: Cert Server security defines
  9. //
  10. //---------------------------------------------------------------------------
  11. #ifndef __CERTACL_H__
  12. #define __CERTACL_H__
  13. #include <sddl.h>
  14. #include "clibres.h"
  15. #include "certsd.h"
  16. // externs
  17. // externs
  18. extern const GUID GUID_APPRV_REQ;
  19. extern const GUID GUID_REVOKE;
  20. extern const GUID GUID_ENROLL;
  21. extern const GUID GUID_AUTOENROLL;
  22. extern const GUID GUID_READ_DB;
  23. //defines
  24. #define MAX_SID_LEN 256
  25. // !!! The SD strings below need to be in sync with certadm.idl definitions
  26. #define WSZ_CA_ACCESS_ADMIN L"0x00000001" // CA administrator
  27. #define WSZ_CA_ACCESS_OFFICER L"0x00000002" // certificate officer
  28. #define WSZ_CA_ACCESS_AUDITOR L"0x00000004" // auditor
  29. #define WSZ_CA_ACCESS_OPERATOR L"0x00000008" // backup operator
  30. #define WSZ_CA_ACCESS_MASKROLES L"0x000000ff"
  31. #define WSZ_CA_ACCESS_READ L"0x00000100" // read only access to CA
  32. #define WSZ_CA_ACCESS_ENROLL L"0x00000200" // enroll access to CA
  33. #define WSZ_CA_ACCESS_MASKALL L"0x0000ffff"
  34. // Important, keep enroll string GUID in sync with define in acl.cpp
  35. #define WSZ_GUID_ENROLL L"0e10c968-78fb-11d2-90d4-00c04f79dc55"
  36. #define WSZ_GUID_AUTOENROLL L"a05b8cc2-17bc-4802-a710-e7c15ab866a2"
  37. // ca access rights define here
  38. // note: need to keep string access and mask in sync!
  39. // WSZ_ACTRL_CERTSRV_MANAGE = L"CCDCLCSWRPWPDTLOCRSDRCWDWO"
  40. #define WSZ_ACTRL_CERTSRV_MANAGE SDDL_CREATE_CHILD \
  41. SDDL_DELETE_CHILD \
  42. SDDL_LIST_CHILDREN \
  43. SDDL_SELF_WRITE \
  44. SDDL_READ_PROPERTY \
  45. SDDL_WRITE_PROPERTY \
  46. SDDL_DELETE_TREE \
  47. SDDL_LIST_OBJECT \
  48. SDDL_CONTROL_ACCESS \
  49. SDDL_STANDARD_DELETE \
  50. SDDL_READ_CONTROL \
  51. SDDL_WRITE_DAC \
  52. SDDL_WRITE_OWNER
  53. #define ACTRL_CERTSRV_MANAGE (ACTRL_DS_READ_PROP | \
  54. ACTRL_DS_WRITE_PROP | \
  55. READ_CONTROL | \
  56. DELETE | \
  57. WRITE_DAC | \
  58. WRITE_OWNER | \
  59. ACTRL_DS_CONTROL_ACCESS | \
  60. ACTRL_DS_CREATE_CHILD | \
  61. ACTRL_DS_DELETE_CHILD | \
  62. ACTRL_DS_LIST | \
  63. ACTRL_DS_SELF | \
  64. ACTRL_DS_DELETE_TREE | \
  65. ACTRL_DS_LIST_OBJECT)
  66. #define WSZ_ACTRL_CERTSRV_MANAGE_LESS_CONTROL_ACCESS \
  67. SDDL_CREATE_CHILD \
  68. SDDL_DELETE_CHILD \
  69. SDDL_LIST_CHILDREN \
  70. SDDL_SELF_WRITE \
  71. SDDL_READ_PROPERTY \
  72. SDDL_WRITE_PROPERTY \
  73. SDDL_DELETE_TREE \
  74. SDDL_LIST_OBJECT \
  75. SDDL_STANDARD_DELETE \
  76. SDDL_READ_CONTROL \
  77. SDDL_WRITE_DAC \
  78. SDDL_WRITE_OWNER
  79. #define ACTRL_CERTSRV_MANAGE_LESS_CONTROL_ACCESS \
  80. (ACTRL_DS_READ_PROP | \
  81. ACTRL_DS_WRITE_PROP | \
  82. READ_CONTROL | \
  83. DELETE | \
  84. WRITE_DAC | \
  85. WRITE_OWNER | \
  86. ACTRL_DS_CREATE_CHILD | \
  87. ACTRL_DS_DELETE_CHILD | \
  88. ACTRL_DS_LIST | \
  89. ACTRL_DS_SELF | \
  90. ACTRL_DS_DELETE_TREE | \
  91. ACTRL_DS_LIST_OBJECT)
  92. // WSZ_ACTRL_CERTSRV_READ = L"RPLCLORC"
  93. #define WSZ_ACTRL_CERTSRV_READ SDDL_READ_PROPERTY \
  94. SDDL_LIST_CHILDREN \
  95. SDDL_LIST_OBJECT \
  96. SDDL_READ_CONTROL
  97. #define ACTRL_CERTSRV_READ (READ_CONTROL | \
  98. ACTRL_DS_READ_PROP | \
  99. ACTRL_DS_LIST | \
  100. ACTRL_DS_LIST_OBJECT)
  101. // WSZ_ACTRL_CERTSRV_ENROLL = L"WPRPCR"
  102. #define WSZ_ACTRL_CERTSRV_ENROLL SDDL_WRITE_PROPERTY \
  103. SDDL_READ_PROPERTY \
  104. SDDL_CONTROL_ACCESS
  105. #define ACTRL_CERTSRV_ENROLL (ACTRL_DS_READ_PROP | \
  106. ACTRL_DS_WRITE_PROP | \
  107. ACTRL_DS_CONTROL_ACCESS)
  108. #define WSZ_ACTRL_CERTSRV_CAADMIN SDDL_CONTROL_ACCESS
  109. #define WSZ_ACTRL_CERTSRV_OFFICER SDDL_CONTROL_ACCESS
  110. #define WSZ_ACTRL_CERTSRV_CAREAD SDDL_CONTROL_ACCESS
  111. #define ACTRL_CERTSRV_CAADMIN ACTRL_DS_CONTROL_ACCESS
  112. #define ACTRL_CERTSRV_OFFICER ACTRL_DS_CONTROL_ACCESS
  113. #define ACTRL_CERTSRV_CAREAD ACTRL_DS_CONTROL_ACCESS
  114. // define all ca string security here in consistant format
  115. // SDDL_OWNER L":" SDDL_ENTERPRISE_ADMINS \
  116. // SDDL_GROUP L":" SDDL_ENTERPRISE_ADMINS \
  117. // SDDL_DACL L":" SDDL_PROTECTED SDDL_AUTO_INHERITED \
  118. // L"(" SDDL_ACCESS_ALLOWED or SDDL_OBJECT_ACCESS_ALLOWED L";" \
  119. // SDDL_OBJECT_INHERIT SDDL_CONTAINER_INHERIT or list L";" \
  120. // list of AccessRights L";" \
  121. // StringGUID L";" \
  122. // L";" \
  123. // SDDL_EVERYONE or Sid L")"
  124. // ...list of ace
  125. #define CERTSRV_STD_ACE(access, sid) \
  126. L"(" SDDL_ACCESS_ALLOWED L";" \
  127. SDDL_OBJECT_INHERIT SDDL_CONTAINER_INHERIT L";" \
  128. access L";;;" sid L")"
  129. #define CERTSRV_INH_ACE(access, sid) \
  130. L"(" SDDL_ACCESS_ALLOWED L";" \
  131. SDDL_OBJECT_INHERIT SDDL_CONTAINER_INHERIT SDDL_INHERIT_ONLY L";" \
  132. access L";;;" sid L")"
  133. #define CERTSRV_OBJ_ACE(access, guid, sid) \
  134. L"(" SDDL_OBJECT_ACCESS_ALLOWED L";" \
  135. SDDL_OBJECT_INHERIT SDDL_CONTAINER_INHERIT L";" \
  136. access L";" \
  137. guid L";;" sid L")"
  138. #define CERTSRV_OBJ_ACE_DENY(access, guid, sid) \
  139. L"(" SDDL_OBJECT_ACCESS_DENIED L";" \
  140. SDDL_OBJECT_INHERIT SDDL_CONTAINER_INHERIT L";" \
  141. access L";" \
  142. guid L";;" sid L")"
  143. #define CERTSRV_STD_OG(owner, group) \
  144. SDDL_OWNER L":" owner SDDL_GROUP L":" group \
  145. SDDL_DACL L":" SDDL_AUTO_INHERITED
  146. #define CERTSRV_SACL_ON \
  147. SDDL_SACL L": (" SDDL_AUDIT L";" \
  148. SDDL_AUDIT_SUCCESS SDDL_AUDIT_FAILURE L";" \
  149. WSZ_CA_ACCESS_MASKALL L";;;" \
  150. SDDL_EVERYONE L")"
  151. #define CERTSRV_SACL_OFF \
  152. SDDL_SACL L":"
  153. #define WSZ_CERTSRV_SID_ANONYMOUS_LOGON L"S-1-5-7"
  154. #define WSZ_CERTSRV_SID_EVERYONE L"S-1-1-0"
  155. // Default Standalone security
  156. // Standalone
  157. // Owner, local administrators
  158. // Group, local administrators
  159. // DACL:
  160. // enroll - everyone
  161. // caadmin - builtin\administrators
  162. // officer - builtin\administrators
  163. #define WSZ_DEFAULT_CA_STD_SECURITY \
  164. CERTSRV_STD_OG(SDDL_BUILTIN_ADMINISTRATORS, SDDL_BUILTIN_ADMINISTRATORS) \
  165. CERTSRV_STD_ACE(WSZ_CA_ACCESS_ADMIN, SDDL_BUILTIN_ADMINISTRATORS) \
  166. CERTSRV_STD_ACE(WSZ_CA_ACCESS_OFFICER, SDDL_BUILTIN_ADMINISTRATORS) \
  167. CERTSRV_STD_ACE(WSZ_CA_ACCESS_ENROLL, SDDL_EVERYONE) \
  168. CERTSRV_SACL_ON
  169. // Default Enterprise Security
  170. // Owner, Enterprise Administrators
  171. // Group, Enterprise Administrators
  172. // DACL:
  173. // enroll - authenticated users
  174. // caadmin - builtin\administrators
  175. // - domain admins
  176. // - enterprise admins
  177. // officer - builtin\administrators
  178. // - domain admins
  179. // - enterprise admins
  180. #define WSZ_DEFAULT_CA_ENT_SECURITY \
  181. CERTSRV_STD_OG(SDDL_BUILTIN_ADMINISTRATORS, SDDL_BUILTIN_ADMINISTRATORS) \
  182. CERTSRV_STD_ACE(WSZ_CA_ACCESS_ADMIN, SDDL_BUILTIN_ADMINISTRATORS) \
  183. CERTSRV_STD_ACE(WSZ_CA_ACCESS_OFFICER, SDDL_BUILTIN_ADMINISTRATORS) \
  184. CERTSRV_STD_ACE(WSZ_CA_ACCESS_ADMIN, SDDL_DOMAIN_ADMINISTRATORS) \
  185. CERTSRV_STD_ACE(WSZ_CA_ACCESS_OFFICER, SDDL_DOMAIN_ADMINISTRATORS) \
  186. CERTSRV_STD_ACE(WSZ_CA_ACCESS_ADMIN, SDDL_ENTERPRISE_ADMINS) \
  187. CERTSRV_STD_ACE(WSZ_CA_ACCESS_OFFICER, SDDL_ENTERPRISE_ADMINS) \
  188. CERTSRV_STD_ACE(WSZ_CA_ACCESS_ENROLL, SDDL_AUTHENTICATED_USERS) \
  189. CERTSRV_SACL_ON
  190. // DS Container
  191. // (CDP/CA container)
  192. // Owner: Enterprise Admins (overidden by installer)
  193. // Group: Enterprise Admins (overidden by installer)
  194. // DACL:
  195. // Enterprise Admins - Full Control
  196. // Domain Admins - Full Control
  197. // Cert Publishers - Full Control
  198. // Builtin Admins - Full Control
  199. // Everyone - Read
  200. #define WSZ_DEFAULT_CA_DS_SECURITY \
  201. CERTSRV_STD_OG(SDDL_ENTERPRISE_ADMINS, SDDL_ENTERPRISE_ADMINS) \
  202. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE, SDDL_ENTERPRISE_ADMINS) \
  203. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE, SDDL_DOMAIN_ADMINISTRATORS) \
  204. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE, SDDL_CERT_SERV_ADMINISTRATORS) \
  205. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE, SDDL_BUILTIN_ADMINISTRATORS) \
  206. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_READ, SDDL_EVERYONE)
  207. // NTAuthCertificates
  208. //
  209. // Owner: Enterprise Admins (overidden by installer)
  210. // Group: Enterprise Admins (overidden by installer)
  211. // DACL:
  212. // Enterprise Admins - Full Control
  213. // Domain Admins - Full Control
  214. // Builtin Admins - Full Control
  215. // Everyone - Read
  216. #define WSZ_DEFAULT_NTAUTH_SECURITY \
  217. CERTSRV_STD_OG(SDDL_ENTERPRISE_ADMINS, SDDL_ENTERPRISE_ADMINS) \
  218. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE, SDDL_ENTERPRISE_ADMINS) \
  219. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE, SDDL_DOMAIN_ADMINISTRATORS) \
  220. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE, SDDL_BUILTIN_ADMINISTRATORS) \
  221. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_READ, SDDL_EVERYONE)
  222. // CDP/CA
  223. // Owner: Enterprise Admins (overidden by installer)
  224. // Group: Enterprise Admins (overidden by installer)
  225. // DACL:
  226. // Enterprise Admins - Full Control
  227. // Domain Admins - Full Control
  228. // Cert Publishers - Full Control
  229. // Builtin Admins- Full Control
  230. // Authenticated Users - Read
  231. #define WSZ_DEFAULT_CDP_DS_SECURITY \
  232. CERTSRV_STD_OG(SDDL_ENTERPRISE_ADMINS, SDDL_ENTERPRISE_ADMINS) \
  233. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE, SDDL_ENTERPRISE_ADMINS) \
  234. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE, SDDL_DOMAIN_ADMINISTRATORS) \
  235. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE, L"%ws") \
  236. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE, SDDL_BUILTIN_ADMINISTRATORS) \
  237. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_READ, SDDL_EVERYONE)
  238. // Shared Folder related security
  239. // Owner: Local Admin
  240. // DACL:
  241. // Local Admin - Full Control
  242. // LocalSystem - Full Control
  243. // Enterprise Admins - Full Control
  244. // Everyone - Read
  245. #define WSZ_DEFAULT_SF_SECURITY \
  246. CERTSRV_STD_OG(SDDL_BUILTIN_ADMINISTRATORS, SDDL_BUILTIN_ADMINISTRATORS) \
  247. CERTSRV_STD_ACE(SDDL_GENERIC_ALL, SDDL_BUILTIN_ADMINISTRATORS) \
  248. CERTSRV_STD_ACE(SDDL_GENERIC_ALL, SDDL_LOCAL_SYSTEM)
  249. #define WSZ_DEFAULT_SF_USEDS_SECURITY \
  250. CERTSRV_STD_OG(SDDL_BUILTIN_ADMINISTRATORS, SDDL_BUILTIN_ADMINISTRATORS) \
  251. CERTSRV_STD_ACE(SDDL_GENERIC_ALL, SDDL_BUILTIN_ADMINISTRATORS) \
  252. CERTSRV_STD_ACE(SDDL_GENERIC_ALL, SDDL_LOCAL_SYSTEM) \
  253. CERTSRV_STD_ACE(SDDL_GENERIC_ALL, SDDL_ENTERPRISE_ADMINS)
  254. #define WSZ_DEFAULT_SF_EVERYONEREAD_SECURITY \
  255. WSZ_DEFAULT_SF_SECURITY \
  256. CERTSRV_STD_ACE(SDDL_GENERIC_READ, SDDL_EVERYONE)
  257. #define WSZ_DEFAULT_SF_USEDS_EVERYONEREAD_SECURITY \
  258. WSZ_DEFAULT_SF_USEDS_SECURITY \
  259. CERTSRV_STD_ACE(SDDL_GENERIC_READ, SDDL_EVERYONE)
  260. // Enroll share security
  261. // Owner: Administrators
  262. // Group: Administrators
  263. // DACL:
  264. // Everyone: read access
  265. // local admin: full access
  266. #define WSZ_ACTRL_CERTSRV_SHARE_READ SDDL_FILE_READ \
  267. SDDL_READ_CONTROL \
  268. SDDL_GENERIC_READ \
  269. SDDL_GENERIC_EXECUTE
  270. #define WSZ_ACTRL_CERTSRV_SHARE_ALL SDDL_FILE_ALL \
  271. SDDL_CREATE_CHILD \
  272. SDDL_STANDARD_DELETE \
  273. SDDL_READ_CONTROL \
  274. SDDL_WRITE_DAC \
  275. SDDL_WRITE_OWNER \
  276. SDDL_GENERIC_ALL
  277. #define WSZ_DEFAULT_SHARE_SECURITY \
  278. CERTSRV_STD_OG(SDDL_BUILTIN_ADMINISTRATORS, SDDL_BUILTIN_ADMINISTRATORS) \
  279. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_SHARE_READ, SDDL_EVERYONE) \
  280. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_SHARE_ALL, SDDL_BUILTIN_ADMINISTRATORS)
  281. // Service string below need to be in sync with the following
  282. // definitions from winsvc.h
  283. //#define SERVICE_QUERY_CONFIG 0x0001
  284. //#define SERVICE_CHANGE_CONFIG 0x0002
  285. //#define SERVICE_QUERY_STATUS 0x0004
  286. //#define SERVICE_ENUMERATE_DEPENDENTS 0x0008
  287. //#define SERVICE_START 0x0010
  288. //#define SERVICE_STOP 0x0020
  289. //#define SERVICE_PAUSE_CONTINUE 0x0040
  290. //#define SERVICE_INTERROGATE 0x0080
  291. //#define SERVICE_USER_DEFINED_CONTROL 0x0100
  292. // full access to service
  293. // STANDARD_RIGHTS_REQUIRED
  294. // SERVICE_QUERY_CONFIG
  295. // SERVICE_CHANGE_CONFIG
  296. // SERVICE_QUERY_STATUS
  297. // SERVICE_ENUMERATE_DEPENDENTS
  298. // SERVICE_START
  299. // SERVICE_STOP
  300. // SERVICE_PAUSE_CONTINUE
  301. // SERVICE_INTERROGATE
  302. // SERVICE_USER_DEFINED_CONTROL
  303. #define WSZ_SERVICE_ALL_ACCESS L"0x000f01ff"
  304. // Read-only access to service
  305. // SERVICE_QUERY_CONFIG,
  306. // SERVICE_QUERY_STATUS,
  307. // SERVICE_ENUMERATE_DEPENDENTS,
  308. // SERVICE_INTERROGATE
  309. // SERVICE_USER_DEFINED_CONTROL
  310. #define WSZ_SERVICE_READ L"0x0000018d"
  311. #define WSZ_SERVICE_START_STOP L"0x00000030"
  312. // Power user and system access
  313. // SERVICE_QUERY_CONFIG
  314. // SERVICE_QUERY_STATUS
  315. // SERVICE_ENUMERATE_DEPENDENTS
  316. // SERVICE_START
  317. // SERVICE_STOP
  318. // SERVICE_PAUSE_CONTINUE
  319. // SERVICE_INTERROGATE
  320. // SERVICE_USER_DEFINED_CONTROL
  321. #define WSZ_SERVICE_POWER_USER L"0x000001fd"
  322. #define CERTSRV_SERVICE_SACL_ON \
  323. CERTSRV_STD_OG(SDDL_BUILTIN_ADMINISTRATORS, SDDL_BUILTIN_ADMINISTRATORS) \
  324. SDDL_SACL L": (" SDDL_AUDIT L";" \
  325. SDDL_AUDIT_SUCCESS SDDL_AUDIT_FAILURE L";" \
  326. WSZ_SERVICE_START_STOP L";;;" \
  327. SDDL_EVERYONE L")"
  328. #define CERTSRV_SERVICE_SACL_OFF \
  329. SDDL_SACL L":"
  330. // Certsrv service default security
  331. #define WSZ_DEFAULT_SERVICE_SECURITY \
  332. CERTSRV_STD_OG(SDDL_BUILTIN_ADMINISTRATORS, SDDL_BUILTIN_ADMINISTRATORS) \
  333. CERTSRV_STD_ACE(WSZ_SERVICE_READ, SDDL_AUTHENTICATED_USERS) \
  334. CERTSRV_STD_ACE(WSZ_SERVICE_POWER_USER, SDDL_POWER_USERS) \
  335. CERTSRV_STD_ACE(WSZ_SERVICE_POWER_USER, SDDL_LOCAL_SYSTEM) \
  336. CERTSRV_STD_ACE(WSZ_SERVICE_ALL_ACCESS, SDDL_BUILTIN_ADMINISTRATORS) \
  337. CERTSRV_STD_ACE(WSZ_SERVICE_ALL_ACCESS, SDDL_SERVER_OPERATORS)
  338. // DS pKIEnrollmentService default security
  339. #define WSZ_DEFAULT_DSENROLLMENT_SECURITY \
  340. CERTSRV_STD_OG(SDDL_BUILTIN_ADMINISTRATORS, SDDL_BUILTIN_ADMINISTRATORS) \
  341. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE_LESS_CONTROL_ACCESS, SDDL_BUILTIN_ADMINISTRATORS) \
  342. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE_LESS_CONTROL_ACCESS, SDDL_DOMAIN_ADMINISTRATORS) \
  343. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE_LESS_CONTROL_ACCESS, SDDL_ENTERPRISE_ADMINS) \
  344. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE_LESS_CONTROL_ACCESS, SDDL_LOCAL_SYSTEM) \
  345. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE_LESS_CONTROL_ACCESS, L"%ws") \
  346. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_READ, SDDL_AUTHENTICATED_USERS)
  347. // Key Conatiner security
  348. // Owner: local admin
  349. // Group: local admin
  350. // DACL:
  351. // Local Admin - Full Control
  352. // LocalSystem - Full Control
  353. #define WSZ_DEFAULT_KEYCONTAINER_SECURITY \
  354. CERTSRV_STD_OG(SDDL_BUILTIN_ADMINISTRATORS, SDDL_BUILTIN_ADMINISTRATORS) \
  355. CERTSRV_STD_ACE(SDDL_GENERIC_ALL, SDDL_BUILTIN_ADMINISTRATORS) \
  356. CERTSRV_STD_ACE(SDDL_GENERIC_ALL, SDDL_LOCAL_SYSTEM)
  357. // upgrade security
  358. // DACL:
  359. // Local Admin - Full Control
  360. // Everyone - read
  361. #define WSZ_DEFAULT_UPGRADE_SECURITY \
  362. CERTSRV_STD_ACE(SDDL_FILE_READ, SDDL_EVERYONE) \
  363. CERTSRV_STD_ACE(SDDL_FILE_ALL, SDDL_BUILTIN_ADMINISTRATORS)
  364. // following defines certsrv security editing access
  365. #define GUID_CERTSRV GUID_NULL
  366. #define ACTRL_CERTSRV_OBJ ACTRL_DS_CONTROL_ACCESS
  367. #define CS_GEN_SIAE(access, ids) \
  368. {&GUID_CERTSRV, (access), MAKEINTRESOURCE((ids)), \
  369. SI_ACCESS_GENERAL}
  370. #define CS_SPE_SIAE(access, ids) \
  371. {&GUID_CERTSRV, (access), MAKEINTRESOURCE((ids)), \
  372. SI_ACCESS_SPECIFIC}
  373. #define OBJ_GEN_SIAE(guid, access, ids) \
  374. {&(guid), (access), MAKEINTRESOURCE((ids)), \
  375. SI_ACCESS_GENERAL|SI_ACCESS_SPECIFIC}
  376. #define OBJ_SPE_SIAE(guid, ids) \
  377. {&(guid), ACTRL_CERTSRV_OBJ, MAKEINTRESOURCE((ids)), \
  378. SI_ACCESS_SPECIFIC}
  379. #define OBJ_SPE_SIAE_OICI(guid, ids) \
  380. {&(guid), ACTRL_CERTSRV_OBJ, MAKEINTRESOURCE((ids)), \
  381. SI_ACCESS_SPECIFIC | OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE }
  382. #define CERTSRV_SI_ACCESS_LIST \
  383. CS_GEN_SIAE(CA_ACCESS_READ, IDS_ACTRL_CAREAD), \
  384. CS_GEN_SIAE(CA_ACCESS_OFFICER, IDS_ACTRL_OFFICER), \
  385. CS_GEN_SIAE(CA_ACCESS_ADMIN, IDS_ACTRL_CAADMIN), \
  386. CS_GEN_SIAE(CA_ACCESS_ENROLL, IDS_ACTRL_ENROLL), \
  387. // disabled for beta1 CS_GEN_SIAE(CA_ACCESS_AUDITOR, IDS_ACTRL_AUDITOR),
  388. // disabled for beta1 CS_GEN_SIAE(CA_ACCESS_OPERATOR, IDS_ACTRL_OPERATOR),
  389. HRESULT
  390. myGetSDFromTemplate(
  391. IN WCHAR const *pwszStringSD,
  392. IN OPTIONAL WCHAR const *pwszReplace,
  393. OUT PSECURITY_DESCRIPTOR *ppSD);
  394. HRESULT
  395. CertSrvMapAndSetSecurity(
  396. OPTIONAL IN WCHAR const *pwszSanitizedName,
  397. IN WCHAR const *pwszKeyContainerName,
  398. IN BOOL fSetDsSecurity,
  399. IN SECURITY_INFORMATION si,
  400. IN PSECURITY_DESCRIPTOR pSD);
  401. HRESULT
  402. SetCAKeySecurity(
  403. IN SECURITY_INFORMATION si,
  404. IN WCHAR const *pwszSanitizedName,
  405. IN WCHAR const *pwszKeyContainerName,
  406. IN OPTIONAL PSECURITY_DESCRIPTOR pSD);
  407. HRESULT
  408. myMergeSD(
  409. IN PSECURITY_DESCRIPTOR pSDOld,
  410. IN PSECURITY_DESCRIPTOR pSDMerge,
  411. IN SECURITY_INFORMATION si,
  412. OUT PSECURITY_DESCRIPTOR *ppSDNew);
  413. HRESULT
  414. UpdateServiceSacl(bool fTurnOnAuditing);
  415. #endif // __CERTLIB_H__