Mercurial > hg > orthanc-tests
annotate Tests/CheckHttpServerSecurity.py @ 631:3bf3ea08efde
typo
author | Alain Mazy <am@osimis.io> |
---|---|
date | Tue, 05 Mar 2024 09:13:02 +0100 |
parents | ec657d1a62a6 |
children | 9f8276ac1cdd |
rev | line source |
---|---|
610
ec657d1a62a6
fix compatibility with python3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
1 #!/usr/bin/env python3 |
370
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 # Orthanc - A Lightweight, RESTful DICOM Store |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 # Department, University Hospital of Liege, Belgium |
511
933fe1bbce4f
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
449
diff
changeset
|
6 # Copyright (C) 2017-2023 Osimis S.A., Belgium |
933fe1bbce4f
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
449
diff
changeset
|
7 # Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
370
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 # |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 # This program is free software: you can redistribute it and/or |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 # modify it under the terms of the GNU General Public License as |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 # published by the Free Software Foundation, either version 3 of the |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 # License, or (at your option) any later version. |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 # |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 # This program is distributed in the hope that it will be useful, but |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 # WITHOUT ANY WARRANTY; without even the implied warranty of |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 # General Public License for more details. |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 # |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 # You should have received a copy of the GNU General Public License |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 import json |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 import os |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 import subprocess |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 import sys |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 import time |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 import Toolbox |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 if len(sys.argv) != 2: |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 print('Must provide a path to Orthanc binaries') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 exit(-1) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 TMP = '/tmp/OrthancTest' |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 CONFIG = os.path.join(TMP, 'Configuration.json') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 if os.path.exists(TMP): |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 print('Temporary path already exists: %s' % TMP) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 exit(-1) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 os.mkdir(TMP) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 ORTHANC = Toolbox.DefineOrthanc(username = 'orthanc', |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 password = 'orthanc') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 def IsHttpServerSecure(config): |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 with open(CONFIG, 'w') as f: |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 f.write(json.dumps(config)) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 process = subprocess.Popen( |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 [ sys.argv[1], CONFIG ], |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 cwd = TMP, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 #stdout=subprocess.PIPE, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 stderr=subprocess.PIPE, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 #shell=True |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 ) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 time.sleep(1) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 while True: |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 try: |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 system = Toolbox.DoGet(ORTHANC, '/system') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 break |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 except: |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 time.sleep(0.1) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 process.terminate() |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 process.wait() |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 return system['IsHttpServerSecure'] |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 def Assert(b): |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 if not b: |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 raise Exception('Bad result') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 print('==== TEST 1 ====') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 Assert(IsHttpServerSecure({ |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
83 'RemoteAccessAllowed': False, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
84 'RegisteredUsers' : { } |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 })) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
86 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
87 print('==== TEST 2 ====') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 Assert(IsHttpServerSecure({ |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
89 'RemoteAccessAllowed': False, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
90 'AuthenticationEnabled': False, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 'RegisteredUsers' : { } |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
92 })) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
93 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 print('==== TEST 3 ====') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
95 Assert(IsHttpServerSecure({ |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
96 'RemoteAccessAllowed': False, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
97 'AuthenticationEnabled': True, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 'RegisteredUsers' : { 'orthanc' : 'orthanc' } |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 })) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 print('==== TEST 4 ====') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 Assert(not IsHttpServerSecure({ |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
103 'RemoteAccessAllowed': True |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
104 })) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
105 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
106 print('==== TEST 5 (server application scenario) ====') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
107 Assert(not IsHttpServerSecure({ |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
108 'RemoteAccessAllowed': True, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
109 'AuthenticationEnabled': False, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
110 })) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
111 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
112 print('==== TEST 6 ====') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
113 Assert(IsHttpServerSecure({ |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
114 'RemoteAccessAllowed': True, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
115 'AuthenticationEnabled': True, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
116 'RegisteredUsers' : { 'orthanc' : 'orthanc' } |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
117 })) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
118 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
119 print('==== TEST 7 (Docker scenario) ====') |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
120 Assert(not IsHttpServerSecure({ |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
121 'RemoteAccessAllowed': True, |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
122 'AuthenticationEnabled': True |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
123 })) |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
124 |
7eb5b86508b1
added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
125 print('Success!') |