Leaked source code of windows server 2003
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.

498 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_DACL \
  147. SDDL_DACL L":" SDDL_AUTO_INHERITED
  148. #define CERTSRV_DACL_PROTECTED \
  149. SDDL_DACL L":" SDDL_AUTO_INHERITED SDDL_PROTECTED
  150. #define CERTSRV_SACL_ACE(account) \
  151. L"(" SDDL_AUDIT L";" \
  152. SDDL_AUDIT_SUCCESS SDDL_AUDIT_FAILURE L";" \
  153. WSZ_CA_ACCESS_MASKALL L";;;" \
  154. account L")"
  155. #define CERTSRV_SACL_ON \
  156. SDDL_SACL L": " \
  157. CERTSRV_SACL_ACE(SDDL_EVERYONE) \
  158. CERTSRV_SACL_ACE(SDDL_ANONYMOUS)
  159. #define CERTSRV_SACL_OFF \
  160. SDDL_SACL L":"
  161. #define WSZ_CERTSRV_SID_ANONYMOUS_LOGON L"S-1-5-7"
  162. #define WSZ_CERTSRV_SID_EVERYONE L"S-1-1-0"
  163. // Default Standalone security
  164. // Standalone
  165. // Owner, local administrators
  166. // Group, local administrators
  167. // DACL:
  168. // enroll - everyone
  169. // caadmin - builtin\administrators
  170. // officer - builtin\administrators
  171. #define WSZ_DEFAULT_CA_STD_SECURITY \
  172. CERTSRV_STD_OG(SDDL_BUILTIN_ADMINISTRATORS, SDDL_BUILTIN_ADMINISTRATORS) \
  173. CERTSRV_STD_ACE(WSZ_CA_ACCESS_ADMIN, SDDL_BUILTIN_ADMINISTRATORS) \
  174. CERTSRV_STD_ACE(WSZ_CA_ACCESS_OFFICER, SDDL_BUILTIN_ADMINISTRATORS) \
  175. CERTSRV_STD_ACE(WSZ_CA_ACCESS_ENROLL, SDDL_EVERYONE) \
  176. CERTSRV_SACL_ON
  177. // Default Enterprise Security
  178. // Owner, Enterprise Administrators
  179. // Group, Enterprise Administrators
  180. // DACL:
  181. // enroll - authenticated users
  182. // caadmin - builtin\administrators
  183. // - domain admins
  184. // - enterprise admins
  185. // officer - builtin\administrators
  186. // - domain admins
  187. // - enterprise admins
  188. #define WSZ_DEFAULT_CA_ENT_SECURITY \
  189. CERTSRV_STD_OG(SDDL_BUILTIN_ADMINISTRATORS, SDDL_BUILTIN_ADMINISTRATORS) \
  190. CERTSRV_STD_ACE(WSZ_CA_ACCESS_ADMIN, SDDL_BUILTIN_ADMINISTRATORS) \
  191. CERTSRV_STD_ACE(WSZ_CA_ACCESS_OFFICER, SDDL_BUILTIN_ADMINISTRATORS) \
  192. CERTSRV_STD_ACE(WSZ_CA_ACCESS_ADMIN, SDDL_DOMAIN_ADMINISTRATORS) \
  193. CERTSRV_STD_ACE(WSZ_CA_ACCESS_OFFICER, SDDL_DOMAIN_ADMINISTRATORS) \
  194. CERTSRV_STD_ACE(WSZ_CA_ACCESS_ADMIN, SDDL_ENTERPRISE_ADMINS) \
  195. CERTSRV_STD_ACE(WSZ_CA_ACCESS_OFFICER, SDDL_ENTERPRISE_ADMINS) \
  196. CERTSRV_STD_ACE(WSZ_CA_ACCESS_ENROLL, SDDL_AUTHENTICATED_USERS) \
  197. CERTSRV_SACL_ON
  198. // Empty CA SD
  199. #define WSZ_EMPTY_CA_SECURITY \
  200. CERTSRV_STD_OG(SDDL_BUILTIN_ADMINISTRATORS, SDDL_BUILTIN_ADMINISTRATORS) \
  201. CERTSRV_SACL_ON
  202. // DS Container
  203. // (CDP/CA container)
  204. // Owner: Enterprise Admins (overidden by installer)
  205. // Group: Enterprise Admins (overidden by installer)
  206. // DACL:
  207. // Enterprise Admins - Full Control
  208. // Domain Admins - Full Control
  209. // Cert Publishers - Full Control
  210. // Builtin Admins - Full Control
  211. // Everyone - Read
  212. #define WSZ_DEFAULT_CA_DS_SECURITY \
  213. CERTSRV_DACL \
  214. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE, SDDL_ENTERPRISE_ADMINS) \
  215. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE, SDDL_DOMAIN_ADMINISTRATORS) \
  216. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE, SDDL_CERT_SERV_ADMINISTRATORS) \
  217. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE, SDDL_BUILTIN_ADMINISTRATORS) \
  218. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_READ, SDDL_EVERYONE)
  219. // NTAuthCertificates
  220. //
  221. // Owner: Enterprise Admins (overidden by installer)
  222. // Group: Enterprise Admins (overidden by installer)
  223. // DACL:
  224. // Enterprise Admins - Full Control
  225. // Domain Admins - Full Control
  226. // Builtin Admins - Full Control
  227. // Everyone - Read
  228. #define WSZ_DEFAULT_NTAUTH_SECURITY \
  229. CERTSRV_DACL \
  230. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE, SDDL_ENTERPRISE_ADMINS) \
  231. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE, SDDL_DOMAIN_ADMINISTRATORS) \
  232. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE, SDDL_BUILTIN_ADMINISTRATORS) \
  233. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_READ, SDDL_EVERYONE)
  234. // CDP/CA
  235. // Owner: Enterprise Admins (overidden by installer)
  236. // Group: Enterprise Admins (overidden by installer)
  237. // DACL:
  238. // Enterprise Admins - Full Control
  239. // Domain Admins - Full Control
  240. // Cert Publishers - Full Control
  241. // Builtin Admins- Full Control
  242. // Authenticated Users - Read
  243. #define WSZ_DEFAULT_CDP_DS_SECURITY \
  244. CERTSRV_DACL \
  245. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE, SDDL_ENTERPRISE_ADMINS) \
  246. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE, SDDL_DOMAIN_ADMINISTRATORS) \
  247. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE, L"%ws") \
  248. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE, SDDL_BUILTIN_ADMINISTRATORS) \
  249. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_READ, SDDL_EVERYONE)
  250. // Shared Folder related security
  251. // Owner: Local Admin
  252. // DACL:
  253. // Local Admin - Full Control
  254. // LocalSystem - Full Control
  255. // Enterprise Admins - Full Control
  256. // Everyone - Read
  257. #define WSZ_DEFAULT_SF_SECURITY \
  258. CERTSRV_DACL \
  259. CERTSRV_STD_ACE(SDDL_GENERIC_ALL, SDDL_BUILTIN_ADMINISTRATORS) \
  260. CERTSRV_STD_ACE(SDDL_GENERIC_ALL, SDDL_LOCAL_SYSTEM)
  261. #define WSZ_DEFAULT_SF_USEDS_SECURITY \
  262. CERTSRV_DACL \
  263. CERTSRV_STD_ACE(SDDL_GENERIC_ALL, SDDL_BUILTIN_ADMINISTRATORS) \
  264. CERTSRV_STD_ACE(SDDL_GENERIC_ALL, SDDL_LOCAL_SYSTEM) \
  265. CERTSRV_STD_ACE(SDDL_GENERIC_ALL, SDDL_ENTERPRISE_ADMINS)
  266. #define WSZ_DEFAULT_SF_EVERYONEREAD_SECURITY \
  267. WSZ_DEFAULT_SF_SECURITY \
  268. CERTSRV_STD_ACE(SDDL_GENERIC_READ, SDDL_EVERYONE)
  269. #define WSZ_DEFAULT_SF_USEDS_EVERYONEREAD_SECURITY \
  270. WSZ_DEFAULT_SF_USEDS_SECURITY \
  271. CERTSRV_STD_ACE(SDDL_GENERIC_READ, SDDL_EVERYONE)
  272. #define WSZ_DEFAULT_DB_DIR_SECURITY \
  273. CERTSRV_DACL_PROTECTED \
  274. CERTSRV_STD_ACE(SDDL_GENERIC_ALL, SDDL_BUILTIN_ADMINISTRATORS) \
  275. CERTSRV_STD_ACE(SDDL_GENERIC_ALL, SDDL_LOCAL_SYSTEM) \
  276. CERTSRV_STD_ACE(SDDL_GENERIC_ALL, SDDL_CREATOR_OWNER) \
  277. CERTSRV_STD_ACE(SDDL_GENERIC_ALL, SDDL_BACKUP_OPERATORS)
  278. #define WSZ_DEFAULT_LOG_DIR_SECURITY WSZ_DEFAULT_DB_DIR_SECURITY
  279. // Enroll share security
  280. // Owner: Administrators
  281. // Group: Administrators
  282. // DACL:
  283. // Everyone: read access
  284. // local admin: full access
  285. #define WSZ_ACTRL_CERTSRV_SHARE_READ SDDL_FILE_READ \
  286. SDDL_READ_CONTROL \
  287. SDDL_GENERIC_READ \
  288. SDDL_GENERIC_EXECUTE
  289. #define WSZ_ACTRL_CERTSRV_SHARE_ALL SDDL_FILE_ALL \
  290. SDDL_CREATE_CHILD \
  291. SDDL_STANDARD_DELETE \
  292. SDDL_READ_CONTROL \
  293. SDDL_WRITE_DAC \
  294. SDDL_WRITE_OWNER \
  295. SDDL_GENERIC_ALL
  296. #define WSZ_DEFAULT_SHARE_SECURITY \
  297. CERTSRV_DACL \
  298. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_SHARE_READ, SDDL_EVERYONE) \
  299. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_SHARE_ALL, SDDL_BUILTIN_ADMINISTRATORS)
  300. // Service string below need to be in sync with the following
  301. // definitions from winsvc.h
  302. //#define SERVICE_QUERY_CONFIG 0x0001
  303. //#define SERVICE_CHANGE_CONFIG 0x0002
  304. //#define SERVICE_QUERY_STATUS 0x0004
  305. //#define SERVICE_ENUMERATE_DEPENDENTS 0x0008
  306. //#define SERVICE_START 0x0010
  307. //#define SERVICE_STOP 0x0020
  308. //#define SERVICE_PAUSE_CONTINUE 0x0040
  309. //#define SERVICE_INTERROGATE 0x0080
  310. //#define SERVICE_USER_DEFINED_CONTROL 0x0100
  311. // full access to service
  312. // STANDARD_RIGHTS_REQUIRED
  313. // SERVICE_QUERY_CONFIG
  314. // SERVICE_CHANGE_CONFIG
  315. // SERVICE_QUERY_STATUS
  316. // SERVICE_ENUMERATE_DEPENDENTS
  317. // SERVICE_START
  318. // SERVICE_STOP
  319. // SERVICE_PAUSE_CONTINUE
  320. // SERVICE_INTERROGATE
  321. // SERVICE_USER_DEFINED_CONTROL
  322. #define WSZ_SERVICE_ALL_ACCESS L"0x000f01ff"
  323. // Read-only access to service
  324. // SERVICE_QUERY_CONFIG,
  325. // SERVICE_QUERY_STATUS,
  326. // SERVICE_ENUMERATE_DEPENDENTS,
  327. // SERVICE_INTERROGATE
  328. // SERVICE_USER_DEFINED_CONTROL
  329. #define WSZ_SERVICE_READ L"0x0000018d"
  330. #define WSZ_SERVICE_START_STOP L"0x00000030"
  331. // Power user and system access
  332. // SERVICE_QUERY_CONFIG
  333. // SERVICE_QUERY_STATUS
  334. // SERVICE_ENUMERATE_DEPENDENTS
  335. // SERVICE_START
  336. // SERVICE_STOP
  337. // SERVICE_PAUSE_CONTINUE
  338. // SERVICE_INTERROGATE
  339. // SERVICE_USER_DEFINED_CONTROL
  340. #define WSZ_SERVICE_POWER_USER L"0x000001fd"
  341. #define CERTSRV_SERVICE_SACL_ON \
  342. CERTSRV_DACL \
  343. SDDL_SACL L": (" SDDL_AUDIT L";" \
  344. SDDL_AUDIT_SUCCESS SDDL_AUDIT_FAILURE L";" \
  345. WSZ_SERVICE_START_STOP L";;;" \
  346. SDDL_EVERYONE L")"
  347. #define CERTSRV_SERVICE_SACL_OFF \
  348. SDDL_SACL L":"
  349. // Certsrv service default security
  350. #define WSZ_DEFAULT_SERVICE_SECURITY \
  351. CERTSRV_DACL \
  352. CERTSRV_STD_ACE(WSZ_SERVICE_READ, SDDL_AUTHENTICATED_USERS) \
  353. CERTSRV_STD_ACE(WSZ_SERVICE_POWER_USER, SDDL_POWER_USERS) \
  354. CERTSRV_STD_ACE(WSZ_SERVICE_POWER_USER, SDDL_LOCAL_SYSTEM) \
  355. CERTSRV_STD_ACE(WSZ_SERVICE_ALL_ACCESS, SDDL_BUILTIN_ADMINISTRATORS) \
  356. CERTSRV_STD_ACE(WSZ_SERVICE_ALL_ACCESS, SDDL_SERVER_OPERATORS)
  357. // DS pKIEnrollmentService default security
  358. #define WSZ_DEFAULT_DSENROLLMENT_SECURITY \
  359. CERTSRV_DACL \
  360. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE_LESS_CONTROL_ACCESS, SDDL_ENTERPRISE_ADMINS) \
  361. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_MANAGE_LESS_CONTROL_ACCESS, L"%ws") \
  362. CERTSRV_STD_ACE(WSZ_ACTRL_CERTSRV_READ, SDDL_AUTHENTICATED_USERS)
  363. // Key Conatiner security
  364. // Owner: local admin
  365. // Group: local admin
  366. // DACL:
  367. // Local Admin - Full Control
  368. // LocalSystem - Full Control
  369. #define WSZ_DEFAULT_KEYCONTAINER_SECURITY \
  370. CERTSRV_DACL \
  371. CERTSRV_STD_ACE(SDDL_GENERIC_ALL, SDDL_BUILTIN_ADMINISTRATORS) \
  372. CERTSRV_STD_ACE(SDDL_GENERIC_ALL, SDDL_LOCAL_SYSTEM)
  373. // upgrade security
  374. // DACL:
  375. // Local Admin - Full Control
  376. // Everyone - read
  377. #define WSZ_DEFAULT_UPGRADE_SECURITY \
  378. CERTSRV_STD_ACE(SDDL_FILE_READ, SDDL_EVERYONE) \
  379. CERTSRV_STD_ACE(SDDL_FILE_ALL, SDDL_BUILTIN_ADMINISTRATORS)
  380. // following defines certsrv security editing access
  381. #define GUID_CERTSRV GUID_NULL
  382. #define ACTRL_CERTSRV_OBJ ACTRL_DS_CONTROL_ACCESS
  383. #define CS_GEN_SIAE(access, ids) \
  384. {&GUID_CERTSRV, (access), MAKEINTRESOURCE((ids)), \
  385. SI_ACCESS_GENERAL}
  386. #define CS_SPE_SIAE(access, ids) \
  387. {&GUID_CERTSRV, (access), MAKEINTRESOURCE((ids)), \
  388. SI_ACCESS_SPECIFIC}
  389. #define OBJ_GEN_SIAE(guid, access, ids) \
  390. {&(guid), (access), MAKEINTRESOURCE((ids)), \
  391. SI_ACCESS_GENERAL|SI_ACCESS_SPECIFIC}
  392. #define OBJ_SPE_SIAE(guid, ids) \
  393. {&(guid), ACTRL_CERTSRV_OBJ, MAKEINTRESOURCE((ids)), \
  394. SI_ACCESS_SPECIFIC}
  395. #define OBJ_SPE_SIAE_OICI(guid, ids) \
  396. {&(guid), ACTRL_CERTSRV_OBJ, MAKEINTRESOURCE((ids)), \
  397. SI_ACCESS_SPECIFIC | OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE }
  398. #define CERTSRV_SI_ACCESS_LIST \
  399. CS_GEN_SIAE(CA_ACCESS_READ, IDS_ACTRL_CAREAD), \
  400. CS_GEN_SIAE(CA_ACCESS_OFFICER, IDS_ACTRL_OFFICER), \
  401. CS_GEN_SIAE(CA_ACCESS_ADMIN, IDS_ACTRL_CAADMIN), \
  402. CS_GEN_SIAE(CA_ACCESS_ENROLL, IDS_ACTRL_ENROLL), \
  403. // disabled for beta1 CS_GEN_SIAE(CA_ACCESS_AUDITOR, IDS_ACTRL_AUDITOR),
  404. // disabled for beta1 CS_GEN_SIAE(CA_ACCESS_OPERATOR, IDS_ACTRL_OPERATOR),
  405. HRESULT
  406. myGetSDFromTemplate(
  407. IN WCHAR const *pwszStringSD,
  408. IN OPTIONAL WCHAR const *pwszReplace,
  409. OUT PSECURITY_DESCRIPTOR *ppSD);
  410. HRESULT
  411. CertSrvMapAndSetSecurity(
  412. OPTIONAL IN WCHAR const *pwszSanitizedName,
  413. IN WCHAR const *pwszKeyContainerName,
  414. IN BOOL fSetDsSecurity,
  415. IN SECURITY_INFORMATION si,
  416. IN PSECURITY_DESCRIPTOR pSD);
  417. HRESULT
  418. mySetKeyContainerSecurity(
  419. IN HCRYPTPROV hProv);
  420. HRESULT
  421. myMergeSD(
  422. IN PSECURITY_DESCRIPTOR pSDOld,
  423. IN PSECURITY_DESCRIPTOR pSDMerge,
  424. IN SECURITY_INFORMATION si,
  425. OUT PSECURITY_DESCRIPTOR *ppSDNew);
  426. HRESULT
  427. UpdateServiceSacl(bool fTurnOnAuditing);
  428. HRESULT
  429. SetFolderDacl(LPCWSTR pcwszFolderPath, LPCWSTR pcwszSDDL);
  430. #endif // __CERTLIB_H__