diff options
author | vrvarma <vv8305@att.com> | 2019-04-10 15:13:38 -0400 |
---|---|---|
committer | vrvarma <vv8305@att.com> | 2019-04-10 15:45:20 -0400 |
commit | 75f7a15a5a14af434e0e8430fcec880106d64dbf (patch) | |
tree | a42df7dc1a43b1d3156f1a941f42b504f2e865e8 /osdfapp.py | |
parent | 4198ff2f181030c73b4cf43979fd8a40adf80f70 (diff) |
Implement osdf code to enable ssl
Fix aaf related permissions
Change-Id: Id458d7198d1ccef66e816d39bb7f8dce787c9a80
Signed-off-by: vrvarma <vv8305@att.com>
Issue-ID: OPTFRA-223
Signed-off-by: vrvarma <vv8305@att.com>
Diffstat (limited to 'osdfapp.py')
-rwxr-xr-x | osdfapp.py | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -21,6 +21,7 @@ OSDF Manager Main Flask Application """ import json +import ssl import sys import traceback from optparse import OptionParser @@ -99,6 +100,12 @@ def handle_data_error(e): def do_osdf_health_check(): """Simple health check""" audit_log.info("A health check request is processed!") + return "OK" + + +@app.route("/api/oof/loadmodels/v1", methods=["GET"]) +def do_osdf_load_policies(): + audit_log.info("Uploading policy models") """Upload policy models""" response = upload_policy_models() audit_log.info(response) @@ -196,6 +203,13 @@ def get_options(argv): return opts +def build_ssl_context(): + ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) + ssl_context.set_ciphers('ECDHE-RSA-AES128-SHA256:EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH') + ssl_context.load_cert_chain(sys_conf['ssl_context'][0], sys_conf['ssl_context'][1]) + return ssl_context + + if __name__ == "__main__": sys_conf = osdf_config['core']['osdf_system'] @@ -207,7 +221,7 @@ if __name__ == "__main__": ssl_opts = sys_conf.get('ssl_context') if ssl_opts: - common_app_opts.update({'ssl_context': tuple(ssl_opts)}) + common_app_opts.update({'ssl_context': build_ssl_context()}) opts = get_options(sys.argv) # Load secrets from SMS |