annotate Tests/CheckHttpServerSecurity.py @ 649:5d7b6e43ab7d

updated copyright, as Orthanc Team now replaces Osimis
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 30 May 2024 21:51:11 +0200
parents 9f8276ac1cdd
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
649
5d7b6e43ab7d updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 640
diff changeset
6 # Copyright (C) 2017-2023 Osimis S.A., Belgium
5d7b6e43ab7d updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 640
diff changeset
7 # Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
640
9f8276ac1cdd update year to 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 610
diff changeset
8 # Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
370
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 #
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 # 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
11 # 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
12 # 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
13 # 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
14 #
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 # 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
16 # 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
17 # 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
18 # General Public License for more details.
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 #
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 # 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
21 # 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
22
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 import json
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 import os
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 import subprocess
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 import sys
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 import time
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 import Toolbox
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 if len(sys.argv) != 2:
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 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
33 exit(-1)
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
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 TMP = '/tmp/OrthancTest'
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 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
38
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 if os.path.exists(TMP):
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 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
41 exit(-1)
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 os.mkdir(TMP)
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
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 ORTHANC = Toolbox.DefineOrthanc(username = 'orthanc',
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 password = 'orthanc')
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
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 def IsHttpServerSecure(config):
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 with open(CONFIG, 'w') as f:
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 f.write(json.dumps(config))
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 process = subprocess.Popen(
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 [ sys.argv[1], CONFIG ],
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 cwd = TMP,
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 #stdout=subprocess.PIPE,
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 stderr=subprocess.PIPE,
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 #shell=True
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
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 time.sleep(1)
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 while True:
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 try:
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 system = Toolbox.DoGet(ORTHANC, '/system')
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 break
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 except:
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 time.sleep(0.1)
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 process.terminate()
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 process.wait()
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 return system['IsHttpServerSecure']
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
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 def Assert(b):
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 if not b:
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 raise Exception('Bad result')
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
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 print('==== TEST 1 ====')
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 Assert(IsHttpServerSecure({
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 'RemoteAccessAllowed': False,
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 'RegisteredUsers' : { }
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
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 print('==== TEST 2 ====')
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 Assert(IsHttpServerSecure({
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 'RemoteAccessAllowed': False,
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 'AuthenticationEnabled': False,
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 'RegisteredUsers' : { }
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
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 print('==== TEST 3 ====')
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 Assert(IsHttpServerSecure({
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 'RemoteAccessAllowed': False,
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 'AuthenticationEnabled': True,
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 'RegisteredUsers' : { 'orthanc' : 'orthanc' }
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
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 print('==== TEST 4 ====')
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 Assert(not IsHttpServerSecure({
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 'RemoteAccessAllowed': True
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
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 print('==== TEST 5 (server application scenario) ====')
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 Assert(not IsHttpServerSecure({
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 'RemoteAccessAllowed': True,
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 'AuthenticationEnabled': False,
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
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 print('==== TEST 6 ====')
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 Assert(IsHttpServerSecure({
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 'RemoteAccessAllowed': True,
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 'AuthenticationEnabled': True,
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 'RegisteredUsers' : { 'orthanc' : 'orthanc' }
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
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 print('==== TEST 7 (Docker scenario) ====')
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 Assert(not IsHttpServerSecure({
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 'RemoteAccessAllowed': True,
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 'AuthenticationEnabled': True
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
7eb5b86508b1 added Tests/CheckHttpServerSecurity.py and Tests/CheckIngestTranscoding.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 print('Success!')