security.yaml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699
  1. ---
  2. swagger: '2.0'
  3. info:
  4. version: 1.0.0
  5. title: GeoServer Security
  6. description: The Security area shows access rules and other configuration for the security subsystem
  7. contact:
  8. name: GeoServer
  9. email: 'geoserver-users@osgeo.org'
  10. url: 'https://geoserver.org/comm/'
  11. host: localhost:8080
  12. basePath: /geoserver/rest
  13. paths:
  14. /rest/security/masterpw:
  15. get:
  16. operationId: getMasterPW
  17. tags:
  18. - "Security"
  19. summary: Get keystore password
  20. description: |
  21. Displays the keystore password. HTTPS is strongly suggested, otherwise password will be sent in plain text. Use the "Accept:" header to specify format or append an extension to the endpoint (example "/settings.xml" for XML).
  22. produces:
  23. - application/xml
  24. - application/json
  25. responses:
  26. 200:
  27. description: OK
  28. schema:
  29. $ref: "#/definitions/MasterPW"
  30. examples:
  31. application/xml: |
  32. <?xml version="1.0" encoding="UTF-8"?>
  33. <masterPassword>
  34. <oldMasterPassword>geoserver</oldMasterPassword>
  35. </masterPassword>
  36. application/json: |
  37. {"oldMasterPassword":"GeoServer"}
  38. post:
  39. operationId: postMasterPW
  40. tags:
  41. - "Security"
  42. description: Invalid. Use PUT to change keystore password.
  43. responses:
  44. 405:
  45. description: Method Not Allowed
  46. put:
  47. operationId: putMasterPW
  48. tags:
  49. - "Security"
  50. summary: Update keystore password
  51. description: Changes keystore password. Must supply current keystore password. HTTPS is strongly suggested, otherwise password will be sent in plain text.
  52. parameters:
  53. - name: MasterPWBody
  54. description: The old and new keystore password information to upload.
  55. in: body
  56. required: true
  57. schema:
  58. $ref: "#/definitions/UpdateMasterPW"
  59. consumes:
  60. - application/xml
  61. - application/json
  62. responses:
  63. 200:
  64. description: OK
  65. 422:
  66. description: Unprocessable Entity. This error code will show when the current keystore password supplied is incorrect, or if the new keystore password is rejected by the password policy.
  67. delete:
  68. operationId: deleteMasterPW
  69. tags:
  70. - "Security"
  71. description: Invalid. Use PUT to change keystore password.
  72. responses:
  73. 405:
  74. description: Method Not Allowed
  75. /rest/security/self/password:
  76. get:
  77. operationId: getSelfPassword
  78. tags:
  79. - "Security"
  80. description: Invalid. Use PUT to change password.
  81. responses:
  82. 405:
  83. description: Method Not Allowed
  84. post:
  85. operationId: postSelfPassword
  86. tags:
  87. - "Security"
  88. description: Invalid. Use PUT to change password
  89. responses:
  90. 405:
  91. description: Method Not Allowed
  92. put:
  93. operationId: putSelfPassword
  94. tags:
  95. - "Security"
  96. summary: Update password
  97. description: Updates the password for the account used to issue the request.
  98. parameters:
  99. - name: SelfPasswordBody
  100. description: The catalog mode information to upload.
  101. in: body
  102. required: true
  103. schema:
  104. $ref: "#/definitions/SelfPassword"
  105. consumes:
  106. - application/xml
  107. - application/json
  108. responses:
  109. 200:
  110. description: OK
  111. 422:
  112. description: Bad password
  113. delete:
  114. operationId: deleteSelfPassword
  115. tags:
  116. - "Security"
  117. description: Invalid. Use PUT to change password.
  118. responses:
  119. 405:
  120. description: Method Not Allowed
  121. /rest/security/acl/catalog:
  122. get:
  123. operationId: getCatalogMode
  124. tags:
  125. - "Security"
  126. description: Gets the catalog mode, which specifies how GeoServer will advertise secured layers and behave when a secured layer is accessed without the necessary privileges.
  127. produces:
  128. - application/xml
  129. - application/json
  130. responses:
  131. 200:
  132. description: OK
  133. schema:
  134. $ref: "#/definitions/CatalogMode"
  135. examples:
  136. application/xml: |
  137. <?xml version="1.0" encoding="UTF-8"?>
  138. <catalog>
  139. <mode>HIDE</mode>
  140. </catalog>
  141. application/json: |
  142. {"mode":"HIDE"}
  143. post:
  144. operationId: postCatalogMode
  145. tags:
  146. - "Security"
  147. description: Invalid. Use PUT to change catalog mode.
  148. responses:
  149. 405:
  150. description: Method Not Allowed
  151. put:
  152. tags:
  153. - "Security"
  154. summary: Update catalog mode
  155. description: Changes catalog mode. The mode must be one of HIDE, MIXED, or CHALLENGE.
  156. parameters:
  157. - name: CatalogModeBody
  158. description: The catalog mode information to upload.
  159. in: body
  160. required: true
  161. schema:
  162. $ref: "#/definitions/CatalogMode"
  163. consumes:
  164. - application/xml
  165. - application/json
  166. responses:
  167. 200:
  168. description: OK
  169. 422:
  170. description: Unprocessable Entity. This error code will show when an invalid catalog mode is specified.
  171. delete:
  172. operationId: deleteCatalogMode
  173. tags:
  174. - "Security"
  175. description: Invalid. Use PUT to change catalog mode.
  176. responses:
  177. 405:
  178. description: Method Not Allowed
  179. /rest/security/acl/layers:
  180. get:
  181. operationId: getACLLayers
  182. tags:
  183. - "Security"
  184. summary: Get layer rules
  185. description: Displays the current layer-based security rules.
  186. produces:
  187. - application/xml
  188. - application/json
  189. responses:
  190. 200:
  191. description: OK
  192. schema:
  193. $ref: "#/definitions/ACLLayers"
  194. examples:
  195. application/xml: |
  196. <?xml version="1.0" encoding="UTF-8"?>
  197. <rules>
  198. <rule resource="*.*.w">GROUP_ADMIN,ADMIN</rule>
  199. <rule resource="*.*.r">*</rule>
  200. </rules>
  201. application/json: |
  202. {"*.*.w":"GROUP_ADMIN,ADMIN","*.*.r":"*"}
  203. post:
  204. operationId: postACLLayers
  205. tags:
  206. - "Security"
  207. summary: Add layer rule(s)
  208. description: |
  209. Adds one or more new layer-based rules to the list of security rules.
  210. parameters:
  211. - name: ACLLayersBody
  212. description: The new rules to upload.
  213. in: body
  214. required: true
  215. schema:
  216. $ref: "#/definitions/ACLLayers"
  217. consumes:
  218. - application/xml
  219. - application/json
  220. responses:
  221. 200:
  222. description: OK
  223. 409:
  224. description: |
  225. Conflict. Adding an already-added rule. Use PUT to edit the rule in this case. All rule additions are aborted.
  226. put:
  227. operationId: putACLLayers
  228. tags:
  229. - "Security"
  230. summary: Edit layer rule(s)
  231. description: Edits one or more layer-based rules in the list of security rules.
  232. parameters:
  233. - name: ACLLayersBody
  234. description: The altered rules to upload.
  235. in: body
  236. required: true
  237. schema:
  238. $ref: "#/definitions/ACLLayers"
  239. consumes:
  240. - application/xml
  241. - application/json
  242. responses:
  243. 200:
  244. description: OK
  245. 409:
  246. description: Conflict. Attempting to modify a non-existent rule. Use POST to create the rule in this case. All rule modifications are aborted.
  247. delete:
  248. operationId: deleteACLLayers
  249. tags:
  250. - "Security"
  251. summary: Delete layer rule(s)
  252. description: |
  253. Deletes one or more layer-based rules in the list of security rules.
  254. responses:
  255. 200:
  256. description: OK
  257. 404:
  258. description: Not found. Attempting to delete a non-existent rule.
  259. /rest/security/acl/layers/{rule}:
  260. parameters:
  261. - $ref: "#/parameters/Rule"
  262. get:
  263. operationId: getACLLayer
  264. tags:
  265. - "Security"
  266. description: Has no effect. Endpoint that includes a specific rule is only used with DELETE.
  267. responses:
  268. 405:
  269. description: Method not allowed
  270. post:
  271. operationId: postACLLayer
  272. tags:
  273. - "Security"
  274. description: Has no effect. Endpoint that includes a specific rule is only used with DELETE.
  275. responses:
  276. 405:
  277. description: Method not allowed.
  278. put:
  279. operationId: putACLLayer
  280. tags:
  281. - "Security"
  282. description: Has no effect. Endpoint that includes a specific rule is only used with DELETE.
  283. responses:
  284. 405:
  285. description: Method not allowed.
  286. delete:
  287. operationId: deleteACLLayer
  288. tags:
  289. - "Security"
  290. summary: Delete layer rule.
  291. description: |
  292. Deletes specific layer-based rule(s). The {rule} must specified in the last part of the URL and of the form \<workspace\>.\<layer\>.[r|w|a]
  293. responses:
  294. 200:
  295. description: OK
  296. /rest/security/acl/services:
  297. get:
  298. operationId: getACLServices
  299. tags:
  300. - "Security"
  301. summary: Get service rules
  302. description: Displays the current service-based security rules.
  303. produces:
  304. - application/xml
  305. - application/json
  306. responses:
  307. 200:
  308. description: OK
  309. schema:
  310. $ref: "#/definitions/ACLServices"
  311. examples:
  312. application/xml: |
  313. <?xml version="1.0" encoding="UTF-8"?>
  314. <rules>
  315. <rule resource="*.*">*</rule>
  316. </rules>
  317. application/json: |
  318. {"*.*":"*"}
  319. post:
  320. operationId: postACLServices
  321. tags:
  322. - "Security"
  323. summary: Add service rule(s)
  324. description: Adds one or more new service-based rules to the list of security rules.
  325. parameters:
  326. - name: ACLServicesBody
  327. description: The new rules to upload.
  328. in: body
  329. required: true
  330. schema:
  331. $ref: "#/definitions/ACLServices"
  332. consumes:
  333. - application/xml
  334. - application/json
  335. responses:
  336. 200:
  337. description: OK
  338. 409:
  339. description: Conflict. Adding an already-added rule. Use PUT to edit the rule in this case. All rule additions are aborted.
  340. put:
  341. operationId: putACLServices
  342. tags:
  343. - "Security"
  344. summary: Edit service rule(s)
  345. description: Edits one or more service-based rules in the list of security rules.
  346. parameters:
  347. - name: ACLServicesBody
  348. description: The altered rules to upload.
  349. in: body
  350. required: true
  351. schema:
  352. $ref: "#/definitions/ACLServices"
  353. consumes:
  354. - application/xml
  355. - application/json
  356. responses:
  357. 200:
  358. description: OK
  359. 409:
  360. description: Conflict. Attempting to modify a non-existent rule. Use POST to create the rule in this case. All rule modifications are aborted.
  361. delete:
  362. operationId: deleteACLServices
  363. tags:
  364. - "Security"
  365. summary: Delete service rule(s)
  366. description: Deletes one or more service-based rules in the list of security rules.
  367. responses:
  368. 200:
  369. description: OK
  370. 404:
  371. description: Not found. Attempting to delete a non-existent rule.
  372. /rest/security/acl/services/{rule}:
  373. parameters:
  374. - $ref: "#/parameters/Rule"
  375. get:
  376. operationId: getACLService
  377. tags:
  378. - "Security"
  379. description: Has no effect. Endpoint that includes a specific rule is only used with DELETE.
  380. responses:
  381. 405:
  382. description: Method not allowed.
  383. post:
  384. operationId: postACLService
  385. tags:
  386. - "Security"
  387. description: Has no effect. Endpoint that includes a specific rule is only used with DELETE.
  388. responses:
  389. 405:
  390. description: Method not allowed.
  391. put:
  392. operationId: putACLService
  393. tags:
  394. - "Security"
  395. description: Has no effect. Endpoint that includes a specific rule is only used with DELETE.
  396. responses:
  397. 405:
  398. description: Method not allowed.
  399. delete:
  400. operationId: deleteACLService
  401. tags:
  402. - "Security"
  403. summary: Delete service rule.
  404. description: |
  405. Deletes specific service-based rule(s). The {rule} must be specified as the last part of the URL and must be of the form \<service\>.\<operation\>
  406. responses:
  407. 200:
  408. description: OK
  409. /rest/security/acl/rest:
  410. get:
  411. operationId: getACLRESTRules
  412. tags:
  413. - "Security"
  414. summary: Get REST rules
  415. description: Displays the current REST access rules.
  416. produces:
  417. - application/xml
  418. - application/json
  419. responses:
  420. 200:
  421. description: OK
  422. schema:
  423. $ref: "#/definitions/ACLREST"
  424. examples:
  425. application/xml: |
  426. <rules>
  427. <rule resource="/**:GET">ADMIN</rule>
  428. <rule resource="/**:POST,DELETE,PUT">ADMIN</rule>
  429. </rules>
  430. application/json: |
  431. {"/**:GET":"ADMIN","/**:POST,DELETE,PUT":"ADMIN"}
  432. post:
  433. operationId: postACLRESTRules
  434. tags:
  435. - "Security"
  436. summary: Add REST access rule(s)
  437. description: Adds one or more new REST access rules.
  438. parameters:
  439. - name: ACLRESTBody
  440. description: The new rules to upload.
  441. in: body
  442. required: true
  443. schema:
  444. $ref: "#/definitions/ACLREST"
  445. consumes:
  446. - application/xml
  447. - application/json
  448. responses:
  449. 200:
  450. description: OK
  451. 409:
  452. description: Conflict. Adding an already-added rule. Use PUT to edit the rule in this case. All rule additions are aborted.
  453. put:
  454. operationId: putACLRESTRules
  455. tags:
  456. - "Security"
  457. summary: Edit REST access rule(s)
  458. description: Edits one or more REST access rules.
  459. parameters:
  460. - name: ACLRESTBody
  461. description: The altered rules to upload.
  462. in: body
  463. required: true
  464. schema:
  465. $ref: "#/definitions/ACLREST"
  466. consumes:
  467. - application/xml
  468. - application/json
  469. responses:
  470. 200:
  471. description: OK
  472. 409:
  473. description: Conflict. Attempting to modify a non-existent rule. Use POST to create the rule in this case. All rule modifications are aborted.
  474. delete:
  475. operationId: deleteACLRESTRules
  476. tags:
  477. - "Security"
  478. summary: Delete REST access rule(s)
  479. description: Deletes one or more service-based rules.
  480. responses:
  481. 200:
  482. description: OK
  483. 404:
  484. description: Not found. Attempting to delete a non-existent rule.
  485. /rest/security/acl/rest/{rule}:
  486. parameters:
  487. - name: rule
  488. type: string
  489. in: path
  490. required: true
  491. description: |
  492. The REST rule, specified as \<URL Ant pattern\>;\<comma separated list of HTTP methods\>. Examples are
  493. - /**;GET
  494. - /**;POST,DELETE,PUT
  495. get:
  496. operationId: getACLRESTRule
  497. tags:
  498. - "Security"
  499. description: Has no effect. Endpoint that includes a specific rule is only used with DELETE.
  500. responses:
  501. 200:
  502. description: OK
  503. post:
  504. operationId: postACLRESTRule
  505. tags:
  506. - "Security"
  507. description: Has no effect. Endpoint that includes a specific rule is only used with DELETE.
  508. responses:
  509. 200:
  510. description: OK
  511. put:
  512. operationId: putACLRESTRule
  513. tags:
  514. - "Security"
  515. description: Has no effect. Endpoint that includes a specific rule is only used with DELETE.
  516. responses:
  517. 200:
  518. description: OK
  519. delete:
  520. operationId: deleteACLRESTRule
  521. tags:
  522. - "Security"
  523. summary: Delete REST access rule
  524. description: |
  525. Deletes specific REST access rule(s). The {rule} must specified as the last part of the URL and must be of the form \<URL Ant pattern\>:\<comma separated list of HTTP methods\>
  526. responses:
  527. 200:
  528. description: OK
  529. parameters:
  530. Rule:
  531. name: rule
  532. in: path
  533. required: true
  534. type: string
  535. description: |
  536. The specified rule, as the last part in the URI, e.g. /security/acl/layers/\*.\*.r
  537. definitions:
  538. MasterPW:
  539. title: masterPassword
  540. type: object
  541. properties:
  542. oldMasterPassword:
  543. type: string
  544. description: Current keystore password
  545. UpdateMasterPW:
  546. title: masterPassword
  547. type: object
  548. xml:
  549. name: masterPassword
  550. properties:
  551. oldMasterPassword:
  552. type: string
  553. description: Current keystore password
  554. example: oldPassword
  555. newMasterPassword:
  556. type: string
  557. description: New keystore password
  558. example: newPassword
  559. CatalogMode:
  560. title: catalog
  561. xml:
  562. name: catalog
  563. type: object
  564. properties:
  565. mode:
  566. type: string
  567. enum:
  568. - HIDE
  569. - MIXED
  570. - CHALLENGE
  571. SelfPassword:
  572. title: userPassword
  573. type: object
  574. xml:
  575. name: userPassword
  576. properties:
  577. newPassword:
  578. type: string
  579. description: New password
  580. example: newPassword
  581. ACLLayers:
  582. title: rules
  583. xml:
  584. name: rules
  585. type: object
  586. properties:
  587. rule:
  588. type: object
  589. properties:
  590. '@resource':
  591. type: string
  592. description: |
  593. Security pattern of the form <workspace>.<layer>.[r|w|a]
  594. text:
  595. type: string
  596. description: Comma-separated list of roles
  597. ACLServices:
  598. title: rules
  599. xml:
  600. name: rules
  601. type: object
  602. properties:
  603. rule:
  604. type: object
  605. properties:
  606. '@resource':
  607. type: string
  608. description: |
  609. Security pattern of the form \<service\>.\<operation\>
  610. text:
  611. type: string
  612. description: Comma-separated list of roles
  613. ACLREST:
  614. title: rules
  615. xml:
  616. name: rules
  617. type: object
  618. properties:
  619. rule:
  620. type: object
  621. properties:
  622. '@resource':
  623. type: string
  624. description: |
  625. Security pattern of the form \<URL Ant pattern\>:\<comma separated list of HTTP methods\>
  626. text:
  627. type: string
  628. description: Comma-separated list of roles