1
0
mirror of https://github.com/certbot/certbot.git synced 2026-01-26 07:41:33 +03:00

35 Commits

Author SHA1 Message Date
Brad Warren
d1330efe41 Print warning when certbot-auto has insecure permissions. (#6995)
This PR attempts to better inform people about the problem identified at https://community.letsencrypt.org/t/certbot-auto-deployment-best-practices/91979/.

I was hesitant to add the flag --no-permissions-check, however, if there's some obscure distro out there (or custom user setup) that has a strange users and groups, I didn't want us to either:

Have to put out a bug fix release
Refuse to fix the problem and let them deal with warnings on every run

* add check_permissions.py

* Update letsencrypt-auto.template.

* build letsencrypt-auto

* Add test_permissions_warnings to auto_test

* Allow uid/gid < 1000.

* Add --no-permissions-check to Certbot.

* Add --no-permissions-check to certbot-auto.

* Add test farm test that letsencrypt-auto is quiet.

As a bonus, this new test will catch problems like the one that the caused
0.33.1 point release.

* Update CHANGELOG about permissions check.

* Update permissions comment.

* Fix symlink handling.

* Use a better default in auto_test.py.
2019-04-30 10:45:03 -07:00
Adrien Ferrand
78cf8ec4de Protect certbot-auto against automated downgrades (#6448)
With current code, the certbot-auto self-upgrade process can make it actually to downgrade itself, because the comparison done is an equality test between local certbot-auto version and the remote one. This is a flaw for attackers, that could make certbot-auto break itself by falsely advertising it about an old version as the latest one available.

A function is added to make a more advanced comparison between version. Certbot-auto will upgrade itself only if the local version is strictly inferior to the latest one available. For instance, a version 0.28.0 will not upgrade itself if the latest one available on internet is 0.27.1. Similarly, non-official versions like 0.28.0.dev0 will never trigger a self-upgrade, to help development workflows.

This implementation relies only on the Python distribution installed by certbot-auto (supporting 2.7+) and basic shell operations, to be compatible with any UNIX-based system.

* Check version with protection again downgrade

* Create a stable version of letsencrypt-auto to use correctly self-upgrade functionality

* Update letsencrypt-auto-source/letsencrypt-auto.template
2018-11-19 14:28:59 -08:00
ohemorange
5ff7f2211e Explicitly add six as a dependency in letsencrypt-auto-source dockerfiles (#5808)
* update documentation

* explicitly add six as a dependency in letsencrypt-auto-source dockerfiles

* pin six version
2018-03-29 15:34:38 -07:00
cclauss
e405aaa4c1 Fix print() and xrange() for Python 3 (#5590) 2018-03-14 09:37:29 -07:00
Brad Warren
b18696b6a0 Don't run tests with Python 2.6 (#5627)
* Don't run tests with Python 2.6.

* Revert "Don't run tests with Python 2.6."

This reverts commit 4a9d778cca.

* Revert changes to auto_test.py.
2018-02-27 16:47:43 -08:00
Hugo
42638afc75 Drop support for EOL Python 2.6 and 3.3
* Drop support for EOL Python 2.6

* Use more helpful assertIn/NotIn instead of assertTrue/False

* Drop support for EOL Python 3.3

* Remove redundant Python 3.3 code

* Restore code for RHEL 6 and virtualenv for Py2.7

* Revert pipstrap.py to upstream

* Merge py26_packages and non_py26_packages into all_packages

* Revert changes to *-auto in root

* Update by calling letsencrypt-auto-source/build.py

* Revert permissions for pipstrap.py
2018-02-16 16:14:01 -08:00
Brad Warren
a1aba5842e Fix --no-bootstrap on CentOS/RHEL 6 (#5476)
* fix --no-bootstrap on RHEL6

* Add regression test
2018-01-24 22:23:20 -08:00
Brad Warren
887a6bcfce Handle need to rebootstrap before fetch.py (#5389)
* Fix #5387

* Add test for #5387

* remove LE_PYTHON

* Use environment variable to reduce line length
2018-01-09 15:40:26 -08:00
Joona Hoikkala
288c4d956c Automatically install updates in test script (#5394) 2018-01-09 08:28:52 -08:00
ohemorange
8585cdd861 Deprecate Python2.6 by using Python3 on CentOS/RHEL 6 (#5329)
* If there's no python or there's only python2.6 on red hat systems, install python3

* Always check for python2.6

* address style, documentation, nits

* factor out all initialization code

* fix up python version return value when no python installed

* add no python error and exit

* document DeterminePythonVersion parameters

* build letsencrypt-auto

* close brace

* build leauto

* fix syntax errors

* set USE_PYTHON_3 for all cases

* rip out NOCRASH

* replace NOCRASH, update LE_PYTHON set logic

* use built-in venv for py3

* switch to LE_PYTHON not affecting bootstrap selection and not overwriting LE_PYTHON

* python3ify fetch.py

* get fetch.py working with python2 and 3

* don't verify server certificates in fetch.py HttpsGetter

* Use SSLContext and an environment variable so that our tests continue to never verify server certificates.

* typo

* build

* remove commented out code

* address review comments

* add documentation for YES_FLAG and QUIET_FLAG

* Add tests to centos6 Dockerfile to make sure we install python3 if and only if appropriate to do so.
2018-01-08 13:57:04 -08:00
Brad Warren
ed2168aaa8 Fix auto_tests on systems with new bootstrappers (#5348) 2017-12-21 16:55:21 -08:00
Brad Warren
48173ed1cb Switch from nose to pytest (#5282)
* Use pipstrap to install a good version of pip

* Use pytest in cb-auto tests

* Remove nose usage in auto_test.py

* remove nose dev dep

* use pytest in test_tests

* Use pytest in tox

* Update dev dependency pinnings

* remove nose multiprocess lines

* Use pytest for coverage

* Use older py and pytest for old python versions

* Add test for Error.__str__

* pin pytest in oldest test

* Fix tests for DNS-DO plugin on py26

* Work around bug for Python 3.3

* Clarify dockerfile comments
2017-12-01 10:59:55 -08:00
Brad Warren
56db211367 Change certbot-auto's installation path to /opt (#4970)
* Update comment about root usage.

* run all of certbot-auto as root

* remove other $SUDO uses from template

* remove $SUDO usage from bootstrappers

* default venv path = /opt/eff.org/certbot/venv

* Create symlinks from old default venvs

* Delete old venv path when it exists.

Also, quote expansion of paths.

* fix typo

* Separate venv_dir and le_auto_path

* Deduplicate code with test_dirs()

* Ignore cleanup errors.

This is caused by subdirectories being owned by root.

* Split test into test_phase2_upgrade.

* Rename test_dirs to temp_paths for clarity.

* Check both venvs before bootstrapping again.

* Use OLD_VENV_PATH/bin

* Preserve environment with sudo.

* Remove "esp. under sudo" comment.

* Export *VENV_PATH.

* Change check for OLD_VENV installation.

This approach better handles manually set VENV_PATH values.

* Remove SUDO_ENV.

* Print message before requesting root privileges.

* Make a function for selecting root auth method.

* Address @erikrose's feedback.
2017-08-21 12:23:09 -07:00
Amjad Mashaal
1e27e43c14 Expanding tests for le-auto, adding CentOS test suite (#2671)
* Adding Dockerfile for CentOS 6

* Adding CentOS 7 to LEA tests

* Enabling CentOS 6 LEA test

* Removing CentOS 7

* Fixing nits

* Using yum to install epel-release
2016-11-10 15:05:03 -08:00
Peter Eckersley
731f9a2dee Merge pull request #2926 from TheNavigat/auto_test_fix
Fixing auto_test.py for Python 2.6
2016-05-27 14:39:44 -07:00
Noah Swartz
22badb2380 tests pass? 2016-05-19 17:29:39 -07:00
Noah Swartz
0bb8b0bcd5 change invocation 2016-05-19 12:27:17 -07:00
Noah Swartz
409640fb87 le to cb for test package 2016-05-19 12:05:42 -07:00
Noah Swartz
e8e009cc85 Revert "update secret pypi?"
This reverts commit 55755d818a.
2016-05-18 17:00:42 -07:00
Noah Swartz
55755d818a update secret pypi? 2016-05-18 15:42:55 -07:00
Noah Swartz
01ebab26bf update pypi for auto 2016-05-18 14:21:57 -07:00
Amjad Mashaal
d57c943471 Fixing broken tests 2016-05-18 01:57:48 +02:00
Amjad Mashaal
12a0312282 Fixing auto_test.py for Python 2.6 2016-05-18 01:57:48 +02:00
Brad Warren
45681909c7 Selectively rename le-auto strings 2016-04-20 14:39:26 -04:00
Brad Warren
99382b9f5b Merge branch 'pip8' 2016-03-08 15:49:52 -08:00
Erik Rose
d791697b93 If le-auto's installation fails, delete the venv. Fix #2332.
Leaving broken venvs around can, if it got as far as installing the venv/bin/letsencrypt script, wreck future le-auto runs, since the presence of that script means "a working LE is installed" to it. Waiting until a new version of le-auto comes out and running it would recover, but this lets re-running the same version recover as well.
2016-02-11 17:17:09 -05:00
Erik Rose
b20eab67ce Remove errant DS_Store. Ick. 2016-01-19 16:10:39 -05:00
Erik Rose
d8130974c7 Upgrade half-sign to sha256. Bring back old le-auto temporarily. Improve le-auto's option parsing.
If the new le-auto works well in the minutes or hours after release, we'll make another commit to master that removes the old le-auto and bootstrap scripts.

Close https://github.com/erikrose/letsencrypt/pull/2.
2016-01-13 13:12:34 -05:00
Erik Rose
86266f5fe1 Remove backported Python 2.7 assertion helpers.
I didn't backport their imports, so they had NameErrors in the failure case anyway. And, because of the docker image, these tests currently are run under only 2.7 at the moment.
2016-01-13 12:50:12 -05:00
Brad Warren
ab07620504 Fixed fake letsencrypt hash 2016-01-13 09:30:54 -08:00
Brad Warren
7945db7a2d Rebuild sdist 2016-01-13 09:30:54 -08:00
Brad Warren
e192cce1fc Fix fake letsencrypt 2016-01-13 09:30:54 -08:00
Erik Rose
6c05197a43 Remove mock as an install requirement.
The motivation is to free us of a reliance on a rather modern version of setuptools, which caused le-auto failures for people on Wheezy and other older distros. (The alternative would have been to forcibly upgrade setuptools as the old le-auto did, but less is more.)

Mock is used only in tests, so we move it to tests_require. It will still be installed automatically when setup.py test is run. Give all packages a test_suite so this works.

The "testing" extra remains for optional packages not required for the nose tests but used in tox. However, the extra is much less useful now and is a candidate for deletion. We could roll the list of packages therein into the tox config so as not to favor any particular package.

Remove tests_require=install_requires, which I don't think does anything useful, since install requirements are implicitly installed when running setup.py test.

Fix tests to pass with mock removed. We had to stop them pulling down LE from PyPI, since the current version there (0.1.1) requires mock and explodes when `letsencrypt` is run.
2016-01-11 21:26:41 -05:00
Erik Rose
5512838377 Get le-auto tests running on Travis. 2016-01-08 17:39:51 -05:00
Erik Rose
cd43e9035b Rename letsencrypt_auto dir to match other dirs.
Originally, I had it in mind to move letsencrypt-auto inside this dir. However, now we'd like to copy it or link it to the root level, where people are used to finding it (at least for awhile). Since it would be confusing to have a letsencrypt-auto and a letsencrypt_auto right next to each other, we rename this folder.
2016-01-08 16:26:25 -05:00