Skip to content

Commit

Permalink
updating image to improve security (#133)
Browse files Browse the repository at this point in the history
* updating image to improve security
* need to use psycogp2-binary
* updating headers

Signed-off-by: vsoch <vsochat@stanford.edu>
  • Loading branch information
vsoch committed Dec 9, 2020
1 parent 4744a05 commit 25468f7
Show file tree
Hide file tree
Showing 41 changed files with 42 additions and 75 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Critical items to know are:


## [v3.x](https://github.com/expfactory/expfactory/tree/master) (master)
- update of base images to ubuntu 20.04 (3.18)
- removing uneeded import of secure_filename (3.17)
- adding black lint formatting (3.16)
- pinning flask version to known working (3.15)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion examples/docker/custom-container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN cp expfactory/config_dummy.py expfactory/config.py && \
chmod u+x /opt/expfactory/script/generate_key.sh && \
/bin/bash /opt/expfactory/script/generate_key.sh /opt/expfactory/expfactory/config.py
RUN python3 setup.py install
RUN python3 -m pip install pyaml pymysql psycopg2==2.7.5
RUN python3 -m pip install pyaml pymysql psycopg2-binary
RUN apt-get clean # tests, mysql, postgres

########################################
Expand Down
2 changes: 1 addition & 1 deletion expfactory/api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
api.py: part of expfactory package
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion expfactory/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
client initialization: part of expfactory package
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion expfactory/cli/build.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion expfactory/cli/install.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion expfactory/cli/list.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion expfactory/cli/logs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion expfactory/cli/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion expfactory/cli/users.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
33 changes: 0 additions & 33 deletions expfactory/config_dummy.py
Original file line number Diff line number Diff line change
@@ -1,36 +1,3 @@
"""
Copyright (c) 2017-2020, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""

import os

WTF_CSRF_ENABLED = True
Expand Down
2 changes: 1 addition & 1 deletion expfactory/database/filesystem.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion expfactory/database/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
models.py: datanases for the expfactory package
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion expfactory/database/relational.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion expfactory/database/sqlite.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion expfactory/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
case that required = True. A required = True variable not found
will system exit with an error.
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion expfactory/experiment.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
experiment.py: part of expfactory package
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion expfactory/forms.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
views.py: part of expfactory package
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion expfactory/logger/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
logger/message.py: Python logger base for expfactory
Copyright (c) 2016-2020 Vanessa Sochat
Copyright (c) 2016-2021 Vanessa Sochat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion expfactory/logger/spinner.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
logger/spinner.py: Simple spinner for logger
Copyright (c) 2017-2020 Vanessa Sochat
Copyright (c) 2017-2021 Vanessa Sochat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion expfactory/server.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Copyright (c) 2016-2020, Vanessa Sochat
Copyright (c) 2016-2021, Vanessa Sochat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion expfactory/templates/build/docker/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RUN cp expfactory/config_dummy.py expfactory/config.py && \
chmod u+x /opt/expfactory/script/generate_key.sh && \
/bin/bash /opt/expfactory/script/generate_key.sh /opt/expfactory/expfactory/config.py
RUN python3 setup.py install
RUN python3 -m pip install pyaml pymysql psycopg2==2.7.5
RUN python3 -m pip install pyaml pymysql psycopg2-binary
RUN apt-get clean # tests, mysql, postgres

########################################
Expand Down
2 changes: 1 addition & 1 deletion expfactory/templates/build/docker/Dockerfile.https
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN cp expfactory/config_dummy.py expfactory/config.py && \
chmod u+x /opt/expfactory/script/generate_key.sh && \
/bin/bash /opt/expfactory/script/generate_key.sh /opt/expfactory/expfactory/config.py
RUN python3 setup.py install
RUN python3 -m pip install pyaml pymysql psycopg2==2.7.5
RUN python3 -m pip install pyaml pymysql psycopg2-binary
RUN apt-get clean # tests, mysql, postgres

########################################
Expand Down
2 changes: 1 addition & 1 deletion expfactory/templates/build/docker/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN cp expfactory/config_dummy.py expfactory/config.py && \
chmod u+x /opt/expfactory/script/generate_key.sh && \
/bin/bash /opt/expfactory/script/generate_key.sh /opt/expfactory/expfactory/config.py
RUN python3 setup.py install
RUN python3 -m pip install pyaml pymysql psycopg2==2.7.5
RUN python3 -m pip install pyaml pymysql psycopg2-binary
RUN apt-get clean # tests, mysql, postgres

########################################
Expand Down
5 changes: 2 additions & 3 deletions expfactory/templates/build/docker/builder-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
FROM ubuntu:18.04
FROM ubuntu:20.04

# docker build -t quay.io/vanessa/expfactory-builder:base .

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y nginx \
git \
python3-pip \
python3-dev \
python \
libyaml-dev \
libssl-dev \
python-dev \
libffi-dev
ENV DEBIAN_FRONTEND noninteractive
2 changes: 1 addition & 1 deletion expfactory/templates/experiments/template.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'''
dynamic_views.py: part of expfactory package
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion expfactory/testing/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
Test experiments
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion expfactory/testing/test_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
Test experiments
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion expfactory/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
utils.py: part of expfactory package
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion expfactory/validator/experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
validators/experiments.py: python functions to validate experiments and library
experiment objects
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion expfactory/validator/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
validators/library.py: python functions to validate library
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021 Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion expfactory/validator/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
validators/runtime.py: python functions to validate deployments
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion expfactory/validator/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
validators/utils.py: utility functions for validation objects
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion expfactory/variables.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Copyright (c) 2018-2020, Vanessa Sochat
Copyright (c) 2018-2021, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions expfactory/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -30,7 +30,7 @@
"""

__version__ = "3.17"
__version__ = "3.18"
AUTHOR = "Vanessa Sochat"
AUTHOR_EMAIL = "vsochat@stanford.edu"
NAME = "expfactory"
Expand Down
2 changes: 1 addition & 1 deletion expfactory/views/database.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
database.py: part of expfactory package
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion expfactory/views/general.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
general.py: part of expfactory package
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion expfactory/views/headless.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
headless.py: part of expfactory package
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion expfactory/views/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
views.py: part of expfactory package
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion expfactory/views/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
views.py: part of expfactory package
Copyright (c) 2017-2020, Vanessa Sochat
Copyright (c) 2017-2021, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down

0 comments on commit 25468f7

Please sign in to comment.