annotate Plugin/DefaultConfiguration.json @ 77:94a9484d7f8f

fix security issues allowing to browse remote dicom servers + introduced UnitTests
author Alain Mazy <am@osimis.io>
date Wed, 15 Mar 2023 16:36:42 +0100
parents 57e98fc07ab2
children 94c5388ed30b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
71
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
1 {
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
2 "Authorization" : {
72
e381ba725669 new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents: 71
diff changeset
3 // The Base URL of the auth webservice. This is an alias for all 3 next configurations:
e381ba725669 new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents: 71
diff changeset
4 // // "WebServiceUserProfileUrl" : " ROOT /user/get-profile",
e381ba725669 new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents: 71
diff changeset
5 // // "WebServiceTokenValidationUrl" : " ROOT /tokens/validate",
e381ba725669 new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents: 71
diff changeset
6 // // "WebServiceTokenCreationBaseUrl" : " ROOT /tokens/",
73
512247750f0a new ValidityDuration arg in create token API
Alain Mazy <am@osimis.io>
parents: 72
diff changeset
7 // You should define it only if your auth webservice implements all 3 routes !
72
e381ba725669 new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents: 71
diff changeset
8 // "WebServiceRootUrl" : "http://change-me:8000/",
e381ba725669 new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents: 71
diff changeset
9
e381ba725669 new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents: 71
diff changeset
10 // The URL of the auth webservice route implementing user profile (optional)
e381ba725669 new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents: 71
diff changeset
11 // (this configuration was previously named "WebService" and its old name is still accepted
e381ba725669 new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents: 71
diff changeset
12 // for backward compatibility)
e381ba725669 new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents: 71
diff changeset
13 // "WebServiceUserProfileUrl" : "http://change-me:8000/user/profile",
e381ba725669 new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents: 71
diff changeset
14
e381ba725669 new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents: 71
diff changeset
15 // The URL of the auth webservice route implementing resource level authorization (optional)
e381ba725669 new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents: 71
diff changeset
16 // "WebServiceTokenValidationUrl" : "http://change-me:8000/tokens/validate",
e381ba725669 new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents: 71
diff changeset
17
e381ba725669 new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents: 71
diff changeset
18 // The Base URL of the auth webservice route to create tokens (optional)
e381ba725669 new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents: 71
diff changeset
19 // "WebServiceTokenCreationBaseUrl" : "http://change-me:8000/tokens/",
71
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
20
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
21 // The username and password to connect to the webservice (optional)
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
22 //"WebServiceUsername": "change-me",
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
23 //"WebServicePassword": "change-me",
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
24
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
25 // An identifier added to the payload of each request to the auth webservice (optional)
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
26 //"WebServiceIdentifier": "change-me"
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
27
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
28 // The name of the HTTP headers that may contain auth tokens
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
29 //"TokenHttpHeaders" : [],
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
30
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
31 // the name of the GET arguments that may contain auth tokens
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
32 //"TokenGetArguments" : [],
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
33
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
34 // A list of predefined configurations for well-known plugins
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
35 // "StandardConfigurations": [ // new in v 0.4.0
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
36 // "osimis-web-viewer",
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
37 // "stone-webviewer",
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
38 // "orthanc-explorer-2"
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
39 // ],
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
40
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
41 //"UncheckedResources" : [],
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
42 //"UncheckedFolders" : [],
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
43 //"CheckedLevel" : "studies",
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
44 //"UncheckedLevels" : [],
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
45
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
46 // Definition of required "user-permissions". This can be fully customized.
72
e381ba725669 new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents: 71
diff changeset
47 // You may define other permissions yourself as long as they match the permissions
71
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
48 // provided in the user-profile route implemented by the auth-service.
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
49 // You may test your regex in https://regex101.com/ by selecting .NET (C#) and removing the leading ^ and trailing $
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
50 // The default configuration is suitable for Orthanc-Explorer-2 (see TBD sample)
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
51 "Permissions" : [
75
57e98fc07ab2 default permissions
Alain Mazy <am@osimis.io>
parents: 73
diff changeset
52 ["post", "^/auth/tokens/decode$", ""],
77
94a9484d7f8f fix security issues allowing to browse remote dicom servers + introduced UnitTests
Alain Mazy <am@osimis.io>
parents: 75
diff changeset
53 ["post", "^/tools/lookup$", ""], // currently used to authorize downloads in Stone (to map the StudyInstanceUID into an OrthancID. Not ideal -> we should define a new API that has the resource ID in the path to be able to check it at resource level) but, on another hand, you do not get any Patient information from this route
75
57e98fc07ab2 default permissions
Alain Mazy <am@osimis.io>
parents: 73
diff changeset
54
71
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
55 // elemental browsing in OE2
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
56 ["post", "^/tools/find$", "all|view"],
75
57e98fc07ab2 default permissions
Alain Mazy <am@osimis.io>
parents: 73
diff changeset
57 ["get" , "^/(patients|studies|series|instances)/([a-f0-9-]+)$", "all|view"],
57e98fc07ab2 default permissions
Alain Mazy <am@osimis.io>
parents: 73
diff changeset
58 ["get" , "^/(patients|studies|series|instances)/([a-f0-9-]+)/(studies|study|series|instances)$", "all|view"],
71
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
59 ["get" , "^/instances/([a-f0-9-]+)/(tags|header)$", "all|view"],
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
60 ["get" , "^/statistics$", "all|view"],
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
61
75
57e98fc07ab2 default permissions
Alain Mazy <am@osimis.io>
parents: 73
diff changeset
62 // create links to open viewer or download resources
57e98fc07ab2 default permissions
Alain Mazy <am@osimis.io>
parents: 73
diff changeset
63 ["put", "^/auth/tokens/(viewer-instant-link|meddream-instant-link)$", "all|view"],
57e98fc07ab2 default permissions
Alain Mazy <am@osimis.io>
parents: 73
diff changeset
64 ["put", "^/auth/tokens/(download-instant-link)$", "all|download"],
57e98fc07ab2 default permissions
Alain Mazy <am@osimis.io>
parents: 73
diff changeset
65
57e98fc07ab2 default permissions
Alain Mazy <am@osimis.io>
parents: 73
diff changeset
66 // share a link to open a study
57e98fc07ab2 default permissions
Alain Mazy <am@osimis.io>
parents: 73
diff changeset
67 ["put", "^/auth/tokens/(stone-viewer-publication|meddream-viewer-publication|osimis-viewer-publication)$", "all|share"],
57e98fc07ab2 default permissions
Alain Mazy <am@osimis.io>
parents: 73
diff changeset
68
57e98fc07ab2 default permissions
Alain Mazy <am@osimis.io>
parents: 73
diff changeset
69 // uploads
57e98fc07ab2 default permissions
Alain Mazy <am@osimis.io>
parents: 73
diff changeset
70 ["post", "^/instances$", "all|upload"],
57e98fc07ab2 default permissions
Alain Mazy <am@osimis.io>
parents: 73
diff changeset
71
71
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
72 // monitor jobs you have created
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
73 ["get" , "^/jobs/([a-f0-9-]+)$", "all|send|modify|anonymize|q-r-remote-modalities"],
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
74
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
75 // interacting with peers/modalities/dicomweb
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
76 ["post", "^/(peers|modalities)/(.*)/store$", "all|send"],
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
77 ["get" , "^/(peers|modalities)$", "all|send|q-r-remote-modalities"],
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
78 ["post", "^/modalities/(.*)/echo$", "all|send|q-r-remote-modalities"],
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
79 ["post", "^/modalities/(.*)/query$", "all|q-r-remote-modalities"],
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
80 ["get", "^/queries/([a-f0-9-]+)/answers$", "all|q-r-remote-modalities"],
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
81 ["post", "^/modalities/(.*)/move$", "all|q-r-remote-modalities"],
75
57e98fc07ab2 default permissions
Alain Mazy <am@osimis.io>
parents: 73
diff changeset
82 ["get" , "^/DICOM_WEB_ROOT/servers$", "all|send|q-r-remote-modalities"],
71
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
83 ["get" , "^/DICOM_WEB_ROOT/(servers)/(.*)/stow$", "all|send"],
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
84
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
85 // modifications/anonymization
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
86 ["post", "^/(patients|studies|series|instances)/([a-f0-9-]+)/modify(.*)$", "all|modify"],
77
94a9484d7f8f fix security issues allowing to browse remote dicom servers + introduced UnitTests
Alain Mazy <am@osimis.io>
parents: 75
diff changeset
87 ["post", "^/(patients|studies|series|instances)/([a-f0-9-]+)/anonymize(.*)$", "all|anonymize"],
94a9484d7f8f fix security issues allowing to browse remote dicom servers + introduced UnitTests
Alain Mazy <am@osimis.io>
parents: 75
diff changeset
88
94a9484d7f8f fix security issues allowing to browse remote dicom servers + introduced UnitTests
Alain Mazy <am@osimis.io>
parents: 75
diff changeset
89 // deletes
94a9484d7f8f fix security issues allowing to browse remote dicom servers + introduced UnitTests
Alain Mazy <am@osimis.io>
parents: 75
diff changeset
90 ["delete" , "^/(patients|studies|series|instances)/([a-f0-9-]+)$", "all|delete"],
94a9484d7f8f fix security issues allowing to browse remote dicom servers + introduced UnitTests
Alain Mazy <am@osimis.io>
parents: 75
diff changeset
91
94a9484d7f8f fix security issues allowing to browse remote dicom servers + introduced UnitTests
Alain Mazy <am@osimis.io>
parents: 75
diff changeset
92 // settings
94a9484d7f8f fix security issues allowing to browse remote dicom servers + introduced UnitTests
Alain Mazy <am@osimis.io>
parents: 75
diff changeset
93 ["put", "^/tools/log-level$", "all|settings"],
94a9484d7f8f fix security issues allowing to browse remote dicom servers + introduced UnitTests
Alain Mazy <am@osimis.io>
parents: 75
diff changeset
94 ["get", "^/tools/log-level$", "all|settings"]
71
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
95 ]
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
96 }
30fb3ce960d9 configurable user permissions
Alain Mazy <am@osimis.io>
parents:
diff changeset
97 }