Compare commits

...

2725 Commits

Author SHA1 Message Date
5e5e72ca86 Merge pull request #3471 from hosseinsh/aut0mate-bump-version
Automate bump version
2021-03-12 11:20:24 -08:00
29b5c554d6 allow automatic version bumping 2021-03-12 10:42:59 -08:00
d1c21fa23a updating version number 2021-03-12 10:11:47 -08:00
c2ec095532 Merge pull request #3468 from Netflix/change-log-0.8.1
Change log for 0.8.1
2021-03-12 09:55:57 -08:00
d7f413efe3 Merge branch 'master' into change-log-0.8.1 2021-03-12 09:35:11 -08:00
66e7acf773 Merge pull request #3467 from jtschladen/doc-fix
Doc fix
2021-03-11 17:24:31 -08:00
a630721a3a Update CHANGELOG.rst 2021-03-11 17:16:03 -08:00
97bdb8a00a Change log for 0.8.1 2021-03-11 17:14:51 -08:00
2b7c151426 Add missing dependency 2021-03-11 17:10:13 -08:00
00e0609547 Doc fix 2021-03-11 17:04:28 -08:00
e5eba715b6 Merge pull request #3464 from hosseinsh/acme-preferred-chain
Support for selecting the ACME preferred chain
2021-03-11 16:32:54 -08:00
1fd6959403 Merge branch 'master' into acme-preferred-chain 2021-03-11 12:38:45 -08:00
932a4489e7 Merge pull request #3466 from Netflix/security_doc_update
Update security disclosure documentation
2021-03-11 12:38:17 -08:00
6e4dd15790 Merge branch 'master' into acme-preferred-chain 2021-03-11 11:57:47 -08:00
bbc6c0dc5f Merge branch 'master' into security_doc_update 2021-03-10 20:08:03 -08:00
04b9df0a34 Update Security disclosure process 2021-03-10 19:58:41 -08:00
e64f4028d4 Merge pull request #3465 from Netflix/hosseinsh-publish-release
Automate Lemur release
2021-03-10 18:03:12 -08:00
8d44ab2124 Automate Lemur release
Lemur's current release publishing is done manual, which comes with overheads and slows down the release cycle.

Automating this operation would allow Lemur to make more frequent releases, for instance at least once a week to pick up the latest dependency updates.
2021-03-10 16:41:24 -08:00
9e37793cb5 Merge branch 'master' into acme-preferred-chain 2021-03-10 14:01:13 -08:00
e48f4ffe77 improved documentation 2021-03-10 13:29:53 -08:00
13539814db adding documentation 2021-03-10 13:23:21 -08:00
addaa3ab13 adding the config as an example 2021-03-10 12:43:58 -08:00
45712c582b fixing the mock to include the alternative chain 2021-03-10 12:43:36 -08:00
4937c5dc2c testing test_extract_cert_and_chain 2021-03-10 12:42:42 -08:00
caa44c1531 adding functionality to fetch the desired chain 2021-03-10 12:39:50 -08:00
f2205b6025 new test vectors 2021-03-09 19:51:55 -08:00
b2bfff341f adding cert
bot
2021-03-09 19:50:52 -08:00
df17337075 Merge pull request #3458 from Netflix/dependabot/pip/boto3-1.17.22 2021-03-08 20:40:46 +00:00
03014ac194 Bump boto3 from 1.17.17 to 1.17.22
Bumps [boto3](https://github.com/boto/boto3) from 1.17.17 to 1.17.22.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.17.17...1.17.22)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-08 20:02:10 +00:00
6547e028b3 Merge pull request #3457 from Netflix/dependabot/pip/botocore-1.20.22 2021-03-08 19:59:00 +00:00
d779c74e84 Bump botocore from 1.20.17 to 1.20.22
Bumps [botocore](https://github.com/boto/botocore) from 1.20.17 to 1.20.22.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.20.17...1.20.22)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-08 19:40:20 +00:00
72852af3a9 Merge pull request #3460 from Netflix/dependabot/pip/acme-1.13.0 2021-03-08 19:37:20 +00:00
b319b335a7 Bump acme from 1.12.0 to 1.13.0
Bumps [acme](https://github.com/letsencrypt/letsencrypt) from 1.12.0 to 1.13.0.
- [Release notes](https://github.com/letsencrypt/letsencrypt/releases)
- [Commits](https://github.com/letsencrypt/letsencrypt/compare/v1.12.0...v1.13.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-08 18:30:02 +00:00
39b7e10bfe Merge pull request #3459 from Netflix/dependabot/pip/pre-commit-2.11.0 2021-03-08 18:27:13 +00:00
31180fdca8 Bump pre-commit from 2.10.1 to 2.11.0
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.10.1 to 2.11.0.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.10.1...v2.11.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-08 17:58:02 +00:00
7fb13c7939 Merge pull request #3461 from Netflix/dependabot/pip/sphinx-3.5.2 2021-03-08 17:55:48 +00:00
396cc5db40 Bump sphinx from 3.5.1 to 3.5.2
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.5.1 to 3.5.2.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.5.1...v3.5.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-08 17:26:35 +00:00
0276d1a6f8 Merge pull request #3462 from Netflix/dependabot/pip/arrow-1.0.3 2021-03-08 17:24:12 +00:00
48aeb26b1a Bump arrow from 1.0.2 to 1.0.3
Bumps [arrow](https://github.com/arrow-py/arrow) from 1.0.2 to 1.0.3.
- [Release notes](https://github.com/arrow-py/arrow/releases)
- [Changelog](https://github.com/arrow-py/arrow/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/arrow-py/arrow/compare/1.0.2...1.0.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-08 13:37:03 +00:00
2e43211496 Merge pull request #3455 from hosseinsh/exclude-revoked-certs-default-autorotatet
Exclude revoked certs from defaulting them to auto-rotate
2021-03-05 11:04:24 -08:00
580506f605 lint 2021-03-04 19:21:26 -08:00
fdd6140995 typo and removing unused session commit 2021-03-04 19:16:06 -08:00
c579405805 since we have created an endpoint, need to iterate on this endpoint_id here 2021-03-04 19:13:40 -08:00
8e5e8fdd03 tests 2021-03-04 19:12:57 -08:00
e530664da6 exclude revoked certs from default to auto-rotate 2021-03-04 19:11:20 -08:00
cf7de0aa59 Merge pull request #3454 from hosseinsh/gulp-buffer
Addressing Gulp Deprecation warning
2021-03-03 16:43:13 -08:00
d73b334958 Merge branch 'master' into gulp-buffer 2021-03-03 16:15:05 -08:00
a724aa6c26 Merge pull request #3453 from hosseinsh/moto-upgrade
enumerating the scope of moto package as required by 2.0.0
2021-03-03 16:04:31 -08:00
a4e12f0d75 (node:73186) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. 2021-03-03 16:02:04 -08:00
3062d31800 Merge branch 'master' into moto-upgrade 2021-03-03 15:36:58 -08:00
b118fbbc3b Merge pull request #3452 from hosseinsh/sts-config
AWS STS regional config
2021-03-03 15:36:38 -08:00
6f197b255f enumerating the scope of moto package as required by 2.0.0 2021-03-03 15:31:20 -08:00
c3eb463c42 documentation 2021-03-03 14:50:22 -08:00
a49570e5f9 sts seems to require the region where Lemur is deployed 2021-03-03 14:24:22 -08:00
576122393b Merge pull request #3451 from Netflix/dependabot/pip/arrow-1.0.2 2021-03-02 02:38:39 +00:00
aabc7ea319 Bump arrow from 0.17.0 to 1.0.2
Bumps [arrow](https://github.com/arrow-py/arrow) from 0.17.0 to 1.0.2.
- [Release notes](https://github.com/arrow-py/arrow/releases)
- [Changelog](https://github.com/arrow-py/arrow/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/arrow-py/arrow/compare/0.17.0...1.0.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-01 22:18:28 +00:00
59149186cb Merge pull request #3449 from Netflix/dependabot/pip/boto3-1.17.17 2021-03-01 22:15:51 +00:00
d0d888a7f1 Bump boto3 from 1.17.15 to 1.17.17
Bumps [boto3](https://github.com/boto/boto3) from 1.17.15 to 1.17.17.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.17.15...1.17.17)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-01 21:34:19 +00:00
f8fb5754f0 Merge pull request #3448 from Netflix/dependabot/pip/pytest-flask-1.2.0 2021-03-01 21:30:58 +00:00
735e7b10f9 Bump pytest-flask from 1.1.0 to 1.2.0
Bumps [pytest-flask](https://github.com/pytest-dev/pytest-flask) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/pytest-dev/pytest-flask/releases)
- [Changelog](https://github.com/pytest-dev/pytest-flask/blob/master/docs/changelog.rst)
- [Commits](https://github.com/pytest-dev/pytest-flask/compare/1.1.0...1.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-01 21:02:28 +00:00
5f0e61122d Merge pull request #3447 from Netflix/dependabot/pip/coverage-5.5 2021-03-01 20:59:52 +00:00
1b4d511db2 Bump coverage from 5.4 to 5.5
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.4 to 5.5.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/coverage-5.4...coverage-5.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-01 19:22:35 +00:00
603d89bffe Merge pull request #3446 from Netflix/dependabot/pip/botocore-1.20.17 2021-03-01 19:19:40 +00:00
cf7cf74bb0 Bump botocore from 1.20.15 to 1.20.17
Bumps [botocore](https://github.com/boto/botocore) from 1.20.15 to 1.20.17.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.20.15...1.20.17)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-01 18:44:01 +00:00
6676dc245b Merge pull request #3444 from jtschladen/remove-celerybeat-schedule
Remove celerybeat-schedule
2021-02-24 18:28:15 -08:00
30d5df339d Remove celerybear-schedule 2021-02-24 18:09:28 -08:00
d823f5f767 Merge pull request #3443 from jtschladen/fix-docs
Fix docs
2021-02-24 18:04:29 -08:00
a7f8da91b8 Fix docs 2021-02-24 17:42:28 -08:00
0136366c83 Merge pull request #3439 from jtschladen/notification-interval-sns
Include notification interval (converted to days) in SNS notifications
2021-02-24 17:34:47 -08:00
8824156d4f Merge branch 'master' into notification-interval-sns 2021-02-24 17:16:45 -08:00
b3e8bb4bc2 Merge pull request #3433 from Netflix/dependabot/pip/cryptography-3.4.6 2021-02-25 01:10:35 +00:00
72b4e93e06 Bump cryptography from 3.4.5 to 3.4.6
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.4.5 to 3.4.6.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.4.5...3.4.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-25 00:49:18 +00:00
1401b21674 Merge pull request #3441 from Netflix/dependabot/pip/boto3-1.17.15 2021-02-25 00:46:04 +00:00
358de8e25e Bump boto3 from 1.17.7 to 1.17.15
Bumps [boto3](https://github.com/boto/boto3) from 1.17.7 to 1.17.15.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.17.7...1.17.15)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-25 00:21:38 +00:00
2eb6fcf75b Merge pull request #3442 from Netflix/dependabot/pip/botocore-1.20.15 2021-02-25 00:18:33 +00:00
775a7b7da8 Bump botocore from 1.20.7 to 1.20.15
Bumps [botocore](https://github.com/boto/botocore) from 1.20.7 to 1.20.15.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.20.7...1.20.15)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-24 23:51:43 +00:00
7293651c7c Merge pull request #3440 from Netflix/dependabot/pip/faker-6.5.0 2021-02-24 23:48:44 +00:00
86dcac26a2 Bump faker from 6.1.1 to 6.5.0
Bumps [faker](https://github.com/joke2k/faker) from 6.1.1 to 6.5.0.
- [Release notes](https://github.com/joke2k/faker/releases)
- [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.md)
- [Commits](https://github.com/joke2k/faker/compare/v6.1.1...v6.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-24 23:05:15 +00:00
d9b2e3559a Merge pull request #3430 from Netflix/dependabot/pip/josepy-1.7.0 2021-02-24 23:02:42 +00:00
6d9dca510e Bump josepy from 1.3.0 to 1.7.0
Bumps [josepy](https://github.com/certbot/josepy) from 1.3.0 to 1.7.0.
- [Release notes](https://github.com/certbot/josepy/releases)
- [Changelog](https://github.com/certbot/josepy/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/certbot/josepy/compare/v1.3.0...v1.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-24 22:36:07 +00:00
3f6248fb5a Merge pull request #3436 from Netflix/dependabot/pip/tabulate-0.8.9 2021-02-24 22:33:40 +00:00
6579630ae7 Bump tabulate from 0.8.7 to 0.8.9
Bumps [tabulate](https://github.com/astanin/python-tabulate) from 0.8.7 to 0.8.9.
- [Release notes](https://github.com/astanin/python-tabulate/releases)
- [Changelog](https://github.com/astanin/python-tabulate/blob/master/CHANGELOG)
- [Commits](https://github.com/astanin/python-tabulate/compare/v0.8.7...v0.8.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-24 21:55:58 +00:00
3dc8f20e93 Merge pull request #3434 from Netflix/dependabot/pip/sphinx-3.5.1 2021-02-24 21:53:27 +00:00
5c91e7431f Merge branch 'master' into notification-interval-sns 2021-02-24 13:42:55 -08:00
1d6023e6d8 Reuse get_option 2021-02-24 13:42:43 -08:00
4c13d1a5a2 Bump sphinx from 3.5.0 to 3.5.1
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.5.0 to 3.5.1.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.5.0...v3.5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-24 21:29:50 +00:00
783676ce52 Merge pull request #3429 from Netflix/dependabot/pip/flask-migrate-2.7.0 2021-02-24 21:27:35 +00:00
d278c6e132 Include notification interval (converted to days) in SNS notifications 2021-02-24 11:43:35 -08:00
d22bec1ec9 Bump flask-migrate from 2.6.0 to 2.7.0
Bumps [flask-migrate](https://github.com/miguelgrinberg/flask-migrate) from 2.6.0 to 2.7.0.
- [Release notes](https://github.com/miguelgrinberg/flask-migrate/releases)
- [Changelog](https://github.com/miguelgrinberg/Flask-Migrate/blob/master/CHANGES.md)
- [Commits](https://github.com/miguelgrinberg/flask-migrate/compare/v2.6.0...v2.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-23 01:21:27 +00:00
de06f13bb1 Merge pull request #3428 from jtschladen/add-remove-certs-for-notification
Add/remove certs for notification UI
2021-02-22 17:18:51 -08:00
811ac1a970 Remove stray comments 2021-02-19 18:27:29 -08:00
b3d0b7ce1b Fix issue with repeatedly adding and removing 2021-02-19 18:25:05 -08:00
fbba3034fc Merge branch 'master' of github.com:Netflix/lemur into add-remove-certs-for-notification 2021-02-19 09:21:21 -08:00
ad5f7aef82 Merge pull request #3426 from jtschladen/fix-docs
Enable fail on warning for docs
2021-02-18 18:08:07 -08:00
931dd26585 Fix style 2021-02-18 17:55:41 -08:00
bc260fabb1 Fix style 2021-02-18 17:45:59 -08:00
0bc66be418 Fix docs and enable fail on warning 2021-02-18 17:23:02 -08:00
cbbbe22bb1 Merge branch 'master' of github.com:Netflix/lemur into add-remove-certs-for-notification 2021-02-18 15:16:34 -08:00
85b053ed98 Ignore submitted certificates 2021-02-18 14:41:28 -08:00
1918b911b3 Make code more parallel 2021-02-18 14:28:15 -08:00
a153781335 Merge pull request #3427 from jtschladen/fix-more-button-notification
Fix "more" button on notification edit dialog
2021-02-18 14:22:00 -08:00
46864f038c Merge 2021-02-18 14:07:55 -08:00
f29abebf64 Merge branch 'master' of github.com:Netflix/lemur into fix-more-button-notification 2021-02-18 13:59:02 -08:00
2fb595046f Merge pull request #3425 from jtschladen/fix-docs
Debug docs
2021-02-17 15:26:31 -08:00
360e4c6154 Remove extra spaces 2021-02-17 15:10:15 -08:00
da9e949e89 Remove extra spaces 2021-02-17 15:08:36 -08:00
00c64ba52f More doc style fixes 2021-02-17 15:02:49 -08:00
5f2e32ff92 Fix AuthorityVisualizations 2021-02-17 14:52:28 -08:00
24c1415983 Fix AuthoritiesList post 2021-02-17 14:47:53 -08:00
40f62a0ad7 Add tabulate 2021-02-17 14:35:55 -08:00
e464e62d01 Add dyn 2021-02-17 14:33:00 -08:00
47121906f5 Add Cloudflare, retrying 2021-02-17 14:25:04 -08:00
824a4b5910 add acme, boto, xmltodict 2021-02-17 14:17:37 -08:00
d4643d760a Add dnspython3 2021-02-17 14:07:06 -08:00
c4a896ecf2 Add josepy 2021-02-17 14:00:42 -08:00
dfad5ae968 Add pyopenssl 2021-02-17 13:56:04 -08:00
8c666b7f0b Add gunicorn 2021-02-17 13:53:22 -08:00
40e5c60c39 Fix some doc warnings 2021-02-17 13:52:20 -08:00
bfe3358b16 Add pyjwt 2021-02-17 13:50:05 -08:00
8086d7afc0 Add marshmallow 2021-02-17 13:47:59 -08:00
6aa6986a14 Add pem 2021-02-17 13:45:58 -08:00
e9e79309c5 Add sqlalchemy-utils 2021-02-17 13:43:49 -08:00
1ab4fe278d Add flask-cors 2021-02-17 13:41:27 -08:00
5e46e2adf0 Add raven 2021-02-17 13:38:15 -08:00
6aff89c1dc Add flask-mail, flask-script 2021-02-17 13:26:13 -08:00
bbdacaccf9 Add flask-principal 2021-02-17 13:22:25 -08:00
c0c1022a5b Add flask-bcrypt 2021-02-17 13:18:49 -08:00
abdf544e06 Add flask-restful 2021-02-17 13:16:16 -08:00
bfa1c067d9 Add flask-migrate 2021-02-17 13:12:10 -08:00
91f6f752db Add inflection 2021-02-17 13:08:40 -08:00
938b962a32 Undo add everything, add just sqlalchemy 2021-02-17 13:05:14 -08:00
b265ecf588 Make sure it's still broken if we add everything 2021-02-17 12:56:27 -08:00
ec9e1c0dd0 Add cryptography 2021-02-17 12:53:49 -08:00
e29ebb4b61 Add arrow 2021-02-17 12:50:46 -08:00
45b84bd088 Debug docs 2021-02-17 12:44:02 -08:00
3049fa6585 Merge pull request #3424 from jtschladen/fix-docs
Debug docs
2021-02-17 11:57:01 -08:00
058877d76b Remove accidental file 2021-02-17 09:47:52 -08:00
160ecd926d Debug docs 2021-02-17 09:42:07 -08:00
01b880a74b Merge pull request #3423 from jtschladen/fix-docs
Fix docs build to include autodoc again
2021-02-17 09:35:41 -08:00
6d336ec79f Merge branch 'master' into fix-docs 2021-02-17 09:13:11 -08:00
697b1ad878 Merge pull request #3422 from jtschladen/fix-apikey-ttl
Fix TTL calculation for API keys
2021-02-17 09:12:56 -08:00
e607210fe9 Add .readthedocs.yml file 2021-02-16 18:22:07 -08:00
8cabffcb70 Attempt to fix docs build 2021-02-16 18:13:04 -08:00
42044e99ae Attempt to fix docs build 2021-02-16 18:07:37 -08:00
e9860ee72a Fix TTL calculation for API keys 2021-02-16 17:54:57 -08:00
9f4e26a961 Merge pull request #3419 from Netflix/dependabot/pip/cryptography-3.4.5 2021-02-15 19:26:32 +00:00
683d9cd769 Bump cryptography from 3.4.2 to 3.4.5
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.4.2 to 3.4.5.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.4.2...3.4.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-15 19:05:11 +00:00
f29685b024 Merge pull request #3421 from Netflix/dependabot/pip/boto3-1.17.7 2021-02-15 19:01:41 +00:00
85d6cd1bfa Bump boto3 from 1.17.3 to 1.17.7
Bumps [boto3](https://github.com/boto/boto3) from 1.17.3 to 1.17.7.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.17.3...1.17.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-15 18:36:46 +00:00
c4e283925b Merge pull request #3420 from Netflix/dependabot/pip/botocore-1.20.7 2021-02-15 18:33:57 +00:00
2c6abd7fe8 Bump botocore from 1.20.3 to 1.20.7
Bumps [botocore](https://github.com/boto/botocore) from 1.20.3 to 1.20.7.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.20.3...1.20.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-15 18:07:56 +00:00
c9beec7333 Merge pull request #3418 from Netflix/dependabot/pip/sphinx-3.5.0 2021-02-15 18:05:13 +00:00
4c5fb1f34e Bump sphinx from 3.4.3 to 3.5.0
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.4.3 to 3.5.0.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.4.3...v3.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-15 17:47:04 +00:00
983015ef04 Merge pull request #3417 from Netflix/dependabot/pip/faker-6.1.1 2021-02-15 17:45:20 +00:00
ecf0997778 Bump faker from 6.0.0 to 6.1.1
Bumps [faker](https://github.com/joke2k/faker) from 6.0.0 to 6.1.1.
- [Release notes](https://github.com/joke2k/faker/releases)
- [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.md)
- [Commits](https://github.com/joke2k/faker/compare/v6.0.0...v6.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-15 13:32:06 +00:00
7582eaeaf3 Merge pull request #3416 from charhate/membership
ECCPRIME256V1 as default for cert create API
2021-02-11 16:12:50 -08:00
ab960a533b Merge branch 'master' into membership 2021-02-11 11:07:00 -08:00
51e90f6fb2 ECCPRIME256V1 as default for cert create API 2021-02-10 20:06:14 -08:00
fb219b2e94 Merge pull request #3415 from charhate/membership
pyjwt from 1.7.1 to 2.0.1
2021-02-10 20:05:50 -08:00
b3f6df6709 Merge branch 'master' into membership 2021-02-10 18:11:07 -08:00
533985ca35 pyjwt from 1.7.1 to 2.0.1 2021-02-10 18:09:20 -08:00
6fd7684d2d Merge pull request #3414 from charhate/membership
Configurable user memberships endpoint
2021-02-10 15:00:05 -08:00
c71f3bfb5c membership API pagination 2021-02-10 13:14:31 -08:00
a4f3ffa2d8 never set admin third party 2021-02-10 12:12:52 -08:00
0c1701314a User memberships 2021-02-10 12:04:06 -08:00
47d617f066 Merge pull request #3404 from hosseinsh/entrust-crosssigned-ecc
support for Entrust cross-signed EC
2021-02-09 10:37:16 -08:00
9ef7f4d549 Merge branch 'master' into entrust-crosssigned-ecc 2021-02-08 17:53:34 -08:00
52b3fa9c79 Merge pull request #3412 from Netflix/dependabot/pip/cryptography-3.4.2 2021-02-08 19:22:05 +00:00
6c33cd0bf3 Bump cryptography from 3.3.1 to 3.4.2
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.3.1 to 3.4.2.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/3.4.2/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.3.1...3.4.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-08 18:48:21 +00:00
3138b99835 Merge pull request #3409 from Netflix/dependabot/pip/boto3-1.17.3 2021-02-08 18:45:15 +00:00
73b1edf096 Bump boto3 from 1.16.63 to 1.17.3
Bumps [boto3](https://github.com/boto/boto3) from 1.16.63 to 1.17.3.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.16.63...1.17.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-08 18:16:11 +00:00
08a3ef9f70 Merge pull request #3410 from Netflix/dependabot/pip/acme-1.12.0 2021-02-08 18:12:52 +00:00
c2fb41f817 Bump acme from 1.11.0 to 1.12.0
Bumps [acme](https://github.com/letsencrypt/letsencrypt) from 1.11.0 to 1.12.0.
- [Release notes](https://github.com/letsencrypt/letsencrypt/releases)
- [Commits](https://github.com/letsencrypt/letsencrypt/compare/v1.11.0...v1.12.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-08 17:55:53 +00:00
62738c86ce Merge pull request #3411 from Netflix/dependabot/pip/hvac-0.10.8 2021-02-08 17:53:45 +00:00
fb9986fefd Bump hvac from 0.10.6 to 0.10.8
Bumps [hvac](https://github.com/hvac/hvac) from 0.10.6 to 0.10.8.
- [Release notes](https://github.com/hvac/hvac/releases)
- [Changelog](https://github.com/hvac/hvac/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/hvac/hvac/compare/v0.10.6...v0.10.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-08 17:29:38 +00:00
c42a2a75b9 Merge pull request #3408 from Netflix/dependabot/pip/pre-commit-2.10.1 2021-02-08 17:27:23 +00:00
2f318a3021 Bump pre-commit from 2.10.0 to 2.10.1
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.10.0 to 2.10.1.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.10.0...v2.10.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-08 17:12:33 +00:00
f02ae5f3a3 Merge pull request #3407 from Netflix/dependabot/pip/faker-6.0.0 2021-02-08 17:10:31 +00:00
72ef9f090d Bump faker from 5.8.0 to 6.0.0
Bumps [faker](https://github.com/joke2k/faker) from 5.8.0 to 6.0.0.
- [Release notes](https://github.com/joke2k/faker/releases)
- [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.md)
- [Commits](https://github.com/joke2k/faker/compare/v5.8.0...v6.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-08 13:34:11 +00:00
db13d8c001 documentation 2021-02-05 11:51:30 -08:00
240c76b3cb support for Entrust cross-signed EC 2021-02-05 11:47:47 -08:00
8ea760337c Merge pull request #3403 from jtschladen/add-Content-Type-to-docs
Add Content-Type to all sample requests
2021-02-04 13:39:37 -08:00
9a0f000259 Add Content-Type to all sample requests 2021-02-04 13:29:10 -08:00
470068f03e Merge pull request #3402 from jtschladen/add-issuer-id-sns-notification
Add "issuer" and "id" fields to SNS notifications
2021-02-04 09:15:43 -08:00
b2afb2b38a Remove unnecessary ID from factory 2021-02-03 17:10:18 -08:00
3a6c80df9a Remove file 2021-02-03 17:09:03 -08:00
19d90b8f1c Add issuer and ID fields to SNS notification format 2021-02-03 17:08:25 -08:00
4459bbef65 Merge pull request #3401 from charhate/log_changes
User' object has no attribute 'name'
2021-02-03 12:40:41 -08:00
d9569a67ab User' object has no attribute 'name' 2021-02-03 12:31:15 -08:00
fae8a3c537 Merge pull request #3399 from Netflix/dependabot/pip/bleach-3.3.0 2021-02-03 19:28:04 +00:00
feecba0c7a Merge branch 'master' into dependabot/pip/bleach-3.3.0 2021-02-03 11:14:54 -08:00
0089a45135 Merge pull request #3400 from jtschladen/apikey-typo
Correct typos on API key creation response page
2021-02-03 09:08:26 -08:00
234f49cac6 Correct typos on API key creation response page 2021-02-02 17:20:51 -08:00
e242b4eaea [Security] Bump bleach from 3.1.4 to 3.3.0
Bumps [bleach](https://github.com/mozilla/bleach) from 3.1.4 to 3.3.0. **This update includes a security fix.**
- [Release notes](https://github.com/mozilla/bleach/releases)
- [Changelog](https://github.com/mozilla/bleach/blob/master/CHANGES)
- [Commits](https://github.com/mozilla/bleach/compare/v3.1.4...v3.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-02 18:01:52 +00:00
b699683fa3 Merge pull request #3389 from sergerdn/feature/travis-python38
improve Travis tests
2021-02-01 16:03:19 -08:00
9fe912892b added missing new line 2021-02-01 15:51:55 -08:00
002e73e184 Indentation 2021-02-01 15:46:22 -08:00
6d367099be Merge branch 'master' into feature/travis-python38 2021-02-01 14:33:39 -08:00
770a9539bb Merge pull request #3398 from hosseinsh/bugfix-out-of-index
resolving the  of index error
2021-02-01 13:13:44 -08:00
189adcb927 resolving the of index error 2021-02-01 12:55:57 -08:00
1fa6d82b71 Merge pull request #3396 from Netflix/dependabot/pip/boto3-1.16.63 2021-02-01 19:27:28 +00:00
9883173450 Bump boto3 from 1.16.60 to 1.16.63
Bumps [boto3](https://github.com/boto/boto3) from 1.16.60 to 1.16.63.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.16.60...1.16.63)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-01 19:18:40 +00:00
464077c52e Merge pull request #3392 from Netflix/dependabot/pip/jinja2-2.11.3 2021-02-01 19:15:38 +00:00
c9462ea8b7 Bump jinja2 from 2.11.2 to 2.11.3
Bumps [jinja2](https://github.com/pallets/jinja) from 2.11.2 to 2.11.3.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/master/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/2.11.2...2.11.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-01 19:06:39 +00:00
67a8023d0e Merge pull request #3395 from Netflix/dependabot/pip/pytest-6.2.2 2021-02-01 19:03:20 +00:00
88dd4d61e2 Bump pytest from 6.2.1 to 6.2.2
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.1 to 6.2.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.2.1...6.2.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-01 18:51:13 +00:00
712553f21f Merge pull request #3397 from Netflix/dependabot/pip/coverage-5.4 2021-02-01 18:49:08 +00:00
144d576d03 Bump coverage from 5.3.1 to 5.4
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.3.1 to 5.4.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/coverage-5.3.1...coverage-5.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-01 18:34:59 +00:00
35abcf76f4 Merge pull request #3393 from Netflix/dependabot/pip/pre-commit-2.10.0 2021-02-01 18:32:34 +00:00
5fd167ad20 Bump pre-commit from 2.9.3 to 2.10.0
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.9.3 to 2.10.0.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.9.3...v2.10.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-01 18:23:44 +00:00
40dd9df617 Merge pull request #3390 from hosseinsh/acme-fixed-attempts
Acme reduce attempts
2021-02-01 10:21:13 -08:00
83e6d153a5 Merge pull request #4 from sergerdn/feature/travis-js
add make test-js to Travis, minor modification in gulp build
2021-01-30 11:57:48 +03:00
50fe03bab4 add make test-js, minor modification in gulp build 2021-01-30 11:56:50 +03:00
69f21234f3 remove test-build-js 2021-01-30 05:26:57 +03:00
c07af5aae2 Merge branch 'master' into feature/travis-python38 2021-01-30 05:08:10 +03:00
8c2b084bb0 Merge branch 'master' into acme-fixed-attempts 2021-01-29 15:56:20 -08:00
31b20e0a30 ensuring a resolved job doesn't get resolved twice 2021-01-29 15:46:22 -08:00
5fb98f747c comment 2021-01-29 15:45:51 -08:00
2cef876ff2 Merge pull request #3384 from charhate/ui_changes
Audit logs for Role, User and API Key
2021-01-29 15:29:33 -08:00
244c8ff0ed Merge branch 'master' into ui_changes 2021-01-29 11:34:26 -08:00
8e93f4f0cf Merge pull request #3385 from hosseinsh/rotate-multiple-cert-case
Avoid Failure when Rotating Endpoint with multiple certificates
2021-01-29 11:29:30 -08:00
2b8af66202 Merge branch 'master' into rotate-multiple-cert-case 2021-01-29 11:08:40 -08:00
e542bb39de Merge branch 'master' into ui_changes 2021-01-29 11:08:06 -08:00
6df1b2985c removing duplicate print 2021-01-29 10:49:18 -08:00
d5f678f70c language 2021-01-29 10:46:58 -08:00
f4f970c4e9 Merge branch 'master' into feature/travis-python38 2021-01-29 10:45:23 -08:00
93e9cfe8b3 Merge pull request #3386 from sergerdn/fix/docs-deps-versions
docs: update OS and deps versions
2021-01-29 10:44:30 -08:00
5c5a34c206 language 2021-01-29 10:12:42 -08:00
7f16d44b48 add make test-build-js
add python38 to Travis
2021-01-29 15:09:12 +03:00
e1f5bfe41a remove nodejs-legacy from deps 2021-01-29 08:39:55 +03:00
9506898240 Merge branch 'master' into fix/docs-deps-versions 2021-01-29 07:28:03 +03:00
fb2a352b13 update OS and deps versions 2021-01-29 07:23:54 +03:00
38fc80fb47 space 2021-01-28 17:59:35 -08:00
77a50e0abf API Key logs 2021-01-28 17:56:12 -08:00
9b0cc3bbef consolidating the documentation for acme 2021-01-28 16:54:06 -08:00
da8d3f42d2 documenting number of attempts 2021-01-28 16:53:42 -08:00
c3e0597ef1 introducing ACME_ADDITIONAL_ATTEMPTS 2021-01-28 16:53:15 -08:00
20792dfe3a Club role assignment logs 2021-01-28 15:58:12 -08:00
895d5e6ec7 lint 2021-01-28 15:58:01 -08:00
b80b6d0959 same change for rotate region 2021-01-28 15:50:16 -08:00
63e9fdd0e1 rotate also in case of multiple certificates replacing the old one, just select the first one! 2021-01-28 15:50:02 -08:00
0d7e8d77e4 comments 2021-01-28 15:49:00 -08:00
e250a61344 fixing the message bug 2021-01-28 15:48:39 -08:00
089796a849 bug, intention was to skip a region 2021-01-28 15:47:41 -08:00
80f83efec2 todo 2021-01-28 15:44:19 -08:00
92dabe5d43 ineffective line 2021-01-28 15:44:10 -08:00
de762d2e53 better logging 2021-01-28 15:43:59 -08:00
c26db968d2 better logging 2021-01-28 15:43:21 -08:00
b9b3ae2286 better exception handling 2021-01-28 15:38:59 -08:00
ed57a5a45a Keep default role third-party (old code) 2021-01-28 13:43:25 -08:00
fe2fc0eadd PR comments 2021-01-28 11:19:47 -08:00
f14a236739 lint fix 2021-01-27 22:57:33 -08:00
b9be18f281 Role and User update logs 2021-01-27 19:10:13 -08:00
6eeafcf56b Merge pull request #3373 from Netflix/dependabot/pip/pem-21.1.0 2021-01-27 18:33:45 +00:00
859d4e5845 Bump pem from 20.1.0 to 21.1.0
Bumps [pem](https://github.com/hynek/pem) from 20.1.0 to 21.1.0.
- [Release notes](https://github.com/hynek/pem/releases)
- [Changelog](https://github.com/hynek/pem/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/hynek/pem/compare/20.1.0...21.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-27 00:07:15 +00:00
8bf9c975ac Merge pull request #3371 from Netflix/dependabot/pip/pyyaml-5.4.1 2021-01-27 00:05:12 +00:00
c464130f90 Bump pyyaml from 5.3.1 to 5.4.1
Bumps [pyyaml](https://github.com/yaml/pyyaml) from 5.3.1 to 5.4.1.
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES)
- [Commits](https://github.com/yaml/pyyaml/compare/5.3.1...5.4.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-26 23:55:37 +00:00
d6330e91dd Merge pull request #3376 from Netflix/dependabot/pip/flask-migrate-2.6.0 2021-01-26 23:52:24 +00:00
643d94714b Bump flask-migrate from 2.5.3 to 2.6.0
Bumps [flask-migrate](https://github.com/miguelgrinberg/flask-migrate) from 2.5.3 to 2.6.0.
- [Release notes](https://github.com/miguelgrinberg/flask-migrate/releases)
- [Changelog](https://github.com/miguelgrinberg/Flask-Migrate/blob/master/CHANGES.md)
- [Commits](https://github.com/miguelgrinberg/flask-migrate/compare/v2.5.3...v2.6.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-26 23:44:26 +00:00
053d985647 Merge pull request #3380 from Netflix/dependabot/pip/faker-5.8.0 2021-01-26 23:42:17 +00:00
b3c06eb6c8 Bump faker from 5.6.1 to 5.8.0
Bumps [faker](https://github.com/joke2k/faker) from 5.6.1 to 5.8.0.
- [Release notes](https://github.com/joke2k/faker/releases)
- [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.md)
- [Commits](https://github.com/joke2k/faker/compare/v5.6.1...v5.8.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-26 23:30:58 +00:00
d5ba065d4e Merge pull request #3372 from Netflix/dependabot/pip/freezegun-1.1.0 2021-01-26 23:28:53 +00:00
0d13aa3c71 Bump freezegun from 1.0.0 to 1.1.0
Bumps [freezegun](https://github.com/spulec/freezegun) from 1.0.0 to 1.1.0.
- [Release notes](https://github.com/spulec/freezegun/releases)
- [Changelog](https://github.com/spulec/freezegun/blob/master/CHANGELOG)
- [Commits](https://github.com/spulec/freezegun/compare/1.0.0...1.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-26 23:16:03 +00:00
1f1c3eb9ac Merge pull request #3382 from Netflix/dependabot/pip/boto3-1.16.60 2021-01-26 23:13:58 +00:00
5c15e1690d Bump boto3 from 1.16.56 to 1.16.60
Bumps [boto3](https://github.com/boto/boto3) from 1.16.56 to 1.16.60.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.16.56...1.16.60)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-26 22:48:40 +00:00
c6bcf0edf3 Merge pull request #3379 from sergerdn/fix/draft-nodejs-version
multiple fixes docker alpine build
2021-01-26 14:45:28 -08:00
7add8ab408 multiple fixes docker alpine build 2021-01-26 10:32:26 +03:00
f0fbc81370 Merge pull request #3370 from charhate/ui_changes
Return empty result instead of 500 if page number exceeds total
2021-01-20 12:12:37 -08:00
d5d89ec757 Return empty result instead of 500 if page number exceeds total
Removed current since it was not returned by lemur and it's easy to determine
2021-01-20 12:01:05 -08:00
f5899ea71b Merge pull request #3361 from hosseinsh/entrust-cross-signed-subCA
Entrust cross signed sub ca
2021-01-20 10:13:13 -08:00
ec96e08750 Merge branch 'master' into entrust-cross-signed-subCA 2021-01-19 16:45:21 -08:00
556e9fa70a Merge pull request #3363 from hosseinsh/entrust-ratelimit-deactive
Entrust: respecting Entrust's rate limit
2021-01-19 16:42:56 -08:00
3403ba89f1 Merge branch 'master' into entrust-cross-signed-subCA 2021-01-19 16:28:35 -08:00
cf3f3fde3c Merge branch 'master' into entrust-ratelimit-deactive 2021-01-19 16:27:17 -08:00
2240ace825 Merge pull request #3362 from hosseinsh/entrust-default-clientId
Entrust default client
2021-01-19 16:27:04 -08:00
0a37e8a275 Merge branch 'master' into entrust-cross-signed-subCA 2021-01-19 16:26:20 -08:00
c86ad7d1fd Merge branch 'master' into entrust-ratelimit-deactive 2021-01-19 16:26:11 -08:00
74bb4f58a0 Merge branch 'master' into entrust-default-clientId 2021-01-18 14:07:11 -08:00
e6a414a069 moving clientID logic into the respective method, that we want to bypass. 2021-01-18 14:05:17 -08:00
0f6af9f679 Merge pull request #3364 from Netflix/dependabot/pip/faker-5.6.1 2021-01-18 20:37:27 +00:00
09a5b256fb Bump faker from 5.4.1 to 5.6.1
Bumps [faker](https://github.com/joke2k/faker) from 5.4.1 to 5.6.1.
- [Release notes](https://github.com/joke2k/faker/releases)
- [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.md)
- [Commits](https://github.com/joke2k/faker/compare/v5.4.1...v5.6.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-18 20:29:37 +00:00
8584b43d32 Merge pull request #3368 from charhate/ui_changes
Select export type p12 for openssl
2021-01-18 12:27:31 -08:00
70c902954e Merge branch 'master' into ui_changes 2021-01-18 11:59:06 -08:00
3df63469e6 retry 2021-01-18 11:57:49 -08:00
6ff653cb2a Merge pull request #3367 from Netflix/dependabot/pip/boto3-1.16.56
Bump boto3 from 1.16.51 to 1.16.56
2021-01-18 11:52:12 -08:00
ca40dd4cd9 Bump boto3 from 1.16.51 to 1.16.56
Bumps [boto3](https://github.com/boto/boto3) from 1.16.51 to 1.16.56.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.16.51...1.16.56)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-18 13:31:51 +00:00
a62a562a61 Update cli.py
correct index begin
2021-01-15 17:17:56 -08:00
d914d37e6b typo 2021-01-15 16:52:32 -08:00
685cea4768 documentation 2021-01-15 16:51:24 -08:00
fef7c7a907 support for cross-signed subCA 2021-01-15 16:49:14 -08:00
45dfb1beb3 documentation 2021-01-15 16:44:23 -08:00
4afdc13b03 adding config to use the default clientID 2021-01-15 16:44:05 -08:00
f5cd7ecbd5 adding rate limit for Enturst 2021-01-15 16:35:47 -08:00
358f07b4c3 Select export type p12 for openssl 2021-01-15 15:45:39 -08:00
88e587af11 Merge pull request #3360 from jtschladen/docker-docs
Update Docker docs
2021-01-13 12:54:01 -08:00
78d5fa7690 Merge branch 'master' into docker-docs 2021-01-13 11:58:05 -08:00
7343ea3433 Update Docker docs 2021-01-13 11:15:11 -08:00
4b9dee8a31 Merge pull request #3358 from charhate/gulp4
Upgrade to gulp 4.0.2
2021-01-11 14:20:49 -08:00
be389c4876 Merge branch 'master' into gulp4 2021-01-11 13:09:53 -08:00
f93e49963e Merge pull request #3359 from Netflix/dependabot/pip/faker-5.4.1 2021-01-11 20:27:25 +00:00
dc2cbc055d Bump faker from 5.3.0 to 5.4.1
Bumps [faker](https://github.com/joke2k/faker) from 5.3.0 to 5.4.1.
- [Release notes](https://github.com/joke2k/faker/releases)
- [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.md)
- [Commits](https://github.com/joke2k/faker/compare/v5.3.0...v5.4.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-11 20:19:12 +00:00
2a5627112d Merge pull request #3356 from Netflix/dependabot/pip/boto3-1.16.51 2021-01-11 20:16:59 +00:00
3a5d9c212d Bump boto3 from 1.16.49 to 1.16.51
Bumps [boto3](https://github.com/boto/boto3) from 1.16.49 to 1.16.51.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.16.49...1.16.51)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-11 20:09:33 +00:00
e8e085bfc1 Merge pull request #3353 from Netflix/dependabot/pip/botocore-1.19.51 2021-01-11 20:06:15 +00:00
aa8d5f097e Bump botocore from 1.19.49 to 1.19.51
Bumps [botocore](https://github.com/boto/botocore) from 1.19.49 to 1.19.51.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.19.49...1.19.51)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-11 19:56:28 +00:00
76280eb6cd Merge pull request #3352 from Netflix/dependabot/pip/flask-cors-3.0.10 2021-01-11 19:53:32 +00:00
bca995b1ff Bump flask-cors from 3.0.9 to 3.0.10
Bumps [flask-cors](https://github.com/corydolphin/flask-cors) from 3.0.9 to 3.0.10.
- [Release notes](https://github.com/corydolphin/flask-cors/releases)
- [Changelog](https://github.com/corydolphin/flask-cors/blob/master/CHANGELOG.md)
- [Commits](https://github.com/corydolphin/flask-cors/compare/3.0.9...3.0.10)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-11 19:44:23 +00:00
d83c07ce02 Merge pull request #3355 from Netflix/dependabot/pip/pytest-mock-3.5.1 2021-01-11 19:42:13 +00:00
4eb5a26346 Bump pytest-mock from 3.5.0 to 3.5.1
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.5.0 to 3.5.1.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.5.0...v3.5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-11 19:32:30 +00:00
7d52ce2fad Merge pull request #3354 from Netflix/dependabot/pip/sphinx-3.4.3 2021-01-11 19:30:18 +00:00
b04dc06109 Bump sphinx from 3.4.2 to 3.4.3
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.4.2 to 3.4.3.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.4.2...v3.4.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-11 19:20:33 +00:00
2531348d7e Merge pull request #3351 from Netflix/dependabot/pip/sphinx-rtd-theme-0.5.1 2021-01-11 19:18:53 +00:00
7de2257bf8 Bump sphinx-rtd-theme from 0.5.0 to 0.5.1
Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 0.5.0 to 0.5.1.
- [Release notes](https://github.com/readthedocs/sphinx_rtd_theme/releases)
- [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst)
- [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/0.5.0...0.5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-11 19:10:01 +00:00
c523bfc9f6 Merge pull request #3350 from Netflix/dependabot/pip/acme-1.11.0 2021-01-11 19:08:13 +00:00
d325d118cd Merge branch 'master' into gulp4 2021-01-11 10:57:57 -08:00
3b254ac153 Upgrade to gulp 4.0.2 2021-01-11 10:39:27 -08:00
6311e7a283 Bump acme from 1.10.1 to 1.11.0
Bumps [acme](https://github.com/letsencrypt/letsencrypt) from 1.10.1 to 1.11.0.
- [Release notes](https://github.com/letsencrypt/letsencrypt/releases)
- [Commits](https://github.com/letsencrypt/letsencrypt/compare/v1.10.1...v1.11.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-11 13:26:45 +00:00
b0cf709bec Merge pull request #3348 from bgres/update-language
update language
2021-01-08 11:26:14 -08:00
b4ec0a636f Merge branch 'master' into update-language 2021-01-08 10:49:51 -08:00
b628949349 Merge pull request #3349 from hosseinsh/isrg-longer-chain-validation
ACME longer chain validation
2021-01-08 10:49:16 -08:00
ce693d5a1e spacing 2021-01-07 18:34:07 -08:00
65bd472b08 Ensuring that ACME plugin can handle longer chains:
Particularly with respect to this announcement:
https://letsencrypt.org/2020/12/21/extending-android-compatibility.html

Subscriber Certificate < – R3 < – ISRG Root X1 < – DST Root CA X3
2021-01-07 18:33:04 -08:00
00c9d49f4b Update view.tpl.html
additional suggestion
2021-01-07 16:14:17 -08:00
8a9b729478 update language 2021-01-07 14:11:14 +01:00
4c8edbb43e Merge pull request #3347 from charhate/pagination
Paginate valid certificate fetch API
2021-01-06 14:54:48 -08:00
a6354ef6f6 Merge branch 'master' into pagination 2021-01-06 11:31:35 -08:00
ba050028ca Paginate valid certificate fetch API 2021-01-06 11:28:18 -08:00
b3c5d23a3a Merge pull request #3346 from charhate/rotate-cert-ec
Config to change algo to ECC during reissue
2021-01-06 11:24:43 -08:00
396e3afdfa Fix @pytest.yield_fixture deprecation
Use @pytest.fixture instead; they are the same.
2021-01-05 18:14:57 -08:00
8f16402c0a Config to change algo to ECC during reissue 2021-01-05 18:13:09 -08:00
9657098514 Merge pull request #3344 from Netflix/dependabot/pip/boto3-1.16.49 2021-01-05 22:13:35 +00:00
596aa8ca95 Bump boto3 from 1.16.35 to 1.16.49
Bumps [boto3](https://github.com/boto/boto3) from 1.16.35 to 1.16.49.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.16.35...1.16.49)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-05 22:04:37 +00:00
bbf795faf1 Merge pull request #3345 from Netflix/dependabot/pip/botocore-1.19.49 2021-01-05 22:01:10 +00:00
0e04e79260 Bump botocore from 1.19.35 to 1.19.49
Bumps [botocore](https://github.com/boto/botocore) from 1.19.35 to 1.19.49.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.19.35...1.19.49)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-05 21:52:48 +00:00
3742ab3a45 Merge pull request #3334 from Netflix/dependabot/pip/faker-5.3.0 2021-01-05 21:27:16 +00:00
5f31706801 Bump faker from 5.0.1 to 5.3.0
Bumps [faker](https://github.com/joke2k/faker) from 5.0.1 to 5.3.0.
- [Release notes](https://github.com/joke2k/faker/releases)
- [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.md)
- [Commits](https://github.com/joke2k/faker/compare/v5.0.1...v5.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-05 21:14:41 +00:00
8e2e79e732 Merge pull request #3316 from Netflix/dependabot/pip/pyopenssl-20.0.1 2021-01-05 21:12:24 +00:00
3bc6090963 Bump pyopenssl from 20.0.0 to 20.0.1
Bumps [pyopenssl](https://github.com/pyca/pyopenssl) from 20.0.0 to 20.0.1.
- [Release notes](https://github.com/pyca/pyopenssl/releases)
- [Changelog](https://github.com/pyca/pyopenssl/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/pyopenssl/compare/20.0.0...20.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-05 21:02:33 +00:00
ac9fcada87 Merge pull request #3318 from Netflix/dependabot/pip/coverage-5.3.1 2021-01-05 20:59:44 +00:00
836591e165 Bump coverage from 5.3 to 5.3.1
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.3 to 5.3.1.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/coverage-5.3...coverage-5.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-05 20:39:51 +00:00
b9281bd3de Merge pull request #3339 from Netflix/dependabot/pip/pytest-mock-3.5.0 2021-01-05 20:37:42 +00:00
9470f71e34 Bump pytest-mock from 3.3.1 to 3.5.0
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.3.1 to 3.5.0.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.3.1...v3.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-05 20:20:24 +00:00
40b8b7c3a0 Merge pull request #3321 from Netflix/dependabot/pip/pytest-6.2.1 2021-01-05 20:17:55 +00:00
92312ff4f7 Bump pytest from 6.2.0 to 6.2.1
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.0 to 6.2.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.2.0...6.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-05 20:01:47 +00:00
7e06d634d5 Merge pull request #3343 from Netflix/hosseinsh-patch-travic-notification
Reducing Travis CI email noise
2021-01-05 11:59:04 -08:00
597a9e51d3 Merge pull request #3336 from Netflix/dependabot/pip/cloudflare-2.8.15 2021-01-05 19:54:46 +00:00
ae49840add Bump cloudflare from 2.8.14 to 2.8.15
Bumps [cloudflare](https://github.com/cloudflare/python-cloudflare) from 2.8.14 to 2.8.15.
- [Release notes](https://github.com/cloudflare/python-cloudflare/releases)
- [Changelog](https://github.com/cloudflare/python-cloudflare/blob/master/CHANGELOG.md)
- [Commits](https://github.com/cloudflare/python-cloudflare/compare/2.8.14...2.8.15)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-05 19:43:40 +00:00
9a2056cedd Merge branch 'master' into hosseinsh-patch-travic-notification 2021-01-05 11:41:25 -08:00
cbf388bde7 Merge pull request #3326 from Netflix/dependabot/pip/twine-3.3.0 2021-01-05 19:40:53 +00:00
aad48ab289 Reducing Travis CI email noise
# Dependbot cancels Travis before rebase and triggers too many emails
2021-01-05 11:33:11 -08:00
d725a9fdcf Bump twine from 3.2.0 to 3.3.0
Bumps [twine](https://github.com/pypa/twine) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/pypa/twine/releases)
- [Changelog](https://github.com/pypa/twine/blob/master/docs/changelog.rst)
- [Commits](https://github.com/pypa/twine/compare/3.2.0...3.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-05 19:29:39 +00:00
d8b769b5e2 Merge pull request #3320 from Netflix/dependabot/pip/hvac-0.10.6 2021-01-05 19:27:34 +00:00
7916a8ca90 Bump hvac from 0.10.5 to 0.10.6
Bumps [hvac](https://github.com/hvac/hvac) from 0.10.5 to 0.10.6.
- [Release notes](https://github.com/hvac/hvac/releases)
- [Changelog](https://github.com/hvac/hvac/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/hvac/hvac/compare/v0.10.5...v0.10.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-05 19:12:21 +00:00
6c2d5b84bb Merge pull request #3331 from Netflix/dependabot/pip/invoke-1.5.0 2021-01-05 19:10:06 +00:00
f33f3e1af5 Bump invoke from 1.4.1 to 1.5.0
Bumps [invoke](https://github.com/bitprophet/alabaster) from 1.4.1 to 1.5.0.
- [Release notes](https://github.com/bitprophet/alabaster/releases)
- [Changelog](https://github.com/bitprophet/alabaster/blob/master/docs/changelog.rst)
- [Commits](https://github.com/bitprophet/alabaster/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-05 19:00:10 +00:00
8b7b4529b3 Merge pull request #3324 from Netflix/dependabot/pip/factory-boy-3.2.0 2021-01-05 18:58:07 +00:00
53c5381d5b Bump factory-boy from 3.1.0 to 3.2.0
Bumps [factory-boy](https://github.com/FactoryBoy/factory_boy) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/FactoryBoy/factory_boy/releases)
- [Changelog](https://github.com/FactoryBoy/factory_boy/blob/master/docs/changelog.rst)
- [Commits](https://github.com/FactoryBoy/factory_boy/compare/3.1.0...3.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-05 18:47:34 +00:00
d7f807c1ff Merge pull request #3332 from Netflix/dependabot/pip/sphinx-3.4.2 2021-01-05 18:45:21 +00:00
6668592ffe Bump sphinx from 3.3.1 to 3.4.2
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.3.1 to 3.4.2.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.3.1...v3.4.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-05 18:36:41 +00:00
e946a37b6a Merge pull request #3315 from Netflix/dependabot/pip/requests-2.25.1 2021-01-05 18:34:54 +00:00
84b5410075 Bump requests from 2.25.0 to 2.25.1
Bumps [requests](https://github.com/psf/requests) from 2.25.0 to 2.25.1.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.25.0...v2.25.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-05 06:37:45 +00:00
d71da1f4d8 Merge pull request #3330 from timgates42/bugfix_typo_username
docs: fix simple typo, userame -> username
2021-01-04 22:34:06 -08:00
7fb8469449 Merge branch 'master' into bugfix_typo_username 2021-01-04 19:51:59 -08:00
97ce836df9 Merge pull request #3337 from jtschladen/encryption_keys-doc
Add more wording around LEMUR_ENCRYPTION_KEYS in docs
2021-01-04 19:51:49 -08:00
7300ea1eb8 Merge branch 'master' into bugfix_typo_username 2021-01-04 19:43:18 -08:00
843249a84e Merge branch 'master' into encryption_keys-doc 2021-01-04 19:43:07 -08:00
1aa0e3dad6 Merge pull request #3338 from hosseinsh/resolving-dependency-conflict
Resolving inconsistency around idna in requirement-test
2021-01-04 19:42:54 -08:00
63b5d24f39 idna at different versions for requirement vs. requirement-test 2021-01-04 19:31:21 -08:00
3bb5c323ef Fix formatting 2021-01-04 16:13:07 -08:00
d2e9493397 Add additional wording around LEMUR_ENCRYPTION_KEYS 2021-01-04 16:03:15 -08:00
3598953512 docs: fix simple typo, userame -> username
There is a small typo in docs/quickstart/index.rst.

Should read `username` rather than `userame`.
2020-12-30 08:20:38 +11:00
8a63b175e3 Merge pull request #3312 from jtschladen/fix-expiration-summary
Expiration summary email fixes
2020-12-16 09:48:50 -08:00
3e53a43873 Merge branch 'master' into fix-expiration-summary 2020-12-16 09:40:41 -08:00
34553c2586 Merge pull request #3313 from hosseinsh/revert-celery-to-4.4.2
reverting Bump celery[redis] from 4.4.2 to 5.0.4
2020-12-16 09:40:27 -08:00
405aef3160 reverting Bump celery[redis] from 4.4.2 to 5.0.4 #3305 2020-12-16 09:30:54 -08:00
33e46d4a53 Fix return type 2020-12-15 13:37:24 -08:00
de98586c13 Undo metric name change 2020-12-15 13:05:55 -08:00
787ca4f860 Fix incorrect expectation of return type for summary emails in notification cli, and add 1 to days in summary email 2020-12-15 13:03:55 -08:00
9d00464842 Merge pull request #3309 from Netflix/dependabot/pip/boto3-1.16.35 2020-12-14 18:36:29 +00:00
8ac3040396 Bump boto3 from 1.16.30 to 1.16.35
Bumps [boto3](https://github.com/boto/boto3) from 1.16.30 to 1.16.35.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.16.30...1.16.35)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-14 18:28:11 +00:00
e659bf08ff Merge pull request #3304 from Netflix/dependabot/pip/pytest-6.2.0 2020-12-14 18:25:11 +00:00
b89dc7dc6c Bump pytest from 6.1.2 to 6.2.0
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.1.2 to 6.2.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.1.2...6.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-14 18:17:57 +00:00
5cfe88ef51 Merge pull request #3308 from Netflix/dependabot/pip/cryptography-3.3.1 2020-12-14 18:14:58 +00:00
ad5a773712 Bump cryptography from 3.2.1 to 3.3.1
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.2.1 to 3.3.1.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.2.1...3.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-14 18:07:24 +00:00
f8e46da6c3 Merge pull request #3310 from Netflix/dependabot/pip/botocore-1.19.35 2020-12-14 18:04:12 +00:00
aaba3aab7a Bump botocore from 1.19.30 to 1.19.35
Bumps [botocore](https://github.com/boto/botocore) from 1.19.30 to 1.19.35.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.19.30...1.19.35)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-14 17:56:00 +00:00
f511bb664a Merge pull request #3305 from Netflix/dependabot/pip/celery-redis--5.0.4 2020-12-14 17:52:59 +00:00
5f8a1b480e Bump celery[redis] from 4.4.2 to 5.0.4
Bumps [celery[redis]](https://github.com/celery/celery) from 4.4.2 to 5.0.4.
- [Release notes](https://github.com/celery/celery/releases)
- [Changelog](https://github.com/celery/celery/blob/master/Changelog.rst)
- [Commits](https://github.com/celery/celery/compare/4.4.2...v5.0.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-14 17:44:02 +00:00
18b529a7f6 Merge pull request #3311 from Netflix/dependabot/pip/faker-5.0.1 2020-12-14 17:41:37 +00:00
bfbb2372c2 Bump faker from 5.0.0 to 5.0.1
Bumps [faker](https://github.com/joke2k/faker) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/joke2k/faker/releases)
- [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.md)
- [Commits](https://github.com/joke2k/faker/compare/v5.0.0...v5.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-14 17:32:30 +00:00
6e00e1b79b Merge pull request #3307 from Netflix/dependabot/pip/bandit-1.7.0 2020-12-14 17:30:15 +00:00
1165ab5eb7 Bump bandit from 1.6.3 to 1.7.0
Bumps [bandit](https://github.com/PyCQA/bandit) from 1.6.3 to 1.7.0.
- [Release notes](https://github.com/PyCQA/bandit/releases)
- [Commits](https://github.com/PyCQA/bandit/compare/1.6.3...1.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-14 17:22:03 +00:00
cc2f566bd6 Merge pull request #3306 from Netflix/dependabot/pip/pre-commit-2.9.3 2020-12-14 17:19:48 +00:00
58f40a7b86 Bump pre-commit from 2.9.2 to 2.9.3
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.9.2 to 2.9.3.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.9.2...v2.9.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-14 17:11:30 +00:00
0504919835 Merge pull request #3303 from Netflix/cname_metrics
CNAME Delegation Cleanup
2020-12-14 09:01:06 -08:00
4ac432ce87 Creating variable to store cname_delegation state and creating cname delegation metric 2020-12-13 00:03:21 -08:00
90531e79f0 Merge pull request #3301 from charhate/gulp4-revert
Reverting gulp 4.0.2 upgrade
2020-12-10 10:13:52 -08:00
5d79cae0fa Merge branch 'master' into gulp4-revert 2020-12-10 10:04:16 -08:00
f941383cd2 Merge pull request #3296 from jtschladen/expiration-summary-email
Expiration summary email for security team
2020-12-10 08:55:52 -08:00
8ba32aa1e9 Merge branch 'master' into expiration-summary-email 2020-12-10 08:43:10 -08:00
892a668bf5 Revert "Upgrade gulp to 4.0.2"
This reverts commit 22d9ef7798.
2020-12-09 20:07:25 -08:00
34588c9513 Revert "Remove parallel task"
This reverts commit 6e41f74908.
2020-12-09 20:07:07 -08:00
575642fa49 Revert "Fixing duplicate task execution"
This reverts commit 1547cc3e60.
2020-12-09 20:04:11 -08:00
42dd8e3f47 Revert "Uncommented rev-manifest: allowEmpty"
This reverts commit 785ef6adb5.
2020-12-09 20:03:57 -08:00
2ffa691fe4 Merge pull request #3300 from charhate/upgrades
Fixing duplicate task execution
2020-12-09 20:00:17 -08:00
785ef6adb5 Uncommented rev-manifest: allowEmpty 2020-12-09 19:45:36 -08:00
1547cc3e60 Fixing duplicate task execution 2020-12-09 19:30:43 -08:00
d921f53d08 Merge branch 'master' into expiration-summary-email 2020-12-09 14:56:54 -08:00
e0b1dbde98 Merge pull request #3299 from charhate/upgrades
Gulp upgrade: Remove parallel task
2020-12-09 14:51:42 -08:00
8965cf1af5 Merge branch 'master' into upgrades 2020-12-09 14:34:54 -08:00
a9b983fac2 Merge branch 'upgrades' of github.com:charhate/lemur into upgrades 2020-12-09 14:32:31 -08:00
6e41f74908 Remove parallel task
fixing issue of CSS not loading, though it works in dev
2020-12-09 14:32:06 -08:00
456575b88b Merge pull request #3298 from charhate/upgrades
remove gulp-replace-task
2020-12-09 10:33:11 -08:00
d66af6d2bd Merge branch 'master' into upgrades 2020-12-08 20:10:19 -08:00
e62e07c929 remove gulp-replace-task 2020-12-08 20:02:57 -08:00
d643f32fbe Merge pull request #3297 from charhate/upgrades
Version Upgrades
2020-12-08 19:47:19 -08:00
856c2da15c yargs version update ^16.0.0 2020-12-08 19:25:30 -08:00
cf652952ff karma version update ^5.2.3 2020-12-08 19:25:21 -08:00
8bab89262c lodash upgrade 4.17.20 2020-12-08 19:24:49 -08:00
22d9ef7798 Upgrade gulp to 4.0.2 2020-12-08 19:24:41 -08:00
512b1acfdd PR feedback: use days threshold instead of interval set, etc. 2020-12-08 18:29:48 -08:00
d3d186880b Merge pull request #3295 from sirferl/source_options
make options for sources optional
2020-12-08 13:19:59 -08:00
15d43d6c27 Fix lint errors 2020-12-08 12:09:53 -08:00
79c6b3fc00 Merge branch 'master' into expiration-summary-email 2020-12-08 11:48:15 -08:00
065e4d3964 Add new configuration for summary email intervals 2020-12-08 11:46:55 -08:00
eab5532397 Add expiration summary email for security team 2020-12-08 11:41:41 -08:00
2f5b0fb91a Merge branch 'source_options' of github.com:sirferl/lemur into source_options 2020-12-08 11:07:49 +01:00
b93c028215 source plugin: options not needed any more 2020-12-08 11:07:09 +01:00
8a10b861be options not needed any more 2020-12-08 11:05:55 +01:00
9a38052868 Lint - whitespace error fixed 2020-12-08 11:03:08 +01:00
b07af654e1 Merge branch 'master' into source_options 2020-12-08 10:57:40 +01:00
5e33eee5c8 make options for sources optional 2020-12-08 10:53:28 +01:00
affd077afe Merge pull request #3294 from jtschladen/support-multiword-email-subject
Improve formatting for multiword email notification types
2020-12-07 18:47:27 -08:00
94ba1e77dd Improve formatting for multiword email notification types 2020-12-07 18:33:31 -08:00
0ebaa78915 Merge pull request #3291 from Netflix/dependabot/pip/cloudflare-2.8.14 2020-12-07 19:25:19 +00:00
f171e84a5e Bump cloudflare from 2.8.13 to 2.8.14
Bumps [cloudflare](https://github.com/cloudflare/python-cloudflare) from 2.8.13 to 2.8.14.
- [Release notes](https://github.com/cloudflare/python-cloudflare/releases)
- [Changelog](https://github.com/cloudflare/python-cloudflare/blob/master/CHANGELOG.md)
- [Commits](https://github.com/cloudflare/python-cloudflare/compare/2.8.13...2.8.14)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-07 19:15:58 +00:00
d75f8f4149 Merge pull request #3290 from Netflix/dependabot/pip/certifi-2020.12.5 2020-12-07 19:13:55 +00:00
cdb5535ae0 Bump certifi from 2020.11.8 to 2020.12.5
Bumps [certifi](https://github.com/certifi/python-certifi) from 2020.11.8 to 2020.12.5.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](https://github.com/certifi/python-certifi/compare/2020.11.08...2020.12.05)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-07 19:06:23 +00:00
adf8483de1 Merge pull request #3289 from Netflix/dependabot/pip/boto3-1.16.30 2020-12-07 19:03:17 +00:00
a3b7453886 Bump boto3 from 1.16.25 to 1.16.30
Bumps [boto3](https://github.com/boto/boto3) from 1.16.25 to 1.16.30.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.16.25...1.16.30)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-07 18:54:59 +00:00
6fd3e10ab1 Merge pull request #3288 from Netflix/dependabot/pip/acme-1.10.1 2020-12-07 18:52:27 +00:00
9eca783c7e Bump acme from 1.9.0 to 1.10.1
Bumps [acme](https://github.com/letsencrypt/letsencrypt) from 1.9.0 to 1.10.1.
- [Release notes](https://github.com/letsencrypt/letsencrypt/releases)
- [Commits](https://github.com/letsencrypt/letsencrypt/compare/v1.9.0...v1.10.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-07 18:43:27 +00:00
fe01b8ee32 Merge pull request #3286 from Netflix/dependabot/pip/bandit-1.6.3 2020-12-07 18:41:16 +00:00
61ed4ea84d Bump bandit from 1.6.2 to 1.6.3
Bumps [bandit](https://github.com/PyCQA/bandit) from 1.6.2 to 1.6.3.
- [Release notes](https://github.com/PyCQA/bandit/releases)
- [Commits](https://github.com/PyCQA/bandit/compare/1.6.2...1.6.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-07 18:34:11 +00:00
e3824b9861 Merge pull request #3292 from Netflix/dependabot/pip/faker-5.0.0 2020-12-07 18:32:13 +00:00
be46623a7f Bump faker from 4.17.1 to 5.0.0
Bumps [faker](https://github.com/joke2k/faker) from 4.17.1 to 5.0.0.
- [Release notes](https://github.com/joke2k/faker/releases)
- [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.md)
- [Commits](https://github.com/joke2k/faker/compare/v4.17.1...v5.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-07 13:32:42 +00:00
9836d723d9 Merge pull request #3285 from sirferl/kubernetes-plugin
Corrected delivery of TLS format
2020-12-04 09:58:57 -08:00
18573f00a9 Merge branch 'master' into kubernetes-plugin 2020-12-04 09:51:53 -08:00
a9e10778a5 Merge pull request #3281 from jtschladen/add-ca-cert-notifications
Add email notifications for CA cert expiry
2020-12-04 09:01:34 -08:00
9763f5c26a Merge branch 'master' into kubernetes-plugin 2020-12-04 14:24:52 +01:00
a02b378988 Removed local base64encode and use common.utils version 2020-12-04 14:12:21 +01:00
2b65ab8972 Corrected delivery of TLS format 2020-12-04 13:54:39 +01:00
29aeb9b298 Subordinate -> Intermediate wording 2020-12-03 17:59:13 -08:00
1793859781 Merge branch 'add-ca-cert-notifications' of github.com:jtschladen/lemur into add-ca-cert-notifications 2020-12-03 17:56:50 -08:00
576c69c8e5 Fix DB query for cert count for authority 2020-12-03 17:56:39 -08:00
ead8629928 Merge branch 'master' into add-ca-cert-notifications 2020-12-03 16:56:22 -08:00
42957cffc7 PR feedback: add config option to enable rotation emails, add cert count and type to email 2020-12-03 16:10:36 -08:00
1184c219d4 Merge pull request #3280 from sirferl/entrust_source
Entrust source plugin
2020-12-03 12:51:02 -08:00
4c2227f23c Merge branch 'master' into add-ca-cert-notifications 2020-12-03 12:09:48 -08:00
4afd425d9f improved text 2020-12-03 12:07:59 -08:00
148dcc7528 Merge branch 'add-ca-cert-notifications' of github.com:jtschladen/lemur into add-ca-cert-notifications 2020-12-03 11:30:45 -08:00
589df0e230 PR feedback 2020-12-03 11:30:34 -08:00
bc6c913a7a Merge branch 'entrust_source' of github.com:sirferl/lemur into entrust_source 2020-12-03 10:18:44 +01:00
2813186b13 lint errors 2020-12-03 10:17:47 +01:00
5651865347 Merge branch 'master' into entrust_source 2020-12-03 09:26:35 +01:00
c635e0f76e added CSR, Owner, Cert type and extended key usage from Entrust 2020-12-03 09:24:49 +01:00
6585bcaa55 Merge branch 'entrust_source' of github.com:sirferl/lemur into entrust_source 2020-12-03 08:35:02 +01:00
f0f13ce97b Removed commented log lines
Added logging of number of downloaded certificates
2020-12-03 08:30:54 +01:00
101ee7317e Merge pull request #3283 from charhate/cert-revoke
Lemur doc update
2020-12-02 19:21:14 -08:00
9a1cb65853 Update create_authority_options image 2020-12-02 19:08:04 -08:00
6fe92a532b Merge branch 'master' into cert-revoke 2020-12-02 19:00:33 -08:00
ac038b59b7 Added celery task details to quick start 2020-12-02 18:52:33 -08:00
1846402070 Updating user guide 2020-12-02 18:52:33 -08:00
5616965637 Merge pull request #3277 from charhate/cert-revoke
CRL Reason during certificate revoke
2020-12-02 18:48:13 -08:00
535cf6103d Merge branch 'master' into cert-revoke 2020-12-02 18:30:22 -08:00
b1007234e5 Merge pull request #3282 from jtschladen/fix-docs
Fix the docs, attempt #2
2020-12-02 18:28:26 -08:00
03a758deca lint fixes 2020-12-02 18:12:19 -08:00
5e9e454293 Merge branch 'master' into fix-docs 2020-12-02 18:08:54 -08:00
5ca0c83a07 CLI support single cert revoke 2020-12-02 18:08:19 -08:00
33bb17779d Handle revoke not implemented and add comments 2020-12-02 18:07:36 -08:00
aecb222de5 Merge branch 'master' into cert-revoke 2020-12-02 17:23:25 -08:00
a79df00a24 Fix the docs, attempt #2 2020-12-02 17:19:53 -08:00
5d06a62ae9 Merge branch 'master' into add-ca-cert-notifications 2020-12-02 16:42:39 -08:00
a951e7623c Merge branch 'master' into entrust_source 2020-12-02 16:42:19 -08:00
4437a0f870 Merge pull request #3279 from atugushev/fix-deprecated-option
Use --no-emit-index-url instead of deprecated --no-index in pip-compile
2020-12-02 16:42:08 -08:00
1869f8a8b7 Merge branch 'master' into fix-deprecated-option 2020-12-02 14:33:26 -08:00
084b2b1830 Merge branch 'master' into cert-revoke 2020-12-02 11:51:44 -08:00
b40cb5562a Merge branch 'add-ca-cert-notifications' of github.com:jtschladen/lemur into add-ca-cert-notifications 2020-12-02 11:46:40 -08:00
4b93c81add Fix typo 2020-12-02 11:46:18 -08:00
dbf8819034 Merge branch 'master' into add-ca-cert-notifications 2020-12-02 11:44:36 -08:00
5261281960 Merge pull request #3278 from charhate/ec_default
Preselect ECCPRIME256V1 on UI for cert minting
2020-12-02 11:05:57 -08:00
85d99ded73 Add email notifications for CA cert expiry 2020-12-02 09:20:09 -08:00
a0517d26fa lint errors fixed 2020-12-02 16:05:34 +01:00
9b2ac32d70 added source functionality 2020-12-02 15:50:51 +01:00
3b19863a96 adding source plugin code" 2020-12-02 13:24:01 +01:00
d2abe59e6e Use --no-emit-index-url instead of deprecated --no-index in pip-compile 2020-12-02 13:44:25 +07:00
f22f29c053 Preselect ECCPRIME256V1 on UI for cert minting 2020-12-01 18:48:36 -08:00
1f2b445215 Added RFC reference to enum 2020-12-01 18:44:28 -08:00
87a4d7dc3b Merge branch 'master' into cert-revoke 2020-12-01 16:49:18 -08:00
fe213c85ae Make revoke via CLI single threaded
Fixing error - working outside of app context
2020-12-01 16:37:17 -08:00
7a1f13dcb5 CRL Reason for certificate revoke 2020-11-30 20:06:37 -08:00
f6472e6f6f Merge pull request #3267 from charhate/cert-revoke
Remove certificate from AWS and cleanup after cert revoke
2020-11-30 17:28:07 -08:00
817abb2ca8 Removed for loop 2020-11-30 11:15:54 -08:00
a2f731b710 Merge branch 'master' into cert-revoke 2020-11-30 11:05:23 -08:00
0a23a91fdb Merge pull request #3273 from Netflix/dependabot/pip/pyopenssl-20.0.0 2020-11-30 17:18:09 +00:00
fa082145fe Bump pyopenssl from 19.1.0 to 20.0.0
Bumps [pyopenssl](https://github.com/pyca/pyopenssl) from 19.1.0 to 20.0.0.
- [Release notes](https://github.com/pyca/pyopenssl/releases)
- [Changelog](https://github.com/pyca/pyopenssl/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/pyopenssl/compare/19.1.0...20.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-30 17:09:42 +00:00
584f8e32f2 Merge pull request #3274 from Netflix/dependabot/pip/boto3-1.16.25 2020-11-30 17:07:35 +00:00
1eb0024b1f Bump boto3 from 1.16.24 to 1.16.25
Bumps [boto3](https://github.com/boto/boto3) from 1.16.24 to 1.16.25.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.16.24...1.16.25)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-30 17:00:28 +00:00
ac6f2b8d14 Merge pull request #3272 from Netflix/dependabot/pip/fakeredis-1.4.5 2020-11-30 16:57:33 +00:00
b00d97b6de Bump fakeredis from 1.4.4 to 1.4.5
Bumps [fakeredis](https://github.com/jamesls/fakeredis) from 1.4.4 to 1.4.5.
- [Release notes](https://github.com/jamesls/fakeredis/releases)
- [Commits](https://github.com/jamesls/fakeredis/compare/1.4.4...1.4.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-30 16:50:51 +00:00
cb1d3a0883 Merge pull request #3271 from Netflix/dependabot/pip/pre-commit-2.9.2 2020-11-30 16:48:51 +00:00
8ad82bee53 Bump pre-commit from 2.9.0 to 2.9.2
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.9.0 to 2.9.2.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.9.0...v2.9.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-30 13:29:01 +00:00
7b5d6d3db1 Merge pull request #3269 from sirferl/AD-problem
LDAP: error decoding CN when using Active Directory
2020-11-25 13:20:01 -08:00
6d75007644 Merge branch 'master' into AD-problem 2020-11-25 14:19:19 +01:00
e9f7860816 Fixed AD-LDAP decode problem 2020-11-25 14:06:26 +01:00
9949f9914e Merge branch 'master' of github.com:sirferl/lemur into azure-plugin 2020-11-25 07:37:11 +01:00
b90ead36d7 Merge branch 'master' into cert-revoke 2020-11-24 17:46:32 -08:00
6f3cc74721 Merge pull request #3266 from Netflix/dependabot/pip/boto3-1.16.24
Bump boto3 from 1.16.14 to 1.16.24
2020-11-24 15:11:19 -08:00
2710bcc263 Merge branch 'master' into dependabot/pip/boto3-1.16.24 2020-11-24 15:02:52 -08:00
028f0c3330 Merge pull request #3252 from sirferl/azure-plugin
Azure plugin
2020-11-24 15:02:30 -08:00
439e888d9e lint errors 2020-11-24 12:59:42 +01:00
56af628c68 moved base64encode to common.utils 2020-11-24 12:46:09 +01:00
608f3dfb73 Merge branch 'azure-plugin' of github.com:sirferl/lemur into azure-plugin
pulling commits from master
2020-11-24 12:30:42 +01:00
0f3357ab46 moved base64encode to common.utils 2020-11-24 12:29:25 +01:00
eedd2e91ee Merge branch 'entrust-plugin' of github.com:sirferl/lemur into azure-plugin 2020-11-24 12:17:14 +01:00
31bfcd8810 Merge pull request #9 from Netflix/master
update entrust-plugin branch
2020-11-24 12:16:05 +01:00
4c88ffc9bc Merge pull request #8 from Netflix/master
merging commits from netflix/lemur master
2020-11-24 12:13:44 +01:00
b916aef81f Merge branch 'master' into azure-plugin 2020-11-23 17:52:10 -08:00
563c754492 Uncomment code 2020-11-23 17:24:01 -08:00
1207de8925 Remove certificate from AWS and cleanup after cert revoke 2020-11-23 15:24:11 -08:00
c765eab2f0 Merge pull request #3263 from peschmae/feature/acme-http-documentation
Add documentation for ACME http-01 challenge
2020-11-23 13:27:11 -08:00
6d1a630380 Merge branch 'master' into feature/acme-http-documentation 2020-11-23 13:07:07 -08:00
55aa19f878 Merge pull request #3259 from Netflix/dependabot/pip/boto3-1.16.23 2020-11-23 21:05:31 +00:00
1d247f3df4 Bump boto3 from 1.16.14 to 1.16.23
Bumps [boto3](https://github.com/boto/boto3) from 1.16.14 to 1.16.23.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.16.14...1.16.23)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-23 20:57:15 +00:00
f63d73d0dc Merge branch 'master' into feature/acme-http-documentation 2020-11-23 12:54:28 -08:00
0138ed7564 Merge pull request #3257 from Netflix/dependabot/pip/requests-2.25.0 2020-11-23 20:54:26 +00:00
f6096c62cf Bump boto3 from 1.16.14 to 1.16.24
Bumps [boto3](https://github.com/boto/boto3) from 1.16.14 to 1.16.24.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.16.14...1.16.24)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-23 20:47:33 +00:00
1474a399b7 Bump requests from 2.24.0 to 2.25.0
Bumps [requests](https://github.com/psf/requests) from 2.24.0 to 2.25.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.24.0...v2.25.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-23 20:47:10 +00:00
e4b96f1ba4 Merge pull request #3262 from Netflix/dependabot/pip/faker-4.17.1 2020-11-23 20:38:41 +00:00
b703a4ff3c Merge branch 'master' into feature/acme-http-documentation 2020-11-23 12:29:42 -08:00
378e34d3d8 Bump faker from 4.14.2 to 4.17.1
Bumps [faker](https://github.com/joke2k/faker) from 4.14.2 to 4.17.1.
- [Release notes](https://github.com/joke2k/faker/releases)
- [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.md)
- [Commits](https://github.com/joke2k/faker/compare/v4.14.2...v4.17.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-23 20:29:06 +00:00
12b20693f8 Merge pull request #3258 from Netflix/dependabot/pip/sphinx-3.3.1 2020-11-23 20:27:10 +00:00
a0104dd026 Bump sphinx from 3.3.0 to 3.3.1
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.3.0 to 3.3.1.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.3.0...v3.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-23 20:19:34 +00:00
3909032752 Merge pull request #3261 from Netflix/dependabot/pip/pre-commit-2.9.0 2020-11-23 20:17:33 +00:00
48e3eb25a0 Merge branch 'master' into feature/acme-http-documentation 2020-11-23 12:10:55 -08:00
320e0e7513 Bump pre-commit from 2.8.2 to 2.9.0
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.8.2 to 2.9.0.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.8.2...v2.9.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-23 20:10:15 +00:00
4fa7415e28 Merge pull request #3264 from peschmae/bugfix/acme-revoke
Fix ACME revoke_certificate
2020-11-23 12:06:59 -08:00
72da149fde Fix ACME revoke_certificate 2020-11-23 15:32:01 +01:00
c342fb894d Add documentation for ACME http-01 challenge 2020-11-23 14:55:21 +01:00
a65f0c0fdd Merge branch 'master' into azure-plugin 2020-11-16 18:42:16 -08:00
cbdaa4e3e4 Merge pull request #3248 from sirferl/master
Entrust: Improve organization handling
2020-11-16 18:41:59 -08:00
58ecb22f19 Merge branch 'master' into azure-plugin 2020-11-16 17:46:08 -08:00
15b97dc2ef Merge branch 'master' into master 2020-11-16 17:46:05 -08:00
33e34d76b2 Merge pull request #3246 from jtschladen/send-single-email
Send a single email to multiple recipients instead of multiple emails
2020-11-16 17:45:22 -08:00
6163015e36 Merge branch 'master' into azure-plugin 2020-11-16 17:43:09 -08:00
9aaf507dd6 Clarify comment 2020-11-16 17:37:05 -08:00
3dc279ac29 Merge branch 'master' into master 2020-11-16 17:21:05 -08:00
d22156337a Merge branch 'master' into send-single-email 2020-11-16 16:58:01 -08:00
13c2fafd46 Merge pull request #3254 from hosseinsh/updating-release-docs
Updating release doc
2020-11-16 16:50:21 -08:00
e4f89c93b5 updating the release docs 2020-11-16 16:31:50 -08:00
24e74ab873 updating release steps 2020-11-16 15:27:17 -08:00
0521624ccc Azure-Dest: Lint always finds something 2020-11-15 10:33:36 +01:00
1b5f17d8b8 Azure-Dest: More Lint, derive keysize from cert, remove debug output 2020-11-15 10:28:21 +01:00
48302b6acc Azure-Dest: Linted 2020-11-14 13:03:27 +01:00
62230228a7 Azure-Dest: Working Plugin 2020-11-14 12:49:14 +01:00
40057262e1 Azure-Dest: add files 2020-11-14 12:19:16 +01:00
ad1c6074ad Merge branch 'master' of github.com:sirferl/lemur
remerge
2020-11-14 12:02:19 +01:00
5f1978a4da Kubernetes: revert unintentionally change 2020-11-14 12:00:59 +01:00
51bc7d0231 Merge branch 'master' into master 2020-11-14 11:56:27 +01:00
334367376f Entrust: add organization handling-param error 2020-11-14 11:50:25 +01:00
347647da91 Merge branch 'send-single-email' of github.com:jtschladen/lemur into send-single-email 2020-11-13 20:11:15 -08:00
db11f0c1b7 Condense sending notifications 2020-11-13 20:10:21 -08:00
d5714c8b5c Merge branch 'master' into send-single-email 2020-11-13 18:52:31 -08:00
31fde453a8 Merge pull request #3250 from jtschladen/update-docs
Remove python-ldap from requirements-docs.txt
2020-11-13 18:27:34 -08:00
8a2621de44 Merge branch 'master' into update-docs 2020-11-13 18:18:09 -08:00
95b24cbadc Merge pull request #3251 from hosseinsh/release-0.8.0
preparing for release 0.8.0
2020-11-13 17:49:26 -08:00
afbd8b6930 Merge branch 'master' into update-docs 2020-11-13 17:39:37 -08:00
50483c01da preparing for release 0.8.0 2020-11-13 17:37:01 -08:00
bb11ff9f60 Remove python-ldap from requirements-docs.txt 2020-11-13 17:31:40 -08:00
79094e782d Merge branch 'send-single-email' of github.com:jtschladen/lemur into send-single-email 2020-11-13 13:13:56 -08:00
fc7db4a9b2 Fix style 2020-11-13 13:13:37 -08:00
65676a84da Merge branch 'master' of github.com:Netflix/lemur into send-single-email 2020-11-13 13:03:44 -08:00
8c56b74f07 Merge branch 'master' into send-single-email 2020-11-13 13:02:12 -08:00
2d2ecdeee2 Merge pull request #3245 from hosseinsh/aws-pluging-S3-remove-acme-token
AWS plugin s3 adding remove acme token
2020-11-13 12:01:07 -08:00
75107bcd69 Entrust: add organization handling-Lint error 2020-11-13 08:18:33 +01:00
ff540069e2 Entrust: add organization handling-Update test 2020-11-13 08:08:54 +01:00
b191b32312 Entrust: add organization handling-error in script 2020-11-13 07:57:06 +01:00
50ffe6a29c Entrust: add organization handling-test change 2020-11-12 14:31:49 +01:00
8738c4d893 Entrust: add organization handling-linting 2020-11-12 14:14:20 +01:00
949a123cb9 Merge branch 'master' of github.com:sirferl/lemur
still changes
2020-11-12 14:10:02 +01:00
e1926f2f3c Entrust: add organization handling-linting 2020-11-12 14:09:24 +01:00
3a61308354 Merge branch 'master' into master 2020-11-12 14:02:05 +01:00
d4d51c702a Entrust: add organization handling 2020-11-12 13:51:08 +01:00
4b19a3ef78 Merge pull request #7 from Netflix/master
Entrust: Implementing handling of organization
2020-11-12 12:20:31 +01:00
f4e0b3a90f Merge branch 'master' into send-single-email 2020-11-11 16:54:40 -08:00
02c7093b32 Merge branch 'master' into aws-pluging-S3-remove-acme-token 2020-11-11 16:48:00 -08:00
95854c6f68 Merge pull request #3167 from unic/feature/acme-http-challenge
Add support for acme http-01 challenge
2020-11-11 16:47:08 -08:00
1a65e09a99 Send a single email to multiple recipients instead of multiple emails 2020-11-11 15:21:40 -08:00
9fd3440cf6 Cleanup tests 2020-11-11 12:21:06 +01:00
453826c59c Get rid of unnecessary current_app patches 2020-11-11 12:11:13 +01:00
2b01bdb471 Refactor sftp plugin, to avoid duplicate code 2020-11-11 11:58:36 +01:00
648565d3e9 Improve exception handling in lemur_sftp, Add Authentication failure test 2020-11-11 11:45:57 +01:00
e12ee1d89c Implement delete file and delete token tests 2020-11-11 11:23:55 +01:00
ae7a044b9c Add test for upload_acme_token 2020-11-11 11:13:09 +01:00
df11a03bde Implement sftp upload tests 2020-11-11 11:02:15 +01:00
6e5aa4e979 Deduplicate chain/certificate extraction 2020-11-11 08:46:55 +01:00
5cdd88e033 Remove unnecessary token from delete_acme_token 2020-11-11 08:34:40 +01:00
7b1beb62b6 Add directory uri, to exception message 2020-11-11 08:05:59 +01:00
7a7f05ec9e Fix comments in sftp delete_files 2020-11-11 08:05:37 +01:00
252f84cf21 adding also response to upload acme token, just for future use-cases 2020-11-10 17:46:00 -08:00
ea77ef08aa testing for delete 2020-11-10 17:45:02 -08:00
8efa682858 add delete acme token 2020-11-10 17:43:35 -08:00
2798692fa9 Merge branch 'master' of github.com:Netflix/lemur into fix-more-button-notification 2020-11-10 14:50:10 -08:00
dac6838c3b Merge branch 'master' of github.com:Netflix/lemur into add-remove-certs-for-notification 2020-11-10 14:49:46 -08:00
31b5f3df86 Remove duplicate code for revoke_certificate 2020-11-10 18:18:45 +01:00
fba1fdcc34 Improve exception handling during http challenge 2020-11-10 18:06:19 +01:00
9ebcdfc189 Check authorization state and skip already validated challenges 2020-11-10 17:10:43 +01:00
6ffe7bc526 Check if challenges are already validated, and skip them if possible 2020-11-10 16:47:56 +01:00
960b8e78e3 Implement cleanup_acme_token for http challenge 2020-11-10 16:22:25 +01:00
99ca0ac78d Add context fix to tests, Add regex, Flake8 2020-11-10 15:32:04 +01:00
4a181aff6e Merge branch 'master' into feature/acme-http-challenge 2020-11-10 15:20:47 +01:00
f42d9539fc Merge pull request #3237 from ExaneServerTeam/bugfix/group-lookup-fix-referral
Fix group lookup when AD DNS Referal is in lookup path
2020-11-09 14:38:12 -08:00
018f4a4b77 Merge branch 'master' into bugfix/group-lookup-fix-referral 2020-11-09 14:30:01 -08:00
a7a5a8fb72 Merge pull request #3244 from Netflix/dependabot/pip/boto3-1.16.14 2020-11-09 22:29:14 +00:00
65d9ac6a0f Bump boto3 from 1.16.9 to 1.16.14
Bumps [boto3](https://github.com/boto/boto3) from 1.16.9 to 1.16.14.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.16.9...1.16.14)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-09 22:22:52 +00:00
11386c6c7e Merge pull request #3243 from Netflix/dependabot/pip/botocore-1.19.14 2020-11-09 22:20:20 +00:00
7ec2860f88 Bump botocore from 1.19.9 to 1.19.14
Bumps [botocore](https://github.com/boto/botocore) from 1.19.9 to 1.19.14.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.19.9...1.19.14)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-09 21:49:57 +00:00
76fb92d970 Merge pull request #3241 from Netflix/dependabot/pip/certifi-2020.11.8 2020-11-09 21:47:20 +00:00
4c6645ca04 Bump certifi from 2020.6.20 to 2020.11.8
Bumps [certifi](https://github.com/certifi/python-certifi) from 2020.6.20 to 2020.11.8.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](https://github.com/certifi/python-certifi/compare/2020.06.20...2020.11.08)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-09 21:40:24 +00:00
021f530810 Merge pull request #3240 from Netflix/dependabot/pip/faker-4.14.2 2020-11-09 21:37:39 +00:00
a74b8aed15 Bump faker from 4.14.0 to 4.14.2
Bumps [faker](https://github.com/joke2k/faker) from 4.14.0 to 4.14.2.
- [Release notes](https://github.com/joke2k/faker/releases)
- [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/joke2k/faker/compare/v4.14.0...v4.14.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-09 21:29:51 +00:00
307e4693c6 Merge pull request #3239 from Netflix/dependabot/pip/pytest-flask-1.1.0 2020-11-09 21:27:46 +00:00
d3e8921731 Bump pytest-flask from 1.0.0 to 1.1.0
Bumps [pytest-flask](https://github.com/pytest-dev/pytest-flask) from 1.0.0 to 1.1.0.
- [Release notes](https://github.com/pytest-dev/pytest-flask/releases)
- [Changelog](https://github.com/pytest-dev/pytest-flask/blob/master/docs/changelog.rst)
- [Commits](https://github.com/pytest-dev/pytest-flask/compare/1.0.0...1.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-09 21:20:48 +00:00
40ef6d06d7 Merge pull request #3192 from hosseinsh/expanding-S3-plugin
Expanding the S3 plugin with acme-http01-token support
2020-11-09 13:18:38 -08:00
57208fe198 Fix group lookup when AD DNS Referal is in lookup path
Fix an issue when the DNS AD referal is in the path.
An Exception is raised, with the following stacktrace::

  Traceback (most recent call last):
    File "/www/lemur/lemur/auth/views.py", line 317, in post
      user = ldap_principal.authenticate()
    File "/www/lemur/lemur/auth/ldap.py", line 147, in authenticate
      self._bind()
    File "/www/lemur/lemur/auth/ldap.py", line 216, in _bind
      self.ldap_groups.append(values["cn"][0].decode("ascii"))
  TypeError: list indices must be integers or slices, not str

This is issue is trigerred by some extra rows that referrences
the DNS subtree::

   ['ldaps://DomainDnsZones.xxxx']

Limiting the extraction to the expected dicts fix this issue.
2020-11-09 09:40:28 +01:00
7c779d6283 regex 2020-11-06 22:41:48 -08:00
519411b309 regex 2020-11-06 22:40:55 -08:00
6fe855e824 Merge branch 'master' into expanding-S3-plugin 2020-11-05 12:12:45 -08:00
cafc2c1d80 Merge pull request #3236 from charhate/ecc_changes
Version updates
2020-11-05 12:12:04 -08:00
320667935d flake8 version 3.8.4 2020-11-04 19:09:34 -08:00
894b74f523 Merge branch 'master' into expanding-S3-plugin 2020-11-04 18:39:23 -08:00
206d010c9a Version updates and making lint happy 2020-11-04 18:23:39 -08:00
92a555ba4b Merge pull request #3233 from charhate/ecc_changes
Fixing build and test warnings
2020-11-04 18:16:35 -08:00
7d2ce61303 Updating comment for application context 2020-11-04 18:04:57 -08:00
8990209411 Merge branch 'master' into ecc_changes 2020-11-04 17:00:09 -08:00
fb25d82eea Merge pull request #3235 from jtschladen/stop-repeating-certs-in-security-emails
Stop repeating certs when sending expiration notifications to security team email
2020-11-04 11:09:04 -08:00
4d32adb3bf Merge branch 'master' into stop-repeating-certs-in-security-emails 2020-11-04 10:58:20 -08:00
4cc0f6bb60 Stop repeating certs when sending expiration notifications to security team email 2020-11-04 10:53:27 -08:00
ab014873d0 invalid escape sequence warning for not an escape char 2020-11-03 19:33:13 -08:00
003779a112 Mock fix for DeprecationWarning: callable is None 2020-11-03 19:27:41 -08:00
dc7497e29d Fix Working outside of application context Test Failures in dev 2020-11-03 19:05:18 -08:00
2a61206fdf Merge branch 'master' into expanding-S3-plugin 2020-11-03 17:25:06 -08:00
c71dbcb0a0 Fix duplicate tests 2020-11-03 09:48:25 +01:00
bc564b574d Merge branch 'master' into feature/acme-http-challenge 2020-11-03 09:36:37 +01:00
3d64aa8d11 Fixing DeprecationWarning: callable is None: another syntax 2020-11-02 18:58:38 -08:00
86b2cfbe4a invalid escape sequence \ 2020-11-02 18:45:38 -08:00
b75bd56546 Check if ValueError assert works old way 2020-11-02 18:29:22 -08:00
6922d34825 invalid escape sequence \ 2020-11-02 18:16:15 -08:00
825a001a8b pass algorithm to jwt.decode() during login
api_jwt.py : pass "algorithms" argument when calling decode(). This argument will be mandatory in a future version
2020-11-02 17:37:04 -08:00
d88da028b1 Replace binary with LargeBinary
https://flask-appbuilder.readthedocs.io/en/latest/_modules/sqlalchemy/sql/sqltypes.html
2020-11-02 17:37:04 -08:00
d821024e35 Fixing DeprecationWarning: callable is None 2020-11-02 17:37:04 -08:00
2dac95c6fb Replacing PassiveDefault (deprecated) with DefaultClause 2020-11-02 17:37:04 -08:00
4ffced70f8 backref cannot be set for viewonly relationship
will be deprecated in SQLAlchemy 1.4, and will be disallowed in a future release
2020-11-02 17:37:04 -08:00
634339eac6 replacing imp (deprecated) with importlib 2020-11-02 17:37:04 -08:00
5569c9d8e1 Merge pull request #3232 from Netflix/hosseinsh-travis-ci-email
Disabling travis-ci emaill notification on success
2020-11-02 17:25:21 -08:00
8659504a8b Remove debug logs 2020-11-02 16:19:30 -08:00
8e8a89bdfb Refactor notification PUT to expect add/remove sets instead of full certificate set 2020-11-02 16:17:11 -08:00
4659df42d5 better formatting 2020-11-02 15:49:11 -08:00
e9b0e2eca7 Merge branch 'master' into hosseinsh-travis-ci-email 2020-11-02 14:27:03 -08:00
9ad9f349ba Merge pull request #3231 from Netflix/dependabot/pip/boto3-1.16.9 2020-11-02 19:28:40 +00:00
fa620e539d Bump boto3 from 1.16.5 to 1.16.9
Bumps [boto3](https://github.com/boto/boto3) from 1.16.5 to 1.16.9.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.16.5...1.16.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-02 19:21:05 +00:00
c4e3998715 Merge pull request #3228 from Netflix/dependabot/pip/pytest-6.1.2 2020-11-02 19:18:14 +00:00
fc2fce6c0b Bump pytest from 6.1.1 to 6.1.2
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.1.1 to 6.1.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.1.1...6.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-02 19:10:18 +00:00
3f46b0b6d7 Merge pull request #3227 from Netflix/dependabot/pip/sphinx-3.3.0 2020-11-02 19:08:20 +00:00
2331638ed1 Bump sphinx from 3.2.1 to 3.3.0
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.2.1 to 3.3.0.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.2.1...v3.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-02 19:01:19 +00:00
01f31772bb Merge pull request #3229 from Netflix/dependabot/pip/pre-commit-2.8.2 2020-11-02 18:59:04 +00:00
771c272895 Bump pre-commit from 2.7.1 to 2.8.2
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.7.1 to 2.8.2.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.7.1...v2.8.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-02 18:51:46 +00:00
3fb0aae43a Merge pull request #3226 from Netflix/dependabot/pip/cryptography-3.2.1 2020-11-02 18:49:55 +00:00
a15e1831d0 turning off Travis-ci notification on success 2020-11-02 09:43:09 -08:00
a4d2f79a9b Bump cryptography from 3.2 to 3.2.1
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.2 to 3.2.1.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.2...3.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-02 13:34:06 +00:00
9c6856bcdd adjusting the tests to the better naming 2020-10-30 18:36:32 -07:00
7bca42776b better comments 2020-10-30 18:28:34 -07:00
3dfafa0021 making lint happy 2020-10-30 18:28:10 -07:00
add0960579 more meaningful variable naming 2020-10-30 18:18:37 -07:00
e1ff89eb2d better return arguments 2020-10-30 18:18:14 -07:00
cc2aa5c1de cli for live testing 2020-10-30 18:17:34 -07:00
ba8eb7a3f5 better logging and metrics 2020-10-30 18:17:02 -07:00
c5769378cf making lint happy 2020-10-30 15:21:22 -07:00
f90041353c Merge branch 'master' into expanding-S3-plugin 2020-10-30 15:19:26 -07:00
8eba97fd14 Merge pull request #3223 from charhate/ecc_changes
Small fixes
2020-10-30 11:06:02 -07:00
d41daeb4af Merge branch 'master' into ecc_changes 2020-10-30 10:55:23 -07:00
507e3caee5 Merge pull request #3224 from Netflix/cname_01
Fixing floating comma in CNAME PR
2020-10-29 19:09:47 -07:00
cc05d21260 Merge branch 'master' into cname_01 2020-10-29 18:59:43 -07:00
a4178ca113 fixing floating comma in CNAME PR 2020-10-29 18:52:22 -07:00
69aa98c1c8 Merge branch 'master' into ecc_changes 2020-10-29 18:05:38 -07:00
03dfbf535d Consistent algo in UI and API
Removed '-' since UI displays only handful options
2020-10-29 17:59:31 -07:00
aec24ae132 Missing commit in downgrade 2020-10-29 17:58:37 -07:00
4e44dd3d8f Check if authority options is JSON Array 2020-10-29 17:57:54 -07:00
4330a42dd3 Merge pull request #3196 from GnunuX/url_context_path
Do not add urlContextPath to relative path
2020-10-29 16:20:05 -07:00
725eee549d Merge branch 'master' into url_context_path 2020-10-29 15:11:39 -07:00
497bd6a13c Merge pull request #3209 from jtschladen/notification-plugin-field-fix
Fix plugin field on notification edit
2020-10-29 15:08:12 -07:00
945ec0895b Merge branch 'master' into url_context_path 2020-10-29 15:06:50 -07:00
9aa2d2af76 Merge branch 'master' into notification-plugin-field-fix 2020-10-29 14:58:43 -07:00
4bc5899e24 Merge pull request #3221 from Netflix/cname_01
Delegated CNAME DNS validation for ACME
2020-10-29 14:50:19 -07:00
ccecb26816 Merge branch 'cname_01' of github.com:Netflix/lemur into cname_01 2020-10-29 14:43:14 -07:00
ca465e3c9e updating debug string with target_domain 2020-10-29 14:42:51 -07:00
a3a02a8077 Merge branch 'master' into notification-plugin-field-fix 2020-10-29 14:32:57 -07:00
2aec317127 Merge branch 'master' into cname_01 2020-10-29 14:32:23 -07:00
83d363fd9e Merge pull request #3219 from jtschladen/certificates-for-notification-fix
Fix notification view to actually show associated certs
2020-10-29 14:29:55 -07:00
1c59fb575c Fix the 'more' button to view certificates associated with a notification 2020-10-29 14:28:54 -07:00
86207db93b Merge branch 'master' into certificates-for-notification-fix 2020-10-29 14:21:25 -07:00
15a7921bf4 Merge branch 'master' into cname_01 2020-10-29 14:09:48 -07:00
84f8905cf1 Hide expired certs for notifications 2020-10-29 14:07:25 -07:00
cca4670745 Merge pull request #3220 from jtschladen/ses-arn-override
Add ability to override SourceArn for SES
2020-10-29 14:06:05 -07:00
14348a1f95 Merge branch 'master' into cname_01 2020-10-29 14:01:14 -07:00
28c6f8583a Merge branch 'master' into ses-arn-override 2020-10-29 13:52:51 -07:00
a1f99c29c0 Merge branch 'cname_01' of github.com:Netflix/lemur into cname_01 2020-10-29 13:51:58 -07:00
aa2e0aa2f9 Merge pull request #3222 from jtschladen/sns-date-subject
Add subject for SNS messages and correct date format
2020-10-29 13:51:26 -07:00
2b91077d92 updating variables based on feedback 2020-10-29 13:51:22 -07:00
28686fcf5d Merge branch 'ses-arn-override' of github.com:jtschladen/lemur into ses-arn-override 2020-10-29 13:48:55 -07:00
45cc9528d2 Cleaner syntax for default region 2020-10-29 13:48:43 -07:00
78afc060ae Add subject for SNS messages and correct date format 2020-10-29 13:41:47 -07:00
e967f2c676 Merge branch 'master' into ses-arn-override 2020-10-29 11:11:30 -07:00
2cea33cb11 Merge branch 'master' into expanding-S3-plugin 2020-10-29 11:09:00 -07:00
af348b1012 Merge branch 'master' into cname_01 2020-10-28 22:41:23 -07:00
33a006bbeb fixing delete with optional validation 2020-10-28 22:24:37 -07:00
b47667b73e cname redirection working 2020-10-28 20:51:35 -07:00
3e492e6310 Add ability to override SES region 2020-10-28 17:09:54 -07:00
ff83721720 Merge pull request #3211 from charhate/ecc_changes
Modify description during reissue
2020-10-28 17:08:03 -07:00
bbfc65813d Merge branch 'master' into ecc_changes 2020-10-28 17:00:45 -07:00
166dfa89ad Merge pull request #3204 from GnunuX/log_update
do not create db_upgrade.log during migrations
2020-10-28 17:00:22 -07:00
6adf94d28f Merge branch 'master' into log_update 2020-10-28 16:52:19 -07:00
43ebc5aac1 Merge pull request #3212 from hosseinsh/issuer-retry
Issuer retry
2020-10-28 16:51:58 -07:00
9fd61a37dc Merge branch 'master' into log_update 2020-10-28 16:39:18 -07:00
576302fdd5 Merge branch 'master' into issuer-retry 2020-10-28 16:35:25 -07:00
54566ad4c3 Merge pull request #3218 from Netflix/hosseinsh-travis-contact-update
updating notification contact for travis-ci
2020-10-28 16:34:57 -07:00
5e696f36bf Add ability to override SourceArnn for SES 2020-10-28 16:34:31 -07:00
acc95a4b66 Fix notification view to actually show associated certs 2020-10-28 16:12:27 -07:00
c25782468b Merge branch 'master' into log_update 2020-10-28 15:40:16 -07:00
c0bf111cb9 updating notification contact for travis 2020-10-28 15:02:22 -07:00
cc69b433ca Merge branch 'master' into notification-plugin-field-fix 2020-10-28 14:58:58 -07:00
d27f2a53af Merge branch 'master' of github.com:Netflix/lemur into cname_01 2020-10-28 14:03:23 -07:00
95b647ee1d Merge branch 'master' into ecc_changes 2020-10-28 13:54:14 -07:00
84d30b5d50 Merge branch 'master' into issuer-retry 2020-10-28 13:21:10 -07:00
31b9e2cd20 Merge pull request #3201 from jtschladen/sns
Support for SNS Expiration Notifications
2020-10-28 13:19:54 -07:00
13e8421c78 Merge branch 'master' into notification-plugin-field-fix 2020-10-28 08:50:46 -07:00
16ce7970d0 Merge branch 'master' into sns 2020-10-28 08:50:09 -07:00
a9d3b7a676 Merge branch 'master' into issuer-retry 2020-10-28 08:48:29 -07:00
adca20ade1 Merge pull request #3214 from hosseinsh/improving-cn-owner-search-endpooint
Improving cn/owner search endpoint
2020-10-28 08:39:10 -07:00
23e1700fad flake8 2020-10-28 13:47:57 +01:00
b656e0d75a Merge branch 'master' into feature/acme-http-challenge 2020-10-28 13:46:29 +01:00
b7b7e9022f Merge branch 'master' into sns 2020-10-27 17:41:29 -07:00
794e4d3855 Revert log to debug to be safe 2020-10-27 17:36:01 -07:00
61ef7f207d Merge branch 'master' into improving-cn-owner-search-endpooint 2020-10-27 17:01:27 -07:00
44e4100a39 Merge pull request #3217 from hosseinsh/travis-dist-update
Travis dist update
2020-10-27 17:00:52 -07:00
2dd9ea3d01 Merge branch 'master' of github.com:Netflix/lemur into travis-dist-update
* 'master' of github.com:Netflix/lemur:
  Bump boto3 from 1.15.16 to 1.16.5
  Bump cryptography from 3.1.1 to 3.2
  Bump fakeredis from 1.4.3 to 1.4.4
2020-10-27 16:43:13 -07:00
a1af7c89b1 we have been running on bionic since some time 2020-10-27 16:43:02 -07:00
c6a8034890 language 2020-10-27 16:13:05 -07:00
f77c262953 how did that happen 2020-10-27 14:44:18 -07:00
10aa02fd85 more compact design, thanks to Chad for the feedback 2020-10-27 14:42:51 -07:00
54c2245115 comments 2020-10-27 12:47:35 -07:00
d59a558d58 adopting ilike and not relying on ==
reducing redundancy
2020-10-27 12:44:38 -07:00
e9824a6808 change the log level to info if upgrade is successful 2020-10-27 20:38:18 +01:00
79647e3372 add reference to LOG_UPGRADE_FILE in toplevel comment 2020-10-27 20:38:18 +01:00
7f25e02589 Merge branch 'master' into expanding-S3-plugin 2020-10-27 12:02:14 -07:00
729a6e69f5 Merge branch 'master' into sns 2020-10-27 12:02:01 -07:00
46ec1798d3 Merge branch 'master' into log_update 2020-10-27 12:01:53 -07:00
437933c558 Merge branch 'master' into issuer-retry 2020-10-27 12:01:11 -07:00
259a8808f1 Merge branch 'master' into improving-cn-owner-search-endpooint 2020-10-27 12:00:45 -07:00
56061a7e3b Merge branch 'master' into url_context_path 2020-10-27 12:00:00 -07:00
7a982a731a Merge branch 'master' into ecc_changes 2020-10-27 11:58:47 -07:00
dfdb26f994 Merge pull request #3216 from Netflix/dependabot/pip/boto3-1.16.5 2020-10-27 18:56:52 +00:00
97f66276ec Merge branch 'master' into log_update 2020-10-27 10:53:20 -07:00
196a311084 Bump boto3 from 1.15.16 to 1.16.5
Bumps [boto3](https://github.com/boto/boto3) from 1.15.16 to 1.16.5.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.15.16...1.16.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-27 17:26:18 +00:00
3551437d9c Merge pull request #3215 from Netflix/dependabot/pip/cryptography-3.2 2020-10-27 17:23:05 +00:00
20b8c2fd93 PR feedback 2020-10-27 08:56:43 -07:00
5c3758731c Bump cryptography from 3.1.1 to 3.2
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.1.1 to 3.2.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.1.1...3.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-27 13:45:59 +00:00
ccf87986c0 Add store_account to AcmeDnsIssuer 2020-10-27 12:15:07 +01:00
96fbcdaf70 Fix test_finalize_authorizations, dont reuse cleanup_dns_challenges in finalize_authorizations 2020-10-27 11:27:44 +01:00
103e107668 Fix patches for test_create_certificate 2020-10-27 11:16:29 +01:00
82bf8e2ac6 Remove unnecessary code from dnsChallenge, Fix patches in dns tests 2020-10-27 11:09:30 +01:00
2d98e71977 Replace deprecated assertRaisesRegexp with assertRaisesRegex 2020-10-27 10:44:04 +01:00
30c10b93f8 Fix patches for acme_handler tests 2020-10-27 10:37:30 +01:00
3b20a47603 Fix patches for acme_http tests, apparently isinstance is considered evil in python 2020-10-27 10:37:30 +01:00
4464c5890d Flake8 2020-10-27 10:37:30 +01:00
812e1dee92 Refactor Acme plugin into AcmeChallenge objects, dns01 2020-10-27 10:37:27 +01:00
b91cebf245 Refactor Acme plugin into AcmeChallenge objects, http01 2020-10-27 10:36:06 +01:00
6c1be02bfa Remove destination_list from AcmeHttpIssuer 2020-10-27 10:28:34 +01:00
ef0fce2661 Set timeout for finalize to 90s 2020-10-27 10:28:34 +01:00
235653b558 Refactor destination selection for acme-http authorities, to load destinations dynamically 2020-10-27 10:28:34 +01:00
81b078604c Implement revoke certificate for ACME 2020-10-27 10:28:34 +01:00
215070b327 Fix create_certificate tests 2020-10-27 10:28:34 +01:00
41ea59d7e3 Remove unneeded polling 2020-10-27 10:28:33 +01:00
d24fae0bac Fix permissions on acme token upload, dont append well-known automatically 2020-10-27 10:28:33 +01:00
66cab6abd3 Make http-01 challenge work for SAN certificates 2020-10-27 10:28:33 +01:00
e3e5ef7d66 Refactor AcmeHandler, Move DNS stuff into AcmeDnsHandler 2020-10-27 10:28:33 +01:00
76dcfbd528 Add more tests 2020-10-27 10:28:33 +01:00
d6719b729c Implement some test for AcmeHttpIssuerPlugin 2020-10-27 10:28:33 +01:00
b2de986652 Split tests into handler, and dns specifics 2020-10-27 10:28:30 +01:00
b93d271f31 Fix flake8 2020-10-27 10:25:31 +01:00
e06bdcf2a3 Implement create_certificate for HTTP-01 challenge 2020-10-27 10:25:31 +01:00
3012995c76 Improve naming, make it possible to create directories recursively with SFTP 2020-10-27 10:25:31 +01:00
348d8477dd Refactor destination plugin, to allow upload of ACME http-challenge tokens 2020-10-27 10:25:31 +01:00
d00dd9d295 Initial structure for ACME http challenge 2020-10-27 10:25:31 +01:00
faceee0f77 Merge branch 'master' into expanding-S3-plugin 2020-10-26 19:42:56 -07:00
56a4200d2c Merge branch 'master' into notification-plugin-field-fix 2020-10-26 19:42:39 -07:00
645b45401d Merge branch 'master' into sns 2020-10-26 19:42:21 -07:00
3b258447db addressing Chad's feedbakc 2020-10-26 19:16:40 -07:00
2430507e55 Merge branch 'master' of github.com:Netflix/lemur into improving-cn-owner-search-endpooint
* 'master' of github.com:Netflix/lemur:
  Bump fakeredis from 1.4.3 to 1.4.4
2020-10-26 18:34:40 -07:00
1ef6139f9b ignore rotated certs, since there is a new cert that can be used 2020-10-26 18:34:21 -07:00
6a1b4b4857 ignore expired certs 2020-10-26 18:33:33 -07:00
709a9808aa better structure of the query and and removing ilike 2020-10-26 18:32:53 -07:00
cb4f814478 Merge branch 'master' into issuer-retry 2020-10-26 18:01:12 -07:00
4fffb8ba5b Merge branch 'master' into log_update 2020-10-26 18:01:01 -07:00
a87bf0d50a Merge branch 'master' into url_context_path 2020-10-26 17:59:57 -07:00
831e5619e1 Merge pull request #3198 from Netflix/dependabot/pip/fakeredis-1.4.4
Bump fakeredis from 1.4.3 to 1.4.4
2020-10-26 17:58:27 -07:00
ab47db4cd4 Merge branch 'master' into log_update 2020-10-26 17:57:27 -07:00
392725ff30 Add description check in reissue unit test 2020-10-26 15:33:20 -07:00
749aa772ba First change to get CNAME redirection working 2020-10-26 11:57:33 -07:00
2d94b19c32 Merge branch 'notification-plugin-field-fix' of github.com:jtschladen/lemur into notification-plugin-field-fix 2020-10-26 11:27:53 -07:00
3f765b51ef Fix sources and destinations, and allow actually updating the notification type 2020-10-26 11:27:40 -07:00
6723e3c80d now fixing the month to minute bug 2020-10-26 11:27:40 -07:00
3290d6634b fixing testing 2020-10-26 11:27:40 -07:00
fa62023b2d fixing the time bug, sub-second to second, and month to minute! 2020-10-26 11:27:40 -07:00
37f05a89f2 Bump botocore from 1.18.16 to 1.18.18
Bumps [botocore](https://github.com/boto/botocore) from 1.18.16 to 1.18.18.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.18.16...1.18.18)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-26 11:27:40 -07:00
d7478a5c5c use an alternative logger for the upgrade 2020-10-25 19:24:17 +01:00
f6554a9a1e typo, fixing abstract class complaints 2020-10-23 18:03:55 -07:00
0e02abbb37 Entrust just looks into CSR for RSA/EC key type 2020-10-23 18:03:27 -07:00
9957120a7f adding missing import 2020-10-23 18:03:07 -07:00
7e573d6d51 fixing typo 2020-10-23 18:02:54 -07:00
6891077501 readability 2020-10-23 18:02:35 -07:00
75bc3a5b20 refactoring and adding retry 2020-10-23 18:02:05 -07:00
d233490c8a simple retry 2020-10-23 18:01:14 -07:00
2c1e7b19a2 10x 10s delay might be too long for the load balancer request 2020-10-23 17:59:58 -07:00
db0b245b6c Merge branch 'master' into sns 2020-10-23 17:12:06 -07:00
2c22d42a57 Modify description during reissue
Include the certificate ID being reissued and mention that this is created by Lemur as part of reissue
2020-10-23 17:07:14 -07:00
0a05f99741 Merge branch 'master' into notification-plugin-field-fix 2020-10-23 16:39:01 -07:00
d9bbf42480 Merge branch 'master' into dependabot/pip/fakeredis-1.4.4 2020-10-23 16:37:34 -07:00
d58b32a19c Merge pull request #3199 from Netflix/dependabot/pip/botocore-1.18.18 2020-10-23 22:56:13 +00:00
3d83db6f8f Merge branch 'master' into expanding-S3-plugin 2020-10-23 14:13:30 -07:00
2b7cb0d44f Merge branch 'master' into url_context_path 2020-10-23 14:13:25 -07:00
fd16edb3e5 Merge branch 'master' into notification-plugin-field-fix 2020-10-23 14:13:21 -07:00
30915d30be Merge branch 'master' into log_update 2020-10-23 14:13:17 -07:00
5b523bb8ed Merge branch 'master' into dependabot/pip/fakeredis-1.4.4 2020-10-23 14:12:39 -07:00
584159c916 Merge branch 'master' into dependabot/pip/botocore-1.18.18 2020-10-23 14:12:35 -07:00
01bd357b1c Merge branch 'master' into sns 2020-10-23 11:38:35 -07:00
fd12d4848c Grammar fixes 2020-10-23 11:26:11 -07:00
582c7b0771 Merge pull request #3210 from hosseinsh/digicert-time-bug-fix
Digicert time bug fix
2020-10-23 10:48:18 -07:00
1495fb3595 now fixing the month to minute bug 2020-10-23 10:18:24 -07:00
bc6fb02fc2 fixing testing 2020-10-23 10:16:38 -07:00
e01863097b fixing the time bug, sub-second to second, and month to minute! 2020-10-23 10:16:23 -07:00
a5cea4fb9a Skip revoked certs when looking for certs to notify 2020-10-23 09:42:03 -07:00
233f9768e8 Fix error handling 2020-10-23 09:35:46 -07:00
5ccc99bbfa Merge branch 'master' into dependabot/pip/botocore-1.18.18 2020-10-23 09:08:47 -07:00
98962ae5f5 Merge branch 'master' into sns 2020-10-23 08:50:26 -07:00
41ac43013d Merge branch 'master' into notification-plugin-field-fix 2020-10-23 08:43:29 -07:00
2ea39a51e3 Merge pull request #3208 from hosseinsh/improved-logging
Improved issuer logging
2020-10-23 08:43:11 -07:00
2b274f723a Merge branch 'master' into improved-logging 2020-10-23 07:59:30 -07:00
e87cf040f3 Merge pull request #3207 from hosseinsh/entrust-deactivate
Entrust deactivate test certificates
2020-10-23 07:59:15 -07:00
71df6b8560 Fix plugin field on notification edit 2020-10-22 18:15:26 -07:00
8610af8b83 more precise language 2020-10-22 17:54:46 -07:00
820106e333 Merge branch 'master' into expanding-S3-plugin 2020-10-22 17:35:20 -07:00
9ce0010bf1 handle_respone can also handle the no data response 2020-10-22 17:33:39 -07:00
cf87e178c8 making lint happy 2020-10-22 17:33:02 -07:00
97f80b79dc adjusting digicert test to support seconds 2020-10-22 17:23:33 -07:00
9acd974b74 fixing the test to support seconds 2020-10-22 17:20:47 -07:00
ae1e9d120b consistent messaging 2020-10-22 17:13:58 -07:00
2e7652962c refactoring of the error handling 2020-10-22 17:11:02 -07:00
1c96ea9ab1 better messaging of exceptions 2020-10-22 17:10:32 -07:00
02c040865d more meaningful message 2020-10-22 16:05:29 -07:00
8fa90a2ce5 digicert expects also seconds, though not yet honoring it 2020-10-22 16:01:09 -07:00
c60645bec4 improved logging for all responses 2020-10-22 16:00:26 -07:00
c2fe2b5e03 improved logging for all responses 2020-10-22 15:59:59 -07:00
03d1af16e7 better logging for exceptions around all plugins 2020-10-22 15:59:38 -07:00
3e1e17998e Merge branch 'master' into url_context_path 2020-10-22 12:04:11 -07:00
2b876f22a5 Merge branch 'master' into log_update 2020-10-22 12:00:51 -07:00
2e7e3a82fa Update cli.py
logging in exception
2020-10-22 11:57:54 -07:00
c40ecd12cb improved naming 2020-10-22 10:58:16 -07:00
2cc03088cd creating a celery task 2020-10-21 19:53:08 -07:00
a4dba0cb35 creating a cli to handle entrust deactivation 2020-10-21 19:52:51 -07:00
906b3b2337 better handling of status code 2020-10-21 19:52:25 -07:00
92eec5cc9c revocation should only check for not expired and not revoked certs 2020-10-21 18:52:55 -07:00
55f219e97a Merge pull request #3206 from charhate/ecc_changes
Check if present - Organization, State, Country
2020-10-21 16:25:03 -07:00
adf8f37718 Merge branch 'master' into log_update 2020-10-21 16:03:46 -07:00
43483cb1c7 Check if present - Organization, State, Country 2020-10-21 15:44:53 -07:00
2ccb7034b5 Merge pull request #3205 from charhate/ecc_changes
Check if OU and L is present in subject
2020-10-21 13:11:04 -07:00
0986a7a3ff Merge branch 'master' into ecc_changes 2020-10-21 12:32:35 -07:00
757e190b60 Check if OU and L is present in subject
fixing index out of range
2020-10-21 12:11:41 -07:00
9374adaa46 do not create db_upgrade.log during migrations 2020-10-21 11:17:54 +02:00
c1bf192bd8 Merge pull request #3203 from charhate/ecc_changes
Removing ECC 192 and 521 from UI
2020-10-20 18:14:08 -07:00
18fdd420a7 Merge branch 'master' into ecc_changes 2020-10-20 18:08:16 -07:00
4997165235 Removing ECC 192 and 521 from UI
not CAB supported. Keeping 521 for authority
2020-10-20 17:59:50 -07:00
59a97cde1d Merge pull request #3202 from charhate/ecc_changes
Fix cert reissue when L/OU is not set
2020-10-20 17:23:31 -07:00
01dddd2a55 iterate over subject details 2020-10-20 17:17:28 -07:00
788703ce12 Fix cert reissue when L/OU is not set
get_certificate_primitives complains with None L/OU
2020-10-20 16:44:17 -07:00
1fc9cd2ff8 Merge branch 'master' into sns 2020-10-20 12:13:51 -07:00
4f552cb636 Code cleanup 2020-10-20 12:02:36 -07:00
d6075ebc11 Merge 2020-10-20 11:48:54 -07:00
63ace016f9 Merge branch 'master' into url_context_path 2020-10-20 10:23:08 -07:00
a3b90c1a6b Bump botocore from 1.18.16 to 1.18.18
Bumps [botocore](https://github.com/boto/botocore) from 1.18.16 to 1.18.18.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.18.16...1.18.18)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-20 09:23:10 +00:00
58798fbc2e Bump fakeredis from 1.4.3 to 1.4.4
Bumps [fakeredis](https://github.com/jamesls/fakeredis) from 1.4.3 to 1.4.4.
- [Release notes](https://github.com/jamesls/fakeredis/releases)
- [Commits](https://github.com/jamesls/fakeredis/compare/1.4.3...1.4.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-20 09:21:21 +00:00
ea33fe9979 Merge pull request #3197 from charhate/ecc_changes
Show only few supported ECC algorithms on UI
2020-10-19 17:53:48 -07:00
5cf9ea4830 Merge branch 'master' into url_context_path 2020-10-19 17:50:43 -07:00
855baadfee Show only few supported ECC algorithms on UI 2020-10-19 17:42:52 -07:00
669a4273c2 Merge branch 'master' of github.com:jtschladen/lemur into sns 2020-10-19 16:29:33 -07:00
ad07b41763 Merge pull request #3193 from jtschladen/notification-fixes
Miscellaneous notification fixes and tests
2020-10-19 16:17:57 -07:00
b5f0fc5a19 Fix syntax error 2020-10-19 15:21:34 -07:00
ecd4d6ebe3 Change string formatting pattern 2020-10-19 15:12:48 -07:00
af3afe36e1 Merge branch 'master' into expanding-S3-plugin 2020-10-19 14:23:01 -07:00
591c8cf524 Do not add urlContextPath to relative path 2020-10-19 22:35:10 +02:00
e90b08b363 Correct typo and enable Slack notification test 2020-10-16 17:08:44 -07:00
6a1889787d Correct log attributes 2020-10-16 16:30:21 -07:00
2c92fc6eb9 Merge branch 'notification-fixes' of github.com:jtschladen/lemur into notification-fixes 2020-10-16 16:22:28 -07:00
072b337f37 Restructure log messages 2020-10-16 16:21:43 -07:00
fe5d75c7f8 Merge branch 'master' into notification-fixes 2020-10-16 15:20:42 -07:00
60bb0037f0 Miscellaneous notification fixes and tests 2020-10-16 15:13:12 -07:00
cb2f340277 Merge pull request #3190 from charhate/cab_compliant
Use cab_compliant option instead of authority name list
2020-10-16 14:59:51 -07:00
dbdfa9eab8 Merge branch 'master' into expanding-S3-plugin 2020-10-16 11:35:38 -07:00
a04cce6044 Initial implementation 2020-10-16 10:40:11 -07:00
503530e935 the test requires region param for sts 2020-10-16 10:32:10 -07:00
11ce540246 formatting 2020-10-16 10:31:19 -07:00
9c04a888d8 adjusting the S3 test 2020-10-16 09:52:04 -07:00
17e528b5dd adding testing for acme_upload method 2020-10-16 09:50:35 -07:00
d705e3ae3b expanding the S3 destination plugin to support the acme token upload inteface 2020-10-16 09:49:56 -07:00
7d8eb1c61e improving test 2020-10-16 09:49:26 -07:00
6aad37e1f9 cleaning up code 2020-10-16 09:49:00 -07:00
d73db59d23 revsering removing region 2020-10-16 09:48:47 -07:00
ab91d58a03 Merge branch 'master' into cab_compliant 2020-10-16 08:33:04 -07:00
67c184a97c Merge pull request #3191 from unic/hotfix/fix-alembic-url-escaping
Fix "ValueError: invalid interpolation syntax in" for special chars in SQLALCHEMY_DATABASE_URI
2020-10-16 08:32:51 -07:00
55658c5f23 Add double % for escaped SQLALCHEMY_DATABASE_URI 2020-10-16 10:43:52 +02:00
bfe89e131e adding delete and put interfaces for the S3 plugin 2020-10-15 18:13:50 -07:00
29f3dd43f2 Update administration.rst
language
2020-10-15 15:18:04 -07:00
32c0c5fb00 Merge pull request #1 from Netflix/master
Merge pull request #3188 from charhate/cab_compliant
2020-10-15 11:18:47 -07:00
9dc476f393 Use cab_compliant option instead of authority name list 2020-10-15 10:44:46 -07:00
cd29b2b870 Merge pull request #3188 from charhate/cab_compliant
Cab compliant
2020-10-15 10:22:41 -07:00
f38380d156 Check if option is present 2020-10-14 17:38:32 -07:00
4d5e712e85 Remove option reset from test 2020-10-14 15:40:23 -07:00
ee1d07000a Test subject details in reissue with cab_compliant option 2020-10-14 14:49:53 -07:00
90839b4d4b Unit test for cab_compliant = true 2020-10-14 14:49:53 -07:00
0e3638b86c Merge branch 'master' into cab_compliant 2020-10-14 13:33:34 -07:00
c75d44864e Merge pull request #3189 from Netflix/dependabot/pip/faker-4.14.0 2020-10-14 20:31:01 +00:00
62d099b500 Unit tests to check cab_compliant option 2020-10-14 12:41:56 -07:00
ddf94e04da Bump faker from 4.4.0 to 4.14.0
Bumps [faker](https://github.com/joke2k/faker) from 4.4.0 to 4.14.0.
- [Release notes](https://github.com/joke2k/faker/releases)
- [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/joke2k/faker/compare/v4.4.0...v4.14.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-14 18:09:48 +00:00
16766b1f84 Merge pull request #3183 from Netflix/dependabot/pip/boto3-1.15.16 2020-10-14 18:07:49 +00:00
f08b50a952 Bump boto3 from 1.15.12 to 1.15.16
Bumps [boto3](https://github.com/boto/boto3) from 1.15.12 to 1.15.16.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.15.12...1.15.16)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-14 17:45:18 +00:00
ea915282b2 Merge pull request #3186 from Netflix/dependabot/pip/acme-1.9.0 2020-10-14 17:42:24 +00:00
499bbca42e Bump acme from 1.8.0 to 1.9.0
Bumps [acme](https://github.com/letsencrypt/letsencrypt) from 1.8.0 to 1.9.0.
- [Release notes](https://github.com/letsencrypt/letsencrypt/releases)
- [Commits](https://github.com/letsencrypt/letsencrypt/compare/v1.8.0...v1.9.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-14 17:16:30 +00:00
a0ebfad89d Merge pull request #3184 from Netflix/dependabot/pip/arrow-0.17.0 2020-10-14 17:14:13 +00:00
60a8219869 Merge branch 'master' into cab_compliant 2020-10-14 10:04:11 -07:00
409e12a9d6 Update models.py
lint
2020-10-14 10:03:44 -07:00
2fefbb6dea Bump arrow from 0.16.0 to 0.17.0
Bumps [arrow](https://github.com/arrow-py/arrow) from 0.16.0 to 0.17.0.
- [Release notes](https://github.com/arrow-py/arrow/releases)
- [Changelog](https://github.com/arrow-py/arrow/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/arrow-py/arrow/compare/0.16.0...0.17.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-14 16:58:24 +00:00
04fd7c83c1 Merge pull request #3182 from Netflix/dependabot/pip/botocore-1.18.16 2020-10-14 16:56:13 +00:00
894e35b4e2 Update schemas.py
minor language
2020-10-14 09:48:40 -07:00
97cf54433b Update models.py
language
2020-10-14 09:45:13 -07:00
82dd663942 Moving default key_type to getDefaults 2020-10-13 19:40:32 -07:00
28381737dc Removed OU from digicert plugin 2020-10-13 19:40:15 -07:00
b677e6e325 Copy subject details for non-CAB-compliant authorities 2020-10-13 19:40:01 -07:00
8b8f9e652b Bump botocore from 1.18.12 to 1.18.16
Bumps [botocore](https://github.com/boto/botocore) from 1.18.12 to 1.18.16.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.18.12...1.18.16)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-13 06:24:35 +00:00
5aa37b48d3 Merge pull request #3181 from hosseinsh/removing-outdated-language
cleaning up outdated language
2020-10-12 10:29:30 -07:00
5db1d31668 Merge branch 'master' into removing-outdated-language 2020-10-12 10:22:53 -07:00
896d1af0f7 Merge pull request #3153 from unic/feature/store-acme-account-details
Store ACME account details
2020-10-12 10:22:16 -07:00
817fc3f0fe Merge branch 'master' into feature/store-acme-account-details 2020-10-11 14:37:31 +02:00
c65386a8a8 Merge pull request #3180 from charhate/ui_changes
Certificate edit: update role and notification with owner change
2020-10-09 18:14:06 -07:00
4c7b429001 Merge branch 'master' into ui_changes 2020-10-09 18:05:33 -07:00
71697bad34 Merge pull request #3175 from hosseinsh/dymanic-digicert-ICAs
Dynamic DigiCert Intermediate CA
2020-10-09 18:05:16 -07:00
770339f94c cleaning up outdated phrases 2020-10-09 18:04:16 -07:00
fb4df8865b Formatting changes and typo 2020-10-09 17:58:03 -07:00
0fc050e17b Merge branch 'master' into dymanic-digicert-ICAs 2020-10-09 17:53:54 -07:00
475833e8e1 Merge branch 'master' into ui_changes 2020-10-09 17:53:43 -07:00
1d18f061f2 Merge pull request #3179 from sirferl/entrust-plugin
Entrust plugin - Additional Test and fixes
2020-10-09 17:53:21 -07:00
198e20ce4f Merge branch 'master' into dymanic-digicert-ICAs 2020-10-09 17:49:33 -07:00
d4819440af Merge branch 'master' into entrust-plugin 2020-10-09 17:47:01 -07:00
d52e0d4e09 Certificate edit: update role and notification with owner change 2020-10-09 16:55:30 -07:00
b59c76d630 Merge pull request #3176 from charhate/ui_changes
Fix disable notify
2020-10-09 16:49:56 -07:00
42e9b8b627 removing the intermediary from being optional 2020-10-09 15:40:25 -07:00
e67fc09bc8 Merge branch 'entrust-plugin' of github.com:sirferl/lemur into entrust-plugin 2020-10-09 12:11:41 +02:00
5a968ffe63 Lint errors 2020-10-09 12:05:57 +02:00
cc02a0adb0 Merge branch 'master' into entrust-plugin 2020-10-09 11:56:47 +02:00
723bf67957 Merge branch 'master' into master 2020-10-09 11:45:30 +02:00
d43e240a2a dded ELIF at determine_end_date, becuase of error. 2020-10-09 11:41:44 +02:00
a6a4f458e0 added Tests and removed problems in test-setup 2020-10-09 11:35:04 +02:00
d5ce38bf71 lint error fix - remove whitespace 2020-10-08 12:50:30 -07:00
8928e04385 Fix disable notify 2020-10-08 11:38:52 -07:00
1a270cd315 switching from static DigiCert ICAs to dynamic ones to support:
https://knowledge.digicert.com/alerts/DigiCert-ICA-Update.html
2020-10-07 20:06:20 -07:00
4f696abb5d adding util method to convert PKCS7 to pem 2020-10-07 20:03:46 -07:00
e078d33103 Merge pull request #3174 from charhate/ui_changes
Authority create: Email added to subject DN
2020-10-07 16:25:00 -07:00
b7d0e62844 Make location optional
Remove form validation and default value in input schema
2020-10-07 13:31:23 -07:00
57534d86cd Disable account saving by default 2020-10-07 12:28:22 +02:00
8353396940 Improve tests 2020-10-07 12:28:22 +02:00
9abd3e97e7 Add test loading acme account from authority 2020-10-07 12:28:22 +02:00
bf66de0bfd Add Test for saving the accound details 2020-10-07 12:28:22 +02:00
e0708410d0 Add store_account value to options in test_setup_acme_client_success 2020-10-07 12:28:22 +02:00
7e6fb740b3 Fix flake8/linting errors 2020-10-07 12:28:22 +02:00
eed628dbab Implement storage of acme account 2020-10-07 12:28:22 +02:00
898b5da661 Add store_account option to acme plugin 2020-10-07 12:28:22 +02:00
e64e2a41d5 Add update_options to authorities service 2020-10-07 12:28:22 +02:00
c72661a87f Removing hardcoded name 2020-10-06 18:50:37 -07:00
6b96aefa21 Authority create: Email added to subject DN for cloudCA 2020-10-06 18:35:28 -07:00
72d28d0af9 Merge pull request #3173 from Netflix/dependabot/pip/boto3-1.15.12 2020-10-06 18:05:56 +00:00
0b667177dd Bump boto3 from 1.15.7 to 1.15.12
Bumps [boto3](https://github.com/boto/boto3) from 1.15.7 to 1.15.12.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.15.7...1.15.12)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-06 17:51:12 +00:00
90f17d02d9 Merge pull request #3171 from Netflix/dependabot/pip/botocore-1.18.12 2020-10-06 17:48:19 +00:00
4e6d25d0f9 Bump botocore from 1.18.7 to 1.18.12
Bumps [botocore](https://github.com/boto/botocore) from 1.18.7 to 1.18.12.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.18.7...1.18.12)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-06 17:35:06 +00:00
da0970f3c8 Merge pull request #3172 from Netflix/dependabot/pip/faker-4.4.0 2020-10-06 17:32:20 +00:00
16177d751d Bump faker from 4.1.3 to 4.4.0
Bumps [faker](https://github.com/joke2k/faker) from 4.1.3 to 4.4.0.
- [Release notes](https://github.com/joke2k/faker/releases)
- [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/joke2k/faker/compare/v4.1.3...v4.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-06 16:59:28 +00:00
0876d5f911 Merge pull request #3170 from Netflix/dependabot/pip/factory-boy-3.1.0 2020-10-06 16:57:22 +00:00
2586c23efd Bump factory-boy from 3.0.1 to 3.1.0
Bumps [factory-boy](https://github.com/FactoryBoy/factory_boy) from 3.0.1 to 3.1.0.
- [Release notes](https://github.com/FactoryBoy/factory_boy/releases)
- [Changelog](https://github.com/FactoryBoy/factory_boy/blob/master/docs/changelog.rst)
- [Commits](https://github.com/FactoryBoy/factory_boy/compare/3.0.1...3.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-06 16:40:44 +00:00
7a612f36a3 Merge pull request #3169 from Netflix/dependabot/pip/pytest-6.1.1 2020-10-06 16:38:56 +00:00
60d28cf875 Bump pytest from 6.1.0 to 6.1.1
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.1.0 to 6.1.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.1.0...6.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-06 08:30:51 +00:00
98668b0972 Merge pull request #3168 from charhate/key_type_column
Remove bit length check from last query
2020-09-30 11:11:53 -07:00
010862ebcb Merge branch 'master' of github.com:Netflix/lemur into key_type_column 2020-09-29 16:43:22 -07:00
ea513f465f Remove bit length check from last query 2020-09-29 16:33:10 -07:00
d3b01d6b40 Merge pull request #3159 from charhate/key_type_column
Add key_type to CertificateUploadInputSchema
2020-09-29 10:41:25 -07:00
b9100dbf29 Merge branch 'master' of github.com:Netflix/lemur into key_type_column 2020-09-29 10:25:54 -07:00
c278a6db4d Merge pull request #3166 from unic/bugfix/dns-providers-list
Fix dns-providers type missing from schema
2020-09-29 10:21:14 -07:00
5e10a82621 Merge branch 'master' into bugfix/dns-providers-list 2020-09-29 18:52:11 +02:00
12e8e4891c Merge pull request #3162 from Netflix/dependabot/pip/cryptography-3.1.1 2020-09-29 16:49:13 +00:00
0f0f717520 Bump cryptography from 3.1 to 3.1.1
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.1 to 3.1.1.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.1...3.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-29 16:39:43 +00:00
02ff34f440 Merge pull request #3161 from Netflix/dependabot/pip/boto3-1.15.7 2020-09-29 16:36:47 +00:00
5fc6533443 Bump boto3 from 1.15.2 to 1.15.7
Bumps [boto3](https://github.com/boto/boto3) from 1.15.2 to 1.15.7.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.15.2...1.15.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-29 16:27:01 +00:00
3634b5e423 Merge pull request #3163 from Netflix/dependabot/pip/pytest-6.1.0 2020-09-29 16:24:18 +00:00
23797ec067 Bump pytest from 6.0.2 to 6.1.0
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.0.2 to 6.1.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.0.2...6.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-29 16:15:06 +00:00
ca357c08c4 Merge pull request #3160 from Netflix/dependabot/pip/botocore-1.18.7 2020-09-29 16:13:12 +00:00
d7fc84f6e9 Fix dns-providers type missing from schema 2020-09-29 14:36:31 +02:00
d3908fa445 Bump botocore from 1.18.2 to 1.18.7
Bumps [botocore](https://github.com/boto/botocore) from 1.18.2 to 1.18.7.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.18.2...1.18.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-29 07:33:30 +00:00
aaff0f7581 Fixing UT for key_type on upload schema 2020-09-28 19:03:21 -07:00
7a226241db Add key_type to CertificateUploadInputSchema
Parse cert body to determine algo
2020-09-28 18:13:00 -07:00
bf7638937a Merge pull request #3144 from hosseinsh/remove-test-secrets
Generate secrets on the fly
2020-09-28 14:49:16 -07:00
ba47e7448d lint 2020-09-28 14:42:03 -07:00
96eada297f lint 2020-09-28 14:40:56 -07:00
0fa136e7a4 Merge branch 'master' into remove-test-secrets 2020-09-25 17:19:39 -07:00
f8705aa730 lint 2020-09-25 17:19:30 -07:00
1e75cf4ab5 Merge pull request #3155 from charhate/key_type_column
Use key_type column for cert get/rotate/reissue/display
2020-09-25 13:01:40 -07:00
8f1c966079 Merge branch 'master' into remove-test-secrets 2020-09-25 12:48:28 -07:00
d49edd886b language 2020-09-25 12:32:33 -07:00
e871c5eb18 Update conf.py 2020-09-25 12:30:37 -07:00
85da1f1c75 Merge pull request #6 from Netflix/master
Entrust plugin : Test
2020-09-24 14:56:50 +02:00
57457bfe78 Merge branch 'master' of github.com:Netflix/lemur into key_type_column 2020-09-23 15:23:45 -07:00
cd13832377 Use key_type column for cert get/rotate/reissue/display
Added unit tests
2020-09-23 15:16:19 -07:00
df8d6e5d7f Merge pull request #3143 from hosseinsh/entrust-revised
Entrust plugin revised
2020-09-23 14:53:18 -07:00
f0aa9d249f Merge branch 'master' into entrust-revised 2020-09-23 13:41:12 -07:00
497afc3b46 Merge pull request #3151 from unic/feature/acme-documentation-improvement
ACME documentation improvement
2020-09-23 13:40:37 -07:00
4e4a7e9cab Merge branch 'master' into entrust-revised 2020-09-23 13:33:24 -07:00
e5961146b9 session hook complains about metadata
+ consistent language.
2020-09-23 14:22:58 -06:00
21c2255c75 Minor spelling improvements 2020-09-23 22:21:49 +02:00
4f1e09e3af Add reference from configuration options, to more detailed explanation 2020-09-23 22:21:49 +02:00
ae1ead6d75 Document ACME plugin specific configurations 2020-09-23 22:21:49 +02:00
1983eb79de Add paragraph about reusing ACME accounts 2020-09-23 22:21:49 +02:00
59bfcec808 Merge pull request #3150 from charhate/key_type_column
Backfill the key_type column
2020-09-23 12:11:20 -07:00
12af0ecb45 UT get_key_type_from_certificate 2020-09-23 11:46:38 -07:00
710290f590 Formatting changes 2020-09-23 11:45:36 -07:00
72be3ba54c Merge branch 'master' into entrust-revised 2020-09-23 10:34:34 -07:00
17218cbf02 Merge branch 'master' into remove-test-secrets 2020-09-23 10:34:19 -07:00
988d23e163 Merge branch 'master' into key_type_column 2020-09-23 10:34:12 -07:00
2c477ae8e7 Merge pull request #3148 from peschmae/bugfix/celery-documentation
Add redis configuration to celery documentation
2020-09-23 10:24:07 -07:00
19b693f636 Update c301c59688d2_.py
language
2020-09-23 10:21:23 -07:00
e3fa072608 Update c301c59688d2_.py
language
2020-09-23 10:17:30 -07:00
d5557c1533 Update index.rst
adding insight about the default db
2020-09-23 09:58:28 -07:00
cad04885a0 Add celery configuration options, to config documentation 2020-09-23 13:17:28 +02:00
f97e880fa6 REDIS_PORT as integer, add hint about multiple redis databases 2020-09-23 11:06:49 +02:00
1ea24e396a Merge branch 'master' of github.com:Netflix/lemur into key_type_column 2020-09-22 19:00:52 -07:00
921e8d8236 Add error message to the logs 2020-09-22 18:46:15 -07:00
9211178e77 Added date-time and modified log file name 2020-09-22 18:31:38 -07:00
8de9842092 Backfill the key_type column: DB Upgrade 2020-09-22 18:22:45 -07:00
9de8e5a28d Merge branch 'master' into entrust-revised 2020-09-22 16:45:46 -07:00
429261fd63 Merge branch 'master' into bugfix/celery-documentation 2020-09-22 10:13:16 -07:00
772894c414 Merge pull request #3093 from peschmae/master
Fix link for WES-entropy-client
2020-09-22 09:38:08 -07:00
c10f4b6483 Merge branch 'master' into master 2020-09-22 09:29:06 -07:00
ebf86c0eb2 Merge pull request #3146 from Netflix/dependabot/pip/boto3-1.15.2 2020-09-22 16:28:02 +00:00
9f66c18e71 Add REDIS_HOST and REDIS_PORT to celery configuration documentation 2020-09-22 14:53:45 +02:00
6dc4b9877b Bump boto3 from 1.14.61 to 1.15.2
Bumps [boto3](https://github.com/boto/boto3) from 1.14.61 to 1.15.2.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.14.61...1.15.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-22 06:11:00 +00:00
19a678dcc2 removing typo 2020-09-19 08:58:52 -07:00
1632b4b078 making lint happy, running make test-python doesn't run lint 2020-09-18 21:58:53 -07:00
21e9a4508d TypeError: 'float' object cannot be interpreted as an integer 2020-09-18 17:42:28 -07:00
c892cd5ae1 removing anything that remotely looks like a secret in code to set a good example 2020-09-18 17:38:52 -07:00
cc855e2758 modern python style 2020-09-18 17:16:07 -07:00
edab32d9a1 setting the required entrust configs 2020-09-18 17:03:22 -07:00
416f39222a testing 2020-09-18 17:02:19 -07:00
fae3793255 entrrust plugin revised 2020-09-18 11:09:32 -07:00
65795bd139 Merge branch 'master' into master 2020-09-16 10:22:31 -07:00
531e5c0d00 Merge pull request #3135 from charhate/key_type_column
Column addition key_type
2020-09-16 08:38:37 -07:00
5d7ca8520a Add remark that the WES-entropy-client is now linked to a fork 2020-09-16 10:23:04 +02:00
51549ae795 Adding comment for the property to be removed 2020-09-15 17:37:58 -07:00
efd231e0ab Merge branch 'key_type_column' of github.com:charhate/lemur into key_type_column 2020-09-15 15:16:51 -07:00
d8cca855e8 Merge branch 'master' of github.com:Netflix/lemur into key_type_column 2020-09-15 15:16:13 -07:00
5ae65c2c4d Remove unused import 2020-09-15 14:55:04 -07:00
87a85dd3b5 Merge branch 'master' into master 2020-09-15 12:14:13 -07:00
4321ca7cc7 Merge pull request #3142 from hosseinsh/fix-http-proxy-security-alert
Bump http-proxy from 1.16.2 to 1.18.1
2020-09-15 12:13:55 -07:00
2b40d2743c Merge branch 'master' into fix-http-proxy-security-alert 2020-09-15 11:52:31 -07:00
980883cb8d Dependbot failed to merge this PR, so raising it manually
Bump http-proxy from 1.16.2 to 1.18.1
https://github.com/Netflix/lemur/pull/3123#partial-pull-merging
2020-09-15 11:39:29 -07:00
f1e2cc1265 Merge pull request #3140 from Netflix/dependabot/pip/boto3-1.14.61 2020-09-15 17:56:02 +00:00
477f2fa1c2 Merge branch 'master' into key_type_column 2020-09-15 10:51:36 -07:00
f5e71bb431 Bump boto3 from 1.14.56 to 1.14.61
Bumps [boto3](https://github.com/boto/boto3) from 1.14.56 to 1.14.61.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.14.56...1.14.61)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-15 17:45:52 +00:00
9136a50d51 Merge pull request #3136 from Netflix/dependabot/pip/acme-1.8.0 2020-09-15 17:42:58 +00:00
8022efe32e Bump acme from 1.7.0 to 1.8.0
Bumps [acme](https://github.com/letsencrypt/letsencrypt) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/letsencrypt/letsencrypt/releases)
- [Commits](https://github.com/letsencrypt/letsencrypt/compare/v1.7.0...v1.8.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-15 17:35:46 +00:00
df3e39cc25 Merge pull request #3134 from Netflix/dependabot/pip/moto-1.3.16 2020-09-15 17:33:24 +00:00
1ceafc593a Bump moto from 1.3.14 to 1.3.16
Bumps [moto](https://github.com/spulec/moto) from 1.3.14 to 1.3.16.
- [Release notes](https://github.com/spulec/moto/releases)
- [Changelog](https://github.com/spulec/moto/blob/master/CHANGELOG.md)
- [Commits](https://github.com/spulec/moto/compare/1.3.14...1.3.16)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-15 17:22:55 +00:00
b147aec53d Merge pull request #3138 from Netflix/dependabot/pip/coverage-5.3 2020-09-15 17:20:53 +00:00
dc675311f0 Bump coverage from 5.2.1 to 5.3
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.2.1 to 5.3.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/coverage-5.2.1...coverage-5.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-15 17:13:55 +00:00
64fffecc8a Merge pull request #3139 from Netflix/dependabot/pip/faker-4.1.3 2020-09-15 17:12:01 +00:00
51fbd6a871 Bump faker from 4.1.2 to 4.1.3
Bumps [faker](https://github.com/joke2k/faker) from 4.1.2 to 4.1.3.
- [Release notes](https://github.com/joke2k/faker/releases)
- [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/joke2k/faker/compare/v4.1.2...v4.1.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-15 17:04:29 +00:00
93057561b3 Merge pull request #3137 from Netflix/dependabot/pip/pytest-6.0.2 2020-09-15 17:01:58 +00:00
f5228407c2 Bump pytest from 6.0.1 to 6.0.2
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.0.1...6.0.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-15 16:51:01 +00:00
cff8fb15ae Merge pull request #3133 from sirferl/master
Entrust documentation
2020-09-15 09:49:08 -07:00
305de2217e Merge branch 'master' into master 2020-09-15 09:14:15 -07:00
fd2aff7a16 Merge pull request #3132 from sirferl/entrust-plugin
Entrust plugin
2020-09-15 09:13:46 -07:00
676562ffde Match column type to db schema
No functional change
2020-09-14 18:13:35 -07:00
02d711282d New column key_type
commenting conflicting property for now
2020-09-14 18:12:33 -07:00
02c7a5ca7c another round of lint errors 2020-09-14 16:34:56 +02:00
e011cc9251 added several enhancements following advice from peer 2020-09-14 16:24:53 +02:00
9778eb7b25 fixed lint errors 2020-09-14 15:56:02 +02:00
5bb0143da4 lint errors and removed _path from the API-Cert variables 2020-09-14 15:42:36 +02:00
84496b0f55 fixed a few problems 2020-09-14 15:18:46 +02:00
b8e3162c5f added revoke functionality 2020-09-14 14:20:11 +02:00
b337b27146 added response handler 2020-09-14 12:23:58 +02:00
01678a714f added required vars check 2020-09-14 09:50:55 +02:00
1bdfaa9739 removed merge conflicts 2020-09-14 08:58:31 +02:00
b217a68512 added entrust to setup.py 2020-09-14 08:53:17 +02:00
8adca442e1 Merge branch 'master' into entrust-plugin 2020-09-11 17:11:57 -07:00
5cc6279361 Merge pull request #3115 from charhate/validity
Cert Validity UI Changes
2020-09-11 16:48:50 -07:00
09a2a8fc76 Log message change
PR comments
2020-09-11 15:53:34 -07:00
806aeddd87 Merge branch 'master' into validity 2020-09-11 10:09:01 -07:00
e4ed2a14e7 Merge pull request #3130 from hosseinsh/improved-csr-support
Improved csr support and EC key_type support
2020-09-11 10:08:44 -07:00
6e588f9c7b Merge branch 'master' into validity 2020-09-11 09:06:11 -07:00
1c9c377751 Lint errors 2020-09-11 12:31:15 +02:00
fd52438d61 yet lint errors 2020-09-11 12:30:53 +02:00
de9ad82011 Fixed Lint complaints 2020-09-11 12:24:33 +02:00
3487ecbaa7 Added entrust plugin doc and amended ADCS 2020-09-11 12:04:02 +02:00
aa0a31f90e Added entrust plugin 2020-09-11 11:16:23 +02:00
a99a84b0b2 entrust plugin inital edit 2020-09-10 16:04:31 +02:00
f47f108f43 ientrust plgin - first version 2020-09-10 16:03:29 +02:00
f6c10ef3d8 Merge pull request #5 from Netflix/master
Entrust Plugin
2020-09-10 14:15:55 +02:00
a7be8b6dce adding support for different types of CSR encodings 2020-09-09 19:54:53 -07:00
4923157dc2 expanding key_type to with EC support 2020-09-09 19:54:20 -07:00
aff7ad7ea2 testing 2020-09-09 19:53:59 -07:00
60fd2134ca removing duplicate curves, and marking them in existing mapping 2020-09-09 19:53:35 -07:00
5ab9626cbd overwriting cn and key_type values from CSR, as they take precedence 2020-09-09 19:52:59 -07:00
6fa15c4cb3 methods to extract cn and key_type from csr 2020-09-09 19:48:21 -07:00
de0c38e9ba mapping of curve name to key_type 2020-09-09 19:47:51 -07:00
1eb2df63cc Merge pull request #3127 from Netflix/dependabot/pip/boto3-1.14.56 2020-09-08 17:06:16 +00:00
aeead5363b Bump boto3 from 1.14.54 to 1.14.56
Bumps [boto3](https://github.com/boto/boto3) from 1.14.54 to 1.14.56.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.14.54...1.14.56)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-08 16:58:54 +00:00
e14dfc8639 Merge pull request #3125 from Netflix/dependabot/pip/psycopg2-2.8.6 2020-09-08 16:56:16 +00:00
6ef6fe40e6 Bump psycopg2 from 2.8.5 to 2.8.6
Bumps [psycopg2](https://github.com/psycopg/psycopg2) from 2.8.5 to 2.8.6.
- [Release notes](https://github.com/psycopg/psycopg2/releases)
- [Changelog](https://github.com/psycopg/psycopg2/blob/master/NEWS)
- [Commits](https://github.com/psycopg/psycopg2/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-08 16:46:51 +00:00
61a0aae96c Merge pull request #3126 from Netflix/dependabot/pip/freezegun-1.0.0 2020-09-08 16:44:48 +00:00
e0ba90d672 Bump freezegun from 0.3.15 to 1.0.0
Bumps [freezegun](https://github.com/spulec/freezegun) from 0.3.15 to 1.0.0.
- [Release notes](https://github.com/spulec/freezegun/releases)
- [Changelog](https://github.com/spulec/freezegun/blob/master/CHANGELOG)
- [Commits](https://github.com/spulec/freezegun/compare/0.3.15...1.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-08 16:38:36 +00:00
5d24cff338 Merge pull request #3124 from Netflix/dependabot/pip/botocore-1.17.56 2020-09-08 16:36:42 +00:00
458b4b062c Bump botocore from 1.17.54 to 1.17.56
Bumps [botocore](https://github.com/boto/botocore) from 1.17.54 to 1.17.56.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.17.54...1.17.56)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-08 06:13:59 +00:00
50f98dd223 Merge pull request #3122 from Netflix/dependabot/pip/boto3-1.14.54 2020-09-03 15:50:03 +00:00
86d37ced17 Bump boto3 from 1.14.48 to 1.14.54
Bumps [boto3](https://github.com/boto/boto3) from 1.14.48 to 1.14.54.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.14.48...1.14.54)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-03 05:27:42 +00:00
f66d91036b Merge pull request #3110 from Netflix/dependabot/pip/flask-cors-3.0.9 2020-09-03 05:24:55 +00:00
2fd05eed3d Bump flask-cors from 3.0.8 to 3.0.9
Bumps [flask-cors](https://github.com/corydolphin/flask-cors) from 3.0.8 to 3.0.9.
- [Release notes](https://github.com/corydolphin/flask-cors/releases)
- [Changelog](https://github.com/corydolphin/flask-cors/blob/master/CHANGELOG.md)
- [Commits](https://github.com/corydolphin/flask-cors/compare/3.0.8...3.0.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-03 05:13:48 +00:00
ac62cc7767 Merge pull request #3114 from Netflix/dependabot/pip/black-20.8b1 2020-09-03 05:11:24 +00:00
0d95d77a10 Bump black from 19.10b0 to 20.8b1
Bumps [black](https://github.com/psf/black) from 19.10b0 to 20.8b1.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/master/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-03 05:04:07 +00:00
cb38415b3c Merge pull request #3113 from Netflix/dependabot/pip/pytest-mock-3.3.1 2020-09-03 05:02:23 +00:00
b9a30a2188 Bump pytest-mock from 3.3.0 to 3.3.1
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.3.0 to 3.3.1.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.3.0...v3.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-03 04:34:55 +00:00
67c57b9b63 Merge pull request #3111 from Netflix/dependabot/pip/cryptography-3.1 2020-09-03 04:32:56 +00:00
26dfe5f654 Bump cryptography from 3.0 to 3.1
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.0 to 3.1.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.0...3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-03 00:59:57 +00:00
2ca8dba5e4 Merge pull request #3109 from Netflix/dependabot/pip/paramiko-2.7.2 2020-09-03 00:57:05 +00:00
9af887cf95 Bump paramiko from 2.7.1 to 2.7.2
Bumps [paramiko](https://github.com/paramiko/paramiko) from 2.7.1 to 2.7.2.
- [Release notes](https://github.com/paramiko/paramiko/releases)
- [Changelog](https://github.com/paramiko/paramiko/blob/master/NEWS)
- [Commits](https://github.com/paramiko/paramiko/compare/2.7.1...2.7.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-02 17:13:23 +00:00
7cad569114 Merge pull request #3107 from hosseinsh/ecc-support-for-authority-minting
adding the correct signing algorithm, and a missing key Type
2020-09-02 10:11:20 -07:00
6fd27c3372 Merge branch 'master' into ecc-support-for-authority-minting 2020-09-01 17:57:07 -07:00
8e30305596 Merge branch 'master' into validity 2020-09-01 17:56:52 -07:00
9ded7b8571 Merge pull request #3116 from Netflix/fix_distutils
Cleanup setup.py
2020-09-01 17:55:59 -07:00
ef6373cb3a Merge branch 'master' into fix_distutils 2020-09-01 17:42:14 -07:00
5dd6c6636b Merge pull request #3118 from Netflix/fix_travis_build_01
Add SETUPTOOLS_USE_DISTUTILS environment variable to fix travis build issue
2020-09-01 17:41:39 -07:00
af4bb72be3 adding SETUPTOOLS_USE_DISTUTILS environment variable to fix travis build issue 2020-09-01 17:28:42 -07:00
d5e51b3fc3 Remove changes to .travis.yml, moving them to new PR 2020-09-01 17:20:34 -07:00
beba785b09 cleaning up requirements imports and adding comments to change to .travis.yml 2020-09-01 17:16:18 -07:00
4ec0430a61 adding SETUP_TOOLS_USE_DISTUTILS to travis build file 2020-09-01 16:41:09 -07:00
079e8ccf3b removing explicit dependencies on import pip and moving to pkg_resources 2020-09-01 16:35:54 -07:00
77b67f613f removing dependency on distutils from setup.py 2020-09-01 16:07:47 -07:00
0077452e10 fixing import order to fix travis builds 2020-09-01 15:26:23 -07:00
8ad4448c85 Match date format for comparison + expected new lines 2020-09-01 12:44:49 -07:00
db4f68f0ed Logs during cert validity truncate for digicert 2020-08-31 18:20:32 -07:00
9c4fb85dc3 Calculate dates from defaultDays in js 2020-08-31 18:19:32 -07:00
d478def98c removing the custom key Type and doing the conversion in the backend 2020-08-31 16:35:47 -07:00
9a7a632489 using a standard curve for testing 2020-08-28 09:48:35 -07:00
a50c641044 Merge branch 'master' into ecc-support-for-authority-minting 2020-08-27 15:23:46 -07:00
9671b34485 adding support for all type of ECC curves which existing CA plugins might support 2020-08-27 14:15:14 -07:00
91c2976bfc fixing Makefile build issue with @echo 2020-08-27 14:15:14 -07:00
75eaea3aad fixing setup-git so build continues if ./git/hooks does not exist. 2020-08-27 14:15:14 -07:00
1fc2e29ab8 Remove 397 days validation as it causes error in API calls
More to come in future
2020-08-27 14:15:14 -07:00
1577f99567 Bump boto3 from 1.14.33 to 1.14.48
Bumps [boto3](https://github.com/boto/boto3) from 1.14.33 to 1.14.48.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.14.33...1.14.48)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-27 14:15:14 -07:00
9d37f8018a Bump arrow from 0.15.8 to 0.16.0
Bumps [arrow](https://github.com/arrow-py/arrow) from 0.15.8 to 0.16.0.
- [Release notes](https://github.com/arrow-py/arrow/releases)
- [Changelog](https://github.com/arrow-py/arrow/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/arrow-py/arrow/compare/0.15.8...0.16.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-27 14:15:14 -07:00
beea47fd09 Bump cloudflare from 2.8.9 to 2.8.13
Bumps [cloudflare](https://github.com/cloudflare/python-cloudflare) from 2.8.9 to 2.8.13.
- [Release notes](https://github.com/cloudflare/python-cloudflare/releases)
- [Changelog](https://github.com/cloudflare/python-cloudflare/blob/master/CHANGELOG.md)
- [Commits](https://github.com/cloudflare/python-cloudflare/compare/2.8.9...2.8.13)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-27 14:15:14 -07:00
4955ec8541 Bump pytest-mock from 3.2.0 to 3.3.0
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.2.0...v3.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-27 14:15:14 -07:00
ced9696322 Bump inflection from 0.5.0 to 0.5.1
Bumps [inflection](https://github.com/jpvanhal/inflection) from 0.5.0 to 0.5.1.
- [Release notes](https://github.com/jpvanhal/inflection/releases)
- [Commits](https://github.com/jpvanhal/inflection/compare/0.5.0...0.5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-27 14:15:14 -07:00
50d5c15a69 Bump sphinx from 3.2.0 to 3.2.1
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.2.0 to 3.2.1.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.2.0...v3.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-27 14:15:14 -07:00
54ca1315ca Bump faker from 4.1.1 to 4.1.2
Bumps [faker](https://github.com/joke2k/faker) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/joke2k/faker/releases)
- [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/joke2k/faker/compare/v4.1.1...v4.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-27 14:15:14 -07:00
f7abfff51d Bump nodeenv from 1.4.0 to 1.5.0
Bumps [nodeenv](https://github.com/ekalinin/nodeenv) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/ekalinin/nodeenv/releases)
- [Changelog](https://github.com/ekalinin/nodeenv/blob/master/CHANGES)
- [Commits](https://github.com/ekalinin/nodeenv/compare/1.4.0...1.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-27 14:15:14 -07:00
d4dfa63cf5 Bump pre-commit from 2.6.0 to 2.7.1
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.6.0 to 2.7.1.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.6.0...v2.7.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-27 14:15:14 -07:00
cbc328d073 Bump factory-boy from 2.12.0 to 3.0.1
Bumps [factory-boy](https://github.com/FactoryBoy/factory_boy) from 2.12.0 to 3.0.1.
- [Release notes](https://github.com/FactoryBoy/factory_boy/releases)
- [Changelog](https://github.com/FactoryBoy/factory_boy/blob/master/docs/changelog.rst)
- [Commits](https://github.com/FactoryBoy/factory_boy/compare/2.12.0...3.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-27 14:15:14 -07:00
c5106f5fa4 Bump fakeredis from 1.4.1 to 1.4.3
Bumps [fakeredis](https://github.com/jamesls/fakeredis) from 1.4.1 to 1.4.3.
- [Release notes](https://github.com/jamesls/fakeredis/releases)
- [Commits](https://github.com/jamesls/fakeredis/compare/1.4.1...1.4.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-27 14:15:14 -07:00
07f1d751c4 Bump acme from 1.6.0 to 1.7.0
Bumps [acme](https://github.com/letsencrypt/letsencrypt) from 1.6.0 to 1.7.0.
- [Release notes](https://github.com/letsencrypt/letsencrypt/releases)
- [Commits](https://github.com/letsencrypt/letsencrypt/compare/v1.6.0...v1.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-27 14:15:14 -07:00
ab4cda2298 Extended ADCS_TEMPLATE_ Variable
If there is a config variable ADCS_TEMPLATE_<upper(authority.name)> take the value as Cert template else default to ADCS_TEMPLATE to be compatible with former versions
2020-08-27 14:15:14 -07:00
7a9500eee0 Lint error fix 2020-08-27 14:15:14 -07:00
e79dda3384 doc update DEFAULT_MAX_VALIDITY_DAYS 2020-08-27 14:15:14 -07:00
5ed109e998 Max end date as per start date + default validity 3 years 2020-08-27 14:15:14 -07:00
599a6943e2 Updating LEMUR_DEFAULT_ORGANIZATIONAL_UNIT to empty string 2020-08-27 14:15:14 -07:00
7011a4df8b max date on UI as per max validity configs 2020-08-27 14:15:14 -07:00
4d7c6844e5 Make Organizational Unit optional 2020-08-27 14:15:14 -07:00
2645c4a82d mention 397 for digicert plugin 2020-08-27 14:15:14 -07:00
8d2fffba87 Add new configs to the doc 2020-08-27 14:15:14 -07:00
3cb386cc0f maximum 1 year validity for digicert 2020-08-27 14:15:14 -07:00
e06dea106f Modify unit test test_determine_end_date to match new config 2020-08-27 14:15:14 -07:00
747df683a9 Bump sphinx from 3.1.2 to 3.2.0
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.1.2 to 3.2.0.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.1.2...v3.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-27 14:15:14 -07:00
8a1563db54 Updating Lemur docs to capture Digicert validity config changes 2020-08-27 14:15:14 -07:00
d7d483fa9b Renaming PUBLIC_CA to PUBLIC_CA_AUTHORITY_NAMES 2020-08-27 14:15:14 -07:00
25125f3257 Cert validity should not exceed 397 days for publicly trusted issuers 2020-08-27 14:15:14 -07:00
a7082f7332 Bump cloudflare from 2.8.8 to 2.8.9
Bumps [cloudflare](https://github.com/cloudflare/python-cloudflare) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/cloudflare/python-cloudflare/releases)
- [Changelog](https://github.com/cloudflare/python-cloudflare/blob/master/CHANGELOG.md)
- [Commits](https://github.com/cloudflare/python-cloudflare/compare/2.8.8...2.8.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-27 14:15:14 -07:00
404d213e8f Modified cert description to have cert id being cloned 2020-08-27 14:15:14 -07:00
e75e472a1a Do not inherit replacement info during cert clone 2020-08-27 14:15:14 -07:00
69b64c63ea Honor selected algorithm during certificate cloning 2020-08-27 14:15:14 -07:00
d07464f3b1 updating documentation for cross-signed ICA 2020-08-27 14:15:14 -07:00
de0e646cf9 Bump boto3 from 1.14.28 to 1.14.33
Bumps [boto3](https://github.com/boto/boto3) from 1.14.28 to 1.14.33.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.14.28...1.14.33)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-27 14:15:14 -07:00
5c5e53b8ec Bump botocore from 1.17.28 to 1.17.33
Bumps [botocore](https://github.com/boto/botocore) from 1.17.28 to 1.17.33.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.17.28...1.17.33)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-27 14:15:14 -07:00
85f18afa81 Bump pytest from 5.4.3 to 6.0.1
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.4.3 to 6.0.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/5.4.3...6.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-27 14:15:14 -07:00
bc8eda2a6b fixing Dockerfile, Lemur builds now 2020-08-27 14:15:14 -07:00
f4bcd1cf30 lack of an empty config file was resulting into this error
```
Traceback (most recent call last):
  File "/home/travis/build/Netflix/lemur/lemur/plugins/lemur_acme/tests/test_acme.py", line 159, in test_request_certificate
    self.acme.request_certificate(mock_acme, [], mock_order)
  File "/home/travis/build/Netflix/lemur/lemur/plugins/lemur_acme/plugin.py", line 211, in request_certificate
    current_app.config.get("IDENTRUST_CROSS_SIGNED_LE_ICA_EXPIRATION_DATE", "17/03/21"), '%d/%m/%y'):
TypeError: strptime() argument 1 must be str, not MagicMock
```
2020-08-27 14:15:14 -07:00
5a6e4e5b43 Let's Encrypt has been using a cross-signed intermediate CA by DST Root CA X3, which is included in any older devices' TrustStore.
https://letsencrypt.org/certificates/

Let's Encrypt is transitioning to use the intermediate CA issued by their own root (ISRG X1) starting from September 29th 2020. This is in preparation of concluding the initial bootstrapping of their CA, by having it cross-signed by an older CA.
https://letsencrypt.org/2019/04/15/transitioning-to-isrg-root.html

This PR allows Lemur to pin to the cross-signed ICA (same public/private key pair as the ICA signed by ISRG X1). This will prolong support for incompatible systems.
2020-08-27 14:15:14 -07:00
c169ad291e adding the correct signing algorithm, and a missing key Type 2020-08-27 13:29:56 -07:00
3242fc1e13 Validity with radio buttons 2020-08-26 19:30:12 -07:00
9af8d63f11 Merge pull request #3106 from Netflix/dev_branch
fixing setup-git so build continues if ./git/hooks does not exist.
2020-08-26 10:47:04 -07:00
27c5539178 fixing Makefile build issue with @echo 2020-08-26 01:47:17 -07:00
be21d357cb fixing setup-git so build continues if ./git/hooks does not exist. 2020-08-26 01:38:17 -07:00
6aedd3b0d8 Datepicker enhancements 2020-08-25 18:40:36 -07:00
2b64959953 Merge pull request #3105 from charhate/validity
Remove 397 days validation as it causes error in API calls
2020-08-25 16:33:54 -07:00
3efe14c43f Remove 397 days validation as it causes error in API calls
More to come in future
2020-08-25 16:26:20 -07:00
85b47bed05 Merge pull request #3103 from Netflix/dependabot/pip/boto3-1.14.48 2020-08-25 19:50:14 +00:00
0f463d5f13 Bump boto3 from 1.14.33 to 1.14.48
Bumps [boto3](https://github.com/boto/boto3) from 1.14.33 to 1.14.48.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.14.33...1.14.48)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-25 19:17:13 +00:00
367c6f0b03 Merge pull request #3096 from Netflix/dependabot/pip/arrow-0.16.0 2020-08-25 19:14:46 +00:00
939c41a70e Bump arrow from 0.15.8 to 0.16.0
Bumps [arrow](https://github.com/arrow-py/arrow) from 0.15.8 to 0.16.0.
- [Release notes](https://github.com/arrow-py/arrow/releases)
- [Changelog](https://github.com/arrow-py/arrow/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/arrow-py/arrow/compare/0.15.8...0.16.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-25 19:04:47 +00:00
8855e60db7 Merge pull request #3087 from Netflix/dependabot/pip/cloudflare-2.8.13 2020-08-25 19:02:33 +00:00
a4a83dda72 Bump cloudflare from 2.8.9 to 2.8.13
Bumps [cloudflare](https://github.com/cloudflare/python-cloudflare) from 2.8.9 to 2.8.13.
- [Release notes](https://github.com/cloudflare/python-cloudflare/releases)
- [Changelog](https://github.com/cloudflare/python-cloudflare/blob/master/CHANGELOG.md)
- [Commits](https://github.com/cloudflare/python-cloudflare/compare/2.8.9...2.8.13)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-25 18:55:27 +00:00
d229ccf654 Merge pull request #3098 from Netflix/dependabot/pip/pytest-mock-3.3.0 2020-08-25 18:53:19 +00:00
ad5416e441 Bump pytest-mock from 3.2.0 to 3.3.0
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.2.0...v3.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-25 18:42:38 +00:00
41f853afd6 Merge pull request #3100 from Netflix/dependabot/pip/inflection-0.5.1 2020-08-25 18:40:07 +00:00
88a043cfec Bump inflection from 0.5.0 to 0.5.1
Bumps [inflection](https://github.com/jpvanhal/inflection) from 0.5.0 to 0.5.1.
- [Release notes](https://github.com/jpvanhal/inflection/releases)
- [Commits](https://github.com/jpvanhal/inflection/compare/0.5.0...0.5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-25 18:28:42 +00:00
605d218385 Merge pull request #3084 from Netflix/dependabot/pip/sphinx-3.2.1 2020-08-25 18:26:21 +00:00
1a8e96ed32 Bump sphinx from 3.2.0 to 3.2.1
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.2.0 to 3.2.1.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.2.0...v3.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-25 18:12:28 +00:00
dc4df9b279 Merge pull request #3094 from Netflix/dependabot/pip/faker-4.1.2 2020-08-25 18:10:24 +00:00
61eac2aada Bump faker from 4.1.1 to 4.1.2
Bumps [faker](https://github.com/joke2k/faker) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/joke2k/faker/releases)
- [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/joke2k/faker/compare/v4.1.1...v4.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-25 18:03:20 +00:00
1cc3051aa2 Merge pull request #3095 from Netflix/dependabot/pip/nodeenv-1.5.0 2020-08-25 18:01:33 +00:00
ad0e469e92 Bump nodeenv from 1.4.0 to 1.5.0
Bumps [nodeenv](https://github.com/ekalinin/nodeenv) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/ekalinin/nodeenv/releases)
- [Changelog](https://github.com/ekalinin/nodeenv/blob/master/CHANGES)
- [Commits](https://github.com/ekalinin/nodeenv/compare/1.4.0...1.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-25 17:54:14 +00:00
9cb430f92c Merge pull request #3101 from Netflix/dependabot/pip/pre-commit-2.7.1 2020-08-25 17:52:30 +00:00
660a09e4c9 Bump pre-commit from 2.6.0 to 2.7.1
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.6.0 to 2.7.1.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.6.0...v2.7.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-25 17:41:18 +00:00
08762d3bbb Merge pull request #3086 from Netflix/dependabot/pip/factory-boy-3.0.1 2020-08-25 17:39:23 +00:00
553b7fab8d Bump factory-boy from 2.12.0 to 3.0.1
Bumps [factory-boy](https://github.com/FactoryBoy/factory_boy) from 2.12.0 to 3.0.1.
- [Release notes](https://github.com/FactoryBoy/factory_boy/releases)
- [Changelog](https://github.com/FactoryBoy/factory_boy/blob/master/docs/changelog.rst)
- [Commits](https://github.com/FactoryBoy/factory_boy/compare/2.12.0...3.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-25 17:28:39 +00:00
3d160a459c Merge pull request #3099 from Netflix/dependabot/pip/fakeredis-1.4.3 2020-08-25 17:25:59 +00:00
7b2b3911bc Bump fakeredis from 1.4.1 to 1.4.3
Bumps [fakeredis](https://github.com/jamesls/fakeredis) from 1.4.1 to 1.4.3.
- [Release notes](https://github.com/jamesls/fakeredis/releases)
- [Commits](https://github.com/jamesls/fakeredis/compare/1.4.1...1.4.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-25 17:19:48 +00:00
c899173dc9 Merge pull request #3080 from Netflix/dependabot/pip/acme-1.7.0 2020-08-25 17:17:51 +00:00
3e8ca982a1 Bump acme from 1.6.0 to 1.7.0
Bumps [acme](https://github.com/letsencrypt/letsencrypt) from 1.6.0 to 1.7.0.
- [Release notes](https://github.com/letsencrypt/letsencrypt/releases)
- [Commits](https://github.com/letsencrypt/letsencrypt/compare/v1.6.0...v1.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-25 16:41:17 +00:00
136b8e67d4 Merge pull request #3092 from sirferl/master
Extended  ADCS_TEMPLATE_ Variable
2020-08-25 09:39:12 -07:00
301f099622 Fix link for WES-entropy-client 2020-08-21 09:56:46 +02:00
4f148f3bc3 Merge branch 'master' into master 2020-08-20 11:33:18 +02:00
41b35fb13d Merge pull request #3091 from charhate/pub_issuer
empty OU and date changes on UI
2020-08-19 11:31:46 -07:00
1b73b1d080 Merge branch 'master' into master 2020-08-19 12:29:02 +02:00
c2116df652 Extended ADCS_TEMPLATE_ Variable
If there is a config variable ADCS_TEMPLATE_<upper(authority.name)> take the value as Cert template else default to ADCS_TEMPLATE to be compatible with former versions
2020-08-19 12:25:52 +02:00
5b96b3a032 Lint error fix 2020-08-18 20:03:15 -07:00
d41227327e doc update DEFAULT_MAX_VALIDITY_DAYS 2020-08-18 19:47:38 -07:00
240f0b99c8 Max end date as per start date + default validity 3 years 2020-08-18 19:34:59 -07:00
cab1216cb7 Updating LEMUR_DEFAULT_ORGANIZATIONAL_UNIT to empty string 2020-08-18 15:14:34 -07:00
bc5579e9bf max date on UI as per max validity configs 2020-08-18 14:50:42 -07:00
5b3f40467b Make Organizational Unit optional 2020-08-18 14:50:42 -07:00
14b73b73cf Merge pull request #3081 from charhate/pub_issuer
Cert validity should not exceed 397 days for publicly trusted issuers
2020-08-17 17:41:25 -07:00
d86d599d61 Merge branch 'master' into pub_issuer 2020-08-11 19:28:36 -07:00
6ff8910f87 mention 397 for digicert plugin 2020-08-11 18:53:19 -07:00
acb0463844 Add new configs to the doc 2020-08-11 18:51:41 -07:00
d7ca1570be maximum 1 year validity for digicert 2020-08-11 18:02:42 -07:00
bde2829e72 Modify unit test test_determine_end_date to match new config 2020-08-11 17:10:29 -07:00
226a62d338 Bump sphinx from 3.1.2 to 3.2.0
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.1.2 to 3.2.0.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.1.2...v3.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-11 12:09:22 -07:00
0d1798b0e0 Bump cloudflare from 2.8.8 to 2.8.9
Bumps [cloudflare](https://github.com/cloudflare/python-cloudflare) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/cloudflare/python-cloudflare/releases)
- [Changelog](https://github.com/cloudflare/python-cloudflare/blob/master/CHANGELOG.md)
- [Commits](https://github.com/cloudflare/python-cloudflare/compare/2.8.8...2.8.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-11 12:09:22 -07:00
aa800d79de Merge pull request #3076 from Netflix/dependabot/pip/sphinx-3.2.0
Bump sphinx from 3.1.2 to 3.2.0
2020-08-10 18:49:05 -07:00
9d3b7ac5dd Bump sphinx from 3.1.2 to 3.2.0
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.1.2 to 3.2.0.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.1.2...v3.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-11 01:40:26 +00:00
4c62108c11 Merge pull request #3079 from Netflix/dependabot/pip/cloudflare-2.8.9
Bump cloudflare from 2.8.8 to 2.8.9
2020-08-10 18:38:29 -07:00
682991c022 Updating Lemur docs to capture Digicert validity config changes 2020-08-10 18:07:46 -07:00
18a3514974 Renaming PUBLIC_CA to PUBLIC_CA_AUTHORITY_NAMES 2020-08-10 18:06:45 -07:00
7a83799bcd Cert validity should not exceed 397 days for publicly trusted issuers 2020-08-10 17:30:34 -07:00
914c029138 Bump cloudflare from 2.8.8 to 2.8.9
Bumps [cloudflare](https://github.com/cloudflare/python-cloudflare) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/cloudflare/python-cloudflare/releases)
- [Changelog](https://github.com/cloudflare/python-cloudflare/blob/master/CHANGELOG.md)
- [Commits](https://github.com/cloudflare/python-cloudflare/compare/2.8.8...2.8.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-10 13:43:11 +00:00
574c76ad66 Merge pull request #3074 from charhate/bootswatch-fix
Certificate cloning enhancements/fixes
2020-08-06 10:17:57 -07:00
9bcfcebb3a Merge branch 'master' into bootswatch-fix 2020-08-04 14:09:33 -07:00
817a4c3d90 Modified cert description to have cert id being cloned 2020-08-03 19:24:06 -07:00
c3d8501401 Do not inherit replacement info during cert clone 2020-08-03 19:23:24 -07:00
c15a2c62d1 Honor selected algorithm during certificate cloning 2020-08-03 19:22:13 -07:00
983f9beacb Merge pull request #3057 from hosseinsh/pinning-to-cross-signed-LE-ICA
Pinning to the Cross-signed LE ICA
2020-08-03 17:50:13 -07:00
cbe06bd4d0 Merge branch 'master' into pinning-to-cross-signed-LE-ICA 2020-08-03 17:50:05 -07:00
2a8cf805dd Merge pull request #3070 from Netflix/testbranch
fixing Dockerfile, Lemur builds now
2020-08-03 17:49:15 -07:00
084f9a14f4 updating documentation for cross-signed ICA 2020-08-03 16:14:14 -07:00
2af336f6c2 Merge branch 'master' into pinning-to-cross-signed-LE-ICA 2020-08-03 15:58:59 -07:00
5c4a167cfd Merge branch 'master' into testbranch 2020-08-03 15:58:49 -07:00
b382d0332e Merge pull request #3073 from Netflix/dependabot/pip/boto3-1.14.33 2020-08-03 17:46:19 +00:00
117c0bab04 Bump boto3 from 1.14.28 to 1.14.33
Bumps [boto3](https://github.com/boto/boto3) from 1.14.28 to 1.14.33.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.14.28...1.14.33)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-03 17:38:07 +00:00
41a02610ba Merge pull request #3072 from Netflix/dependabot/pip/botocore-1.17.33 2020-08-03 17:35:24 +00:00
c80a3390e7 Bump botocore from 1.17.28 to 1.17.33
Bumps [botocore](https://github.com/boto/botocore) from 1.17.28 to 1.17.33.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.17.28...1.17.33)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-03 17:27:26 +00:00
88b38f7f0b Merge pull request #3071 from Netflix/dependabot/pip/pytest-6.0.1 2020-08-03 17:25:05 +00:00
229a5fbc9b Merge branch 'master' into testbranch 2020-08-03 09:47:12 -07:00
57e06cf1db Bump pytest from 5.4.3 to 6.0.1
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.4.3 to 6.0.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/5.4.3...6.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-03 13:36:46 +00:00
e7c684724a fixing Dockerfile, Lemur builds now 2020-07-31 17:54:18 -07:00
8e1d2b51e0 Merge branch 'master' into pinning-to-cross-signed-LE-ICA 2020-07-27 14:20:00 -07:00
b5e22f5a6b Merge pull request #3063 from Netflix/dependabot/pip/cryptography-3.0
Bump cryptography from 2.9.2 to 3.0
2020-07-27 14:19:43 -07:00
4752e10472 Bump cryptography from 2.9.2 to 3.0
Bumps [cryptography](https://github.com/pyca/cryptography) from 2.9.2 to 3.0.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/2.9.2...3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-27 18:40:59 +00:00
7ac754a894 Merge pull request #3066 from Netflix/dependabot/pip/boto3-1.14.28 2020-07-27 18:35:15 +00:00
1e90bb2d0b Bump boto3 from 1.14.23 to 1.14.28
Bumps [boto3](https://github.com/boto/boto3) from 1.14.23 to 1.14.28.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.14.23...1.14.28)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-27 18:26:11 +00:00
00134a0966 Merge pull request #3068 from Netflix/dependabot/pip/cloudflare-2.8.8 2020-07-27 18:19:51 +00:00
69bfe48cbe Bump cloudflare from 2.8.6 to 2.8.8
Bumps [cloudflare](https://github.com/cloudflare/python-cloudflare) from 2.8.6 to 2.8.8.
- [Release notes](https://github.com/cloudflare/python-cloudflare/releases)
- [Changelog](https://github.com/cloudflare/python-cloudflare/blob/master/CHANGELOG.md)
- [Commits](https://github.com/cloudflare/python-cloudflare/compare/2.8.6...2.8.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-27 18:11:16 +00:00
f98d53fda0 Merge pull request #3069 from Netflix/dependabot/pip/arrow-0.15.8 2020-07-27 18:05:41 +00:00
99628aface Bump arrow from 0.15.7 to 0.15.8
Bumps [arrow](https://github.com/arrow-py/arrow) from 0.15.7 to 0.15.8.
- [Release notes](https://github.com/arrow-py/arrow/releases)
- [Changelog](https://github.com/arrow-py/arrow/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/arrow-py/arrow/compare/0.15.7...0.15.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-27 17:58:40 +00:00
918e1699ea Merge pull request #3065 from Netflix/dependabot/pip/hvac-0.10.5 2020-07-27 17:53:21 +00:00
560894befb Bump hvac from 0.10.4 to 0.10.5
Bumps [hvac](https://github.com/hvac/hvac) from 0.10.4 to 0.10.5.
- [Release notes](https://github.com/hvac/hvac/releases)
- [Changelog](https://github.com/hvac/hvac/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/hvac/hvac/compare/v0.10.4...v0.10.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-27 17:45:03 +00:00
b5b50d34b2 Merge pull request #3067 from Netflix/dependabot/pip/coverage-5.2.1 2020-07-27 17:39:54 +00:00
276229db4a Bump coverage from 5.2 to 5.2.1
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.2 to 5.2.1.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/coverage-5.2...coverage-5.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-27 17:32:39 +00:00
6000d8bb06 Merge pull request #3064 from Netflix/dependabot/pip/botocore-1.17.28 2020-07-27 17:27:42 +00:00
0607520f93 Bump botocore from 1.17.23 to 1.17.28
Bumps [botocore](https://github.com/boto/botocore) from 1.17.23 to 1.17.28.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.17.23...1.17.28)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-27 13:40:35 +00:00
3c1d6998fb Merge branch 'master' into pinning-to-cross-signed-LE-ICA 2020-07-24 10:25:11 -07:00
456c994d25 Merge pull request #3062 from charhate/bootswatch-fix
Hardcoding bootswatch version to 3.4.1+1
2020-07-24 10:16:34 -07:00
4c3a6112b8 Merge branch 'master' into bootswatch-fix 2020-07-23 17:12:23 -07:00
f6faa856fe Hardcoding bootswatch version to 3.4.1+1
Fixing error : Potentially unhandled rejection [2] variable @path is undefined in file bower_components/bootswatch/sandstone/bootswatch.less line no. 10
2020-07-23 15:40:55 -07:00
91c0432cc2 Merge pull request #2982 from thousandeyes/fix-cryptography-intermediate-ca
Fix intermediate CA creation on cryptography plugin
2020-07-23 14:31:34 -07:00
0fd83d13ae Fix intermediate CA creation on cryptography plugin 2020-07-23 13:58:32 -07:00
4fa0374097 Merge branch 'master' into pinning-to-cross-signed-LE-ICA 2020-07-20 11:18:50 -07:00
a3ae76fac1 Merge pull request #3060 from Netflix/dependabot/pip/boto3-1.14.23 2020-07-20 17:39:43 +00:00
1da7564374 Bump boto3 from 1.14.20 to 1.14.23
Bumps [boto3](https://github.com/boto/boto3) from 1.14.20 to 1.14.23.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.14.20...1.14.23)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-20 17:33:37 +00:00
e7a0002f1b Merge pull request #3059 from Netflix/dependabot/pip/botocore-1.17.23 2020-07-20 17:31:04 +00:00
0d19986fb1 Bump botocore from 1.17.20 to 1.17.23
Bumps [botocore](https://github.com/boto/botocore) from 1.17.20 to 1.17.23.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.17.20...1.17.23)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-20 17:25:32 +00:00
c0869e0c71 Merge pull request #3061 from Netflix/dependabot/pip/flask-sqlalchemy-2.4.4 2020-07-20 17:23:11 +00:00
863bdc045b Bump flask-sqlalchemy from 2.4.3 to 2.4.4
Bumps [flask-sqlalchemy](https://github.com/pallets/flask-sqlalchemy) from 2.4.3 to 2.4.4.
- [Release notes](https://github.com/pallets/flask-sqlalchemy/releases)
- [Changelog](https://github.com/pallets/flask-sqlalchemy/blob/master/CHANGES.rst)
- [Commits](https://github.com/pallets/flask-sqlalchemy/compare/2.4.3...2.4.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-20 17:15:36 +00:00
8cc57a884e Merge pull request #3058 from Netflix/dependabot/pip/cloudflare-2.8.6 2020-07-20 17:13:19 +00:00
f7fce73e1e Bump cloudflare from 2.8.3 to 2.8.6
Bumps [cloudflare](https://github.com/cloudflare/python-cloudflare) from 2.8.3 to 2.8.6.
- [Release notes](https://github.com/cloudflare/python-cloudflare/releases)
- [Changelog](https://github.com/cloudflare/python-cloudflare/blob/master/CHANGELOG.md)
- [Commits](https://github.com/cloudflare/python-cloudflare/compare/2.8.3...2.8.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-20 13:36:39 +00:00
2317967802 lack of an empty config file was resulting into this error
```
Traceback (most recent call last):
  File "/home/travis/build/Netflix/lemur/lemur/plugins/lemur_acme/tests/test_acme.py", line 159, in test_request_certificate
    self.acme.request_certificate(mock_acme, [], mock_order)
  File "/home/travis/build/Netflix/lemur/lemur/plugins/lemur_acme/plugin.py", line 211, in request_certificate
    current_app.config.get("IDENTRUST_CROSS_SIGNED_LE_ICA_EXPIRATION_DATE", "17/03/21"), '%d/%m/%y'):
TypeError: strptime() argument 1 must be str, not MagicMock
```
2020-07-15 17:04:49 -07:00
d5ae45a0d0 Let's Encrypt has been using a cross-signed intermediate CA by DST Root CA X3, which is included in any older devices' TrustStore.
https://letsencrypt.org/certificates/

Let's Encrypt is transitioning to use the intermediate CA issued by their own root (ISRG X1) starting from September 29th 2020. This is in preparation of concluding the initial bootstrapping of their CA, by having it cross-signed by an older CA.
https://letsencrypt.org/2019/04/15/transitioning-to-isrg-root.html

This PR allows Lemur to pin to the cross-signed ICA (same public/private key pair as the ICA signed by ISRG X1). This will prolong support for incompatible systems.
2020-07-14 17:35:13 -07:00
a46991646b Merge pull request #3055 from Netflix/dependabot/pip/boto3-1.14.20 2020-07-13 17:50:03 +00:00
fd2adad49e Bump boto3 from 1.14.16 to 1.14.20
Bumps [boto3](https://github.com/boto/boto3) from 1.14.16 to 1.14.20.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.14.16...1.14.20)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-13 17:36:12 +00:00
e3afaccf97 Merge pull request #3053 from Netflix/dependabot/pip/sqlalchemy-utils-0.36.8 2020-07-13 17:33:57 +00:00
05cae2ae8d Bump sqlalchemy-utils from 0.36.7 to 0.36.8
Bumps [sqlalchemy-utils](https://github.com/kvesteri/sqlalchemy-utils) from 0.36.7 to 0.36.8.
- [Release notes](https://github.com/kvesteri/sqlalchemy-utils/releases)
- [Changelog](https://github.com/kvesteri/sqlalchemy-utils/blob/master/CHANGES.rst)
- [Commits](https://github.com/kvesteri/sqlalchemy-utils/compare/0.36.7...0.36.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-13 17:21:30 +00:00
5bfb98e097 Merge pull request #3054 from Netflix/dependabot/pip/acme-1.6.0 2020-07-13 17:19:25 +00:00
ba9b633c45 Bump acme from 1.5.0 to 1.6.0
Bumps [acme](https://github.com/letsencrypt/letsencrypt) from 1.5.0 to 1.6.0.
- [Release notes](https://github.com/letsencrypt/letsencrypt/releases)
- [Commits](https://github.com/letsencrypt/letsencrypt/compare/v1.5.0...v1.6.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-13 17:04:17 +00:00
e73c7db16b Merge pull request #3056 from Netflix/dependabot/pip/pytest-mock-3.2.0 2020-07-13 17:02:18 +00:00
0517d01748 Bump pytest-mock from 3.1.1 to 3.2.0
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.1.1...v3.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-13 16:44:52 +00:00
672f0e10f9 Merge pull request #3052 from Netflix/dependabot/pip/botocore-1.17.20 2020-07-13 16:43:03 +00:00
d02128a093 Bump botocore from 1.17.16 to 1.17.20
Bumps [botocore](https://github.com/boto/botocore) from 1.17.16 to 1.17.20.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.17.16...1.17.20)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-13 13:38:55 +00:00
d27a1292c5 Merge pull request #3051 from hosseinsh/reverse-package-lock-PR
reversing PR due to internal resolved addresses
2020-07-06 14:14:55 -07:00
f6fed4ddc2 reversing PR due to internal resolved addresses 2020-07-06 14:08:31 -07:00
a58e10f107 Merge pull request #3048 from Netflix/dependabot/pip/boto3-1.14.16 2020-07-06 19:05:47 +00:00
2aea0fbfba Bump boto3 from 1.14.12 to 1.14.16
Bumps [boto3](https://github.com/boto/boto3) from 1.14.12 to 1.14.16.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.14.12...1.14.16)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-06 18:58:25 +00:00
0fa9ce7a6d Merge pull request #3047 from Netflix/dependabot/pip/botocore-1.17.16 2020-07-06 18:56:00 +00:00
f863a227ac Bump botocore from 1.17.12 to 1.17.16
Bumps [botocore](https://github.com/boto/botocore) from 1.17.12 to 1.17.16.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.17.12...1.17.16)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-06 18:48:54 +00:00
31298845f5 Merge pull request #3049 from Netflix/dependabot/pip/sqlalchemy-utils-0.36.7 2020-07-06 18:46:16 +00:00
98c2e5cc31 Bump sqlalchemy-utils from 0.36.6 to 0.36.7
Bumps [sqlalchemy-utils](https://github.com/kvesteri/sqlalchemy-utils) from 0.36.6 to 0.36.7.
- [Release notes](https://github.com/kvesteri/sqlalchemy-utils/releases)
- [Changelog](https://github.com/kvesteri/sqlalchemy-utils/blob/master/CHANGES.rst)
- [Commits](https://github.com/kvesteri/sqlalchemy-utils/compare/0.36.6...0.36.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-06 18:37:07 +00:00
5e24e3fd91 Merge pull request #3045 from Netflix/dependabot/pip/sphinx-3.1.2 2020-07-06 18:34:31 +00:00
4050111291 Bump sphinx from 3.1.1 to 3.1.2
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.1.1...v3.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-06 18:25:18 +00:00
343ea09813 Merge pull request #3046 from Netflix/dependabot/pip/python-ldap-3.3.1 2020-07-06 18:23:23 +00:00
c384de7e19 Bump python-ldap from 3.3.0 to 3.3.1
Bumps [python-ldap](https://github.com/python-ldap/python-ldap) from 3.3.0 to 3.3.1.
- [Release notes](https://github.com/python-ldap/python-ldap/releases)
- [Commits](https://github.com/python-ldap/python-ldap/compare/python-ldap-3.3.0...python-ldap-3.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-06 18:12:45 +00:00
d8bc7d34c5 Merge pull request #3050 from Netflix/dependabot/pip/pre-commit-2.6.0 2020-07-06 18:10:41 +00:00
b329d1cdb9 Bump pre-commit from 2.5.1 to 2.6.0
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.5.1 to 2.6.0.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.5.1...v2.6.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-06 18:03:49 +00:00
0f00074500 Merge pull request #3044 from Netflix/dependabot/pip/coverage-5.2 2020-07-06 18:01:58 +00:00
d65198cd2e Bump coverage from 5.1 to 5.2
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.1 to 5.2.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/coverage-5.1...coverage-5.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-06 13:32:27 +00:00
75160ae5f3 Merge pull request #3041 from jramosf/patch-1
Fix unmatched field in Authorization
2020-07-02 10:34:04 -07:00
e0c2f4274e Merge branch 'master' into patch-1 2020-07-02 10:16:02 -07:00
4fd1d7d957 Merge pull request #3042 from jramosf/patch-2
Remove f from non-f string
2020-07-02 10:10:59 -07:00
aa11088944 Remove f from non-f string 2020-07-02 16:48:41 +02:00
1f598e3752 Fix unmatched field in Authorization
The field in the formatted string was not matching the args
2020-07-02 16:41:19 +02:00
5870ff4713 Merge pull request #3040 from jramosf/patch-1
Raise ValidationError if CSR contains invalid CN
2020-07-01 14:48:55 -07:00
7a5a5531cc Raise ValidationError if CSR contains invalid CN
If we supply a CSR that contains an empty field in the Subject, Lemur will crash with an error 500 as the ValueError exception is not captured. This change captures the exception and raises a ValidationError which in this case is a 400 sent back to client. Example to reproduce:

    Subject: C=ZZ, ST=Something, L=, O=My_Org, OU=My_Dept, CN=www.booking.com

The empty L= causes a ValueError which needs to be captured.
2020-07-01 15:44:06 +02:00
47946510d4 Merge pull request #3038 from Netflix/dependabot/pip/boto3-1.14.12 2020-06-29 17:20:43 +00:00
9ec7593bc7 Bump boto3 from 1.14.8 to 1.14.12
Bumps [boto3](https://github.com/boto/boto3) from 1.14.8 to 1.14.12.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.14.8...1.14.12)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-29 17:13:05 +00:00
6bb3fa20fb Merge pull request #3037 from Netflix/dependabot/pip/cloudflare-2.8.3 2020-06-29 17:10:32 +00:00
f17ad9aad9 Bump cloudflare from 2.8.2 to 2.8.3
Bumps [cloudflare](https://github.com/cloudflare/python-cloudflare) from 2.8.2 to 2.8.3.
- [Release notes](https://github.com/cloudflare/python-cloudflare/releases)
- [Changelog](https://github.com/cloudflare/python-cloudflare/blob/master/CHANGELOG.md)
- [Commits](https://github.com/cloudflare/python-cloudflare/compare/2.8.2...2.8.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-29 17:03:09 +00:00
c722df1245 Merge pull request #3039 from Netflix/dependabot/pip/botocore-1.17.12 2020-06-29 17:00:53 +00:00
81457f88c9 Bump botocore from 1.17.8 to 1.17.12
Bumps [botocore](https://github.com/boto/botocore) from 1.17.8 to 1.17.12.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.17.8...1.17.12)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-29 16:46:32 +00:00
a669e5b057 Merge pull request #3036 from Netflix/dependabot/pip/twine-3.2.0 2020-06-29 16:44:00 +00:00
80b9f97b39 Bump twine from 3.1.1 to 3.2.0
Bumps [twine](https://github.com/pypa/twine) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/pypa/twine/releases)
- [Changelog](https://github.com/pypa/twine/blob/master/docs/changelog.rst)
- [Commits](https://github.com/pypa/twine/compare/3.1.1...3.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-29 13:38:29 +00:00
9f641c14a9 Merge pull request #3025 from Netflix/dependabot/pip/certifi-2020.6.20 2020-06-23 00:14:12 +00:00
1d9af2eb72 Bump certifi from 2020.4.5.2 to 2020.6.20
Bumps [certifi](https://github.com/certifi/python-certifi) from 2020.4.5.2 to 2020.6.20.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](https://github.com/certifi/python-certifi/compare/2020.04.05.2...2020.06.20)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-23 00:08:05 +00:00
0003e53f5a Merge pull request #3034 from Netflix/dependabot/pip/boto3-1.14.8 2020-06-23 00:05:24 +00:00
5ab9d7f4e8 Bump boto3 from 1.13.19 to 1.14.8
Bumps [boto3](https://github.com/boto/boto3) from 1.13.19 to 1.14.8.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.13.19...1.14.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-22 23:50:41 +00:00
e61ecea0f2 Merge pull request #3029 from Netflix/dependabot/pip/requests-2.24.0 2020-06-22 23:47:59 +00:00
1be0362b11 Bump requests from 2.23.0 to 2.24.0
Bumps [requests](https://github.com/psf/requests) from 2.23.0 to 2.24.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.23.0...v2.24.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-22 23:39:56 +00:00
7ada40d1b3 Merge pull request #3031 from Netflix/dependabot/pip/arrow-0.15.7 2020-06-22 23:37:15 +00:00
ff6e23f2ea Bump arrow from 0.15.6 to 0.15.7
Bumps [arrow](https://github.com/crsmithdev/arrow) from 0.15.6 to 0.15.7.
- [Release notes](https://github.com/crsmithdev/arrow/releases)
- [Changelog](https://github.com/crsmithdev/arrow/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/crsmithdev/arrow/compare/0.15.6...0.15.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-22 23:29:09 +00:00
738afc4760 Merge pull request #3020 from Netflix/dependabot/pip/flask-replicated-1.4 2020-06-22 23:27:02 +00:00
9c20c0c950 Bump flask-replicated from 1.3 to 1.4
Bumps [flask-replicated](https://github.com/peterdemin/python-flask-replicated) from 1.3 to 1.4.
- [Release notes](https://github.com/peterdemin/python-flask-replicated/releases)
- [Commits](https://github.com/peterdemin/python-flask-replicated/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-22 23:17:28 +00:00
bf4043d4c2 Merge pull request #3033 from Netflix/dependabot/pip/cloudflare-2.8.2 2020-06-22 23:15:23 +00:00
2a12fd886d Bump cloudflare from 2.7.1 to 2.8.2
Bumps [cloudflare](https://github.com/cloudflare/python-cloudflare) from 2.7.1 to 2.8.2.
- [Release notes](https://github.com/cloudflare/python-cloudflare/releases)
- [Changelog](https://github.com/cloudflare/python-cloudflare/blob/master/CHANGELOG.md)
- [Commits](https://github.com/cloudflare/python-cloudflare/compare/2.7.1...2.8.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-22 23:04:50 +00:00
d350953bcc Merge pull request #3018 from Netflix/dependabot/pip/sphinx-3.1.1 2020-06-22 23:02:45 +00:00
b6b07edcb6 Bump sphinx from 3.1.0 to 3.1.1
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.1.0...v3.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-22 22:53:26 +00:00
fb39c48530 Merge pull request #3028 from Netflix/dependabot/pip/sphinx-rtd-theme-0.5.0 2020-06-22 22:51:35 +00:00
c8a232f65f Bump sphinx-rtd-theme from 0.4.3 to 0.5.0
Bumps [sphinx-rtd-theme](https://github.com/rtfd/sphinx_rtd_theme) from 0.4.3 to 0.5.0.
- [Release notes](https://github.com/rtfd/sphinx_rtd_theme/releases)
- [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst)
- [Commits](https://github.com/rtfd/sphinx_rtd_theme/compare/0.4.3...0.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-22 22:43:42 +00:00
125e6d046f Merge pull request #3027 from Netflix/dependabot/pip/python-ldap-3.3.0 2020-06-22 22:41:40 +00:00
17e28748ff Bump python-ldap from 3.2.0 to 3.3.0
Bumps [python-ldap](https://github.com/python-ldap/python-ldap) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/python-ldap/python-ldap/releases)
- [Commits](https://github.com/python-ldap/python-ldap/compare/python-ldap-3.2.0...python-ldap-3.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-22 22:26:26 +00:00
f532d5c1a5 Merge pull request #3024 from Netflix/dependabot/pip/hvac-0.10.4 2020-06-22 22:24:13 +00:00
8af7a2155d Bump hvac from 0.10.3 to 0.10.4
Bumps [hvac](https://github.com/hvac/hvac) from 0.10.3 to 0.10.4.
- [Release notes](https://github.com/hvac/hvac/releases)
- [Changelog](https://github.com/hvac/hvac/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/hvac/hvac/compare/v0.10.3...v0.10.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-22 22:13:20 +00:00
a480330c98 Merge pull request #3021 from Netflix/dependabot/pip/pre-commit-2.5.1 2020-06-22 22:11:20 +00:00
59d63b5f40 Bump pre-commit from 2.4.0 to 2.5.1
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.4.0 to 2.5.1.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.4.0...v2.5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-22 22:01:18 +00:00
51c0342ec4 Merge pull request #3026 from Netflix/dependabot/pip/faker-4.1.1 2020-06-22 21:59:38 +00:00
431c3cc686 Bump faker from 4.1.0 to 4.1.1
Bumps [faker](https://github.com/joke2k/faker) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/joke2k/faker/releases)
- [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/joke2k/faker/compare/v4.1.0...v4.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-22 21:53:12 +00:00
88ed00c330 Merge pull request #3017 from Netflix/dependabot/pip/botocore-1.16.26 2020-06-22 21:51:22 +00:00
804d3b630a Bump botocore from 1.16.25 to 1.16.26
Bumps [botocore](https://github.com/boto/botocore) from 1.16.25 to 1.16.26.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.16.25...1.16.26)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-15 13:37:15 +00:00
e024fceba2 Merge pull request #3016 from hosseinsh/UnboundLocalError
fixing UnboundLocalError bug
2020-06-11 16:57:48 -07:00
4985744bd8 fixing UnboundLocalError bug 2020-06-11 16:47:37 -07:00
5ea3815c7e Merge pull request #3015 from Netflix/ultra_move_01
moving ultradns tests to separate file
2020-06-11 14:43:23 -07:00
a7a309136f fixing whitespace and imports 2020-06-11 14:15:40 -07:00
f834d10f9a moving ultradns tests to separate file 2020-06-11 14:04:17 -07:00
43bb48c286 Merge pull request #2884 from ilyalabun/ilabun/optimize-certificates-sql
Optimize certificates sql
2020-06-09 17:10:04 -07:00
c40d297735 Merge branch 'master' into ilabun/optimize-certificates-sql 2020-06-09 14:20:31 -07:00
1b05971268 Merge pull request #2985 from hosseinsh/adding-package-lock
freeze dependencies for more reliable builds
2020-06-09 12:17:52 -07:00
472a4654a2 Merge branch 'master' into adding-package-lock 2020-06-09 11:23:36 -07:00
1a0704c43b Merge pull request #2986 from hosseinsh/json-logging-rotate
adding json formatted logging
2020-06-09 11:23:23 -07:00
fd3ea2cf46 Merge branch 'master' into json-logging-rotate 2020-06-09 10:58:53 -07:00
3ec8b7b36e Merge pull request #2842 from hosseinsh/check-revoke-revised
improving check revoked by only considering authorities which do supp…
2020-06-09 10:58:41 -07:00
099ebee409 Merge branch 'master' into check-revoke-revised 2020-06-09 10:47:24 -07:00
64b4437ca7 Merge branch 'master' into adding-package-lock 2020-06-09 10:46:08 -07:00
62469e518f Merge branch 'master' into json-logging-rotate 2020-06-09 10:45:57 -07:00
e5a9debf10 Merge pull request #3013 from Netflix/dependabot/pip/botocore-1.16.25 2020-06-09 16:21:50 +00:00
cd47101069 Bump botocore from 1.16.19 to 1.16.25
Bumps [botocore](https://github.com/boto/botocore) from 1.16.19 to 1.16.25.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.16.19...1.16.25)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-09 04:09:05 +00:00
b059813c5b Merge pull request #3004 from Netflix/dependabot/pip/certifi-2020.4.5.2 2020-06-09 04:06:48 +00:00
422d9ba050 Bump certifi from 2020.4.5.1 to 2020.4.5.2
Bumps [certifi](https://github.com/certifi/python-certifi) from 2020.4.5.1 to 2020.4.5.2.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](https://github.com/certifi/python-certifi/compare/2020.04.05.1...2020.04.05.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-09 03:56:46 +00:00
44be7d2900 Merge pull request #3007 from Netflix/dependabot/pip/redis-3.5.3 2020-06-09 03:54:29 +00:00
34f61db5bc Bump redis from 3.5.2 to 3.5.3
Bumps [redis](https://github.com/andymccurdy/redis-py) from 3.5.2 to 3.5.3.
- [Release notes](https://github.com/andymccurdy/redis-py/releases)
- [Changelog](https://github.com/andymccurdy/redis-py/blob/master/CHANGES)
- [Commits](https://github.com/andymccurdy/redis-py/compare/3.5.2...3.5.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-09 03:46:06 +00:00
735db771f8 Merge pull request #3012 from Netflix/dependabot/pip/inflection-0.5.0 2020-06-09 03:43:51 +00:00
f08394ffe2 Bump inflection from 0.4.0 to 0.5.0
Bumps [inflection](https://github.com/jpvanhal/inflection) from 0.4.0 to 0.5.0.
- [Release notes](https://github.com/jpvanhal/inflection/releases)
- [Commits](https://github.com/jpvanhal/inflection/compare/0.4.0...0.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-09 03:35:59 +00:00
354f699135 Merge pull request #3006 from Netflix/dependabot/pip/sphinx-3.1.0 2020-06-09 03:33:55 +00:00
5d00670346 Bump sphinx from 3.0.4 to 3.1.0
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.0.4 to 3.1.0.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.0.4...v3.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-09 03:28:33 +00:00
a2c56d6686 Merge pull request #2992 from hosseinsh/improve-expiry-email
improved messaging
2020-06-08 20:26:43 -07:00
c3b36d697f clarification 2020-06-08 15:17:45 -07:00
9dccd6f3bd Merge branch 'master' into improve-expiry-email 2020-06-08 15:14:23 -07:00
d9d46dba35 Merge pull request #3005 from Netflix/dependabot/pip/pytest-5.4.3 2020-06-08 17:18:31 +00:00
73347a02b6 Bump pytest from 5.4.2 to 5.4.3
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.4.2 to 5.4.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/5.4.2...5.4.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-08 17:11:16 +00:00
ad005e0b4c Merge pull request #3011 from Netflix/dependabot/pip/nodeenv-1.4.0 2020-06-08 17:09:29 +00:00
a632f32816 Bump nodeenv from 1.3.5 to 1.4.0
Bumps [nodeenv](https://github.com/ekalinin/nodeenv) from 1.3.5 to 1.4.0.
- [Release notes](https://github.com/ekalinin/nodeenv/releases)
- [Changelog](https://github.com/ekalinin/nodeenv/blob/master/CHANGES)
- [Commits](https://github.com/ekalinin/nodeenv/compare/1.3.5...1.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-08 17:02:49 +00:00
9d097c593e Merge pull request #3010 from Netflix/dependabot/pip/pytest-mock-3.1.1 2020-06-08 17:01:04 +00:00
db45fc678f Bump pytest-mock from 3.1.0 to 3.1.1
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.1.0...v3.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-08 16:51:27 +00:00
4a040c66c5 Merge pull request #3003 from Netflix/dependabot/pip/acme-1.5.0 2020-06-08 16:49:39 +00:00
53601be788 Merge branch 'master' into dependabot/pip/acme-1.5.0 2020-06-08 09:43:39 -07:00
a0c2357d81 Merge pull request #3002 from avoidik/master
docker - add libtool, fix url context path
2020-06-08 09:42:52 -07:00
a2e84441ce Bump acme from 1.4.0 to 1.5.0
Bumps [acme](https://github.com/letsencrypt/letsencrypt) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/letsencrypt/letsencrypt/releases)
- [Commits](https://github.com/letsencrypt/letsencrypt/compare/v1.4.0...v1.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-08 13:40:31 +00:00
7fad7df768 docker - add libtool, fix url context path 2020-06-06 16:23:12 +03:00
5215a71a6d Merge branch 'master' into check-revoke-revised 2020-06-04 15:51:48 -07:00
b487363bda Merge branch 'master' into adding-package-lock 2020-06-04 15:51:33 -07:00
704e61dd53 Merge branch 'master' into json-logging-rotate 2020-06-04 15:51:24 -07:00
e06c3ea192 Merge branch 'master' into improve-expiry-email 2020-06-04 15:51:17 -07:00
8beaeffaec Merge pull request #2997 from Netflix/dependabot/pip/flask-sqlalchemy-2.4.3 2020-06-04 00:34:58 +00:00
7e8bb97920 Merge branch 'master' into dependabot/pip/flask-sqlalchemy-2.4.3 2020-06-03 17:29:26 -07:00
8270ee98e9 Merge pull request #2998 from Netflix/dependabot/pip/boto3-1.13.19 2020-06-04 00:02:21 +00:00
aadca10a12 Merge branch 'master' into dependabot/pip/flask-sqlalchemy-2.4.3 2020-06-03 16:56:28 -07:00
03eb991c89 Merge branch 'master' into dependabot/pip/boto3-1.13.19 2020-06-03 16:56:25 -07:00
6c957be3d8 Merge pull request #3001 from alwaysjolley/valid_domain_fix
fixing domain validation
2020-06-03 16:55:42 -07:00
1bcc9d5d0d allowing for _ in domains 2020-06-03 13:20:23 -04:00
1b8507636b fixing quotes, no escape characters in tests, fixed anchors 2020-06-03 12:49:55 -04:00
3ce7cd6c50 fixing escaped string on domain test 2020-06-03 11:34:14 -04:00
8658ac531e fixing unittests and allowing for single character domains 2020-06-03 08:08:49 -04:00
2a1751ec30 fixing domain validation to account for 2-63 character length and correct character set 2020-06-03 04:56:38 -04:00
860b35e19d Merge branch 'master' into adding-package-lock 2020-06-02 13:54:32 -07:00
aff8500b85 Merge branch 'master' into json-logging-rotate 2020-06-02 13:54:21 -07:00
840408d5d2 Merge branch 'master' into improve-expiry-email 2020-06-02 13:54:09 -07:00
9a5ec72850 Bump boto3 from 1.13.18 to 1.13.19
Bumps [boto3](https://github.com/boto/boto3) from 1.13.18 to 1.13.19.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.13.18...1.13.19)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-01 17:02:26 +00:00
b68a7f1de2 Bump flask-sqlalchemy from 2.4.1 to 2.4.3
Bumps [flask-sqlalchemy](https://github.com/pallets/flask-sqlalchemy) from 2.4.1 to 2.4.3.
- [Release notes](https://github.com/pallets/flask-sqlalchemy/releases)
- [Changelog](https://github.com/pallets/flask-sqlalchemy/blob/master/CHANGES.rst)
- [Commits](https://github.com/pallets/flask-sqlalchemy/compare/2.4.1...2.4.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-01 17:02:08 +00:00
93225f1ec2 Merge pull request #2999 from Netflix/dependabot/pip/sphinx-3.0.4 2020-06-01 16:59:50 +00:00
01bb9df16d Bump sphinx from 3.0.3 to 3.0.4
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.0.3 to 3.0.4.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.0.3...v3.0.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-01 16:48:50 +00:00
c42bf89c5e Merge pull request #2996 from Netflix/dependabot/pip/botocore-1.16.19 2020-06-01 16:46:42 +00:00
2e73a4e872 Bump botocore from 1.16.18 to 1.16.19
Bumps [botocore](https://github.com/boto/botocore) from 1.16.18 to 1.16.19.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.16.18...1.16.19)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-01 16:39:45 +00:00
a3af428639 Merge pull request #2995 from Netflix/dependabot/pip/marshmallow-sqlalchemy-0.23.1 2020-06-01 16:37:36 +00:00
e2fefdbe89 Bump marshmallow-sqlalchemy from 0.23.0 to 0.23.1
Bumps [marshmallow-sqlalchemy](https://github.com/marshmallow-code/marshmallow-sqlalchemy) from 0.23.0 to 0.23.1.
- [Release notes](https://github.com/marshmallow-code/marshmallow-sqlalchemy/releases)
- [Changelog](https://github.com/marshmallow-code/marshmallow-sqlalchemy/blob/dev/CHANGELOG.rst)
- [Commits](https://github.com/marshmallow-code/marshmallow-sqlalchemy/compare/0.23.0...0.23.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-01 13:38:37 +00:00
50091cca1d Merge branch 'master' into ilabun/optimize-certificates-sql 2020-05-27 15:29:47 -07:00
d8948a12d3 Merge branch 'master' into check-revoke-revised 2020-05-27 15:29:19 -07:00
277249fff1 Merge branch 'master' into adding-package-lock 2020-05-27 15:29:00 -07:00
86c3771044 Merge branch 'master' into json-logging-rotate 2020-05-27 15:28:48 -07:00
904bc9d8b6 Merge branch 'master' into improve-expiry-email 2020-05-27 15:28:41 -07:00
4bf7e26976 Merge pull request #2994 from Netflix/dependabot/pip/boto3-1.13.18 2020-05-27 22:24:58 +00:00
66a5c3880e Bump boto3 from 1.13.11 to 1.13.18
Bumps [boto3](https://github.com/boto/boto3) from 1.13.11 to 1.13.18.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.13.11...1.13.18)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-27 22:18:14 +00:00
084672bd07 Merge pull request #2991 from Netflix/dependabot/pip/hvac-0.10.3 2020-05-27 22:15:47 +00:00
3ac2e20e93 Bump hvac from 0.10.1 to 0.10.3
Bumps [hvac](https://github.com/hvac/hvac) from 0.10.1 to 0.10.3.
- [Release notes](https://github.com/hvac/hvac/releases)
- [Changelog](https://github.com/hvac/hvac/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/hvac/hvac/compare/v0.10.1...v0.10.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-27 22:05:24 +00:00
f794ad7e9e Merge pull request #2990 from Netflix/dependabot/pip/sqlalchemy-utils-0.36.6 2020-05-27 22:03:15 +00:00
44eeb2b738 Bump sqlalchemy-utils from 0.36.5 to 0.36.6
Bumps [sqlalchemy-utils](https://github.com/kvesteri/sqlalchemy-utils) from 0.36.5 to 0.36.6.
- [Release notes](https://github.com/kvesteri/sqlalchemy-utils/releases)
- [Changelog](https://github.com/kvesteri/sqlalchemy-utils/blob/master/CHANGES.rst)
- [Commits](https://github.com/kvesteri/sqlalchemy-utils/compare/0.36.5...0.36.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-27 21:56:49 +00:00
22759e7f5c Merge pull request #2988 from Netflix/dependabot/pip/six-1.15.0 2020-05-27 21:55:02 +00:00
760a219e09 Bump six from 1.14.0 to 1.15.0
Bumps [six](https://github.com/benjaminp/six) from 1.14.0 to 1.15.0.
- [Release notes](https://github.com/benjaminp/six/releases)
- [Changelog](https://github.com/benjaminp/six/blob/master/CHANGES)
- [Commits](https://github.com/benjaminp/six/compare/1.14.0...1.15.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-27 21:38:46 +00:00
0ed10eafbb Merge pull request #2922 from e11it/master
Docker fixes. Vault dest path and obj_name support vars from cert
2020-05-27 14:36:22 -07:00
d95f02d234 Merge branch 'master' into master 2020-05-27 14:25:07 -07:00
8861cc70cb rewordin 2020-05-26 17:12:47 -07:00
34e3f7c049 improved messaging 2020-05-26 16:38:12 -07:00
4eeab91d73 making lint happy 2020-05-22 18:36:39 -07:00
10dfedee36 making lint happy 2020-05-22 18:33:43 -07:00
5f87b7d2db Merge branch 'master' into adding-package-lock 2020-05-22 18:25:15 -07:00
86310ff02d Merge branch 'master' into check-revoke-revised 2020-05-22 18:25:00 -07:00
87a53557cd Merge branch 'master' into json-logging-rotate 2020-05-22 18:24:53 -07:00
b96657994a Merge pull request #2953 from hosseinsh/cert-rotation-region-by-region
Certificate rotation region by region
2020-05-22 18:24:20 -07:00
8f16688b0a Merge branch 'master' into check-revoke-revised 2020-05-22 17:45:50 -07:00
49a8b80df2 better exception handling when OCSP or CRL or not implemented 2020-05-22 17:36:34 -07:00
c9767b3172 adding logging for revoked certs 2020-05-22 17:32:44 -07:00
49c4a9c3b2 making the revocation to be scoped based on the authority plugin name 2020-05-22 17:29:30 -07:00
4923bbf8a7 adding json formatted logging 2020-05-22 16:22:12 -07:00
09016fd2ee cleaning up the code after more local testing 2020-05-22 16:04:39 -07:00
13cfe7a754 Merge branch 'master' into master 2020-05-22 21:53:05 +03:00
f83e3f764e always assign csr_sans to name 2020-05-22 21:52:43 +03:00
b292c1c3c3 Merge branch 'master' into cert-rotation-region-by-region 2020-05-22 11:32:12 -07:00
0e38870fb5 freeze dependencies for more reliable builds as recommended by
https://docs.npmjs.com/files/package-lock.json
2020-05-22 11:20:26 -07:00
ecf940bb8f Update README.rst
updating python
2020-05-22 10:44:02 -07:00
97145b6dee Merge branch 'master' into ilabun/optimize-certificates-sql 2020-05-22 10:29:28 -07:00
cc4fc66c93 Merge branch 'master' into master 2020-05-22 09:57:46 -07:00
748268ecd5 Merge branch 'master' into cert-rotation-region-by-region 2020-05-22 09:57:06 -07:00
f60ade4d28 Merge pull request #2984 from hosseinsh/improved-logging-enable-auto-rotate
improved logging for enable auto-rotate
2020-05-21 16:12:27 -07:00
3b8f3612a1 Merge branch 'master' into improved-logging-enable-auto-rotate 2020-05-21 15:41:01 -07:00
2582086d39 Merge branch 'master' into ilabun/optimize-certificates-sql 2020-05-21 15:39:58 -07:00
2422717467 Merge pull request #2966 from lumatijev/master
Improve periodic tasks docs
2020-05-21 15:39:10 -07:00
fd444403bb improved logging.
- adding destination name, fixing broken metric.
2020-05-21 15:32:38 -07:00
07cb2f71cb Merge branch 'master' into master 2020-05-18 11:59:46 -07:00
2660beb0bc Merge branch 'master' into cert-rotation-region-by-region 2020-05-18 11:57:19 -07:00
fb3373f789 Merge pull request #2974 from Netflix/dependabot/pip/pre-commit-2.4.0 2020-05-18 18:16:17 +00:00
4d4ff85090 Bump pre-commit from 2.3.0 to 2.4.0
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.3.0 to 2.4.0.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.3.0...v2.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-18 17:44:22 +00:00
fb6979ae6d Merge pull request #2978 from Netflix/dependabot/pip/boto3-1.13.11 2020-05-18 17:42:41 +00:00
2bf03a0bc2 Bump boto3 from 1.13.6 to 1.13.11
Bumps [boto3](https://github.com/boto/boto3) from 1.13.6 to 1.13.11.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.13.6...1.13.11)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-18 17:35:43 +00:00
9d894b0817 Merge pull request #2980 from Netflix/dependabot/pip/redis-3.5.2 2020-05-18 17:32:42 +00:00
d010553d23 Bump redis from 3.4.1 to 3.5.2
Bumps [redis](https://github.com/andymccurdy/redis-py) from 3.4.1 to 3.5.2.
- [Release notes](https://github.com/andymccurdy/redis-py/releases)
- [Changelog](https://github.com/andymccurdy/redis-py/blob/master/CHANGES)
- [Commits](https://github.com/andymccurdy/redis-py/compare/3.4.1...3.5.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-18 17:23:23 +00:00
25685b4e16 Merge pull request #2979 from Netflix/dependabot/pip/botocore-1.16.11 2020-05-18 17:21:07 +00:00
9bc017c9bf Bump botocore from 1.16.6 to 1.16.11
Bumps [botocore](https://github.com/boto/botocore) from 1.16.6 to 1.16.11.
- [Release notes](https://github.com/boto/botocore/releases)
- [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/botocore/compare/1.16.6...1.16.11)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-18 17:11:39 +00:00
c1902d9232 Merge pull request #2977 from Netflix/dependabot/pip/cloudflare-2.7.1 2020-05-18 17:09:20 +00:00
d3a0fe7491 Bump cloudflare from 2.6.5 to 2.7.1
Bumps [cloudflare](https://github.com/cloudflare/python-cloudflare) from 2.6.5 to 2.7.1.
- [Release notes](https://github.com/cloudflare/python-cloudflare/releases)
- [Changelog](https://github.com/cloudflare/python-cloudflare/blob/master/CHANGELOG.md)
- [Commits](https://github.com/cloudflare/python-cloudflare/compare/2.6.5...2.7.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-18 16:58:47 +00:00
ba1bb688b7 Merge pull request #2967 from Netflix/dependabot/pip/marshmallow-sqlalchemy-0.23.0 2020-05-18 16:56:29 +00:00
23cd7d3d62 Bump marshmallow-sqlalchemy from 0.22.3 to 0.23.0
Bumps [marshmallow-sqlalchemy](https://github.com/marshmallow-code/marshmallow-sqlalchemy) from 0.22.3 to 0.23.0.
- [Release notes](https://github.com/marshmallow-code/marshmallow-sqlalchemy/releases)
- [Changelog](https://github.com/marshmallow-code/marshmallow-sqlalchemy/blob/dev/CHANGELOG.rst)
- [Commits](https://github.com/marshmallow-code/marshmallow-sqlalchemy/compare/0.22.3...0.23.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-18 16:47:18 +00:00
296d4d04a0 Merge pull request #2970 from Netflix/dependabot/pip/pytest-mock-3.1.0 2020-05-18 16:44:53 +00:00
dfd9acb0d7 Bump pytest-mock from 3.0.0 to 3.1.0
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.0.0...v3.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-18 16:37:21 +00:00
ae75fa8246 Merge pull request #2971 from Netflix/dependabot/pip/pytest-5.4.2 2020-05-18 16:35:41 +00:00
9e1737edc4 Bump pytest from 5.4.1 to 5.4.2
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.4.1 to 5.4.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/5.4.1...5.4.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-18 16:25:47 +00:00
c4b42e194f Merge pull request #2968 from Netflix/dependabot/pip/requests-mock-1.8.0 2020-05-18 16:23:59 +00:00
c0829478fd Bump requests-mock from 1.7.0 to 1.8.0
Bumps [requests-mock](https://github.com/jamielennox/requests-mock) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/jamielennox/requests-mock/releases)
- [Commits](https://github.com/jamielennox/requests-mock/compare/1.7.0...1.8.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-18 16:14:27 +00:00
477248dd8b Merge pull request #2981 from Netflix/dependabot/pip/faker-4.1.0 2020-05-18 16:12:33 +00:00
5d75204a4f Bump faker from 4.0.3 to 4.1.0
Bumps [faker](https://github.com/joke2k/faker) from 4.0.3 to 4.1.0.
- [Release notes](https://github.com/joke2k/faker/releases)
- [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/joke2k/faker/compare/v4.0.3...v4.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-18 13:45:08 +00:00
70985f4ff5 revised system arch 2020-05-14 22:37:30 -07:00
201a96ff72 Improve periodic tasks docs 2020-05-11 13:59:07 +02:00
a17f665c52 Merge pull request #2965 from Netflix/dependabot/pip/boto3-1.13.6 2020-05-08 23:02:32 +00:00
5afa32fa22 Bump boto3 from 1.12.39 to 1.13.6
Bumps [boto3](https://github.com/boto/boto3) from 1.12.39 to 1.13.6.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/boto/boto3/compare/1.12.39...1.13.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-08 22:57:55 +00:00
98e05cf8ea Merge pull request #2961 from Netflix/dependabot/pip/sqlalchemy-utils-0.36.5 2020-05-08 22:55:18 +00:00
5ac65062c9 Bump sqlalchemy-utils from 0.36.3 to 0.36.5
Bumps [sqlalchemy-utils](https://github.com/kvesteri/sqlalchemy-utils) from 0.36.3 to 0.36.5.
- [Release notes](https://github.com/kvesteri/sqlalchemy-utils/releases)
- [Changelog](https://github.com/kvesteri/sqlalchemy-utils/blob/master/CHANGES.rst)
- [Commits](https://github.com/kvesteri/sqlalchemy-utils/compare/0.36.3...0.36.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-08 22:49:15 +00:00
4534e26f93 Merge pull request #2964 from Netflix/dependabot/pip/acme-1.4.0 2020-05-08 22:47:12 +00:00
6d05af1790 Bump pyjks from 19.0.0 to 20.0.0
Bumps [pyjks](https://github.com/kurtbrose/pyjks) from 19.0.0 to 20.0.0.
- [Release notes](https://github.com/kurtbrose/pyjks/releases)
- [Changelog](https://github.com/kurtbrose/pyjks/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kurtbrose/pyjks/compare/v19.0.0...v20.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-08 15:42:20 -07:00
6bef8fb9d7 Bump acme from 1.3.0 to 1.4.0
Bumps [acme](https://github.com/letsencrypt/letsencrypt) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/letsencrypt/letsencrypt/releases)
- [Commits](https://github.com/letsencrypt/letsencrypt/compare/v1.3.0...v1.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-08 22:36:54 +00:00
56308cbd90 Merge pull request #2960 from Netflix/dependabot/pip/pyjks-20.0.0 2020-05-08 22:34:46 +00:00
cdd9137f4e Merge branch 'master' into cert-rotation-region-by-region 2020-05-08 15:32:49 -07:00
dac95313b8 Bump pyjks from 19.0.0 to 20.0.0
Bumps [pyjks](https://github.com/kurtbrose/pyjks) from 19.0.0 to 20.0.0.
- [Release notes](https://github.com/kurtbrose/pyjks/releases)
- [Changelog](https://github.com/kurtbrose/pyjks/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kurtbrose/pyjks/compare/v19.0.0...v20.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-08 22:29:51 +00:00
f8c6e2338a Merge pull request #2957 from Netflix/dependabot/pip/arrow-0.15.6 2020-05-08 22:27:55 +00:00
5ad9c11716 Bump arrow from 0.15.5 to 0.15.6
Bumps [arrow](https://github.com/crsmithdev/arrow) from 0.15.5 to 0.15.6.
- [Release notes](https://github.com/crsmithdev/arrow/releases)
- [Changelog](https://github.com/crsmithdev/arrow/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/crsmithdev/arrow/compare/0.15.5...0.15.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-08 18:42:41 +00:00
34f6c3a230 Merge pull request #2962 from Netflix/dependabot/pip/pre-commit-2.3.0 2020-05-08 18:40:37 +00:00
8e2226180a Bump pre-commit from 2.2.0 to 2.3.0
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.2.0 to 2.3.0.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.2.0...v2.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-08 18:35:37 +00:00
b993e664a3 Merge pull request #2963 from Netflix/dependabot/pip/sphinx-3.0.3 2020-05-08 18:34:10 +00:00
fa13bda99e Bump sphinx from 3.0.1 to 3.0.3
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.0.1 to 3.0.3.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.0.1...v3.0.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-08 16:45:06 +00:00
53c314cb41 Merge pull request #2959 from hosseinsh/improve-enable-autorotate
improving logging and the possibility of …
2020-05-08 09:43:11 -07:00
0f374c8fd0 Merge branch 'master' into cert-rotation-region-by-region 2020-05-08 09:21:13 -07:00
529ee04ae7 removing duplicate line 2020-05-08 09:16:46 -07:00
65b193a891 Merge branch 'master' into improve-enable-autorotate 2020-05-08 08:50:50 -07:00
daafb5ddd4 Merge pull request #2956 from Netflix/dependabot/pip/cryptography-2.9.2
Bump cryptography from 2.9 to 2.9.2
2020-05-08 08:48:10 -07:00
bffaeb1067 Merge branch 'master' into dependabot/pip/cryptography-2.9.2 2020-05-08 08:39:59 -07:00
746e314a5b Merge pull request #2954 from Netflix/dependabot/pip/fakeredis-1.4.1
Bump fakeredis from 1.4.0 to 1.4.1
2020-05-08 08:38:17 -07:00
f68900d2b3 improving logging and the possibility of defining which Authorities qualify for auto-rotation 2020-05-07 18:28:01 -07:00
7f6eae7213 Bump cryptography from 2.9 to 2.9.2
Bumps [cryptography](https://github.com/pyca/cryptography) from 2.9 to 2.9.2.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/2.9...2.9.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-08 00:25:47 +00:00
d469700cbf Bump fakeredis from 1.4.0 to 1.4.1
Bumps [fakeredis](https://github.com/jamesls/fakeredis) from 1.4.0 to 1.4.1.
- [Release notes](https://github.com/jamesls/fakeredis/releases)
- [Commits](https://github.com/jamesls/fakeredis/compare/1.4.0...1.4.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-08 00:23:52 +00:00
843ffad60e removing testing comments 2020-05-07 17:10:50 -07:00
1b6907a404 Certificate rotation region by region
example scheudule:
CELERYBEAT_SCHEDULE = {
    'certificate_rotate': {
        'task': 'lemur.common.celery.certificate_rotate',
        'options': {
            'expires': 180
        },
        'schedule': crontab(minute="*"),
        'kwargs': {'region': 'us-east-1'}
    }
}
2020-05-07 16:28:01 -07:00
54035e8db8 Merge pull request #2952 from Netflix/fix_for_latest_pip
Fix parse_requirements logic for Pip 20.1
2020-04-29 09:42:07 -07:00
ba8184c874 Fix requirement parsing for pip 20.1 2020-04-29 08:51:09 -07:00
4c40e806bc Requirements fix for Pip 20.1 2020-04-29 08:41:42 -07:00
eaaacfad3e Merge pull request #2951 from Netflix/enable_autorotate_attached_certs
Autorotate certs attached to endpoints
2020-04-28 16:33:12 -04:00
7e97d885df Address comments 2020-04-28 13:16:27 -07:00
863af7a3e5 Making CLI command ; Running black 2020-04-28 12:16:46 -07:00
273c3e2793 Celery task to enable autorotate for all certificates attached to endpoints without it enabled 2020-04-28 11:52:43 -07:00
f71a9e0ad2 Merge pull request #2950 from hosseinsh/route53-private-zone-fix
fixing the private DNS zone issue.
2020-04-24 16:08:38 -07:00
8d0007b9c0 fixing the private DNS zone issue.
Private hosted zones will never be visible to third-parties like LetsEncrypt, and Lemur should not consider them as authoritative zones.
This fix, make sure  they are not added to the  dns_provider table.
2020-04-24 15:48:06 -07:00
7b305514a1 Merge pull request #2948 from Netflix/mcandre-fix-cves
Fix Gulp CVEs & Fix broken bootswatch/bootstrap
2020-04-16 09:17:33 -07:00
4fcb050fa8 fixing bootstrap, bootswatch, and updating bower 2020-04-16 01:08:39 -07:00
3eea32a227 Merge branch 'master' into fix-cves 2020-04-15 16:53:02 -07:00
5122e0e375 Merge pull request #2947 from Netflix/qcc_q2_2020
Updated Python requirements and non-breaking node packages.
2020-04-15 16:11:59 -07:00
e33b767d12 updating package.jso based on npm update 2020-04-15 14:31:41 -07:00
f8657998e6 updated python requirements and still works 2020-04-15 14:17:34 -07:00
cee81bd693 updated requirements, fixed unittests, pytest, and distinguidedName ordering 2020-04-09 18:17:05 -07:00
67cb703c83 Merge pull request #2946 from Netflix/enhanced_error_loggin
Improve error logging for a couple of use cases
2020-04-08 15:03:41 -04:00
213b13d3c9 Merge branch 'master' into enhanced_error_loggin 2020-04-08 14:56:51 -04:00
0537d494e7 Merge pull request #2944 from dstipp/oauth2
OAUTH2 fixes
2020-04-08 11:56:42 -07:00
2c8dc24fda Merge branch 'master' into enhanced_error_loggin 2020-04-08 14:51:06 -04:00
1360d846fd Improve error logging for a couple of use cases 2020-04-08 11:50:42 -07:00
3b3cec6f8b Merge branch 'master' into oauth2 2020-04-08 10:12:04 -07:00
6102ec9267 Merge pull request #2943 from hosseinsh/imporved-metrics-sources
emitting the count of certificates on the source
2020-04-08 09:36:59 -07:00
eaeec5d757 Merge branch 'master' into imporved-metrics-sources 2020-04-08 09:23:27 -07:00
7b2d5c9103 Merge pull request #2945 from Netflix/celery_metrics
Add default celery metrics and logging using celery signals
2020-04-08 12:23:04 -04:00
11b15e7e23 Clean up docstrings 2020-04-08 08:41:48 -07:00
eb138fc960 Add default celery metrics and logging using celery signals 2020-04-08 08:38:40 -07:00
45c98a21b3 Merge branch 'master' into imporved-metrics-sources 2020-04-06 16:02:25 -07:00
37f4b4c2a6 Merge pull request #2937 from Netflix/powerdnsplugin_02
Update PowerDNS Plugin to support multiple tokens per domain
2020-04-06 09:32:44 -07:00
bb21f891cb Merge branch 'powerdnsplugin_02' of github.com:Netflix/lemur into powerdnsplugin_02 2020-04-05 21:48:31 -07:00
46e0d1953b Merge branch 'master' of github.com:Netflix/lemur into powerdnsplugin_02 2020-04-05 21:47:24 -07:00
f82ec24dfa updating _get_txt_records return values and docstrings 2020-04-05 21:46:33 -07:00
5c2a2f8ff2 OAUTH2 fixes
* Use OAUTH2 variable instead of PING while using OAUTH
* Some IDPs require a POST instead of a GET to user data
2020-04-04 11:32:23 -04:00
5add647148 # emitting the count of certificates on the source 2020-04-03 16:51:24 -07:00
274e61cffb Merge branch 'master' into powerdnsplugin_02 2020-04-03 12:59:36 -07:00
9ddfd9f3b1 Merge pull request #2942 from Netflix/dependabot/pip/bleach-3.1.4
Bump bleach from 3.1.2 to 3.1.4
2020-04-03 11:34:09 -07:00
2e1b58c70a Bump bleach from 3.1.2 to 3.1.4
Bumps [bleach](https://github.com/mozilla/bleach) from 3.1.2 to 3.1.4.
- [Release notes](https://github.com/mozilla/bleach/releases)
- [Changelog](https://github.com/mozilla/bleach/blob/master/CHANGES)
- [Commits](https://github.com/mozilla/bleach/compare/v3.1.2...v3.1.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-04-03 18:27:38 +00:00
1dd5d64461 Merge pull request #2935 from Netflix/dependabot/pip/bleach-3.1.2
Bump bleach from 3.1.1 to 3.1.2
2020-04-03 11:24:28 -07:00
c4b1277d3e Merge branch 'master' into dependabot/pip/bleach-3.1.2 2020-04-03 11:09:38 -07:00
e4bba5c6e9 Merge branch 'master' into powerdnsplugin_02 2020-04-01 12:03:18 -07:00
37bdbc0f91 Merge pull request #2940 from Netflix/castrapel-patch-3
No need to retry 25 times on DeleteConflict errors
2020-04-01 14:12:47 -04:00
efb7a33d3e Merge branch 'master' into castrapel-patch-3 2020-04-01 14:03:17 -04:00
577a29db0b Merge pull request #2939 from Netflix/castrapel-patch-2
Bump time limit for clean_source Celery job
2020-04-01 14:03:02 -04:00
77cfa1e55c Merge branch 'master' into dependabot/pip/bleach-3.1.2 2020-04-01 10:55:15 -07:00
b4025e6820 Merge branch 'master' into castrapel-patch-3 2020-04-01 13:55:14 -04:00
9a939e8281 Merge branch 'master' into castrapel-patch-2 2020-04-01 13:54:39 -04:00
2500228d7a Merge pull request #2938 from Netflix/castrapel-patch-1
Remove equivalent destinations when cleaning certificates
2020-04-01 13:54:01 -04:00
d825616ea6 No need to retry 25 times on DeleteConflict errors 2020-04-01 10:53:17 -07:00
e25f97fce7 Bump time limit for clean_source Celery job
For larger accounts, I've hit SoftTimeLimit exceptions before completion of this celery job. Bumping up the time limit on this job.
2020-04-01 10:50:24 -07:00
67d24caef5 Remove equivalent destinations when cleaning certificates
Remove equivalent destinations when cleaning certificates. This will prevent Lemur from attempting to re-upload a certificate after it has been cleaned.
2020-04-01 10:31:12 -07:00
6f3ba23fa0 updating sinlge line of comments 2020-03-30 13:34:24 -07:00
9d9bf9d7ba Merge branch 'powerdnsplugin_02' of github.com:Netflix/lemur into powerdnsplugin_02 2020-03-30 09:02:56 -07:00
d6cc8a8a9a fixing whitespace 2020-03-30 09:01:28 -07:00
66183e6bdd Merge branch 'master' into powerdnsplugin_02 2020-03-27 10:45:15 -07:00
88b14d6ad6 Merge branch 'master' into dependabot/pip/bleach-3.1.2 2020-03-27 10:44:54 -07:00
0c02ddec3c Merge pull request #2936 from hosseinsh/expired-cert
Bugfix:  compare offset-naive and offset-aware datetimes
2020-03-27 10:42:12 -07:00
2b7e60399c Merge branch 'master' into powerdnsplugin_02 2020-03-27 10:27:33 -07:00
0e314d0028 adding documentation and final cleanup 2020-03-27 10:18:38 -07:00
0149f8b0d3 add support for wildcard and naked domains to PowerDNS module 2020-03-26 22:15:10 -07:00
2a2499a929 simplifying code 2020-03-26 20:45:00 -07:00
e4e5bc056b Merge branch 'master' into expired-cert 2020-03-26 19:05:47 -07:00
5206997468 expired is now called for new certs, where the not_after field might be in datetime format, and not comparable to utc 2020-03-26 19:01:07 -07:00
8ba9ae1148 Bump bleach from 3.1.1 to 3.1.2
Bumps [bleach](https://github.com/mozilla/bleach) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/mozilla/bleach/releases)
- [Changelog](https://github.com/mozilla/bleach/blob/master/CHANGES)
- [Commits](https://github.com/mozilla/bleach/compare/v3.1.1...v3.1.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-03-24 16:18:43 +00:00
88c40aa93c Merge branch 'master' into master 2020-03-23 20:31:16 -07:00
001ad3b8d9 Merge pull request #2934 from hosseinsh/expired-cert
better handling of destination plugin errors, and also checking cert …
2020-03-23 12:43:49 -07:00
697215f8bc better handling of destination plugin errors, and also checking cert expiration before upload 2020-03-21 20:05:35 -07:00
edf1f9c6ad Merge branch 'master' of github.com:e11it/lemur 2020-03-20 20:53:40 +03:00
7bd5173da4 Merge with Netflix/lemur master 2020-03-20 20:52:33 +03:00
6049e8f117 Merge branch 'master' into master 2020-03-20 20:44:46 +03:00
eb48e2fe75 Merge pull request #2931 from hosseinsh/new_clean_cert_cli
New clean cert cli
2020-03-18 09:02:52 -07:00
1d4da0e3d8 another polish 2020-03-17 16:59:09 -07:00
ecca003ab4 improving the documentation and method naming 2020-03-17 16:55:36 -07:00
9de89ec96a Merge branch 'master' into new_clean_cert_cli 2020-03-17 13:38:32 -07:00
db3920ed25 Merge pull request #2930 from Netflix/powerdnsplugin_01
Fixing authorization lookup code to fix duplicate domain authorizations bug
2020-03-16 11:49:09 -07:00
07dc31bed7 cleaning up whitespace changes 2020-03-16 11:41:05 -07:00
febc1c270b Merge branch 'powerdnsplugin_01' of github.com:Netflix/lemur into powerdnsplugin_01 2020-03-16 11:25:01 -07:00
1a19e250bb updating and cleaning up tests 2020-03-16 11:24:17 -07:00
34d23503de fixing the data bug 2020-03-14 20:41:03 -07:00
b28b4f9a28 adding to new cli commands for cleaning certificates from source:
a) either about to expire in X days and not attached to an endpoint
a) or issued since X days but still not attached to an endpoint
2020-03-14 20:19:26 -07:00
c96695c966 refactor 2020-03-14 20:18:07 -07:00
593c35776c adding new methods for getting pending clean 2020-03-14 20:17:05 -07:00
cf3298d1ad Merge branch 'master' into powerdnsplugin_01 2020-03-13 00:26:41 -07:00
09ce55efcd Merge branch 'powerdnsplugin_01' of github.com:Netflix/lemur into powerdnsplugin_01 2020-03-13 00:23:10 -07:00
921d52b360 fixing get_dns_challenge() logic so duplicate domains (such as wildcard and not wildcard) do not match the wrong authorziations 2020-03-13 00:03:31 -07:00
be722fb1b3 Fix lint 2020-03-11 20:51:10 +03:00
92a8942727 Fix lint 2020-03-11 15:37:11 +03:00
a6c3b85fe1 Fix lint 2020-03-11 15:15:56 +03:00
ba8e315eed Fix typo 2020-03-11 14:22:04 +03:00
729ed3843d Fix bug wth get_options and slash in name 2020-03-11 14:16:29 +03:00
d3cb0b517a Add format support 2020-03-11 02:27:31 +03:00
ad86cf1fd9 Merge remote-tracking branch 'upstream/master' 2020-03-11 00:29:07 +03:00
790367ea5a Update lemur.conf.py
ALLOW_CERT_DELETION from env
2020-03-10 13:46:59 +03:00
cd7adacca3 Merge pull request #2929 from Netflix/powerdnsplugin_01
fixing formatting of POWER_DNS_VERIFY documentation
2020-03-05 17:01:52 -08:00
df596be5cf Merge branch 'master' into powerdnsplugin_01 2020-03-05 16:54:57 -08:00
027580cade Merge branch 'powerdnsplugin_01' of github.com:Netflix/lemur into powerdnsplugin_01 2020-03-05 16:52:38 -08:00
6227e4aa89 fixing formatting of ACME_POWERDNS_VERIFY options 2020-03-05 16:51:21 -08:00
5fc62aff7e Merge pull request #2928 from Netflix/powerdnsplugin_01
Add Support for ACME_POWERDNS_VERIFY Option
2020-03-05 15:46:44 -08:00
e1e7efc96e Merge branch 'master' into powerdnsplugin_01 2020-03-05 15:25:40 -08:00
771e72187a updates based on feedback 2020-03-05 15:24:56 -08:00
b85fe2f2b5 updated documentation language 2020-03-05 15:03:43 -08:00
5dfb6acb17 adding support for ACME_POWERDNS_VERIFY option to support CA Bundles and disabling Server validation 2020-03-05 14:59:21 -08:00
3c24c22890 Merge pull request #2927 from Netflix/validity_gui_update_01
removing 2 year option from Lemur certificate request form
2020-03-04 15:21:47 -08:00
c0004e506e removing 2 year option from Lemur certificate request form 2020-03-04 14:50:44 -08:00
509523b9ee Merge pull request #2926 from Netflix/powerdns_doc_update_01
adding documentation for DIGICERT_MAX_VALIDITY
2020-03-04 11:53:48 -08:00
9ef538305d updating default language for digicert max validity option 2020-03-04 11:46:23 -08:00
72a0552073 Merge branch 'master' into powerdns_doc_update_01 2020-03-04 11:11:32 -08:00
4a4b3b932e Merge branch 'master' into master 2020-03-04 10:32:10 -08:00
a873d69859 adding documentation for DIGICERT_MAX_VALIDITY 2020-03-03 18:24:48 -08:00
38a7f3d43e Merge pull request #2925 from Netflix/renewal_validity_01
adding default/max DigiCert validity dates
2020-03-03 17:36:46 -08:00
1e81d47793 Merge branch 'renewal_validity_01' of github.com:Netflix/lemur into renewal_validity_01 2020-03-03 17:28:58 -08:00
fdc1e20c23 updating config_mock defaults 2020-03-03 17:27:15 -08:00
38b7d6e5e3 Merge branch 'master' into renewal_validity_01 2020-03-03 14:44:33 -08:00
6c46481ffd simplifying return statement for validity years 2020-03-03 14:40:50 -08:00
318292704d fixing default/max DigiCert validity values 2020-03-03 14:29:17 -08:00
6ed70eb9eb Merge pull request #2 from e11it/fix_san_duplicate
Fix: San values #2921
2020-03-03 21:45:55 +03:00
27a86f5c18 Fix: San values #2921
Not sure is it correct solution
2020-03-03 21:45:33 +03:00
462099d906 Merge pull request #1 from e11it/e11it-patch-1
Update plugin.py
2020-03-02 09:18:26 +03:00
fe67ff2146 Update plugin.py
Fix lint
2020-03-02 09:18:02 +03:00
a8c0adaa4d Merge remote-tracking branch 'upstream/master' 2020-02-27 17:08:35 +03:00
5fb3da8bec Add certificate reissue to cron 2020-02-27 11:24:35 +03:00
a584aeb7eb User lemur instead manage.py 2020-02-26 20:12:53 +03:00
ce69d47b8b Fix 2020-02-26 19:43:16 +03:00
4df64a87e5 Merge pull request #2920 from Netflix/dependabot/pip/bleach-3.1.1
Bump bleach from 3.1.0 to 3.1.1
2020-02-24 13:15:11 -08:00
64a7faffd9 Bump bleach from 3.1.0 to 3.1.1
Bumps [bleach](https://github.com/mozilla/bleach) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/mozilla/bleach/releases)
- [Changelog](https://github.com/mozilla/bleach/blob/master/CHANGES)
- [Commits](https://github.com/mozilla/bleach/compare/v3.1.0...v3.1.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-02-24 18:30:10 +00:00
2bcb842d93 Merge branch 'master' into fix-cves 2020-02-20 13:42:00 -08:00
1430ac5395 fix 2020-02-18 19:54:41 +03:00
ccb811516c Add dockerfile to build from repo 2020-02-18 19:43:48 +03:00
9612d291ed Add path suffix options 2020-02-18 19:16:27 +03:00
9c56d603ce Merge pull request #2916 from Netflix/le_Log_orderurl
Log certificate issuance success and metrics.
2020-02-17 12:57:00 -08:00
2ee60bcdb6 Merge branch 'master' into le_Log_orderurl 2020-02-17 10:30:58 -08:00
0c95ec3bdf Merge pull request #2918 from sirferl/master
Added VERISIGN_INTERMEDIATE_<authority> parameter
2020-02-17 10:30:43 -08:00
e75df1ddc9 Update plugin.py 2020-02-17 19:04:20 +01:00
d29edabefe Merge branch 'master' into le_Log_orderurl 2020-02-17 09:24:51 -08:00
ed3472d029 Update plugin.py 2020-02-17 15:21:29 +01:00
aa5200b85f Merge branch 'master' into master 2020-02-17 15:04:04 +01:00
3fd0d3e141 Added VERISIGN_INTERMEDIATE_<authority> parameter
When using the VERISIGN_PRODUCT_<authority> Parameter one also has to add this parameter:
VERISIGN_INTERMEDIATE_<authority> = """ <PEM-String of Issuing CA for this certificate Type>""" 
While doing this, I also added code, so the external_id field is filled with data from CA-Answer
2020-02-17 12:40:36 +01:00
0d76690091 Merge pull request #2917 from sirferl/master
New variable VERISIGN_PRODUCT_(authority.name)
2020-02-16 15:38:42 -08:00
1815c89970 Made the change more elegant
As suggested by @hosseinsh. This is of course more elegant.
2020-02-16 09:28:52 +01:00
a70a49e4e9 Update plugin.py 2020-02-15 16:11:58 +01:00
3693bc2d8b removed whitespaces inserted by online editor 2020-02-15 16:09:25 +01:00
bfa953270d Fixed whitespace error 2020-02-15 16:04:44 +01:00
ac95f1cc33 Merge branch 'master' into master 2020-02-15 15:55:28 +01:00
fabcad1e46 New variable VERISIGN_PRODUCT_(authority.name)
If there is a config variable with VERISIGN_PRODUCT_<upper(authority.name)> take the value as Cert product-type
else default to "Server", to be compatoible with former versions.
This enables the use of different Verisign authorities for differnt cert-products eg. EV or Standard Certs
2020-02-15 15:52:24 +01:00
a8e8924e2a Merge branch 'master' into le_Log_orderurl 2020-02-14 17:10:38 -08:00
bde3d1ac66 Merge pull request #2914 from sirferl/master
Fixing kubernetes and verisign plugin
2020-02-14 09:34:34 -08:00
8e3cc93d6a Whitespaces in empty line 113 removed 2020-02-14 07:50:18 +01:00
b521aaf579 Merge branch 'master' into le_Log_orderurl 2020-02-13 16:41:14 -08:00
af21225918 adding logging on sucess and metric submission of URL for certificate issuance 2020-02-13 16:38:33 -08:00
a449cc2b15 Merge branch 'master' into ilabun/optimize-certificates-sql 2020-02-13 16:05:46 -08:00
2b849a6520 Update plugin.py
making lint happy
2020-02-13 15:58:07 -08:00
9db1ea3307 Merge branch 'master' into master 2020-02-13 12:47:06 -08:00
5c4b36fd5f Merge pull request #2915 from Netflix/powerdnsplugin_01
fixed get_domains() to remove duplicate entries, updated usage and tests
2020-02-13 12:45:53 -08:00
571c8bf42d Error when validity_end date is empty #2905
this lines of code (114ff) in threw an error, when the validity_end date was empty:

if options.get("validity_end") > arrow.utcnow().shift(years=2):
raise Exception(
"Verisign issued certificates cannot exceed two years in validity"
)

Actually, they are not needed, because immidiately following is a check for an empty validity_end and for the length of the entered period.
When I commented it out for testing, the error was gone and everything worked as expected.
2020-02-13 07:38:04 +01:00
6c7bb5f9b7 Fixed TLS secret format ( #2913 )
The Plugin handled the TLS secret format wrong: it sent chain certificate instead of requested public certificate #2913
2020-02-13 07:35:35 +01:00
14edd1bd4f Merge pull request #3 from Netflix/master
Fixing kubernetes and verisign plugin
2020-02-13 07:31:08 +01:00
ca8e73286f fixed get_domains() to remove duplicate entries, updated usage and tests 2020-02-12 15:10:24 -08:00
d69c83e5c8 Merge pull request #2912 from Netflix/powerdns_doc_update_01
Add Documentation for PowerDNS Plugin
2020-02-10 11:31:18 -08:00
1e4d4b9413 Merge branch 'master' into fix-cves 2020-02-10 11:23:58 -08:00
2d7284f677 Merge branch 'master' into ilabun/optimize-certificates-sql 2020-02-10 11:23:21 -08:00
c575ed5c79 Merge branch 'master' into powerdns_doc_update_01 2020-02-10 11:22:55 -08:00
7dd2a3c269 Merge pull request #2883 from rohanmehto2/vault-k8s-auth
implemented #2882 k8s auth for vault
2020-02-10 11:22:36 -08:00
98cffb6c79 Merge branch 'master' into fix-cves 2020-02-10 11:15:26 -08:00
c0cf1c02c1 Merge branch 'master' into ilabun/optimize-certificates-sql 2020-02-10 11:14:26 -08:00
b23ae60847 Merge branch 'master' into vault-k8s-auth 2020-02-10 11:12:52 -08:00
77cec4fde9 Fix ssl env. Add issuer and authority 2020-02-05 19:11:36 +03:00
e379e34212 Merge branch 'master' into powerdns_doc_update_01 2020-02-04 18:36:37 -08:00
b9736dfd3f Merge pull request #2911 from Netflix/powerdnsplugin_01
Add PowerDNS ACME Plugin
2020-02-04 18:36:11 -08:00
bcdb3173bd ensuring that "3" is set as an integer instead of a string 2020-02-04 18:23:17 -08:00
5324290234 updating documentation based on feedback 2020-02-04 16:23:53 -08:00
8ea54d7db2 removing exception if domain zone not found. Logging the issue instead 2020-02-04 14:50:56 -08:00
48bccd6f68 moving _check_config() lower in file, near other private methods 2020-02-03 19:08:28 -08:00
c38e651eb0 Merge branch 'powerdnsplugin_01' of github.com:Netflix/lemur into powerdnsplugin_01 2020-02-03 19:04:05 -08:00
53f81fb09f updating based on suggestions in 2911 2020-02-03 18:58:31 -08:00
5e8599540e Merge branch 'master' into ilabun/optimize-certificates-sql 2020-02-03 20:32:41 +01:00
ac0282529e adding basic logging on success 2020-02-03 11:05:20 -08:00
7dac0e1dd8 Update administration.rst 2020-01-31 16:54:25 -08:00
fecb5b6252 Merge branch 'master' into powerdnsplugin_01 2020-01-31 16:37:57 -08:00
fb6d369130 removed unnecessary imports in test_dns_providers.py 2020-01-31 16:18:22 -08:00
fe2b13becb Merge branch 'master' into fix-cves 2020-01-31 16:15:44 -08:00
a4475ad2a3 Merge pull request #2910 from e11it/Fix-Docker
Fixes and enhancements of docker image
2020-01-31 15:30:46 -08:00
e9404aa06b Merge branch 'master' into Fix-Docker 2020-01-31 13:18:43 -08:00
02757359f0 Merge pull request #2907 from Netflix/fix_write_domains_on_failure_01
fixing issue where set_domains() is still called when get_all_zones()…
2020-01-31 13:18:00 -08:00
be7736d350 adding dns tests and assorted exception handling 2020-01-31 13:16:37 -08:00
75d4699c7a Fix nginx ssl. Add env vars. Opt docker 2020-01-31 22:52:59 +03:00
139769edea Merge branch 'master' into fix_write_domains_on_failure_01 2020-01-29 16:03:30 -08:00
30ab0bcdbe Merge pull request #2908 from Netflix/pip_import_fix_01
adding support for pip version >=19.3 by supporting change to PipSess…
2020-01-29 15:56:13 -08:00
48d8e1d235 adding support for pip version >=19.3 by supporting change to PipSession() location in setup.py 2020-01-29 15:30:08 -08:00
969a7107fe fixed PowerDNS Tests 2020-01-29 13:12:09 -08:00
b885244aa7 fixing issue where set_domains() is still called when get_all_zones() throws an exception 2020-01-29 11:26:53 -08:00
ef115ef2b1 moving PowerDNS number_of_attempts to global config variable ACME_POWERDNS_RETRIES 2020-01-29 11:20:39 -08:00
f3039a1210 removed accidently added __init__py file 2020-01-29 11:05:46 -08:00
b91899fe99 created CLI options for testin ACME over dns. Examle: acme dnstest -d _acme-chall.foo.com -t token1 2020-01-28 19:13:28 -08:00
9576fa4b0f Merge pull request #2906 from hosseinsh/logging-get-dns
DNS provider: adding more logging
2020-01-28 16:34:48 -08:00
192ecb3ce0 DNS provider: adding more logging 2020-01-28 16:24:50 -08:00
980360b94a patch gulp-less 2020-01-27 14:09:57 -06:00
7a2ca8969e patch gulp-imagemin 2020-01-27 14:08:22 -06:00
a0a8c155f6 patch gulp-protractor 2020-01-27 13:59:41 -06:00
0129e97dfe address karma CVEs 2020-01-27 13:56:24 -06:00
127f7c1582 Merge pull request #2893 from sirferl/master
Fxing Issue #2831
2020-01-27 09:11:38 -08:00
620f972635 Fixed an error
Found out that I introduced an error when I changed code up for publishig. The certserv.py I use does not return the ID of the certificate created. For now I just leave the field empty. I will create another issue , so that the ID is filled up.
2020-01-27 11:04:49 +01:00
6248cbb902 Merge pull request #2 from Netflix/master
Fxing Issue #2831
2020-01-27 10:59:03 +01:00
5d8eb51ef4 Merge branch 'master' into ilabun/optimize-certificates-sql 2020-01-24 11:28:55 +01:00
c465062673 integrated PowerDNS plugin into dns_providers 2020-01-23 23:53:38 -08:00
21c651a566 Merge pull request #2891 from rajatsharma94/bugfix
fix fatal error in schema validator
2020-01-23 08:49:46 -08:00
9984470b58 fix fatal error in schema validator 2020-01-23 15:27:02 +01:00
bddae6e428 adding PowerDNS delete_txt_record with associated tests 2020-01-22 16:18:52 -08:00
52c7686d58 adding wait_for_dns_change() and tests for PowerDNS ACME plugin 2020-01-21 18:47:21 -08:00
915ec0ba63 added PowerDNS support for create_txt_record and associated tests 2020-01-21 17:08:59 -08:00
99f46c1add Merge pull request #2890 from Gutttlt/patch-1
Fixing "'Role' object has no attribute 'set_third_party'" error on LDAP authentication.
2020-01-21 08:17:30 -08:00
71f43dfcc1 Fixing "'Role' object has no attribute 'set_third_party'" error. 2020-01-21 08:40:54 +01:00
e159e2f3d8 Merge branch 'master' into ilabun/optimize-certificates-sql 2020-01-20 15:41:46 -08:00
3ef2f97967 Merge branch 'master' into vault-k8s-auth 2020-01-20 15:41:38 -08:00
d9990bc075 Merge pull request #2885 from ilyalabun/ilabun/fix-docker-compose-tests
Fix Dockerfile for tests
2020-01-20 15:41:14 -08:00
b10e68df35 Merge branch 'master' into vault-k8s-auth 2020-01-21 01:32:37 +02:00
5293fac125 Merge branch 'master' into ilabun/fix-docker-compose-tests 2020-01-20 15:22:31 -08:00
ca61857dcf Merge pull request #2886 from pmelse/pmelse-workaround-#2857
update for #2857 workaround
2020-01-20 15:19:27 -08:00
acf531ece3 Merge branch 'master' into vault-k8s-auth 2020-01-20 15:18:29 -08:00
6ee856e26d Merge branch 'master' into ilabun/optimize-certificates-sql 2020-01-20 15:15:25 -08:00
2cfe5437d9 Merge branch 'master' into ilabun/fix-docker-compose-tests 2020-01-20 15:15:03 -08:00
6d06f3ca6f Merge branch 'master' into pmelse-workaround-#2857 2020-01-20 15:14:03 -08:00
9b1317f4a4 Merge pull request #2889 from hosseinsh/better-string-formatting
improved string formatting to  avoid dangling white spaces and new lines
2020-01-20 14:53:46 -08:00
3080a9527c adding PowerDNS get_zones functionality and unit tests 2020-01-17 18:29:37 -08:00
7f119b8914 Merge branch 'master' into ilabun/optimize-certificates-sql 2020-01-17 17:18:06 -08:00
cb7507156c Merge branch 'master' into vault-k8s-auth 2020-01-17 17:17:53 -08:00
3b393dec6d Merge branch 'master' into ilabun/fix-docker-compose-tests 2020-01-17 17:17:06 -08:00
d6f41b6a99 improving string formatting to avoid dangling white spaces and new lines 2020-01-16 13:45:13 -08:00
7f73417bda Merge pull request #2887 from hosseinsh/issuer-default-hash-algo
possibility to default to a SIGNING_ALGORITHM for a given profile
2020-01-15 16:37:20 -08:00
1ed6ae539d # possibility to default to a SIGNING_ALGORITHM for a given profile 2020-01-15 16:19:48 -08:00
58d8a145c3 update for #2857 workaround
update for #2857 workaround
2020-01-13 22:13:30 -05:00
cd7d9aee55 fixed lint error 2020-01-13 23:09:58 +02:00
8d957f22af changed file handling 2020-01-13 22:46:34 +02:00
78f9c490dd Fix Dockercompose for tests 2020-01-13 15:26:35 +01:00
bc1a2cf69c Optimize certificates SQL query
Co-authored-by: Javier Ramos <javier.ramos@booking.com>
2020-01-13 14:43:41 +01:00
cc0b2d5439 Added new lowercase indexes for certificates cn, name and domains name
Co-authored-by: Javier Ramos <javier.ramos@booking.com>
2020-01-13 14:40:22 +01:00
cad56c813e fixed lint error 2020-01-12 01:51:48 +02:00
409b499217 added kubernetes auth for vault 2020-01-12 01:25:22 +02:00
a65c4c94a0 Merge pull request #2881 from rohanmehto2/cfssl-key-fix
fix for #2879 cfssl-key TypeError
2020-01-09 10:50:01 -08:00
348682d5ea Merge branch 'master' into cfssl-key-fix 2020-01-09 10:44:02 -08:00
9f35d740d2 Merge pull request #2880 from hosseinsh/improved-expiry-email-notification
Improved messaging to point out to the Auto Rotate option for certifi…
2020-01-09 10:43:33 -08:00
8be8c95b17 handled cfssl-key type error 2020-01-09 15:16:19 +02:00
1537d591a8 Improved messaging to point out to the Auto Rotate option for certificate issuance and renewal. 2020-01-08 14:42:16 -08:00
8e04aa1bd3 Merge pull request #2875 from ilyalabun/master
Eliminate SQL subqueries when showing certificates list
2020-01-06 11:15:31 -08:00
f446fcc1c2 Merge branch 'master' into master 2020-01-03 14:20:02 -08:00
deaac42dba Merge pull request #2878 from hosseinsh/update-reqs-03Jan2019
updating requirements
2020-01-03 14:19:49 -08:00
1ccc15859f updating requirements.
removing this pin, since the issue is now resolved.
kombu<4.6.0 # Bug with inspecting active tasks: https://github.com/celery/kombu/issues/1051
2020-01-03 14:14:01 -08:00
9b9662d470 Merge branch 'master' into master 2020-01-03 13:15:58 -08:00
ebc48ae304 Merge pull request #2876 from pmelse/master
updated permission fix for sftp plugin if certificate is set read-only
2020-01-03 13:14:38 -08:00
45c1207d07 Merge branch 'master' into master 2019-12-27 13:30:56 -05:00
9fb4be1273 remove trailing whitespace 2019-12-27 13:25:03 -05:00
189e8b2725 Eliminate subqueries when showing certificates list 2019-12-20 10:37:47 +01:00
f10121c343 Merge pull request #2874 from nbischof/patch-1
type on quickstart/index.rst
2019-12-02 08:17:56 -08:00
f188aea2c2 type on quickstart/index.rst 2019-12-02 06:22:09 -05:00
805d6942ae Merge pull request #2873 from zarfide/permalinkOptimization_jzarfoss
used fixedName variable to transport db lookup optimization
2019-11-20 10:40:34 -08:00
00a0a27826 used fixedName variable to transport db lookup optimization 2019-11-20 09:44:31 -08:00
93aca891b7 Merge pull request #2872 from zarfide/PS-2522-atlas-redis
Ps 2522 atlas redis
2019-11-06 12:39:19 -08:00
113c9dd657 atlas redis plugin typo cleanup and better exception handling 2019-11-06 10:42:59 -08:00
f803fab413 add plugin to send atlas metric via redis 2019-11-06 10:14:49 -08:00
77fdc8795b Merge pull request #2870 from hosseinsh/cert-sync-endpoint-find-by-hash
missed edge case
2019-10-18 15:53:11 -07:00
0d983bd2b5 missed edge case 2019-10-18 15:39:36 -07:00
f077b19126 Merge branch 'master' into master 2019-10-18 11:32:21 -07:00
da1080e041 Merge pull request #2869 from hosseinsh/cert-sync-endpoint-find-by-hash
Cert sync endpoint find by hash
2019-10-18 11:29:57 -07:00
06f4aed693 keeping track of certs found by hash 2019-10-18 11:21:29 -07:00
11f9920ff9 Merge branch 'master' into cert-sync-endpoint-find-by-hash 2019-10-18 11:08:51 -07:00
2418c3eb0a Merge pull request #2868 from hosseinsh/acme-client-setup-retrial
ACME-clientsetup-retrial
2019-10-18 11:08:31 -07:00
14e13b512e providing a count for conflicts 2019-10-18 11:03:28 -07:00
9037f88430 just in case the path varies 2019-10-18 11:02:41 -07:00
1768aad9e2 capturing no such entity exception. 2019-10-18 10:17:58 -07:00
8aea257e6a optimizing the call to describe cert to only the few certs with the naming issue 2019-10-18 09:24:49 -07:00
f075c5af3d in case no cert match via name-search, search via the cert itself (serial number, hash comparison) 2019-10-18 08:48:11 -07:00
d43e859c34 describing the cert for each endpoint, for better cert search 2019-10-18 08:46:01 -07:00
10b600424e refactoring searching for cert 2019-10-18 08:45:32 -07:00
b5ab87877b adding retry to acme setup client, since it can experience timeouts or other types of Connection Errors 2019-10-17 10:16:33 -07:00
356d3ee9f3 Merge pull request #2866 from Netflix/dependabot/pip/ecdsa-0.13.3
Bump ecdsa from 0.13.2 to 0.13.3
2019-10-15 16:26:39 -07:00
fea37ba101 Merge branch 'master' into dependabot/pip/ecdsa-0.13.3 2019-10-15 15:56:59 -07:00
9d7ab27977 Merge pull request #2865 from hosseinsh/up-dependencies-20191015
updating requirements
2019-10-15 15:56:48 -07:00
a076497cf0 Bump ecdsa from 0.13.2 to 0.13.3
Bumps [ecdsa](https://github.com/warner/python-ecdsa) from 0.13.2 to 0.13.3.
- [Release notes](https://github.com/warner/python-ecdsa/releases)
- [Changelog](https://github.com/warner/python-ecdsa/blob/master/NEWS)
- [Commits](https://github.com/warner/python-ecdsa/compare/python-ecdsa-0.13.2...python-ecdsa-0.13.3)

Signed-off-by: dependabot[bot] <support@github.com>
2019-10-15 22:49:30 +00:00
6f96a8f5b0 updating requirements 2019-10-15 15:47:21 -07:00
f0652ca6a9 bug fix for overwriting certificates 2019-10-10 15:49:31 -04:00
2239b68e0e Merge pull request #2854 from hosseinsh/nlb-naming-bug
With NLBs the DNS formatting has changed, which resulted in Lemur not…
2019-09-23 13:23:43 -07:00
477db836f4 lint 2019-09-23 12:52:17 -07:00
86f661a8af With NLBs the DNS formatting has changed, which resulted in Lemur not getting the region correctly parsed 2019-09-23 12:36:08 -07:00
4e7e81aee8 Merge pull request #2853 from hosseinsh/up-dependencies-20Sep2019
updating dependencies, and fixing the deprecated arrow.replaces to shift
2019-09-20 15:34:55 -07:00
96b2149433 removing unintended commit 2019-09-20 15:22:45 -07:00
8c9a1df2cf Merge branch 'master' into up-dependencies-20Sep2019 2019-09-20 15:19:25 -07:00
a13c45e9cc updating dependencies, and fixing the deprecated arrow.replaces to shift 2019-09-20 13:49:38 -07:00
0c70e5c3fd Merge pull request #2852 from hosseinsh/cert-year-validity
removing 3 and 4 years from validity range options
2019-09-20 10:23:47 -07:00
c669cd23f0 Merge branch 'master' into check-revoke-revised 2019-09-20 10:22:04 -07:00
972051a61e removing 3 and 4 years from validity range options 2019-09-20 10:16:23 -07:00
9b2a1bebd1 Merge pull request #2849 from hosseinsh/better-metrics-endpoints
adding account number for better logging, since the endpoint is not a…
2019-08-21 10:13:02 -07:00
d0e8666267 Merge branch 'master' into better-metrics-endpoints 2019-08-21 10:01:00 -07:00
cb966a0204 Merge pull request #2848 from jramosf/patch-1
Show number of found items in pager
2019-08-21 10:00:46 -07:00
db91e48395 adding account number for better logging, since the endpoint is not available in Lemur DB 2019-08-21 09:54:18 -07:00
e5e395f0d9 Show number of found items in pager
This commit does not involve any additional query as the data is already in API calls' responses
2019-08-20 09:29:58 +02:00
18f42d2349 Merge pull request #2847 from hosseinsh/better-metrics-endpoints
metric for missing certificate from an endpoint
2019-08-15 19:20:33 -07:00
9b04d901c4 metric for missing certificate from an endpoint 2019-08-15 19:14:08 -07:00
f09643f350 Merge branch 'master' into check-revoke-revised 2019-08-15 11:15:24 -07:00
24698516fc Merge pull request #2846 from castrapel/better_dns_autodetection
Allow better DNS autodetection for domains that directly match a DNS zone
2019-08-15 11:15:15 -07:00
1c6fee7292 Allow better DNS autodetection for domains that directly match a DNS hosted zone 2019-08-15 10:52:26 -07:00
68abf11be8 Merge branch 'master' into check-revoke-revised 2019-08-13 20:09:27 -07:00
0e31e708e3 Merge pull request #2843 from hosseinsh/soft_time_outs
adding soft time outs for celery
2019-08-13 20:06:12 -07:00
296a315a3e Merge branch 'master' into soft_time_outs 2019-08-13 19:42:22 -07:00
b6486d85ba Merge pull request #2845 from hosseinsh/prevent-duplicate-celery-tasks
preventing celery duplicate tasks
2019-08-13 19:42:11 -07:00
ceb2d3d796 Merge branch 'master' into check-revoke-revised 2019-08-13 14:07:57 -07:00
2de3f287ab standardizing the timeouts to easier monitor any timeouts 2019-08-13 12:21:27 -07:00
6e17d36d76 typos 2019-08-13 12:16:23 -07:00
22c60fedad cosmetics 2019-08-13 12:11:04 -07:00
a3dfc3ef0a consistency 2019-08-13 11:58:58 -07:00
c29f282560 improved the flow for checking if the task is active 2019-08-13 11:52:56 -07:00
4d728738ee handling celery tasks without any arguments 2019-08-13 11:42:43 -07:00
07a9c56fb8 making lint happy 2019-08-13 09:35:57 -07:00
bf47f87c21 preventing celery duplicate tasks 2019-08-12 13:52:01 -07:00
95086e08dc Merge pull request #2839 from kush-bavishi/ultradnsPlugin
Ultradns plugin
2019-08-09 08:59:11 -07:00
5d4413e45c Merge branch 'master' into ultradnsPlugin 2019-08-09 08:48:24 -07:00
0711ba9c04 Merge pull request #2841 from hosseinsh/multi-profile-digicert-plugin
Multi profile digiCert plugin
2019-08-09 07:42:17 -07:00
83159c2417 Merge branch 'master' into multi-profile-digicert-plugin 2019-08-09 07:32:33 -07:00
d2c7330fb7 Merge pull request #2844 from hosseinsh/fixing-metric-bug
fixing metric bug
2019-08-09 00:20:40 -07:00
da9c91afb4 fixing metric bug 2019-08-08 17:56:22 -07:00
3b9b94623f cleaning up 2019-08-07 18:06:59 -07:00
8340e0653b making lint happy 2019-08-07 18:04:28 -07:00
d1519343d1 improving check revoked by only considering authorities which do support revocation and also only including not expired certs 2019-08-07 17:54:10 -07:00
9a02230d63 adding soft time outs for celery 2019-08-07 17:48:06 -07:00
d9aef2da3e Changed dummy nameserver value 2019-08-07 14:38:18 -07:00
a97283f0a4 Fixed indentation 2019-08-07 14:23:09 -07:00
a6bf081bec Remove unused import 2019-08-07 14:08:27 -07:00
43f5c8b34e Fixed indentation 2019-08-07 14:08:06 -07:00
cadf372f7b Removed hardcoded value from function call 2019-08-07 14:02:10 -07:00
b4f4e4dc24 Added extra check for return value to test_create_txt_record 2019-08-07 13:55:02 -07:00
fa7f71d859 Modified paginate response to dummy values 2019-08-07 13:53:10 -07:00
3ff56fc595 Blank line removed 2019-08-07 13:42:11 -07:00
894502644c test_wait_for_dns_change fixed! 2019-08-07 13:39:20 -07:00
37a1b55b08 test_delete_txt_record changed to mock get_zone_name and return the value directly instead of executing the function. 2019-08-07 13:27:21 -07:00
31c2d207a2 test_delete_txt_record fixed. Function call was missing earlier 2019-08-07 13:23:05 -07:00
785c1ca73e test_create_txt_record modified - get_zone_name mocked to return the zone name directly, instead of actually running the function. 2019-08-07 13:20:24 -07:00
f2cbddf9e2 Unit tests for get_zone_name, get_zones 2019-08-07 13:17:16 -07:00
6e84e1fd59 Unit Tests for create_txt_record, delete_txt_record, wait_for_dns_change 2019-08-07 13:04:38 -07:00
ff1f73f985 fixing the plugin test to include authority 2019-08-07 12:05:36 -07:00
bbda9b1d6f making sure to handle when no config file provided, though we do a check for that 2019-08-07 12:05:13 -07:00
e2ea2ca4d1 providing sample config 2019-08-07 11:05:07 -07:00
b885cdf9d0 adding multi profile name support with DigiCert plug.
This requires that the configs are a dict, with multiple entries, where the key is the name of the Authority used to issue certs with.

DIGICERT_CIS_PROFILE_NAMES = {"sha2-rsa-ecc-root": "ssl_plus"}
DIGICERT_CIS_ROOTS = {"root": "ROOT"}
DIGICERT_CIS_INTERMEDIATES = {"inter": "INTERMEDIATE_CA_CERT"}

Hence, in DB one need to add
1) the corresponding authority table, with digicert-cis-issuer. Note the names here are used to mapping in the above config
2) the corresponding intermediary in the certificate table , with root_aurhority_id set to the id of the new authority_id
2019-08-07 10:24:38 -07:00
a7c2b970b0 Unit testing Part 1 2019-08-05 14:00:22 -07:00
ad6c38960a Merge branch 'master' into ultradnsPlugin 2019-07-31 16:05:36 -07:00
2903799b85 Changed string formatting from "{}".format() to f"{}" for consistency 2019-07-31 14:19:49 -07:00
bbc3bf513d Merge pull request #2837 from hosseinsh/moving-cronjobs-to-celery-v2
moving all cron jobs to become celery jobs
2019-07-31 14:11:25 -07:00
e8e4f826ea updating logging format 2019-07-31 13:09:31 -07:00
5a401b2d87 Added the Zone class and Record class to ultradns.py and removed the respective files 2019-07-31 12:04:42 -07:00
fe075dc9f5 Changed function comments to doc strings. 2019-07-31 12:00:31 -07:00
503df999fa Updated metrics.send to send function named, followed by status, separated by a period 2019-07-31 11:32:04 -07:00
11cd095131 Reduced the number of calls to get_public_authoritative_nameserver by using a variable 2019-07-31 11:12:28 -07:00
3ba7fdbd49 Updated logger to log a dictionary instead of a string 2019-07-31 11:11:39 -07:00
0f591e9a3d Merge branch 'master' into moving-cronjobs-to-celery-v2 2019-07-30 14:13:59 -07:00
6bf920e66c Merge branch 'master' into ultradnsPlugin 2019-07-30 14:13:45 -07:00
0be80e156a Merge pull request #2834 from hosseinsh/better-error-handling-dyn
metric tags, to be able to track which domains where failing during t…
2019-07-30 13:38:12 -07:00
7810095796 Merge branch 'master' into better-error-handling-dyn 2019-07-30 13:27:43 -07:00
ff933ba1aa Merge pull request #2833 from hosseinsh/redis-better-error-handling_
better error handling for redis
2019-07-30 13:27:33 -07:00
44bc562e8b Update ultradns.py
Minor logging changes in wait_for_dns_change
2019-07-30 13:08:16 -07:00
30e4f5032b Merge branch 'master' into moving-cronjobs-to-celery-v2 2019-07-30 11:44:24 -07:00
ffdd06ec07 Merge branch 'master' into better-error-handling-dyn 2019-07-30 11:43:56 -07:00
bec4416185 Merge branch 'master' into redis-better-error-handling_ 2019-07-30 11:43:49 -07:00
b17da52ead Merge branch 'master' of https://github.com/kush-bavishi/lemur into ultradnsPlugin 2019-07-30 11:40:20 -07:00
3d48b422b5 Removed TODO 2019-07-30 11:39:35 -07:00
0ec8fe05ea Merge pull request #2838 from hosseinsh/fixing-makeFile
lemur is one level deep than makefile
2019-07-30 10:41:29 -07:00
244aa069f0 lemur is one level deep than makefile 2019-07-30 10:32:09 -07:00
a89cbe9332 moving all cron jobs to become celery jobs 2019-07-30 09:57:15 -07:00
3ad791e1ec Dynamically obtain the authoritative nameserver for the domain 2019-07-29 18:01:28 -07:00
e993194b4f Check ultraDNS authoritative server first. Upon success, check Googles DNS server. 2019-07-29 14:59:28 -07:00
adabe18c90 metric tags, to be able to track which domains where failing during the LetsEncrypt domain validation 2019-07-25 18:56:28 -07:00
429e6a967c better error handling for redis 2019-07-25 18:49:19 -07:00
252410c6e9 Updated TTL from 300 to 5 2019-07-22 16:00:20 -07:00
51f3b7dde0 Added the Record class for UltraDNS 2019-07-22 14:23:40 -07:00
0b52aa8c59 Added Zone class to handle ultradns zones 2019-07-22 11:47:48 -07:00
5c1bc72af8 Merge pull request #2825 from arnydo/docs_adcs
Add ADCS Plugin to Docs
2019-07-18 17:16:53 -07:00
41cf1335d2 Merge branch 'master' into docs_adcs 2019-07-18 17:04:09 -07:00
3beaedc2fa Merge pull request #2832 from hosseinsh/metrics-tags
fixing metrics: source is not dict
2019-07-18 17:03:25 -07:00
004df84c6d Merge branch 'master' into docs_adcs 2019-07-18 16:54:03 -07:00
36ebba6491 source is not dict 2019-07-18 15:16:01 -07:00
e37a7c775e Initial commit for the UltraDNS plugin to support Lets Encrypt 2019-07-18 14:29:54 -07:00
ee151bdc43 Merge pull request #2828 from hosseinsh/improved-logging-alerting-v2
Improved logging alerting v2
2019-07-17 11:33:45 -07:00
a3706594fc Merge branch 'master' into improved-logging-alerting-v2 2019-07-17 11:20:55 -07:00
d199819d66 Merge pull request #2829 from hosseinsh/update-reqs-20190712
updating requirements
2019-07-17 09:54:41 -07:00
09c0fa0f94 updating the function declaration 2019-07-16 17:21:01 -07:00
54ecda4e1a updating fakeredis 2019-07-16 09:09:12 -07:00
0ed00c5011 updating test requirement 2019-07-16 09:01:04 -07:00
cd1aeb15f1 adding testing for redis 2019-07-12 11:50:12 -07:00
ae1633b0f2 updating requirements
has been a while since last update, more testing in deployment needed
2019-07-12 10:38:47 -07:00
1b1bdbb261 spacing 2019-07-12 10:25:37 -07:00
97d74bfa1d fixing the app context issue. we will create an app if no current_app available 2019-07-12 08:47:39 -07:00
2628ed1a82 better alerting 2019-07-11 23:00:35 -07:00
66bff57c04 Add ADCS Plugin Configuration to Docs
Add configuration options based on https://github.com/Netflix/lemur/pull/2255#issue-240136873
2019-07-10 12:10:47 -04:00
41c781318c Add ADCS in Docs
Add info regarding the ADCS plugin created by "https://github.com/sirferl/lemur".
"lemur_adcs" plugin is part of Lemur by default so I added to main plugins section within Docs.
2019-07-10 10:08:14 -04:00
ea8524f035 Merge pull request #2824 from castrapel/doc_image_fix
Fix doc images
2019-07-10 06:54:03 -07:00
424b517914 Fix doc images 2019-07-10 06:53:19 -07:00
7419fd951e Merge pull request #2822 from castrapel/master
Initial LetsEncrypt / Celery docs
2019-07-09 11:29:15 -07:00
f2a2683dcb Merge branch 'master' into master 2019-07-09 11:28:42 -07:00
8eb639e366 Initial LetsEncrypt / Celery docs 2019-07-09 11:13:11 -07:00
2510f25cc0 Merge pull request #2821 from hosseinsh/updating-docs
updating the python version
2019-07-09 10:55:10 -07:00
4f5f55a383 Merge branch 'master' into updating-docs 2019-07-09 10:41:25 -07:00
0b2a5e8646 updating the python version 2019-07-09 09:51:51 -07:00
c7398d9e2f Merge pull request #2820 from castrapel/celery_time_limit_sync
Relax celery time limit for source syncing; Ensure metric tags are string
2019-07-01 11:14:05 -07:00
0c5a8f2039 Relax celery time limit for source syncing; Ensure metric tags are string 2019-07-01 08:35:04 -07:00
ff3016e65e Merge pull request #2818 from Netflix/revert-2807-FasterPermalink
Revert "Faster permalink"
2019-06-26 10:44:44 -07:00
0e037973b2 Revert "Faster permalink" 2019-06-26 10:31:58 -07:00
14d32368c0 Merge pull request #2808 from intgr/restore-manage-shebang
manage.py: Restore shebang line
2019-06-25 09:41:22 -07:00
850620c2a2 Merge branch 'master' into restore-manage-shebang 2019-06-25 09:41:08 -07:00
5df06501f6 Merge pull request #2814 from intgr/expose-cert-hasprivaatekey
Expose new certificate field hasPrivateKey
2019-06-25 09:40:27 -07:00
8fbff00850 Merge branch 'master' into restore-manage-shebang 2019-06-25 09:29:06 -07:00
3434f78e50 Merge pull request #2815 from alwaysjolley/cleanup_chain
Cleanup no chain in Vault destination plugin
2019-06-25 09:28:52 -07:00
404b7a25bc Merge branch 'master' into restore-manage-shebang 2019-06-25 09:27:08 -07:00
86a1fb41ac lint fix 2019-06-25 06:56:37 -04:00
55a96ba790 type none 2019-06-24 15:10:10 -04:00
6699833297 fixing empty chain 2019-06-24 13:10:08 -04:00
2319858586 Expose new certificate field hasPrivateKey
We can also now disable the 'private key' tab when cert doesn't have a
private key.
2019-06-22 15:38:28 +03:00
d96155b6df Merge pull request #2813 from DanielThomas/master
Update SAN text
2019-06-21 13:44:54 -07:00
4565bd7dc6 Update SAN text 2019-06-21 13:33:55 -07:00
e1d8bb83ec Merge pull request #2812 from kush-bavishi/temp-ExpiredToggle-3
Color change for Show Expired button
2019-06-21 11:43:17 -07:00
960064d5c6 Color change for Show Expired button 2019-06-21 11:32:16 -07:00
b564f97a47 Merge pull request #2810 from kush-bavishi/temp-ExpiredToggle-3
Expired Toggle
2019-06-21 09:12:31 -07:00
23caac5576 Merge branch 'master' into temp-ExpiredToggle-3 2019-06-21 08:59:53 -07:00
7bff3a7947 Merge pull request #2811 from hosseinsh/generalizing-api
removing the rotation enabled requirement, to keep the endpoint generic
2019-06-20 16:38:28 -07:00
39d65db7fd Merge branch 'master' into generalizing-api 2019-06-20 16:13:04 -07:00
162a300e53 Merge branch 'master' into temp-ExpiredToggle-3 2019-06-20 16:12:55 -07:00
5b8c600261 Merge pull request #2809 from alwaysjolley/vault_regex
fixing regex to be more flexable
2019-06-20 16:12:03 -07:00
34cdd29a50 removing the rotation enabled requirement, to keep the endpoint generic 2019-06-20 16:06:26 -07:00
de0462e54f Added missing semi-colon and changed double quotes to single quotes 2019-06-20 15:41:32 -07:00
68815b8f44 UI changes - Button to show / hide expired certs. 2019-06-20 15:05:26 -07:00
bbf50cf0b0 updated dest as well as src 2019-06-20 08:26:32 -04:00
02719a1de7 Merge branch 'master' into vault_regex
fixed conflicts:
	lemur/plugins/lemur_vault_dest/plugin.py
2019-06-19 09:53:08 -04:00
56917614a2 fixing regex to be more flexable 2019-06-19 09:46:44 -04:00
8a08edb0f3 manage.py: Restore shebang line
This is an executable file but cannot be executed without the interpreter.

The shebang line was lost in commit 8cbc6b8325
2019-06-18 10:51:11 +03:00
f836c6fff6 API additions for viewing expired certs as well. Default behavior modified to show only valid certs and those which have expired less than 1 month ago. 2019-06-17 14:29:48 -07:00
cdb83c48c5 API additions for viewing expired certs as well. Default behavior modified to show only valid certs and those which have expired less than 1 month ago. 2019-06-17 13:44:50 -07:00
198abcfe65 Merge pull request #2807 from kush-bavishi/FasterPermalink
Faster permalink
2019-06-11 16:16:55 -07:00
c0f8fbb24f Modified Permalink behavior to access a newer, faster API 2019-06-11 15:53:47 -07:00
57016f2f45 Merge branch 'master' of https://github.com/Netflix/lemur into FasterPermalink 2019-06-11 14:33:58 -07:00
491d048948 Modified the behavior of Permalink to access a newer, faster API 2019-06-10 09:47:29 -07:00
29213972ae Merge pull request #2806 from hosseinsh/duplicate-notifications-(alternative)
Duplicate notifications (alternative)
2019-06-06 16:29:55 -07:00
0446aea20e Update messaging.py 2019-06-06 13:35:45 -07:00
1ed41d03ea Merge branch 'master' into duplicate-notifications-(alternative) 2019-06-06 09:10:57 -07:00
28e26a1baf to prevent duplicate emails, we might better remove owner and security email address from the notification recipient 2019-06-05 17:57:11 -07:00
3a512d5bda Merge pull request #2804 from kush-bavishi/CommonNameAutoAdditionAsDNS
Common name auto addition as domain name
2019-06-05 15:29:35 -07:00
24f5ce7170 Merge branch 'master' into CommonNameAutoAdditionAsDNS 2019-06-04 13:59:57 -07:00
f991317301 Merge pull request #2805 from castrapel/docker_37
Upgrade docker to 3.7
2019-06-04 08:32:20 -07:00
aeb32f4853 Upgrade docker to 3.7 2019-06-04 08:21:52 -07:00
45231c2423 Added code to automatically add the common name as a DNS name while creating a certificate. 2019-05-31 14:08:28 -07:00
28b216273d Upgrading Gulp. If this is not necessary, we can remove it later. 2019-05-31 14:07:26 -07:00
ce9b06e4c6 Merge pull request #2802 from castrapel/downgrade_kombu_0530
Downgrade Kombu
2019-05-30 13:37:26 -07:00
e300cf6e1b Downgrade Kombu 2019-05-30 13:34:44 -07:00
7eb9c80fb2 Merge pull request #2798 from castrapel/domains_enhancements
Enhance domains query and sensitive domain checking code
2019-05-30 10:31:24 -07:00
7e31498a4b Merge pull request #2799 from hosseinsh/update-reqs-30052019
Update reqs 30052019
2019-05-30 10:29:56 -07:00
b89dd36771 updating requirements 2019-05-30 10:21:53 -07:00
8b821d0023 Enhance domains query and sensitive domain checking code; Allow creation of opt-out roles via config 2019-05-30 10:21:44 -07:00
071c083eae hiding expired certs after 6 months from the main page 2019-05-30 10:21:03 -07:00
b4d9ab9f0c Merge branch 'master' of github.com:Netflix/lemur into improving-cert-lookup-time 2019-05-30 08:55:49 -07:00
13d46ae42e indexing the not after field in the cert table 2019-05-30 08:55:30 -07:00
8bc23f6deb Merge pull request #2797 from castrapel/get_or_increase_name_simplify
Make get_or_increase_name queries less demanding
2019-05-29 12:50:06 -07:00
6e4306b3bb Merge pull request #2795 from ardichoke/fix_vault_api_v2_append
Fix Certificate Appending With v2 Vault API
2019-05-29 12:49:36 -07:00
5e389f3f48 Add certificate1 to test DB 2019-05-29 12:38:17 -07:00
f81adb1371 Make get_or_increase_name queries less demanding 2019-05-29 12:20:05 -07:00
9da428c7fd Merge pull request #2796 from castrapel/read_replica_support
Read replica support
2019-05-28 12:56:22 -07:00
fd35a26955 Support read replicas 2019-05-28 12:45:39 -07:00
5059cb731a Support read replicas in Lemur for improved performance 2019-05-28 12:38:33 -07:00
09c7076e79 Handle double data field in API v2 2019-05-22 17:12:10 -04:00
de65d363fc Merge pull request #2794 from castrapel/max_retry_iam
Set Max Retries + Add metrics to IAM handler
2019-05-21 13:08:47 -07:00
1423ac0d98 More metrics 2019-05-21 12:55:33 -07:00
34c7e5230b Set a limit on number of retries 2019-05-21 12:52:41 -07:00
3c6799d736 Merge pull request #2793 from castrapel/json_logging
Add support for JSON logging
2019-05-17 08:57:09 -07:00
4fac726cf4 Add support for JSON logging 2019-05-17 08:48:26 -07:00
37e5857406 Merge pull request #2792 from castrapel/black-052019
Black lint all the things
2019-05-16 08:25:12 -07:00
0320c04be2 nosec comment 2019-05-16 08:14:46 -07:00
c5ec5fa41f Add bandit to test and pre-commit 2019-05-16 08:13:42 -07:00
68fd1556b2 Black lint all the things 2019-05-16 07:57:02 -07:00
3680d523d4 Merge pull request #2791 from castrapel/digicert_expose_error
Expose exact response from digicert as error
2019-05-15 13:43:44 -07:00
e3c5490d25 Expose exact response from digicert as error 2019-05-15 13:36:40 -07:00
8c73851708 Merge pull request #2790 from castrapel/resolved_cert
Set resolved cert ID before resolving cert
2019-05-15 11:57:03 -07:00
26d10e8b98 change ordering in more places 2019-05-15 11:47:53 -07:00
7e92edc70a Set resolved cert ID before resolving cert; Ignore sentry exceptions when no records on deletion 2019-05-15 11:43:59 -07:00
ed39e30824 Merge pull request #2788 from hosseinsh/fast-valid-cert-lookup
adding a new API for faster certificate lookup
2019-05-15 10:25:50 -07:00
6eb3836abc Merge branch 'master' into fast-valid-cert-lookup 2019-05-15 10:20:17 -07:00
302219325b Merge pull request #2789 from castrapel/celery-timeouts-LE-validation
Add soft timeouts to celery jobs; Check for PEM in LE order
2019-05-14 14:09:02 -07:00
5d8f71c3e4 nt 2019-05-14 13:02:24 -07:00
565142f985 Add soft timeouts to celery jobs; Check for PEM in LE order 2019-05-14 12:52:30 -07:00
f452a7ce68 adding a new API for faster certificate lookup.
The new API api/1/certificates/valid returns only non-expired (not_after >= today) certs which have auto-rotate enabled:

cn is a required parameter:

http://localhost:8000/api/1/certificates/valid?filter=cn;example.com
cn can also be a database string wildcard ('%'):

http://localhost:8000/api/1/certificates/valid?filter=cn;%
owner is the additional parameter, and must be the email address of the owner:

http://localhost:8000/api/1/certificates/valid?filter=cn;example.com&owner=hossein@example.com
given owner  and a database string wildcard ('%') one can retrieve all certs for that owner, which are still valid, and have auto-rotate enabled:

http://localhost:8000/api/1/certificates/valid?filter=cn;%&owner=hossein@example.com
2019-05-11 18:06:51 -07:00
0f2773c986 Merge pull request #2787 from castrapel/search_by_name
Allow searching for certificates by name via API
2019-05-09 15:08:34 -07:00
3f10b43254 Ignore bandit error 2019-05-09 15:00:09 -07:00
ed18df22db remove permalink change 2019-05-09 14:54:44 -07:00
e33a103ca1 Allow searching for certificates by name via API 2019-05-09 14:36:56 -07:00
02554b427a Merge pull request #2784 from castrapel/add_metrics_reissue_rotate
Gather more metrics on certificate reissue/rotate jobs
2019-05-08 07:57:51 -07:00
c9c782684d Merge branch 'master' into add_metrics_reissue_rotate 2019-05-08 07:48:44 -07:00
87470602fd Gather more metrics on certificate reissue/rotate jobs 2019-05-08 07:48:08 -07:00
9cfdf55d9e Merge pull request #2773 from jplana/jwks_validation_error_control
Better error management in jwks token validation
2019-05-08 07:42:35 -07:00
1de85dbcf4 Merge branch 'master' into jwks_validation_error_control 2019-05-08 07:29:37 -07:00
6a83da2292 Merge pull request #2775 from jplana/re-enable-gulp-backend-proxy
Enable gulp server to proxy backend
2019-05-08 07:22:58 -07:00
34640e009b Merge branch 'master' into re-enable-gulp-backend-proxy 2019-05-08 07:19:51 -07:00
317c84800c Merge branch 'master' into jwks_validation_error_control 2019-05-08 06:50:56 -07:00
3500be39aa Merge pull request #2783 from alwaysjolley/vault_docs
Adding documentation for Vault and CFSSL Plugin changes
2019-05-08 06:50:38 -07:00
029efeb03a fixing syntax 2019-05-08 09:45:13 -04:00
15eb7689ed Adding documentation for Vault and CFSSL Plugin changes 2019-05-08 09:32:46 -04:00
6c66370142 Merge pull request #2782 from castrapel/fix_bearer_token
Converting userinfo authorization to a config var
2019-05-07 15:38:05 -07:00
0eacbd42d7 Converting userinfo authorization to a config var 2019-05-07 15:31:42 -07:00
4e6e7edf27 Rename return variable for better readability 2019-05-07 22:53:01 +02:00
b7ce9ab901 Merge branch 'master' into jwks_validation_error_control 2019-05-07 13:09:02 -07:00
1492890ac7 Merge branch 'master' into re-enable-gulp-backend-proxy 2019-05-07 09:18:01 -07:00
65f594fc29 Merge pull request #2774 from jplana/aid_openid_roles_provider_integration
Don't fail if googleGroups is not found in user profile
2019-05-07 09:17:26 -07:00
0de42fdf0f Merge branch 'master' into re-enable-gulp-backend-proxy 2019-05-07 09:06:24 -07:00
ff583981b1 Merge branch 'master' into aid_openid_roles_provider_integration 2019-05-07 09:06:02 -07:00
e58ff476c9 Merge branch 'master' into jwks_validation_error_control 2019-05-07 09:05:41 -07:00
06ccafeb24 Merge pull request #2772 from jplana/fix_userinfo_authorization
Fixes userinfo using Bearer token
2019-05-07 08:46:18 -07:00
22caaa0c95 Merge branch 'master' into fix_userinfo_authorization 2019-05-07 07:48:47 -07:00
44d4c98a99 Merge pull request #2779 from dciancu/develop
Fix Cloudflare DNS
2019-05-07 07:45:48 -07:00
e65154b48e Merge branch 'master' into develop 2019-05-07 07:36:51 -07:00
adec451613 Merge pull request #2781 from alwaysjolley/lemur_vault_source
adding Vault Source plugin
2019-05-07 07:36:37 -07:00
ef7a8587fe Merge branch 'lemur_vault_source' of github.com:/alwaysjolley/lemur into lemur_vault_source 2019-05-07 10:06:09 -04:00
b0c8901b0a lint cleanup 2019-05-07 10:05:01 -04:00
36ce1cc7ef Merge branch 'master' into lemur_vault_source 2019-05-07 09:41:50 -04:00
fb3f0bd72a adding Vault Source plugin 2019-05-07 09:37:30 -04:00
da237c9c84 Merge branch 'master' into develop 2019-05-06 17:10:15 -07:00
a7af3cf8d2 Fix Cloudflare DNS 2019-05-07 03:05:24 +03:00
298d172536 Merge branch 'master' into jwks_validation_error_control 2019-05-06 16:57:03 -07:00
3be8117310 Merge branch 'master' into fix_userinfo_authorization 2019-05-06 16:56:52 -07:00
852a605de3 Merge branch 'master' into re-enable-gulp-backend-proxy 2019-05-06 16:56:33 -07:00
51bf256723 Merge pull request #2778 from hosseinsh/re-update-05062019
updating requirements
2019-05-06 16:46:41 -07:00
6d5552afd3 updating requirements 2019-05-06 16:31:50 -07:00
47595e2073 Enable gulp server to proxy backend 2019-05-06 12:33:53 +02:00
deed1b9685 Don't fail if googleGroups is not found in user profile 2019-05-06 12:30:25 +02:00
6c99e76c9a Better error management in jwks token validation 2019-05-06 12:27:43 +02:00
2063baefc9 Fixes userinfo using Bearer token 2019-05-06 12:23:24 +02:00
dfadcc52ef Merge pull request #2776 from GaryCarneiro/master
Ubuntu Package name changed
2019-05-03 08:48:49 -07:00
b642c7279d Merge pull request #1 from GaryCarneiro/GaryCarneiro-pypkgnamechange
Package name has changed
2019-05-03 13:49:30 +05:30
8ed6187697 Package name has changed
python-software-properties was renamed to software-properties-common
https://askubuntu.com/questions/422975/e-package-python-software-properties-has-no-installation-candidate
2019-05-03 13:49:02 +05:30
2497f3fd4e Merge pull request #2771 from castrapel/acme_domain_suffix
Updated requirements ; Require internal DNS validation
2019-04-29 14:13:42 -07:00
14cd593a59 Merge branch 'master' into acme_domain_suffix 2019-04-29 13:58:15 -07:00
3a1da72419 nt 2019-04-29 13:57:04 -07:00
6e3f394cff Updated requirements ; Revert change and require DNS validation by provider 2019-04-29 13:55:26 -07:00
cf56300b55 Merge pull request #2770 from castrapel/acme_domain_suffix
Move ACME host validation logic prior to R53 host modification
2019-04-26 17:28:35 -07:00
2e3cd98a3c Merge branch 'master' into acme_domain_suffix 2019-04-26 17:28:29 -07:00
1a90e71884 Move ACME host validation logic prior to R53 host modification 2019-04-26 17:27:44 -07:00
056dfc34e4 Merge pull request #2769 from castrapel/lowercase-acme
Ensure hostname is lowercase when comparing DNS challenges. ACME will…
2019-04-26 15:45:52 -07:00
333ba8030a Ensure hostname is lowercase when comparing DNS challenges. ACME will automatically lowercase the hostname 2019-04-26 15:45:04 -07:00
517a96c6eb Merge pull request #2768 from castrapel/strip_out_self_polling_logic
Strip out self-polling logic and rely on ACME; Enhance ELB logging and retries
2019-04-26 10:30:49 -07:00
1a3ba46873 More retry changes 2019-04-26 10:18:54 -07:00
1e64851d79 Strip out self-polling logic and rely on ACME; Enhance ELB logging and retries 2019-04-26 10:16:18 -07:00
b300a21948 Merge pull request #2767 from castrapel/expose_verisign_exception
Expose verisign exceptions
2019-04-25 19:28:44 -07:00
8eef95b58e Merge branch 'master' into expose_verisign_exception 2019-04-25 19:15:55 -07:00
dcdfb32883 Expose verisign exceptions 2019-04-25 19:14:15 -07:00
4cc2befbfb Merge pull request #2766 from castrapel/improve_dnschallenge_flow
Process DNS Challenges appropriately (1 challenge -> 1 domain)
2019-04-25 15:20:09 -07:00
cbfde3ff94 Merge branch 'master' into improve_dnschallenge_flow 2019-04-25 15:13:16 -07:00
39584f214b Process DNS Challenges appropriately (1 challenge -> 1 domain) 2019-04-25 15:12:52 -07:00
db4c4846b9 Merge pull request #2765 from castrapel/metrics_errors_acme
Metrics / Exception Reporting - LetsEncrypt / Dynect flow, ELB source sync
2019-04-25 14:12:30 -07:00
e2b5962281 Merge branch 'master' into metrics_errors_acme 2019-04-25 13:59:52 -07:00
2bc604e5a9 Better metrics and error reporting 2019-04-25 13:50:41 -07:00
88ed9581b6 Merge pull request #2764 from hosseinsh/update-travis-sudo
Update travis sudo
2019-04-24 18:10:39 -07:00
45da5847f7 Merge branch 'master' of github.com:Netflix/lemur into update-travis-sudo
# Conflicts:
#	.travis.yml
2019-04-24 17:51:07 -07:00
55f35b0f35 removing sudo, since deprecated in Travis
https://github.com/Netflix/lemur/issues/2758
2019-04-24 17:48:18 -07:00
e313b74813 Merge pull request #2763 from castrapel/metrics_errors_acme
Better exception handling, logging, and metrics for ACME flow
2019-04-24 15:33:11 -07:00
272285f64a Better exception handling, logging, and metrics for ACME flow 2019-04-24 15:26:23 -07:00
ccd0bde0bc Merge pull request #2757 from jplana/add-pending-certificate-upload
Allow uploading a signed cert for a pending certificate.
2019-04-24 09:53:50 -07:00
0f9b0f39f7 Merge branch 'master' into add-pending-certificate-upload 2019-04-24 09:34:35 -07:00
21d619e24a Merge pull request #2759 from alwaysjolley/lemur_vault_plugin
Adding SAN filter to Vault Destination Plugin
2019-04-24 09:30:35 -07:00
6804bfb233 Merge branch 'master' into lemur_vault_plugin 2019-04-24 08:53:10 -07:00
4338b4346e Merge branch 'master' into add-pending-certificate-upload 2019-04-24 08:52:58 -07:00
07e8e6a628 Merge pull request #2762 from castrapel/pyjks
Use official pyjks version
2019-04-23 08:06:33 -07:00
b6e09621f8 Use official pyjks version 2019-04-23 08:05:32 -07:00
a801112cf6 Merge branch 'master' into lemur_vault_plugin 2019-04-23 07:07:39 -04:00
85efb6a99e cleanup tmp files 2019-04-23 07:06:52 -04:00
ec7da60d04 Merge pull request #2761 from castrapel/pyjks_pycryptodomex
Pinning pyjks to specific commit with pycryptodomex
2019-04-22 22:00:22 -07:00
83784d7cb8 Pinning pyjks to specific commit with pycryptodomex instead of pycryptodome 2019-04-22 21:50:48 -07:00
9b38761153 Merge branch 'master' into add-pending-certificate-upload 2019-04-22 11:47:02 -07:00
f1a3fdf7b9 Merge pull request #2751 from intgr/rewrite-java-keystore-use-pyjks
Rewrite Java Keystore/Truststore support based on pyjks library
2019-04-22 11:46:26 -07:00
94f3265104 Merge branch 'master' into rewrite-java-keystore-use-pyjks 2019-04-22 09:55:58 -07:00
0bd2c76ed3 Merge pull request #2760 from hosseinsh/re-update-190422
updating requirements, addressing the urllib3 high severity warning
2019-04-22 09:55:47 -07:00
d1e5a40d20 updating requirements, addressing the urllib3 high severity warning 2019-04-22 09:49:03 -07:00
f9dadb2670 fixing validation 2019-04-22 09:38:44 -04:00
8dccaaf544 simpler validation 2019-04-22 07:58:01 -04:00
1667c05742 removed unused functions 2019-04-18 13:57:10 -04:00
b39e2e3f66 Merge branch 'master' into lemur_vault_plugin 2019-04-18 13:55:45 -04:00
fb3b0e8cd7 adding regex filtering 2019-04-18 13:52:40 -04:00
7dd9268ca7 Allow uploading a signed cert for a pending certificate. 2019-04-18 00:46:39 +02:00
8177e12f3f Merge branch 'master' into rewrite-java-keystore-use-pyjks 2019-04-17 10:43:44 -07:00
4c7bf917f2 Merge pull request #2747 from jramosf/master
Parse SubjectAlternativeNames from CSR into Lemur Certificate
2019-04-17 10:43:21 -07:00
52f939658f Merge branch 'master' into rewrite-java-keystore-use-pyjks 2019-04-17 10:31:58 -07:00
f6afcc6d21 Merge branch 'master' into master 2019-04-17 10:28:46 -07:00
2f7342951d Merge pull request #2534 from jplana/upload_certificates_with_csr
Allow uploading csr along with certificates
2019-04-17 10:28:31 -07:00
f76e913689 Merge branch 'master' into upload_certificates_with_csr 2019-04-17 10:20:05 -07:00
135d86c583 Merge branch 'master' into master 2019-04-17 10:19:56 -07:00
c45c2344bc Merge pull request #2756 from castrapel/makefile-checkout-pr
Make command to checkout PR from upstream
2019-04-17 10:19:24 -07:00
eb16afb6e6 Make command to checkout PR from upstream 2019-04-17 10:18:49 -07:00
58dd424de8 Prevent potential NoneType not subscriptable
Fix when data['extensions']['subAltNames']['names'] is none
2019-04-17 18:33:52 +02:00
900ae10764 Merge branch 'master' into master 2019-04-17 09:06:24 -07:00
57874971aa Merge branch 'master' into upload_certificates_with_csr 2019-04-16 15:05:11 -07:00
e45d005b74 Merge branch 'master' into rewrite-java-keystore-use-pyjks 2019-04-16 14:57:16 -07:00
0c078fea57 Merge pull request #2755 from hosseinsh/re-update-190416
updating requirements
2019-04-16 14:55:09 -07:00
8e1f00f17c Merge branch 'master' into master 2019-04-16 08:56:31 -07:00
e24026f3db Merge branch 'master' into rewrite-java-keystore-use-pyjks 2019-04-16 08:51:32 -07:00
5dd2e05972 updating requirements 2019-04-16 08:50:46 -07:00
771f2ebc47 Use SAN_CERT_CSR 2019-04-13 11:01:36 +02:00
770729a72e Allow csr to be empty during upload 2019-04-13 01:17:12 +02:00
2ff811ae71 updating cryptography API call, to create right signing algorithm object. 2019-04-13 00:57:48 +02:00
09796cf7c9 the check_cert_signature() method was attempting to compare RSA and ECC signatures.
If a ec public-key certificate is signed with an RSA key, then it can't be a self-signed certificate, in which case we just raise InvalidSignature.
2019-04-13 00:57:48 +02:00
406753fcde Fix PEP8 2019-04-13 00:49:35 +02:00
a5570d07bc Added some documentation for API users. 2019-04-13 00:48:19 +02:00
c1b02cc8a5 Allow uploading csr along with certificates 2019-04-13 00:48:19 +02:00
cf5b0145bd Merge pull request #2754 from hosseinsh/re-update-190412
Updating requirements
2019-04-12 15:09:44 -07:00
9bdf48c1b9 updating requirements 2019-04-12 14:29:08 -07:00
ad244fc83d Merge branch 'master' of github.com:Netflix/lemur into re-update-190412 2019-04-12 14:26:35 -07:00
da51e7f31d removing the announcement 2019-04-12 14:24:29 -07:00
f8a9ec6e3e simple hardcoded announcement 2019-04-12 14:24:29 -07:00
df8d4e0892 Merge branch 'master' into rewrite-java-keystore-use-pyjks 2019-04-12 09:38:50 -07:00
ceb335f3ab Merge branch 'master' into master 2019-04-12 09:38:41 -07:00
26e3982cb4 Merge pull request #2469 from hosseinsh/hshafagh-src-dst-register
Source and Destination registration
2019-04-12 09:25:25 -07:00
9ecc19c481 adding san filter 2019-04-12 09:53:06 -04:00
6d67ec7e34 removing unused import 2019-04-11 17:34:02 -07:00
512e1a0bdd fixing typos 2019-04-11 17:17:28 -07:00
6ec84a398c checking for None 2019-04-11 17:13:47 -07:00
69c00c4db5 upon creating a new destination, we also add it as source, if the plugin defines this as an option 2019-04-11 17:13:47 -07:00
d7abf2ec18 adding a new util method for setting options 2019-04-11 17:13:47 -07:00
557fac39b5 refactoring the sync job into a service method that we can also call when adding a new destination 2019-04-11 17:13:47 -07:00
d1ead4b79c removing the announcement 2019-04-11 17:13:47 -07:00
5900828051 simple hardcoded announcement 2019-04-11 17:13:47 -07:00
818da6653d removing the announcement 2019-04-11 17:13:47 -07:00
e1a67e9b4e simple hardcoded announcement 2019-04-11 17:13:47 -07:00
84dfdd0600 removing the announcement 2019-04-11 17:13:47 -07:00
ba691a26d4 simple hardcoded announcement 2019-04-11 17:13:47 -07:00
b66fac0494 removing the announcement 2019-04-11 17:13:47 -07:00
1bda246df2 simple hardcoded announcement 2019-04-11 17:13:47 -07:00
9a210c055a Merge branch 'master' into hshafagh-src-dst-register 2019-04-11 15:36:48 -07:00
81e2ff99ff Merge pull request #2468 from hosseinsh/hosseinsh-celeryjob-sync-src-dst
Celery job for synching destinations and sources
2019-04-11 15:17:16 -07:00
2459234147 removing lines 2019-04-11 14:34:26 -07:00
60edab9f6d cleaning up 2019-04-11 14:12:31 -07:00
ec3d2d7316 fixing typo 2019-04-11 13:51:43 -07:00
83d408b238 Merge branch 'master' into hosseinsh-celeryjob-sync-src-dst 2019-04-11 13:30:12 -07:00
266c83367d avoiding hard-coded plugin names 2019-04-11 13:29:37 -07:00
f185df4f1e bringing class AWSDestinationPlugin(DestinationPlugin) after AWSSourcePlugin.slug, such that we can do: sync_as_source_name = AWSSourcePlugin.slug 2019-04-11 13:28:58 -07:00
4dae8851d9 Merge pull request #2753 from castrapel/unpin_dependencies_py37
Update requirements - upgrade to py37
2019-04-10 16:28:19 -07:00
142aadffef Upgrade travis to xenial 2019-04-10 16:18:49 -07:00
d3fbf46f7a Upgrade travis deps 2019-04-10 16:09:55 -07:00
2ff57e932c Update requirements - upgrade to py37 2019-04-10 15:40:48 -07:00
d628e97035 Merge branch 'master' into hosseinsh-celeryjob-sync-src-dst 2019-04-10 09:47:06 -07:00
bc8c7e114a Merge branch 'master' into hshafagh-src-dst-register 2019-04-09 20:52:33 -07:00
f3d0536800 removing hardcoded rules, to give more flexibility into defining new source-destinations 2019-04-09 20:49:07 -07:00
1c09712df0 removing the announcement 2019-04-09 10:09:32 -07:00
0cc98c378f simple hardcoded announcement 2019-04-09 10:09:32 -07:00
6fd7752b29 removing the announcement 2019-04-09 10:08:25 -07:00
bfc4f940da Merge branch 'master' into master 2019-04-09 18:06:09 +02:00
64c6bb2475 Merge branch 'master' into rewrite-java-keystore-use-pyjks 2019-04-09 08:28:05 -07:00
70c8c2b5fc Merge pull request #2750 from ardichoke/vault_kv2
Add support for Vault KV API v2
2019-04-09 08:25:28 -07:00
dbf34a4d48 Rewrite Java Keystore/Truststore support based on pyjks library 2019-04-06 20:24:46 +03:00
2c82708391 simple hardcoded announcement 2019-04-04 12:12:29 -07:00
d80a6bb405 Added tests for CSR parsing into CertificateInputSchema 2019-04-01 08:44:40 +02:00
e10007ef7b Add support for Vault KV API v2
This adds the ability to target KV API v1 or v2.
2019-03-29 10:32:49 -04:00
b86e381e20 Parse SubjectAlternativeNames from CSR into Lemur Certificate 2019-03-27 13:46:33 +01:00
d2e969b836 better synching of source and destinations 2019-03-26 18:20:14 -07:00
a865675537 Merge pull request #2746 from castrapel/authority_validation_LE_errors
Add order URI during LE cert creation failure; Fail properly when inv…
2019-03-25 08:58:12 -07:00
4018c68d49 Merge branch 'master' into authority_validation_LE_errors 2019-03-25 08:34:10 -07:00
c2158ff8fb Add order URI during LE cert creation failure; Fail properly when invalid CA passed; Update reqs 2019-03-25 08:28:23 -07:00
57a680834e Merge pull request #2700 from jramosf/ghjaramos/master
Parse DNSNames from CSR into Lemur Certificate
2019-03-25 08:19:19 -07:00
8a42cfa345 Merge branch 'master' into ghjaramos/master 2019-03-21 08:07:44 -07:00
d920341dab Merge pull request #2617 from alwaysjolley/lemur_vault_plugin
Hashi Vault Destination Plugin
2019-03-21 08:05:54 -07:00
fa4a5122bc fixing file read to trim line endings and cleanup 2019-03-20 14:59:04 -04:00
3a96475a2e Merge branch 'lemur_vault_plugin' of github.com:/alwaysjolley/lemur into lemur_vault_plugin 2019-03-20 13:52:20 -04:00
f99b11d50e refactor url and token to support muiltiple instances of vault 2019-03-20 13:51:06 -04:00
a59eec553a Merge branch 'master' into lemur_vault_plugin 2019-03-18 15:21:18 -07:00
fed6f661c7 Merge branch 'master' into ghjaramos/master 2019-03-18 15:21:10 -07:00
5c11a2941c Merge pull request #2713 from hosseinsh/up-reqs-03182019
updating requirements
2019-03-18 15:20:48 -07:00
dbd948be6e updating requirements 2019-03-18 12:50:18 -07:00
9e5496b484 Update schemas.py 2019-03-15 10:19:25 +01:00
f7452e8379 Parse DNSNames from CSR into Lemur Certificate 2019-03-15 09:29:23 +01:00
157db684c3 Merge branch 'master' into lemur_vault_plugin 2019-03-14 11:09:01 -04:00
cfe0595918 Merge pull request #2689 from castrapel/skip_duplicate_tasks
Skip a task if similar task already active
2019-03-12 15:54:46 -07:00
c445297357 Update celery.py 2019-03-12 15:41:24 -07:00
f38e5b0879 Update celery.py 2019-03-12 15:29:04 -07:00
1a5a91ccc7 Update celery.py 2019-03-12 15:11:13 -07:00
3b3faa66f4 Merge branch 'master' into skip_duplicate_tasks 2019-03-12 14:53:42 -07:00
d220e9326c Skip a task if similar task already active 2019-03-12 14:45:43 -07:00
9ff789ab06 Merge pull request #2336 from intgr/verify-cert-chain
Check that stored certificate chain matches certificate
2019-03-11 18:06:06 -07:00
57d3f3d5a5 Merge branch 'master' into lemur_vault_plugin 2019-03-08 07:08:56 -05:00
f1c09a6f8f fixed comments 2019-03-07 15:58:34 -05:00
93ce259fb2 Merge branch 'master' into verify-cert-chain 2019-03-07 12:46:19 -08:00
bd27932783 Merge pull request #2529 from rmoesbergen/allow-cert-deletion
Implement ALLOW_CERT_DELETION setting
2019-03-07 12:45:53 -08:00
7b0a3cf781 Merge branch 'lemur_vault_plugin' of github.com:/alwaysjolley/lemur into lemur_vault_plugin 2019-03-07 15:42:40 -05:00
752c9a086b fixing error handling and better data formating 2019-03-07 15:41:29 -05:00
92b60b279a Merge branch 'master' into verify-cert-chain 2019-03-06 11:15:32 -08:00
b8d3a4f9aa Update requirements.in 2019-03-06 11:13:34 -08:00
43b1d6217a Merge branch 'master' into allow-cert-deletion 2019-03-06 10:59:33 -08:00
98ece58342 Merge branch 'master' into lemur_vault_plugin 2019-03-06 10:59:03 -08:00
b5d255d7c9 Merge pull request #2646 from Netflix/2636-config-ignore
Ensuring that configs passed via the command line are respected.
2019-03-06 10:58:42 -08:00
f974e29cc9 Merge branch 'master' into verify-cert-chain 2019-03-06 09:36:10 -08:00
45cb0f0513 Merge branch 'master' into allow-cert-deletion 2019-03-06 09:35:10 -08:00
4904e6e223 Merge branch 'master' into lemur_vault_plugin 2019-03-06 12:06:10 -05:00
cc6d53fdeb Ensuring that configs passed via the command line are respected. 2019-03-05 15:39:37 -08:00
721fb8ec70 Merge pull request #2639 from castrapel/really_downgrade_kombu
Downgrade Kombu for real this time
2019-03-05 09:46:36 -08:00
077ae1eedd Downgrade Kombu for real this time 2019-03-05 09:45:59 -08:00
b878c7e2db Merge pull request #2638 from castrapel/downgrade_kombu2
downgrade kombu
2019-03-05 07:50:23 -08:00
20ac4bd3dd downgrade kombu 2019-03-05 07:34:30 -08:00
a1cb8ee266 fixing lint 2019-03-05 07:37:04 -05:00
880eaad6cb Merge branch 'lemur_vault_plugin' of github.com:/alwaysjolley/lemur into lemur_vault_plugin 2019-03-05 07:22:18 -05:00
4a027797e0 fixing linting issues 2019-03-05 07:19:22 -05:00
54ad3ba777 Merge branch 'master' into verify-cert-chain 2019-03-04 17:55:36 -08:00
c9bcd29082 Merge branch 'master' into lemur_vault_plugin 2019-03-04 17:55:00 -08:00
130688252a Merge pull request #2630 from castrapel/relax_search
Relax search; update requirements
2019-03-04 11:14:16 -08:00
dd2900bdbc Relax search;update requirements 2019-03-04 10:04:06 -08:00
10cec063c2 Check that stored certificate chain matches certificate
Similar to how the private key is checked.
2019-03-04 17:10:59 +02:00
20518bc377 Merge branch 'master' into lemur_vault_plugin 2019-03-01 09:58:43 -05:00
5d2f603c84 renamed vault destination plugin to avoid conflict with vault pki plugin 2019-03-01 09:49:52 -05:00
63de8047ce Return 'already deleted' instead of 'not found' when cert has already been deleted 2019-02-27 09:38:25 +01:00
a9735e129c Merge branch 'master' into allow-cert-deletion 2019-02-27 09:28:48 +01:00
930af17802 Merge pull request #2588 from hosseinsh/fixing-signature-verify-ecc
Fixing signature verify ecc
2019-02-26 17:12:21 -08:00
658c58e4b6 clarifying comments 2019-02-26 17:04:43 -08:00
9dbae39604 updating cryptography API call, to create right signing algorithm object. 2019-02-26 16:42:26 -08:00
16a18cc4b7 adding more edge test cases for EC-certs 2019-02-26 16:42:26 -08:00
aec7c7b0bc Merge branch 'master' into fixing-signature-verify-ecc 2019-02-26 09:28:48 -08:00
38827cc66b Merge pull request #2563 from rmoesbergen/fix-blah-as-alias
Fix setting alias to "blah" when exporting without explicit alias
2019-02-26 09:21:59 -08:00
53301728fa Moved url to config file instead of plugin option. One one url can be supported
unless both the token and url are moved to the plugin options.
2019-02-26 09:15:12 -05:00
bc35ae90d0 Merge branch 'master' into allow-cert-deletion 2019-02-25 20:03:47 -08:00
d37943a17f Merge branch 'master' into fix-blah-as-alias 2019-02-25 20:03:27 -08:00
141500f4aa Merge branch 'master' into fixing-signature-verify-ecc 2019-02-25 20:03:18 -08:00
6e4f400d93 Merge pull request #2589 from hosseinsh/update-reqs-022519
updating requirements
2019-02-25 20:03:02 -08:00
65cbe7c77e Merge branch 'master' into allow-cert-deletion 2019-02-25 19:25:31 -08:00
0eefb9e355 Merge branch 'master' into fix-blah-as-alias 2019-02-25 19:25:09 -08:00
de129037e1 Merge branch 'master' into fixing-signature-verify-ecc 2019-02-25 19:24:54 -08:00
9159520716 Merge branch 'master' into update-reqs-022519 2019-02-25 19:24:38 -08:00
e64de7d312 updating requirements 2019-02-25 19:12:20 -08:00
60cd28f516 Merge pull request #2567 from hosseinsh/req-update-022119
updating requirements
2019-02-25 19:10:00 -08:00
40fac02d8b the check_cert_signature() method was attempting to compare RSA and ECC signatures.
If a ec public-key certificate is signed with an RSA key, then it can't be a self-signed certificate, in which case we just raise InvalidSignature.
2019-02-25 19:05:54 -08:00
cd65a36437 - support multiple bundle configuration, nginx, apache, cert only
- update vault destination to support multi cert under one object
- added san list as key value
- read and update object with new keys, keeping other keys, allowing
us to keep an iterable list of keys in an object for deploying multiple
certs to a single node
2019-02-25 09:42:07 -05:00
14d8596b8a updating requirements 2019-02-21 20:19:14 -08:00
ef0c08dfd9 Fix: when no alias is entered when exporting a certificate, the alias is set to 'blah'.
This fix sets it to the common name instead.
2019-02-21 16:33:43 +01:00
a0ca486f0f adding hvac and updating requrements 2019-02-19 15:22:11 -05:00
eaa73998a0 adding lemur_vault destination plugin 2019-02-19 15:03:15 -05:00
29bda6c00d Fix typo's 2019-02-14 11:58:29 +01:00
8abf95063c Implement a ALLOW_CERT_DELETION option (boolean, default False). When enabled, the certificate delete API call will work and the UI
will no longer display deleted certificates. When disabled (the default), the delete API call will not work (405 method not allowed)
 and the UI will show all certificates, regardless of the 'deleted' flag.
2019-02-14 11:57:27 +01:00
c79d9c7051 Merge pull request #2262 from intgr/special-issuer-for-selfsigned-certs
Use special issuer values <selfsigned> and <unknown> in special cases
2019-02-11 16:37:27 -08:00
a390c59e27 Merge branch 'master' into special-issuer-for-selfsigned-certs 2019-02-11 14:09:00 -08:00
e1d13ef965 Merge pull request #2505 from hosseinsh/update-reqs-021119
updating requirements
2019-02-11 14:08:43 -08:00
7c3815e7b5 Merge branch 'master' into update-reqs-021119 2019-02-11 12:05:03 -08:00
e034771e36 Merge branch 'master' into special-issuer-for-selfsigned-certs 2019-02-11 12:04:33 -08:00
f43e3588a2 Merge pull request #1865 from explody/get_by_attributes
Added get_by_attributes to the certificates service, for fetching cer…
2019-02-11 12:04:05 -08:00
793242d3a7 Merge branch 'master' into update-reqs-021119 2019-02-11 10:53:19 -08:00
427025e8f3 Merge branch 'master' into special-issuer-for-selfsigned-certs 2019-02-11 10:27:11 -08:00
ad18ea4bf7 Merge branch 'master' into get_by_attributes 2019-02-11 10:27:02 -08:00
42af082d3a updating requirements 2019-02-11 10:22:59 -08:00
7ea6e2059a Merge pull request #2493 from hosseinsh/update-reqs-020819
pinning pyyaml to ensure only using the patched version
2019-02-08 08:41:31 -08:00
20402ddd2f Merge branch 'master' into update-reqs-020819 2019-02-08 08:28:47 -08:00
73a474bd35 pinning pyyaml to ensure only using the patched version 2019-02-08 08:23:42 -08:00
bd1d29f0a1 Merge pull request #2485 from hosseinsh/update-reqs-020719
updating requirements, pinning pyyaml to patched version.
2019-02-08 08:11:54 -08:00
fd60b16342 updating requirements, pinning pyyaml to patched version. 2019-02-07 17:13:53 -08:00
f29c99bde9 Merge pull request #2482 from hosseinsh/update-reqs-020719
updating requirements
2019-02-07 17:07:51 -08:00
a43c6cf954 Update requirements-docs.txt 2019-02-07 09:57:42 -08:00
198826dd66 Merge branch 'master' into update-reqs-020719 2019-02-07 09:57:12 -08:00
70a70663a2 updating requirements 2019-02-07 09:51:34 -08:00
605663704b Merge branch 'master' into hosseinsh-celeryjob-sync-src-dst 2019-02-05 12:41:33 -08:00
e139b92b24 Merge branch 'master' into hshafagh-src-dst-register 2019-02-05 12:41:26 -08:00
6d1ef933c4 creating a new celery task to sync sources with destinations. This is as a measure to make sure important new destinations are also present as sources. 2019-02-05 10:48:52 -08:00
2107d58050 Merge branch 'master' into get_by_attributes 2019-02-05 10:31:35 -08:00
8d261b4120 Merge branch 'master' into special-issuer-for-selfsigned-certs 2019-02-05 10:29:20 -08:00
eebee9e523 Merge pull request #2467 from castrapel/update-reqs-020519
Updating requirements
2019-02-05 10:21:43 -08:00
d9d12c7603 Merge branch 'master' into update-reqs-020519 2019-02-05 09:48:11 -08:00
35158ed933 Merge pull request #2255 from sirferl/ADCS-plugin
ADCS (MS AD-PKI) plugin
2019-02-05 09:48:02 -08:00
176f9bfea6 Updating requirements 2019-02-05 09:37:04 -08:00
51248c1938 Use special issuer values <selfsigned> and <unknown> in special cases
This way it's easy to find/distinguish selfsigned certificates stored in
Lemur.
2019-02-05 16:56:09 +02:00
1d2771b014 Merge branch 'master' into get_by_attributes 2019-02-04 21:07:09 -08:00
f249a82d71 renaming destination to source. 2019-02-04 16:10:48 -08:00
44a060b159 adding support for creating a source while creating a new dst, while the destination is from AWS 2019-02-04 15:36:39 -08:00
c1cf8d7a92 Merge branch 'master' into ADCS-plugin 2019-02-02 19:21:22 +01:00
1a2712cdf1 Merge pull request #2388 from rmoesbergen/master
Implement certificates 'delete' API call
2019-02-01 17:23:04 -08:00
6c5c9fac01 Merge branch 'master' of https://github.com/rmoesbergen/lemur into rmoesbergen-master 2019-02-01 17:13:59 -08:00
45fbaf159a Merge branch 'master' into master 2019-02-01 16:50:09 -08:00
8e93d007be Merge branch 'master' into get_by_attributes 2019-02-01 16:48:50 -08:00
6705a0e030 Merge branch 'master' into ADCS-plugin 2019-02-01 16:38:39 -08:00
73ac1591e0 Merge pull request #2337 from intgr/enforce-certs-pkeys-are-str
Enforce that PEM strings (certs, keys, CSR) are internally passed as str, not bytes
2019-02-01 16:30:25 -08:00
36ab1c0bec Merge branch 'master' into ADCS-plugin 2019-02-01 19:10:46 +01:00
e24a94d798 Enforce that PEM strings (certs, keys, CSR) are internally passed as str, not bytes
This was already true in most places but not 100%, leading to lots of redundant checks and conversions.
2019-01-30 18:11:24 +02:00
e475d90e2e Merge branch 'master' into master 2019-01-30 07:20:44 -08:00
c60b712523 Merge pull request #2408 from hosseinsh/master
Resolving the 2 years error from UI during cert creation
2019-01-30 07:19:06 -08:00
81e5abd23d Merge branch 'master' of https://github.com/rmoesbergen/lemur into rmoesbergen-master 2019-01-29 17:17:30 -08:00
e5ddf08f48 Merge branch 'master' into master 2019-01-29 16:37:29 -08:00
7f4f4ffded Merge branch 'master' into master 2019-01-29 16:30:15 -08:00
48ad20faca moving the 2 year validity issue to the Verisign plugin, and address it there 2019-01-29 16:17:08 -08:00
0a392b7bac Merge pull request #2436 from castrapel/password_noninteractive
allowing create_user with noninteractive PW;updating reqs
2019-01-29 15:34:14 -08:00
1e708bf1c7 Merge branch 'master' into password_noninteractive 2019-01-29 15:21:34 -08:00
753ae3cbaf Merge pull request #2396 from intgr/expose-cert-distinguished-name
Expose full certificate RFC 4514 Distinguished Name string
2019-01-29 15:21:12 -08:00
d2317acfc5 allowing create_user with noninteractive PW;updating reqs 2019-01-29 15:17:40 -08:00
29638c7f3b Merge branch 'master' into master 2019-01-29 14:59:55 -08:00
93021a5d89 Merge branch 'master' into expose-cert-distinguished-name 2019-01-29 14:56:31 -08:00
7fb97ef4e5 Merge pull request #2432 from alwaysjolley/cfssl_authsign
Adding support for cfssl auth mode signing
2019-01-29 14:56:17 -08:00
c68a9cf80a fixing linting issues 2019-01-29 11:10:56 -05:00
254a3079f2 fix whitespace 2019-01-29 11:01:55 -05:00
b4d1b80e04 Adding support for cfssl auth mode signing 2019-01-29 10:13:44 -05:00
c77ccdf46e Merge branch 'master' into ADCS-plugin 2019-01-28 17:57:46 +01:00
c47fa0f9a2 adjusting the tests to reflect on the new full year convert limit! 2019-01-24 17:52:22 -08:00
a9724e7383 Resolving the 2 years error from UI during cert creation:
Though a CA would accept two year validity, we were getting error for being beyond 2 years.
This is because our current conversion is just current date plus 2 years,
1/25/2019 + 2 years ==> 1/25/2019
This is more strictly seen two years and 1 day extra, violating the 2 year's limit.
2019-01-24 17:23:40 -08:00
4b893ab5b4 Expose full certificate RFC 4514 Distinguished Name string
Using rfc4514_string() method added in cryptography version 2.5.
2019-01-23 10:03:40 +02:00
4c4fbf3e48 Implement certificates delete API call by marking a cert as 'deleted' in the database. Only certificates that have expired can be deleted. 2019-01-21 10:25:28 +01:00
cb35f19d6c Add 'delete_cert' to enum log_type in logs table 2019-01-21 10:22:03 +01:00
4842bb0880 Merge pull request #2376 from castrapel/fix_letsencrypt_sans
Fix letsencrypt sans
2019-01-17 15:21:18 -08:00
d689f5cda3 Fix LetsEncrypt for duplicate CN/SAN 2019-01-17 14:59:57 -08:00
0336d68ee2 Merge remote-tracking branch 'upstream/master' 2019-01-17 14:56:12 -08:00
7f88c24e83 Fix LetsEncrypt Dyn flow for duplicate CN/SAN 2019-01-17 14:56:04 -08:00
3022af4410 Merge pull request #2367 from hosseinsh/master
fixing-lemur-authorities-CN-filtering
2019-01-15 08:15:59 -08:00
d3284a4006 adjusting the query to filter authorities based on matching CN 2019-01-14 17:52:06 -08:00
f9618def0b Merge branch 'master' of github.com:Netflix/lemur 2019-01-14 17:45:35 -08:00
cbfdd0c531 Merge pull request #2360 from Netflix/compare_cert_hashes
Compare certificate hashes
2019-01-14 13:48:43 -08:00
3567a768d5 Compare certificate hashes to determine if Lemur already has a synced certificate 2019-01-14 13:35:55 -08:00
2c545aa4bc Merge pull request #2359 from castrapel/db_cert_filtering_2
Reduce the expense of joins during cert query
2019-01-14 10:11:28 -08:00
757b99e6e5 Merge branch 'master' into db_cert_filtering_2 2019-01-14 09:35:32 -08:00
31a86687e7 Reduce the expense of joins 2019-01-14 09:20:02 -08:00
42ffeda90d Merge pull request #2358 from castrapel/db_cert_filtering
Optimize DB cert filtering
2019-01-14 08:25:50 -08:00
c4e6e7c59b Optimize DB cert filtering 2019-01-14 08:02:27 -08:00
5ebfba26d7 Merge pull request #2338 from castrapel/more_retries
Be more forgiving to throttling
2019-01-11 11:40:08 -08:00
638a8450a3 Merge branch 'master' into more_retries 2019-01-11 11:25:00 -08:00
0e02e6da79 Be more forgiving to throttling 2019-01-11 11:13:43 -08:00
5118681cb5 Merge pull request #2269 from intgr/verify-cert-private-key
Check that stored private keys match certificates
2019-01-10 17:01:34 -08:00
1570cdb5d4 Merge branch 'master' into verify-cert-private-key 2019-01-10 09:50:57 -08:00
7b70719ea7 Merge pull request #2326 from castrapel/upreq-11019
Update requirements
2019-01-10 09:38:20 -08:00
3ee12cc50b Update requirements 2019-01-10 09:26:15 -08:00
cb42685322 Merge branch 'intgr-verify-cert-private-key' 2019-01-09 16:31:56 -08:00
a1ca61d813 changed a too long comment 2019-01-09 09:50:26 +01:00
707affec01 Merge branch 'master' into ADCS-plugin 2019-01-08 10:59:19 -08:00
cdf9a53a40 Merge branch 'master' into verify-cert-private-key 2019-01-08 10:53:28 -08:00
3637410327 Merge pull request #2290 from bby-bishopclark/patch-1
Update index.rst
2019-01-08 10:52:56 -08:00
7bc95ba6ee Merge branch 'master' into patch-1 2019-01-08 10:51:29 -08:00
c5ed0f3f81 Merge pull request #2312 from castrapel/up-reqs-1-2019
Update requirements with Kombu fix
2019-01-08 10:51:16 -08:00
f1e3777947 Merge branch 'verify-cert-private-key' of https://github.com/intgr/lemur into intgr-verify-cert-private-key 2019-01-08 10:49:30 -08:00
b0a2d2a907 Merge branch 'master' into up-reqs-1-2019 2019-01-08 10:22:59 -08:00
61b64d9353 Merge pull request #2280 from lukasmrtvy/master
WIP: Alpine Docker
2019-01-08 10:22:30 -08:00
c95fde7023 Better fix for kombu is to unpin it and modify makefile 2019-01-08 09:55:53 -08:00
faa91ef2a7 Update requirements with Kombu fix 2019-01-08 09:47:46 -08:00
af88ad0f0d changed broken kombu ref. from 4.2.2 to 4.2.1 because travis build fails 2019-01-07 11:35:56 +01:00
a43476bc87 minor errors after lint fix 2019-01-07 11:04:27 +01:00
054685fc38 Merge branch 'master' into ADCS-plugin 2019-01-07 10:23:18 +01:00
c62bcd1456 repaired several lint errors 2019-01-07 10:02:37 +01:00
3ac5361cb2 Update index.rst
Simple English gaffes noticed while perusing docs -- Setup vs set up, it's vs English, etc.
2019-01-03 07:58:42 -08:00
7cbdc09055 Update entrypoint 2019-01-01 12:09:06 +01:00
125a885742 Update Dockerfile 2019-01-01 11:50:48 +01:00
6c1129c946 Rename docker/lemur.conf.py to docker/src/lemur.conf.py 2019-01-01 11:50:14 +01:00
949ebfa285 Update Dockerfile 2019-01-01 11:49:49 +01:00
248c0d226f Rename docker/default.conf to docker/nginx/default.conf 2019-01-01 11:49:36 +01:00
4570fcf7fa Rename docker/default-ssl.conf to docker/nginx/default-ssl.conf 2019-01-01 11:49:24 +01:00
28382ce728 Update default-ssl.conf 2019-01-01 11:48:42 +01:00
bb4b781d24 Update entrypoint 2019-01-01 11:46:56 +01:00
0d0c295f82 Update entrypoint 2019-01-01 11:33:49 +01:00
3cc63c6618 Update entrypoint 2019-01-01 11:05:45 +01:00
ff0dbdcc5a Update entrypoint 2018-12-31 18:36:02 +01:00
918af0873f Update default-ssl.conf 2018-12-31 18:35:17 +01:00
c0f6e5a134 Update default-ssl.conf 2018-12-31 18:03:39 +01:00
628aaf2748 Update entrypoint 2018-12-31 17:36:52 +01:00
809ca0fcfe Update Dockerfile 2018-12-31 17:13:31 +01:00
4faedf3e5b Update entrypoint 2018-12-31 16:58:51 +01:00
728be37de9 Update Dockerfile 2018-12-31 15:37:48 +01:00
7fb0631ff0 Update entrypoint 2018-12-31 15:37:19 +01:00
542e953919 Check that stored private keys match certificates
This is done in two places:
* Certificate import validator -- throws validation errors.
* Certificate model constructor -- to ensure integrity of Lemur's data
  even when issuer plugins or other code paths have bugs.
2018-12-31 16:28:20 +02:00
6b1d2bfb60 Create default-ssl.conf 2018-12-31 14:55:13 +01:00
341756d7c0 Update entrypoint 2018-12-31 14:07:56 +01:00
d6a374130c Update entrypoint 2018-12-31 13:33:58 +01:00
666f180482 Update Dockerfile 2018-12-31 13:21:30 +01:00
c94557f2ed Update entrypoint 2018-12-31 13:21:13 +01:00
ca6f2b782b Update supervisor.conf 2018-12-31 12:52:07 +01:00
239acb5f95 Update supervisor.conf 2018-12-31 12:49:21 +01:00
25c4672845 Update supervisor.conf 2018-12-31 10:41:19 +01:00
aefdead50a Update entrypoint 2018-12-31 00:04:58 +01:00
e488c0ddcf Update Dockerfile 2018-12-30 23:57:14 +01:00
ba20c07420 Update entrypoint 2018-12-30 23:54:31 +01:00
abd29f8462 Update entrypoint 2018-12-30 23:53:39 +01:00
d5d4241501 Update entrypoint 2018-12-30 23:20:29 +01:00
97f6cdccfc Update Dockerfile 2018-12-30 22:58:06 +01:00
7348fd37e8 Update Dockerfile 2018-12-30 22:50:22 +01:00
2ae6c3a714 Update Dockerfile 2018-12-30 22:48:28 +01:00
a4ce379bce Update lemur.conf.py 2018-12-30 22:46:41 +01:00
692671a543 Update entrypoint 2018-12-30 22:43:55 +01:00
60b84a29b5 Update Dockerfile 2018-12-30 22:28:02 +01:00
58296cff5a Update entrypoint 2018-12-30 22:25:11 +01:00
f8008e8614 Update Dockerfile 2018-12-30 22:01:28 +01:00
ce634bfd08 Create default.conf 2018-12-30 21:49:03 +01:00
4edda34e2d Update entrypoint 2018-12-30 21:47:27 +01:00
d8377ffc57 Update supervisor.conf 2018-12-30 21:44:27 +01:00
3901571685 Update Dockerfile 2018-12-30 21:44:05 +01:00
5567bb2eaa Update Dockerfile 2018-12-30 21:43:04 +01:00
6d5782b44c Create lemur.conf.py 2018-12-30 21:38:05 +01:00
c25c703723 Create entrypoint 2018-12-30 21:37:46 +01:00
7eb6617a28 Create supervisor.conf 2018-12-30 21:37:30 +01:00
fc6caecc0b Update Dockerfile 2018-12-30 21:37:09 +01:00
4ec8490c55 Create Dockerfile 2018-12-30 00:04:13 +01:00
d60b0c8805 Merge pull request #2229 from wfhartford/kubernetes-improvment
Improve the Kubernetes Destination plugin
2018-12-21 13:00:46 -08:00
6a31856d0d Update plugin.py 2018-12-21 12:33:47 -08:00
b5d6abb01f Merge branch 'master' into kubernetes-improvment 2018-12-21 12:06:09 -08:00
954c4dfc16 Merge pull request #2261 from intgr/unicode-in-issuer-name
Properly handle Unicode in issuer name sanitization
2018-12-21 08:39:18 -08:00
b7332957e7 Merge branch 'master' into unicode-in-issuer-name 2018-12-21 07:59:20 -08:00
4bfe9bc921 Merge pull request #2219 from wfhartford/kubernetes-fix
Fix Kubernetes Destination Plugin
2018-12-21 07:58:55 -08:00
70381c4c89 Merge branch 'master' into kubernetes-fix 2018-12-21 07:44:11 -08:00
a14fe08a63 Merge branch 'master' into kubernetes-improvment 2018-12-21 07:42:13 -08:00
fb7605e34b Merge branch 'master' into unicode-in-issuer-name 2018-12-21 07:41:08 -08:00
ae2b227943 Merge pull request #2260 from intgr/deduplicate-before-unique-migration
Deduplicate rows before notification associations unique constraint migration
2018-12-21 07:40:24 -08:00
72f6fdb17d Properly handle Unicode in issuer name sanitization
If the point of sanitization is to get rid of all non-alphanumeric
characters then Unicode characters should probably be forbidden too.

We can re-use the same sanitization function as used for cert 'name'
2018-12-21 16:34:12 +02:00
0f2e30cdae Deduplicate rows before notification associations unique constraint migration 2018-12-21 12:11:33 +02:00
f02178c154 added ADCS issuer and source plugin 2018-12-20 11:54:47 +01:00
194e2a43e7 Merge pull request #1 from Netflix/master
Merge fork with updated master again
2018-12-20 09:10:46 +01:00
fbf48316b1 Minor changes for code review suggestions. 2018-12-18 22:43:32 -05:00
073d05ae21 Merge branch 'kubernetes-fix' into kubernetes-improvment 2018-12-18 22:26:03 -05:00
e7313da03e Minor changes for code review suggestions. 2018-12-18 22:24:48 -05:00
0b39d0fa34 Merge pull request #2242 from castrapel/up-reqs-12182018
Update requirements
2018-12-18 12:48:04 -08:00
49723d9aed Merge branch 'master' into up-reqs-12182018 2018-12-18 12:34:41 -08:00
9e8804dddb Merge pull request #2218 from wfhartford/destination-tpl-fix
Fix textarea and validation on destination page
2018-12-18 12:34:26 -08:00
d01e9f21f9 Merge branch 'master' into up-reqs-12182018 2018-12-18 12:29:37 -08:00
b35d494f2d Update requirements 2018-12-18 12:29:12 -08:00
425a07e988 Merge branch 'master' into destination-tpl-fix 2018-12-18 12:27:35 -08:00
388699be7c Merge pull request #2204 from rmoesbergen/master
Bugfix: Prevent 'unserializable' error for unknown SAN types
2018-12-18 12:27:15 -08:00
513e876e2e Merge branch 'master' into master 2018-12-18 12:18:38 -08:00
04681d9e1e Merge pull request #2227 from sirferl/cli-repair-query
updated query to ignore empty parameters
2018-12-18 12:18:08 -08:00
bc621c1468 Improve the Kubernetes Destination plugin
The plugin now supports loading details from local files rather than requiring them to be entered through the UI. This is especially relaent when Lemur is deployed on Kubernetes as the certificate, token, and current namespace will be injected into the pod. The location these details are injected are the defaults if no configuration details are supplied.

The plugin now supports deploying the secret in three different formats:
* Full - matches the formate used by the plugin prior to these changes.
* TLS - creates a secret of type kubernetes.io/tls and includes the certificate chain and private key, this format is used by many kubernetes features.
* Certificate - creates a secret containing only the certificate chain, suitable for use as trust authority where private keys should _NOT_ be deployed.

The deployed secret can now have a name set through the configuration options; the setting allows the insertion of the placeholder '{common_name}' which will be replaced by the certificate's common name value.

Debug level logging has been added.
2018-12-12 13:25:36 -08:00
a50d80992c updated query to ignore empty parameters 2018-12-12 12:45:48 +01:00
060c78fd91 Fix Kubernetes Destination Plugin
The Kubernetes plugin was broken. There were two major issues:
* The server certificate was entered in a string input making it impossible (as far as I know) to enter a valid PEM certificate.
* The base64 encoding calls were passing strings where bytes were expected.

The fix to the first issue depends on #2218 and a change in the options structure. I've also included some improved input validation and logging.
2018-12-10 15:33:04 -08:00
437d918cf7 Fix textarea and validation on destination page
The destination configuration page did not previously support a textarea input as was supported on most other pages. The validation of string inputs was not being performed. This commit addresses both of those issues and corrects the validation expressions for the AWS and S3 destination plugins so that they continue to function. The SFTP destination plugin does not have any string validation. The Kubernetes plugin does not work at all as far as I can tell; there will be another PR in the coming days to address that.
2018-12-10 12:04:16 -08:00
dcf5ce0eec Merge branch 'master' into master 2018-12-07 13:57:59 +01:00
afc7512914 Merge pull request #2200 from castrapel/notification_fix
Fix notification emails
2018-12-06 12:50:01 -08:00
da87135e02 update reqs 2018-12-06 12:29:16 -08:00
27fdce3842 Merge branch 'master' into notification_fix 2018-12-06 12:26:51 -08:00
c32e20b6fc Fix notifications - Ensure that notifcation e-mails are sent appropriately 2018-12-06 12:25:43 -08:00
e0ac749734 When parsing SAN's, ignore unknown san_types, because in some cases they can contain unparsable/serializable values, resulting in a TypeError(repr(o) + " is not JSON serializable") 2018-12-06 16:47:53 +01:00
f944e6aa32 Merge pull request #2177 from castrapel/multiple_dns_providers
Prefer DNS provider with longest matching zone
2018-11-30 12:53:25 -08:00
2a235fb0e2 Prefer DNS provider with longest matching zone 2018-11-30 12:44:52 -08:00
d36a51fabb Merge pull request #2171 from castrapel/letsencrypt_fix
LetsEncrypt Celery Flow
2018-11-29 09:42:36 -08:00
a90154e0ae LetsEncrypt Celery Flow 2018-11-29 09:29:05 -08:00
67b476e6d7 Merge pull request #2158 from castrapel/celery_pending
Add async call to create pending cert when needed
2018-11-28 15:22:31 -08:00
39b76d18dc add countdown to async call 2018-11-28 14:41:56 -08:00
e074a14ee9 unit test 2018-11-28 14:27:03 -08:00
2381d0a4bb Add async call to create pending cert when needed 2018-11-28 11:32:52 -08:00
c66c8f873e Merge pull request #2127 from rmoesbergen/master
Add support for nested group membership in ldap authenticator
2018-11-26 12:09:37 -08:00
5fc5a058b6 Add documentation for the LDAP_IS_ACTIVE_DIRECTORY setting 2018-11-20 10:51:14 +01:00
da10913045 Only search nested group memberships when LDAP_IS_ACTIVE_DIRECTORY is True 2018-11-20 10:37:36 +01:00
61839f4aca Add support for nested group membership in ldap authenticator 2018-11-19 13:42:42 +01:00
661bc9cc13 Merge pull request #2101 from castrapel/left_outer_join
Left outer join on domains tables to avoid missing results
2018-11-13 15:08:59 -08:00
495b3fd844 Merge branch 'master' into left_outer_join 2018-11-13 14:33:51 -08:00
3ce8abe46e Left outer join on domains tables to avoid missing results 2018-11-13 14:33:17 -08:00
d5bf85b3b0 Merge pull request #2099 from castrapel/count_accurate
More accurate db count functionality
2018-11-13 09:26:14 -08:00
92a771f5ed More accurate db count functionality 2018-11-13 09:14:21 -08:00
9d07b6644f Merge pull request #2092 from castrapel/no_csr_reissue
No csr reissue
2018-11-12 10:01:57 -08:00
29be647911 Merge branch 'master' into no_csr_reissue 2018-11-12 09:54:47 -08:00
a7a05e26bc Do not re-use CSR during certificate reissuance; Update requirement; Add more logging to celery handler 2018-11-12 09:52:11 -08:00
6f0005c78e Avoid colliding LetsEncrypt jobs 2018-11-09 10:31:27 -08:00
de1c2fc500 Merge pull request #2062 from castrapel/optimize_filter_queries
Optimize certificate filtering by name
2018-11-08 08:40:01 -08:00
1643650685 Changing essential part of query 2018-11-07 16:02:04 -08:00
08a2a2b0e5 Optimize certificate filtering by name 2018-11-07 15:34:25 -08:00
a2b22a7d09 Merge pull request #2041 from castrapel/unpin_dependencies_fix_moto
Unpin most dependencies, and fix moto
2018-11-05 15:23:59 -08:00
a3f96b96ee Add fixture to failing function 2018-11-05 15:16:09 -08:00
75183ef2f2 Unpin most dependencies, and fix moto 2018-11-05 14:37:52 -08:00
8e3f9a3c5a Merge pull request #2037 from castrapel/db_optimize_select
Add new gin index to optimize ILIKE queries
2018-11-05 13:32:37 -08:00
b9f511ed02 Updat email on travisci 2018-11-05 13:19:22 -08:00
61738dde9e Run query on DB 2018-11-05 13:15:53 -08:00
73e4396edd Enable on all schemas 2018-11-05 12:58:39 -08:00
bb36d0e0fa Add semicolon 2018-11-05 12:47:05 -08:00
0b697b9d53 Adding travis declaration for pg_trgm extension 2018-11-05 12:19:49 -08:00
b6cc8180fe downgrade flake8 2018-11-05 11:20:11 -08:00
52e773230d Add new gin index to optimize ILIKE queries 2018-11-05 10:29:11 -08:00
baa73c7f3e Merge pull request #1946 from castrapel/safer_reissue
safer reissue, fix celery sync job
2018-10-29 14:41:43 -07:00
0277e4dc05 get_or_increase_name fix for pendingcertificates 2018-10-29 13:53:30 -07:00
50761d9d3b safer reissue, fix celery sync job 2018-10-29 13:22:50 -07:00
f824f76d9c Merge pull request #1944 from castrapel/celery_tasks_sync
Celery task for sync job
2018-10-29 12:08:19 -07:00
a3a8a9d6f7 Merge branch 'master' into celery_tasks_sync 2018-10-29 10:28:52 -07:00
3079cfd08c Merge pull request #1945 from castrapel/itsdangerous_up
update itsdangerous
2018-10-29 10:28:41 -07:00
885b674298 Merge branch 'master' into itsdangerous_up 2018-10-29 09:39:54 -07:00
d4880f3e9d update itsdangerous 2018-10-29 09:39:12 -07:00
56ed416cb7 Celery task for sync job 2018-10-29 09:10:43 -07:00
a8b357965e Merge branch 'master' into get_by_attributes 2018-10-29 08:15:42 -07:00
f0e305c20e Merge pull request #1909 from jchuong/upstream-csr
Add CSR to certificiates
2018-10-29 08:13:48 -07:00
2138930102 Merge branch 'master' into get_by_attributes 2018-10-24 07:20:46 -07:00
75069cd52a Add CSR to certificiates
Add csr column to certificates field, as pending certificates have
exposed the CSR already.  This is required as generating CSR from
existing certificate is will not include SANs due to OpenSSL bug:
https://github.com/openssl/openssl/issues/6481

Change-Id: I9ea86c4f87067ee6d791d77dc1cce8f469cb2a22
2018-10-23 17:46:04 -07:00
9d7ad28ca1 Merge pull request #1890 from castrapel/check_last_updated_5_min
Only resolve pending cert if not attempted in last 5 min
2018-10-23 13:27:50 -07:00
31571ba930 Merge branch 'master' into check_last_updated_5_min 2018-10-23 13:14:30 -07:00
b709eed3c3 Only resolve pending cert if not attempted in last 5 min 2018-10-23 13:08:43 -07:00
b0d8454915 Merge pull request #1889 from castrapel/dash_in_aws_name
Prevent dashes from appearing at end of cert name in AWS
2018-10-23 13:02:43 -07:00
054cc64ee8 Prevent dashes from appearing at end of cert name in AWS 2018-10-23 12:49:58 -07:00
e168221bdc Merge pull request #1888 from castrapel/job_to_clean_expired_unattached_certs
Add celery job to clean all expired / unattached certificates from sources
2018-10-22 15:19:03 -07:00
73ed5164cd deps 2018-10-22 14:51:13 -07:00
b058508478 Merge branch 'master' into get_by_attributes 2018-10-22 09:09:55 -07:00
65060d3321 Merge pull request #1885 from castrapel/requests_up
bump requests to resolve compatibility issues w urllib3 v1.24
2018-10-22 09:09:29 -07:00
ac0e9b4b81 bump requests to resolve compatibility issues w urllib3 v1.24 2018-10-19 16:13:26 -07:00
f263be96b8 Merge pull request #1884 from castrapel/unq_sources_label
Add unique constraint to sources table - label column
2018-10-19 15:46:44 -07:00
e83699b6ae Add unique constraint to sources table - label column 2018-10-19 15:34:34 -07:00
81d114092e Merge branch 'github' into get_by_attributes 2018-10-17 12:00:36 -04:00
48017a9d4c Added get_by_attributes to the certificates service, for fetching certs based on arbitrary attributes. Also associated test and extra tests for other service methods 2018-10-17 11:42:09 -04:00
c6b679bb19 Merge pull request #1831 from castrapel/lemur_letsencrypt_resolved_info
Lemur LetsEncrypt Polling Support
2018-10-12 07:33:48 -07:00
a912c3488d python fix to retrigger tests 2018-10-12 07:25:58 -07:00
89a077e54c minor change to pass stuck github check 2018-10-12 07:14:31 -07:00
13ef965666 nit: comments 2018-10-12 05:56:14 -07:00
6073f9e7b6 datetime ref fix 2018-10-12 05:51:30 -07:00
4b3d458dba Celery task to delete old pending certs 2018-10-12 05:47:16 -07:00
3d8c4af543 Merge branch 'master' into lemur_letsencrypt_resolved_info 2018-10-12 05:25:31 -07:00
cc18a68c00 Lemur LetsEncrypt Polling Support 2018-10-11 22:01:05 -07:00
b83c5eca49 Merge pull request #1823 from castrapel/indexes_domains_certs
add indexes to domains and certificates tables to optimize load time
2018-10-11 13:07:23 -07:00
e91d8ec81b add indexes to domains and certificates tables to optimize load time 2018-10-11 11:36:50 -07:00
318527223b Merge pull request #1779 from explody/improved_verify
Improved verify
2018-10-04 11:27:13 -07:00
79033f42b4 Merge branch 'master' into improved_verify 2018-10-02 09:19:24 -04:00
40f4444099 Flake8 fix in test_verify.py 2018-10-01 22:04:31 -04:00
eb7eb6ae88 Merge pull request #1783 from castrapel/verisign_ct_option
Enable optional verisign cloud transparency configuration
2018-10-01 09:32:13 -07:00
56282845fa Enable optional verisign cloud transparency configuration 2018-10-01 09:20:50 -07:00
50919d85a8 Merge remote-tracking branch 'upstream/master' into improved_verify 2018-09-27 11:19:06 -04:00
590fac4aa8 docstring update in verify.py 2018-09-27 10:11:13 -04:00
f19b6382bc Updated verify tests 2018-09-27 10:10:04 -04:00
11f2210894 Merge branch 'improved_verify' of github.com:explody/lemur into improved_verify 2018-09-27 09:28:45 -04:00
652d7f65dd flake8 tweak 2018-09-27 09:28:21 -04:00
c7b57e21a5 Merge pull request #1711 from castrapel/celery_092018
Celery integration
2018-09-17 15:36:06 -07:00
54ba7a053a up reqs 2018-09-17 10:57:03 -07:00
563f0fb9b2 Celery refactoring, celery beat job in configuration 2018-09-17 10:52:12 -07:00
23382b2777 Celery integration 2018-09-13 10:35:54 -07:00
3c521f66a5 Merge pull request #1691 from castrapel/fix_import_v1
Fix certificate import issues
2018-09-10 11:05:56 -07:00
c09d8ae630 Merge branch 'master' into fix_import_v1 2018-09-10 10:35:31 -07:00
7d42e4ce67 Fix certificate import issues 2018-09-10 10:34:47 -07:00
72858e7412 Merge pull request #1690 from castrapel/message-notifications
Add more logging to messaging
2018-09-10 09:57:13 -07:00
f6a130b09d Add more logging to messaging 2018-09-10 09:13:31 -07:00
c9836fbf25 Merge branch 'master' into improved_verify 2018-09-06 07:33:55 -07:00
85b035e6ad Merge pull request #1655 from gesquive/missing_reqs
add missing requirements files for setup
2018-09-05 15:38:56 -07:00
d9aeef363e Merge branch 'master' into missing_reqs 2018-09-05 14:49:48 -07:00
0ab0caa375 Merge pull request #1661 from gesquive/cfssl_error_msg
cfssl plugin error message typo
2018-09-05 14:49:30 -07:00
82e69db0c5 fix error message typo 2018-09-04 10:21:34 -05:00
b503594ac0 add missing requirements files for setup 2018-08-31 13:02:53 -05:00
2815ddf6c8 Moved cert object to be passed to both ocsp/crl methods so we can report in better detail on the certs. Ensured proper returns of False (revoked) True (good) None (unknown) throughout the methods. 2018-08-31 13:34:55 -04:00
34c88494b8 More specific exception catch for cert parsing. line shortening. 2018-08-31 12:19:55 -04:00
7dbca821c3 Reducing the stacked exceptions plus a bit of pep8 2018-08-31 12:01:49 -04:00
b3c4324728 Merge pull request #1630 from castrapel/validate_config_fix
Validate config - fix for issue#1629
2018-08-28 10:08:14 -07:00
d82a615e17 Validate config - fix for issue#1629 2018-08-28 09:15:28 -07:00
cfbb3a205b Merge pull request #1612 from andrewachen/crt-sh-link
Add link to search for certificate in crt.sh.
2018-08-27 10:00:38 -07:00
5797fd4042 Merge pull request #1620 from castrapel/recommit-achen
recommit https://github.com/Netflix/lemur/pull/1612
2018-08-27 10:00:21 -07:00
453bb43157 recommit https://github.com/Netflix/lemur/pull/1612 2018-08-27 09:50:02 -07:00
9d56ae3add Merge branch 'master' into crt-sh-link 2018-08-27 09:23:24 -07:00
dee9bbdfad Merge pull request #1619 from castrapel/up-reqs-828v2
Up reqs 828v2
2018-08-27 09:23:09 -07:00
b8b0f77ff8 Update requirements 2018-08-27 09:00:04 -07:00
7ad24042c1 Add link to search for certificate in crt.sh. 2018-08-24 14:16:25 -07:00
51f05764e0 Merge remote-tracking branch 'upstream/master' 2018-08-23 11:07:46 -07:00
9aac7c2269 Merge pull request #1600 from Netflix/revert-1599-precommit
Revert "Precommit - Fix linty things"
2018-08-22 14:07:06 -07:00
1b77dfa47a Revert "Precommit - Fix linty things" 2018-08-22 13:21:35 -07:00
cdc385ea16 Merge remote-tracking branch 'upstream/master' 2018-08-22 13:18:03 -07:00
bc88d3514c Revert "Merge pull request #1589 from castrapel/issue_1570_ignorecasev2"
This reverts commit a21b71a0e2, reversing
changes made to 075b18e5db.
2018-08-22 13:17:33 -07:00
e21693cb18 Merge pull request #1599 from castrapel/precommit
Precommit - Fix linty things
2018-08-22 10:55:59 -07:00
3e9726d9db Precommit work 2018-08-22 10:38:09 -07:00
a21b71a0e2 Merge pull request #1589 from castrapel/issue_1570_ignorecasev2
Allow case insensitive role matching for cert permissions
2018-08-20 09:03:55 -07:00
6abf274680 Allow case insensitive role matching for cert permissions 2018-08-20 08:55:04 -07:00
075b18e5db Merge pull request #1584 from castrapel/issue_1570_ignorecase
Increase LetsEncrypt Timeout
2018-08-17 17:17:37 -07:00
a0aa78a529 Merge branch 'master' into issue_1570_ignorecase 2018-08-17 16:59:35 -07:00
9f64f0523b Increase timeouts 2018-08-17 15:36:56 -07:00
43ae6c39e3 wait right here 2018-08-17 12:14:02 -07:00
c5fb2422da Merge pull request #1576 from castrapel/issue_1570_ignorecase
force owner into lowercase. Properly decode bytecode private key
2018-08-17 11:26:03 -07:00
7f9a035802 Fix private key bytecode issue 2018-08-17 10:59:01 -07:00
a6b1f33208 Ensure owner names are lowercase for new / updated certificates 2018-08-17 10:41:55 -07:00
cc4cdfcf13 Merge pull request #1575 from castrapel/fix_validity
allow null validity periods
2018-08-17 08:51:53 -07:00
1ad61b1550 allow null validity periods 2018-08-17 07:57:55 -07:00
29556e9f8c Merge pull request #1573 from castrapel/better_dnsprovider_handling
Better dnsprovider handling
2018-08-16 10:33:58 -07:00
be9d683e46 fix merge 2018-08-16 10:15:48 -07:00
da99bcda68 Better zone handling 2018-08-16 10:12:19 -07:00
f3d9513df2 Merge pull request #1561 from castrapel/le_fix
Allow proper detection of zones, fix certificate detection
2018-08-14 15:01:29 -07:00
2c22c9c2f1 Allow proper detection of zones, fix certificate detection 2018-08-14 14:37:45 -07:00
e050177c08 Merge pull request #1553 from castrapel/fix_le_renew
Allow auto-detection of DNS providers / Fix acme renewal flow
2018-08-13 15:22:45 -07:00
1a5abe6550 fix lint 2018-08-13 15:11:57 -07:00
cc836433fb formatting 2018-08-13 15:06:16 -07:00
5829794d82 typo fix 2018-08-13 14:25:54 -07:00
bb026b8b59 Allow LetsEncrypt renewals and requesting certificates without specifying DNS provider 2018-08-13 14:22:59 -07:00
771be58dc5 Merge pull request #1511 from intgr/unittests-use-valid-certs
Fix unit tests certificates to have correct chains and private keys
2018-08-07 10:04:56 -07:00
ab37189022 Merge branch 'master' into unittests-use-valid-certs 2018-08-07 09:42:39 -07:00
3463848cb5 Merge pull request #1509 from intgr/fill-missing-rotation-policy
Fill in missing cert rotation_policy; don't ignore validation errors when re-issuing certs
2018-08-07 09:40:09 -07:00
cf71f88680 Merge branch 'master' into fill-missing-rotation-policy 2018-08-07 08:23:29 -07:00
234533e367 Merge branch 'master' into unittests-use-valid-certs 2018-08-07 08:13:48 -07:00
e0c6d6dd7d Merge pull request #1530 from castrapel/up-reqs8718
Up reqs8718
2018-08-07 08:13:32 -07:00
c82f3bbf0f updating requirements 2018-08-07 07:48:09 -07:00
51d5a897c2 Merge remote-tracking branch 'upstream/master' 2018-08-07 07:47:07 -07:00
7f821abfef Fixed invalid JSON payloads (making API requests fail in particular) (#1522) 2018-08-07 07:46:59 -07:00
1edb964da9 Delete dead code in unit tests (#1510) 2018-08-07 07:46:59 -07:00
400bcaf085 Add .pytest_cache dir to .gitignore (#1512) 2018-08-07 07:46:58 -07:00
583bbee606 remove debug print 2018-08-07 07:46:58 -07:00
7463d47057 Support LetsEncrypt accounts 2018-08-07 07:46:58 -07:00
46cd1a21f7 Proper flask_restful boolean parsing.
This is documented here: https://github.com/flask-restful/flask-restful/issues/488
2018-08-07 07:46:58 -07:00
82c7530b6f fix deletion 2018-08-07 07:46:58 -07:00
6d8217e00f requirements 2018-08-07 07:46:58 -07:00
cc735e9b33 Error logging 2018-08-07 07:46:58 -07:00
19753632a9 Show and send error for pending certs 2018-08-07 07:46:58 -07:00
a3e1d08ba2 Adding pessimistic sqlalchemy disconnection handling 2018-08-07 07:46:58 -07:00
5e34287530 no bare except 2018-08-07 07:46:57 -07:00
dd7c9e3f88 Explicit capture exception during create failure 2018-08-07 07:46:57 -07:00
d8652fad36 Unpinning requests 2018-08-07 07:46:57 -07:00
58ec0bab09 updated requirements 2018-08-07 07:46:57 -07:00
094b2fd5a9 Clean up module imports
Example:
* import lemur.common.utils -> from lemur.common import utils
* import sqlalchemy.types as types -> from sqlalchemy import types
2018-08-07 07:46:57 -07:00
85285b5e62 Cache parsed certificate instead of re-parsing for each field
Use @cached_property decorator to cache the results of parse_certificate().

This significantly cuts down on the number of times certs need to be
parsed for a list view.
2018-08-07 07:46:57 -07:00
16dc7dc2f6 no bare except 2018-08-07 07:46:57 -07:00
f53067ab29 Explicit capture exception during create failure 2018-08-07 07:46:56 -07:00
efd33db69d Unpinning requests 2018-08-07 07:46:56 -07:00
5b13032aec Adds an optional interval variable to notification service's
create_default_expiration_notifications and introduces a new optional
configuration variable, LEMUR_SECURITY_TEAM_EMAIL_INTERVALS, to allow admins
control over the centralized email notification defaults.
2018-08-07 07:46:56 -07:00
177208f9da updated requirements 2018-08-07 07:46:56 -07:00
b8d017418a Clean up module imports
Example:
* import lemur.common.utils -> from lemur.common import utils
* import sqlalchemy.types as types -> from sqlalchemy import types
2018-08-07 07:46:56 -07:00
ce6e64bd17 Cache parsed certificate instead of re-parsing for each field
Use @cached_property decorator to cache the results of parse_certificate().

This significantly cuts down on the number of times certs need to be
parsed for a list view.
2018-08-07 07:46:56 -07:00
6ce044806b initial commit 2018-08-07 07:46:56 -07:00
68203436e0 Sinful Use of $
Using the `$` sign within any block of text already marked as a code block is a grievous sin due to the fact that it makes it 100% pointless for you to have USED THE CODE BLOCK IN THE FIRST PLACE!

The `$` becomes included in the text we're trying to highlight for us to be able to actually use in our own projects.

Why post the info if you don't want us to use it.

Thank you.
2018-08-07 07:46:55 -07:00
f9a7b97839 Merge branch 'master' into unittests-use-valid-certs 2018-08-07 07:45:45 -07:00
2869042f38 Fixed invalid JSON payloads (making API requests fail in particular) (#1522) 2018-08-03 15:26:48 -07:00
82158aece6 Fill in missing cert rotation_policy; don't ignore validation errors when re-issuing certs
CertificateInputSchema requires the rotation_policy field, but
certificates created before the field existed have set to NULL. Thus
saving such certificates failed and probably caused other errors.

Made cert re-issuing (get_certificate_primitives) more strict so such
errors are harder to miss in the future.
2018-08-03 20:06:21 +03:00
1f0f432327 Fix unit tests certificates to have correct chains and private keys
In preparation for certificate integrity-checking: invalid certificate
chains and mismatching private keys will no longer be allowed anywhere
in Lemur code.

The test vector certs were generated using the Lemur "cryptography"
authority plugin.

* Certificates are now more similar to real-world usage: long serial
  numbers, etc.
* Private key is included for all certs, so it's easy to re-generate
  anything if needed.
2018-08-03 19:45:13 +03:00
acd2701fa2 Delete dead code in unit tests (#1510) 2018-08-03 08:21:55 -07:00
bb0c229d7e Add .pytest_cache dir to .gitignore (#1512) 2018-08-03 08:12:04 -07:00
3f9d66bd51 Merge pull request #1497 from castrapel/letsencrypt_account_support
Letsencrypt account support
2018-07-30 15:37:35 -07:00
025d177565 Merge branch 'master' into letsencrypt_account_support 2018-07-30 15:28:29 -07:00
44192d4494 remove debug print 2018-07-30 15:27:23 -07:00
4b5e93cd3c Merge pull request #1491 from mikegrima/booleans
Proper flask_restful boolean parsing
2018-07-30 15:25:52 -07:00
0889076d3b Support LetsEncrypt accounts 2018-07-30 15:25:02 -07:00
d6b482755b Proper flask_restful boolean parsing.
This is documented here: https://github.com/flask-restful/flask-restful/issues/488
2018-07-30 13:49:41 -07:00
b70885595f Merge pull request #1488 from castrapel/fix_delete
fix deletion
2018-07-27 16:44:23 -07:00
caf99d36d6 fix deletion 2018-07-27 15:52:22 -07:00
35341a6828 Merge pull request #1487 from castrapel/cancel_pending_cert_failures
Cancel pending cert failures
2018-07-27 14:26:52 -07:00
2bb00bc666 requirements 2018-07-27 14:20:22 -07:00
e16c1de001 Error logging 2018-07-27 14:17:50 -07:00
2a6dda07eb Show and send error for pending certs 2018-07-27 14:15:14 -07:00
4fa8f9ecc0 Merge pull request #1468 from castrapel/fix_db
http://docs.sqlalchemy.org/en/latest/core/pooling.html#disconnect-handling-pessimistic
2018-07-23 11:07:45 -07:00
9b29f9f819 Adding pessimistic sqlalchemy disconnection handling 2018-07-23 10:57:22 -07:00
faa1779204 Merge remote-tracking branch 'upstream/master' 2018-07-23 10:29:52 -07:00
2f51fea743 no bare except 2018-07-20 13:43:47 -07:00
c78077d8d6 Explicit capture exception during create failure 2018-07-20 13:43:47 -07:00
0bb7a6e125 Unpinning requests 2018-07-20 13:43:47 -07:00
bd9203fcbc Adds an optional interval variable to notification service's
create_default_expiration_notifications and introduces a new optional
configuration variable, LEMUR_SECURITY_TEAM_EMAIL_INTERVALS, to allow admins
control over the centralized email notification defaults.
2018-07-20 13:43:47 -07:00
af8cf2d550 updated requirements 2018-07-20 13:43:47 -07:00
d071d85486 Clean up module imports
Example:
* import lemur.common.utils -> from lemur.common import utils
* import sqlalchemy.types as types -> from sqlalchemy import types
2018-07-20 13:43:47 -07:00
04ee1656ee Cache parsed certificate instead of re-parsing for each field
Use @cached_property decorator to cache the results of parse_certificate().

This significantly cuts down on the number of times certs need to be
parsed for a list view.
2018-07-20 13:43:47 -07:00
56372c55b4 initial commit 2018-07-20 13:43:47 -07:00
7146c4cb71 Sinful Use of $
Using the `$` sign within any block of text already marked as a code block is a grievous sin due to the fact that it makes it 100% pointless for you to have USED THE CODE BLOCK IN THE FIRST PLACE!

The `$` becomes included in the text we're trying to highlight for us to be able to actually use in our own projects. 

Why post the info if you don't want us to use it. 

Thank you.
2018-07-20 13:43:47 -07:00
b0847e2fa1 Merge pull request #1457 from castrapel/better_sentry
Better sentry
2018-07-20 11:16:49 -07:00
f93e938cda no bare except 2018-07-20 10:53:47 -07:00
5a01840784 Explicit capture exception during create failure 2018-07-20 10:47:19 -07:00
0a0992fffe Merge remote-tracking branch 'upstream/master' 2018-07-20 10:08:40 -07:00
2a5f713f97 initial commit 2018-07-20 10:07:32 -07:00
3ac440b6b5 Sinful Use of $
Using the `$` sign within any block of text already marked as a code block is a grievous sin due to the fact that it makes it 100% pointless for you to have USED THE CODE BLOCK IN THE FIRST PLACE!

The `$` becomes included in the text we're trying to highlight for us to be able to actually use in our own projects. 

Why post the info if you don't want us to use it. 

Thank you.
2018-07-20 10:07:32 -07:00
db9891d8cf Merge pull request #1433 from castrapel/update-requests
Unpinning requests
2018-07-17 19:24:57 -07:00
be9be6d3cd Unpinning requests 2018-07-17 18:38:15 -07:00
b02c00bbf1 Merge pull request #1431 from Netflix/security_notifications_config
Adds an optional interval variable to notification service's
2018-07-13 15:51:26 -07:00
7f3454128d Adds an optional interval variable to notification service's
create_default_expiration_notifications and introduces a new optional
configuration variable, LEMUR_SECURITY_TEAM_EMAIL_INTERVALS, to allow admins
control over the centralized email notification defaults.
2018-07-13 14:08:31 -07:00
4922f4dd40 Merge pull request #1426 from jpartain89/patch-1
Sinful Use of `$`
2018-07-12 21:53:17 -07:00
e3de9baaeb Merge branch 'master' into patch-1 2018-07-12 21:37:33 -07:00
5df280e94d Merge pull request #1429 from Brett-Wood/master
Missing file lemur/dns_providers/__init__.py
2018-07-12 21:37:12 -07:00
5afc9ba739 Merge branch 'master' into master 2018-07-12 15:37:44 -07:00
983636c502 Merge pull request #1430 from castrapel/upreqs71218
Update requirements
2018-07-12 15:37:31 -07:00
a19a47dba1 updated requirements 2018-07-12 13:24:44 -07:00
ead374db5f Clean up module imports
Example:
* import lemur.common.utils -> from lemur.common import utils
* import sqlalchemy.types as types -> from sqlalchemy import types
2018-07-12 13:23:38 -07:00
2f32014c75 Cache parsed certificate instead of re-parsing for each field
Use @cached_property decorator to cache the results of parse_certificate().

This significantly cuts down on the number of times certs need to be
parsed for a list view.
2018-07-12 13:23:38 -07:00
4f4be51ac8 Merge remote-tracking branch 'upstream/master' 2018-07-12 11:21:31 -07:00
149caa5602 Clean up module imports
Example:
* import lemur.common.utils -> from lemur.common import utils
* import sqlalchemy.types as types -> from sqlalchemy import types
2018-07-12 11:21:18 -07:00
b472e5e648 Cache parsed certificate instead of re-parsing for each field
Use @cached_property decorator to cache the results of parse_certificate().

This significantly cuts down on the number of times certs need to be
parsed for a list view.
2018-07-12 11:21:18 -07:00
64132ba92b Expose certificate dateCreated via API 2018-07-12 11:21:18 -07:00
9ef356f59d reformat code (noop) 2018-07-12 11:21:17 -07:00
825844107e updates 2018-07-12 11:21:17 -07:00
8dc52b859b initial commit 2018-07-11 11:57:36 -05:00
86082009b9 Sinful Use of $
Using the `$` sign within any block of text already marked as a code block is a grievous sin due to the fact that it makes it 100% pointless for you to have USED THE CODE BLOCK IN THE FIRST PLACE!

The `$` becomes included in the text we're trying to highlight for us to be able to actually use in our own projects. 

Why post the info if you don't want us to use it. 

Thank you.
2018-07-09 23:24:35 -05:00
5b70504144 Merge pull request #1395 from intgr/import-police
Clean up module imports
2018-07-09 10:13:08 -07:00
0398c6e723 Clean up module imports
Example:
* import lemur.common.utils -> from lemur.common import utils
* import sqlalchemy.types as types -> from sqlalchemy import types
2018-07-07 23:56:23 +03:00
c568e41296 Merge pull request #1388 from intgr/cache-parsed-cert
Cache parsed certificate instead of re-parsing for each field
2018-07-06 09:40:40 -07:00
d690ea32bc Cache parsed certificate instead of re-parsing for each field
Use @cached_property decorator to cache the results of parse_certificate().

This significantly cuts down on the number of times certs need to be
parsed for a list view.
2018-07-03 17:31:44 +03:00
48c378127f Merge pull request #1394 from intgr/date-created
Expose certificate dateCreated via API
2018-07-02 13:12:22 -07:00
50846eb682 Expose certificate dateCreated via API 2018-07-02 18:24:18 +03:00
5c0cc69d22 Merge pull request #1409 from castrapel/up-reqs-6292018
reformat code (noop)
2018-06-29 15:39:05 -07:00
74d9fa58be Merge branch 'master' into up-reqs-6292018 2018-06-29 15:28:21 -07:00
1a02740b67 reformat code (noop) 2018-06-29 15:24:31 -07:00
acd473683e Merge pull request #1408 from castrapel/update-reqs
Update reqs
2018-06-29 14:14:02 -07:00
090619151e updates 2018-06-29 14:03:45 -07:00
846027b9e3 Merge remote-tracking branch 'upstream/master' 2018-06-28 13:51:23 -07:00
f9539cfba5 tests 2018-06-28 11:12:55 -07:00
9375862ee2 lint 2018-06-28 11:12:55 -07:00
4818cc4eb9 lint 2018-06-28 11:12:55 -07:00
65461d7418 Update requirements 2018-06-28 11:12:55 -07:00
ad73abced1 Support concurrent issuance in Route53 for LetsEncrypt 2018-06-28 11:12:55 -07:00
261b024bf4 Upgrade dependency boto3 to ==1.7.39 2018-06-28 11:12:54 -07:00
20292275b5 update requirements while we're at it 2018-06-28 11:12:54 -07:00
e912b8e075 Graceful cancellation of pending cert and order details in log for acme failure 2018-06-28 11:12:54 -07:00
4551cc11df update requirements 2018-06-28 11:12:54 -07:00
14b8892cce Limit dns queries to 10 attempts 2018-06-28 11:12:54 -07:00
284e57ad68 boto update. They updated between this and the last change 2018-06-28 11:12:54 -07:00
b46023bb4c lint 2018-06-28 11:12:54 -07:00
3002945d55 Fix unique dyn situation where zone does not match tld, and there's a deeper zone 2018-06-28 11:12:53 -07:00
0d4df75375 update requirements 2018-06-28 11:12:53 -07:00
78c4a86371 remove linuxdst plugin 2018-06-28 11:12:53 -07:00
367 changed files with 26278 additions and 7582 deletions

View File

@ -0,0 +1,41 @@
# This workflow will upload a Python Package using Twine when a Lemur release is created via github
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Publish Lemur's latest package to PyPI
on:
release:
types: [created]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Autobump version
run: |
# from refs/tags/v0.8.1 get 0.8.1
VERSION=$(echo $GITHUB_REF | sed 's#.*/v##')
PLACEHOLDER='__version__ = "develop"'
VERSION_FILE='lemur/__about__.py'
# in case placeholder is missing, exists with code 1 and github actions aborts the build
grep "$PLACEHOLDER" "$VERSION_FILE"
sed -i "s/$PLACEHOLDER/__version__ = \"${VERSION}\"/g" "$VERSION_FILE"
shell: bash
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.LEMUR_PYPI_API_USERNAME }}
TWINE_PASSWORD: ${{ secrets.LEMUR_PYPI_API_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*

8
.gitignore vendored
View File

@ -10,6 +10,7 @@
*.db
*.pid
*.enc
*.env
MANIFEST
test.conf
pip-log.txt
@ -25,10 +26,17 @@ package-lock.json
/lemur/static/dist/
/lemur/static/app/vendor/
/wheelhouse
/lemur/lib
/lemur/bin
/lemur/lib64
/lemur/include
docs/_build
.editorconfig
.idea
.pytest_cache
lemur/tests/tmp
/lemur/plugins/lemur_email/tests/expiration-rendered.html
/lemur/plugins/lemur_email/tests/rotation-rendered.html
.celerybeat-schedule

View File

@ -8,3 +8,17 @@
sha: v2.9.5
hooks:
- id: jshint
- repo: https://github.com/ambv/black
rev: stable
hooks:
- id: black
language_version: python3.7
- repo: local
hooks:
- id: python-bandit-vulnerability-check
name: bandit
entry: bandit
args: ['--ini', 'tox.ini', '-r', 'consoleme']
language: system
pass_filenames: false

23
.readthedocs.yml Normal file
View File

@ -0,0 +1,23 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
fail_on_warning: true
# Build docs in all formats (html, pdf, epub)
formats: all
# Set the version of Python and requirements required to build the docs
python:
version: 3.7
install:
- requirements: requirements-docs.txt
- method: setuptools
path: .
system_packages: true

View File

@ -1,17 +1,50 @@
language: python
sudo: required
dist: trusty
node_js:
- "6.2.0"
- "10"
jobs:
include:
- name: "python3.7-postgresql-9.4-bionic"
dist: bionic
language: python
python: "3.7"
env: TOXENV=py37
addons:
postgresql: "9.4"
matrix:
include:
- python: "3.5"
env: TOXENV=py35
chrome: stable
services:
- xvfb
- name: "python3.7-postgresql-10-bionic"
dist: bionic
language: python
python: "3.7"
env: TOXENV=py37
addons:
postgresql: '10'
chrome: stable
apt:
packages:
- postgresql-10
- postgresql-client-10
- postgresql-server-dev-10
services:
- postgresql
- xvfb
- name: "python3.8-postgresql-12-focal"
dist: focal
language: python
python: "3.8"
env: TOXENV=py38
addons:
postgresql: '12'
chrome: stable
apt:
packages:
- postgresql-12
- postgresql-client-12
- postgresql-server-dev-12
services:
- postgresql
- xvfb
cache:
directories:
@ -21,16 +54,29 @@ cache:
env:
global:
- PIP_DOWNLOAD_CACHE=".pip_download_cache"
# The following line is a temporary workaround for this issue: https://github.com/pypa/setuptools/issues/2230
- SETUPTOOLS_USE_DISTUTILS=stdlib
# do not load /etc/boto.cfg with Python 3 incompatible plugin
# https://github.com/travis-ci/travis-ci/issues/5246#issuecomment-166460882
- BOTO_CONFIG=/doesnotexist
before_install:
- export CHROME_BIN=/usr/bin/google-chrome
before_script:
- sudo systemctl stop postgresql
# the port may have been auto-configured to use 5433 if it thought 5422 was already in use,
# for some reason it happens very often
# https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/bash/travis_setup_postgresql.bash#L52
- sudo sed -i -e 's/5433/5432/' /etc/postgresql/*/main/postgresql.conf
- sudo systemctl restart postgresql
- psql -c "create database lemur;" -U postgres
- psql -c "create user lemur with password 'lemur;'" -U postgres
- psql lemur -c "create extension IF NOT EXISTS pg_trgm;" -U postgres
- npm config set registry https://registry.npmjs.org
- npm install -g bower
- npm install -g npm@latest bower
- pip install --upgrade setuptools
- export DISPLAY=:99.0
install:
- pip install coveralls
@ -39,10 +85,15 @@ install:
script:
- make test
- bandit -r . -ll -ii -x lemur/tests/,docs
- make test-js
after_success:
- coveralls
notifications:
email:
kglisson@netflix.com
recipients:
- lemur@netflix.com
on_success: never
on_failure: always
on_cancel: never # Dependbot cancels Travis before rebase and triggers too many emails

View File

@ -1,9 +1,121 @@
Changelog
=========
0.8.1 - `2021-03-12`
~~~~~~~~~~~~~~~~~~~~
This release includes improvements on many fronts, such as:
- Notifications:
- Enhanced SNS flow
- Expiration Summary
- CA expiration email
- EC algorithm as the default
- Improved revocation flow
- Localized AWS STS option
- Improved Lemur doc building
- ACME:
- reduced failed attempts to 3x trials
- support for selecting the chain (Let's Encrypt X1 transition)
- revocation
- http01 documentation
- Entrust:
- Support for cross-signed intermediate CA
- Revised disclosure process
- Dependency updates and conflict resolutions
Special thanks to all who contributed to this release, notably:
- `peschmae <https://github.com/peschmae>`_
- `atugushev <https://github.com/atugushev>`_
- `sirferl <https://github.com/sirferl>`_
0.8.0 - `2020-11-13`
~~~~~~~~~~~~~~~~~~~~
This release comes after more than two years and contains many interesting new features and improvements.
In addition to multiple new plugins, such as ACME-http01, ADCS, PowerDNS, UltraDNS, Entrust, SNS, many of Lemur's existing
flows have improved.
In the future, we plan to do frequent releases.
Summary of notable changes:
- AWS S3 plugin: added delete, get methods, and support for uploading/deleting acme tokens
- ACME plugin:
- revamp of the plugin
- support for http01 domain validation, via S3 and SFTP as destination for the acme token
- support for CNAME delegated domain validation
- store-acme-account-details
- PowerDNS plugin
- UltraDNS plugin
- ADCS plugin
- SNS plugin
- Entrust plugin
- Rotation:
- respecting keyType and extensions
- region-by-region rotation option
- default to auto-rotate when cert attached to endpoint
- default to 1y validity during rotation for multi-year browser-trusted certs
- Certificate: search_by_name, and important performance improvements
- UI
- reducing the EC curve options to the relevant ones
- edit option for notifications, destinations and sources
- showing 13 month validity as default
- option to hide certs expired since 3month
- faster Permalink (no search involved)
- commonName Auto Added as DNS in the UI
- improved search and cert lookup
- celery tasks instead of crone, for better logging and monitoring
- countless bugfixes
- group-lookup-fix-referral
- url_context_path
- duplicate notification
- digicert-time-bug-fix
- improved-csr-support
- fix-cryptography-intermediate-ca
- enhanced logging
- vault-k8s-auth
- cfssl-key-fix
- cert-sync-endpoint-find-by-hash
- nlb-naming-bug
- fix_vault_api_v2_append
- aid_openid_roles_provider_integration
- rewrite-java-keystore-use-pyjks
- vault_kv2
To see the full list of changes, you can run
$ git log --merges --first-parent master --pretty=format:"%h %<(10,trunc)%aN %C(white)%<(15)%ar%Creset %C(red bold)%<(15)%D%Creset %s" | grep -v "depend"
Special thanks to all who contributed to this release, notably:
- `peschmae <https://github.com/peschmae>`_
- `sirferl <https://github.com/sirferl>`_
- `lukasmrtvy <https://github.com/lukasmrtvy>`_
- `intgr <https://github.com/intgr>`_
- `kush-bavishi <https://github.com/kush-bavishi>`_
- `alwaysjolley <https://github.com/alwaysjolley>`_
- `jplana <https://github.com/jplana>`_
- `explody <https://github.com/explody>`_
- `titouanc <https://github.com/titouanc>`_
- `jramosf <https://github.com/jramosf>`_
Upgrading
---------
.. note:: This release will need a migration change. Please follow the `documentation <https://lemur.readthedocs.io/en/latest/administration.html#upgrading-lemur>`_ to upgrade Lemur.
0.7 - `2018-05-07`
~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~
This release adds LetsEncrypt support with DNS providers Dyn, Route53, and Cloudflare, and expands on the pending certificate functionality.
The linux_dst plugin will also be deprecated and removed.
@ -40,8 +152,7 @@ Happy Holidays! This is a big release with lots of bug fixes and features. Below
Features:
* Per-certificate rotation policies, requires a database migration. The default rotation policy for all certificates.
is 30 days. Every certificate will gain a policy regardless of if auto-rotation is used.
* Per-certificate rotation policies, requires a database migration. The default rotation policy for all certificates is 30 days. Every certificate will gain a policy regardless of if auto-rotation is used.
* Adds per-user API Keys, allows users to issue multiple long-lived API tokens with the same permission as the user creating them.
* Adds the ability to revoke certificates from the Lemur UI/API, this is currently only supported for the digicert CIS and cfssl plugins.
* Allow destinations to support an export function. Useful for file system destinations e.g. S3 to specify the export plugin you wish to run before being sent to the destination.
@ -85,13 +196,9 @@ Big thanks to neilschelly for quite a lot of improvements to the `lemur-cryptogr
Other Highlights:
* Closed `#501 <https://github.com/Netflix/lemur/issues/501>`_ - Endpoint resource as now kept in sync via an
expiration mechanism. Such that non-existant endpoints gracefully fall out of Lemur. Certificates are never
removed from Lemur.
* Closed `#551 <https://github.com/Netflix/lemur/pull/551>`_ - Added the ability to create a 4096 bit key during certificate
creation. Closed `#528 <https://github.com/Netflix/lemur/pull/528>`_ to ensure that issuer plugins supported the new 4096 bit keys.
* Closed `#566 <https://github.com/Netflix/lemur/issues/566>`_ - Fixed an issue changing the notification status for certificates
without private keys.
* Closed `#501 <https://github.com/Netflix/lemur/issues/501>`_ - Endpoint resource as now kept in sync via an expiration mechanism. Such that non-existant endpoints gracefully fall out of Lemur. Certificates are never removed from Lemur.
* Closed `#551 <https://github.com/Netflix/lemur/pull/551>`_ - Added the ability to create a 4096 bit key during certificate creation. Closed `#528 <https://github.com/Netflix/lemur/pull/528>`_ to ensure that issuer plugins supported the new 4096 bit keys.
* Closed `#566 <https://github.com/Netflix/lemur/issues/566>`_ - Fixed an issue changing the notification status for certificates without private keys.
* Closed `#594 <https://github.com/Netflix/lemur/issues/594>`_ - Added `replaced` field indicating if a certificate has been superseded.
* Closed `#602 <https://github.com/Netflix/lemur/issues/602>`_ - AWS plugin added support for ALBs for endpoint tracking.
@ -115,12 +222,8 @@ Upgrading
There have been quite a few issues closed in this release. Some notables:
* Closed `#284 <https://github.com/Netflix/lemur/issues/284>`_ - Created new models for `Endpoints` created associated
AWS ELB endpoint tracking code. This was the major stated goal of this milestone and should serve as the basis for
future enhancements of Lemur's certificate 'deployment' capabilities.
* Closed `#334 <https://github.com/Netflix/lemur/issues/334>`_ - Lemur not has the ability
to restrict certificate expiration dates to weekdays.
* Closed `#284 <https://github.com/Netflix/lemur/issues/284>`_ - Created new models for `Endpoints` created associated AWS ELB endpoint tracking code. This was the major stated goal of this milestone and should serve as the basis for future enhancements of Lemur's certificate 'deployment' capabilities.
* Closed `#334 <https://github.com/Netflix/lemur/issues/334>`_ - Lemur not has the ability to restrict certificate expiration dates to weekdays.
Several fixes/tweaks to Lemurs python3 support (thanks chadhendrie!)
@ -175,7 +278,7 @@ these keys should be fairly trivial, additionally pull requests have been submit
should be easier to determine what authorities are available and when an authority has actually been selected.
* Closed `#254 <https://github.com/Netflix/lemur/issues/254>`_ - Forces certificate names to be generally unique. If a certificate name
(generated or otherwise) is found to be a duplicate we increment by appending a counter.
* Closed `#254 <https://github.com/Netflix/lemur/issues/275>`_ - Switched to using Fernet generated passphrases for exported items.
* Closed `#275 <https://github.com/Netflix/lemur/issues/275>`_ - Switched to using Fernet generated passphrases for exported items.
These are more sounds that pseudo random passphrases generated before and have the nice property of being in base64.
* Closed `#278 <https://github.com/Netflix/lemur/issues/278>`_ - Added ability to specify a custom name to certificate creation, previously
this was only available in the certificate import wizard.

View File

@ -1,9 +1,10 @@
FROM python:3.5
FROM python:3.7
RUN apt-get update
RUN apt-get install -y make python-software-properties curl
RUN apt-get install -y make software-properties-common curl
RUN curl -sL https://deb.nodesource.com/setup_7.x | bash -
RUN apt-get update
RUN apt-get install -y nodejs libldap2-dev libsasl2-dev libldap2-dev libssl-dev
RUN apt-get install -y npm libldap2-dev libsasl2-dev libldap2-dev libssl-dev
RUN pip install pip==20.0.2
RUN pip install -U setuptools
RUN pip install coveralls bandit
WORKDIR /app

View File

@ -1,4 +1,4 @@
include setup.py version.py package.json bower.json gulpfile.js README.rst MANIFEST.in LICENSE AUTHORS
include setup.py version.py package.json bower.json gulpfile.js README.rst MANIFEST.in LICENSE AUTHORS requirements*.txt
recursive-include lemur/plugins/lemur_email/templates *
recursive-include lemur/static *
global-exclude *~

View File

@ -36,20 +36,24 @@ endif
@echo ""
dev-docs:
pip install -r docs/requirements.txt
pip install -r requirements-docs.txt
reset-db:
@echo "--> Dropping existing 'lemur' database"
dropdb lemur || true
@echo "--> Creating 'lemur' database"
createdb -E utf-8 lemur
@echo "--> Enabling pg_trgm extension"
psql lemur -c "create extension IF NOT EXISTS pg_trgm;"
@echo "--> Applying migrations"
lemur db upgrade
cd lemur && lemur db upgrade
setup-git:
@echo "--> Installing git hooks"
git config branch.autosetuprebase always
cd .git/hooks && ln -sf ../../hooks/* ./
if [ -d .git/hooks ]; then \
git config branch.autosetuprebase always; \
cd .git/hooks && ln -sf ../../hooks/* ./; \
fi
@echo ""
clean:
@ -111,10 +115,10 @@ endif
@echo "--> Updating Python requirements"
pip install --upgrade pip
pip install --upgrade pip-tools
pip-compile --output-file requirements-docs.txt requirements-docs.in -U --no-index
pip-compile --output-file requirements-dev.txt requirements-dev.in -U --no-index
pip-compile --output-file requirements-tests.txt requirements-tests.in -U --no-index
pip-compile --output-file requirements.txt requirements.in -U --no-index
pip-compile --output-file requirements.txt requirements.in -U --no-emit-index-url
pip-compile --output-file requirements-docs.txt requirements-docs.in -U --no-emit-index-url
pip-compile --output-file requirements-dev.txt requirements-dev.in -U --no-emit-index-url
pip-compile --output-file requirements-tests.txt requirements-tests.in -U --no-emit-index-url
@echo "--> Done updating Python requirements"
@echo "--> Removing python-ldap from requirements-docs.txt"
grep -v "python-ldap" requirements-docs.txt > tempreqs && mv tempreqs requirements-docs.txt
@ -123,5 +127,9 @@ endif
@echo "--> Done installing new dependencies"
@echo ""
# Execute with make checkout-pr pr=<pr number>
checkout-pr:
git fetch upstream pull/$(pr)/head:pr-$(pr)
.PHONY: develop dev-postgres dev-docs setup-git build clean update-submodules test testloop test-cli test-js test-python lint lint-python lint-js coverage publish release

View File

@ -22,7 +22,7 @@ Lemur
Lemur manages TLS certificate creation. While not able to issue certificates itself, Lemur acts as a broker between CAs
and environments providing a central portal for developers to issue TLS certificates with 'sane' defaults.
It works on CPython 3.5. We deploy on Ubuntu and develop on OS X.
It works on Python 3.7. We deploy on Ubuntu and develop on OS X.
Project resources

View File

@ -11,12 +11,12 @@
"angular": "1.4.9",
"json3": "~3.3",
"es5-shim": "~4.5.0",
"bootstrap": "~3.3.6",
"angular-bootstrap": "~1.1.1",
"angular-animate": "~1.4.9",
"restangular": "~1.5.1",
"ng-table": "~0.8.3",
"moment": "~2.11.1",
"bootstrap": "~3.4.1",
"angular-loading-bar": "~0.8.0",
"angular-moment": "~0.10.3",
"moment-range": "~2.1.0",
@ -24,12 +24,12 @@
"angularjs-toaster": "~1.0.0",
"angular-chart.js": "~0.8.8",
"ngletteravatar": "~4.0.0",
"bootswatch": "~3.3.6",
"bootswatch": "3.4.1+1",
"fontawesome": "~4.5.0",
"satellizer": "~0.13.4",
"angular-ui-router": "~0.2.15",
"font-awesome": "~4.5.0",
"lodash": "~4.0.1",
"lodash": "~4.17.20",
"underscore": "~1.8.3",
"angular-smart-table": "2.1.8",
"angular-strap": ">= 2.2.2",

View File

@ -13,7 +13,15 @@ services:
VIRTUAL_ENV: 'true'
postgres:
image: postgres:9.4
image: postgres
restart: always
environment:
POSTGRES_USER: lemur
POSTGRES_PASSWORD: lemur
ports:
- "5432:5432"
redis:
image: "redis:alpine"
ports:
- "6379:6379"

3
docker/.dockerignore Normal file
View File

@ -0,0 +1,3 @@
*-env
docker-compose.yml
Dockerfile

69
docker/Dockerfile Normal file
View File

@ -0,0 +1,69 @@
FROM python:3.7.9-alpine3.12
ARG VERSION
ENV VERSION master
ARG URLCONTEXT
ENV uid 1337
ENV gid 1337
ENV user lemur
ENV group lemur
RUN addgroup -S ${group} -g ${gid} && \
adduser -D -S ${user} -G ${group} -u ${uid} && \
apk add --no-cache --update python3 py-pip libldap postgresql-client nginx supervisor curl tzdata openssl bash && \
apk --update add --virtual build-dependencies \
git \
tar \
curl \
python3-dev \
npm \
bash \
musl-dev \
gcc \
autoconf \
automake \
libtool \
make \
nasm \
zlib-dev \
postgresql-dev \
libressl-dev \
libffi-dev \
cyrus-sasl-dev \
openldap-dev && \
mkdir -p /opt/lemur /home/lemur/.lemur/ && \
curl -sSL https://github.com/Netflix/lemur/archive/$VERSION.tar.gz | tar xz -C /opt/lemur --strip-components=1 && \
pip3 install --upgrade pip && \
pip3 install --upgrade setuptools && \
mkdir -p /run/nginx/ /etc/nginx/ssl/ && \
chown -R $user:$group /opt/lemur/ /home/lemur/.lemur/
WORKDIR /opt/lemur
RUN echo "Running with python:" && python -c 'import platform; print(platform.python_version())' && \
echo "Running with nodejs:" && node -v && \
npm install --unsafe-perm && \
pip3 install -e . && \
node_modules/.bin/gulp build && \
node_modules/.bin/gulp package --urlContextPath=${URLCONTEXT} && \
apk del build-dependencies
COPY entrypoint /
COPY src/lemur.conf.py /home/lemur/.lemur/lemur.conf.py
COPY supervisor.conf /
COPY nginx/default.conf /etc/nginx/conf.d/
COPY nginx/default-ssl.conf /etc/nginx/conf.d/
RUN chmod +x /entrypoint
WORKDIR /
HEALTHCHECK --interval=12s --timeout=12s --start-period=30s \
CMD curl --fail http://localhost:80/api/1/healthcheck | grep -q ok || exit 1
USER root
ENTRYPOINT ["/entrypoint"]
CMD ["/usr/bin/supervisord","-c","supervisor.conf"]

67
docker/Dockerfile-src Normal file
View File

@ -0,0 +1,67 @@
FROM alpine:3.8
ARG VERSION
ENV VERSION master
ARG URLCONTEXT
ENV uid 1337
ENV gid 1337
ENV user lemur
ENV group lemur
RUN addgroup -S ${group} -g ${gid} && \
adduser -D -S ${user} -G ${group} -u ${uid} && \
apk --update add python3 libldap postgresql-client nginx supervisor curl tzdata openssl bash && \
apk --update add --virtual build-dependencies \
git \
tar \
curl \
python3-dev \
npm \
bash \
musl-dev \
gcc \
autoconf \
automake \
libtool \
make \
nasm \
zlib-dev \
postgresql-dev \
libressl-dev \
libffi-dev \
cyrus-sasl-dev \
openldap-dev && \
pip3 install --upgrade pip && \
pip3 install --upgrade setuptools && \
mkdir -p /home/lemur/.lemur/ && \
mkdir -p /run/nginx/ /etc/nginx/ssl/
COPY ./ /opt/lemur
WORKDIR /opt/lemur
RUN chown -R $user:$group /opt/lemur/ /home/lemur/.lemur/ && \
npm install --unsafe-perm && \
pip3 install -e . && \
node_modules/.bin/gulp build && \
node_modules/.bin/gulp package --urlContextPath=${URLCONTEXT} && \
apk del build-dependencies
COPY docker/entrypoint /
COPY docker/src/lemur.conf.py /home/lemur/.lemur/lemur.conf.py
COPY docker/supervisor.conf /
COPY docker/nginx/default.conf /etc/nginx/conf.d/
COPY docker/nginx/default-ssl.conf /etc/nginx/conf.d/
RUN chmod +x /entrypoint
WORKDIR /
HEALTHCHECK --interval=12s --timeout=12s --start-period=30s \
CMD curl --fail http://localhost:80/api/1/healthcheck | grep -q ok || exit 1
USER root
ENTRYPOINT ["/entrypoint"]
CMD ["/usr/bin/supervisord","-c","supervisor.conf"]

32
docker/docker-compose.yml Normal file
View File

@ -0,0 +1,32 @@
version: '3'
volumes:
pg_data: { }
services:
postgres:
image: "postgres:13.1-alpine"
restart: on-failure
volumes:
- pg_data:/var/lib/postgresql/data
env_file:
- pgsql-env
lemur:
# image: "netlix-lemur:latest"
restart: on-failure
build:
context: .
depends_on:
- postgres
- redis
env_file:
- lemur-env
- pgsql-env
ports:
- 87:80
- 447:443
redis:
image: "redis:alpine3.12"
restart: on-failure

59
docker/entrypoint Normal file
View File

@ -0,0 +1,59 @@
#!/bin/bash
set -eo pipefail
if [ -z "${POSTGRES_USER}" ] || [ -z "${POSTGRES_PASSWORD}" ] || [ -z "${POSTGRES_HOST}" ] || [ -z "${POSTGRES_DB}" ];then
echo "Database vars not set"
exit 1
fi
export POSTGRES_PORT="${POSTGRES_PORT:-5432}"
export LEMUR_ADMIN_PASSWORD="${LEMUR_ADMIN_PASSWORD:-admin}"
export SQLALCHEMY_DATABASE_URI="postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:$POSTGRES_PORT/$POSTGRES_DB"
PGPASSWORD=$POSTGRES_PASSWORD psql -h "$POSTGRES_HOST" -p "$POSTGRES_PORT" -U "$POSTGRES_USER" -d "$POSTGRES_DB" --command 'select 1;'
echo " # Create Postgres trgm extension"
PGPASSWORD=$POSTGRES_PASSWORD psql -h "$POSTGRES_HOST" -p "$POSTGRES_PORT" -U "$POSTGRES_USER" -d "$POSTGRES_DB" --command 'CREATE EXTENSION IF NOT EXISTS pg_trgm;'
echo " # Done"
if [ -z "${SKIP_SSL}" ]; then
if [ ! -f /etc/nginx/ssl/server.crt ] && [ ! -f /etc/nginx/ssl/server.key ]; then
openssl req -x509 -newkey rsa:4096 -nodes -keyout /etc/nginx/ssl/server.key -out /etc/nginx/ssl/server.crt -days 365 -subj "/C=US/ST=FAKE/L=FAKE/O=FAKE/OU=FAKE/CN=FAKE"
fi
[ -f "/etc/nginx/conf.d/default-ssl.conf.a" ] && mv /etc/nginx/conf.d/default-ssl.conf.a /etc/nginx/conf.d/default-ssl.conf
[ -f "/etc/nginx/conf.d/default.conf" ] && mv -f /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.a
fi
# if [ ! -f /home/lemur/.lemur/lemur.conf.py ]; then
# echo "Creating config"
# https://github.com/Netflix/lemur/issues/2257
# python3 /opt/lemur/lemur/manage.py create_config
# echo "Done"
# fi
echo " # Running init"
su lemur -s /bin/bash -c "cd /opt/lemur/lemur; lemur init -p ${LEMUR_ADMIN_PASSWORD}"
echo " # Done"
# echo "Creating user"
# https://github.com/Netflix/lemur/issues/
# echo "something that will create user" | python3 /opt/lemur/lemur/manage.py shell
# echo "Done"
cron_notify="${CRON_NOTIFY:-"0 22 * * *"}"
cron_sync="${CRON_SYNC:-"*/15 * * * *"}"
cron_revoked="${CRON_CHECK_REVOKED:-"0 22 * * *"}"
cron_reissue="${CRON_REISSUE:-"0 23 * * *"}"
echo " # Populating crontab"
echo "${cron_notify} lemur notify expirations" > /etc/crontabs/lemur
echo "${cron_sync} lemur source sync -s all" >> /etc/crontabs/lemur
echo "${cron_revoked} lemur certificate check_revoked" >> /etc/crontabs/lemur
echo "${cron_reissue} lemur certificate reissue -c" >> /etc/crontabs/lemur
echo " # Done"
exec "$@"

25
docker/lemur-env Normal file
View File

@ -0,0 +1,25 @@
# SKIP_SSL=1
# LEMUR_TOKEN_SECRET=
# LEMUR_DEFAULT_COUNTRY=
# LEMUR_DEFAULT_STATE=
# LEMUR_DEFAULT_LOCATION=
# LEMUR_DEFAULT_ORGANIZATION=
# LEMUR_DEFAULT_ORGANIZATIONAL_UNIT=
# LEMUR_DEFAULT_ISSUER_PLUGIN=cryptography-issuer
# LEMUR_DEFAULT_AUTHORITY=cryptography
# MAIL_SERVER=mail.example.com
# MAIL_PORT=25
# LEMUR_EMAIL=lemur@example.com
# LEMUR_SECURITY_TEAM_EMAIL=['team@example.com']
# LEMUR_TOKEN_SECRET=
# LEMUR_ENCRYPTION_KEYS=['']
# DEBUG=True
# LDAP_DEBUG=True
# LDAP_AUTH=True
# LDAP_BIND_URI=ldap://example.com
# LDAP_BASE_DN=DC=example,DC=com
# LDAP_EMAIL_DOMAIN=example.com
# LDAP_USE_TLS=False
# LDAP_REQUIRED_GROUP=certificate-management-admins
# LDAP_GROUPS_TO_ROLES={'certificate-management-admins': 'admin', 'Team': 'team@example.com'}
# LDAP_IS_ACTIVE_DIRECTORY=False

View File

@ -0,0 +1,37 @@
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
server {
listen 80;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name _;
access_log /dev/stdout;
error_log /dev/stderr;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
location /api {
proxy_pass http://127.0.0.1:8000;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location / {
root /opt/lemur/lemur/static/dist;
include mime.types;
index index.html;
}
}

26
docker/nginx/default.conf Normal file
View File

@ -0,0 +1,26 @@
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
server {
listen 80;
access_log /dev/stdout;
error_log /dev/stderr;
location /api {
proxy_pass http://127.0.0.1:8000;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location / {
root /opt/lemur/lemur/static/dist;
include mime.types;
index index.html;
}
}

4
docker/pgsql-env Normal file
View File

@ -0,0 +1,4 @@
POSTGRES_USER=lemur
POSTGRES_PASSWORD=12345
POSTGRES_DB=lemur
POSTGRES_HOST=postgres

237
docker/src/lemur.conf.py Normal file
View File

@ -0,0 +1,237 @@
import os.path
import random
import string
from celery.schedules import crontab
import base64
_basedir = os.path.abspath(os.path.dirname(__file__))
# See the Lemur docs (https://lemur.readthedocs.org) for more information on configuration
LOG_LEVEL = str(os.environ.get('LOG_LEVEL', 'DEBUG'))
LOG_FILE = str(os.environ.get('LOG_FILE', '/home/lemur/.lemur/lemur.log'))
LOG_JSON = True
CORS = os.environ.get("CORS") == "True"
debug = os.environ.get("DEBUG") == "True"
def get_random_secret(length):
secret_key = ''.join(random.choice(string.ascii_uppercase) for x in range(round(length / 4)))
secret_key = secret_key + ''.join(random.choice("~!@#$%^&*()_+") for x in range(round(length / 4)))
secret_key = secret_key + ''.join(random.choice(string.ascii_lowercase) for x in range(round(length / 4)))
return secret_key + ''.join(random.choice(string.digits) for x in range(round(length / 4)))
# This is the secret key used by Flask session management
SECRET_KEY = repr(os.environ.get('SECRET_KEY', get_random_secret(32).encode('utf8')))
# You should consider storing these separately from your config
LEMUR_TOKEN_SECRET = repr(os.environ.get('LEMUR_TOKEN_SECRET',
base64.b64encode(get_random_secret(32).encode('utf8'))))
# This must match the key for whichever DB the container is using - this could be a dump of dev or test, or a unique key
LEMUR_ENCRYPTION_KEYS = repr(os.environ.get('LEMUR_ENCRYPTION_KEYS',
base64.b64encode(get_random_secret(32).encode('utf8')).decode('utf8')))
REDIS_HOST = 'redis'
REDIS_PORT = 6379
REDIS_DB = 0
CELERY_RESULT_BACKEND = f'redis://{REDIS_HOST}:{REDIS_PORT}'
CELERY_BROKER_URL = f'redis://{REDIS_HOST}:{REDIS_PORT}'
CELERY_IMPORTS = ('lemur.common.celery')
CELERYBEAT_SCHEDULE = {
# All tasks are disabled by default. Enable any tasks you wish to run.
# 'fetch_all_pending_acme_certs': {
# 'task': 'lemur.common.celery.fetch_all_pending_acme_certs',
# 'options': {
# 'expires': 180
# },
# 'schedule': crontab(minute="*"),
# },
# 'remove_old_acme_certs': {
# 'task': 'lemur.common.celery.remove_old_acme_certs',
# 'options': {
# 'expires': 180
# },
# 'schedule': crontab(hour=8, minute=0, day_of_week=5),
# },
# 'clean_all_sources': {
# 'task': 'lemur.common.celery.clean_all_sources',
# 'options': {
# 'expires': 180
# },
# 'schedule': crontab(hour=5, minute=0, day_of_week=5),
# },
# 'sync_all_sources': {
# 'task': 'lemur.common.celery.sync_all_sources',
# 'options': {
# 'expires': 180
# },
# 'schedule': crontab(hour="*/2", minute=0),
# # this job is running 30min before endpoints_expire which deletes endpoints which were not updated
# },
# 'sync_source_destination': {
# 'task': 'lemur.common.celery.sync_source_destination',
# 'options': {
# 'expires': 180
# },
# 'schedule': crontab(hour="*/2", minute=15),
# },
# 'report_celery_last_success_metrics': {
# 'task': 'lemur.common.celery.report_celery_last_success_metrics',
# 'options': {
# 'expires': 180
# },
# 'schedule': crontab(minute="*"),
# },
# 'certificate_reissue': {
# 'task': 'lemur.common.celery.certificate_reissue',
# 'options': {
# 'expires': 180
# },
# 'schedule': crontab(hour=9, minute=0),
# },
# 'certificate_rotate': {
# 'task': 'lemur.common.celery.certificate_rotate',
# 'options': {
# 'expires': 180
# },
# 'schedule': crontab(hour=10, minute=0),
# },
# 'endpoints_expire': {
# 'task': 'lemur.common.celery.endpoints_expire',
# 'options': {
# 'expires': 180
# },
# 'schedule': crontab(hour="*/2", minute=30),
# # this job is running 30min after sync_all_sources which updates endpoints
# },
# 'get_all_zones': {
# 'task': 'lemur.common.celery.get_all_zones',
# 'options': {
# 'expires': 180
# },
# 'schedule': crontab(minute="*/30"),
# },
# 'check_revoked': {
# 'task': 'lemur.common.celery.check_revoked',
# 'options': {
# 'expires': 180
# },
# 'schedule': crontab(hour=10, minute=0),
# }
# 'enable_autorotate_for_certs_attached_to_endpoint': {
# 'task': 'lemur.common.celery.enable_autorotate_for_certs_attached_to_endpoint',
# 'options': {
# 'expires': 180
# },
# 'schedule': crontab(hour=10, minute=0),
# }
# 'notify_expirations': {
# 'task': 'lemur.common.celery.notify_expirations',
# 'options': {
# 'expires': 180
# },
# 'schedule': crontab(hour=10, minute=0),
# },
# 'notify_authority_expirations': {
# 'task': 'lemur.common.celery.notify_authority_expirations',
# 'options': {
# 'expires': 180
# },
# 'schedule': crontab(hour=10, minute=0),
# },
# 'send_security_expiration_summary': {
# 'task': 'lemur.common.celery.send_security_expiration_summary',
# 'options': {
# 'expires': 180
# },
# 'schedule': crontab(hour=10, minute=0, day_of_week='mon-fri'),
# }
}
CELERY_TIMEZONE = 'UTC'
SQLALCHEMY_ENABLE_FLASK_REPLICATED = False
SQLALCHEMY_DATABASE_URI = os.environ.get('SQLALCHEMY_DATABASE_URI', 'postgresql://lemur:lemur@localhost:5432/lemur')
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = True
SQLALCHEMY_POOL_RECYCLE = 499
SQLALCHEMY_POOL_TIMEOUT = 20
LEMUR_EMAIL = 'lemur@example.com'
LEMUR_SECURITY_TEAM_EMAIL = ['security@example.com']
LEMUR_SECURITY_TEAM_EMAIL_INTERVALS = [15, 2]
LEMUR_DEFAULT_EXPIRATION_NOTIFICATION_INTERVALS = [30, 15, 2]
LEMUR_EMAIL_SENDER = 'smtp'
# mail configuration
# MAIL_SERVER = 'mail.example.com'
PUBLIC_CA_MAX_VALIDITY_DAYS = 397
DEFAULT_VALIDITY_DAYS = 365
LEMUR_OWNER_EMAIL_IN_SUBJECT = False
LEMUR_DEFAULT_COUNTRY = str(os.environ.get('LEMUR_DEFAULT_COUNTRY', 'US'))
LEMUR_DEFAULT_STATE = str(os.environ.get('LEMUR_DEFAULT_STATE', 'California'))
LEMUR_DEFAULT_LOCATION = str(os.environ.get('LEMUR_DEFAULT_LOCATION', 'Los Gatos'))
LEMUR_DEFAULT_ORGANIZATION = str(os.environ.get('LEMUR_DEFAULT_ORGANIZATION', 'Example, Inc.'))
LEMUR_DEFAULT_ORGANIZATIONAL_UNIT = str(os.environ.get('LEMUR_DEFAULT_ORGANIZATIONAL_UNIT', ''))
LEMUR_DEFAULT_AUTHORITY = str(os.environ.get('LEMUR_DEFAULT_AUTHORITY', 'ExampleCa'))
LEMUR_DEFAULT_ROLE = 'operator'
ACTIVE_PROVIDERS = []
METRIC_PROVIDERS = []
# Authority Settings - These will change depending on which authorities you are
# using
current_path = os.path.dirname(os.path.realpath(__file__))
# DNS Settings
# exclude logging missing SAN, since we can have certs from private CAs with only cn, prod parity
LOG_SSL_SUBJ_ALT_NAME_ERRORS = False
ACME_DNS_PROVIDER_TYPES = {"items": [
{
'name': 'route53',
'requirements': [
{
'name': 'account_id',
'type': 'int',
'required': True,
'helpMessage': 'AWS Account number'
},
]
},
{
'name': 'cloudflare',
'requirements': [
{
'name': 'email',
'type': 'str',
'required': True,
'helpMessage': 'Cloudflare Email'
},
{
'name': 'key',
'type': 'str',
'required': True,
'helpMessage': 'Cloudflare Key'
},
]
},
{
'name': 'dyn',
},
{
'name': 'ultradns',
},
]}
# Authority plugins which support revocation
SUPPORTED_REVOCATION_AUTHORITY_PLUGINS = ['acme-issuer']

33
docker/supervisor.conf Normal file
View File

@ -0,0 +1,33 @@
[supervisord]
nodaemon=true
user=root
logfile=/dev/stdout
logfile_maxbytes=0
pidfile = /tmp/supervisord.pid
[program:lemur]
environment=LEMUR_CONF=/home/lemur/.lemur/lemur.conf.py
command=lemur start -b 0.0.0.0:8000
user=lemur
directory=/opt/lemur/lemur
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes = 0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[program:nginx]
command=/usr/sbin/nginx -g "daemon off;"
user=root
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes = 0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[program:cron]
environment=LEMUR_CONF=/home/lemur/.lemur/lemur.conf.py
command=/usr/sbin/crond -f
user=root
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes = 0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

View File

@ -28,6 +28,13 @@ Basic Configuration
LOG_FILE = "/logs/lemur/lemur-test.log"
.. data:: LOG_UPGRADE_FILE
:noindex:
::
LOG_UPGRADE_FILE = "/logs/lemur/db_upgrade.log"
.. data:: DEBUG
:noindex:
@ -100,7 +107,7 @@ Specifying the `SQLALCHEMY_MAX_OVERFLOW` to 0 will enforce limit to not create c
Specifies whether to allow certificates created by Lemur to expire on weekends. Default is True.
.. data:: LEMUR_WHITELISTED_DOMAINS
.. data:: LEMUR_ALLOWED_DOMAINS
:noindex:
List of regular expressions for domain restrictions; if the list is not empty, normal users can only issue
@ -144,6 +151,15 @@ Specifying the `SQLALCHEMY_MAX_OVERFLOW` to 0 will enforce limit to not create c
to start. Multiple keys can be provided to facilitate key rotation. The first key in the list is used for
encryption and all keys are tried for decryption until one works. Each key must be 32 URL safe base-64 encoded bytes.
Only fields of type ``Vault`` will be encrypted. At present, only the following fields are encrypted:
* ``certificates.private_key``
* ``pending_certificates.private_key``
* ``dns_providers.credentials``
* ``roles.password``
For implementation details, see ``Vault`` in ``utils.py``.
Running lemur create_config will securely generate a key for your configuration file.
If you would like to generate your own, we recommend the following method:
@ -156,11 +172,48 @@ Specifying the `SQLALCHEMY_MAX_OVERFLOW` to 0 will enforce limit to not create c
LEMUR_ENCRYPTION_KEYS = ['1YeftooSbxCiX2zo8m1lXtpvQjy27smZcUUaGmffhMY=', 'LAfQt6yrkLqOK5lwpvQcT4jf2zdeTQJV1uYeh9coT5s=']
.. data:: PUBLIC_CA_MAX_VALIDITY_DAYS
:noindex:
Use this config to override the limit of 397 days of validity for certificates issued by CA/Browser compliant authorities.
The authorities with cab_compliant option set to true will use this config. The example below overrides the default validity
of 397 days and sets it to 365 days.
::
PUBLIC_CA_MAX_VALIDITY_DAYS = 365
.. data:: DEFAULT_VALIDITY_DAYS
:noindex:
Use this config to override the default validity of 365 days for certificates offered through Lemur UI. Any CA which
is not CA/Browser Forum compliant will be using this value as default validity to be displayed on UI. Please
note that this config is used for cert issuance only through Lemur UI. The example below overrides the default validity
of 365 days and sets it to 1095 days (3 years).
::
DEFAULT_VALIDITY_DAYS = 1095
.. data:: DEBUG_DUMP
:noindex:
Dump all imported or generated CSR and certificate details to stdout using OpenSSL. (default: `False`)
.. data:: ALLOW_CERT_DELETION
:noindex:
When set to True, certificates can be marked as deleted via the API and deleted certificates will not be displayed
in the UI. When set to False (the default), the certificate delete API will always return "405 method not allowed"
and deleted certificates will always be visible in the UI. (default: `False`)
.. data:: LEMUR_AWS_REGION
:noindex:
This is an optional config applicable for settings where Lemur is deployed in AWS. For accessing regionalized
STS endpoints, LEMUR_AWS_REGION defines the region where Lemur is deployed.
Certificate Default Options
---------------------------
@ -206,7 +259,7 @@ and are used when Lemur creates the CSR for your certificates.
::
LEMUR_DEFAULT_ORGANIZATIONAL_UNIT = "Operations"
LEMUR_DEFAULT_ORGANIZATIONAL_UNIT = ""
.. data:: LEMUR_DEFAULT_ISSUER_PLUGIN
@ -225,22 +278,123 @@ and are used when Lemur creates the CSR for your certificates.
LEMUR_DEFAULT_AUTHORITY = "verisign"
.. _NotificationOptions:
Notification Options
--------------------
Lemur currently has very basic support for notifications. Currently only expiration notifications are supported. Actual notification
is handled by the notification plugins that you have configured. Lemur ships with the 'Email' notification that allows expiration emails
to be sent to subscribers.
Lemur supports a small variety of notification types through a set of notification plugins.
By default, Lemur configures a standard set of email notifications for all certificates.
Templates for expiration emails are located under `lemur/plugins/lemur_email/templates` and can be modified for your needs.
Notifications are sent to the certificate creator, owner and security team as specified by the `LEMUR_SECURITY_TEAM_EMAIL` configuration parameter.
**Plugin-capable notifications**
Certificates marked as inactive will **not** be notified of upcoming expiration. This enables a user to essentially
silence the expiration. If a certificate is active and is expiring the above will be notified according to the `LEMUR_DEFAULT_EXPIRATION_NOTIFICATION_INTERVALS` or
30, 15, 2 days before expiration if no intervals are set.
These notifications can be configured to use all available notification plugins.
Lemur supports sending certification expiration notifications through SES and SMTP.
Supported types:
* Certificate expiration
**Email-only notifications**
These notifications can only be sent via email and cannot use other notification plugins.
Supported types:
* CA certificate expiration
* Pending ACME certificate failure
* Certificate rotation
* Security certificate expiration summary
**Default notifications**
When a certificate is created, the following email notifications are created for it if they do not exist.
If these notifications already exist, they will be associated with the new certificate.
* ``DEFAULT_<OWNER>_X_DAY``, where X is the set of values specified in ``LEMUR_DEFAULT_EXPIRATION_NOTIFICATION_INTERVALS`` and defaults to 30, 15, and 2 if not specified. The owner's username will replace ``<OWNER>``.
* ``DEFAULT_SECURITY_X_DAY``, where X is the set of values specified in ``LEMUR_SECURITY_TEAM_EMAIL_INTERVALS`` and defaults to ``LEMUR_DEFAULT_EXPIRATION_NOTIFICATION_INTERVALS`` if not specified (which also defaults to 30, 15, and 2 if not specified).
These notifications can be disabled if desired. They can also be unassociated with a specific certificate.
**Disabling notifications**
Notifications can be disabled either for an individual certificate (which disables all notifications for that certificate)
or for an individual notification object (which disables that notification for all associated certificates).
At present, disabling a notification object will only disable certificate expiration notifications, and not other types,
since other notification types don't use notification objects.
**Certificate expiration**
Certificate expiration notifications are sent when the scheduled task to send certificate expiration notifications runs
(see :ref:`PeriodicTasks`). Specific patterns of certificate names may be excluded using ``--exclude`` (when using
cron; you may specify this multiple times for multiple patterns) or via the config option ``EXCLUDE_CN_FROM_NOTIFICATION``
(when using celery; this is a list configuration option, meaning you specify multiple values, such as
``['exclude', 'also exclude']``). The specified exclude pattern will match if found anywhere in the certificate name.
When the periodic task runs, Lemur checks for certificates meeting the following conditions:
* Certificate has notifications enabled
* Certificate is not expired
* Certificate is not revoked
* Certificate name does not match the `exclude` parameter
* Certificate has at least one associated notification object
* That notification is active
* That notification's configured interval and unit match the certificate's remaining lifespan
All eligible certificates are then grouped by owner and applicable notification. For each notification and certificate group,
Lemur will send the expiration notification using whichever plugin was configured for that notification object.
In addition, Lemur will send an email to the certificate owner and security team (as specified by the
``LEMUR_SECURITY_TEAM_EMAIL`` configuration parameter).
**CA certificate expiration**
Certificate authority certificate expiration notifications are sent when the scheduled task to send authority certificate
expiration notifications runs (see :ref:`PeriodicTasks`). Notifications are sent via the intervals configured in the
configuration parameter ``LEMUR_AUTHORITY_CERT_EXPIRATION_EMAIL_INTERVALS``, with a default of 365 and 180 days.
When the periodic task runs, Lemur checks for certificates meeting the following conditions:
* Certificate has notifications enabled
* Certificate is not expired
* Certificate is not revoked
* Certificate is associated with a CA
* Certificate's remaining lifespan matches one of the configured intervals
All eligible certificates are then grouped by owner and expiration interval. For each interval and certificate group,
Lemur will send the CA certificate expiration notification via email to the certificate owner and security team
(as specified by the ``LEMUR_SECURITY_TEAM_EMAIL`` configuration parameter).
**Pending ACME certificate failure**
Whenever a pending ACME certificate fails to be issued, Lemur will send a notification via email to the certificate owner
and security team (as specified by the ``LEMUR_SECURITY_TEAM_EMAIL`` configuration parameter). This email is not sent if
the pending certificate had notifications disabled.
Lemur will attempt 3x times to resolve a pending certificate.
This can at times result into 3 duplicate certificates, if all certificate attempts get resolved.
**Certificate rotation**
Whenever a cert is rotated, Lemur will send a notification via email to the certificate owner. This notification is
disabled by default; to enable it, you must set the option ``--notify`` (when using cron) or the configuration parameter
``ENABLE_ROTATION_NOTIFICATION`` (when using celery).
**Security certificate expiration summary**
If you enable the Celery or cron task to send this notification type, Lemur will send a summary of all
certificates with upcoming expiration date that occurs within the number of days specified by the
``LEMUR_EXPIRATION_SUMMARY_EMAIL_THRESHOLD_DAYS`` configuration parameter (with a fallback of 14 days).
Note that certificates will be included in this summary even if they do not have any associated notifications.
This notification type also supports the same ``--exclude`` and ``EXCLUDE_CN_FROM_NOTIFICATION`` options as expiration emails.
NOTE: At present, this summary email essentially duplicates the certificate expiration notifications, since all
certificate expiration notifications are also sent to the security team. This issue will be fixed in the future.
**Email notifications**
Templates for emails are located under `lemur/plugins/lemur_email/templates` and can be modified for your needs.
The following configuration options are supported:
.. data:: LEMUR_EMAIL_SENDER
:noindex:
@ -255,6 +409,25 @@ Lemur supports sending certification expiration notifications through SES and SM
you can send any mail. See: `Verifying Email Address in Amazon SES <http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses.html>`_
.. data:: LEMUR_SES_SOURCE_ARN
:noindex:
Specifies an ARN to use as the SourceArn when sending emails via SES.
.. note::
This parameter is only required if you're using a sending authorization with SES.
See: `Using sending authorization with Amazon SES <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html>`_
.. data:: LEMUR_SES_REGION
:noindex:
Specifies a region for sending emails via SES.
.. note::
This parameter defaults to us-east-1 and is only required if you wish to use a different region.
.. data:: LEMUR_EMAIL
:noindex:
@ -262,7 +435,7 @@ Lemur supports sending certification expiration notifications through SES and SM
::
LEMUR_EMAIL = 'lemur.example.com'
LEMUR_EMAIL = 'lemur@example.com'
.. data:: LEMUR_SECURITY_TEAM_EMAIL
@ -274,16 +447,81 @@ Lemur supports sending certification expiration notifications through SES and SM
LEMUR_SECURITY_TEAM_EMAIL = ['security@example.com']
.. data:: LEMUR_DEFAULT_EXPIRATION_NOTIFICATION_INTERVALS
:noindex:
Lemur notification intervals
Lemur notification intervals. If unspecified, the value [30, 15, 2] is used.
::
LEMUR_DEFAULT_EXPIRATION_NOTIFICATION_INTERVALS = [30, 15, 2]
.. data:: LEMUR_SECURITY_TEAM_EMAIL_INTERVALS
:noindex:
Alternate notification interval set for security team notifications. Use this if you would like the default security team notification interval for new certificates to differ from the global default as specified in LEMUR_DEFAULT_EXPIRATION_NOTIFICATION_INTERVALS. If unspecified, the value of LEMUR_DEFAULT_EXPIRATION_NOTIFICATION_INTERVALS is used. Security team default notifications for new certificates can effectively be disabled by setting this value to an empty array.
::
LEMUR_SECURITY_TEAM_EMAIL_INTERVALS = [15, 2]
.. data:: LEMUR_AUTHORITY_CERT_EXPIRATION_EMAIL_INTERVALS
:noindex:
Notification interval set for CA certificate expiration notifications. If unspecified, the value [365, 180] is used (roughly one year and 6 months).
::
LEMUR_AUTHORITY_CERT_EXPIRATION_EMAIL_INTERVALS = [365, 180]
Celery Options
---------------
To make use of automated tasks within lemur (e.g. syncing source/destinations, or reissuing ACME certificates), you
need to configure celery. See :ref:`Periodic Tasks <PeriodicTasks>` for more in depth documentation.
.. data:: CELERY_RESULT_BACKEND
:noindex:
The url to your redis backend (needs to be in the format `redis://<host>:<port>/<database>`)
.. data:: CELERY_BROKER_URL
:noindex:
The url to your redis broker (needs to be in the format `redis://<host>:<port>/<database>`)
.. data:: CELERY_IMPORTS
:noindex:
The module that celery needs to import, in our case thats `lemur.common.celery`
.. data:: CELERY_TIMEZONE
:noindex:
The timezone for celery to work with
.. data:: CELERYBEAT_SCHEDULE
:noindex:
This defines the schedule, with which the celery beat makes the worker run the specified tasks.
Since the celery module, relies on the RedisHandler, the following options also need to be set.
.. data:: REDIS_HOST
:noindex:
Hostname of your redis instance
.. data:: REDIS_PORT
:noindex:
Port on which redis is running (default: 6379)
.. data:: REDIS_DB
:noindex:
Which redis database to be used, by default redis offers databases 0-15 (default: 0)
Authentication Options
----------------------
@ -316,6 +554,7 @@ Here is an example LDAP configuration stanza you can add to your config. Adjust
LDAP_CACERT_FILE = '/opt/lemur/trusted.pem'
LDAP_REQUIRED_GROUP = 'certificate-management-access'
LDAP_GROUPS_TO_ROLES = {'certificate-management-admin': 'admin', 'certificate-management-read-only': 'read-only'}
LDAP_IS_ACTIVE_DIRECTORY = True
The lemur ldap module uses the `user principal name` (upn) of the authenticating user to bind. This is done once for each user at login time. The UPN is effectively the email address in AD/LDAP of the user. If the user doesn't provide the email address, it constructs one based on the username supplied (which should normally match the samAccountName) and the value provided by the config LDAP_EMAIL_DOMAIN.
@ -398,6 +637,17 @@ The following LDAP options are not required, however TLS is always recommended.
LDAP_GROUPS_TO_ROLES = {'lemur_admins': 'admin', 'Lemur Team DL Group': 'team@example.com'}
.. data:: LDAP_IS_ACTIVE_DIRECTORY
:noindex:
When set to True, nested group memberships are supported, by searching for groups with the member:1.2.840.113556.1.4.1941 attribute set to the user DN.
When set to False, the list of groups will be determined by the 'memberof' attribute of the LDAP user logging in.
::
LDAP_IS_ACTIVE_DIRECTORY = False
Authentication Providers
~~~~~~~~~~~~~~~~~~~~~~~~
@ -469,6 +719,33 @@ For more information about how to use social logins, see: `Satellizer <https://g
PING_AUTH_ENDPOINT = "https://<yourpingserver>/oauth2/authorize"
.. data:: PING_USER_MEMBERSHIP_URL
:noindex:
An optional additional endpoint to learn membership details post the user validation.
::
PING_USER_MEMBERSHIP_URL = "https://<yourmembershipendpoint>"
.. data:: PING_USER_MEMBERSHIP_TLS_PROVIDER
:noindex:
A custom TLS session provider plugin name
::
PING_USER_MEMBERSHIP_TLS_PROVIDER = "slug-name"
.. data:: PING_USER_MEMBERSHIP_SERVICE
:noindex:
Membership service name used by PING_USER_MEMBERSHIP_TLS_PROVIDER to create a session
::
PING_USER_MEMBERSHIP_SERVICE = "yourmembershipservice"
.. data:: OAUTH2_SECRET
:noindex:
@ -566,8 +843,190 @@ If you are not using a metric provider you do not need to configure any of these
Plugin Specific Options
-----------------------
ACME Plugin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. data:: ACME_DNS_PROVIDER_TYPES
:noindex:
Dictionary of ACME DNS Providers and their requirements.
.. data:: ACME_ENABLE_DELEGATED_CNAME
:noindex:
Enables delegated DNS domain validation using CNAMES. When enabled, Lemur will attempt to follow CNAME records to authoritative DNS servers when creating DNS-01 challenges.
The following configration properties are optional for the ACME plugin to use. They allow reusing an existing ACME
account. See :ref:`Using a pre-existing ACME account <AcmeAccountReuse>` for more details.
.. data:: ACME_PRIVATE_KEY
:noindex:
This is the private key, the account was registered with (in JWK format)
.. data:: ACME_REGR
:noindex:
This is the registration for the ACME account, the most important part is the uri attribute (in JSON)
.. data:: ACME_PREFERRED_ISSUER
:noindex:
This is an optional parameter to indicate the preferred chain to retrieve from ACME when finalizing the order.
This is applicable to Let's Encrypts recent `migration <https://letsencrypt.org/certificates/>`_ to their
own root, where they provide two distinct certificate chains (fullchain_pem vs. alternative_fullchains_pem);
the main chain will be the long chain that is rooted in the expiring DTS root, whereas the alternative chain
is rooted in X1 root CA.
Select "X1" to get the shorter chain (currently alternative), leave blank or "DST Root CA X3" for the longer chain.
Active Directory Certificate Services Plugin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. data:: ADCS_SERVER
:noindex:
FQDN of your ADCS Server
.. data:: ADCS_AUTH_METHOD
:noindex:
The chosen authentication method. Either basic (the default), ntlm or cert (SSL client certificate). The next 2 variables are interpreted differently for different methods.
.. data:: ADCS_USER
:noindex:
The username (basic) or the path to the public cert (cert) of the user accessing PKI
.. data:: ADCS_PWD
:noindex:
The passwd (basic) or the path to the private key (cert) of the user accessing PKI
.. data:: ADCS_TEMPLATE
:noindex:
Template to be used for certificate issuing. Usually display name w/o spaces
.. data:: ADCS_TEMPLATE_<upper(authority.name)>
:noindex:
If there is a config variable ADCS_TEMPLATE_<upper(authority.name)> take the value as Cert template else default to ADCS_TEMPLATE to be compatible with former versions. Template to be used for certificate issuing. Usually display name w/o spaces
.. data:: ADCS_START
:noindex:
Used in ADCS-Sourceplugin. Minimum id of the first certificate to be returned. ID is increased by one until ADCS_STOP. Missing cert-IDs are ignored
.. data:: ADCS_STOP
:noindex:
Used for ADCS-Sourceplugin. Maximum id of the certificates returned.
.. data:: ADCS_ISSUING
:noindex:
Contains the issuing cert of the CA
.. data:: ADCS_ROOT
:noindex:
Contains the root cert of the CA
Entrust Plugin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enables the creation of Entrust certificates. You need to set the API access up with Entrust support. Check the information in the Entrust Portal as well.
Certificates are created as "SERVER_AND_CLIENT_AUTH".
Caution: Sometimes the entrust API does not respond in a timely manner. This error is handled and reported by the plugin. Should this happen you just have to hit the create button again after to create a valid certificate.
The following parameters have to be set in the configuration files.
.. data:: ENTRUST_URL
:noindex:
This is the url for the Entrust API. Refer to the API documentation.
.. data:: ENTRUST_API_CERT
:noindex:
Path to the certificate file in PEM format. This certificate is created in the onboarding process. Refer to the API documentation.
.. data:: ENTRUST_API_KEY
:noindex:
Path to the key file in RSA format. This certificate is created in the onboarding process. Refer to the API documentation. Caution: the request library cannot handle encrypted keys. The keyfile therefore has to contain the unencrypted key. Please put this in a secure location on the server.
.. data:: ENTRUST_API_USER
:noindex:
String with the API user. This user is created in the onboarding process. Refer to the API documentation.
.. data:: ENTRUST_API_PASS
:noindex:
String with the password for the API user. This password is created in the onboarding process. Refer to the API documentation.
.. data:: ENTRUST_NAME
:noindex:
String with the name that should appear as certificate owner in the Entrust portal. Refer to the API documentation.
.. data:: ENTRUST_EMAIL
:noindex:
String with the email address that should appear as certificate contact email in the Entrust portal. Refer to the API documentation.
.. data:: ENTRUST_PHONE
:noindex:
String with the phone number that should appear as certificate contact in the Entrust portal. Refer to the API documentation.
.. data:: ENTRUST_ISSUING
:noindex:
Contains the issuing cert of the CA
.. data:: ENTRUST_ROOT
:noindex:
Contains the root cert of the CA
.. data:: ENTRUST_PRODUCT_<upper(authority.name)>
:noindex:
If there is a config variable ENTRUST_PRODUCT_<upper(authority.name)> take the value as cert product name else default to "STANDARD_SSL". Refer to the API documentation for valid products names.
.. data:: ENTRUST_CROSS_SIGNED_RSA_L1K
:noindex:
This is optional. Entrust provides support for cross-signed subCAS. One can set ENTRUST_CROSS_SIGNED_RSA_L1K to the respective cross-signed RSA-based subCA PEM and Lemur will replace the retrieved subCA with ENTRUST_CROSS_SIGNED_RSA_L1K.
.. data:: ENTRUST_CROSS_SIGNED_ECC_L1F
:noindex:
This is optional. Entrust provides support for cross-signed subCAS. One can set ENTRUST_CROSS_SIGNED_ECC_L1F to the respective cross-signed EC-based subCA PEM and Lemur will replace the retrieved subCA with ENTRUST_CROSS_SIGNED_ECC_L1F.
.. data:: ENTRUST_USE_DEFAULT_CLIENT_ID
:noindex:
If set to True, Entrust will use the primary client ID of 1, which applies to most use-case.
Otherwise, Entrust will first lookup the clientId before ordering the certificate.
Verisign Issuer Plugin
^^^^^^^^^^^^^^^^^^^^^^
~~~~~~~~~~~~~~~~~~~~~~
Authorities will each have their own configuration options. There is currently just one plugin bundled with Lemur,
Verisign/Symantec. Additional plugins may define additional options. Refer to the plugin's own documentation
@ -650,10 +1109,16 @@ The following configuration properties are required to use the Digicert issuer p
This is the root to be used for your CA chain
.. data:: DIGICERT_DEFAULT_VALIDITY
.. data:: DIGICERT_DEFAULT_VALIDITY_DAYS
:noindex:
This is the default validity (in years), if no end date is specified. (Default: 1)
This is the default validity (in days), if no end date is specified. (Default: 397)
.. data:: DIGICERT_MAX_VALIDITY_DAYS
:noindex:
This is the maximum validity (in days). (Default: value of DIGICERT_DEFAULT_VALIDITY_DAYS)
.. data:: DIGICERT_PRIVATE
@ -663,7 +1128,7 @@ The following configuration properties are required to use the Digicert issuer p
CFSSL Issuer Plugin
^^^^^^^^^^^^^^^^^^^
~~~~~~~~~~~~~~~~~~~
The following configuration properties are required to use the CFSSL issuer plugin.
@ -682,9 +1147,36 @@ The following configuration properties are required to use the CFSSL issuer plug
This is the intermediate to be used for your CA chain
.. data:: CFSSL_KEY
:noindex:
This is the hmac key to authenticate to the CFSSL service. (Optional)
Hashicorp Vault Source/Destination Plugin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lemur can import and export certificate data to and from a Hashicorp Vault secrets store. Lemur can connect to a different Vault service per source/destination.
.. note:: This plugin does not supersede or overlap the 3rd party Vault Issuer plugin.
.. note:: Vault does not have any configuration properties however it does read from a file on disk for a vault access token. The Lemur service account needs read access to this file.
Vault Source
""""""""""""
The Vault Source Plugin will read from one Vault object location per source defined. There is expected to be one or more certificates defined in each object in Vault.
Vault Destination
"""""""""""""""""
A Vault destination can be one object in Vault or a directory where all certificates will be stored as their own object by CN.
Vault Destination supports a regex filter to prevent certificates with SAN that do not match the regex filter from being deployed. This is an optional feature per destination defined.
AWS Source/Destination Plugin
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In order for Lemur to manage its own account and other accounts we must ensure it has the correct AWS permissions.
@ -867,6 +1359,53 @@ Will be the sender of all notifications, so ensure that it is verified with AWS.
SES if the default notification gateway and will be used unless SMTP settings are configured in the application configuration
settings.
PowerDNS ACME Plugin
~~~~~~~~~~~~~~~~~~~~~~
The following configuration properties are required to use the PowerDNS ACME Plugin for domain validation.
.. data:: ACME_POWERDNS_DOMAIN
:noindex:
This is the FQDN for the PowerDNS API (without path)
.. data:: ACME_POWERDNS_SERVERID
:noindex:
This is the ServerID attribute of the PowerDNS API Server (i.e. "localhost")
.. data:: ACME_POWERDNS_APIKEYNAME
:noindex:
This is the Key name to use for authentication (i.e. "X-API-Key")
.. data:: ACME_POWERDNS_APIKEY
:noindex:
This is the API Key to use for authentication (i.e. "Password")
.. data:: ACME_POWERDNS_RETRIES
:noindex:
This is the number of times DNS Verification should be attempted (i.e. 20)
.. data:: ACME_POWERDNS_VERIFY
:noindex:
This configures how TLS certificates on the PowerDNS API target are validated. The PowerDNS Plugin depends on the PyPi requests library, which supports the following options for the verify parameter:
True: Verifies the TLS certificate was issued by a known publicly-trusted CA. (Default)
False: Disables certificate validation (Not Recommended)
File/Dir path to CA Bundle: Verifies the TLS certificate was issued by a Certificate Authority in the provided CA bundle.
.. _CommandLineInterface:
Command Line Interface
@ -965,6 +1504,15 @@ All commands default to `~/.lemur/lemur.conf.py` if a configuration is not speci
lemur notify
.. data:: acme
Handles all ACME related tasks, like ACME plugin testing.
::
lemur acme
Sub-commands
------------
@ -1036,7 +1584,9 @@ Verisign/Symantec
-----------------
:Authors:
Kevin Glisson <kglisson@netflix.com>
Kevin Glisson <kglisson@netflix.com>,
Curtis Castrapel <ccastrapel@netflix.com>,
Hossein Shafagh <hshafagh@netflix.com>
:Type:
Issuer
:Description:
@ -1062,18 +1612,23 @@ Acme
:Authors:
Kevin Glisson <kglisson@netflix.com>,
Mikhail Khodorovskiy <mikhail.khodorovskiy@jivesoftware.com>
Curtis Castrapel <ccastrapel@netflix.com>,
Hossein Shafagh <hshafagh@netflix.com>,
Mikhail Khodorovskiy <mikhail.khodorovskiy@jivesoftware.com>,
Chad Sine <csine@netflix.com>
:Type:
Issuer
:Description:
Adds support for the ACME protocol (including LetsEncrypt) with domain validation being handled Route53.
Adds support for the ACME protocol (including LetsEncrypt) with domain validation using several providers.
Atlas
-----
:Authors:
Kevin Glisson <kglisson@netflix.com>
Kevin Glisson <kglisson@netflix.com>,
Curtis Castrapel <ccastrapel@netflix.com>,
Hossein Shafagh <hshafagh@netflix.com>
:Type:
Metric
:Description:
@ -1084,7 +1639,9 @@ Email
-----
:Authors:
Kevin Glisson <kglisson@netflix.com>
Kevin Glisson <kglisson@netflix.com>,
Curtis Castrapel <ccastrapel@netflix.com>,
Hossein Shafagh <hshafagh@netflix.com>
:Type:
Notification
:Description:
@ -1102,28 +1659,45 @@ Slack
Adds support for slack notifications.
AWS
----
AWS (Source)
------------
:Authors:
Kevin Glisson <kglisson@netflix.com>
Kevin Glisson <kglisson@netflix.com>,
Curtis Castrapel <ccastrapel@netflix.com>,
Hossein Shafagh <hshafagh@netflix.com>
:Type:
Source
:Description:
Uses AWS IAM as a source of certificates to manage. Supports a multi-account deployment.
AWS
----
AWS (Destination)
-----------------
:Authors:
Kevin Glisson <kglisson@netflix.com>
Kevin Glisson <kglisson@netflix.com>,
Curtis Castrapel <ccastrapel@netflix.com>,
Hossein Shafagh <hshafagh@netflix.com>
:Type:
Destination
:Description:
Uses AWS IAM as a destination for Lemur generated certificates. Support a multi-account deployment.
AWS (SNS Notification)
----------------------
:Authors:
Jasmine Schladen <jschladen@netflix.com>
:Type:
Notification
:Description:
Adds support for SNS notifications. SNS notifications (like other notification plugins) are currently only supported
for certificate expiration. Configuration requires a region, account number, and SNS topic name; these elements
are then combined to build the topic ARN. Lemur must have access to publish messages to the specified SNS topic.
Kubernetes
----------
@ -1167,6 +1741,26 @@ CFSSL
:Description:
Basic support for generating certificates from the private certificate authority CFSSL
Vault
-----
:Authors:
Christopher Jolley <chris@alwaysjolley.com>
:Type:
Source
:Description:
Source plugin imports certificates from Hashicorp Vault secret store.
Vault
-----
:Authors:
Christopher Jolley <chris@alwaysjolley.com>
:Type:
Destination
:Description:
Destination plugin to deploy certificates to Hashicorp Vault secret store.
3rd Party Plugins
=================

View File

@ -18,19 +18,23 @@ from unittest.mock import MagicMock
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath(".."))
# Mock packages that cannot be installed on rtd
on_rtd = os.environ.get('READTHEDOCS') == 'True'
on_rtd = os.environ.get("READTHEDOCS") == "True"
if on_rtd:
class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return MagicMock()
MOCK_MODULES = ['ldap']
MOCK_MODULES = ["ldap"]
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
autodoc_mock_imports = ["python-ldap", "acme", "certsrv", "dnspython3", "dyn", "factory-boy", "flask_replicated",
"josepy", "logmatic", "pem"]
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
@ -39,27 +43,23 @@ if on_rtd:
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinxcontrib.autohttp.flask',
'sphinx.ext.todo',
]
extensions = ["sphinx.ext.autodoc", "sphinxcontrib.autohttp.flask", "sphinx.ext.todo"]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]
# The suffix of source filenames.
source_suffix = '.rst'
source_suffix = ".rst"
# The encoding of source files.
# source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
master_doc = "index"
# General information about the project.
project = u'lemur'
copyright = u'2018, Netflix Inc.'
project = u"lemur"
copyright = u"2018, Netflix Inc."
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@ -68,7 +68,7 @@ copyright = u'2018, Netflix Inc.'
base_dir = os.path.join(os.path.dirname(__file__), os.pardir)
about = {}
with open(os.path.join(base_dir, "lemur", "__about__.py")) as f:
exec(f.read(), about)
exec(f.read(), about) # nosec
version = release = about["__version__"]
@ -84,7 +84,7 @@ version = release = about["__version__"]
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
exclude_patterns = ["_build"]
# The reST default role (used for this markup: `text`) to use for all
# documents.
@ -102,7 +102,7 @@ exclude_patterns = ['_build']
# show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"
# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
@ -114,11 +114,12 @@ pygments_style = 'sphinx'
# -- Options for HTML output ----------------------------------------------
# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# Theme options are theme-specific and customize the look and feel of a theme
@ -148,7 +149,7 @@ if not on_rtd: # only import and set the theme if we're building docs locally
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# html_static_path = ["_static"]
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
@ -197,7 +198,7 @@ html_static_path = ['_static']
# html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'lemurdoc'
htmlhelp_basename = "lemurdoc"
# -- Options for LaTeX output ---------------------------------------------
@ -205,10 +206,8 @@ htmlhelp_basename = 'lemurdoc'
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
}
@ -217,8 +216,7 @@ latex_elements = {
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'lemur.tex', u'Lemur Documentation',
u'Kevin Glisson', 'manual'),
("index", "lemur.tex", u"Lemur Documentation", u"Netflix Security", "manual")
]
# The name of an image file (relative to this directory) to place at the top of
@ -246,10 +244,7 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'Lemur', u'Lemur Documentation',
[u'Kevin Glisson'], 1)
]
man_pages = [("index", "Lemur", u"Lemur Documentation", [u"Netflix Security"], 1)]
# If true, show URL addresses after external links.
# man_show_urls = False
@ -261,9 +256,15 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'Lemur', u'Lemur Documentation',
u'Kevin Glisson', 'Lemur', 'SSL Certificate Management',
'Miscellaneous'),
(
"index",
"Lemur",
u"Lemur Documentation",
u"Netflix Security",
"Lemur",
"SSL Certificate Management",
"Miscellaneous",
)
]
# Documents to append as an appendix to all manuals.

View File

@ -22,12 +22,18 @@ Once you've got all that, the rest is simple:
# If you have a fork, you'll want to clone it instead
git clone git://github.com/netflix/lemur.git
# Create a python virtualenv
mkvirtualenv lemur
# Create and activate python virtualenv from within the lemur repo
python3 -m venv env
. env/bin/activate
# Install doc requirements
# Make the magic happen
make dev-docs
# Make the docs
cd docs
make html
Running ``make dev-docs`` will install the basic requirements to get Sphinx running.
@ -37,18 +43,35 @@ Building Documentation
Inside the ``docs`` directory, you can run ``make`` to build the documentation.
See ``make help`` for available options and the `Sphinx Documentation <http://sphinx-doc.org/contents.html>`_ for more information.
Adding New Modules to Documentation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When a new module is added, it will need to be added to the documentation.
Ideally, we might rely on `sphinx-apidoc <https://www.sphinx-doc.org/en/master/man/sphinx-apidoc.html>`_ to autogenerate our documentation.
Unfortunately, this causes some build problems.
Instead, you'll need to add new modules by hand.
Developing Against HEAD
-----------------------
We try to make it easy to get up and running in a development environment using a git checkout
of Lemur. You'll want to make sure you have a few things on your local system first:
of Lemur. There are two ways to run Lemur locally: directly on your development machine, or
in a Docker container.
**Running in a Docker container**
Look at the `lemur-docker <https://github.com/Netflix/lemur-docker>`_ project.
Usage instructions are self-contained in the README for that project.
**Running directly on your development machine**
You'll want to make sure you have a few things on your local system first:
* python-dev (if you're on OS X, you already have this)
* pip
* virtualenv (ideally virtualenvwrapper)
* node.js (for npm and building css/javascript)
+* `PostgreSQL <https://lemur.readthedocs.io/en/latest/quickstart/index.html#setup-postgres>`_
* `PostgreSQL <https://lemur.readthedocs.io/en/latest/quickstart/index.html#setup-postgres>`_
Once you've got all that, the rest is simple:
@ -58,7 +81,7 @@ Once you've got all that, the rest is simple:
git clone git://github.com/lemur/lemur.git
# Create a python virtualenv
mkvirtualenv lemur
python3 -m venv env
# Make the magic happen
make
@ -93,7 +116,9 @@ You'll likely want to make some changes to the default configuration (we recomme
Running tests with Docker and docker-compose
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Alternatively you can use Docker and docker-compose for running the tests with ``docker-compose run test``.
If you just want to run tests in a Docker container, you can use Docker and docker-compose for running the tests with ``docker-compose run test`` directly in the ``lemur`` project.
(For running the Lemur service in Docker, see `lemur-docker <https://github.com/Netflix/lemur-docker>`_.)
Coding Standards
@ -135,7 +160,7 @@ The test suite consists of multiple parts, testing both the Python and JavaScrip
make test
If you only need to run the Python tests, you can do so with ``make test-python``, as well as ``test-js`` for the JavaScript tests.
If you only need to run the Python tests, you can do so with ``make test-python``, as well as ``make test-js`` for the JavaScript tests.
You'll notice that the test suite is structured based on where the code lives, and strongly encourages using the mock library to drive more accurate individual tests.
@ -146,7 +171,7 @@ You'll notice that the test suite is structured based on where the code lives, a
Static Media
------------
Lemur uses a library that compiles it's static media assets (LESS and JS files) automatically. If you're developing using
Lemur uses a library that compiles its static media assets (LESS and JS files) automatically. If you're developing using
runserver you'll see changes happen not only in the original files, but also the minified or processed versions of the file.
If you've made changes and need to compile them by hand for any reason, you can do so by running:

View File

@ -0,0 +1,29 @@
defaults Package
================
:mod:`defaults` Module
----------------------------------------
.. automodule:: lemur.defaults
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`schemas` Module
-----------------------------
.. automodule:: lemur.defaults.schemas
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`views` Module
---------------------------
.. automodule:: lemur.defaults.views
:noindex:
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,20 @@
deployment Package
===================
:mod:`deployment` Module
----------------------------------------
.. automodule:: lemur.deployment
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`service` Module
------------------------------
.. automodule:: lemur.deployment.service
:noindex:
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,56 @@
endpoints Package
===================
:mod:`endpoints` Module
----------------------------------------
.. automodule:: lemur.endpoints
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`cli` Module
--------------------------
.. automodule:: lemur.endpoints.cli
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`models` Module
-----------------------------
.. automodule:: lemur.endpoints.models
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`schemas` Module
------------------------------
.. automodule:: lemur.endpoints.schemas
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`service` Module
------------------------------
.. automodule:: lemur.endpoints.service
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`views` Module
----------------------------
.. automodule:: lemur.endpoints.views
:noindex:
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,47 @@
logs Package
===================
:mod:`logs` Module
--------------------
.. automodule:: lemur.logs
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`models` Module
------------------------------
.. automodule:: lemur.logs.models
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`schemas` Module
------------------------------
.. automodule:: lemur.logs.schemas
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`service` Module
------------------------------
.. automodule:: lemur.logs.service
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`views` Module
------------------------------
.. automodule:: lemur.logs.views
:noindex:
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,83 @@
lemur_acme package
=================================
:mod:`lemur_acme` Module
----------------------------------------
.. automodule:: lemur.plugins.lemur_acme
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`acme_handlers` Module
-----------------------------------------------
.. automodule:: lemur.plugins.lemur_acme.acme_handlers
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`challenge_types` Module
-------------------------------------------------
.. automodule:: lemur.plugins.lemur_acme.challenge_types
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`cloudflare` Module
-------------------------------------------
.. automodule:: lemur.plugins.lemur_acme.cloudflare
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`dyn` Module
------------------------------------
.. automodule:: lemur.plugins.lemur_acme.dyn
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`plugin` Module
---------------------------------------
.. automodule:: lemur.plugins.lemur_acme.plugin
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`powerdns` Module
-----------------------------------------
.. automodule:: lemur.plugins.lemur_acme.powerdns
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`route53` Module
----------------------------------------
.. automodule:: lemur.plugins.lemur_acme.route53
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`ultradns` Module
-----------------------------------------
.. automodule:: lemur.plugins.lemur_acme.ultradns
:noindex:
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,20 @@
lemur_atlas package
==================================
:mod:`lemur_atlas` Module
----------------------------------------
.. automodule:: lemur.plugins.lemur_atlas
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`plugin` Module
--------------------
.. automodule:: lemur.plugins.lemur_atlas.plugin
:noindex:
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,20 @@
lemur_cryptography package
==================================
:mod:`lemur_cryptography` Module
----------------------------------------
.. automodule:: lemur.plugins.lemur_cryptography
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`plugin` Module
--------------------
.. automodule:: lemur.plugins.lemur_cryptography.plugin
:noindex:
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,20 @@
lemur_digicert package
==================================
:mod:`lemur_digicert` Module
----------------------------------------
.. automodule:: lemur.plugins.lemur_digicert
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`plugin` Module
--------------------
.. automodule:: lemur.plugins.lemur_digicert.plugin
:noindex:
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,20 @@
lemur_jks package
==================================
:mod:`lemur_jks` Module
----------------------------------------
.. automodule:: lemur.plugins.lemur_jks
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`plugin` Module
--------------------
.. automodule:: lemur.plugins.lemur_jks.plugin
:noindex:
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,20 @@
lemur_kubernetes package
==================================
:mod:`lemur_kubernetes` Module
----------------------------------------
.. automodule:: lemur.plugins.lemur_kubernetes
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`plugin` Module
--------------------
.. automodule:: lemur.plugins.lemur_kubernetes.plugin
:noindex:
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,20 @@
lemur_openssl package
==================================
:mod:`lemur_openssl` Module
----------------------------------------
.. automodule:: lemur.plugins.lemur_openssl
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`plugin` Module
--------------------
.. automodule:: lemur.plugins.lemur_openssl.plugin
:noindex:
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,20 @@
lemur_slack package
==================================
:mod:`lemur_slack` Module
----------------------------------------
.. automodule:: lemur.plugins.lemur_slack
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`plugin` Module
--------------------
.. automodule:: lemur.plugins.lemur_slack.plugin
:noindex:
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,38 @@
reporting Package
===================
:mod:`reporting` Module
----------------------------------------
.. automodule:: lemur.reporting
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`cli` Module
------------------------------
.. automodule:: lemur.reporting.cli
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`service` Module
------------------------------
.. automodule:: lemur.reporting.service
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`views` Module
------------------------------
.. automodule:: lemur.reporting.views
:noindex:
:members:
:undoc-members:
:show-inheritance:

View File

@ -28,15 +28,6 @@ lemur Package
:undoc-members:
:show-inheritance:
:mod:`decorators` Module
------------------------
.. automodule:: lemur.decorators
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`exceptions` Module
------------------------
@ -108,7 +99,7 @@ Subpackages
lemur.plugins.lemur_atlas
lemur.plugins.lemur_cryptography
lemur.plugins.lemur_digicert
lemur.plugins.lemur_java
lemur.plugins.lemur_jks
lemur.plugins.lemur_kubernetes
lemur.plugins.lemur_openssl
lemur.plugins.lemur_slack

View File

@ -0,0 +1,56 @@
sources Package
===================
:mod:`sources` Module
----------------------
.. automodule:: lemur.sources
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`cli` Module
------------------------------
.. automodule:: lemur.sources.cli
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`models` Module
------------------------------
.. automodule:: lemur.sources.models
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`schemas` Module
------------------------------
.. automodule:: lemur.sources.schemas
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`service` Module
------------------------------
.. automodule:: lemur.sources.service
:noindex:
:members:
:undoc-members:
:show-inheritance:
:mod:`views` Module
------------------------------
.. automodule:: lemur.sources.views
:noindex:
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,11 @@
tests Package
=============
:mod:`tests` Module
--------------------
.. automodule:: lemur.tests
:noindex:
:members:
:undoc-members:
:show-inheritance:

View File

@ -104,7 +104,7 @@ The `IssuerPlugin` exposes four functions functions::
def create_certificate(self, csr, issuer_options):
# requests.get('a third party')
def revoke_certificate(self, certificate, comments):
def revoke_certificate(self, certificate, reason):
# requests.put('a third party')
def get_ordered_certificate(self, order_id):
# requests.get('already existing certificate')
@ -145,8 +145,7 @@ The `IssuerPlugin` doesn't have any options like Destination, Source, and Notifi
any fields you might need to submit a request to a third party. If there are additional options you need
in your plugin feel free to open an issue, or look into adding additional options to issuers yourself.
Asynchronous Certificates
^^^^^^^^^^^^^^^^^^^^^^^^^
**Asynchronous Certificates**
An issuer may take some time to actually issue a certificate for an order. In this case, a `PendingCertificate` is returned, which holds information to recreate a `Certificate` object at a later time. Then, `get_ordered_certificate()` should be run periodically via `python manage.py pending_certs fetch -i all` to attempt to retrieve an ordered certificate::
def get_ordered_ceriticate(self, order_id):
@ -154,6 +153,7 @@ An issuer may take some time to actually issue a certificate for an order. In t
# retrieve an order, and check if there is an issued certificate attached to it
`cancel_ordered_certificate()` should be implemented to allow an ordered certificate to be canceled before it is issued::
def cancel_ordered_certificate(self, pending_cert, **kwargs):
# pending_cert should contain the necessary information to match an order
# kwargs can be given to provide information to the issuer for canceling
@ -215,18 +215,22 @@ Notification
------------
Lemur includes the ability to create Email notifications by **default**. These notifications
currently come in the form of expiration notices. Lemur periodically checks certifications expiration dates and
currently come in the form of expiration and rotation notices for all certificates, expiration notices for CA certificates,
and ACME certificate creation failure notices. Lemur periodically checks certificate expiration dates and
determines if a given certificate is eligible for notification. There are currently only two parameters used to
determine if a certificate is eligible; validity expiration (date the certificate is no longer valid) and the number
of days the current date (UTC) is from that expiration date.
There are currently two objects that available for notification plugins the first is `NotficationPlugin`. This is the base object for
any notification within Lemur. Currently the only support notification type is an certificate expiration notification. If you
Certificate expiration notifications can also be configured for Slack or AWS SNS. Other notifications are not configurable.
Notifications sent to a certificate owner and security team (`LEMUR_SECURITY_TEAM_EMAIL`) can currently only be sent via email.
There are currently two objects that are available for notification plugins. The first is `NotificationPlugin`, which is the base object for
any notification within Lemur. Currently the only supported notification type is a certificate expiration notification. If you
are trying to create a new notification type (audit, failed logins, etc.) this would be the object to base your plugin on.
You would also then need to build additional code to trigger the new notification type.
The second is `ExpirationNotificationPlugin`, this object inherits from `NotificationPlugin` object.
You will most likely want to base your plugin on, if you want to add new channels for expiration notices (Slack, HipChat, Jira, etc.). It adds default options that are required by
The second is `ExpirationNotificationPlugin`, which inherits from the `NotificationPlugin` object.
You will most likely want to base your plugin on this object if you want to add new channels for expiration notices (HipChat, Jira, etc.). It adds default options that are required by
all expiration notifications (interval, unit). This interface expects for the child to define the following function::
def send(self, notification_type, message, targets, options, **kwargs):
@ -281,6 +285,17 @@ The `ExportPlugin` object requires the implementation of one function::
Support of various formats sometimes relies on external tools system calls. Always be mindful of sanitizing any input to these calls.
Custom TLS Provider
-------------------
Managing TLS at the enterprise scale could be hard and often organizations offer custom wrapper implementations. It could
be ideal to use those while making calls to internal services. The `TLSPlugin` would help to achieve this. It requires the
implementation of one function which creates a TLS session::
def session(self, server_application):
# return active session
Testing
=======

View File

@ -11,22 +11,47 @@ software.
* Update the version number in ``lemur/__about__.py``.
* Set the release date in the :doc:`/changelog`.
* Do a commit indicating this.
* Send a pull request with this.
* Do a commit indicating this, and raise a pull request with this.
* Wait for it to be merged.
Performing the release
----------------------
The commit that merged the version number bump is now the official release
commit for this release. You will need to have ``gpg`` installed and a ``gpg``
key in order to do a release. Once this has happened:
commit for this release. You need an `API key <https://pypi.org/manage/account/#api-tokens>`_,
which requires permissions to maintain the Lemur `project <https://pypi.org/project/lemur/>`_.
* Run ``invoke release {version}``.
For creating the release, follow these steps (more details `here <https://packaging.python.org/tutorials/packaging-projects/#generating-distribution-archives>`_)
The release should now be available on PyPI and a tag should be available in
* Make sure you have the latest versions of setuptools and wheel installed:
``python3 -m pip install --user --upgrade setuptools wheel``
* Now run this command from the same directory where setup.py is located:
``python3 setup.py sdist bdist_wheel``
* Once completed it should generate two files in the dist directory:
.. code-block:: pycon
$ ls dist/
lemur-0.8.0-py2.py3-none-any.whl lemur-0.8.0.tar.gz
* In this step, the distribution will be uploaded. Youll need to install Twine:
``python3 -m pip install --user --upgrade twine``
* Once installed, run Twine to upload all of the archives under dist. Once installed, run Twine to upload all of the archives under dist:
``python3 -m twine upload --repository pypi dist/*``
The release should now be available on `PyPI Lemur <https://pypi.org/project/lemur/>`_ and a tag should be available in
the repository.
Make sure to also make a github `release <https://github.com/Netflix/lemur/releases>`_ which will pick up the latest version.
Verifying the release
---------------------

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 74 KiB

View File

@ -37,18 +37,20 @@ Create a New Certificate
.. figure:: create_certificate.png
Enter an owner, short description and the authority you wish to issue this certificate.
Enter a common name into the certificate, if no validity range is selected two years is
the default.
Enter an owner, common name, short description and certificate authority you wish to issue this certificate.
Depending upon the selected CA, the UI displays default validity of the certificate. You can select different
validity by entering a custom date, if supported by the CA.
You can also add `Subject Alternate Names` or SAN for certificates that need to include more than one domains,
The first domain is the Common Name and all other domains are added here as DNSName entries.
You can add notification options and upload the created certificate to a destination, both
of these are editable features and can be changed after the certificate has been created.
.. figure:: certificate_extensions.png
These options are typically for advanced users, the one exception is the `Subject Alternate Names` or SAN.
For certificates that need to include more than one domains, the first domain is the Common Name and all
other domains are added here as DNSName entries.
These options are typically for advanced users. Lemur creates ECC based certificate (ECCPRIME256V1 in particular)
by default. One can change the key type using the dropdown option listed here.
Import an Existing Certificate
@ -58,11 +60,12 @@ Import an Existing Certificate
Enter an owner, short description and public certificate. If there are intermediates and private keys
Lemur will track them just as it does if the certificate were created through Lemur. Lemur generates
a certificate name but you can override that by passing a value to the `Custom Name` field.
a certificate name but you can override that by passing a value to the `Custom Certificate Name` field.
You can add notification options and upload the created certificate to a destination, both
of these are editable features and can be changed after the certificate has been created.
.. _CreateANewUser:
Create a New User
~~~~~~~~~~~~~~~~~

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 83 KiB

View File

@ -18,3 +18,4 @@ Lemur License
-------------
.. include:: ../../LICENSE
:literal:

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

View File

@ -49,9 +49,11 @@ The amount of effort you wish to expend ensuring that Lemur has good entropy to
If you wish to generate more entropy for your system we would suggest you take a look at the following resources:
- `WES-entropy-client <https://github.com/WhitewoodCrypto/WES-entropy-client>`_
- `WES-entropy-client <https://github.com/Virginian/WES-entropy-client>`_
- `haveged <http://www.issihosts.com/haveged/>`_
The original *WES-entropy-client* repository by WhitewoodCrypto was removed, the link now points to a fork of it.
For additional information about OpenSSL entropy issues:
- `Managing and Understanding Entropy Usage <https://www.blackhat.com/docs/us-15/materials/us-15-Potter-Understanding-And-Managing-Entropy-Usage.pdf>`_
@ -313,24 +315,288 @@ It will start a shell from which you can start/stop/restart the service.
You can read all errors that might occur from /tmp/lemur.log.
.. _PeriodicTasks:
Periodic Tasks
==============
Lemur contains a few tasks that are run and scheduled basis, currently the recommend way to run these tasks is to create
a cron job that runs the commands.
celery tasks or cron jobs that run these commands.
There are currently three commands that could/should be run on a periodic basis:
The following commands that could/should be run on a periodic basis:
- `notify`
- `notify expirations` `notify authority_expirations`, and `notify security_expiration_summary` (see :ref:`NotificationOptions` for configuration info)
- `check_revoked`
- `sync`
How often you run these commands is largely up to the user. `notify` and `check_revoked` are typically run at least once a day.
`sync` is typically run every 15 minutes.
If you are using LetsEncrypt, you must also run the following:
- `fetch_all_pending_acme_certs`
- `remove_old_acme_certs`
How often you run these commands is largely up to the user. `notify` should be run once a day (more often will result in
duplicate notifications). `check_revoked` is typically run at least once a day.
`sync` is typically run every 15 minutes. `fetch_all_pending_acme_certs` should be ran frequently (Every minute is fine).
`remove_old_acme_certs` can be ran more rarely, such as once every week.
Example cron entries::
0 22 * * * lemuruser export LEMUR_CONF=/Users/me/.lemur/lemur.conf.py; /www/lemur/bin/lemur notify expirations
0 22 * * * lemuruser export LEMUR_CONF=/Users/me/.lemur/lemur.conf.py; /www/lemur/bin/lemur notify authority_expirations
0 22 * * * lemuruser export LEMUR_CONF=/Users/me/.lemur/lemur.conf.py; /www/lemur/bin/lemur notify security_expiration_summary
*/15 * * * * lemuruser export LEMUR_CONF=/Users/me/.lemur/lemur.conf.py; /www/lemur/bin/lemur source sync -s all
0 22 * * * lemuruser export LEMUR_CONF=/Users/me/.lemur/lemur.conf.py; /www/lemur/bin/lemur certificate check_revoked
Example Celery configuration (To be placed in your configuration file)::
CELERYBEAT_SCHEDULE = {
'fetch_all_pending_acme_certs': {
'task': 'lemur.common.celery.fetch_all_pending_acme_certs',
'options': {
'expires': 180
},
'schedule': crontab(minute="*"),
},
'remove_old_acme_certs': {
'task': 'lemur.common.celery.remove_old_acme_certs',
'options': {
'expires': 180
},
'schedule': crontab(hour=7, minute=30, day_of_week=1),
},
'clean_all_sources': {
'task': 'lemur.common.celery.clean_all_sources',
'options': {
'expires': 180
},
'schedule': crontab(hour=1, minute=0, day_of_week=1),
},
'sync_all_sources': {
'task': 'lemur.common.celery.sync_all_sources',
'options': {
'expires': 180
},
'schedule': crontab(hour="*/3", minute=5),
},
'sync_source_destination': {
'task': 'lemur.common.celery.sync_source_destination',
'options': {
'expires': 180
},
'schedule': crontab(hour="*"),
},
'notify_expirations': {
'task': 'lemur.common.celery.notify_expirations',
'options': {
'expires': 180
},
'schedule': crontab(hour=22, minute=0),
},
'notify_authority_expirations': {
'task': 'lemur.common.celery.notify_authority_expirations',
'options': {
'expires': 180
},
'schedule': crontab(hour=22, minute=0),
},
'send_security_expiration_summary': {
'task': 'lemur.common.celery.send_security_expiration_summary',
'options': {
'expires': 180
},
'schedule': crontab(hour=22, minute=0),
}
}
To enable celery support, you must also have configuration values that tell Celery which broker and backend to use.
Here are the Celery configuration variables that should be set::
CELERY_RESULT_BACKEND = 'redis://your_redis_url:6379'
CELERY_BROKER_URL = 'redis://your_redis_url:6379/0'
CELERY_IMPORTS = ('lemur.common.celery')
CELERY_TIMEZONE = 'UTC'
REDIS_HOST="your_redis_url"
REDIS_PORT=6379
REDIS_DB=0
Out of the box, every Redis instance supports 16 databases. The default database (`REDIS_DB`) is set to 0, however, you can use any of the databases from 0-15. Via `redis.conf` more databases can be supported.
In the `redis://` url, the database number can be added with a slash after the port. (defaults to 0, if omitted)
Do not forget to import crontab module in your configuration file::
from celery.task.schedules import crontab
You must start a single Celery scheduler instance and one or more worker instances in order to handle incoming tasks.
The scheduler can be started with::
LEMUR_CONF='/location/to/conf.py' /location/to/lemur/bin/celery -A lemur.common.celery beat
And the worker can be started with desired options such as the following::
LEMUR_CONF='/location/to/conf.py' /location/to/lemur/bin/celery -A lemur.common.celery worker --concurrency 10 -E -n lemurworker1@%%h
supervisor or systemd configurations should be created for these in production environments as appropriate.
Add support for LetsEncrypt/ACME
================================
LetsEncrypt is a free, limited-feature certificate authority that offers publicly trusted certificates that are valid
for 90 days. LetsEncrypt does not use organizational validation (OV), and instead relies on domain validation (DV).
LetsEncrypt requires that we prove ownership of a domain before we're able to issue a certificate for that domain, each
time we want a certificate.
The most common methods to prove ownership are HTTP validation and DNS validation. Lemur supports DNS validation
through the creation of DNS TXT records as well as HTTP validation, reusing the destination concept.
ACME DNS Challenge
------------------
In a nutshell, when we send a certificate request to LetsEncrypt, they generate a random token and ask us to put that
token in a DNS text record to prove ownership of a domain. If a certificate request has multiple domains, we must
prove ownership of all of these domains through this method. The token is typically written to a TXT record at
-acme_challenge.domain.com. Once we create the appropriate TXT record(s), Lemur will try to validate propagation
before requesting that LetsEncrypt finalize the certificate request and send us the certificate.
.. figure:: letsencrypt_flow.png
To start issuing certificates through LetsEncrypt, you must enable Celery support within Lemur first. After doing so,
you need to create a LetsEncrypt authority. To do this, visit
Authorities -> Create. Set the applicable attributes and click "More Options".
.. figure:: letsencrypt_authority_1.png
You will need to set "Certificate" to LetsEncrypt's active chain of trust for the authority you want to use. To find
the active chain of trust at the time of writing, please visit `LetsEncrypt
<https://letsencrypt.org/certificates/>`_.
Under Acme_url, enter in the appropriate endpoint URL. Lemur supports LetsEncrypt's V2 API, and we recommend you to use
this. At the time of writing, the staging and production URLs for LetsEncrypt V2 are
https://acme-staging-v02.api.letsencrypt.org/directory and https://acme-v02.api.letsencrypt.org/directory.
.. figure:: letsencrypt_authority_2.png
After creating the authorities, we will need to create a DNS provider. Visit `Admin` -> `DNS Providers` and click
`Create`. Lemur comes with a few provider plugins built in, with different options. Create a DNS provider with the
appropriate choices.
.. figure:: create_dns_provider.png
By default, users will need to select the DNS provider that is authoritative over their domain in order for the
LetsEncrypt flow to function. However, Lemur will attempt to automatically determine the appropriate provider if
possible. To enable this functionality, periodically (or through Cron/Celery) run `lemur dns_providers get_all_zones`.
This command will traverse all DNS providers, determine which zones they control, and upload this list of zones to
Lemur's database (in the dns_providers table). Alternatively, you can manually input this data.
ACME HTTP Challenge
-------------------
The flow for requesting a certificate using the HTTP challenge is not that different from the one described for the DNS
challenge. The only difference is, that instead of creating a DNS TXT record, a file is uploaded to a Webserver which
serves the file at `http://<domain>/.well-known/acme-challenge/<token>`
Currently the HTTP challenge also works without Celery, since it's done while creating the certificate, and doesn't
rely on celery to create the DNS record. This will change when we implement mix & match of acme challenge types.
To create a HTTP compatible Authority, you first need to create a new destination that will be used to deploy the
challenge token. Visit `Admin` -> `Destination` and click `Create`. The path you provide for the destination needs to
be the exact path that is called when the ACME providers calls `http://<domain>/.well-known/acme-challenge/`. The
token part will be added dynamically by the acme_upload.
Currently only the SFTP and S3 Bucket destination support the ACME HTTP challenge.
Afterwards you can create a new certificate authority as described in the DNS challenge, but need to choose
`Acme HTTP-01` as the plugin type, and then the destination you created beforehand.
LetsEncrypt: pinning to cross-signed ICA
----------------------------------------
Let's Encrypt has been using a `cross-signed <https://letsencrypt.org/certificates/>`_ intermediate CA by DST Root CA X3,
which is included in many older devices' TrustStore.
Let's Encrypt is `transitioning <https://letsencrypt.org/2019/04/15/transitioning-to-isrg-root.html>`_ to use
the intermediate CA issued by their own root (ISRG X1) starting from September 29th 2020.
This is in preparation of concluding the initial bootstrapping of their CA, by having it cross-signed by an older CA.
Lemur can temporarily pin to the cross-signed intermediate CA (same public/private key pair as the ICA signed by ISRG X1).
This will prolong support for incompatible devices.
The following must be added to the config file to activate the pinning (the pinning will be removed by September 2021)::
# remove or update after Mar 17 16:40:46 2021 GMT
IDENTRUST_CROSS_SIGNED_LE_ICA_EXPIRATION_DATE = "17/03/21"
IDENTRUST_CROSS_SIGNED_LE_ICA = """
-----BEGIN CERTIFICATE-----
MIIEkjCCA3qgAwIBAgIQCgFBQgAAAVOFc2oLheynCDANBgkqhkiG9w0BAQsFADA/
MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT
DkRTVCBSb290IENBIFgzMB4XDTE2MDMxNzE2NDA0NloXDTIxMDMxNzE2NDA0Nlow
SjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUxldCdzIEVuY3J5cHQxIzAhBgNVBAMT
GkxldCdzIEVuY3J5cHQgQXV0aG9yaXR5IFgzMIIBIjANBgkqhkiG9w0BAQEFAAOC
AQ8AMIIBCgKCAQEAnNMM8FrlLke3cl03g7NoYzDq1zUmGSXhvb418XCSL7e4S0EF
q6meNQhY7LEqxGiHC6PjdeTm86dicbp5gWAf15Gan/PQeGdxyGkOlZHP/uaZ6WA8
SMx+yk13EiSdRxta67nsHjcAHJyse6cF6s5K671B5TaYucv9bTyWaN8jKkKQDIZ0
Z8h/pZq4UmEUEz9l6YKHy9v6Dlb2honzhT+Xhq+w3Brvaw2VFn3EK6BlspkENnWA
a6xK8xuQSXgvopZPKiAlKQTGdMDQMc2PMTiVFrqoM7hD8bEfwzB/onkxEz0tNvjj
/PIzark5McWvxI0NHWQWM6r6hCm21AvA2H3DkwIDAQABo4IBfTCCAXkwEgYDVR0T
AQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAYYwfwYIKwYBBQUHAQEEczBxMDIG
CCsGAQUFBzABhiZodHRwOi8vaXNyZy50cnVzdGlkLm9jc3AuaWRlbnRydXN0LmNv
bTA7BggrBgEFBQcwAoYvaHR0cDovL2FwcHMuaWRlbnRydXN0LmNvbS9yb290cy9k
c3Ryb290Y2F4My5wN2MwHwYDVR0jBBgwFoAUxKexpHsscfrb4UuQdf/EFWCFiRAw
VAYDVR0gBE0wSzAIBgZngQwBAgEwPwYLKwYBBAGC3xMBAQEwMDAuBggrBgEFBQcC
ARYiaHR0cDovL2Nwcy5yb290LXgxLmxldHNlbmNyeXB0Lm9yZzA8BgNVHR8ENTAz
MDGgL6AthitodHRwOi8vY3JsLmlkZW50cnVzdC5jb20vRFNUUk9PVENBWDNDUkwu
Y3JsMB0GA1UdDgQWBBSoSmpjBH3duubRObemRWXv86jsoTANBgkqhkiG9w0BAQsF
AAOCAQEA3TPXEfNjWDjdGBX7CVW+dla5cEilaUcne8IkCJLxWh9KEik3JHRRHGJo
uM2VcGfl96S8TihRzZvoroed6ti6WqEBmtzw3Wodatg+VyOeph4EYpr/1wXKtx8/
wApIvJSwtmVi4MFU5aMqrSDE6ea73Mj2tcMyo5jMd6jmeWUHK8so/joWUoHOUgwu
X4Po1QYz+3dszkDqMp4fklxBwXRsW10KXzPMTZ+sOPAveyxindmjkW8lGy+QsRlG
PfZ+G6Z6h7mjem0Y+iWlkYcV4PIWL1iwBi8saCbGS5jN2p8M+X+Q7UNKEkROb3N6
KOqkqm57TH2H3eDJAkSnh6/DNFu0Qg==
-----END CERTIFICATE-----
"""
.. _AcmeAccountReuse:
LetsEncrypt: Using a pre-existing ACME account
-----------------------------------------------
Let's Encrypt allows reusing an existing ACME account, to create and especially revoke certificates. The current
implementation in the acme plugin, only allows for a single account for all ACME authorities, which might be an issue,
when you try to use Let's Encrypt together with another certificate authority that uses the ACME protocol.
To use an existing account, you need to configure the `ACME_PRIVATE_KEY` and `ACME_REGR` variables in the lemur
configuration.
`ACME_PRIVATE_KEY` needs to be in the JWK format::
{
"kty": "RSA",
"n": "yr1qBwHizA7ME_iV32bY10ILp.....",
"e": "AQAB",
"d": "llBlYhil3I.....",
"p": "-5LW2Lewogo.........",
"q": "zk6dHqHfHksd.........",
"dp": "qfe9fFIu3mu.......",
"dq": "cXFO-loeOyU.......",
"qi": "AfK1sh0_8sLTb..........."
}
Using `python-jwt` converting an existing private key in PEM format is quite easy::
import python_jwt as jwt, jwcrypto.jwk as jwk
priv_key = jwk.JWK.from_pem(b"""-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----""")
print(priv_key.export())
`ACME_REGR` needs to be a valid JSON with a `body` and a `uri` attribute, similar to this::
{"body": {}, "uri": "https://acme-staging-v02.api.letsencrypt.org/acme/acct/<ACCOUNT_NUMBER>"}
The URI can be retrieved from the ACME create account endpoint when creating a new account, using the existing key.

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

View File

@ -1,9 +1,10 @@
Quickstart
**********
This guide will step you through setting up a Python-based virtualenv, installing the required packages, and configuring the basic web service. This guide assumes a clean Ubuntu 14.04 instance, commands may differ based on the OS and configuration being used.
This guide will step you through setting up a Python-based virtualenv, installing the required packages, and configuring the basic web service.
This guide assumes a clean Ubuntu 18.04/20.04 instance, commands may differ based on the OS and configuration being used.
Pressed for time? See the Lemur docker file on `Github <https://github.com/Netflix/lemur-docker>`_.
For a quicker alternative, see the Lemur docker file on `Github <https://github.com/Netflix/lemur-docker>`_.
Dependencies
@ -11,34 +12,36 @@ Dependencies
Some basic prerequisites which you'll need in order to run Lemur:
* A UNIX-based operating system (we test on Ubuntu, develop on OS X)
* Python 3.5 or greater
* A UNIX-based operating system (we test on Ubuntu, develop on macOS)
* Python 3.7 or greater
* PostgreSQL 9.4 or greater
* Nginx
* Node v10.x (LTS)
.. note:: Lemur was built with in AWS in mind. This means that things such as databases (RDS), mail (SES), and TLS (ELB), are largely handled for us. Lemur does **not** require AWS to function. Our guides and documentation try to be as generic as possible and are not intended to document every step of launching Lemur into a given environment.
.. note:: Ubuntu 18.04 supports by default Python 3.6.x and Node v8.x
.. note:: Lemur was built with AWS in mind. This means that things such as databases (RDS), mail (SES), and TLS (ELB), are largely handled for us. Lemur does **not** require AWS to function. Our guides and documentation try to be as generic as possible and are not intended to document every step of launching Lemur into a given environment.
Installing Build Dependencies
-----------------------------
If installing Lemur on a bare Ubuntu OS you will need to grab the following packages so that Lemur can correctly build it's dependencies:
If installing Lemur on a bare Ubuntu OS you will need to grab the following packages so that Lemur can correctly build its dependencies:
.. code-block:: bash
$ sudo apt-get update
$ sudo apt-get install nodejs nodejs-legacy python-pip python-dev python3-dev libpq-dev build-essential libssl-dev libffi-dev libsasl2-dev libldap2-dev nginx git supervisor npm postgresql
sudo apt-get update
sudo apt-get install nodejs npm python-pip python-dev python3-dev libpq-dev build-essential libssl-dev libffi-dev libsasl2-dev libldap2-dev nginx git supervisor postgresql
.. note:: PostgreSQL is only required if your database is going to be on the same host as the webserver. npm is needed if you're installing Lemur from the source (e.g., from git).
.. note:: Installing node from a package manager may creat the nodejs bin at /usr/bin/nodejs instead of /usr/bin/node If that is the case run the following
$ sudo ln -s /user/bin/nodejs /usr/bin/node
.. note:: Installing node from a package manager may create the nodejs bin at /usr/bin/nodejs instead of /usr/bin/node If that is the case run the following
sudo ln -s /user/bin/nodejs /usr/bin/node
Now, install Python ``virtualenv`` package:
.. code-block:: bash
$ sudo pip install -U virtualenv
sudo pip install -U virtualenv
Setting up an Environment
@ -48,28 +51,28 @@ In this guide, Lemur will be installed in ``/www``, so you need to create that s
.. code-block:: bash
$ sudo mkdir /www
$ cd /www
sudo mkdir /www
cd /www
Clone Lemur inside the just created directory and give yourself write permission (we assume ``lemur`` is the user):
.. code-block:: bash
$ sudo useradd lemur
$ sudo passwd lemur
$ sudo mkdir /home/lemur
$ sudo chown lemur:lemur /home/lemur
$ sudo git clone https://github.com/Netflix/lemur
$ sudo chown -R lemur lemur/
sudo useradd lemur
sudo passwd lemur
sudo mkdir /home/lemur
sudo chown lemur:lemur /home/lemur
sudo git clone https://github.com/Netflix/lemur
sudo chown -R lemur lemur/
Create the virtual environment, activate it and enter the Lemur's directory:
.. code-block:: bash
$ su lemur
$ virtualenv -p python3 lemur
$ source /www/lemur/bin/activate
$ cd lemur
su lemur
virtualenv -p python3 lemur
source /www/lemur/bin/activate
cd lemur
.. note:: Activating the environment adjusts your PATH, so that things like pip now install into the virtualenv by default.
@ -81,13 +84,13 @@ Once your system is prepared, ensure that you are in the virtualenv:
.. code-block:: bash
$ which python
which python
And then run:
.. code-block:: bash
$ make release
make release
.. note:: This command will install npm dependencies as well as compile static assets.
@ -101,7 +104,7 @@ You may also run with the urlContextPath variable set. If this is set it will ad
.. code-block:: bash
$ make release urlContextPath={desired context path}
make release urlContextPath={desired context path}
Creating a configuration
@ -113,7 +116,7 @@ Simply run:
.. code-block:: bash
$ lemur create_config
lemur create_config
.. note:: This command will create a default configuration under ``~/.lemur/lemur.conf.py`` you can specify this location by passing the ``config_path`` parameter to the ``create_config`` command.
@ -127,10 +130,10 @@ Once created, you will need to update the configuration file with information ab
.. code-block:: bash
$ vi ~/.lemur/lemur.conf.py
vi ~/.lemur/lemur.conf.py
.. note:: If you are unfamiliar with the SQLALCHEMY_DATABASE_URI string it can be broken up like so:
``postgresql://userame:password@<database-fqdn>:<database-port>/<database-name>``
``postgresql://username:password@<database-fqdn>:<database-port>/<database-name>``
Before Lemur will run you need to fill in a few required variables in the configuration file:
@ -144,8 +147,8 @@ Before Lemur will run you need to fill in a few required variables in the config
LEMUR_DEFAULT_ORGANIZATION
LEMUR_DEFAULT_ORGANIZATIONAL_UNIT
Setup Postgres
--------------
Set Up Postgres
---------------
For production, a dedicated database is recommended, for this guide we will assume postgres has been installed and is on the same machine that Lemur is installed on.
@ -153,8 +156,8 @@ First, set a password for the postgres user. For this guide, we will use ``lemu
.. code-block:: bash
$ sudo -u postgres -i
$ psql
sudo -u postgres -i
psql
postgres=# CREATE USER lemur WITH PASSWORD 'lemur';
Once successful, type CTRL-D to exit the Postgres shell.
@ -163,7 +166,7 @@ Next, we will create our new database:
.. code-block:: bash
$ sudo -u postgres createdb lemur
sudo -u postgres createdb lemur
.. _InitializingLemur:
@ -180,23 +183,38 @@ Lemur provides a helpful command that will initialize your database for you. It
In addition to creating a new user, Lemur also creates a few default email notifications. These notifications are based on a few configuration options such as ``LEMUR_SECURITY_TEAM_EMAIL``. They basically guarantee that every certificate within Lemur will send one expiration notification to the security team.
Additional notifications can be created through the UI or API. See :ref:`Creating Notifications <CreatingNotifications>` and :ref:`Command Line Interface <CommandLineInterface>` for details.
Your database installation requires the pg_trgm extension. If you do not have this installed already, you can allow the script to install this for you by adding the SUPERUSER permission to the lemur database user.
.. code-block:: bash
sudo -u postgres -i
psql
postgres=# ALTER USER lemur WITH SUPERUSER
Additional notifications can be created through the UI or API. See :ref:`Notification Options <NotificationOptions>` and :ref:`Command Line Interface <CommandLineInterface>` for details.
**Make note of the password used as this will be used during first login to the Lemur UI.**
.. code-block:: bash
$ cd /www/lemur/lemur
$ lemur init
cd /www/lemur/lemur
lemur init
.. note:: If you added the SUPERUSER permission to the lemur database user above, it is recommended you revoke that permission now.
.. code-block:: bash
sudo -u postgres -i
psql
postgres=# ALTER USER lemur WITH NOSUPERUSER
.. note:: It is recommended that once the ``lemur`` user is created that you create individual users for every day access. There is currently no way for a user to self enroll for Lemur access, they must have an administrator create an account for them or be enrolled automatically through SSO. This can be done through the CLI or UI. See :ref:`Creating Users <CreatingUsers>` and :ref:`Command Line Interface <CommandLineInterface>` for details.
.. note:: It is recommended that once the ``lemur`` user is created that you create individual users for every day access. There is currently no way for a user to self enroll for Lemur access, they must have an administrator create an account for them or be enrolled automatically through SSO. This can be done through the CLI or UI. See :ref:`Creating a New User <CreateANewUser>` and :ref:`Command Line Interface <CommandLineInterface>` for details.
Set Up a Reverse Proxy
----------------------
Setup a Reverse Proxy
---------------------
By default, Lemur runs on port 8000. Even if you change this, under normal conditions you won't be able to bind to port 80. To get around this (and to avoid running Lemur as a privileged user, which you shouldn't), we need setup a simple web proxy. There are many different web servers you can use for this, we like and recommend Nginx.
By default, Lemur runs on port 8000. Even if you change this, under normal conditions you won't be able to bind to port 80. To get around this (and to avoid running Lemur as a privileged user, which you shouldn't), we need to set up a simple web proxy. There are many different web servers you can use for this, we like and recommend Nginx.
Proxying with Nginx
@ -228,7 +246,7 @@ After making these changes, restart Nginx service to apply them:
.. code-block:: bash
$ sudo service nginx restart
sudo service nginx restart
Starting the Web Service
@ -284,7 +302,7 @@ Lemur uses periodic sync tasks to make sure it is up-to-date with its environmen
.. code-block:: bash
$ crontab -e
crontab -e
*/15 * * * * lemur sync -s all
0 22 * * * lemur check_revoked
0 22 * * * lemur notify
@ -310,6 +328,12 @@ unlock
Decrypts sensitive key material - used to decrypt the secrets stored in source during deployment.
Automated celery tasks
~~~~~~~~~~~~~~~~~~~~~~
Please refer to :ref:`Periodic Tasks <PeriodicTasks>` to learn more about task scheduling in Lemur.
What's Next?
------------

View File

@ -22,7 +22,7 @@ Supported Versions
------------------
At any given time, we will provide security support for the `master`_ branch
as well as the 2 most recent releases.
as well as the most recent release.
Disclosure Process
------------------
@ -30,20 +30,15 @@ Disclosure Process
Our process for taking a security issue from private discussion to public
disclosure involves multiple steps.
Approximately one week before full public disclosure, we will send advance
notification of the issue to a list of people and organizations, primarily
composed of operating-system vendors and other distributors of
``lemur``. This notification will consist of an email message
containing:
Approximately one week before full public disclosure, we will provide advanced notification that a security issue exists. Depending on the severity of the issue, we may choose to either send a targeted email to known Lemur users and contributors or post an issue to the Lemur repository. In either case, the notification should contain the following.
* A full description of the issue and the affected versions of
``lemur``.
* A description of the potential impact
* The affected versions of ``lemur``.
* The steps we will be taking to remedy the issue.
* The patches, if any, that will be applied to ``lemur``.
* The date on which the ``lemur`` team will apply these patches, issue
new releases, and publicly disclose the issue.
Simultaneously, the reporter of the issue will receive notification of the date
If the issue was disclosed to us, the reporter will receive notification of the date
on which we plan to make the issue public.
On the day of disclosure, we will take the following steps:
@ -52,7 +47,7 @@ On the day of disclosure, we will take the following steps:
messages for these patches will indicate that they are for security issues,
but will not describe the issue in any detail; instead, they will warn of
upcoming disclosure.
* Issue the relevant releases.
* Issue an updated release.
If a reported issue is believed to be particularly time-sensitive due to a
known exploit in the wild, for example the time between advance notification

View File

@ -21,7 +21,6 @@ var gulp = require('gulp'),
useref = require('gulp-useref'),
filter = require('gulp-filter'),
rev = require('gulp-rev'),
revReplace = require('gulp-rev-replace'),
imagemin = require('gulp-imagemin'),
minifyHtml = require('gulp-minify-html'),
bowerFiles = require('main-bower-files'),
@ -29,52 +28,77 @@ var gulp = require('gulp'),
replace = require('gulp-replace'),
argv = require('yargs').argv;
gulp.task('default', ['clean'], function () {
gulp.start('fonts', 'styles');
// http://stackoverflow.com/questions/1144783/replacing-all-occurrences-of-a-string-in-javascript
function escapeRegExp(string) {
return string.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1');
}
function replaceAll(string, find, replace) {
return string.replace(new RegExp(escapeRegExp(find), 'g'), replace);
}
function stringSrc(filename, string) {
let src = require('stream').Readable({objectMode: true});
src._read = function () {
this.push(new gutil.File({cwd: '', base: '', path: filename, contents: Buffer.from(string)}));
this.push(null);
};
return src;
}
gulp.task('clean', function (done) {
del(['.tmp', 'lemur/static/dist'], done);
done();
});
gulp.task('clean', function (cb) {
del(['.tmp', 'lemur/static/dist'], cb);
});
gulp.task('default', gulp.series(['clean'], function () {
gulp.start('fonts', 'styles');
}));
gulp.task('test', function (done) {
new karma.Server({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, function() {
}, function (err) {
if (err === 0) {
done();
} else {
// if karma server failed to start raise error
done(new gutil.PluginError('karma', {
message: 'Karma Tests failed'
}));
}
}).start();
});
gulp.task('dev:fonts', function () {
var fileList = [
let fileList = [
'bower_components/bootstrap/dist/fonts/*',
'bower_components/fontawesome/fonts/*'
];
return gulp.src(fileList)
.pipe(gulp.dest('.tmp/fonts'));
.pipe(gulp.dest('.tmp/fonts')); // returns a stream making it async
});
gulp.task('dev:styles', function () {
var baseContent = '@import "bower_components/bootstrap/less/bootstrap.less";@import "bower_components/bootswatch/$theme$/variables.less";@import "bower_components/bootswatch/$theme$/bootswatch.less";@import "bower_components/bootstrap/less/utilities.less";';
var isBootswatchFile = function (file) {
let baseContent = '@import "bower_components/bootstrap/less/bootstrap.less";@import "bower_components/bootswatch/$theme$/variables.less";@import "bower_components/bootswatch/$theme$/bootswatch.less";@import "bower_components/bootstrap/less/utilities.less";';
let isBootswatchFile = function (file) {
var suffix = 'bootswatch.less';
let suffix = 'bootswatch.less';
return file.path.indexOf(suffix, file.path.length - suffix.length) !== -1;
};
var isBootstrapFile = function (file) {
var suffix = 'bootstrap-',
let isBootstrapFile = function (file) {
let suffix = 'bootstrap-',
fileName = path.basename(file.path);
return fileName.indexOf(suffix) === 0;
};
var fileList = [
let fileList = [
'bower_components/bootswatch/sandstone/bootswatch.less',
'bower_components/fontawesome/css/font-awesome.css',
'bower_components/angular-spinkit/src/angular-spinkit.css',
'bower_components/angular-chart.js/dist/angular-chart.css',
'bower_components/angular-loading-bar/src/loading-bar.css',
'bower_components/angular-ui-switch/angular-ui-switch.css',
@ -87,20 +111,18 @@ gulp.task('dev:styles', function () {
return gulp.src(fileList)
.pipe(gulpif(isBootswatchFile, foreach(function (stream, file) {
var themeName = path.basename(path.dirname(file.path)),
content = replaceAll(baseContent, '$theme$', themeName),
file2 = string_src('bootstrap-' + themeName + '.less', content);
return file2;
let themeName = path.basename(path.dirname(file.path)),
content = replaceAll(baseContent, '$theme$', themeName);
return stringSrc('bootstrap-' + themeName + '.less', content);
})))
.pipe(less())
.pipe(gulpif(isBootstrapFile, foreach(function (stream, file) {
var fileName = path.basename(file.path),
let fileName = path.basename(file.path),
themeName = fileName.substring(fileName.indexOf('-') + 1, fileName.indexOf('.'));
// http://stackoverflow.com/questions/21719833/gulp-how-to-add-src-files-in-the-middle-of-a-pipe
// https://github.com/gulpjs/gulp/blob/master/docs/recipes/using-multiple-sources-in-one-task.md
return merge(stream, gulp.src(['.tmp/styles/font-awesome.css', '.tmp/styles/lemur.css']))
return merge(stream, gulp.src(['.tmp/styles/font-awesome.css', '.tmp/styles/lemur.css'], {allowEmpty: true}))
.pipe(concat('style-' + themeName + '.css'));
})))
.pipe(plumber())
@ -111,24 +133,6 @@ gulp.task('dev:styles', function () {
.pipe(size());
});
// http://stackoverflow.com/questions/1144783/replacing-all-occurrences-of-a-string-in-javascript
function escapeRegExp(string) {
return string.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1');
}
function replaceAll(string, find, replace) {
return string.replace(new RegExp(escapeRegExp(find), 'g'), replace);
}
function string_src(filename, string) {
var src = require('stream').Readable({ objectMode: true });
src._read = function () {
this.push(new gutil.File({ cwd: '', base: '', path: filename, contents: new Buffer(string) }));
this.push(null);
};
return src;
}
gulp.task('dev:scripts', function () {
return gulp.src(['lemur/static/app/angular/**/*.js'])
.pipe(jshint())
@ -162,7 +166,7 @@ function injectHtml(isDev) {
}))
.pipe(
gulpif(!isDev,
inject(gulp.src('lemur/static/dist/ngviews/ngviews.min.js'), {
inject(gulp.src('lemur/static/dist/ngviews/ngviews.min.js', {allowEmpty: true}), {
starttag: '<!-- inject:ngviews -->',
addRootSlash: false
})
@ -170,13 +174,9 @@ function injectHtml(isDev) {
).pipe(gulp.dest('.tmp/'));
}
gulp.task('dev:inject', ['dev:styles', 'dev:scripts'], function () {
gulp.task('dev:inject', gulp.series(['dev:styles', 'dev:scripts'], function () {
return injectHtml(true);
});
gulp.task('build:inject', ['dev:styles', 'dev:scripts', 'build:ngviews'], function () {
return injectHtml(false);
});
}));
gulp.task('build:ngviews', function () {
return gulp.src(['lemur/static/app/angular/**/*.html'])
@ -189,9 +189,13 @@ gulp.task('build:ngviews', function () {
.pipe(size());
});
gulp.task('build:html', ['dev:styles', 'dev:scripts', 'build:ngviews', 'build:inject'], function () {
var jsFilter = filter(['**/*.js'], {'restore': true});
var cssFilter = filter(['**/*.css'], {'restore': true});
gulp.task('build:inject', gulp.series(['dev:styles', 'dev:scripts', 'build:ngviews'], function () {
return injectHtml(false);
}));
gulp.task('build:html', gulp.series(['build:inject'], function () {
let jsFilter = filter(['**/*.js'], {'restore': true});
let cssFilter = filter(['**/*.css'], {'restore': true});
return gulp.src('.tmp/index.html')
.pipe(jsFilter)
@ -203,12 +207,12 @@ gulp.task('build:html', ['dev:styles', 'dev:scripts', 'build:ngviews', 'build:in
.pipe(useref())
.pipe(gulp.dest('lemur/static/dist'))
.pipe(size());
});
}));
gulp.task('build:fonts', ['dev:fonts'], function () {
gulp.task('build:fonts', gulp.series(['dev:fonts'], function () {
return gulp.src('.tmp/fonts/**/*')
.pipe(gulp.dest('lemur/static/dist/fonts'));
});
}));
gulp.task('build:images', function () {
return gulp.src('lemur/static/app/images/**/*')
@ -230,36 +234,28 @@ gulp.task('package:strip', function () {
.pipe(size());
});
gulp.task('addUrlContextPath',['addUrlContextPath:revreplace'], function(){
var urlContextPathExists = argv.urlContextPath ? true : false;
['lemur/static/dist/scripts/main*.js',
'lemur/static/dist/angular/**/*.html']
.forEach(function(file){
return gulp.src(file)
.pipe(gulpif(urlContextPathExists, replace('api/', argv.urlContextPath + '/api/')))
.pipe(gulpif(urlContextPathExists, replace('angular/', argv.urlContextPath + '/angular/')))
.pipe(gulp.dest(function(file){
return file.base;
}))
})
});
gulp.task('addUrlContextPath:revision', function () {
return gulp.src(['lemur/static/dist/**/*.css', 'lemur/static/dist/**/*.js'])
.pipe(rev())
.pipe(gulp.dest('lemur/static/dist'))
.pipe(rev.manifest())
.pipe(gulp.dest('lemur/static/dist'))
})
gulp.task('addUrlContextPath:revreplace', ['addUrlContextPath:revision'], function(){
var manifest = gulp.src("lemur/static/dist/rev-manifest.json");
var urlContextPathExists = argv.urlContextPath ? true : false;
return gulp.src( "lemur/static/dist/index.html")
.pipe(gulpif(urlContextPathExists, revReplace({prefix: argv.urlContextPath + '/', manifest: manifest}, revReplace({manifest: manifest}))))
.pipe(gulp.dest('lemur/static/dist'));
})
});
gulp.task('addUrlContextPath:revreplace', gulp.series(['addUrlContextPath:revision'], function () {
return gulp.src('lemur/static/dist/index.html')
.pipe(gulp.dest('lemur/static/dist'));
}));
gulp.task('build', ['build:ngviews', 'build:inject', 'build:images', 'build:fonts', 'build:html', 'build:extras']);
gulp.task('package', ['addUrlContextPath', 'package:strip']);
gulp.task('addUrlContextPath', gulp.series(['addUrlContextPath:revreplace'], function () {
let urlContextPathExists = !!argv.urlContextPath;
return gulp.src(['lemur/static/dist/scripts/main*.js', 'lemur/static/dist/angular/**/*.html'])
.pipe(gulpif(urlContextPathExists, replace('api/', argv.urlContextPath + '/api/')))
.pipe(gulpif(urlContextPathExists, replace('/angular/', '/' + argv.urlContextPath + '/angular/')))
.pipe(gulp.dest(function (file) {
return file.base;
}));
}));
gulp.task('build', gulp.series(['build:images', 'build:fonts', 'build:html', 'build:extras']));
gulp.task('package', gulp.series(['addUrlContextPath', 'package:strip']));

View File

@ -1,10 +1,12 @@
// Contents of: config/karma.conf.js
'use strict';
module.exports = function (config) {
config.set({
basePath: '../',
// Fix for "JASMINE is not supported anymore" warning
frameworks : ["jasmine"],
frameworks: ['jasmine'],
files: [
'app/lib/angular/angular.js',
@ -16,12 +18,20 @@ module.exports = function (config) {
autoWatch: true,
browsers : ['Chrome'],
browsers: [process.env.TRAVIS ? 'Chrome_travis_ci' : 'Chrome'],
customLaunchers: {
'Chrome_travis_ci': {
base: 'Chrome',
flags: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-gpu',],
},
},
junitReporter: {
outputFile: 'test_out/unit.xml',
suite: 'unit'
//...
}
},
failOnEmptyTestSuite: false,
});
};

View File

@ -1,14 +1,15 @@
'use strict';
var gulp = require('gulp');
const watch = require('./watch')
var browserSync = require('browser-sync');
var httpProxy = require('http-proxy');
/* This configuration allow you to configure browser sync to proxy your backend */
/*
var proxyTarget = 'http://localhost/context/'; // The location of your backend
var proxyApiPrefix = 'api'; // The element in the URL which differentiate between API request and static file request
var proxyTarget = 'http://localhost:8000/'; // The location of your backend
var proxyApiPrefix = '/api/'; // The element in the URL which differentiate between API request and static file request
var proxy = httpProxy.createProxyServer({
target: proxyTarget
});
@ -19,7 +20,6 @@ var httpProxy = require('http-proxy');
next();
}
}
*/
function browserSyncInit(baseDir, files, browser) {
browser = browser === undefined ? 'default' : browser;
@ -27,6 +27,7 @@ function browserSyncInit(baseDir, files, browser) {
browserSync.instance = browserSync.init(files, {
startPath: '/index.html',
server: {
middleware: [proxyMiddleware],
baseDir: baseDir,
routes: {
'/bower_components': './bower_components'
@ -38,7 +39,7 @@ function browserSyncInit(baseDir, files, browser) {
}
gulp.task('serve', ['watch'], function () {
gulp.task('serve', gulp.series(['watch'], function (done) {
browserSyncInit([
'.tmp',
'lemur/static/app'
@ -51,9 +52,12 @@ gulp.task('serve', ['watch'], function () {
'lemur/static/app/angular/**/*',
'lemur/static/app/index.html'
]);
});
done();
}));
gulp.task('serve:dist', ['build'], function () {
gulp.task('serve:dist', gulp.series(['build'], function (done) {
browserSyncInit('lemur/static/dist');
});
done();
}));

View File

@ -3,10 +3,13 @@
var gulp = require('gulp');
gulp.task('watch', ['dev:styles', 'dev:scripts', 'dev:inject', 'dev:fonts'] ,function () {
gulp.watch('app/styles/**/*.less', ['dev:styles']);
gulp.watch('app/styles/**/*.css', ['dev:styles']);
gulp.watch('app/**/*.js', ['dev:scripts']);
gulp.watch('app/images/**/*', ['build:images']);
gulp.watch('bower.json', ['dev:inject']);
});
const watch = gulp.task('watch', gulp.series(['dev:inject', 'dev:fonts'] ,function (done) {
gulp.watch('app/styles/**/*.less', gulp.series('dev:styles'));
gulp.watch('app/styles/**/*.css', gulp.series('dev:styles'));
gulp.watch('app/**/*.js', gulp.series('dev:scripts'));
gulp.watch('app/images/**/*', gulp.series('build:images'));
gulp.watch('bower.json', gulp.series('dev:inject'));
done();
}));
module.exports = {watch:watch}

View File

@ -1,15 +1,21 @@
from __future__ import absolute_import, division, print_function
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__author__",
"__email__", "__license__", "__copyright__",
"__title__",
"__summary__",
"__uri__",
"__version__",
"__author__",
"__email__",
"__license__",
"__copyright__",
]
__title__ = "lemur"
__summary__ = ("Certificate management and orchestration service")
__summary__ = "Certificate management and orchestration service"
__uri__ = "https://github.com/Netflix/lemur"
__version__ = "0.7.0"
__version__ = "develop"
__author__ = "The Lemur developers"
__email__ = "security@netflix.com"

View File

@ -5,7 +5,8 @@
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
.. moduleauthor:: Curtis Castrapel <ccastrapel@netflix.com>
.. moduleauthor:: Hossein Shafagh <hshafagh@netflix.com>
"""
import time
@ -32,14 +33,26 @@ from lemur.pending_certificates.views import mod as pending_certificates_bp
from lemur.dns_providers.views import mod as dns_providers_bp
from lemur.__about__ import (
__author__, __copyright__, __email__, __license__, __summary__, __title__,
__uri__, __version__
__author__,
__copyright__,
__email__,
__license__,
__summary__,
__title__,
__uri__,
__version__,
)
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__author__",
"__email__", "__license__", "__copyright__",
"__title__",
"__summary__",
"__uri__",
"__version__",
"__author__",
"__email__",
"__license__",
"__copyright__",
]
LEMUR_BLUEPRINTS = (
@ -62,8 +75,10 @@ LEMUR_BLUEPRINTS = (
)
def create_app(config=None):
app = factory.create_app(app_name=__name__, blueprints=LEMUR_BLUEPRINTS, config=config)
def create_app(config_path=None):
app = factory.create_app(
app_name=__name__, blueprints=LEMUR_BLUEPRINTS, config=config_path
)
configure_hook(app)
return app
@ -93,7 +108,7 @@ def configure_hook(app):
@app.after_request
def after_request(response):
# Return early if we don't have the start time
if not hasattr(g, 'request_start_time'):
if not hasattr(g, "request_start_time"):
return response
# Get elapsed time in milliseconds
@ -102,12 +117,12 @@ def configure_hook(app):
# Collect request/response tags
tags = {
'endpoint': request.endpoint,
'request_method': request.method.lower(),
'status_code': response.status_code
"endpoint": request.endpoint,
"request_method": request.method.lower(),
"status_code": response.status_code,
}
# Record our response time metric
metrics.send('response_time', 'TIMER', elapsed, metric_tags=tags)
metrics.send('status_code_{}'.format(response.status_code), 'counter', 1)
metrics.send("response_time", "TIMER", elapsed, metric_tags=tags)
metrics.send("status_code_{}".format(response.status_code), "counter", 1)
return response

View File

191
lemur/acme_providers/cli.py Normal file
View File

@ -0,0 +1,191 @@
import time
import json
import arrow
from flask_script import Manager
from flask import current_app
from lemur.extensions import sentry
from lemur.constants import SUCCESS_METRIC_STATUS
from lemur.plugins import plugins
from lemur.plugins.lemur_acme.plugin import AcmeHandler
from lemur.plugins.lemur_aws import s3
manager = Manager(
usage="Handles all ACME related tasks"
)
@manager.option(
"-d",
"--domain",
dest="domain",
required=True,
help="Name of the Domain to store to (ex. \"_acme-chall.test.com\".",
)
@manager.option(
"-t",
"--token",
dest="token",
required=True,
help="Value of the Token to store in DNS as content.",
)
def dnstest(domain, token):
"""
Create, verify, and delete DNS TXT records using an autodetected provider.
"""
print("[+] Starting ACME Tests.")
change_id = (domain, token)
acme_handler = AcmeHandler()
acme_handler.autodetect_dns_providers(domain)
if not acme_handler.dns_providers_for_domain[domain]:
raise Exception(f"No DNS providers found for domain: {format(domain)}.")
# Create TXT Records
for dns_provider in acme_handler.dns_providers_for_domain[domain]:
dns_provider_plugin = acme_handler.get_dns_provider(dns_provider.provider_type)
dns_provider_options = json.loads(dns_provider.credentials)
account_number = dns_provider_options.get("account_id")
print(f"[+] Creating TXT Record in `{dns_provider.name}` provider")
change_id = dns_provider_plugin.create_txt_record(domain, token, account_number)
print("[+] Verifying TXT Record has propagated to DNS.")
print("[+] This step could take a while...")
time.sleep(10)
# Verify TXT Records
for dns_provider in acme_handler.dns_providers_for_domain[domain]:
dns_provider_plugin = acme_handler.get_dns_provider(dns_provider.provider_type)
dns_provider_options = json.loads(dns_provider.credentials)
account_number = dns_provider_options.get("account_id")
try:
dns_provider_plugin.wait_for_dns_change(change_id, account_number)
print(f"[+] Verified TXT Record in `{dns_provider.name}` provider")
except Exception:
sentry.captureException()
current_app.logger.debug(
f"Unable to resolve DNS challenge for change_id: {change_id}, account_id: "
f"{account_number}",
exc_info=True,
)
print(f"[+] Unable to Verify TXT Record in `{dns_provider.name}` provider")
time.sleep(10)
# Delete TXT Records
for dns_provider in acme_handler.dns_providers_for_domain[domain]:
dns_provider_plugin = acme_handler.get_dns_provider(dns_provider.provider_type)
dns_provider_options = json.loads(dns_provider.credentials)
account_number = dns_provider_options.get("account_id")
# TODO(csine@: Add Exception Handling
dns_provider_plugin.delete_txt_record(change_id, account_number, domain, token)
print(f"[+] Deleted TXT Record in `{dns_provider.name}` provider")
status = SUCCESS_METRIC_STATUS
print("[+] Done with ACME Tests.")
@manager.option(
"-t",
"--token",
dest="token",
default="date: " + arrow.utcnow().format("YYYY-MM-DDTHH-mm-ss"),
required=False,
help="Value of the Token",
)
@manager.option(
"-n",
"--token_name",
dest="token_name",
default="Token-" + arrow.utcnow().format("YYYY-MM-DDTHH-mm-ss"),
required=False,
help="path",
)
@manager.option(
"-p",
"--prefix",
dest="prefix",
default="test/",
required=False,
help="S3 bucket prefix",
)
@manager.option(
"-a",
"--account_number",
dest="account_number",
required=True,
help="AWS Account",
)
@manager.option(
"-b",
"--bucket_name",
dest="bucket_name",
required=True,
help="Bucket Name",
)
def upload_acme_token_s3(token, token_name, prefix, account_number, bucket_name):
"""
This method serves for testing the upload_acme_token to S3, fetching the token to verify it, and then deleting it.
It mainly serves for testing purposes.
:param token:
:param token_name:
:param prefix:
:param account_number:
:param bucket_name:
:return:
"""
additional_options = [
{
"name": "bucket",
"value": bucket_name,
"type": "str",
"required": True,
"validation": r"[0-9a-z.-]{3,63}",
"helpMessage": "Must be a valid S3 bucket name!",
},
{
"name": "accountNumber",
"type": "str",
"value": account_number,
"required": True,
"validation": r"[0-9]{12}",
"helpMessage": "A valid AWS account number with permission to access S3",
},
{
"name": "region",
"type": "str",
"default": "us-east-1",
"required": False,
"helpMessage": "Region bucket exists",
"available": ["us-east-1", "us-west-2", "eu-west-1"],
},
{
"name": "encrypt",
"type": "bool",
"value": False,
"required": False,
"helpMessage": "Enable server side encryption",
"default": True,
},
{
"name": "prefix",
"type": "str",
"value": prefix,
"required": False,
"helpMessage": "Must be a valid S3 object prefix!",
},
]
p = plugins.get("aws-s3")
p.upload_acme_token(token_name, token, additional_options)
if not prefix.endswith("/"):
prefix + "/"
token_res = s3.get(bucket_name, prefix + token_name, account_number=account_number)
assert(token_res == token)
s3.delete(bucket_name, prefix + token_name, account_number=account_number)

View File

@ -14,23 +14,32 @@ from datetime import datetime
manager = Manager(usage="Handles all api key related tasks.")
@manager.option('-u', '--user-id', dest='uid', help='The User ID this access key belongs too.')
@manager.option('-n', '--name', dest='name', help='The name of this API Key.')
@manager.option('-t', '--ttl', dest='ttl', help='The TTL of this API Key. -1 for forever.')
@manager.option(
"-u", "--user-id", dest="uid", help="The User ID this access key belongs too."
)
@manager.option("-n", "--name", dest="name", help="The name of this API Key.")
@manager.option(
"-t", "--ttl", dest="ttl", help="The TTL of this API Key. -1 for forever."
)
def create(uid, name, ttl):
"""
Create a new api key for a user.
:return:
"""
print("[+] Creating a new api key.")
key = api_key_service.create(user_id=uid, name=name,
ttl=ttl, issued_at=int(datetime.utcnow().timestamp()), revoked=False)
key = api_key_service.create(
user_id=uid,
name=name,
ttl=ttl,
issued_at=int(datetime.utcnow().timestamp()),
revoked=False,
)
print("[+] Successfully created a new api key. Generating a JWT...")
jwt = create_token(uid, key.id, key.ttl)
print("[+] Your JWT is: {jwt}".format(jwt=jwt))
@manager.option('-a', '--api-key-id', dest='aid', help='The API Key ID to revoke.')
@manager.option("-a", "--api-key-id", dest="aid", help="The API Key ID to revoke.")
def revoke(aid):
"""
Revokes an api key for a user.

View File

@ -12,14 +12,19 @@ from lemur.database import db
class ApiKey(db.Model):
__tablename__ = 'api_keys'
__tablename__ = "api_keys"
id = Column(Integer, primary_key=True)
name = Column(String)
user_id = Column(Integer, ForeignKey('users.id'))
user_id = Column(Integer, ForeignKey("users.id"))
ttl = Column(BigInteger)
issued_at = Column(BigInteger)
revoked = Column(Boolean)
def __repr__(self):
return "ApiKey(name={name}, user_id={user_id}, ttl={ttl}, issued_at={iat}, revoked={revoked})".format(
user_id=self.user_id, name=self.name, ttl=self.ttl, iat=self.issued_at, revoked=self.revoked)
user_id=self.user_id,
name=self.name,
ttl=self.ttl,
iat=self.issued_at,
revoked=self.revoked,
)

View File

@ -13,12 +13,18 @@ from lemur.users.schemas import UserNestedOutputSchema, UserInputSchema
def current_user_id():
return {'id': g.current_user.id, 'email': g.current_user.email, 'username': g.current_user.username}
return {
"id": g.current_user.id,
"email": g.current_user.email,
"username": g.current_user.username,
}
class ApiKeyInputSchema(LemurInputSchema):
name = fields.String(required=False)
user = fields.Nested(UserInputSchema, missing=current_user_id, default=current_user_id)
user = fields.Nested(
UserInputSchema, missing=current_user_id, default=current_user_id
)
ttl = fields.Integer()

View File

@ -7,6 +7,7 @@
"""
from lemur import database
from lemur.api_keys.models import ApiKey
from lemur.logs import service as log_service
def get(aid):
@ -24,6 +25,7 @@ def delete(access_key):
:param access_key:
:return:
"""
log_service.audit_log("delete_api_key", access_key.name, "Deleting the API key")
database.delete(access_key)
@ -34,8 +36,9 @@ def revoke(aid):
:return:
"""
api_key = get(aid)
setattr(api_key, 'revoked', False)
setattr(api_key, "revoked", True)
log_service.audit_log("revoke_api_key", api_key.name, "Revoking API key")
return database.update(api_key)
@ -55,6 +58,9 @@ def create(**kwargs):
:return:
"""
api_key = ApiKey(**kwargs)
# this logs only metadata about the api key
log_service.audit_log("create_api_key", api_key.name, f"Creating the API key {api_key}")
database.create(api_key)
return api_key
@ -69,6 +75,7 @@ def update(api_key, **kwargs):
for key, value in kwargs.items():
setattr(api_key, key, value)
log_service.audit_log("update_api_key", api_key.name, f"Update summary - {kwargs}")
return database.update(api_key)
@ -80,10 +87,10 @@ def render(args):
:return:
"""
query = database.session_query(ApiKey)
user_id = args.pop('user_id', None)
aid = args.pop('id', None)
has_permission = args.pop('has_permission', False)
requesting_user_id = args.pop('requesting_user_id')
user_id = args.pop("user_id", None)
aid = args.pop("id", None)
has_permission = args.pop("has_permission", False)
requesting_user_id = args.pop("requesting_user_id")
if user_id:
query = query.filter(ApiKey.user_id == user_id)

View File

@ -19,10 +19,16 @@ from lemur.auth.permissions import ApiKeyCreatorPermission
from lemur.common.schema import validate_schema
from lemur.common.utils import paginated_parser
from lemur.api_keys.schemas import api_key_input_schema, api_key_revoke_schema, api_key_output_schema, \
api_keys_output_schema, api_key_described_output_schema, user_api_key_input_schema
from lemur.api_keys.schemas import (
api_key_input_schema,
api_key_revoke_schema,
api_key_output_schema,
api_keys_output_schema,
api_key_described_output_schema,
user_api_key_input_schema,
)
mod = Blueprint('api_keys', __name__)
mod = Blueprint("api_keys", __name__)
api = Api(mod)
@ -81,8 +87,8 @@ class ApiKeyList(AuthenticatedResource):
"""
parser = paginated_parser.copy()
args = parser.parse_args()
args['has_permission'] = ApiKeyCreatorPermission().can()
args['requesting_user_id'] = g.current_user.id
args["has_permission"] = ApiKeyCreatorPermission().can()
args["requesting_user_id"] = g.current_user.id
return service.render(args)
@validate_schema(api_key_input_schema, api_key_output_schema)
@ -99,6 +105,7 @@ class ApiKeyList(AuthenticatedResource):
POST /keys HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
Content-Type: application/json;charset=UTF-8
{
"name": "my custom name",
@ -124,12 +131,26 @@ class ApiKeyList(AuthenticatedResource):
:statuscode 403: unauthenticated
"""
if not ApiKeyCreatorPermission().can():
if data['user']['id'] != g.current_user.id:
return dict(message="You are not authorized to create tokens for: {0}".format(data['user']['username'])), 403
if data["user"]["id"] != g.current_user.id:
return (
dict(
message="You are not authorized to create tokens for: {0}".format(
data["user"]["username"]
)
),
403,
)
access_token = service.create(name=data['name'], user_id=data['user']['id'], ttl=data['ttl'],
revoked=False, issued_at=int(datetime.utcnow().timestamp()))
return dict(jwt=create_token(access_token.user_id, access_token.id, access_token.ttl))
access_token = service.create(
name=data["name"],
user_id=data["user"]["id"],
ttl=data["ttl"],
revoked=False,
issued_at=int(datetime.utcnow().timestamp()),
)
return dict(
jwt=create_token(access_token.user_id, access_token.id, access_token.ttl)
)
class ApiKeyUserList(AuthenticatedResource):
@ -186,9 +207,9 @@ class ApiKeyUserList(AuthenticatedResource):
"""
parser = paginated_parser.copy()
args = parser.parse_args()
args['has_permission'] = ApiKeyCreatorPermission().can()
args['requesting_user_id'] = g.current_user.id
args['user_id'] = user_id
args["has_permission"] = ApiKeyCreatorPermission().can()
args["requesting_user_id"] = g.current_user.id
args["user_id"] = user_id
return service.render(args)
@validate_schema(user_api_key_input_schema, api_key_output_schema)
@ -205,6 +226,7 @@ class ApiKeyUserList(AuthenticatedResource):
POST /users/1/keys HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
Content-Type: application/json;charset=UTF-8
{
"name": "my custom name"
@ -230,11 +252,25 @@ class ApiKeyUserList(AuthenticatedResource):
"""
if not ApiKeyCreatorPermission().can():
if user_id != g.current_user.id:
return dict(message="You are not authorized to create tokens for: {0}".format(user_id)), 403
return (
dict(
message="You are not authorized to create tokens for: {0}".format(
user_id
)
),
403,
)
access_token = service.create(name=data['name'], user_id=user_id, ttl=data['ttl'],
revoked=False, issued_at=int(datetime.utcnow().timestamp()))
return dict(jwt=create_token(access_token.user_id, access_token.id, access_token.ttl))
access_token = service.create(
name=data["name"],
user_id=user_id,
ttl=data["ttl"],
revoked=False,
issued_at=int(datetime.utcnow().timestamp()),
)
return dict(
jwt=create_token(access_token.user_id, access_token.id, access_token.ttl)
)
class ApiKeys(AuthenticatedResource):
@ -298,6 +334,7 @@ class ApiKeys(AuthenticatedResource):
PUT /keys/1 HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
Content-Type: application/json;charset=UTF-8
{
"name": "new_name",
@ -329,7 +366,9 @@ class ApiKeys(AuthenticatedResource):
if not ApiKeyCreatorPermission().can():
return dict(message="You are not authorized to update this token!"), 403
service.update(access_key, name=data['name'], revoked=data['revoked'], ttl=data['ttl'])
service.update(
access_key, name=data["name"], revoked=data["revoked"], ttl=data["ttl"]
)
return dict(jwt=create_token(access_key.user_id, access_key.id, access_key.ttl))
def delete(self, aid):
@ -371,7 +410,7 @@ class ApiKeys(AuthenticatedResource):
return dict(message="You are not authorized to delete this token!"), 403
service.delete(access_key)
return {'result': True}
return {"result": True}
class UserApiKeys(AuthenticatedResource):
@ -438,6 +477,7 @@ class UserApiKeys(AuthenticatedResource):
PUT /users/1/keys/1 HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
Content-Type: application/json;charset=UTF-8
{
"name": "new_name",
@ -472,7 +512,9 @@ class UserApiKeys(AuthenticatedResource):
if access_key.user_id != uid:
return dict(message="You are not authorized to update this token!"), 403
service.update(access_key, name=data['name'], revoked=data['revoked'], ttl=data['ttl'])
service.update(
access_key, name=data["name"], revoked=data["revoked"], ttl=data["ttl"]
)
return dict(jwt=create_token(access_key.user_id, access_key.id, access_key.ttl))
def delete(self, uid, aid):
@ -517,7 +559,7 @@ class UserApiKeys(AuthenticatedResource):
return dict(message="You are not authorized to delete this token!"), 403
service.delete(access_key)
return {'result': True}
return {"result": True}
class ApiKeysDescribed(AuthenticatedResource):
@ -572,8 +614,12 @@ class ApiKeysDescribed(AuthenticatedResource):
return access_key
api.add_resource(ApiKeyList, '/keys', endpoint='api_keys')
api.add_resource(ApiKeys, '/keys/<int:aid>', endpoint='api_key')
api.add_resource(ApiKeysDescribed, '/keys/<int:aid>/described', endpoint='api_key_described')
api.add_resource(ApiKeyUserList, '/users/<int:user_id>/keys', endpoint='user_api_keys')
api.add_resource(UserApiKeys, '/users/<int:uid>/keys/<int:aid>', endpoint='user_api_key')
api.add_resource(ApiKeyList, "/keys", endpoint="api_keys")
api.add_resource(ApiKeys, "/keys/<int:aid>", endpoint="api_key")
api.add_resource(
ApiKeysDescribed, "/keys/<int:aid>/described", endpoint="api_key_described"
)
api.add_resource(ApiKeyUserList, "/users/<int:user_id>/keys", endpoint="user_api_keys")
api.add_resource(
UserApiKeys, "/users/<int:uid>/keys/<int:aid>", endpoint="user_api_key"
)

View File

@ -14,34 +14,41 @@ from lemur.roles import service as role_service
from lemur.common.utils import validate_conf, get_psuedo_random_string
class LdapPrincipal():
class LdapPrincipal:
"""
Provides methods for authenticating against an LDAP server.
"""
def __init__(self, args):
self._ldap_validate_conf()
# setup ldap config
if not args['username']:
if not args["username"]:
raise Exception("missing ldap username")
if not args['password']:
if not args["password"]:
self.error_message = "missing ldap password"
raise Exception("missing ldap password")
self.ldap_principal = args['username']
self.ldap_principal = args["username"]
self.ldap_email_domain = current_app.config.get("LDAP_EMAIL_DOMAIN", None)
if '@' not in self.ldap_principal:
self.ldap_principal = '%s@%s' % (self.ldap_principal, self.ldap_email_domain)
self.ldap_username = args['username']
if '@' in self.ldap_username:
self.ldap_username = args['username'].split("@")[0]
self.ldap_password = args['password']
self.ldap_server = current_app.config.get('LDAP_BIND_URI', None)
if "@" not in self.ldap_principal:
self.ldap_principal = "%s@%s" % (
self.ldap_principal,
self.ldap_email_domain,
)
self.ldap_username = args["username"]
if "@" in self.ldap_username:
self.ldap_username = args["username"].split("@")[0]
self.ldap_password = args["password"]
self.ldap_server = current_app.config.get("LDAP_BIND_URI", None)
self.ldap_base_dn = current_app.config.get("LDAP_BASE_DN", None)
self.ldap_use_tls = current_app.config.get("LDAP_USE_TLS", False)
self.ldap_cacert_file = current_app.config.get("LDAP_CACERT_FILE", None)
self.ldap_default_role = current_app.config.get("LEMUR_DEFAULT_ROLE", None)
self.ldap_required_group = current_app.config.get("LDAP_REQUIRED_GROUP", None)
self.ldap_groups_to_roles = current_app.config.get("LDAP_GROUPS_TO_ROLES", None)
self.ldap_attrs = ['memberOf']
self.ldap_is_active_directory = current_app.config.get(
"LDAP_IS_ACTIVE_DIRECTORY", False
)
self.ldap_attrs = ["memberOf"]
self.ldap_client = None
self.ldap_groups = None
@ -59,8 +66,8 @@ class LdapPrincipal():
get_psuedo_random_string(),
self.ldap_principal,
True,
'', # thumbnailPhotoUrl
list(roles)
"", # thumbnailPhotoUrl
list(roles),
)
else:
# we add 'lemur' specific roles, so they do not get marked as removed
@ -75,7 +82,7 @@ class LdapPrincipal():
self.ldap_principal,
user.active,
user.profile_picture,
list(roles)
list(roles),
)
return user
@ -98,15 +105,18 @@ class LdapPrincipal():
role = role_service.get_by_name(self.ldap_default_role)
if role:
if not role.third_party:
role = role.set_third_party(role.id, third_party_status=True)
role = role_service.set_third_party(role.id, third_party_status=True)
roles.add(role)
# update their 'roles'
role = role_service.get_by_name(self.ldap_principal)
if not role:
description = "auto generated role based on owner: {0}".format(self.ldap_principal)
role = role_service.create(self.ldap_principal, description=description,
third_party=True)
description = "auto generated role based on owner: {0}".format(
self.ldap_principal
)
role = role_service.create(
self.ldap_principal, description=description, third_party=True
)
if not role.third_party:
role = role_service.set_third_party(role.id, third_party_status=True)
roles.add(role)
@ -117,9 +127,15 @@ class LdapPrincipal():
role = role_service.get_by_name(role_name)
if role:
if ldap_group_name in self.ldap_groups:
current_app.logger.debug("assigning role {0} to ldap user {1}".format(self.ldap_principal, role))
current_app.logger.debug(
"assigning role {0} to ldap user {1}".format(
self.ldap_principal, role
)
)
if not role.third_party:
role = role_service.set_third_party(role.id, third_party_status=True)
role = role_service.set_third_party(
role.id, third_party_status=True
)
roles.add(role)
return roles
@ -131,7 +147,7 @@ class LdapPrincipal():
self._bind()
roles = self._authorize()
if not roles:
raise Exception('ldap authorization failed')
raise Exception("ldap authorization failed")
return self._update_user(roles)
def _bind(self):
@ -140,9 +156,12 @@ class LdapPrincipal():
list groups for a user.
raise an exception on error.
"""
if '@' not in self.ldap_principal:
self.ldap_principal = '%s@%s' % (self.ldap_principal, self.ldap_email_domain)
ldap_filter = 'userPrincipalName=%s' % self.ldap_principal
if "@" not in self.ldap_principal:
self.ldap_principal = "%s@%s" % (
self.ldap_principal,
self.ldap_email_domain,
)
ldap_filter = "userPrincipalName=%s" % self.ldap_principal
# query ldap for auth
try:
@ -158,30 +177,54 @@ class LdapPrincipal():
self.ldap_client.set_option(ldap.OPT_X_TLS_DEMAND, True)
self.ldap_client.set_option(ldap.OPT_DEBUG_LEVEL, 255)
if self.ldap_cacert_file:
self.ldap_client.set_option(ldap.OPT_X_TLS_CACERTFILE, self.ldap_cacert_file)
self.ldap_client.set_option(
ldap.OPT_X_TLS_CACERTFILE, self.ldap_cacert_file
)
self.ldap_client.simple_bind_s(self.ldap_principal, self.ldap_password)
except ldap.INVALID_CREDENTIALS:
self.ldap_client.unbind()
raise Exception('The supplied ldap credentials are invalid')
raise Exception("The supplied ldap credentials are invalid")
except ldap.SERVER_DOWN:
raise Exception('ldap server unavailable')
raise Exception("ldap server unavailable")
except ldap.LDAPError as e:
raise Exception("ldap error: {0}".format(e))
lgroups = self.ldap_client.search_s(self.ldap_base_dn,
ldap.SCOPE_SUBTREE, ldap_filter, self.ldap_attrs)[0][1]['memberOf']
if self.ldap_is_active_directory:
# Lookup user DN, needed to search for group membership
userdn = self.ldap_client.search_s(
self.ldap_base_dn,
ldap.SCOPE_SUBTREE,
ldap_filter,
["distinguishedName"],
)[0][1]["distinguishedName"][0]
userdn = userdn.decode("utf-8")
# Search all groups that have the userDN as a member
groupfilter = "(&(objectclass=group)(member:1.2.840.113556.1.4.1941:={0}))".format(
userdn
)
lgroups = self.ldap_client.search_s(
self.ldap_base_dn, ldap.SCOPE_SUBTREE, groupfilter, ["cn"]
)
# Create a list of group CN's from the result
self.ldap_groups = []
for group in lgroups:
(dn, values) = group
if type(values) == dict:
self.ldap_groups.append(values["cn"][0].decode("utf-8"))
else:
lgroups = self.ldap_client.search_s(
self.ldap_base_dn, ldap.SCOPE_SUBTREE, ldap_filter, self.ldap_attrs
)[0][1]["memberOf"]
# lgroups is a list of utf-8 encoded strings
# convert to a single string of groups to allow matching
self.ldap_groups = b''.join(lgroups).decode('ascii')
self.ldap_groups = b"".join(lgroups).decode("ascii")
self.ldap_client.unbind()
def _ldap_validate_conf(self):
"""
Confirms required ldap config settings exist.
"""
required_vars = [
'LDAP_BIND_URI',
'LDAP_BASE_DN',
'LDAP_EMAIL_DOMAIN',
]
required_vars = ["LDAP_BIND_URI", "LDAP_BASE_DN", "LDAP_EMAIL_DOMAIN"]
validate_conf(current_app, required_vars)

View File

@ -9,55 +9,66 @@
from functools import partial
from collections import namedtuple
from flask import current_app
from flask_principal import Permission, RoleNeed
# Permissions
operator_permission = Permission(RoleNeed('operator'))
admin_permission = Permission(RoleNeed('admin'))
operator_permission = Permission(RoleNeed("operator"))
admin_permission = Permission(RoleNeed("admin"))
CertificateOwner = namedtuple('certificate', ['method', 'value'])
CertificateOwnerNeed = partial(CertificateOwner, 'role')
CertificateOwner = namedtuple("certificate", ["method", "value"])
CertificateOwnerNeed = partial(CertificateOwner, "role")
class SensitiveDomainPermission(Permission):
def __init__(self):
super(SensitiveDomainPermission, self).__init__(RoleNeed('admin'))
needs = [RoleNeed("admin")]
sensitive_domain_roles = current_app.config.get("SENSITIVE_DOMAIN_ROLES", [])
if sensitive_domain_roles:
for role in sensitive_domain_roles:
needs.append(RoleNeed(role))
super(SensitiveDomainPermission, self).__init__(*needs)
class CertificatePermission(Permission):
def __init__(self, owner, roles):
needs = [RoleNeed('admin'), RoleNeed(owner), RoleNeed('creator')]
needs = [RoleNeed("admin"), RoleNeed(owner), RoleNeed("creator")]
for r in roles:
needs.append(CertificateOwnerNeed(str(r)))
# Backwards compatibility with mixed-case role names
if str(r) != str(r).lower():
needs.append(CertificateOwnerNeed(str(r).lower()))
super(CertificatePermission, self).__init__(*needs)
class ApiKeyCreatorPermission(Permission):
def __init__(self):
super(ApiKeyCreatorPermission, self).__init__(RoleNeed('admin'))
super(ApiKeyCreatorPermission, self).__init__(RoleNeed("admin"))
RoleMember = namedtuple('role', ['method', 'value'])
RoleMemberNeed = partial(RoleMember, 'member')
RoleMember = namedtuple("role", ["method", "value"])
RoleMemberNeed = partial(RoleMember, "member")
class RoleMemberPermission(Permission):
def __init__(self, role_id):
needs = [RoleNeed('admin'), RoleMemberNeed(role_id)]
needs = [RoleNeed("admin"), RoleMemberNeed(role_id)]
super(RoleMemberPermission, self).__init__(*needs)
AuthorityCreator = namedtuple('authority', ['method', 'value'])
AuthorityCreatorNeed = partial(AuthorityCreator, 'authorityUse')
AuthorityCreator = namedtuple("authority", ["method", "value"])
AuthorityCreatorNeed = partial(AuthorityCreator, "authorityUse")
AuthorityOwner = namedtuple('authority', ['method', 'value'])
AuthorityOwnerNeed = partial(AuthorityOwner, 'role')
AuthorityOwner = namedtuple("authority", ["method", "value"])
AuthorityOwnerNeed = partial(AuthorityOwner, "role")
class AuthorityPermission(Permission):
def __init__(self, authority_id, roles):
needs = [RoleNeed('admin'), AuthorityCreatorNeed(str(authority_id))]
needs = [RoleNeed("admin"), AuthorityCreatorNeed(str(authority_id))]
for r in roles:
needs.append(AuthorityOwnerNeed(str(r)))

View File

@ -39,13 +39,13 @@ def get_rsa_public_key(n, e):
:param e:
:return: a RSA Public Key in PEM format
"""
n = int(binascii.hexlify(jwt.utils.base64url_decode(bytes(n, 'utf-8'))), 16)
e = int(binascii.hexlify(jwt.utils.base64url_decode(bytes(e, 'utf-8'))), 16)
n = int(binascii.hexlify(jwt.utils.base64url_decode(bytes(n, "utf-8"))), 16)
e = int(binascii.hexlify(jwt.utils.base64url_decode(bytes(e, "utf-8"))), 16)
pub = RSAPublicNumbers(e, n).public_key(default_backend())
return pub.public_bytes(
encoding=serialization.Encoding.PEM,
format=serialization.PublicFormat.SubjectPublicKeyInfo
format=serialization.PublicFormat.SubjectPublicKeyInfo,
)
@ -57,28 +57,27 @@ def create_token(user, aid=None, ttl=None):
:param user:
:return:
"""
expiration_delta = timedelta(days=int(current_app.config.get('LEMUR_TOKEN_EXPIRATION', 1)))
payload = {
'iat': datetime.utcnow(),
'exp': datetime.utcnow() + expiration_delta
}
expiration_delta = timedelta(
days=int(current_app.config.get("LEMUR_TOKEN_EXPIRATION", 1))
)
payload = {"iat": datetime.utcnow(), "exp": datetime.utcnow() + expiration_delta}
# Handle Just a User ID & User Object.
if isinstance(user, int):
payload['sub'] = user
payload["sub"] = user
else:
payload['sub'] = user.id
payload["sub"] = user.id
if aid is not None:
payload['aid'] = aid
payload["aid"] = aid
# Custom TTLs are only supported on Access Keys.
if ttl is not None and aid is not None:
# Tokens that are forever until revoked.
if ttl == -1:
del payload['exp']
del payload["exp"]
else:
payload['exp'] = ttl
token = jwt.encode(payload, current_app.config['LEMUR_TOKEN_SECRET'])
return token.decode('unicode_escape')
payload["exp"] = datetime.utcnow() + timedelta(days=ttl)
token = jwt.encode(payload, current_app.config["LEMUR_TOKEN_SECRET"])
return token
def login_required(f):
@ -88,49 +87,54 @@ def login_required(f):
:param f:
:return:
"""
@wraps(f)
def decorated_function(*args, **kwargs):
if not request.headers.get('Authorization'):
response = jsonify(message='Missing authorization header')
if not request.headers.get("Authorization"):
response = jsonify(message="Missing authorization header")
response.status_code = 401
return response
try:
token = request.headers.get('Authorization').split()[1]
token = request.headers.get("Authorization").split()[1]
except Exception as e:
return dict(message='Token is invalid'), 403
return dict(message="Token is invalid"), 403
try:
payload = jwt.decode(token, current_app.config['LEMUR_TOKEN_SECRET'])
header_data = fetch_token_header(token)
payload = jwt.decode(token, current_app.config["LEMUR_TOKEN_SECRET"], algorithms=[header_data["alg"]])
except jwt.DecodeError:
return dict(message='Token is invalid'), 403
return dict(message="Token is invalid"), 403
except jwt.ExpiredSignatureError:
return dict(message='Token has expired'), 403
return dict(message="Token has expired"), 403
except jwt.InvalidTokenError:
return dict(message='Token is invalid'), 403
return dict(message="Token is invalid"), 403
if 'aid' in payload:
access_key = api_key_service.get(payload['aid'])
if "aid" in payload:
access_key = api_key_service.get(payload["aid"])
if access_key.revoked:
return dict(message='Token has been revoked'), 403
return dict(message="Token has been revoked"), 403
if access_key.ttl != -1:
current_time = datetime.utcnow()
expired_time = datetime.fromtimestamp(access_key.issued_at + access_key.ttl)
# API key uses days
expired_time = datetime.fromtimestamp(access_key.issued_at) + timedelta(days=access_key.ttl)
if current_time >= expired_time:
return dict(message='Token has expired'), 403
return dict(message="Token has expired"), 403
user = user_service.get(payload['sub'])
user = user_service.get(payload["sub"])
if not user.active:
return dict(message='User is not currently active'), 403
return dict(message="User is not currently active"), 403
g.current_user = user
if not g.current_user:
return dict(message='You are not logged in'), 403
return dict(message="You are not logged in"), 403
# Tell Flask-Principal the identity changed
identity_changed.send(current_app._get_current_object(), identity=Identity(g.current_user.id))
identity_changed.send(
current_app._get_current_object(), identity=Identity(g.current_user.id)
)
return f(*args, **kwargs)
@ -144,18 +148,18 @@ def fetch_token_header(token):
:param token:
:return: :raise jwt.DecodeError:
"""
token = token.encode('utf-8')
token = token.encode("utf-8")
try:
signing_input, crypto_segment = token.rsplit(b'.', 1)
header_segment, payload_segment = signing_input.split(b'.', 1)
signing_input, crypto_segment = token.rsplit(b".", 1)
header_segment, payload_segment = signing_input.split(b".", 1)
except ValueError:
raise jwt.DecodeError('Not enough segments')
raise jwt.DecodeError("Not enough segments")
try:
return json.loads(jwt.utils.base64url_decode(header_segment).decode('utf-8'))
return json.loads(jwt.utils.base64url_decode(header_segment).decode("utf-8"))
except TypeError as e:
current_app.logger.exception(e)
raise jwt.DecodeError('Invalid header padding')
raise jwt.DecodeError("Invalid header padding")
@identity_loaded.connect
@ -174,13 +178,13 @@ def on_identity_loaded(sender, identity):
identity.provides.add(UserNeed(identity.id))
# identity with the roles that the user provides
if hasattr(user, 'roles'):
if hasattr(user, "roles"):
for role in user.roles:
identity.provides.add(RoleNeed(role.name))
identity.provides.add(RoleMemberNeed(role.id))
# apply ownership for authorities
if hasattr(user, 'authorities'):
if hasattr(user, "authorities"):
for authority in user.authorities:
identity.provides.add(AuthorityCreatorNeed(authority.id))
@ -191,6 +195,7 @@ class AuthenticatedResource(Resource):
"""
Inherited by all resources that need to be protected by authentication.
"""
method_decorators = [login_required]
def __init__(self):

View File

@ -5,6 +5,8 @@
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
"""
import json
import jwt
import base64
import requests
@ -20,15 +22,18 @@ from lemur.common.utils import get_psuedo_random_string
from lemur.users import service as user_service
from lemur.roles import service as role_service
from lemur.logs import service as log_service
from lemur.auth.service import create_token, fetch_token_header, get_rsa_public_key
import lemur.auth.ldap as ldap
from lemur.auth import ldap
from lemur.plugins.base import plugins
mod = Blueprint('auth', __name__)
mod = Blueprint("auth", __name__)
api = Api(mod)
def exchange_for_access_token(code, redirect_uri, client_id, secret, access_token_url=None, verify_cert=True):
def exchange_for_access_token(
code, redirect_uri, client_id, secret, access_token_url=None, verify_cert=True
):
"""
Exchanges authorization code for access token.
@ -43,28 +48,32 @@ def exchange_for_access_token(code, redirect_uri, client_id, secret, access_toke
"""
# take the information we have received from the provider to create a new request
params = {
'grant_type': 'authorization_code',
'scope': 'openid email profile address',
'code': code,
'redirect_uri': redirect_uri,
'client_id': client_id
"grant_type": "authorization_code",
"scope": "openid email profile address",
"code": code,
"redirect_uri": redirect_uri,
"client_id": client_id,
}
# the secret and cliendId will be given to you when you signup for the provider
token = '{0}:{1}'.format(client_id, secret)
token = "{0}:{1}".format(client_id, secret)
basic = base64.b64encode(bytes(token, 'utf-8'))
basic = base64.b64encode(bytes(token, "utf-8"))
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'authorization': 'basic {0}'.format(basic.decode('utf-8'))
"Content-Type": "application/x-www-form-urlencoded",
"authorization": "basic {0}".format(basic.decode("utf-8")),
}
# exchange authorization code for access token.
r = requests.post(access_token_url, headers=headers, params=params, verify=verify_cert)
r = requests.post(
access_token_url, headers=headers, params=params, verify=verify_cert
)
if r.status_code == 400:
r = requests.post(access_token_url, headers=headers, data=params, verify=verify_cert)
id_token = r.json()['id_token']
access_token = r.json()['access_token']
r = requests.post(
access_token_url, headers=headers, data=params, verify=verify_cert
)
id_token = r.json()["id_token"]
access_token = r.json()["access_token"]
return id_token, access_token
@ -83,23 +92,25 @@ def validate_id_token(id_token, client_id, jwks_url):
# retrieve the key material as specified by the token header
r = requests.get(jwks_url)
for key in r.json()['keys']:
if key['kid'] == header_data['kid']:
secret = get_rsa_public_key(key['n'], key['e'])
algo = header_data['alg']
for key in r.json()["keys"]:
if key["kid"] == header_data["kid"]:
secret = get_rsa_public_key(key["n"], key["e"])
algo = header_data["alg"]
break
else:
return dict(message='Key not found'), 401
return dict(message="Key not found"), 401
# validate your token based on the key it was signed with
try:
jwt.decode(id_token, secret.decode('utf-8'), algorithms=[algo], audience=client_id)
jwt.decode(
id_token, secret.decode("utf-8"), algorithms=[algo], audience=client_id
)
except jwt.DecodeError:
return dict(message='Token is invalid'), 401
return dict(message="Token is invalid"), 401
except jwt.ExpiredSignatureError:
return dict(message='Token has expired'), 401
return dict(message="Token has expired"), 401
except jwt.InvalidTokenError:
return dict(message='Token is invalid'), 401
return dict(message="Token is invalid"), 401
def retrieve_user(user_api_url, access_token):
@ -110,16 +121,66 @@ def retrieve_user(user_api_url, access_token):
:param access_token:
:return:
"""
user_params = dict(access_token=access_token, schema='profile')
user_params = dict(access_token=access_token, schema="profile")
headers = {}
if current_app.config.get("PING_INCLUDE_BEARER_TOKEN"):
headers = {"Authorization": f"Bearer {access_token}"}
# retrieve information about the current user.
r = requests.get(user_api_url, params=user_params)
r = requests.get(user_api_url, params=user_params, headers=headers)
# Some IDPs, like "Keycloak", require a POST instead of a GET
if r.status_code == 400:
r = requests.post(user_api_url, data=user_params, headers=headers)
profile = r.json()
user = user_service.get_by_email(profile['email'])
user = user_service.get_by_email(profile["email"])
return user, profile
def retrieve_user_memberships(user_api_url, user_membership_api_url, access_token):
user, profile = retrieve_user(user_api_url, access_token)
if user_membership_api_url is None:
return user, profile
"""
Potentially, below code can be made more generic i.e., plugin driven. Unaware of the usage of this
code across the community, current implementation is config driven. Without user_membership_api_url
configured, it is backward compatible.
"""
tls_provider = plugins.get(current_app.config.get("PING_USER_MEMBERSHIP_TLS_PROVIDER"))
# put user id in url
user_membership_api_url = user_membership_api_url.replace("%user_id%", profile["userId"])
session = tls_provider.session(current_app.config.get("PING_USER_MEMBERSHIP_SERVICE"))
headers = {"Content-Type": "application/json"}
data = {"relation": "DIRECT_ONLY", "groupFilter": {"type": "GOOGLE"}, "size": 500}
user_membership = {"email": profile["email"],
"thumbnailPhotoUrl": profile["thumbnailPhotoUrl"],
"googleGroups": []}
while True:
# retrieve information about the current user memberships
r = session.post(user_membership_api_url, data=json.dumps(data), headers=headers)
if r.status_code == 200:
response = r.json()
membership_details = response["data"]
for membership in membership_details:
user_membership["googleGroups"].append(membership["membership"]["name"])
if "nextPageToken" in response and response["nextPageToken"]:
data["nextPageToken"] = response["nextPageToken"]
else:
break
else:
current_app.logger.error(f"Response Code:{r.status_code} {r.text}")
break
return user, user_membership
def create_user_roles(profile):
"""Creates new roles based on profile information.
@ -129,28 +190,44 @@ def create_user_roles(profile):
roles = []
# update their google 'roles'
for group in profile['googleGroups']:
if "googleGroups" in profile:
for group in profile["googleGroups"]:
role = role_service.get_by_name(group)
if not role:
role = role_service.create(group, description='This is a google group based role created by Lemur', third_party=True)
if not role.third_party:
role = role_service.create(
group,
description="This is a google group based role created by Lemur",
third_party=True,
)
if (group != 'admin') and (not role.third_party):
role = role_service.set_third_party(role.id, third_party_status=True)
roles.append(role)
else:
current_app.logger.warning(
"'googleGroups' not sent by identity provider, no specific roles will assigned to the user."
)
role = role_service.get_by_name(profile['email'])
role = role_service.get_by_name(profile["email"])
if not role:
role = role_service.create(profile['email'], description='This is a user specific role', third_party=True)
role = role_service.create(
profile["email"],
description="This is a user specific role",
third_party=True,
)
if not role.third_party:
role = role_service.set_third_party(role.id, third_party_status=True)
roles.append(role)
# every user is an operator (tied to a default role)
if current_app.config.get('LEMUR_DEFAULT_ROLE'):
default = role_service.get_by_name(current_app.config['LEMUR_DEFAULT_ROLE'])
if current_app.config.get("LEMUR_DEFAULT_ROLE"):
default = role_service.get_by_name(current_app.config["LEMUR_DEFAULT_ROLE"])
if not default:
default = role_service.create(current_app.config['LEMUR_DEFAULT_ROLE'], description='This is the default Lemur role.')
default = role_service.create(
current_app.config["LEMUR_DEFAULT_ROLE"],
description="This is the default Lemur role.",
)
if not default.third_party:
role_service.set_third_party(default.id, third_party_status=True)
roles.append(default)
@ -165,32 +242,37 @@ def update_user(user, profile, roles):
:param profile:
:param roles:
"""
# if we get an sso user create them an account
if not user:
user = user_service.create(
profile['email'],
profile["email"],
get_psuedo_random_string(),
profile['email'],
profile["email"],
True,
profile.get('thumbnailPhotoUrl'),
roles
profile.get("thumbnailPhotoUrl"),
roles,
)
else:
# we add 'lemur' specific roles, so they do not get marked as removed
removed_roles = []
for ur in user.roles:
if not ur.third_party:
roles.append(ur)
elif ur not in roles:
# This is a role assigned in lemur, but not returned by sso during current login
removed_roles.append(ur.name)
if removed_roles:
log_service.audit_log("unassign_role", user.username, f"Un-assigning roles {removed_roles}")
# update any changes to the user
user_service.update(
user.id,
profile['email'],
profile['email'],
profile["email"],
profile["email"],
True,
profile.get('thumbnailPhotoUrl'), # profile isn't google+ enabled
roles
profile.get("thumbnailPhotoUrl"), # profile isn't google+ enabled
roles,
)
@ -211,6 +293,7 @@ class Login(Resource):
on your uses cases but. It is important to not that there is currently no build in method to revoke a users token \
and force re-authentication.
"""
def __init__(self):
self.reqparse = reqparse.RequestParser()
super(Login, self).__init__()
@ -228,6 +311,7 @@ class Login(Resource):
POST /auth/login HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
Content-Type: application/json;charset=UTF-8
{
"username": "test",
@ -251,23 +335,26 @@ class Login(Resource):
:statuscode 401: invalid credentials
:statuscode 200: no error
"""
self.reqparse.add_argument('username', type=str, required=True, location='json')
self.reqparse.add_argument('password', type=str, required=True, location='json')
self.reqparse.add_argument("username", type=str, required=True, location="json")
self.reqparse.add_argument("password", type=str, required=True, location="json")
args = self.reqparse.parse_args()
if '@' in args['username']:
user = user_service.get_by_email(args['username'])
if "@" in args["username"]:
user = user_service.get_by_email(args["username"])
else:
user = user_service.get_by_username(args['username'])
user = user_service.get_by_username(args["username"])
# default to local authentication
if user and user.check_password(args['password']) and user.active:
if user and user.check_password(args["password"]) and user.active:
# Tell Flask-Principal the identity changed
identity_changed.send(current_app._get_current_object(),
identity=Identity(user.id))
identity_changed.send(
current_app._get_current_object(), identity=Identity(user.id)
)
metrics.send('login', 'counter', 1, metric_tags={'status': SUCCESS_METRIC_STATUS})
metrics.send(
"login", "counter", 1, metric_tags={"status": SUCCESS_METRIC_STATUS}
)
return dict(token=create_token(user))
# try ldap login
@ -277,19 +364,29 @@ class Login(Resource):
user = ldap_principal.authenticate()
if user and user.active:
# Tell Flask-Principal the identity changed
identity_changed.send(current_app._get_current_object(),
identity=Identity(user.id))
metrics.send('login', 'counter', 1, metric_tags={'status': SUCCESS_METRIC_STATUS})
identity_changed.send(
current_app._get_current_object(), identity=Identity(user.id)
)
metrics.send(
"login",
"counter",
1,
metric_tags={"status": SUCCESS_METRIC_STATUS},
)
return dict(token=create_token(user))
except Exception as e:
current_app.logger.error("ldap error: {0}".format(e))
ldap_message = 'ldap error: %s' % e
metrics.send('login', 'counter', 1, metric_tags={'status': FAILURE_METRIC_STATUS})
ldap_message = "ldap error: %s" % e
metrics.send(
"login", "counter", 1, metric_tags={"status": FAILURE_METRIC_STATUS}
)
return dict(message=ldap_message), 403
# if not valid user - no certificates for you
metrics.send('login', 'counter', 1, metric_tags={'status': FAILURE_METRIC_STATUS})
return dict(message='The supplied credentials are invalid'), 403
metrics.send(
"login", "counter", 1, metric_tags={"status": FAILURE_METRIC_STATUS}
)
return dict(message="The supplied credentials are invalid"), 403
class Ping(Resource):
@ -302,49 +399,63 @@ class Ping(Resource):
provider uses for its callbacks.
2. Add or change the Lemur AngularJS Configuration to point to your new provider
"""
def __init__(self):
self.reqparse = reqparse.RequestParser()
super(Ping, self).__init__()
def get(self):
return 'Redirecting...'
return "Redirecting..."
def post(self):
self.reqparse.add_argument('clientId', type=str, required=True, location='json')
self.reqparse.add_argument('redirectUri', type=str, required=True, location='json')
self.reqparse.add_argument('code', type=str, required=True, location='json')
self.reqparse.add_argument("clientId", type=str, required=True, location="json")
self.reqparse.add_argument(
"redirectUri", type=str, required=True, location="json"
)
self.reqparse.add_argument("code", type=str, required=True, location="json")
args = self.reqparse.parse_args()
# you can either discover these dynamically or simply configure them
access_token_url = current_app.config.get('PING_ACCESS_TOKEN_URL')
user_api_url = current_app.config.get('PING_USER_API_URL')
access_token_url = current_app.config.get("PING_ACCESS_TOKEN_URL")
secret = current_app.config.get('PING_SECRET')
secret = current_app.config.get("PING_SECRET")
id_token, access_token = exchange_for_access_token(
args['code'],
args['redirectUri'],
args['clientId'],
args["code"],
args["redirectUri"],
args["clientId"],
secret,
access_token_url=access_token_url
access_token_url=access_token_url,
)
jwks_url = current_app.config.get('PING_JWKS_URL')
validate_id_token(id_token, args['clientId'], jwks_url)
jwks_url = current_app.config.get("PING_JWKS_URL")
error_code = validate_id_token(id_token, args["clientId"], jwks_url)
if error_code:
return error_code
user, profile = retrieve_user(user_api_url, access_token)
user, profile = retrieve_user_memberships(
current_app.config.get("PING_USER_API_URL"),
current_app.config.get("PING_USER_MEMBERSHIP_URL"),
access_token
)
roles = create_user_roles(profile)
update_user(user, profile, roles)
if not user or not user.active:
metrics.send('login', 'counter', 1, metric_tags={'status': FAILURE_METRIC_STATUS})
return dict(message='The supplied credentials are invalid'), 403
metrics.send(
"login", "counter", 1, metric_tags={"status": FAILURE_METRIC_STATUS}
)
return dict(message="The supplied credentials are invalid"), 403
# Tell Flask-Principal the identity changed
identity_changed.send(current_app._get_current_object(), identity=Identity(user.id))
identity_changed.send(
current_app._get_current_object(), identity=Identity(user.id)
)
metrics.send('login', 'counter', 1, metric_tags={'status': SUCCESS_METRIC_STATUS})
metrics.send(
"login", "counter", 1, metric_tags={"status": SUCCESS_METRIC_STATUS}
)
return dict(token=create_token(user))
@ -354,46 +465,56 @@ class OAuth2(Resource):
super(OAuth2, self).__init__()
def get(self):
return 'Redirecting...'
return "Redirecting..."
def post(self):
self.reqparse.add_argument('clientId', type=str, required=True, location='json')
self.reqparse.add_argument('redirectUri', type=str, required=True, location='json')
self.reqparse.add_argument('code', type=str, required=True, location='json')
self.reqparse.add_argument("clientId", type=str, required=True, location="json")
self.reqparse.add_argument(
"redirectUri", type=str, required=True, location="json"
)
self.reqparse.add_argument("code", type=str, required=True, location="json")
args = self.reqparse.parse_args()
# you can either discover these dynamically or simply configure them
access_token_url = current_app.config.get('OAUTH2_ACCESS_TOKEN_URL')
user_api_url = current_app.config.get('OAUTH2_USER_API_URL')
verify_cert = current_app.config.get('OAUTH2_VERIFY_CERT')
access_token_url = current_app.config.get("OAUTH2_ACCESS_TOKEN_URL")
user_api_url = current_app.config.get("OAUTH2_USER_API_URL")
verify_cert = current_app.config.get("OAUTH2_VERIFY_CERT")
secret = current_app.config.get('OAUTH2_SECRET')
secret = current_app.config.get("OAUTH2_SECRET")
id_token, access_token = exchange_for_access_token(
args['code'],
args['redirectUri'],
args['clientId'],
args["code"],
args["redirectUri"],
args["clientId"],
secret,
access_token_url=access_token_url,
verify_cert=verify_cert
verify_cert=verify_cert,
)
jwks_url = current_app.config.get('PING_JWKS_URL')
validate_id_token(id_token, args['clientId'], jwks_url)
jwks_url = current_app.config.get("OAUTH2_JWKS_URL")
error_code = validate_id_token(id_token, args["clientId"], jwks_url)
if error_code:
return error_code
user, profile = retrieve_user(user_api_url, access_token)
roles = create_user_roles(profile)
update_user(user, profile, roles)
if not user.active:
metrics.send('login', 'counter', 1, metric_tags={'status': FAILURE_METRIC_STATUS})
return dict(message='The supplied credentials are invalid'), 403
metrics.send(
"login", "counter", 1, metric_tags={"status": FAILURE_METRIC_STATUS}
)
return dict(message="The supplied credentials are invalid"), 403
# Tell Flask-Principal the identity changed
identity_changed.send(current_app._get_current_object(), identity=Identity(user.id))
identity_changed.send(
current_app._get_current_object(), identity=Identity(user.id)
)
metrics.send('login', 'counter', 1, metric_tags={'status': SUCCESS_METRIC_STATUS})
metrics.send(
"login", "counter", 1, metric_tags={"status": SUCCESS_METRIC_STATUS}
)
return dict(token=create_token(user))
@ -404,44 +525,52 @@ class Google(Resource):
super(Google, self).__init__()
def post(self):
access_token_url = 'https://accounts.google.com/o/oauth2/token'
people_api_url = 'https://www.googleapis.com/plus/v1/people/me/openIdConnect'
access_token_url = "https://accounts.google.com/o/oauth2/token"
people_api_url = "https://www.googleapis.com/plus/v1/people/me/openIdConnect"
self.reqparse.add_argument('clientId', type=str, required=True, location='json')
self.reqparse.add_argument('redirectUri', type=str, required=True, location='json')
self.reqparse.add_argument('code', type=str, required=True, location='json')
self.reqparse.add_argument("clientId", type=str, required=True, location="json")
self.reqparse.add_argument(
"redirectUri", type=str, required=True, location="json"
)
self.reqparse.add_argument("code", type=str, required=True, location="json")
args = self.reqparse.parse_args()
# Step 1. Exchange authorization code for access token
payload = {
'client_id': args['clientId'],
'grant_type': 'authorization_code',
'redirect_uri': args['redirectUri'],
'code': args['code'],
'client_secret': current_app.config.get('GOOGLE_SECRET')
"client_id": args["clientId"],
"grant_type": "authorization_code",
"redirect_uri": args["redirectUri"],
"code": args["code"],
"client_secret": current_app.config.get("GOOGLE_SECRET"),
}
r = requests.post(access_token_url, data=payload)
token = r.json()
# Step 2. Retrieve information about the current user
headers = {'Authorization': 'Bearer {0}'.format(token['access_token'])}
headers = {"Authorization": "Bearer {0}".format(token["access_token"])}
r = requests.get(people_api_url, headers=headers)
profile = r.json()
user = user_service.get_by_email(profile['email'])
user = user_service.get_by_email(profile["email"])
if not (user and user.active):
metrics.send('login', 'counter', 1, metric_tags={'status': FAILURE_METRIC_STATUS})
return dict(message='The supplied credentials are invalid.'), 403
metrics.send(
"login", "counter", 1, metric_tags={"status": FAILURE_METRIC_STATUS}
)
return dict(message="The supplied credentials are invalid."), 403
if user:
metrics.send('login', 'counter', 1, metric_tags={'status': SUCCESS_METRIC_STATUS})
metrics.send(
"login", "counter", 1, metric_tags={"status": SUCCESS_METRIC_STATUS}
)
return dict(token=create_token(user))
metrics.send('login', 'counter', 1, metric_tags={'status': FAILURE_METRIC_STATUS})
metrics.send(
"login", "counter", 1, metric_tags={"status": FAILURE_METRIC_STATUS}
)
class Providers(Resource):
@ -452,47 +581,57 @@ class Providers(Resource):
provider = provider.lower()
if provider == "google":
active_providers.append({
'name': 'google',
'clientId': current_app.config.get("GOOGLE_CLIENT_ID"),
'url': api.url_for(Google)
})
active_providers.append(
{
"name": "google",
"clientId": current_app.config.get("GOOGLE_CLIENT_ID"),
"url": api.url_for(Google),
}
)
elif provider == "ping":
active_providers.append({
'name': current_app.config.get("PING_NAME"),
'url': current_app.config.get('PING_REDIRECT_URI'),
'redirectUri': current_app.config.get("PING_REDIRECT_URI"),
'clientId': current_app.config.get("PING_CLIENT_ID"),
'responseType': 'code',
'scope': ['openid', 'email', 'profile', 'address'],
'scopeDelimiter': ' ',
'authorizationEndpoint': current_app.config.get("PING_AUTH_ENDPOINT"),
'requiredUrlParams': ['scope'],
'type': '2.0'
})
active_providers.append(
{
"name": current_app.config.get("PING_NAME"),
"url": current_app.config.get("PING_REDIRECT_URI"),
"redirectUri": current_app.config.get("PING_REDIRECT_URI"),
"clientId": current_app.config.get("PING_CLIENT_ID"),
"responseType": "code",
"scope": ["openid", "email", "profile", "address"],
"scopeDelimiter": " ",
"authorizationEndpoint": current_app.config.get(
"PING_AUTH_ENDPOINT"
),
"requiredUrlParams": ["scope"],
"type": "2.0",
}
)
elif provider == "oauth2":
active_providers.append({
'name': current_app.config.get("OAUTH2_NAME"),
'url': current_app.config.get('OAUTH2_REDIRECT_URI'),
'redirectUri': current_app.config.get("OAUTH2_REDIRECT_URI"),
'clientId': current_app.config.get("OAUTH2_CLIENT_ID"),
'responseType': 'code',
'scope': ['openid', 'email', 'profile', 'groups'],
'scopeDelimiter': ' ',
'authorizationEndpoint': current_app.config.get("OAUTH2_AUTH_ENDPOINT"),
'requiredUrlParams': ['scope', 'state', 'nonce'],
'state': 'STATE',
'nonce': get_psuedo_random_string(),
'type': '2.0'
})
active_providers.append(
{
"name": current_app.config.get("OAUTH2_NAME"),
"url": current_app.config.get("OAUTH2_REDIRECT_URI"),
"redirectUri": current_app.config.get("OAUTH2_REDIRECT_URI"),
"clientId": current_app.config.get("OAUTH2_CLIENT_ID"),
"responseType": "code",
"scope": ["openid", "email", "profile", "groups"],
"scopeDelimiter": " ",
"authorizationEndpoint": current_app.config.get(
"OAUTH2_AUTH_ENDPOINT"
),
"requiredUrlParams": ["scope", "state", "nonce"],
"state": "STATE",
"nonce": get_psuedo_random_string(),
"type": "2.0",
}
)
return active_providers
api.add_resource(Login, '/auth/login', endpoint='login')
api.add_resource(Ping, '/auth/ping', endpoint='ping')
api.add_resource(Google, '/auth/google', endpoint='google')
api.add_resource(OAuth2, '/auth/oauth2', endpoint='oauth2')
api.add_resource(Providers, '/auth/providers', endpoint='providers')
api.add_resource(Login, "/auth/login", endpoint="login")
api.add_resource(Ping, "/auth/ping", endpoint="ping")
api.add_resource(Google, "/auth/google", endpoint="google")
api.add_resource(OAuth2, "/auth/oauth2", endpoint="oauth2")
api.add_resource(Providers, "/auth/providers", endpoint="providers")

View File

@ -6,8 +6,21 @@
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
"""
import json
from flask import current_app
from sqlalchemy.orm import relationship
from sqlalchemy import Column, Integer, String, Text, func, ForeignKey, DateTime, PassiveDefault, Boolean
from sqlalchemy import (
Column,
Integer,
String,
Text,
func,
ForeignKey,
DateTime,
DefaultClause,
Boolean,
)
from sqlalchemy.dialects.postgresql import JSON
from lemur.database import db
@ -16,7 +29,7 @@ from lemur.models import roles_authorities
class Authority(db.Model):
__tablename__ = 'authorities'
__tablename__ = "authorities"
id = Column(Integer, primary_key=True)
owner = Column(String(128), nullable=False)
name = Column(String(128), unique=True)
@ -26,27 +39,79 @@ class Authority(db.Model):
plugin_name = Column(String(64))
description = Column(Text)
options = Column(JSON)
date_created = Column(DateTime, PassiveDefault(func.now()), nullable=False)
roles = relationship('Role', secondary=roles_authorities, passive_deletes=True, backref=db.backref('authority'), lazy='dynamic')
user_id = Column(Integer, ForeignKey('users.id'))
authority_certificate = relationship("Certificate", backref='root_authority', uselist=False, foreign_keys='Certificate.root_authority_id')
certificates = relationship("Certificate", backref='authority', foreign_keys='Certificate.authority_id')
date_created = Column(DateTime, DefaultClause(func.now()), nullable=False)
roles = relationship(
"Role",
secondary=roles_authorities,
passive_deletes=True,
backref=db.backref("authority"),
lazy="dynamic",
)
user_id = Column(Integer, ForeignKey("users.id"))
authority_certificate = relationship(
"Certificate",
backref="root_authority",
uselist=False,
foreign_keys="Certificate.root_authority_id",
)
certificates = relationship(
"Certificate", backref="authority", foreign_keys="Certificate.authority_id"
)
authority_pending_certificate = relationship("PendingCertificate", backref='root_authority', uselist=False, foreign_keys='PendingCertificate.root_authority_id')
pending_certificates = relationship('PendingCertificate', backref='authority', foreign_keys='PendingCertificate.authority_id')
authority_pending_certificate = relationship(
"PendingCertificate",
backref="root_authority",
uselist=False,
foreign_keys="PendingCertificate.root_authority_id",
)
pending_certificates = relationship(
"PendingCertificate",
backref="authority",
foreign_keys="PendingCertificate.authority_id",
)
def __init__(self, **kwargs):
self.owner = kwargs['owner']
self.roles = kwargs.get('roles', [])
self.name = kwargs.get('name')
self.description = kwargs.get('description')
self.authority_certificate = kwargs['authority_certificate']
self.plugin_name = kwargs['plugin']['slug']
self.options = kwargs.get('options')
self.owner = kwargs["owner"]
self.roles = kwargs.get("roles", [])
self.name = kwargs.get("name")
self.description = kwargs.get("description")
self.authority_certificate = kwargs["authority_certificate"]
self.plugin_name = kwargs["plugin"]["slug"]
self.options = kwargs.get("options")
@property
def plugin(self):
return plugins.get(self.plugin_name)
@property
def is_cab_compliant(self):
"""
Parse the options to find whether authority is CAB Forum Compliant,
i.e., adhering to the CA/Browser Forum Baseline Requirements.
Returns None if option is not available
"""
if not self.options:
return None
options_array = json.loads(self.options)
if isinstance(options_array, list):
for option in options_array:
if "name" in option and option["name"] == 'cab_compliant':
return option["value"]
return None
@property
def max_issuance_days(self):
if self.is_cab_compliant:
return current_app.config.get("PUBLIC_CA_MAX_VALIDITY_DAYS", 397)
@property
def default_validity_days(self):
if self.is_cab_compliant:
return current_app.config.get("PUBLIC_CA_MAX_VALIDITY_DAYS", 397)
return current_app.config.get("DEFAULT_VALIDITY_DAYS", 365) # 1 year default
def __repr__(self):
return "Authority(name={name})".format(name=self.name)

View File

@ -11,12 +11,19 @@ from marshmallow import fields, validates_schema, pre_load
from marshmallow import validate
from marshmallow.exceptions import ValidationError
from lemur.schemas import PluginInputSchema, PluginOutputSchema, ExtensionSchema, AssociatedAuthoritySchema, AssociatedRoleSchema
from lemur.schemas import (
PluginInputSchema,
PluginOutputSchema,
ExtensionSchema,
AssociatedAuthoritySchema,
AssociatedRoleSchema,
)
from lemur.users.schemas import UserNestedOutputSchema
from lemur.common.schema import LemurInputSchema, LemurOutputSchema
from lemur.common import validators, missing
from lemur.common.fields import ArrowDateTime
from lemur.constants import CERTIFICATE_KEY_TYPES
class AuthorityInputSchema(LemurInputSchema):
@ -30,21 +37,37 @@ class AuthorityInputSchema(LemurInputSchema):
validity_years = fields.Integer()
# certificate body fields
organizational_unit = fields.String(missing=lambda: current_app.config.get('LEMUR_DEFAULT_ORGANIZATIONAL_UNIT'))
organization = fields.String(missing=lambda: current_app.config.get('LEMUR_DEFAULT_ORGANIZATION'))
location = fields.String(missing=lambda: current_app.config.get('LEMUR_DEFAULT_LOCATION'))
country = fields.String(missing=lambda: current_app.config.get('LEMUR_DEFAULT_COUNTRY'))
state = fields.String(missing=lambda: current_app.config.get('LEMUR_DEFAULT_STATE'))
organizational_unit = fields.String(
missing=lambda: current_app.config.get("LEMUR_DEFAULT_ORGANIZATIONAL_UNIT")
)
organization = fields.String(
missing=lambda: current_app.config.get("LEMUR_DEFAULT_ORGANIZATION")
)
location = fields.String()
country = fields.String(
missing=lambda: current_app.config.get("LEMUR_DEFAULT_COUNTRY")
)
state = fields.String(missing=lambda: current_app.config.get("LEMUR_DEFAULT_STATE"))
# Creating a String field instead of Email to allow empty value
email = fields.String()
plugin = fields.Nested(PluginInputSchema)
# signing related options
type = fields.String(validate=validate.OneOf(['root', 'subca']), missing='root')
type = fields.String(validate=validate.OneOf(["root", "subca"]), missing="root")
parent = fields.Nested(AssociatedAuthoritySchema)
signing_algorithm = fields.String(validate=validate.OneOf(['sha256WithRSA', 'sha1WithRSA']), missing='sha256WithRSA')
key_type = fields.String(validate=validate.OneOf(['RSA2048', 'RSA4096']), missing='RSA2048')
signing_algorithm = fields.String(
validate=validate.OneOf(["sha256WithRSA", "sha1WithRSA",
"sha256WithECDSA", "SHA384withECDSA", "SHA512withECDSA"]),
missing="sha256WithRSA",
)
key_type = fields.String(
validate=validate.OneOf(CERTIFICATE_KEY_TYPES), missing="RSA2048"
)
key_name = fields.String()
sensitivity = fields.String(validate=validate.OneOf(['medium', 'high']), missing='medium')
sensitivity = fields.String(
validate=validate.OneOf(["medium", "high"]), missing="medium"
)
serial_number = fields.Integer()
first_serial = fields.Integer(missing=1)
@ -58,9 +81,11 @@ class AuthorityInputSchema(LemurInputSchema):
@validates_schema
def validate_subca(self, data):
if data['type'] == 'subca':
if not data.get('parent'):
raise ValidationError("If generating a subca, parent 'authority' must be specified.")
if data["type"] == "subca":
if not data.get("parent"):
raise ValidationError(
"If generating a subca, parent 'authority' must be specified."
)
@pre_load
def ensure_dates(self, data):
@ -100,6 +125,8 @@ class AuthorityOutputSchema(LemurOutputSchema):
active = fields.Boolean()
options = fields.Dict()
roles = fields.List(fields.Nested(AssociatedRoleSchema))
max_issuance_days = fields.Integer()
default_validity_days = fields.Integer()
authority_certificate = fields.Nested(RootAuthorityCertificateOutputSchema)
@ -111,6 +138,10 @@ class AuthorityNestedOutputSchema(LemurOutputSchema):
owner = fields.Email()
plugin = fields.Nested(PluginOutputSchema)
active = fields.Boolean()
authority_certificate = fields.Nested(RootAuthorityCertificateOutputSchema, only=["not_after", "not_before"])
is_cab_compliant = fields.Boolean()
max_issuance_days = fields.Integer()
default_validity_days = fields.Integer()
authority_update_schema = AuthorityUpdateSchema()

View File

@ -15,6 +15,7 @@ from lemur import database
from lemur.common.utils import truthiness
from lemur.extensions import metrics
from lemur.authorities.models import Authority
from lemur.certificates.models import Certificate
from lemur.roles import service as role_service
from lemur.certificates.service import upload
@ -38,11 +39,27 @@ def update(authority_id, description, owner, active, roles):
return database.update(authority)
def update_options(authority_id, options):
"""
Update an authority with new options.
:param authority_id:
:param options: the new options to be saved into the authority
:return:
"""
authority = get(authority_id)
authority.options = options
return database.update(authority)
def mint(**kwargs):
"""
Creates the authority based on the plugin provided.
"""
issuer = kwargs['plugin']['plugin_object']
issuer = kwargs["plugin"]["plugin_object"]
values = issuer.create_authority(kwargs)
# support older plugins
@ -52,7 +69,12 @@ def mint(**kwargs):
elif len(values) == 4:
body, private_key, chain, roles = values
roles = create_authority_roles(roles, kwargs['owner'], kwargs['plugin']['plugin_object'].title, kwargs['creator'])
roles = create_authority_roles(
roles,
kwargs["owner"],
kwargs["plugin"]["plugin_object"].title,
kwargs["creator"],
)
return body, private_key, chain, roles
@ -65,16 +87,17 @@ def create_authority_roles(roles, owner, plugin_title, creator):
"""
role_objs = []
for r in roles:
role = role_service.get_by_name(r['name'])
role = role_service.get_by_name(r["name"])
if not role:
role = role_service.create(
r['name'],
password=r['password'],
r["name"],
password=r["password"],
description="Auto generated role for {0}".format(plugin_title),
username=r['username'])
username=r["username"],
)
# the user creating the authority should be able to administer it
if role.username == 'admin':
if role.username == "admin":
creator.roles.append(role)
role_objs.append(role)
@ -83,8 +106,7 @@ def create_authority_roles(roles, owner, plugin_title, creator):
owner_role = role_service.get_by_name(owner)
if not owner_role:
owner_role = role_service.create(
owner,
description="Auto generated role based on owner: {0}".format(owner)
owner, description="Auto generated role based on owner: {0}".format(owner)
)
role_objs.append(owner_role)
@ -97,27 +119,29 @@ def create(**kwargs):
"""
body, private_key, chain, roles = mint(**kwargs)
kwargs['creator'].roles = list(set(list(kwargs['creator'].roles) + roles))
kwargs["creator"].roles = list(set(list(kwargs["creator"].roles) + roles))
kwargs['body'] = body
kwargs['private_key'] = private_key
kwargs['chain'] = chain
kwargs["body"] = body
kwargs["private_key"] = private_key
kwargs["chain"] = chain
if kwargs.get('roles'):
kwargs['roles'] += roles
if kwargs.get("roles"):
kwargs["roles"] += roles
else:
kwargs['roles'] = roles
kwargs["roles"] = roles
cert = upload(**kwargs)
kwargs['authority_certificate'] = cert
if kwargs.get('plugin', {}).get('plugin_options', []):
kwargs['options'] = json.dumps(kwargs['plugin']['plugin_options'])
kwargs["authority_certificate"] = cert
if kwargs.get("plugin", {}).get("plugin_options", []):
kwargs["options"] = json.dumps(kwargs["plugin"]["plugin_options"])
authority = Authority(**kwargs)
authority = database.create(authority)
kwargs['creator'].authorities.append(authority)
kwargs["creator"].authorities.append(authority)
metrics.send('authority_created', 'counter', 1, metric_tags=dict(owner=authority.owner))
metrics.send(
"authority_created", "counter", 1, metric_tags=dict(owner=authority.owner)
)
return authority
@ -149,7 +173,7 @@ def get_by_name(authority_name):
:param authority_name:
:return:
"""
return database.get(Authority, authority_name, field='name')
return database.get(Authority, authority_name, field="name")
def get_authority_role(ca_name, creator=None):
@ -172,22 +196,31 @@ def render(args):
:return:
"""
query = database.session_query(Authority)
filt = args.pop('filter')
filt = args.pop("filter")
if filt:
terms = filt.split(';')
if 'active' in filt:
terms = filt.split(";")
if "active" in filt:
query = query.filter(Authority.active == truthiness(terms[1]))
elif "cn" in filt:
term = "%{0}%".format(terms[1])
sub_query = (
database.session_query(Certificate.root_authority_id)
.filter(Certificate.cn.ilike(term))
.subquery()
)
query = query.filter(Authority.id.in_(sub_query))
else:
query = database.filter(query, Authority, terms)
# we make sure that a user can only use an authority they either own are a member of - admins can see all
if not args['user'].is_admin:
if not args["user"].is_admin:
authority_ids = []
for authority in args['user'].authorities:
for authority in args["user"].authorities:
authority_ids.append(authority.id)
for role in args['user'].roles:
for role in args["user"].roles:
for authority in role.authorities:
authority_ids.append(authority.id)
query = query.filter(Authority.id.in_(authority_ids))

View File

@ -16,15 +16,21 @@ from lemur.auth.permissions import AuthorityPermission
from lemur.certificates import service as certificate_service
from lemur.authorities import service
from lemur.authorities.schemas import authority_input_schema, authority_output_schema, authorities_output_schema, authority_update_schema
from lemur.authorities.schemas import (
authority_input_schema,
authority_output_schema,
authorities_output_schema,
authority_update_schema,
)
mod = Blueprint('authorities', __name__)
mod = Blueprint("authorities", __name__)
api = Api(mod)
class AuthoritiesList(AuthenticatedResource):
""" Defines the 'authorities' endpoint """
def __init__(self):
self.reqparse = reqparse.RequestParser()
super(AuthoritiesList, self).__init__()
@ -90,7 +96,7 @@ class AuthoritiesList(AuthenticatedResource):
"owner": "secure@example.com",
"id": 43,
"description": "This is the ROOT certificate for the TestAuthority certificate authority."
}
}],
"total": 1
}
@ -107,7 +113,7 @@ class AuthoritiesList(AuthenticatedResource):
"""
parser = paginated_parser.copy()
args = parser.parse_args()
args['user'] = g.current_user
args["user"] = g.current_user
return service.render(args)
@validate_schema(authority_input_schema, authority_output_schema)
@ -124,6 +130,7 @@ class AuthoritiesList(AuthenticatedResource):
POST /authorities HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
Content-Type: application/json;charset=UTF-8
{
"country": "US",
@ -136,7 +143,7 @@ class AuthoritiesList(AuthenticatedResource):
"sensitivity": "medium",
"keyType": "RSA2048",
"plugin": {
"slug": "cloudca-issuer",
"slug": "cloudca-issuer"
},
"name": "TimeTestAuthority5",
"owner": "secure@example.com",
@ -149,6 +156,7 @@ class AuthoritiesList(AuthenticatedResource):
},
"custom": []
}
}
**Example response**:
@ -210,8 +218,7 @@ class AuthoritiesList(AuthenticatedResource):
:arg parent: the parent authority if this is to be a subca
:arg signingAlgorithm: algorithm used to sign the authority
:arg keyType: key type
:arg sensitivity: the sensitivity of the root key, for CloudCA this determines if the root keys are stored
in an HSM
:arg sensitivity: the sensitivity of the root key, for CloudCA this determines if the root keys are stored in an HSM
:arg keyName: name of the key to store in the HSM (CloudCA)
:arg serialNumber: serial number of the authority
:arg firstSerial: specifies the starting serial number for certificates issued off of this authority
@ -219,7 +226,7 @@ class AuthoritiesList(AuthenticatedResource):
:statuscode 403: unauthenticated
:statuscode 200: no error
"""
data['creator'] = g.current_user
data["creator"] = g.current_user
return service.create(**data)
@ -294,6 +301,7 @@ class Authorities(AuthenticatedResource):
PUT /authorities/1 HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
Content-Type: application/json;charset=UTF-8
{
"name": "TestAuthority5",
@ -387,7 +395,7 @@ class Authorities(AuthenticatedResource):
authority = service.get(authority_id)
if not authority:
return dict(message='Not Found'), 404
return dict(message="Not Found"), 404
# all the authority role members should be allowed
roles = [x.name for x in authority.roles]
@ -396,10 +404,10 @@ class Authorities(AuthenticatedResource):
if permission.can():
return service.update(
authority_id,
owner=data['owner'],
description=data['description'],
active=data['active'],
roles=data['roles']
owner=data["owner"],
description=data["description"],
active=data["active"],
roles=data["roles"],
)
return dict(message="You are not authorized to update this authority."), 403
@ -485,6 +493,26 @@ class CertificateAuthority(AuthenticatedResource):
class AuthorityVisualizations(AuthenticatedResource):
def get(self, authority_id):
"""
.. http:get:: /authorities/1/visualize
Authority visualization
**Example request**:
.. sourcecode:: http
GET /certificates/1/visualize HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
{"name": "flare",
"children": [
{
@ -499,14 +527,31 @@ class AuthorityVisualizations(AuthenticatedResource):
{"name": "MergeEdge", "size": 743}
]
}
]
}
]}
]
}
:reqheader Authorization: OAuth token to authenticate
:statuscode 200: no error
:statuscode 403: unauthenticated
"""
authority = service.get(authority_id)
return dict(name=authority.name, children=[{"name": c.name} for c in authority.certificates])
return dict(
name=authority.name,
children=[{"name": c.name} for c in authority.certificates],
)
api.add_resource(AuthoritiesList, '/authorities', endpoint='authorities')
api.add_resource(Authorities, '/authorities/<int:authority_id>', endpoint='authority')
api.add_resource(AuthorityVisualizations, '/authorities/<int:authority_id>/visualize', endpoint='authority_visualizations')
api.add_resource(CertificateAuthority, '/certificates/<int:certificate_id>/authority', endpoint='certificateAuthority')
api.add_resource(AuthoritiesList, "/authorities", endpoint="authorities")
api.add_resource(Authorities, "/authorities/<int:authority_id>", endpoint="authority")
api.add_resource(
AuthorityVisualizations,
"/authorities/<int:authority_id>/visualize",
endpoint="authority_visualizations",
)
api.add_resource(
CertificateAuthority,
"/certificates/<int:certificate_id>/authority",
endpoint="certificateAuthority",
)

View File

@ -13,7 +13,7 @@ from lemur.plugins.base import plugins
class Authorization(db.Model):
__tablename__ = 'pending_dns_authorizations'
__tablename__ = "pending_dns_authorizations"
id = Column(Integer, primary_key=True, autoincrement=True)
account_number = Column(String(128))
domains = Column(JSONType)
@ -25,7 +25,7 @@ class Authorization(db.Model):
return plugins.get(self.plugin_name)
def __repr__(self):
return "Authorization(id={id})".format(label=self.id)
return "Authorization(id={id})".format(id=self.id)
def __init__(self, account_number, domains, dns_provider_type, options=None):
self.account_number = account_number

View File

@ -6,38 +6,36 @@
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
"""
import sys
import multiprocessing
from tabulate import tabulate
from sqlalchemy import or_
from flask import current_app
from flask_script import Manager
from flask_principal import Identity, identity_changed
from flask_script import Manager
from sqlalchemy import or_
from tabulate import tabulate
from time import sleep
from lemur import database
from lemur.extensions import sentry
from lemur.extensions import metrics
from lemur.plugins.base import plugins
from lemur.constants import SUCCESS_METRIC_STATUS, FAILURE_METRIC_STATUS
from lemur.deployment import service as deployment_service
from lemur.endpoints import service as endpoint_service
from lemur.notifications.messaging import send_rotation_notification
from lemur.domains.models import Domain
from lemur.authorities.models import Authority
from lemur.certificates.schemas import CertificateOutputSchema
from lemur.authorities.service import get as authorities_get_by_id
from lemur.certificates.models import Certificate
from lemur.certificates.schemas import CertificateOutputSchema
from lemur.certificates.service import (
reissue_certificate,
get_certificate_primitives,
get_all_pending_reissue,
get_by_name,
get_all_certs,
get
get_all_valid_certs,
get,
get_all_certs_attached_to_endpoint_without_autorotate,
revoke as revoke_certificate,
)
from lemur.certificates.verify import verify_string
from lemur.constants import SUCCESS_METRIC_STATUS, FAILURE_METRIC_STATUS, CRLReason
from lemur.deployment import service as deployment_service
from lemur.domains.models import Domain
from lemur.endpoints import service as endpoint_service
from lemur.extensions import sentry, metrics
from lemur.notifications.messaging import send_rotation_notification
from lemur.plugins.base import plugins
manager = Manager(usage="Handles all certificate related tasks.")
@ -56,11 +54,14 @@ def print_certificate_details(details):
"\t[+] Authority: {authority_name}\n"
"\t[+] Validity Start: {validity_start}\n"
"\t[+] Validity End: {validity_end}\n".format(
common_name=details['commonName'],
sans=",".join(x['value'] for x in details['extensions']['subAltNames']['names']) or None,
authority_name=details['authority']['name'],
validity_start=details['validityStart'],
validity_end=details['validityEnd']
common_name=details["commonName"],
sans=",".join(
x["value"] for x in details["extensions"]["subAltNames"]["names"]
)
or None,
authority_name=details["authority"]["name"],
validity_start=details["validityStart"],
validity_end=details["validityEnd"],
)
)
@ -118,15 +119,20 @@ def request_rotation(endpoint, certificate, message, commit):
status = SUCCESS_METRIC_STATUS
except Exception as e:
sentry.captureException(extra={"certificate_name": str(certificate.name),
"endpoint": str(endpoint.dnsname)})
current_app.logger.exception(
f"Error rotating certificate: {certificate.name}", exc_info=True
)
print(
"[!] Failed to rotate endpoint {0} to certificate {1} reason: {2}".format(
endpoint.name,
certificate.name,
e
endpoint.name, certificate.name, e
)
)
metrics.send('endpoint_rotation', 'counter', 1, metric_tags={'status': status})
metrics.send("endpoint_rotation", "counter", 1, metric_tags={"status": status,
"certificate_name": str(certificate.name),
"endpoint": str(endpoint.dnsname)})
def request_reissue(certificate, commit):
@ -153,22 +159,53 @@ def request_reissue(certificate, commit):
status = SUCCESS_METRIC_STATUS
except Exception as e:
sentry.captureException()
current_app.logger.exception("Error reissuing certificate.", exc_info=True)
print(
"[!] Failed to reissue certificates. Reason: {}".format(
e
sentry.captureException(extra={"certificate_name": str(certificate.name)})
current_app.logger.exception(
f"Error reissuing certificate: {certificate.name}", exc_info=True
)
print(f"[!] Failed to reissue certificate: {certificate.name}. Reason: {e}")
metrics.send(
"certificate_reissue",
"counter",
1,
metric_tags={"status": status, "certificate": certificate.name},
)
metrics.send('certificate_reissue', 'counter', 1, metric_tags={'status': status})
@manager.option('-e', '--endpoint', dest='endpoint_name', help='Name of the endpoint you wish to rotate.')
@manager.option('-n', '--new-certificate', dest='new_certificate_name', help='Name of the certificate you wish to rotate to.')
@manager.option('-o', '--old-certificate', dest='old_certificate_name', help='Name of the certificate you wish to rotate.')
@manager.option('-a', '--notify', dest='message', action='store_true', help='Send a rotation notification to the certificates owner.')
@manager.option('-c', '--commit', dest='commit', action='store_true', default=False, help='Persist changes.')
@manager.option(
"-e",
"--endpoint",
dest="endpoint_name",
help="Name of the endpoint you wish to rotate.",
)
@manager.option(
"-n",
"--new-certificate",
dest="new_certificate_name",
help="Name of the certificate you wish to rotate to.",
)
@manager.option(
"-o",
"--old-certificate",
dest="old_certificate_name",
help="Name of the certificate you wish to rotate.",
)
@manager.option(
"-a",
"--notify",
dest="message",
action="store_true",
help="Send a rotation notification to the certificates owner.",
)
@manager.option(
"-c",
"--commit",
dest="commit",
action="store_true",
default=False,
help="Persist changes.",
)
def rotate(endpoint_name, new_certificate_name, old_certificate_name, message, commit):
"""
Rotates an endpoint and reissues it if it has not already been replaced. If it has
@ -181,45 +218,265 @@ def rotate(endpoint_name, new_certificate_name, old_certificate_name, message, c
status = FAILURE_METRIC_STATUS
log_data = {
"function": f"{__name__}.{sys._getframe().f_code.co_name}",
}
try:
old_cert = validate_certificate(old_certificate_name)
new_cert = validate_certificate(new_certificate_name)
endpoint = validate_endpoint(endpoint_name)
if endpoint and new_cert:
print("[+] Rotating endpoint: {0} to certificate {1}".format(endpoint.name, new_cert.name))
print(
f"[+] Rotating endpoint: {endpoint.name} to certificate {new_cert.name}"
)
log_data["message"] = "Rotating one endpoint"
log_data["endpoint"] = endpoint.dnsname
log_data["certificate"] = new_cert.name
request_rotation(endpoint, new_cert, message, commit)
current_app.logger.info(log_data)
elif old_cert and new_cert:
print("[+] Rotating all endpoints from {0} to {1}".format(old_cert.name, new_cert.name))
print(f"[+] Rotating all endpoints from {old_cert.name} to {new_cert.name}")
log_data["certificate"] = new_cert.name
log_data["certificate_old"] = old_cert.name
log_data["message"] = "Rotating endpoint from old to new cert"
for endpoint in old_cert.endpoints:
print("[+] Rotating {0}".format(endpoint.name))
print(f"[+] Rotating {endpoint.name}")
log_data["endpoint"] = endpoint.dnsname
request_rotation(endpoint, new_cert, message, commit)
current_app.logger.info(log_data)
else:
# No certificate name or endpoint is provided. We will now fetch all endpoints,
# which are associated with a certificate that has been replaced
print("[+] Rotating all endpoints that have new certificates available")
for endpoint in endpoint_service.get_all_pending_rotation():
if len(endpoint.certificate.replaced) == 1:
print("[+] Rotating {0} to {1}".format(endpoint.name, endpoint.certificate.replaced[0].name))
log_data["message"] = "Rotating endpoint from old to new cert"
if len(endpoint.certificate.replaced) > 1:
log_data["message"] = f"Multiple replacement certificates found, going with the first one out of " \
f"{len(endpoint.certificate.replaced)}"
log_data["endpoint"] = endpoint.dnsname
log_data["certificate"] = endpoint.certificate.replaced[0].name
print(
f"[+] Rotating {endpoint.name} to {endpoint.certificate.replaced[0].name}"
)
request_rotation(endpoint, endpoint.certificate.replaced[0], message, commit)
else:
metrics.send('endpoint_rotation', 'counter', 1, metric_tags={'status': FAILURE_METRIC_STATUS})
print("[!] Failed to rotate endpoint {0} reason: Multiple replacement certificates found.".format(
endpoint.name
))
current_app.logger.info(log_data)
status = SUCCESS_METRIC_STATUS
print("[+] Done!")
except Exception as e:
sentry.captureException()
sentry.captureException(
extra={
"old_certificate_name": str(old_certificate_name),
"new_certificate_name": str(new_certificate_name),
"endpoint_name": str(endpoint_name),
"message": str(message),
}
)
metrics.send('endpoint_rotation_job', 'counter', 1, metric_tags={'status': status})
metrics.send(
"endpoint_rotation_job",
"counter",
1,
metric_tags={
"status": status,
"old_certificate_name": str(old_certificate_name),
"new_certificate_name": str(new_certificate_name),
"endpoint_name": str(endpoint_name),
"message": str(message),
"endpoint": str(globals().get("endpoint")),
},
)
@manager.option('-o', '--old-certificate', dest='old_certificate_name', help='Name of the certificate you wish to reissue.')
@manager.option('-c', '--commit', dest='commit', action='store_true', default=False, help='Persist changes.')
def request_rotation_region(endpoint, new_cert, message, commit, log_data, region):
if region in endpoint.dnsname:
log_data["message"] = "Rotating endpoint in region"
request_rotation(endpoint, new_cert, message, commit)
else:
log_data["message"] = "Skipping rotation, region mismatch"
print(log_data)
current_app.logger.info(log_data)
@manager.option(
"-e",
"--endpoint",
dest="endpoint_name",
help="Name of the endpoint you wish to rotate.",
)
@manager.option(
"-n",
"--new-certificate",
dest="new_certificate_name",
help="Name of the certificate you wish to rotate to.",
)
@manager.option(
"-o",
"--old-certificate",
dest="old_certificate_name",
help="Name of the certificate you wish to rotate.",
)
@manager.option(
"-a",
"--notify",
dest="message",
action="store_true",
help="Send a rotation notification to the certificates owner.",
)
@manager.option(
"-c",
"--commit",
dest="commit",
action="store_true",
default=False,
help="Persist changes.",
)
@manager.option(
"-r",
"--region",
dest="region",
required=True,
help="Region in which to rotate the endpoint.",
)
def rotate_region(endpoint_name, new_certificate_name, old_certificate_name, message, commit, region):
"""
Rotates an endpoint in a defined region it if it has not already been replaced. If it has
been replaced, will use the replacement certificate for the rotation.
:param old_certificate_name: Name of the certificate you wish to rotate.
:param new_certificate_name: Name of the certificate you wish to rotate to.
:param endpoint_name: Name of the endpoint you wish to rotate.
:param message: Send a rotation notification to the certificates owner.
:param commit: Persist changes.
:param region: Region in which to rotate the endpoint.
#todo: merge this method with rotate()
"""
if commit:
print("[!] Running in COMMIT mode.")
print("[+] Starting endpoint rotation.")
status = FAILURE_METRIC_STATUS
log_data = {
"function": f"{__name__}.{sys._getframe().f_code.co_name}",
"region": region,
}
try:
old_cert = validate_certificate(old_certificate_name)
new_cert = validate_certificate(new_certificate_name)
endpoint = validate_endpoint(endpoint_name)
if endpoint and new_cert:
log_data["endpoint"] = endpoint.dnsname
log_data["certificate"] = new_cert.name
request_rotation_region(endpoint, new_cert, message, commit, log_data, region)
elif old_cert and new_cert:
log_data["certificate"] = new_cert.name
log_data["certificate_old"] = old_cert.name
log_data["message"] = "Rotating endpoint from old to new cert"
print(log_data)
current_app.logger.info(log_data)
for endpoint in old_cert.endpoints:
log_data["endpoint"] = endpoint.dnsname
request_rotation_region(endpoint, new_cert, message, commit, log_data, region)
else:
log_data["message"] = "Rotating all endpoints that have new certificates available"
print(log_data)
current_app.logger.info(log_data)
all_pending_rotation_endpoints = endpoint_service.get_all_pending_rotation()
for endpoint in all_pending_rotation_endpoints:
log_data["endpoint"] = endpoint.dnsname
if region not in endpoint.dnsname:
log_data["message"] = "Skipping rotation, region mismatch"
print(log_data)
current_app.logger.info(log_data)
metrics.send(
"endpoint_rotation_region_skipped",
"counter",
1,
metric_tags={
"region": region,
"new_certificate_name": str(endpoint.certificate.replaced[0].name),
"endpoint_name": str(endpoint.dnsname),
},
)
continue
log_data["certificate"] = endpoint.certificate.replaced[0].name
log_data["message"] = "Rotating all endpoints in region"
if len(endpoint.certificate.replaced) > 1:
log_data["message"] = f"Multiple replacement certificates found, going with the first one out of " \
f"{len(endpoint.certificate.replaced)}"
request_rotation(endpoint, endpoint.certificate.replaced[0], message, commit)
current_app.logger.info(log_data)
metrics.send(
"endpoint_rotation_region",
"counter",
1,
metric_tags={
"status": FAILURE_METRIC_STATUS,
"new_certificate_name": str(log_data["certificate"]),
"endpoint_name": str(endpoint.dnsname),
"message": str(message),
"region": str(region),
},
)
status = SUCCESS_METRIC_STATUS
print("[+] Done!")
except Exception as e:
sentry.captureException(
extra={
"old_certificate_name": str(old_certificate_name),
"new_certificate_name": str(new_certificate_name),
"endpoint": str(endpoint_name),
"message": str(message),
"region": str(region),
}
)
metrics.send(
"endpoint_rotation_region_job",
"counter",
1,
metric_tags={
"status": status,
"old_certificate_name": str(old_certificate_name),
"new_certificate_name": str(new_certificate_name),
"endpoint_name": str(endpoint_name),
"message": str(message),
"endpoint": str(globals().get("endpoint")),
"region": str(region),
},
)
@manager.option(
"-o",
"--old-certificate",
dest="old_certificate_name",
help="Name of the certificate you wish to reissue.",
)
@manager.option(
"-c",
"--commit",
dest="commit",
action="store_true",
default=False,
help="Persist changes.",
)
def reissue(old_certificate_name, commit):
"""
Reissues certificate with the same parameters as it was originally issued with.
@ -247,75 +504,93 @@ def reissue(old_certificate_name, commit):
except Exception as e:
sentry.captureException()
current_app.logger.exception("Error reissuing certificate.", exc_info=True)
print(
"[!] Failed to reissue certificates. Reason: {}".format(
e
)
print("[!] Failed to reissue certificates. Reason: {}".format(e))
metrics.send(
"certificate_reissue_job", "counter", 1, metric_tags={"status": status}
)
metrics.send('certificate_reissue_job', 'counter', 1, metric_tags={'status': status})
@manager.option('-f', '--fqdns', dest='fqdns', help='FQDNs to query. Multiple fqdns specified via comma.')
@manager.option('-i', '--issuer', dest='issuer', help='Issuer to query for.')
@manager.option('-o', '--owner', dest='owner', help='Owner to query for.')
@manager.option('-e', '--expired', dest='expired', type=bool, default=False, help='Include expired certificates.')
@manager.option(
"-f",
"--fqdns",
dest="fqdns",
help="FQDNs to query. Multiple fqdns specified via comma.",
)
@manager.option("-i", "--issuer", dest="issuer", help="Issuer to query for.")
@manager.option("-o", "--owner", dest="owner", help="Owner to query for.")
@manager.option(
"-e",
"--expired",
dest="expired",
type=bool,
default=False,
help="Include expired certificates.",
)
def query(fqdns, issuer, owner, expired):
"""Prints certificates that match the query params."""
table = []
q = database.session_query(Certificate)
sub_query = database.session_query(Authority.id) \
.filter(Authority.name.ilike('%{0}%'.format(issuer))) \
if issuer:
sub_query = (
database.session_query(Authority.id)
.filter(Authority.name.ilike("%{0}%".format(issuer)))
.subquery()
)
q = q.filter(
or_(
Certificate.issuer.ilike('%{0}%'.format(issuer)),
Certificate.authority_id.in_(sub_query)
Certificate.issuer.ilike("%{0}%".format(issuer)),
Certificate.authority_id.in_(sub_query),
)
)
q = q.filter(Certificate.owner.ilike('%{0}%'.format(owner)))
if owner:
q = q.filter(Certificate.owner.ilike("%{0}%".format(owner)))
if not expired:
q = q.filter(Certificate.expired == False) # noqa
for f in fqdns.split(','):
if fqdns:
for f in fqdns.split(","):
q = q.filter(
or_(
Certificate.cn.ilike('%{0}%'.format(f)),
Certificate.domains.any(Domain.name.ilike('%{0}%'.format(f)))
Certificate.cn.ilike("%{0}%".format(f)),
Certificate.domains.any(Domain.name.ilike("%{0}%".format(f))),
)
)
for c in q.all():
table.append([c.id, c.name, c.owner, c.issuer])
print(tabulate(table, headers=['Id', 'Name', 'Owner', 'Issuer'], tablefmt='csv'))
print(tabulate(table, headers=["Id", "Name", "Owner", "Issuer"], tablefmt="csv"))
def worker(data, commit, reason):
parts = [x for x in data.split(' ') if x]
parts = [x for x in data.split(" ") if x]
try:
cert = get(int(parts[0].strip()))
plugin = plugins.get(cert.authority.plugin_name)
print('[+] Revoking certificate. Id: {0} Name: {1}'.format(cert.id, cert.name))
print("[+] Revoking certificate. Id: {0} Name: {1}".format(cert.id, cert.name))
if commit:
plugin.revoke_certificate(cert, reason)
revoke_certificate(cert, reason)
metrics.send('certificate_revoke', 'counter', 1, metric_tags={'status': SUCCESS_METRIC_STATUS})
metrics.send(
"certificate_revoke",
"counter",
1,
metric_tags={"status": SUCCESS_METRIC_STATUS},
)
except Exception as e:
sentry.captureException()
metrics.send('certificate_revoke', 'counter', 1, metric_tags={'status': FAILURE_METRIC_STATUS})
print(
"[!] Failed to revoke certificates. Reason: {}".format(
e
)
metrics.send(
"certificate_revoke",
"counter",
1,
metric_tags={"status": FAILURE_METRIC_STATUS},
)
print("[!] Failed to revoke certificates. Reason: {}".format(e))
@manager.command
@ -324,27 +599,48 @@ def clear_pending():
Function clears all pending certificates.
:return:
"""
v = plugins.get('verisign-issuer')
v = plugins.get("verisign-issuer")
v.clear_pending_certificates()
@manager.option('-p', '--path', dest='path', help='Absolute file path to a Lemur query csv.')
@manager.option('-r', '--reason', dest='reason', help='Reason to revoke certificate.')
@manager.option('-c', '--commit', dest='commit', action='store_true', default=False, help='Persist changes.')
def revoke(path, reason, commit):
@manager.option("-p", "--path", dest="path", help="Absolute file path to a Lemur query csv.")
@manager.option("-id", "--certid", dest="cert_id", help="ID of the certificate to be revoked")
@manager.option("-r", "--reason", dest="reason", default="unspecified", help="CRL Reason as per RFC 5280 section 5.3.1")
@manager.option("-m", "--message", dest="message", help="Message explaining reason for revocation")
@manager.option(
"-c",
"--commit",
dest="commit",
action="store_true",
default=False,
help="Persist changes.",
)
def revoke(path, cert_id, reason, message, commit):
"""
Revokes given certificate.
"""
if not path and not cert_id:
print("[!] No input certificates mentioned to revoke")
return
if path and cert_id:
print("[!] Please mention single certificate id (-id) or input file (-p)")
return
if commit:
print("[!] Running in COMMIT mode.")
print("[+] Starting certificate revocation.")
with open(path, 'r') as f:
args = [[x, commit, reason] for x in f.readlines()[2:]]
if reason not in CRLReason.__members__:
reason = CRLReason.unspecified.name
comments = {"comments": message, "crl_reason": reason}
with multiprocessing.Pool(processes=3) as pool:
pool.starmap(worker, args)
if cert_id:
worker(cert_id, commit, comments)
else:
with open(path, "r") as f:
for x in f.readlines()[2:]:
worker(x, commit, comments)
@manager.command
@ -356,18 +652,126 @@ def check_revoked():
encounters an issue with verification it marks the certificate status
as `unknown`.
"""
for cert in get_all_certs():
log_data = {
"function": f"{__name__}.{sys._getframe().f_code.co_name}",
"message": "Checking for revoked Certificates"
}
certs = get_all_valid_certs(current_app.config.get("SUPPORTED_REVOCATION_AUTHORITY_PLUGINS", []))
for cert in certs:
try:
if cert.chain:
status = verify_string(cert.body, cert.chain)
else:
status = verify_string(cert.body, "")
cert.status = 'valid' if status else 'revoked'
cert.status = "valid" if status else "revoked"
if cert.status == "revoked":
log_data["valid"] = cert.status
log_data["certificate_name"] = cert.name
log_data["certificate_id"] = cert.id
metrics.send(
"certificate_revoked",
"counter",
1,
metric_tags={"status": log_data["valid"],
"certificate_name": log_data["certificate_name"],
"certificate_id": log_data["certificate_id"]},
)
current_app.logger.info(log_data)
except Exception as e:
sentry.captureException()
current_app.logger.exception(e)
cert.status = 'unknown'
cert.status = "unknown"
database.update(cert)
@manager.command
def automatically_enable_autorotate():
"""
This function automatically enables auto-rotation for unexpired certificates that are
attached to an endpoint but do not have autorotate enabled.
WARNING: This will overwrite the Auto-rotate toggle!
"""
log_data = {
"function": f"{__name__}.{sys._getframe().f_code.co_name}",
"message": "Enabling auto-rotate for certificate"
}
permitted_authorities = current_app.config.get("ENABLE_AUTO_ROTATE_AUTHORITY", [])
eligible_certs = get_all_certs_attached_to_endpoint_without_autorotate()
for cert in eligible_certs:
if cert.authority_id not in permitted_authorities:
continue
log_data["certificate"] = cert.name
log_data["certificate_id"] = cert.id
log_data["authority_id"] = cert.authority_id
log_data["authority_name"] = authorities_get_by_id(cert.authority_id).name
if cert.destinations:
log_data["destination_names"] = ', '.join([d.label for d in cert.destinations])
else:
log_data["destination_names"] = "NONE"
current_app.logger.info(log_data)
metrics.send("automatically_enable_autorotate",
"counter", 1,
metric_tags={"certificate": log_data["certificate"],
"certificate_id": log_data["certificate_id"],
"authority_id": log_data["authority_id"],
"authority_name": log_data["authority_name"],
"destination_names": log_data["destination_names"]
})
cert.rotation = True
database.update(cert)
@manager.command
def deactivate_entrust_certificates():
"""
Attempt to deactivate test certificates issued by Entrust
"""
log_data = {
"function": f"{__name__}.{sys._getframe().f_code.co_name}",
"message": "Deactivating Entrust certificates"
}
certificates = get_all_valid_certs(['entrust-issuer'])
entrust_plugin = plugins.get('entrust-issuer')
for index, cert in enumerate(certificates):
if (index % 10) == 0:
# Entrust enforces a 10 request per 30s rate limit
sleep(30)
try:
response = entrust_plugin.deactivate_certificate(cert)
if response == 200:
cert.status = "revoked"
else:
cert.status = "unknown"
log_data["valid"] = cert.status
log_data["certificate_name"] = cert.name
log_data["certificate_id"] = cert.id
metrics.send(
"certificate_deactivate",
"counter",
1,
metric_tags={"status": log_data["valid"],
"certificate_name": log_data["certificate_name"],
"certificate_id": log_data["certificate_id"]},
)
current_app.logger.info(log_data)
database.update(cert)
except Exception as e:
current_app.logger.info(log_data)
sentry.captureException()
current_app.logger.exception(e)

View File

@ -12,21 +12,30 @@ import subprocess
from flask import current_app
from lemur.certificates.service import csr_created, csr_imported, certificate_issued, certificate_imported
from lemur.certificates.service import (
csr_created,
csr_imported,
certificate_issued,
certificate_imported,
)
def csr_dump_handler(sender, csr, **kwargs):
try:
subprocess.run(['openssl', 'req', '-text', '-noout', '-reqopt', 'no_sigdump,no_pubkey'],
input=csr.encode('utf8'))
subprocess.run(
["openssl", "req", "-text", "-noout", "-reqopt", "no_sigdump,no_pubkey"],
input=csr.encode("utf8"),
)
except Exception as err:
current_app.logger.warning("Error inspecting CSR: %s", err)
def cert_dump_handler(sender, certificate, **kwargs):
try:
subprocess.run(['openssl', 'x509', '-text', '-noout', '-certopt', 'no_sigdump,no_pubkey'],
input=certificate.body.encode('utf8'))
subprocess.run(
["openssl", "x509", "-text", "-noout", "-certopt", "no_sigdump,no_pubkey"],
input=certificate.body.encode("utf8"),
)
except Exception as err:
current_app.logger.warning("Error inspecting certificate: %s", err)

View File

@ -5,49 +5,55 @@
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
"""
import arrow
from datetime import timedelta
from flask import current_app
import arrow
from cryptography import x509
from cryptography.hazmat.primitives.asymmetric import rsa
from flask import current_app
from idna.core import InvalidCodepoint
from sqlalchemy import (
event,
Integer,
ForeignKey,
String,
DefaultClause,
func,
Column,
Text,
Boolean,
Index,
)
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm import relationship
from sqlalchemy.sql.expression import case, extract
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy import event, Integer, ForeignKey, String, PassiveDefault, func, Column, Text, Boolean
from sqlalchemy_utils.types.arrow import ArrowType
from werkzeug.utils import cached_property
import lemur.common.utils
from lemur.database import db
from lemur.extensions import sentry
from lemur.utils import Vault
from lemur.common import defaults
from lemur.plugins.base import plugins
from lemur.extensions import metrics
from lemur.common import defaults, utils, validators
from lemur.constants import SUCCESS_METRIC_STATUS, FAILURE_METRIC_STATUS
from lemur.models import certificate_associations, certificate_source_associations, \
certificate_destination_associations, certificate_notification_associations, \
certificate_replacement_associations, roles_certificates, pending_cert_replacement_associations
from lemur.database import db
from lemur.domains.models import Domain
from lemur.extensions import metrics
from lemur.extensions import sentry
from lemur.models import (
certificate_associations,
certificate_source_associations,
certificate_destination_associations,
certificate_notification_associations,
certificate_replacement_associations,
roles_certificates,
pending_cert_replacement_associations,
)
from lemur.plugins.base import plugins
from lemur.policies.models import RotationPolicy
from lemur.utils import Vault
def get_sequence(name):
if '-' not in name:
if "-" not in name:
return name, None
parts = name.split('-')
parts = name.split("-")
# see if we have an int at the end of our name
try:
@ -59,22 +65,26 @@ def get_sequence(name):
if len(parts[-1]) == 8:
return name, None
root = '-'.join(parts[:-1])
root = "-".join(parts[:-1])
return root, seq
def get_or_increase_name(name, serial):
certificates = Certificate.query.filter(Certificate.name.ilike('{0}%'.format(name))).all()
certificates = Certificate.query.filter(Certificate.name == name).all()
if not certificates:
return name
serial_name = '{0}-{1}'.format(name, hex(int(serial))[2:].upper())
certificates = Certificate.query.filter(Certificate.name.ilike('{0}%'.format(serial_name))).all()
serial_name = "{0}-{1}".format(name, hex(int(serial))[2:].upper())
certificates = Certificate.query.filter(Certificate.name == serial_name).all()
if not certificates:
return serial_name
certificates = Certificate.query.filter(
Certificate.name.ilike("{0}%".format(serial_name))
).all()
ends = [0]
root, end = get_sequence(serial_name)
for cert in certificates:
@ -82,12 +92,29 @@ def get_or_increase_name(name, serial):
if end:
ends.append(end)
return '{0}-{1}'.format(root, max(ends) + 1)
return "{0}-{1}".format(root, max(ends) + 1)
class Certificate(db.Model):
__tablename__ = 'certificates'
__tablename__ = "certificates"
__table_args__ = (
Index(
"ix_certificates_cn",
"cn",
postgresql_ops={"cn": "gin_trgm_ops"},
postgresql_using="gin",
),
Index(
"ix_certificates_name",
"name",
postgresql_ops={"name": "gin_trgm_ops"},
postgresql_using="gin",
),
)
id = Column(Integer, primary_key=True)
ix = Index(
"ix_certificates_id_desc", id.desc(), postgresql_using="btree", unique=True
)
external_id = Column(String(128))
owner = Column(String(128), nullable=False)
name = Column(String(256), unique=True)
@ -96,17 +123,22 @@ class Certificate(db.Model):
body = Column(Text(), nullable=False)
chain = Column(Text())
csr = Column(Text())
private_key = Column(Vault)
issuer = Column(String(128))
serial = Column(String(128))
cn = Column(String(128))
deleted = Column(Boolean, index=True)
dns_provider_id = Column(Integer(), ForeignKey('dns_providers.id', ondelete='cascade'), nullable=True)
deleted = Column(Boolean, index=True, default=False)
dns_provider_id = Column(
Integer(), ForeignKey("dns_providers.id", ondelete="CASCADE"), nullable=True
)
not_before = Column(ArrowType)
not_after = Column(ArrowType)
date_created = Column(ArrowType, PassiveDefault(func.now()), nullable=False)
not_after_ix = Index("ix_certificates_not_after", not_after.desc())
date_created = Column(ArrowType, DefaultClause(func.now()), nullable=False)
signing_algorithm = Column(String(128))
status = Column(String(128))
@ -114,35 +146,54 @@ class Certificate(db.Model):
san = Column(String(1024)) # TODO this should be migrated to boolean
rotation = Column(Boolean, default=False)
user_id = Column(Integer, ForeignKey('users.id'))
authority_id = Column(Integer, ForeignKey('authorities.id', ondelete="CASCADE"))
root_authority_id = Column(Integer, ForeignKey('authorities.id', ondelete="CASCADE"))
rotation_policy_id = Column(Integer, ForeignKey('rotation_policies.id'))
user_id = Column(Integer, ForeignKey("users.id"))
authority_id = Column(Integer, ForeignKey("authorities.id", ondelete="CASCADE"))
root_authority_id = Column(
Integer, ForeignKey("authorities.id", ondelete="CASCADE")
)
rotation_policy_id = Column(Integer, ForeignKey("rotation_policies.id"))
key_type = Column(String(128))
notifications = relationship('Notification', secondary=certificate_notification_associations, backref='certificate')
destinations = relationship('Destination', secondary=certificate_destination_associations, backref='certificate')
sources = relationship('Source', secondary=certificate_source_associations, backref='certificate')
domains = relationship('Domain', secondary=certificate_associations, backref='certificate')
roles = relationship('Role', secondary=roles_certificates, backref='certificate')
replaces = relationship('Certificate',
notifications = relationship(
"Notification",
secondary=certificate_notification_associations,
backref="certificate",
)
destinations = relationship(
"Destination",
secondary=certificate_destination_associations,
backref="certificate",
)
sources = relationship(
"Source", secondary=certificate_source_associations, backref="certificate"
)
domains = relationship(
"Domain", secondary=certificate_associations, backref="certificate"
)
roles = relationship("Role", secondary=roles_certificates, backref="certificate")
replaces = relationship(
"Certificate",
secondary=certificate_replacement_associations,
primaryjoin=id == certificate_replacement_associations.c.certificate_id, # noqa
secondaryjoin=id == certificate_replacement_associations.c.replaced_certificate_id, # noqa
backref='replaced')
secondaryjoin=id
== certificate_replacement_associations.c.replaced_certificate_id, # noqa
backref="replaced",
)
replaced_by_pending = relationship('PendingCertificate',
replaced_by_pending = relationship(
"PendingCertificate",
secondary=pending_cert_replacement_associations,
backref='pending_replace',
viewonly=True)
backref="pending_replace",
)
logs = relationship('Log', backref='certificate')
endpoints = relationship('Endpoint', backref='certificate')
logs = relationship("Log", backref="certificate")
endpoints = relationship("Endpoint", backref="certificate")
rotation_policy = relationship("RotationPolicy")
sensitive_fields = ('private_key',)
sensitive_fields = ("private_key",)
def __init__(self, **kwargs):
cert = lemur.common.utils.parse_certificate(kwargs['body'])
self.body = kwargs["body"].strip()
cert = self.parsed_cert
self.issuer = defaults.issuer(cert)
self.cn = defaults.common_name(cert)
@ -152,72 +203,110 @@ class Certificate(db.Model):
self.serial = defaults.serial(cert)
# when destinations are appended they require a valid name.
if kwargs.get('name'):
self.name = get_or_increase_name(defaults.text_to_slug(kwargs['name']), self.serial)
if kwargs.get("name"):
self.name = get_or_increase_name(
defaults.text_to_slug(kwargs["name"]), self.serial
)
else:
self.name = get_or_increase_name(
defaults.certificate_name(self.cn, self.issuer, self.not_before, self.not_after, self.san), self.serial)
defaults.certificate_name(
self.cn, self.issuer, self.not_before, self.not_after, self.san
),
self.serial,
)
self.owner = kwargs['owner']
self.body = kwargs['body'].strip()
self.owner = kwargs["owner"]
if kwargs.get('private_key'):
self.private_key = kwargs['private_key'].strip()
if kwargs.get("private_key"):
self.private_key = kwargs["private_key"].strip()
if kwargs.get('chain'):
self.chain = kwargs['chain'].strip()
if kwargs.get("chain"):
self.chain = kwargs["chain"].strip()
self.notify = kwargs.get('notify', True)
self.destinations = kwargs.get('destinations', [])
self.notifications = kwargs.get('notifications', [])
self.description = kwargs.get('description')
self.roles = list(set(kwargs.get('roles', [])))
self.replaces = kwargs.get('replaces', [])
self.rotation = kwargs.get('rotation')
self.rotation_policy = kwargs.get('rotation_policy')
if kwargs.get("csr"):
self.csr = kwargs["csr"].strip()
self.notify = kwargs.get("notify", True)
self.destinations = kwargs.get("destinations", [])
self.notifications = kwargs.get("notifications", [])
self.description = kwargs.get("description")
self.roles = list(set(kwargs.get("roles", [])))
self.replaces = kwargs.get("replaces", [])
self.rotation = kwargs.get("rotation")
self.rotation_policy = kwargs.get("rotation_policy")
self.key_type = kwargs.get("key_type")
self.signing_algorithm = defaults.signing_algorithm(cert)
self.bits = defaults.bitstrength(cert)
self.external_id = kwargs.get('external_id')
self.authority_id = kwargs.get('authority_id')
self.dns_provider_id = kwargs.get('dns_provider_id')
self.external_id = kwargs.get("external_id")
self.authority_id = kwargs.get("authority_id")
self.dns_provider_id = kwargs.get("dns_provider_id")
for domain in defaults.domains(cert):
self.domains.append(Domain(name=domain))
# Check integrity before saving anything into the database.
# For user-facing API calls, validation should also be done in schema validators.
self.check_integrity()
def check_integrity(self):
"""
Integrity checks: Does the cert have a valid chain and matching private key?
"""
if self.private_key:
validators.verify_private_key_match(
utils.parse_private_key(self.private_key),
self.parsed_cert,
error_class=AssertionError,
)
if self.chain:
chain = [self.parsed_cert] + utils.parse_cert_chain(self.chain)
validators.verify_cert_chain(chain, error_class=AssertionError)
@cached_property
def parsed_cert(self):
assert self.body, "Certificate body not set"
return utils.parse_certificate(self.body)
@property
def active(self):
return self.notify
@property
def organization(self):
cert = lemur.common.utils.parse_certificate(self.body)
return defaults.organization(cert)
return defaults.organization(self.parsed_cert)
@property
def organizational_unit(self):
cert = lemur.common.utils.parse_certificate(self.body)
return defaults.organizational_unit(cert)
return defaults.organizational_unit(self.parsed_cert)
@property
def country(self):
cert = lemur.common.utils.parse_certificate(self.body)
return defaults.country(cert)
return defaults.country(self.parsed_cert)
@property
def state(self):
cert = lemur.common.utils.parse_certificate(self.body)
return defaults.state(cert)
return defaults.state(self.parsed_cert)
@property
def location(self):
cert = lemur.common.utils.parse_certificate(self.body)
return defaults.location(cert)
return defaults.location(self.parsed_cert)
@property
def distinguished_name(self):
return self.parsed_cert.subject.rfc4514_string()
"""
# Commenting this property as key_type is now added as a column. This code can be removed in future.
@property
def key_type(self):
cert = lemur.common.utils.parse_certificate(self.body)
if isinstance(cert.public_key(), rsa.RSAPublicKey):
return 'RSA{key_size}'.format(key_size=cert.public_key().key_size)
if isinstance(self.parsed_cert.public_key(), rsa.RSAPublicKey):
return "RSA{key_size}".format(
key_size=self.parsed_cert.public_key().key_size
)
elif isinstance(self.parsed_cert.public_key(), ec.EllipticCurvePublicKey):
return get_key_type_from_ec_curve(self.parsed_cert.public_key().curve.name)
"""
@property
def validity_remaining(self):
@ -229,41 +318,38 @@ class Certificate(db.Model):
@property
def subject(self):
cert = lemur.common.utils.parse_certificate(self.body)
return cert.subject
return self.parsed_cert.subject
@property
def public_key(self):
cert = lemur.common.utils.parse_certificate(self.body)
return cert.public_key()
return self.parsed_cert.public_key()
@hybrid_property
def expired(self):
if self.not_after <= arrow.utcnow():
# can't compare offset-naive and offset-aware datetimes
if arrow.Arrow.fromdatetime(self.not_after) <= arrow.utcnow():
return True
@expired.expression
def expired(cls):
return case(
[
(cls.not_after <= arrow.utcnow(), True)
],
else_=False
)
return case([(cls.not_after <= arrow.utcnow(), True)], else_=False)
@hybrid_property
def revoked(self):
if 'revoked' == self.status:
if "revoked" == self.status:
return True
@revoked.expression
def revoked(cls):
return case(
[
(cls.status == 'revoked', True)
],
else_=False
)
return case([(cls.status == "revoked", True)], else_=False)
@hybrid_property
def has_private_key(self):
return self.private_key is not None
@has_private_key.expression
def has_private_key(cls):
return case([(cls.private_key.is_(None), True)], else_=False)
@hybrid_property
def in_rotation_window(self):
@ -286,67 +372,65 @@ class Certificate(db.Model):
:return:
"""
return case(
[
(extract('day', cls.not_after - func.now()) <= RotationPolicy.days, True)
],
else_=False
[(extract("day", cls.not_after - func.now()) <= RotationPolicy.days, True)],
else_=False,
)
@property
def extensions(self):
# setup default values
return_extensions = {
'sub_alt_names': {'names': []}
}
return_extensions = {"sub_alt_names": {"names": []}}
try:
cert = lemur.common.utils.parse_certificate(self.body)
for extension in cert.extensions:
for extension in self.parsed_cert.extensions:
value = extension.value
if isinstance(value, x509.BasicConstraints):
return_extensions['basic_constraints'] = value
return_extensions["basic_constraints"] = value
elif isinstance(value, x509.SubjectAlternativeName):
return_extensions['sub_alt_names']['names'] = value
return_extensions["sub_alt_names"]["names"] = value
elif isinstance(value, x509.ExtendedKeyUsage):
return_extensions['extended_key_usage'] = value
return_extensions["extended_key_usage"] = value
elif isinstance(value, x509.KeyUsage):
return_extensions['key_usage'] = value
return_extensions["key_usage"] = value
elif isinstance(value, x509.SubjectKeyIdentifier):
return_extensions['subject_key_identifier'] = {'include_ski': True}
return_extensions["subject_key_identifier"] = {"include_ski": True}
elif isinstance(value, x509.AuthorityInformationAccess):
return_extensions['certificate_info_access'] = {'include_aia': True}
return_extensions["certificate_info_access"] = {"include_aia": True}
elif isinstance(value, x509.AuthorityKeyIdentifier):
aki = {
'use_key_identifier': False,
'use_authority_cert': False
}
aki = {"use_key_identifier": False, "use_authority_cert": False}
if value.key_identifier:
aki['use_key_identifier'] = True
aki["use_key_identifier"] = True
if value.authority_cert_issuer:
aki['use_authority_cert'] = True
aki["use_authority_cert"] = True
return_extensions['authority_key_identifier'] = aki
return_extensions["authority_key_identifier"] = aki
elif isinstance(value, x509.CRLDistributionPoints):
return_extensions['crl_distribution_points'] = {'include_crl_dp': value}
return_extensions["crl_distribution_points"] = {
"include_crl_dp": value
}
# TODO: Not supporting custom OIDs yet. https://github.com/Netflix/lemur/issues/665
else:
current_app.logger.warning('Custom OIDs not yet supported for clone operation.')
current_app.logger.warning(
"Custom OIDs not yet supported for clone operation."
)
except InvalidCodepoint as e:
sentry.captureException()
current_app.logger.warning('Unable to parse extensions due to underscore in dns name')
current_app.logger.warning(
"Unable to parse extensions due to underscore in dns name"
)
except ValueError as e:
sentry.captureException()
current_app.logger.warning('Unable to parse')
current_app.logger.warning("Unable to parse")
current_app.logger.exception(e)
return return_extensions
@ -355,7 +439,7 @@ class Certificate(db.Model):
return "Certificate(name={name})".format(name=self.name)
@event.listens_for(Certificate.destinations, 'append')
@event.listens_for(Certificate.destinations, "append")
def update_destinations(target, value, initiator):
"""
Attempt to upload certificate to the new destination
@ -367,18 +451,36 @@ def update_destinations(target, value, initiator):
"""
destination_plugin = plugins.get(value.plugin_name)
status = FAILURE_METRIC_STATUS
if target.expired:
return
try:
if target.private_key:
destination_plugin.upload(target.name, target.body, target.private_key, target.chain, value.options)
if target.private_key or not destination_plugin.requires_key:
destination_plugin.upload(
target.name,
target.body,
target.private_key,
target.chain,
value.options,
)
status = SUCCESS_METRIC_STATUS
except Exception as e:
sentry.captureException()
raise
metrics.send('destination_upload', 'counter', 1,
metric_tags={'status': status, 'certificate': target.name, 'destination': value.label})
metrics.send(
"destination_upload",
"counter",
1,
metric_tags={
"status": status,
"certificate": target.name,
"destination": value.label,
},
)
@event.listens_for(Certificate.replaces, 'append')
@event.listens_for(Certificate.replaces, "append")
def update_replacement(target, value, initiator):
"""
When a certificate is marked as 'replaced' we should not notify.

View File

@ -6,19 +6,24 @@
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
"""
from flask import current_app
from marshmallow import fields, validate, validates_schema, post_load, pre_load
from flask_restful import inputs
from flask_restful.reqparse import RequestParser
from marshmallow import fields, validate, validates_schema, post_load, pre_load, post_dump
from marshmallow.exceptions import ValidationError
from lemur.authorities.schemas import AuthorityNestedOutputSchema
from lemur.common import validators, missing
from lemur.certificates import utils as cert_utils
from lemur.common import missing, utils, validators
from lemur.common.fields import ArrowDateTime, Hex
from lemur.common.schema import LemurInputSchema, LemurOutputSchema
from lemur.constants import CERTIFICATE_KEY_TYPES
from lemur.constants import CERTIFICATE_KEY_TYPES, CRLReason
from lemur.destinations.schemas import DestinationNestedOutputSchema
from lemur.dns_providers.schemas import DnsProvidersNestedOutputSchema
from lemur.domains.schemas import DomainNestedOutputSchema
from lemur.notifications import service as notification_service
from lemur.notifications.schemas import NotificationNestedOutputSchema
from lemur.policies.schemas import RotationPolicyNestedOutputSchema
from lemur.roles import service as roles_service
from lemur.roles.schemas import RoleNestedOutputSchema
from lemur.schemas import (
AssociatedAuthoritySchema,
@ -37,20 +42,26 @@ from lemur.users.schemas import UserNestedOutputSchema
class CertificateSchema(LemurInputSchema):
owner = fields.Email(required=True)
description = fields.String(missing='', allow_none=True)
description = fields.String(missing="", allow_none=True)
class CertificateCreationSchema(CertificateSchema):
@post_load
def default_notification(self, data):
if not data['notifications']:
data['notifications'] += notification_service.create_default_expiration_notifications(
"DEFAULT_{0}".format(data['owner'].split('@')[0].upper()),
[data['owner']],
if not data["notifications"]:
data[
"notifications"
] += notification_service.create_default_expiration_notifications(
"DEFAULT_{0}".format(data["owner"].split("@")[0].upper()),
[data["owner"]],
)
data['notifications'] += notification_service.create_default_expiration_notifications(
'DEFAULT_SECURITY',
current_app.config.get('LEMUR_SECURITY_TEAM_EMAIL')
data[
"notifications"
] += notification_service.create_default_expiration_notifications(
"DEFAULT_SECURITY",
current_app.config.get("LEMUR_SECURITY_TEAM_EMAIL"),
current_app.config.get("LEMUR_SECURITY_TEAM_EMAIL_INTERVALS", None),
)
return data
@ -60,40 +71,61 @@ class CertificateInputSchema(CertificateCreationSchema):
common_name = fields.String(required=True, validate=validators.common_name)
authority = fields.Nested(AssociatedAuthoritySchema, required=True)
validity_start = ArrowDateTime()
validity_end = ArrowDateTime()
validity_years = fields.Integer()
validity_start = ArrowDateTime(allow_none=True)
validity_end = ArrowDateTime(allow_none=True)
validity_years = fields.Integer(allow_none=True)
destinations = fields.Nested(AssociatedDestinationSchema, missing=[], many=True)
notifications = fields.Nested(AssociatedNotificationSchema, missing=[], many=True)
replaces = fields.Nested(AssociatedCertificateSchema, missing=[], many=True)
replacements = fields.Nested(AssociatedCertificateSchema, missing=[], many=True) # deprecated
replacements = fields.Nested(
AssociatedCertificateSchema, missing=[], many=True
) # deprecated
roles = fields.Nested(AssociatedRoleSchema, missing=[], many=True)
dns_provider = fields.Nested(AssociatedDnsProviderSchema, missing=None, allow_none=True, required=False)
dns_provider = fields.Nested(
AssociatedDnsProviderSchema, missing=None, allow_none=True, required=False
)
csr = fields.String(validate=validators.csr)
csr = fields.String(allow_none=True, validate=validators.csr)
key_type = fields.String(
validate=validate.OneOf(CERTIFICATE_KEY_TYPES),
missing='RSA2048')
validate=validate.OneOf(CERTIFICATE_KEY_TYPES), missing="ECCPRIME256V1"
)
notify = fields.Boolean(default=True)
rotation = fields.Boolean()
rotation_policy = fields.Nested(AssociatedRotationPolicySchema, missing={'name': 'default'}, default={'name': 'default'})
rotation_policy = fields.Nested(
AssociatedRotationPolicySchema,
missing={"name": "default"},
allow_none=True,
default={"name": "default"},
)
# certificate body fields
organizational_unit = fields.String(missing=lambda: current_app.config.get('LEMUR_DEFAULT_ORGANIZATIONAL_UNIT'))
organization = fields.String(missing=lambda: current_app.config.get('LEMUR_DEFAULT_ORGANIZATION'))
location = fields.String(missing=lambda: current_app.config.get('LEMUR_DEFAULT_LOCATION'))
country = fields.String(missing=lambda: current_app.config.get('LEMUR_DEFAULT_COUNTRY'))
state = fields.String(missing=lambda: current_app.config.get('LEMUR_DEFAULT_STATE'))
organizational_unit = fields.String(
missing=lambda: current_app.config.get("LEMUR_DEFAULT_ORGANIZATIONAL_UNIT")
)
organization = fields.String(
missing=lambda: current_app.config.get("LEMUR_DEFAULT_ORGANIZATION")
)
location = fields.String()
country = fields.String(
missing=lambda: current_app.config.get("LEMUR_DEFAULT_COUNTRY")
)
state = fields.String(missing=lambda: current_app.config.get("LEMUR_DEFAULT_STATE"))
extensions = fields.Nested(ExtensionSchema)
@validates_schema
def validate_authority(self, data):
if not data['authority'].active:
raise ValidationError("The authority is inactive.", ['authority'])
if 'authority' not in data:
raise ValidationError("Missing Authority.")
if isinstance(data["authority"], str):
raise ValidationError("Authority not found.")
if not data["authority"].active:
raise ValidationError("The authority is inactive.", ["authority"])
@validates_schema
def validate_dates(self, data):
@ -101,8 +133,35 @@ class CertificateInputSchema(CertificateCreationSchema):
@pre_load
def load_data(self, data):
if data.get('replacements'):
data['replaces'] = data['replacements'] # TODO remove when field is deprecated
if data.get("replacements"):
data["replaces"] = data[
"replacements"
] # TODO remove when field is deprecated
if data.get("csr"):
csr_sans = cert_utils.get_sans_from_csr(data["csr"])
if not data.get("extensions"):
data["extensions"] = {"subAltNames": {"names": []}}
elif not data["extensions"].get("subAltNames"):
data["extensions"]["subAltNames"] = {"names": []}
elif not data["extensions"]["subAltNames"].get("names"):
data["extensions"]["subAltNames"]["names"] = []
data["extensions"]["subAltNames"]["names"] = csr_sans
common_name = cert_utils.get_cn_from_csr(data["csr"])
if common_name:
data["common_name"] = common_name
key_type = cert_utils.get_key_type_from_csr(data["csr"])
if key_type:
data["key_type"] = key_type
# This code will be exercised for certificate import (without CSR)
if data.get("key_type") is None:
if data.get("body"):
data["key_type"] = utils.get_key_type_from_certificate(data["body"])
else:
data["key_type"] = "ECCPRIME256V1" # default value
return missing.convert_validity_years(data)
@ -115,26 +174,63 @@ class CertificateEditInputSchema(CertificateSchema):
destinations = fields.Nested(AssociatedDestinationSchema, missing=[], many=True)
notifications = fields.Nested(AssociatedNotificationSchema, missing=[], many=True)
replaces = fields.Nested(AssociatedCertificateSchema, missing=[], many=True)
replacements = fields.Nested(AssociatedCertificateSchema, missing=[], many=True) # deprecated
replacements = fields.Nested(
AssociatedCertificateSchema, missing=[], many=True
) # deprecated
roles = fields.Nested(AssociatedRoleSchema, missing=[], many=True)
@pre_load
def load_data(self, data):
if data.get('replacements'):
data['replaces'] = data['replacements'] # TODO remove when field is deprecated
if data.get("replacements"):
data["replaces"] = data[
"replacements"
] # TODO remove when field is deprecated
if data.get("owner"):
# Check if role already exists. This avoids adding duplicate role.
if data.get("roles") and any(r.get("name") == data["owner"] for r in data["roles"]):
return data
# Add required role
owner_role = roles_service.get_or_create(
data["owner"],
description=f"Auto generated role based on owner: {data['owner']}"
)
# Put role info in correct format using RoleNestedOutputSchema
owner_role_dict = RoleNestedOutputSchema().dump(owner_role).data
if data.get("roles"):
data["roles"].append(owner_role_dict)
else:
data["roles"] = [owner_role_dict]
return data
@post_load
def enforce_notifications(self, data):
"""
Ensures that when an owner changes, default notifications are added for the new owner.
Old owner notifications are retained unless explicitly removed.
Add default notification for current owner if none exist.
This ensures that the default notifications are added in the event of owner change.
Old owner notifications are retained unless explicitly removed later in the code path.
:param data:
:return:
"""
if data['owner']:
notification_name = "DEFAULT_{0}".format(data['owner'].split('@')[0].upper())
data['notifications'] += notification_service.create_default_expiration_notifications(notification_name, [data['owner']])
if data.get("owner"):
notification_name = "DEFAULT_{0}".format(
data["owner"].split("@")[0].upper()
)
# Even if one default role exists, return
# This allows a User to remove unwanted default notification for current owner
if any(n.label.startswith(notification_name) for n in data["notifications"]):
return data
data[
"notifications"
] += notification_service.create_default_expiration_notifications(
notification_name, [data["owner"]]
)
return data
@ -151,6 +247,7 @@ class CertificateNestedOutputSchema(LemurOutputSchema):
bits = fields.Integer()
body = fields.String()
chain = fields.String()
csr = fields.String()
active = fields.Boolean()
rotation = fields.Boolean()
@ -159,13 +256,13 @@ class CertificateNestedOutputSchema(LemurOutputSchema):
# Note aliasing is the first step in deprecating these fields.
cn = fields.String() # deprecated
common_name = fields.String(attribute='cn')
common_name = fields.String(attribute="cn")
not_after = fields.DateTime() # deprecated
validity_end = ArrowDateTime(attribute='not_after')
validity_end = ArrowDateTime(attribute="not_after")
not_before = fields.DateTime() # deprecated
validity_start = ArrowDateTime(attribute='not_before')
validity_start = ArrowDateTime(attribute="not_before")
issuer = fields.Nested(AuthorityNestedOutputSchema)
@ -182,32 +279,39 @@ class CertificateOutputSchema(LemurOutputSchema):
bits = fields.Integer()
body = fields.String()
chain = fields.String()
csr = fields.String()
deleted = fields.Boolean(default=False)
description = fields.String()
issuer = fields.String()
name = fields.String()
dns_provider_id = fields.Integer(required=False, allow_none=True)
date_created = ArrowDateTime()
resolved = fields.Boolean(required=False, allow_none=True)
resolved_cert_id = fields.Integer(required=False, allow_none=True)
rotation = fields.Boolean()
# Note aliasing is the first step in deprecating these fields.
notify = fields.Boolean()
active = fields.Boolean(attribute='notify')
active = fields.Boolean(attribute="notify")
has_private_key = fields.Boolean()
cn = fields.String()
common_name = fields.String(attribute='cn')
common_name = fields.String(attribute="cn")
distinguished_name = fields.String()
not_after = fields.DateTime()
validity_end = ArrowDateTime(attribute='not_after')
validity_end = ArrowDateTime(attribute="not_after")
not_before = fields.DateTime()
validity_start = ArrowDateTime(attribute='not_before')
validity_start = ArrowDateTime(attribute="not_before")
owner = fields.Email()
san = fields.Boolean()
serial = fields.String()
serial_hex = Hex(attribute='serial')
serial_hex = Hex(attribute="serial")
signing_algorithm = fields.String()
key_type = fields.String(allow_none=True)
status = fields.String()
user = fields.Nested(UserNestedOutputSchema)
@ -220,19 +324,60 @@ class CertificateOutputSchema(LemurOutputSchema):
notifications = fields.Nested(NotificationNestedOutputSchema, many=True)
replaces = fields.Nested(CertificateNestedOutputSchema, many=True)
authority = fields.Nested(AuthorityNestedOutputSchema)
dns_provider = fields.Nested(DnsProvidersNestedOutputSchema)
roles = fields.Nested(RoleNestedOutputSchema, many=True)
endpoints = fields.Nested(EndpointNestedOutputSchema, many=True, missing=[])
replaced_by = fields.Nested(CertificateNestedOutputSchema, many=True, attribute='replaced')
replaced_by = fields.Nested(
CertificateNestedOutputSchema, many=True, attribute="replaced"
)
rotation_policy = fields.Nested(RotationPolicyNestedOutputSchema)
country = fields.String()
location = fields.String()
state = fields.String()
organization = fields.String()
organizational_unit = fields.String()
@post_dump
def handle_subject_details(self, data):
subject_details = ["country", "state", "location", "organization", "organizational_unit"]
# Remove subject details if authority is CA/Browser Forum compliant. The code will use default set of values in that case.
# If CA/Browser Forum compliance of an authority is unknown (None), it is safe to fallback to default values. Thus below
# condition checks for 'not False' ==> 'True or None'
if data.get("authority"):
is_cab_compliant = data.get("authority").get("isCabCompliant")
if is_cab_compliant is not False:
for field in subject_details:
data.pop(field, None)
# Removing subject fields if None, else it complains in de-serialization
for field in subject_details:
if field in data and data[field] is None:
data.pop(field)
class CertificateShortOutputSchema(LemurOutputSchema):
id = fields.Integer()
name = fields.String()
owner = fields.Email()
notify = fields.Boolean()
authority = fields.Nested(AuthorityNestedOutputSchema)
issuer = fields.String()
cn = fields.String()
class CertificateUploadInputSchema(CertificateCreationSchema):
name = fields.String()
authority = fields.Nested(AssociatedAuthoritySchema, required=False)
notify = fields.Boolean(missing=True)
private_key = fields.String(validate=validators.private_key)
body = fields.String(required=True, validate=validators.public_certificate)
chain = fields.String(validate=validators.public_certificate, missing=None, allow_none=True) # TODO this could be multiple certificates
external_id = fields.String(missing=None, allow_none=True)
private_key = fields.String()
body = fields.String(required=True)
chain = fields.String(missing=None, allow_none=True)
csr = fields.String(required=False, allow_none=True, validate=validators.csr)
key_type = fields.String()
destinations = fields.Nested(AssociatedDestinationSchema, missing=[], many=True)
notifications = fields.Nested(AssociatedNotificationSchema, missing=[], many=True)
@ -241,9 +386,54 @@ class CertificateUploadInputSchema(CertificateCreationSchema):
@validates_schema
def keys(self, data):
if data.get('destinations'):
if not data.get('private_key'):
raise ValidationError('Destinations require private key.')
if data.get("destinations"):
if not data.get("private_key"):
raise ValidationError("Destinations require private key.")
@validates_schema
def validate_cert_private_key_chain(self, data):
cert = None
key = None
if data.get("body"):
try:
cert = utils.parse_certificate(data["body"])
except ValueError:
raise ValidationError(
"Public certificate presented is not valid.", field_names=["body"]
)
if data.get("private_key"):
try:
key = utils.parse_private_key(data["private_key"])
except ValueError:
raise ValidationError(
"Private key presented is not valid.", field_names=["private_key"]
)
if cert and key:
# Throws ValidationError
validators.verify_private_key_match(key, cert)
if data.get("chain"):
try:
chain = utils.parse_cert_chain(data["chain"])
except ValueError:
raise ValidationError(
"Invalid certificate in certificate chain.", field_names=["chain"]
)
# Throws ValidationError
validators.verify_cert_chain([cert] + chain)
@pre_load
def load_data(self, data):
if data.get("body"):
try:
data["key_type"] = utils.get_key_type_from_certificate(data["body"])
except ValueError:
raise ValidationError(
"Public certificate presented is not valid.", field_names=["body"]
)
class CertificateExportInputSchema(LemurInputSchema):
@ -251,23 +441,40 @@ class CertificateExportInputSchema(LemurInputSchema):
class CertificateNotificationOutputSchema(LemurOutputSchema):
id = fields.Integer()
description = fields.String()
issuer = fields.String()
name = fields.String()
owner = fields.Email()
user = fields.Nested(UserNestedOutputSchema)
validity_end = ArrowDateTime(attribute='not_after')
replaced_by = fields.Nested(CertificateNestedOutputSchema, many=True, attribute='replaced')
validity_end = ArrowDateTime(attribute="not_after")
replaced_by = fields.Nested(
CertificateNestedOutputSchema, many=True, attribute="replaced"
)
endpoints = fields.Nested(EndpointNestedOutputSchema, many=True, missing=[])
class CertificateRevokeSchema(LemurInputSchema):
comments = fields.String()
crl_reason = fields.String(validate=validate.OneOf(CRLReason.__members__), missing="unspecified")
certificates_list_request_parser = RequestParser()
certificates_list_request_parser.add_argument("short", type=inputs.boolean, default=False, location="args")
def certificates_list_output_schema_factory():
args = certificates_list_request_parser.parse_args()
if args["short"]:
return certificates_short_output_schema
else:
return certificates_output_schema
certificate_input_schema = CertificateInputSchema()
certificate_output_schema = CertificateOutputSchema()
certificates_output_schema = CertificateOutputSchema(many=True)
certificates_short_output_schema = CertificateShortOutputSchema(many=True)
certificate_upload_input_schema = CertificateUploadInputSchema()
certificate_export_input_schema = CertificateExportInputSchema()
certificate_edit_input_schema = CertificateEditInputSchema()

View File

@ -6,36 +6,38 @@
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
"""
import arrow
from flask import current_app
from sqlalchemy import func, or_, not_, cast, Integer
import re
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes, serialization
from flask import current_app
from sqlalchemy import func, or_, not_, cast, Integer
from sqlalchemy.sql.expression import false, true
from lemur import database
from lemur.extensions import metrics, signals
from lemur.plugins.base import plugins
from lemur.common.utils import generate_private_key, truthiness
from lemur.roles.models import Role
from lemur.domains.models import Domain
from lemur.authorities.models import Authority
from lemur.destinations.models import Destination
from lemur.certificates.models import Certificate
from lemur.certificates.schemas import CertificateOutputSchema, CertificateInputSchema
from lemur.common.utils import generate_private_key, truthiness
from lemur.destinations.models import Destination
from lemur.domains.models import Domain
from lemur.endpoints import service as endpoint_service
from lemur.extensions import metrics, sentry, signals
from lemur.models import certificate_associations
from lemur.notifications.models import Notification
from lemur.pending_certificates.models import PendingCertificate
from lemur.certificates.schemas import CertificateOutputSchema, CertificateInputSchema
from lemur.plugins.base import plugins
from lemur.roles import service as role_service
from lemur.roles.models import Role
csr_created = signals.signal('csr_created', "CSR generated")
csr_imported = signals.signal('csr_imported', "CSR imported from external source")
certificate_issued = signals.signal('certificate_issued', "Authority issued a certificate")
certificate_imported = signals.signal('certificate_imported', "Certificate imported from external source")
csr_created = signals.signal("csr_created", "CSR generated")
csr_imported = signals.signal("csr_imported", "CSR imported from external source")
certificate_issued = signals.signal(
"certificate_issued", "Authority issued a certificate"
)
certificate_imported = signals.signal(
"certificate_imported", "Certificate imported from external source"
)
def get(cert_id):
@ -55,12 +57,12 @@ def get_by_name(name):
:param name:
:return:
"""
return database.get(Certificate, name, field='name')
return database.get(Certificate, name, field="name")
def get_by_serial(serial):
"""
Retrieves certificate by it's Serial.
Retrieves certificate(s) by serial number.
:param serial:
:return:
"""
@ -70,6 +72,22 @@ def get_by_serial(serial):
return Certificate.query.filter(Certificate.serial == serial).all()
def get_by_attributes(conditions):
"""
Retrieves certificate(s) by conditions given in a hash of given key=>value pairs.
:param serial:
:return:
"""
# Ensure that each of the given conditions corresponds to actual columns
# if not, silently remove it
for attr in conditions.keys():
if attr not in Certificate.__table__.columns:
conditions.pop(attr)
query = database.session_query(Certificate)
return database.find_all(query, Certificate, conditions).all()
def delete(cert_id):
"""
Delete's a certificate.
@ -88,15 +106,95 @@ def get_all_certs():
return Certificate.query.all()
def get_all_pending_cleaning(source):
def get_all_valid_certs(authority_plugin_name):
"""
Retrieves all certificates that are available for cleaning.
Retrieves all valid (not expired & not revoked) certificates within Lemur, for the given authority plugin names
ignored if no authority_plugin_name provided.
Note that depending on the DB size retrieving all certificates might an expensive operation
:param source:
:return:
"""
return Certificate.query.filter(Certificate.sources.any(id=source.id))\
.filter(not_(Certificate.endpoints.any())).all()
if authority_plugin_name:
return (
Certificate.query.outerjoin(Authority, Authority.id == Certificate.authority_id).filter(
Certificate.not_after > arrow.now().format("YYYY-MM-DD")).filter(
Authority.plugin_name.in_(authority_plugin_name)).filter(Certificate.revoked.is_(False)).all()
)
else:
return (
Certificate.query.filter(Certificate.not_after > arrow.now().format("YYYY-MM-DD")).filter(
Certificate.revoked.is_(False)).all()
)
def get_all_pending_cleaning_expired(source):
"""
Retrieves all certificates that are available for cleaning. These are certificates which are expired and are not
attached to any endpoints.
:param source: the source to search for certificates
:return: list of pending certificates
"""
return (
Certificate.query.filter(Certificate.sources.any(id=source.id))
.filter(not_(Certificate.endpoints.any()))
.filter(Certificate.expired)
.all()
)
def get_all_certs_attached_to_endpoint_without_autorotate():
"""
Retrieves all certificates that are attached to an endpoint, but that do not have autorotate enabled.
:return: list of certificates attached to an endpoint without autorotate
"""
return (
Certificate.query.filter(Certificate.endpoints.any())
.filter(Certificate.rotation == false())
.filter(Certificate.revoked == false())
.filter(Certificate.not_after >= arrow.now())
.filter(not_(Certificate.replaced.any()))
.all() # noqa
)
def get_all_pending_cleaning_expiring_in_days(source, days_to_expire):
"""
Retrieves all certificates that are available for cleaning, not attached to endpoint,
and within X days from expiration.
:param days_to_expire: defines how many days till the certificate is expired
:param source: the source to search for certificates
:return: list of pending certificates
"""
expiration_window = arrow.now().shift(days=+days_to_expire).format("YYYY-MM-DD")
return (
Certificate.query.filter(Certificate.sources.any(id=source.id))
.filter(not_(Certificate.endpoints.any()))
.filter(Certificate.not_after < expiration_window)
.all()
)
def get_all_pending_cleaning_issued_since_days(source, days_since_issuance):
"""
Retrieves all certificates that are available for cleaning: not attached to endpoint, and X days since issuance.
:param days_since_issuance: defines how many days since the certificate is issued
:param source: the source to search for certificates
:return: list of pending certificates
"""
not_in_use_window = (
arrow.now().shift(days=-days_since_issuance).format("YYYY-MM-DD")
)
return (
Certificate.query.filter(Certificate.sources.any(id=source.id))
.filter(not_(Certificate.endpoints.any()))
.filter(Certificate.date_created > not_in_use_window)
.all()
)
def get_all_pending_reissue():
@ -109,9 +207,12 @@ def get_all_pending_reissue():
:return:
"""
return Certificate.query.filter(Certificate.rotation == True)\
.filter(not_(Certificate.replaced.any()))\
.filter(Certificate.in_rotation_window == True).all() # noqa
return (
Certificate.query.filter(Certificate.rotation == true())
.filter(not_(Certificate.replaced.any()))
.filter(Certificate.in_rotation_window == true())
.all()
) # noqa
def find_duplicates(cert):
@ -123,10 +224,12 @@ def find_duplicates(cert):
:param cert:
:return:
"""
if cert['chain']:
return Certificate.query.filter_by(body=cert['body'].strip(), chain=cert['chain'].strip()).all()
if cert["chain"]:
return Certificate.query.filter_by(
body=cert["body"].strip(), chain=cert["chain"].strip()
).all()
else:
return Certificate.query.filter_by(body=cert['body'].strip(), chain=None).all()
return Certificate.query.filter_by(body=cert["body"].strip(), chain=None).all()
def export(cert, export_plugin):
@ -138,8 +241,10 @@ def export(cert, export_plugin):
:param cert:
:return:
"""
plugin = plugins.get(export_plugin['slug'])
return plugin.export(cert.body, cert.chain, cert.private_key, export_plugin['pluginOptions'])
plugin = plugins.get(export_plugin["slug"])
return plugin.export(
cert.body, cert.chain, cert.private_key, export_plugin["pluginOptions"]
)
def update(cert_id, **kwargs):
@ -156,19 +261,33 @@ def update(cert_id, **kwargs):
return database.update(cert)
def create_certificate_roles(**kwargs):
# create an role for the owner and assign it
owner_role = role_service.get_by_name(kwargs['owner'])
def cleanup_owner_roles_notification(owner_name, kwargs):
kwargs["roles"] = [r for r in kwargs["roles"] if r.name != owner_name]
notification_prefix = f"DEFAULT_{owner_name.split('@')[0].upper()}"
kwargs["notifications"] = [n for n in kwargs["notifications"] if not n.label.startswith(notification_prefix)]
if not owner_role:
owner_role = role_service.create(
kwargs['owner'],
description="Auto generated role based on owner: {0}".format(kwargs['owner'])
def update_notify(cert, notify_flag):
"""
Toggle notification value which is a boolean
:param notify_flag: new notify value
:param cert: Certificate object to be updated
:return:
"""
cert.notify = notify_flag
return database.update(cert)
def create_certificate_roles(**kwargs):
# create a role for the owner and assign it
owner_role = role_service.get_or_create(
kwargs["owner"],
description=f"Auto generated role based on owner: {kwargs['owner']}"
)
# ensure that the authority's owner is also associated with the certificate
if kwargs.get('authority'):
authority_owner_role = role_service.get_by_name(kwargs['authority'].owner)
if kwargs.get("authority"):
authority_owner_role = role_service.get_by_name(kwargs["authority"].owner)
return [owner_role, authority_owner_role]
return [owner_role]
@ -180,16 +299,16 @@ def mint(**kwargs):
Support for multiple authorities is handled by individual plugins.
"""
authority = kwargs['authority']
authority = kwargs["authority"]
issuer = plugins.get(authority.plugin_name)
# allow the CSR to be specified by the user
if not kwargs.get('csr'):
if not kwargs.get("csr"):
csr, private_key = create_csr(**kwargs)
csr_created.send(authority=authority, csr=csr)
else:
csr = str(kwargs.get('csr'))
csr = str(kwargs.get("csr"))
private_key = None
csr_imported.send(authority=authority, csr=csr)
@ -210,8 +329,8 @@ def import_certificate(**kwargs):
:param kwargs:
"""
if not kwargs.get('owner'):
kwargs['owner'] = current_app.config.get('LEMUR_SECURITY_TEAM_EMAIL')[0]
if not kwargs.get("owner"):
kwargs["owner"] = current_app.config.get("LEMUR_SECURITY_TEAM_EMAIL")[0]
return upload(**kwargs)
@ -222,21 +341,16 @@ def upload(**kwargs):
"""
roles = create_certificate_roles(**kwargs)
if kwargs.get('roles'):
kwargs['roles'] += roles
if kwargs.get("roles"):
kwargs["roles"] += roles
else:
kwargs['roles'] = roles
if kwargs.get('private_key'):
private_key = kwargs['private_key']
if not isinstance(private_key, bytes):
kwargs['private_key'] = private_key.encode('utf-8')
kwargs["roles"] = roles
cert = Certificate(**kwargs)
cert.authority = kwargs.get("authority")
cert = database.create(cert)
kwargs['creator'].certificates.append(cert)
kwargs["creator"].certificates.append(cert)
cert = database.update(cert)
certificate_imported.send(certificate=cert, authority=cert.authority)
@ -247,34 +361,60 @@ def create(**kwargs):
"""
Creates a new certificate.
"""
try:
cert_body, private_key, cert_chain, external_id, csr = mint(**kwargs)
kwargs['body'] = cert_body
kwargs['private_key'] = private_key
kwargs['chain'] = cert_chain
kwargs['external_id'] = external_id
kwargs['csr'] = csr
except Exception:
log_data = {
"message": "Exception minting certificate",
"issuer": kwargs["authority"].name,
"cn": kwargs["common_name"],
}
current_app.logger.error(log_data, exc_info=True)
sentry.captureException()
raise
kwargs["body"] = cert_body
kwargs["private_key"] = private_key
kwargs["chain"] = cert_chain
kwargs["external_id"] = external_id
kwargs["csr"] = csr
roles = create_certificate_roles(**kwargs)
if kwargs.get('roles'):
kwargs['roles'] += roles
if kwargs.get("roles"):
kwargs["roles"] += roles
else:
kwargs['roles'] = roles
kwargs["roles"] = roles
if cert_body:
cert = Certificate(**kwargs)
kwargs['creator'].certificates.append(cert)
kwargs["creator"].certificates.append(cert)
else:
# ACME path
cert = PendingCertificate(**kwargs)
kwargs['creator'].pending_certificates.append(cert)
kwargs["creator"].pending_certificates.append(cert)
cert.authority = kwargs['authority']
cert.authority = kwargs["authority"]
database.commit()
if isinstance(cert, Certificate):
certificate_issued.send(certificate=cert, authority=cert.authority)
metrics.send('certificate_issued', 'counter', 1, metric_tags=dict(owner=cert.owner, issuer=cert.issuer))
metrics.send(
"certificate_issued",
"counter",
1,
metric_tags=dict(owner=cert.owner, issuer=cert.issuer),
)
if isinstance(cert, PendingCertificate):
# We need to refresh the pending certificate to avoid "Instance is not bound to a Session; "
# "attribute refresh operation cannot proceed"
pending_cert = database.session_query(PendingCertificate).get(cert.id)
from lemur.common.celery import fetch_acme_cert
if not current_app.config.get("ACME_DISABLE_AUTORESOLVE", False):
fetch_acme_cert.apply_async((pending_cert.id,), countdown=5)
return cert
@ -287,82 +427,167 @@ def render(args):
"""
query = database.session_query(Certificate)
time_range = args.pop('time_range')
destination_id = args.pop('destination_id')
notification_id = args.pop('notification_id', None)
show = args.pop('show')
show_expired = args.pop("showExpired")
if show_expired != 1:
one_month_old = (
arrow.now()
.shift(months=current_app.config.get("HIDE_EXPIRED_CERTS_AFTER_MONTHS", -1))
.format("YYYY-MM-DD")
)
query = query.filter(Certificate.not_after > one_month_old)
time_range = args.pop("time_range")
destination_id = args.pop("destination_id")
notification_id = args.pop("notification_id", None)
show = args.pop("show")
# owner = args.pop('owner')
# creator = args.pop('creator') # TODO we should enabling filtering by owner
filt = args.pop('filter')
filt = args.pop("filter")
if filt:
terms = filt.split(';')
term = '%{0}%'.format(terms[1])
terms = filt.split(";")
term = "%{0}%".format(terms[1])
# Exact matches for quotes. Only applies to name, issuer, and cn
if terms[1].startswith('"') and terms[1].endswith('"'):
term = terms[1][1:-1]
if 'issuer' in terms:
if "issuer" in terms:
# we can't rely on issuer being correct in the cert directly so we combine queries
sub_query = database.session_query(Authority.id)\
.filter(Authority.name.ilike(term))\
sub_query = (
database.session_query(Authority.id)
.filter(Authority.name.ilike(term))
.subquery()
)
query = query.filter(
or_(
Certificate.issuer.ilike(term),
Certificate.authority_id.in_(sub_query)
Certificate.authority_id.in_(sub_query),
)
)
elif 'destination' in terms:
query = query.filter(Certificate.destinations.any(Destination.id == terms[1]))
elif 'notify' in filt:
elif "destination" in terms:
query = query.filter(
Certificate.destinations.any(Destination.id == terms[1])
)
elif "notify" in filt:
query = query.filter(Certificate.notify == truthiness(terms[1]))
elif 'active' in filt:
elif "active" in filt:
query = query.filter(Certificate.active == truthiness(terms[1]))
elif 'cn' in terms:
elif "cn" in terms:
query = query.filter(
or_(
Certificate.cn.ilike(term),
Certificate.domains.any(Domain.name.ilike(term))
func.lower(Certificate.cn).like(term.lower()),
Certificate.id.in_(like_domain_query(term)),
)
)
elif 'id' in terms:
elif "id" in terms:
query = query.filter(Certificate.id == cast(terms[1], Integer))
elif 'name' in terms:
elif "name" in terms:
query = query.filter(
or_(
Certificate.name.ilike(term),
Certificate.domains.any(Domain.name.ilike(term)),
Certificate.cn.ilike(term),
func.lower(Certificate.name).like(term.lower()),
Certificate.id.in_(like_domain_query(term)),
func.lower(Certificate.cn).like(term.lower()),
)
)
elif "fixedName" in terms:
# only what matches the fixed name directly if a fixedname is provided
query = query.filter(Certificate.name == terms[1])
else:
query = database.filter(query, Certificate, terms)
if show:
sub_query = database.session_query(Role.name).filter(Role.user_id == args['user'].id).subquery()
sub_query = (
database.session_query(Role.name)
.filter(Role.user_id == args["user"].id)
.subquery()
)
query = query.filter(
or_(
Certificate.user_id == args['user'].id,
Certificate.owner.in_(sub_query)
Certificate.user_id == args["user"].id, Certificate.owner.in_(sub_query)
)
)
if destination_id:
query = query.filter(Certificate.destinations.any(Destination.id == destination_id))
query = query.filter(
Certificate.destinations.any(Destination.id == destination_id)
)
if notification_id:
query = query.filter(Certificate.notifications.any(Notification.id == notification_id))
query = query.filter(
Certificate.notifications.any(Notification.id == notification_id)
)
if time_range:
to = arrow.now().replace(weeks=+time_range).format('YYYY-MM-DD')
now = arrow.now().format('YYYY-MM-DD')
query = query.filter(Certificate.not_after <= to).filter(Certificate.not_after >= now)
to = arrow.now().shift(weeks=+time_range).format("YYYY-MM-DD")
now = arrow.now().format("YYYY-MM-DD")
query = query.filter(Certificate.not_after <= to).filter(
Certificate.not_after >= now
)
return database.sort_and_page(query, Certificate, args)
if current_app.config.get("ALLOW_CERT_DELETION", False):
query = query.filter(Certificate.deleted == false())
result = database.sort_and_page(query, Certificate, args)
return result
def like_domain_query(term):
domain_query = database.session_query(Domain.id)
domain_query = domain_query.filter(func.lower(Domain.name).like(term.lower()))
assoc_query = database.session_query(certificate_associations.c.certificate_id)
assoc_query = assoc_query.filter(certificate_associations.c.domain_id.in_(domain_query))
return assoc_query
def query_name(certificate_name, args):
"""
Helper function that queries for a certificate by name
:param args:
:return:
"""
query = database.session_query(Certificate)
query = query.filter(Certificate.name == certificate_name)
result = database.sort_and_page(query, Certificate, args)
return result
def query_common_name(common_name, args):
"""
Helper function that queries for not expired certificates by common name (and owner)
:param common_name:
:param args:
:return:
"""
owner = args.pop("owner")
page = args.pop("page")
count = args.pop("count")
paginate = page and count
query = database.session_query(Certificate) if paginate else Certificate.query
# only not expired certificates
current_time = arrow.utcnow()
query = query.filter(Certificate.not_after >= current_time.format("YYYY-MM-DD"))\
.filter(not_(Certificate.revoked))\
.filter(not_(Certificate.replaced.any())) # ignore rotated certificates to avoid duplicates
if owner:
query = query.filter(Certificate.owner.ilike(owner))
if common_name != "%":
# if common_name is a wildcard ('%'), no need to include it in the query
query = query.filter(Certificate.cn.ilike(common_name))
if paginate:
return database.paginate(query, page, count)
return query.all()
def create_csr(**csr_config):
@ -372,65 +597,77 @@ def create_csr(**csr_config):
:param csr_config:
"""
private_key = generate_private_key(csr_config.get('key_type'))
private_key = generate_private_key(csr_config.get("key_type"))
builder = x509.CertificateSigningRequestBuilder()
name_list = [x509.NameAttribute(x509.OID_COMMON_NAME, csr_config['common_name'])]
if current_app.config.get('LEMUR_OWNER_EMAIL_IN_SUBJECT', True):
name_list.append(x509.NameAttribute(x509.OID_EMAIL_ADDRESS, csr_config['owner']))
if 'organization' in csr_config and csr_config['organization'].strip():
name_list.append(x509.NameAttribute(x509.OID_ORGANIZATION_NAME, csr_config['organization']))
if 'organizational_unit' in csr_config and csr_config['organizational_unit'].strip():
name_list.append(x509.NameAttribute(x509.OID_ORGANIZATIONAL_UNIT_NAME, csr_config['organizational_unit']))
if 'country' in csr_config and csr_config['country'].strip():
name_list.append(x509.NameAttribute(x509.OID_COUNTRY_NAME, csr_config['country']))
if 'state' in csr_config and csr_config['state'].strip():
name_list.append(x509.NameAttribute(x509.OID_STATE_OR_PROVINCE_NAME, csr_config['state']))
if 'location' in csr_config and csr_config['location'].strip():
name_list.append(x509.NameAttribute(x509.OID_LOCALITY_NAME, csr_config['location']))
name_list = [x509.NameAttribute(x509.OID_COMMON_NAME, csr_config["common_name"])]
if current_app.config.get("LEMUR_OWNER_EMAIL_IN_SUBJECT", True):
name_list.append(
x509.NameAttribute(x509.OID_EMAIL_ADDRESS, csr_config["owner"])
)
if "organization" in csr_config and csr_config["organization"].strip():
name_list.append(
x509.NameAttribute(x509.OID_ORGANIZATION_NAME, csr_config["organization"])
)
if (
"organizational_unit" in csr_config
and csr_config["organizational_unit"].strip()
):
name_list.append(
x509.NameAttribute(
x509.OID_ORGANIZATIONAL_UNIT_NAME, csr_config["organizational_unit"]
)
)
if "country" in csr_config and csr_config["country"].strip():
name_list.append(
x509.NameAttribute(x509.OID_COUNTRY_NAME, csr_config["country"])
)
if "state" in csr_config and csr_config["state"].strip():
name_list.append(
x509.NameAttribute(x509.OID_STATE_OR_PROVINCE_NAME, csr_config["state"])
)
if "location" in csr_config and csr_config["location"].strip():
name_list.append(
x509.NameAttribute(x509.OID_LOCALITY_NAME, csr_config["location"])
)
builder = builder.subject_name(x509.Name(name_list))
extensions = csr_config.get('extensions', {})
critical_extensions = ['basic_constraints', 'sub_alt_names', 'key_usage']
noncritical_extensions = ['extended_key_usage']
extensions = csr_config.get("extensions", {})
critical_extensions = ["basic_constraints", "sub_alt_names", "key_usage"]
noncritical_extensions = ["extended_key_usage"]
for k, v in extensions.items():
if v:
if k in critical_extensions:
current_app.logger.debug('Adding Critical Extension: {0} {1}'.format(k, v))
if k == 'sub_alt_names':
if v['names']:
builder = builder.add_extension(v['names'], critical=True)
current_app.logger.debug(
"Adding Critical Extension: {0} {1}".format(k, v)
)
if k == "sub_alt_names":
if v["names"]:
builder = builder.add_extension(v["names"], critical=True)
else:
builder = builder.add_extension(v, critical=True)
if k in noncritical_extensions:
current_app.logger.debug('Adding Extension: {0} {1}'.format(k, v))
current_app.logger.debug("Adding Extension: {0} {1}".format(k, v))
builder = builder.add_extension(v, critical=False)
ski = extensions.get('subject_key_identifier', {})
if ski.get('include_ski', False):
ski = extensions.get("subject_key_identifier", {})
if ski.get("include_ski", False):
builder = builder.add_extension(
x509.SubjectKeyIdentifier.from_public_key(private_key.public_key()),
critical=False
critical=False,
)
request = builder.sign(
private_key, hashes.SHA256(), default_backend()
)
request = builder.sign(private_key, hashes.SHA256(), default_backend())
# serialize our private key and CSR
private_key = private_key.private_bytes(
encoding=serialization.Encoding.PEM,
format=serialization.PrivateFormat.TraditionalOpenSSL, # would like to use PKCS8 but AWS ELBs don't like it
encryption_algorithm=serialization.NoEncryption()
)
encryption_algorithm=serialization.NoEncryption(),
).decode("utf-8")
if isinstance(private_key, bytes):
private_key = private_key.decode('utf-8')
csr = request.public_bytes(
encoding=serialization.Encoding.PEM
).decode('utf-8')
csr = request.public_bytes(encoding=serialization.Encoding.PEM).decode("utf-8")
return csr, private_key
@ -442,16 +679,19 @@ def stats(**kwargs):
:param kwargs:
:return:
"""
if kwargs.get('metric') == 'not_after':
if kwargs.get("metric") == "not_after":
start = arrow.utcnow()
end = start.replace(weeks=+32)
items = database.db.session.query(Certificate.issuer, func.count(Certificate.id))\
.group_by(Certificate.issuer)\
.filter(Certificate.not_after <= end.format('YYYY-MM-DD')) \
.filter(Certificate.not_after >= start.format('YYYY-MM-DD')).all()
end = start.shift(weeks=+32)
items = (
database.db.session.query(Certificate.issuer, func.count(Certificate.id))
.group_by(Certificate.issuer)
.filter(Certificate.not_after <= end.format("YYYY-MM-DD"))
.filter(Certificate.not_after >= start.format("YYYY-MM-DD"))
.all()
)
else:
attr = getattr(Certificate, kwargs.get('metric'))
attr = getattr(Certificate, kwargs.get("metric"))
query = database.db.session.query(attr, func.count(attr))
items = query.group_by(attr).all()
@ -462,7 +702,7 @@ def stats(**kwargs):
keys.append(key)
values.append(count)
return {'labels': keys, 'values': values}
return {"labels": keys, "values": values}
def get_account_number(arn):
@ -509,20 +749,24 @@ def get_certificate_primitives(certificate):
certificate via `create`.
"""
start, end = calculate_reissue_range(certificate.not_before, certificate.not_after)
data = CertificateInputSchema().load(CertificateOutputSchema().dump(certificate).data).data
ser = CertificateInputSchema().load(
CertificateOutputSchema().dump(certificate).data
)
assert not ser.errors, "Error re-serializing certificate: %s" % ser.errors
data = ser.data
# we can't quite tell if we are using a custom name, as this is an automated process (typically)
# we will rely on the Lemur generated name
data.pop('name', None)
data.pop("name", None)
# TODO this can be removed once we migrate away from cn
data['cn'] = data['common_name']
data["cn"] = data["common_name"]
# needed until we move off not_*
data['not_before'] = start
data['not_after'] = end
data['validity_start'] = start
data['validity_end'] = end
data["not_before"] = start
data["not_after"] = end
data["validity_start"] = start
data["validity_end"] = end
return data
@ -536,15 +780,115 @@ def reissue_certificate(certificate, replace=None, user=None):
"""
primitives = get_certificate_primitives(certificate)
if primitives.get("csr"):
# We do not want to re-use the CSR when creating a certificate because this defeats the purpose of rotation.
del primitives["csr"]
if not user:
primitives['creator'] = certificate.user
primitives["creator"] = certificate.user
else:
primitives['creator'] = user
primitives["creator"] = user
if replace:
primitives['replaces'] = [certificate]
primitives["replaces"] = [certificate]
# Modify description to include the certificate ID being reissued and mention that this is created by Lemur
# as part of reissue
reissue_message_prefix = "Reissued by Lemur for cert ID "
reissue_message = re.compile(f"{reissue_message_prefix}([0-9]+)")
if primitives["description"]:
match = reissue_message.search(primitives["description"])
if match:
primitives["description"] = primitives["description"].replace(match.group(1), str(certificate.id))
else:
primitives["description"] = f"{reissue_message_prefix}{certificate.id}, {primitives['description']}"
else:
primitives["description"] = f"{reissue_message_prefix}{certificate.id}"
# Rotate the certificate to ECCPRIME256V1 if cert owner is present in the configured list
# This is a temporary change intending to rotate certificates to ECC, if opted in by certificate owners
# Unless identified a use case, this will be removed in mid-Q2 2021
ecc_reissue_owner_list = current_app.config.get("ROTATE_TO_ECC_OWNER_LIST", [])
ecc_reissue_exclude_cn_list = current_app.config.get("ECC_NON_COMPATIBLE_COMMON_NAMES", [])
if (certificate.owner in ecc_reissue_owner_list) and (certificate.cn not in ecc_reissue_exclude_cn_list):
primitives["key_type"] = "ECCPRIME256V1"
new_cert = create(**primitives)
return new_cert
def is_attached_to_endpoint(certificate_name, endpoint_name):
"""
Find if given certificate is attached to the endpoint. Both, certificate and endpoint, are identified by name.
This method talks to elb and finds the real time information.
:param certificate_name:
:param endpoint_name:
:return: True if certificate is attached to the given endpoint, False otherwise
"""
endpoint = endpoint_service.get_by_name(endpoint_name)
attached_certificates = endpoint.source.plugin.get_endpoint_certificate_names(endpoint)
return certificate_name in attached_certificates
def remove_from_destination(certificate, destination):
"""
Remove the certificate from given destination if clean() is implemented
:param certificate:
:param destination:
:return:
"""
plugin = plugins.get(destination.plugin_name)
if not hasattr(plugin, "clean"):
info_text = f"Cannot clean certificate {certificate.name}, {destination.plugin_name} plugin does not implement 'clean()'"
current_app.logger.warning(info_text)
else:
plugin.clean(certificate=certificate, options=destination.options)
def revoke(certificate, reason):
plugin = plugins.get(certificate.authority.plugin_name)
plugin.revoke_certificate(certificate, reason)
# Perform cleanup after revoke
return cleanup_after_revoke(certificate)
def cleanup_after_revoke(certificate):
"""
Perform the needed cleanup for a revoked certificate. This includes -
1. Disabling notification
2. Disabling auto-rotation
3. Update certificate status to 'revoked'
4. Remove from AWS
:param certificate: Certificate object to modify and update in DB
:return: None
"""
certificate.notify = False
certificate.rotation = False
certificate.status = 'revoked'
error_message = ""
for destination in list(certificate.destinations):
try:
remove_from_destination(certificate, destination)
certificate.destinations.remove(destination)
except Exception as e:
# This cleanup is the best-effort since certificate is already revoked at this point.
# We will capture the exception and move on to the next destination
sentry.captureException()
error_message = error_message + f"Failed to remove destination: {destination.label}. {str(e)}. "
database.update(certificate)
return error_message
def get_issued_cert_count_for_authority(authority):
"""
Returns the count of certs issued by the specified authority.
:return:
"""
return database.db.session.query(Certificate).filter(Certificate.authority_id == authority.id).count()

View File

@ -0,0 +1,85 @@
"""
Utils to parse certificate data.
.. module: lemur.certificates.hooks
:platform: Unix
:copyright: (c) 2019 by Javier Ramos, see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Javier Ramos <javier.ramos@booking.com>
"""
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from marshmallow.exceptions import ValidationError
from cryptography.hazmat.primitives.asymmetric import rsa, ec
from lemur.common.utils import get_key_type_from_ec_curve
def get_sans_from_csr(data):
"""
Fetches SubjectAlternativeNames from CSR.
Works with any kind of SubjectAlternativeName
:param data: PEM-encoded string with CSR
:return: List of LemurAPI-compatible subAltNames
"""
sub_alt_names = []
try:
request = x509.load_pem_x509_csr(data.encode("utf-8"), default_backend())
except Exception:
raise ValidationError("CSR presented is not valid.")
try:
alt_names = request.extensions.get_extension_for_class(
x509.SubjectAlternativeName
)
for alt_name in alt_names.value:
sub_alt_names.append(
{"nameType": type(alt_name).__name__, "value": alt_name.value}
)
except x509.ExtensionNotFound:
pass
return sub_alt_names
def get_cn_from_csr(data):
"""
Fetches common name (CN) from CSR.
Works with any kind of SubjectAlternativeName
:param data: PEM-encoded string with CSR
:return: the common name
"""
try:
request = x509.load_pem_x509_csr(data.encode("utf-8"), default_backend())
except Exception:
raise ValidationError("CSR presented is not valid.")
common_name = request.subject.get_attributes_for_oid(x509.NameOID.COMMON_NAME)
return common_name[0].value
def get_key_type_from_csr(data):
"""
Fetches key_type from CSR.
Works with any kind of SubjectAlternativeName
:param data: PEM-encoded string with CSR
:return: key_type
"""
try:
request = x509.load_pem_x509_csr(data.encode("utf-8"), default_backend())
except Exception:
raise ValidationError("CSR presented is not valid.")
try:
if isinstance(request.public_key(), rsa.RSAPublicKey):
return "RSA{key_size}".format(
key_size=request.public_key().key_size
)
elif isinstance(request.public_key(), ec.EllipticCurvePublicKey):
return get_key_type_from_ec_curve(request.public_key().curve.name)
else:
raise Exception("Unsupported key type")
except NotImplemented:
raise NotImplementedError

View File

@ -7,6 +7,8 @@
"""
import requests
import subprocess
from flask import current_app
from lemur.extensions import sentry
from requests.exceptions import ConnectionError, InvalidSchema
from cryptography import x509
from cryptography.hazmat.backends import default_backend
@ -14,56 +16,88 @@ from cryptography.hazmat.backends import default_backend
from lemur.utils import mktempfile
from lemur.common.utils import parse_certificate
crl_cache = {}
def ocsp_verify(cert_path, issuer_chain_path):
def ocsp_verify(cert, cert_path, issuer_chain_path):
"""
Attempts to verify a certificate via OCSP. OCSP is a more modern version
of CRL in that it will query the OCSP URI in order to determine if the
certificate has been revoked
:param cert:
:param cert_path:
:param issuer_chain_path:
:return bool: True if certificate is valid, False otherwise
"""
command = ['openssl', 'x509', '-noout', '-ocsp_uri', '-in', cert_path]
command = ["openssl", "x509", "-noout", "-ocsp_uri", "-in", cert_path]
p1 = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
url, err = p1.communicate()
p2 = subprocess.Popen(['openssl', 'ocsp', '-issuer', issuer_chain_path,
'-cert', cert_path, "-url", url.strip()], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if not url:
current_app.logger.debug(
"No OCSP URL in certificate {}".format(cert.serial_number)
)
return None
p2 = subprocess.Popen(
[
"openssl",
"ocsp",
"-issuer",
issuer_chain_path,
"-cert",
cert_path,
"-url",
url.strip(),
],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
message, err = p2.communicate()
p_message = message.decode('utf-8')
p_message = message.decode("utf-8")
if 'error' in p_message or 'Error' in p_message:
if "error" in p_message or "Error" in p_message:
raise Exception("Got error when parsing OCSP url")
elif 'revoked' in p_message:
return
elif "revoked" in p_message:
current_app.logger.debug(
"OCSP reports certificate revoked: {}".format(cert.serial_number)
)
return False
elif 'good' not in p_message:
elif "good" not in p_message:
raise Exception("Did not receive a valid response")
return True
def crl_verify(cert_path):
def crl_verify(cert, cert_path):
"""
Attempts to verify a certificate using CRL.
:param cert:
:param cert_path:
:return: True if certificate is valid, False otherwise
:raise Exception: If certificate does not have CRL
"""
with open(cert_path, 'rt') as c:
cert = parse_certificate(c.read())
distribution_points = cert.extensions.get_extension_for_oid(x509.OID_CRL_DISTRIBUTION_POINTS).value
try:
distribution_points = cert.extensions.get_extension_for_oid(
x509.OID_CRL_DISTRIBUTION_POINTS
).value
except x509.ExtensionNotFound:
current_app.logger.debug(
"No CRLDP extension in certificate {}".format(cert.serial_number)
)
return None
for p in distribution_points:
point = p.full_name[0].value
if point not in crl_cache:
current_app.logger.debug("Retrieving CRL: {}".format(point))
try:
response = requests.get(point)
@ -75,20 +109,29 @@ def crl_verify(cert_path):
except ConnectionError:
raise Exception("Unable to retrieve CRL: {0}".format(point))
crl = x509.load_der_x509_crl(response.content, backend=default_backend())
crl_cache[point] = x509.load_der_x509_crl(
response.content, backend=default_backend()
)
else:
current_app.logger.debug("CRL point is cached {}".format(point))
for r in crl:
if cert.serial == r.serial_number:
for r in crl_cache[point]:
if cert.serial_number == r.serial_number:
try:
reason = r.extensions.get_extension_for_class(x509.CRLReason).value
# Handle "removeFromCRL" revoke reason as unrevoked; continue with the next distribution point.
# Per RFC 5280 section 6.3.3 (k): https://tools.ietf.org/html/rfc5280#section-6.3.3
# Handle "removeFromCRL" revoke reason as unrevoked;
# continue with the next distribution point.
# Per RFC 5280 section 6.3.3 (k):
# https://tools.ietf.org/html/rfc5280#section-6.3.3
if reason == x509.ReasonFlags.remove_from_crl:
break
except x509.ExtensionNotFound:
pass
return
current_app.logger.debug(
"CRL reports certificate " "revoked: {}".format(cert.serial_number)
)
return False
return True
@ -101,15 +144,33 @@ def verify(cert_path, issuer_chain_path):
:param issuer_chain_path:
:return: True if valid, False otherwise
"""
with open(cert_path, "rt") as c:
try:
cert = parse_certificate(c.read())
except ValueError as e:
current_app.logger.error(e)
return None
# OCSP is our main source of truth, in a lot of cases CRLs
# have been deprecated and are no longer updated
verify_result = None
try:
return ocsp_verify(cert_path, issuer_chain_path)
verify_result = ocsp_verify(cert, cert_path, issuer_chain_path)
except Exception as e:
sentry.captureException()
current_app.logger.exception(e)
if verify_result is None:
try:
return crl_verify(cert_path)
verify_result = crl_verify(cert, cert_path)
except Exception as e:
raise Exception("Failed to verify")
sentry.captureException()
current_app.logger.exception(e)
if verify_result is None:
current_app.logger.debug("Failed to verify {}".format(cert.serial_number))
return verify_result
def verify_string(cert_string, issuer_string):
@ -121,10 +182,10 @@ def verify_string(cert_string, issuer_string):
:return: True if valid, False otherwise
"""
with mktempfile() as cert_tmp:
with open(cert_tmp, 'w') as f:
with open(cert_tmp, "w") as f:
f.write(cert_string)
with mktempfile() as issuer_tmp:
with open(issuer_tmp, 'w') as f:
with open(issuer_tmp, "w") as f:
f.write(issuer_string)
status = verify(cert_tmp, issuer_tmp)
return status

View File

@ -8,8 +8,8 @@
import base64
from builtins import str
from flask import Blueprint, make_response, jsonify, g
from flask_restful import reqparse, Api
from flask import Blueprint, make_response, jsonify, g, current_app
from flask_restful import reqparse, Api, inputs
from lemur.common.schema import validate_schema
from lemur.common.utils import paginated_parser
@ -19,35 +19,141 @@ from lemur.auth.permissions import AuthorityPermission, CertificatePermission
from lemur.certificates import service
from lemur.certificates.models import Certificate
from lemur.plugins.base import plugins
from lemur.extensions import sentry
from lemur.certificates.schemas import (
certificate_input_schema,
certificate_output_schema,
certificate_upload_input_schema,
certificates_output_schema,
certificate_export_input_schema,
certificate_edit_input_schema
certificate_edit_input_schema,
certificates_list_output_schema_factory,
certificate_revoke_schema,
)
from lemur.roles import service as role_service
from lemur.logs import service as log_service
mod = Blueprint('certificates', __name__)
mod = Blueprint("certificates", __name__)
api = Api(mod)
class CertificatesList(AuthenticatedResource):
""" Defines the 'certificates' endpoint """
class CertificatesListValid(AuthenticatedResource):
""" Defines the 'certificates/valid' endpoint """
def __init__(self):
self.reqparse = reqparse.RequestParser()
super(CertificatesList, self).__init__()
super(CertificatesListValid, self).__init__()
@validate_schema(None, certificates_output_schema)
def get(self):
"""
.. http:get:: /certificates
.. http:get:: /certificates/valid/<query>
The current list of not-expired certificates for a given common name, and owner. The API offers
optional pagination. One can send page number(>=1) and desired count per page. The returned data
contains total number of certificates which can help in determining the last page. Pagination
will not be offered if page or count info is not sent or if it is zero.
**Example request**:
.. sourcecode:: http
GET /certificates/valid?filter=cn;*.test.example.net&owner=joe@example.com&page=1&count=20 HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
**Example response (with single cert to be concise)**:
.. sourcecode:: http
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
{
"items": [{
"status": null,
"cn": "*.test.example.net",
"chain": "",
"csr": "-----BEGIN CERTIFICATE REQUEST-----"
"authority": {
"active": true,
"owner": "secure@example.com",
"id": 1,
"description": "verisign test authority",
"name": "verisign"
},
"owner": "joe@example.com",
"serial": "82311058732025924142789179368889309156",
"id": 2288,
"issuer": "SymantecCorporation",
"dateCreated": "2016-06-03T06:09:42.133769+00:00",
"notBefore": "2016-06-03T00:00:00+00:00",
"notAfter": "2018-01-12T23:59:59+00:00",
"destinations": [],
"bits": 2048,
"body": "-----BEGIN CERTIFICATE-----...",
"description": null,
"deleted": null,
"notifications": [{
"id": 1
}],
"signingAlgorithm": "sha256",
"user": {
"username": "jane",
"active": true,
"email": "jane@example.com",
"id": 2
},
"active": true,
"domains": [{
"sensitive": false,
"id": 1090,
"name": "*.test.example.net"
}],
"replaces": [],
"replaced": [],
"name": "WILDCARD.test.example.net-SymantecCorporation-20160603-20180112",
"roles": [{
"id": 464,
"description": "This is a google group based role created by Lemur",
"name": "joe@example.com"
}],
"san": null
}],
"total": 1
}
:reqheader Authorization: OAuth token to authenticate
:statuscode 200: no error
:statuscode 403: unauthenticated
"""
# using non-paginated parser to ensure backward compatibility
self.reqparse.add_argument("filter", type=str, location="args")
self.reqparse.add_argument("owner", type=str, location="args")
self.reqparse.add_argument("count", type=int, location="args")
self.reqparse.add_argument("page", type=int, location="args")
args = self.reqparse.parse_args()
args["user"] = g.user
common_name = args.pop("filter").split(";")[1]
return service.query_common_name(common_name, args)
class CertificatesNameQuery(AuthenticatedResource):
""" Defines the 'certificates/name' endpoint """
def __init__(self):
self.reqparse = reqparse.RequestParser()
super(CertificatesNameQuery, self).__init__()
@validate_schema(None, certificates_output_schema)
def get(self, certificate_name):
"""
.. http:get:: /certificates/name/<query>
The current list of certificates
@ -55,7 +161,7 @@ class CertificatesList(AuthenticatedResource):
.. sourcecode:: http
GET /certificates HTTP/1.1
GET /certificates/name/WILDCARD.test.example.net-SymantecCorporation-20160603-20180112 HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
@ -72,6 +178,7 @@ class CertificatesList(AuthenticatedResource):
"status": null,
"cn": "*.test.example.net",
"chain": "",
"csr": "-----BEGIN CERTIFICATE REQUEST-----"
"authority": {
"active": true,
"owner": "secure@example.com",
@ -83,6 +190,7 @@ class CertificatesList(AuthenticatedResource):
"serial": "82311058732025924142789179368889309156",
"id": 2288,
"issuer": "SymantecCorporation",
"dateCreated": "2016-06-03T06:09:42.133769+00:00",
"notBefore": "2016-06-03T00:00:00+00:00",
"notAfter": "2018-01-12T23:59:59+00:00",
"destinations": [],
@ -130,16 +238,129 @@ class CertificatesList(AuthenticatedResource):
"""
parser = paginated_parser.copy()
parser.add_argument('timeRange', type=int, dest='time_range', location='args')
parser.add_argument('owner', type=bool, location='args')
parser.add_argument('id', type=str, location='args')
parser.add_argument('active', type=bool, location='args')
parser.add_argument('destinationId', type=int, dest="destination_id", location='args')
parser.add_argument('creator', type=str, location='args')
parser.add_argument('show', type=str, location='args')
parser.add_argument("timeRange", type=int, dest="time_range", location="args")
parser.add_argument("owner", type=inputs.boolean, location="args")
parser.add_argument("id", type=str, location="args")
parser.add_argument("active", type=inputs.boolean, location="args")
parser.add_argument(
"destinationId", type=int, dest="destination_id", location="args"
)
parser.add_argument("creator", type=str, location="args")
parser.add_argument("show", type=str, location="args")
args = parser.parse_args()
args['user'] = g.user
args["user"] = g.user
return service.query_name(certificate_name, args)
class CertificatesList(AuthenticatedResource):
""" Defines the 'certificates' endpoint """
def __init__(self):
self.reqparse = reqparse.RequestParser()
super(CertificatesList, self).__init__()
@validate_schema(None, certificates_list_output_schema_factory)
def get(self):
"""
.. http:get:: /certificates
The current list of certificates
**Example request**:
.. sourcecode:: http
GET /certificates HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
{
"items": [{
"status": null,
"cn": "*.test.example.net",
"chain": "",
"csr": "-----BEGIN CERTIFICATE REQUEST-----"
"authority": {
"active": true,
"owner": "secure@example.com",
"id": 1,
"description": "verisign test authority",
"name": "verisign"
},
"owner": "joe@example.com",
"serial": "82311058732025924142789179368889309156",
"id": 2288,
"issuer": "SymantecCorporation",
"dateCreated": "2016-06-03T06:09:42.133769+00:00",
"notBefore": "2016-06-03T00:00:00+00:00",
"notAfter": "2018-01-12T23:59:59+00:00",
"destinations": [],
"bits": 2048,
"body": "-----BEGIN CERTIFICATE-----...",
"description": null,
"deleted": null,
"notifications": [{
"id": 1
}],
"signingAlgorithm": "sha256",
"user": {
"username": "jane",
"active": true,
"email": "jane@example.com",
"id": 2
},
"active": true,
"domains": [{
"sensitive": false,
"id": 1090,
"name": "*.test.example.net"
}],
"replaces": [],
"replaced": [],
"name": "WILDCARD.test.example.net-SymantecCorporation-20160603-20180112",
"roles": [{
"id": 464,
"description": "This is a google group based role created by Lemur",
"name": "joe@example.com"
}],
"san": null
}],
"total": 1
}
:query sortBy: field to sort on
:query sortDir: asc or desc
:query page: int. default is 1
:query filter: key value pair format is k;v
:query count: count number. default is 10
:reqheader Authorization: OAuth token to authenticate
:statuscode 200: no error
:statuscode 403: unauthenticated
"""
parser = paginated_parser.copy()
parser.add_argument("timeRange", type=int, dest="time_range", location="args")
parser.add_argument("owner", type=inputs.boolean, location="args")
parser.add_argument("id", type=str, location="args")
parser.add_argument("active", type=inputs.boolean, location="args")
parser.add_argument(
"destinationId", type=int, dest="destination_id", location="args"
)
parser.add_argument("creator", type=str, location="args")
parser.add_argument("show", type=str, location="args")
parser.add_argument("showExpired", type=int, location="args")
args = parser.parse_args()
args["user"] = g.user
return service.render(args)
@validate_schema(certificate_input_schema, certificate_output_schema)
@ -156,6 +377,7 @@ class CertificatesList(AuthenticatedResource):
POST /certificates HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
Content-Type: application/json;charset=UTF-8
{
"owner": "secure@example.net",
@ -214,6 +436,7 @@ class CertificatesList(AuthenticatedResource):
"serial": "82311058732025924142789179368889309156",
"id": 2288,
"issuer": "SymantecCorporation",
"dateCreated": "2016-06-03T06:09:42.133769+00:00",
"notBefore": "2016-06-03T00:00:00+00:00",
"notAfter": "2018-01-12T23:59:59+00:00",
"destinations": [],
@ -256,24 +479,31 @@ class CertificatesList(AuthenticatedResource):
:statuscode 403: unauthenticated
"""
role = role_service.get_by_name(data['authority'].owner)
role = role_service.get_by_name(data["authority"].owner)
# all the authority role members should be allowed
roles = [x.name for x in data['authority'].roles]
roles = [x.name for x in data["authority"].roles]
# allow "owner" roles by team DL
roles.append(role)
authority_permission = AuthorityPermission(data['authority'].id, roles)
authority_permission = AuthorityPermission(data["authority"].id, roles)
if authority_permission.can():
data['creator'] = g.user
data["creator"] = g.user
cert = service.create(**data)
if isinstance(cert, Certificate):
# only log if created, not pending
log_service.create(g.user, 'create_cert', certificate=cert)
log_service.create(g.user, "create_cert", certificate=cert)
return cert
return dict(message="You are not authorized to use the authority: {0}".format(data['authority'].name)), 403
return (
dict(
message="You are not authorized to use the authority: {0}".format(
data["authority"].name
)
),
403,
)
class CertificatesUpload(AuthenticatedResource):
@ -297,12 +527,14 @@ class CertificatesUpload(AuthenticatedResource):
POST /certificates/upload HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
Content-Type: application/json;charset=UTF-8
{
"owner": "joe@example.com",
"body": "-----BEGIN CERTIFICATE-----...",
"chain": "-----BEGIN CERTIFICATE-----...",
"privateKey": "-----BEGIN RSA PRIVATE KEY-----..."
"csr": "-----BEGIN CERTIFICATE REQUEST-----..."
"destinations": [],
"notifications": [],
"replacements": [],
@ -334,6 +566,7 @@ class CertificatesUpload(AuthenticatedResource):
"serial": "82311058732025924142789179368889309156",
"id": 2288,
"issuer": "SymantecCorporation",
"dateCreated": "2016-06-03T06:09:42.133769+00:00",
"notBefore": "2016-06-03T00:00:00+00:00",
"notAfter": "2018-01-12T23:59:59+00:00",
"destinations": [],
@ -374,12 +607,14 @@ class CertificatesUpload(AuthenticatedResource):
:statuscode 200: no error
"""
data['creator'] = g.user
if data.get('destinations'):
if data.get('private_key'):
data["creator"] = g.user
if data.get("destinations"):
if data.get("private_key"):
return service.upload(**data)
else:
raise Exception("Private key must be provided in order to upload certificate to AWS")
raise Exception(
"Private key must be provided in order to upload certificate to AWS"
)
return service.upload(**data)
@ -391,10 +626,12 @@ class CertificatesStats(AuthenticatedResource):
super(CertificatesStats, self).__init__()
def get(self):
self.reqparse.add_argument('metric', type=str, location='args')
self.reqparse.add_argument('range', default=32, type=int, location='args')
self.reqparse.add_argument('destinationId', dest='destination_id', location='args')
self.reqparse.add_argument('active', type=str, default='true', location='args')
self.reqparse.add_argument("metric", type=str, location="args")
self.reqparse.add_argument("range", default=32, type=int, location="args")
self.reqparse.add_argument(
"destinationId", dest="destination_id", location="args"
)
self.reqparse.add_argument("active", type=str, default="true", location="args")
args = self.reqparse.parse_args()
@ -446,12 +683,12 @@ class CertificatePrivateKey(AuthenticatedResource):
permission = CertificatePermission(owner_role, [x.name for x in cert.roles])
if not permission.can():
return dict(message='You are not authorized to view this key'), 403
return dict(message="You are not authorized to view this key"), 403
log_service.create(g.current_user, 'key_view', certificate=cert)
log_service.create(g.current_user, "key_view", certificate=cert)
response = make_response(jsonify(key=cert.private_key), 200)
response.headers['cache-control'] = 'private, max-age=0, no-cache, no-store'
response.headers['pragma'] = 'no-cache'
response.headers["cache-control"] = "private, max-age=0, no-cache, no-store"
response.headers["pragma"] = "no-cache"
return response
@ -487,6 +724,7 @@ class Certificates(AuthenticatedResource):
"status": null,
"cn": "*.test.example.net",
"chain": "",
"csr": "-----BEGIN CERTIFICATE REQUEST-----"
"authority": {
"active": true,
"owner": "secure@example.com",
@ -498,6 +736,7 @@ class Certificates(AuthenticatedResource):
"serial": "82311058732025924142789179368889309156",
"id": 2288,
"issuer": "SymantecCorporation",
"dateCreated": "2016-06-03T06:09:42.133769+00:00",
"notBefore": "2016-06-03T00:00:00+00:00",
"notAfter": "2018-01-12T23:59:59+00:00",
"destinations": [],
@ -555,6 +794,7 @@ class Certificates(AuthenticatedResource):
PUT /certificates/1 HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
Content-Type: application/json;charset=UTF-8
{
"owner": "jimbob@example.com",
@ -587,6 +827,7 @@ class Certificates(AuthenticatedResource):
"serial": "82311058732025924142789179368889309156",
"id": 2288,
"issuer": "SymantecCorporation",
"dateCreated": "2016-06-03T06:09:42.133769+00:00",
"notBefore": "2016-06-03T00:00:00+00:00",
"notAfter": "2018-01-12T23:59:59+00:00",
"destinations": [],
@ -638,21 +879,204 @@ class Certificates(AuthenticatedResource):
permission = CertificatePermission(owner_role, [x.name for x in cert.roles])
if not permission.can():
return dict(message='You are not authorized to update this certificate'), 403
return (
dict(message="You are not authorized to update this certificate"),
403,
)
for destination in data['destinations']:
for destination in data["destinations"]:
if destination.plugin.requires_key:
if not cert.private_key:
return dict(
message='Unable to add destination: {0}. Certificate does not have required private key.'.format(
return (
dict(
message="Unable to add destination: {0}. Certificate does not have required private key.".format(
destination.label
)
), 400
),
400,
)
# if owner is changed, remove all notifications and roles associated with old owner
if cert.owner != data["owner"]:
service.cleanup_owner_roles_notification(cert.owner, data)
error_message = ""
# if destination is removed, cleanup the certificate from AWS
for destination in cert.destinations:
if destination not in data["destinations"]:
try:
service.remove_from_destination(cert, destination)
except Exception as e:
sentry.captureException()
# Add the removed destination back
data["destinations"].append(destination)
error_message = error_message + f"Failed to remove destination: {destination.label}. {str(e)}. "
# go ahead with DB update
cert = service.update(certificate_id, **data)
log_service.create(g.current_user, 'update_cert', certificate=cert)
log_service.create(g.current_user, "update_cert", certificate=cert)
if error_message:
return dict(message=f"Edit Successful except -\n\n {error_message}"), 400
return cert
@validate_schema(certificate_edit_input_schema, certificate_output_schema)
def post(self, certificate_id, data=None):
"""
.. http:post:: /certificates/1/update/notify
Update certificate notification
**Example request**:
.. sourcecode:: http
POST /certificates/1/update/notify HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
Content-Type: application/json;charset=UTF-8
{
"notify": false
}
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
{
"status": null,
"cn": "*.test.example.net",
"chain": "",
"authority": {
"active": true,
"owner": "secure@example.com",
"id": 1,
"description": "verisign test authority",
"name": "verisign"
},
"owner": "joe@example.com",
"serial": "82311058732025924142789179368889309156",
"id": 2288,
"issuer": "SymantecCorporation",
"dateCreated": "2016-06-03T06:09:42.133769+00:00",
"notBefore": "2016-06-03T00:00:00+00:00",
"notAfter": "2018-01-12T23:59:59+00:00",
"destinations": [],
"bits": 2048,
"body": "-----BEGIN CERTIFICATE-----...",
"description": null,
"deleted": null,
"notify": false,
"notifications": [{
"id": 1
}]
"signingAlgorithm": "sha256",
"user": {
"username": "jane",
"active": true,
"email": "jane@example.com",
"id": 2
},
"active": true,
"domains": [{
"sensitive": false,
"id": 1090,
"name": "*.test.example.net"
}],
"replaces": [],
"name": "WILDCARD.test.example.net-SymantecCorporation-20160603-20180112",
"roles": [{
"id": 464,
"description": "This is a google group based role created by Lemur",
"name": "joe@example.com"
}],
"rotation": true,
"rotationPolicy": {"name": "default"},
"san": null
}
:reqheader Authorization: OAuth token to authenticate
:statuscode 200: no error
:statuscode 403: unauthenticated
"""
cert = service.get(certificate_id)
if not cert:
return dict(message="Cannot find specified certificate"), 404
# allow creators
if g.current_user != cert.user:
owner_role = role_service.get_by_name(cert.owner)
permission = CertificatePermission(owner_role, [x.name for x in cert.roles])
if not permission.can():
return (
dict(message="You are not authorized to update this certificate"),
403,
)
cert = service.update_notify(cert, data.get("notify"))
log_service.create(g.current_user, "update_cert", certificate=cert)
return cert
def delete(self, certificate_id, data=None):
"""
.. http:delete:: /certificates/1
Delete a certificate
**Example request**:
.. sourcecode:: http
DELETE /certificates/1 HTTP/1.1
Host: example.com
**Example response**:
.. sourcecode:: http
HTTP/1.1 204 OK
:reqheader Authorization: OAuth token to authenticate
:statuscode 204: no error
:statuscode 403: unauthenticated
:statuscode 404: certificate not found
:statuscode 405: certificate deletion is disabled
"""
if not current_app.config.get("ALLOW_CERT_DELETION", False):
return dict(message="Certificate deletion is disabled"), 405
cert = service.get(certificate_id)
if not cert:
return dict(message="Cannot find specified certificate"), 404
if cert.deleted:
return dict(message="Certificate is already deleted"), 412
# allow creators
if g.current_user != cert.user:
owner_role = role_service.get_by_name(cert.owner)
permission = CertificatePermission(owner_role, [x.name for x in cert.roles])
if not permission.can():
return (
dict(message="You are not authorized to delete this certificate"),
403,
)
service.update(certificate_id, deleted=True)
log_service.create(g.current_user, "delete_cert", certificate=cert)
return "Certificate deleted", 204
class NotificationCertificatesList(AuthenticatedResource):
""" Defines the 'certificates' endpoint """
@ -689,6 +1113,7 @@ class NotificationCertificatesList(AuthenticatedResource):
"status": null,
"cn": "*.test.example.net",
"chain": "",
"csr": "-----BEGIN CERTIFICATE REQUEST-----"
"authority": {
"active": true,
"owner": "secure@example.com",
@ -700,6 +1125,7 @@ class NotificationCertificatesList(AuthenticatedResource):
"serial": "82311058732025924142789179368889309156",
"id": 2288,
"issuer": "SymantecCorporation",
"dateCreated": "2016-06-03T06:09:42.133769+00:00",
"notBefore": "2016-06-03T00:00:00+00:00",
"notAfter": "2018-01-12T23:59:59+00:00",
"destinations": [],
@ -749,17 +1175,20 @@ class NotificationCertificatesList(AuthenticatedResource):
"""
parser = paginated_parser.copy()
parser.add_argument('timeRange', type=int, dest='time_range', location='args')
parser.add_argument('owner', type=bool, location='args')
parser.add_argument('id', type=str, location='args')
parser.add_argument('active', type=bool, location='args')
parser.add_argument('destinationId', type=int, dest="destination_id", location='args')
parser.add_argument('creator', type=str, location='args')
parser.add_argument('show', type=str, location='args')
parser.add_argument("timeRange", type=int, dest="time_range", location="args")
parser.add_argument("owner", type=inputs.boolean, location="args")
parser.add_argument("id", type=str, location="args")
parser.add_argument("active", type=inputs.boolean, location="args")
parser.add_argument(
"destinationId", type=int, dest="destination_id", location="args"
)
parser.add_argument("creator", type=str, location="args")
parser.add_argument("show", type=str, location="args")
parser.add_argument("showExpired", type=int, location="args")
args = parser.parse_args()
args['notification_id'] = notification_id
args['user'] = g.current_user
args["notification_id"] = notification_id
args["user"] = g.current_user
return service.render(args)
@ -796,6 +1225,7 @@ class CertificatesReplacementsList(AuthenticatedResource):
"status": null,
"cn": "*.test.example.net",
"chain": "",
"csr": "-----BEGIN CERTIFICATE REQUEST-----",
"authority": {
"active": true,
"owner": "secure@example.com",
@ -807,6 +1237,7 @@ class CertificatesReplacementsList(AuthenticatedResource):
"serial": "82311058732025924142789179368889309156",
"id": 2288,
"issuer": "SymantecCorporation",
"dateCreated": "2016-06-03T06:09:42.133769+00:00",
"notBefore": "2016-06-03T00:00:00+00:00",
"notAfter": "2018-01-12T23:59:59+00:00",
"destinations": [],
@ -872,6 +1303,7 @@ class CertificateExport(AuthenticatedResource):
PUT /certificates/1/export HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
Content-Type: application/json;charset=UTF-8
{
"export": {
@ -930,30 +1362,48 @@ class CertificateExport(AuthenticatedResource):
if not cert:
return dict(message="Cannot find specified certificate"), 404
plugin = data['plugin']['plugin_object']
plugin = data["plugin"]["plugin_object"]
if plugin.requires_key:
if not cert.private_key:
return dict(
message='Unable to export certificate, plugin: {0} requires a private key but no key was found.'.format(
plugin.slug)), 400
return (
dict(
message="Unable to export certificate, plugin: {0} requires a private key but no key was found.".format(
plugin.slug
)
),
400,
)
else:
# allow creators
if g.current_user != cert.user:
owner_role = role_service.get_by_name(cert.owner)
permission = CertificatePermission(owner_role, [x.name for x in cert.roles])
permission = CertificatePermission(
owner_role, [x.name for x in cert.roles]
)
if not permission.can():
return dict(message='You are not authorized to export this certificate.'), 403
return (
dict(
message="You are not authorized to export this certificate."
),
403,
)
options = data['plugin']['plugin_options']
options = data["plugin"]["plugin_options"]
log_service.create(g.current_user, 'key_view', certificate=cert)
extension, passphrase, data = plugin.export(cert.body, cert.chain, cert.private_key, options)
log_service.create(g.current_user, "key_view", certificate=cert)
extension, passphrase, data = plugin.export(
cert.body, cert.chain, cert.private_key, options
)
# we take a hit in message size when b64 encoding
return dict(extension=extension, passphrase=passphrase, data=base64.b64encode(data).decode('utf-8'))
return dict(
extension=extension,
passphrase=passphrase,
data=base64.b64encode(data).decode("utf-8"),
)
class CertificateRevoke(AuthenticatedResource):
@ -961,7 +1411,7 @@ class CertificateRevoke(AuthenticatedResource):
self.reqparse = reqparse.RequestParser()
super(CertificateRevoke, self).__init__()
@validate_schema(None, None)
@validate_schema(certificate_revoke_schema, None)
def put(self, certificate_id, data=None):
"""
.. http:put:: /certificates/1/revoke
@ -975,6 +1425,12 @@ class CertificateRevoke(AuthenticatedResource):
POST /certificates/1/revoke HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
Content-Type: application/json;charset=UTF-8
{
"crlReason": "affiliationChanged",
"comments": "Additional details if any"
}
**Example response**:
@ -985,12 +1441,13 @@ class CertificateRevoke(AuthenticatedResource):
Content-Type: text/javascript
{
'id': 1
"id": 1
}
:reqheader Authorization: OAuth token to authenticate
:statuscode 200: no error
:statuscode 403: unauthenticated
:statuscode 403: unauthenticated or cert attached to LB
:statuscode 400: encountered error, more details in error message
"""
cert = service.get(certificate_id)
@ -1004,28 +1461,79 @@ class CertificateRevoke(AuthenticatedResource):
permission = CertificatePermission(owner_role, [x.name for x in cert.roles])
if not permission.can():
return dict(message='You are not authorized to revoke this certificate.'), 403
return (
dict(message="You are not authorized to revoke this certificate."),
403,
)
if not cert.external_id:
return dict(message='Cannot revoke certificate. No external id found.'), 400
return dict(message="Cannot revoke certificate. No external id found."), 400
if cert.endpoints:
return dict(message='Cannot revoke certificate. Endpoints are deployed with the given certificate.'), 403
for endpoint in cert.endpoints:
if service.is_attached_to_endpoint(cert.name, endpoint.name):
return (
dict(
message="Cannot revoke certificate. Endpoints are deployed with the given certificate."
),
403,
)
plugin = plugins.get(cert.authority.plugin_name)
plugin.revoke_certificate(cert, data)
log_service.create(g.current_user, 'revoke_cert', certificate=cert)
try:
error_message = service.revoke(cert, data)
log_service.create(g.current_user, "revoke_cert", certificate=cert)
if error_message:
return dict(message=f"Certificate (id:{cert.id}) is revoked - {error_message}"), 400
return dict(id=cert.id)
except NotImplementedError as ne:
return dict(message="Revoke is not implemented for issuer of this certificate"), 400
except Exception as e:
sentry.captureException()
return dict(message=f"Failed to revoke: {str(e)}"), 400
api.add_resource(CertificateRevoke, '/certificates/<int:certificate_id>/revoke', endpoint='revokeCertificate')
api.add_resource(CertificatesList, '/certificates', endpoint='certificates')
api.add_resource(Certificates, '/certificates/<int:certificate_id>', endpoint='certificate')
api.add_resource(CertificatesStats, '/certificates/stats', endpoint='certificateStats')
api.add_resource(CertificatesUpload, '/certificates/upload', endpoint='certificateUpload')
api.add_resource(CertificatePrivateKey, '/certificates/<int:certificate_id>/key', endpoint='privateKeyCertificates')
api.add_resource(CertificateExport, '/certificates/<int:certificate_id>/export', endpoint='exportCertificate')
api.add_resource(NotificationCertificatesList, '/notifications/<int:notification_id>/certificates',
endpoint='notificationCertificates')
api.add_resource(CertificatesReplacementsList, '/certificates/<int:certificate_id>/replacements',
endpoint='replacements')
api.add_resource(
CertificateRevoke,
"/certificates/<int:certificate_id>/revoke",
endpoint="revokeCertificate",
)
api.add_resource(
CertificatesNameQuery,
"/certificates/name/<string:certificate_name>",
endpoint="certificatesNameQuery",
)
api.add_resource(CertificatesList, "/certificates", endpoint="certificates")
api.add_resource(
CertificatesListValid, "/certificates/valid", endpoint="certificatesListValid"
)
api.add_resource(
Certificates, "/certificates/<int:certificate_id>", endpoint="certificate"
)
api.add_resource(
Certificates, "/certificates/<int:certificate_id>/update/notify", endpoint="certificateUpdateNotify"
)
api.add_resource(CertificatesStats, "/certificates/stats", endpoint="certificateStats")
api.add_resource(
CertificatesUpload, "/certificates/upload", endpoint="certificateUpload"
)
api.add_resource(
CertificatePrivateKey,
"/certificates/<int:certificate_id>/key",
endpoint="privateKeyCertificates",
)
api.add_resource(
CertificateExport,
"/certificates/<int:certificate_id>/export",
endpoint="exportCertificate",
)
api.add_resource(
NotificationCertificatesList,
"/notifications/<int:notification_id>/certificates",
endpoint="notificationCertificates",
)
api.add_resource(
CertificatesReplacementsList,
"/certificates/<int:certificate_id>/replacements",
endpoint="replacements",
)

955
lemur/common/celery.py Normal file
View File

@ -0,0 +1,955 @@
"""
This module controls defines celery tasks and their applicable schedules. The celery beat server and workers will start
when invoked.
When ran in development mode (LEMUR_CONFIG=<location of development configuration file. To run both the celery
beat scheduler and a worker simultaneously, and to have jobs kick off starting at the next minute, run the following
command: celery -A lemur.common.celery worker --loglevel=info -l DEBUG -B
"""
import copy
import sys
import time
from celery import Celery
from celery.app.task import Context
from celery.exceptions import SoftTimeLimitExceeded
from celery.signals import task_failure, task_received, task_revoked, task_success
from datetime import datetime, timezone, timedelta
from flask import current_app
from lemur.authorities.service import get as get_authority
from lemur.certificates import cli as cli_certificate
from lemur.common.redis import RedisHandler
from lemur.constants import ACME_ADDITIONAL_ATTEMPTS
from lemur.destinations import service as destinations_service
from lemur.dns_providers import cli as cli_dns_providers
from lemur.endpoints import cli as cli_endpoints
from lemur.extensions import metrics, sentry
from lemur.factory import create_app
from lemur.notifications import cli as cli_notification
from lemur.notifications.messaging import send_pending_failure_notification
from lemur.pending_certificates import service as pending_certificate_service
from lemur.plugins.base import plugins
from lemur.sources.cli import clean, sync, validate_sources
from lemur.sources.service import add_aws_destination_to_sources
if current_app:
flask_app = current_app
else:
flask_app = create_app()
red = RedisHandler().redis()
def make_celery(app):
celery = Celery(
app.import_name,
backend=app.config.get("CELERY_RESULT_BACKEND"),
broker=app.config.get("CELERY_BROKER_URL"),
)
celery.conf.update(app.config)
TaskBase = celery.Task
class ContextTask(TaskBase):
abstract = True
def __call__(self, *args, **kwargs):
with app.app_context():
return TaskBase.__call__(self, *args, **kwargs)
celery.Task = ContextTask
return celery
celery = make_celery(flask_app)
def is_task_active(fun, task_id, args):
from celery.task.control import inspect
if not args:
args = "()" # empty args
i = inspect()
active_tasks = i.active()
for _, tasks in active_tasks.items():
for task in tasks:
if task.get("id") == task_id:
continue
if task.get("name") == fun and task.get("args") == str(args):
return True
return False
def get_celery_request_tags(**kwargs):
request = kwargs.get("request")
sender_hostname = "unknown"
sender = kwargs.get("sender")
if sender:
try:
sender_hostname = sender.hostname
except AttributeError:
sender_hostname = vars(sender.request).get("origin", "unknown")
if request and not isinstance(
request, Context
): # unlike others, task_revoked sends a Context for `request`
task_name = request.name
task_id = request.id
receiver_hostname = request.hostname
else:
task_name = sender.name
task_id = sender.request.id
receiver_hostname = sender.request.hostname
tags = {
"task_name": task_name,
"task_id": task_id,
"sender_hostname": sender_hostname,
"receiver_hostname": receiver_hostname,
}
if kwargs.get("exception"):
tags["error"] = repr(kwargs["exception"])
return tags
@celery.task()
def report_celery_last_success_metrics():
"""
For each celery task, this will determine the number of seconds since it has last been successful.
Celery tasks should be emitting redis stats with a deterministic key (In our case, `f"{task}.last_success"`.
report_celery_last_success_metrics should be ran periodically to emit metrics on when a task was last successful.
Admins can then alert when tasks are not ran when intended. Admins should also alert when no metrics are emitted
from this function.
"""
function = f"{__name__}.{sys._getframe().f_code.co_name}"
task_id = None
if celery.current_task:
task_id = celery.current_task.request.id
log_data = {
"function": function,
"message": "recurrent task",
"task_id": task_id,
}
if task_id and is_task_active(function, task_id, None):
log_data["message"] = "Skipping task: Task is already active"
current_app.logger.debug(log_data)
return
current_time = int(time.time())
schedule = current_app.config.get("CELERYBEAT_SCHEDULE")
for _, t in schedule.items():
task = t.get("task")
last_success = int(red.get(f"{task}.last_success") or 0)
metrics.send(
f"{task}.time_since_last_success", "gauge", current_time - last_success
)
red.set(
f"{function}.last_success", int(time.time())
) # Alert if this metric is not seen
metrics.send(f"{function}.success", "counter", 1)
@task_received.connect
def report_number_pending_tasks(**kwargs):
"""
Report the number of pending tasks to our metrics broker every time a task is published. This metric can be used
for autoscaling workers.
https://docs.celeryproject.org/en/latest/userguide/signals.html#task-received
"""
with flask_app.app_context():
metrics.send(
"celery.new_pending_task",
"TIMER",
1,
metric_tags=get_celery_request_tags(**kwargs),
)
@task_success.connect
def report_successful_task(**kwargs):
"""
Report a generic success metric as tasks to our metrics broker every time a task finished correctly.
This metric can be used for autoscaling workers.
https://docs.celeryproject.org/en/latest/userguide/signals.html#task-success
"""
with flask_app.app_context():
tags = get_celery_request_tags(**kwargs)
red.set(f"{tags['task_name']}.last_success", int(time.time()))
metrics.send("celery.successful_task", "TIMER", 1, metric_tags=tags)
@task_failure.connect
def report_failed_task(**kwargs):
"""
Report a generic failure metric as tasks to our metrics broker every time a task fails.
This metric can be used for alerting.
https://docs.celeryproject.org/en/latest/userguide/signals.html#task-failure
"""
with flask_app.app_context():
log_data = {
"function": f"{__name__}.{sys._getframe().f_code.co_name}",
"Message": "Celery Task Failure",
}
# Add traceback if exception info is in the kwargs
einfo = kwargs.get("einfo")
if einfo:
log_data["traceback"] = einfo.traceback
error_tags = get_celery_request_tags(**kwargs)
log_data.update(error_tags)
current_app.logger.error(log_data)
metrics.send("celery.failed_task", "TIMER", 1, metric_tags=error_tags)
@task_revoked.connect
def report_revoked_task(**kwargs):
"""
Report a generic failure metric as tasks to our metrics broker every time a task is revoked.
This metric can be used for alerting.
https://docs.celeryproject.org/en/latest/userguide/signals.html#task-revoked
"""
with flask_app.app_context():
log_data = {
"function": f"{__name__}.{sys._getframe().f_code.co_name}",
"Message": "Celery Task Revoked",
}
error_tags = get_celery_request_tags(**kwargs)
log_data.update(error_tags)
current_app.logger.error(log_data)
metrics.send("celery.revoked_task", "TIMER", 1, metric_tags=error_tags)
@celery.task(soft_time_limit=600)
def fetch_acme_cert(id):
"""
Attempt to get the full certificate for the pending certificate listed.
Args:
id: an id of a PendingCertificate
"""
task_id = None
if celery.current_task:
task_id = celery.current_task.request.id
function = f"{__name__}.{sys._getframe().f_code.co_name}"
log_data = {
"function": function,
"message": "Resolving pending certificate {}".format(id),
"task_id": task_id,
"id": id,
}
current_app.logger.debug(log_data)
if task_id and is_task_active(log_data["function"], task_id, (id,)):
log_data["message"] = "Skipping task: Task is already active"
current_app.logger.debug(log_data)
return
pending_certs = pending_certificate_service.get_pending_certs([id])
new = 0
failed = 0
wrong_issuer = 0
acme_certs = []
# We only care about certs using the acme-issuer plugin
for cert in pending_certs:
cert_authority = get_authority(cert.authority_id)
if cert_authority.plugin_name == "acme-issuer":
acme_certs.append(cert)
else:
wrong_issuer += 1
authority = plugins.get("acme-issuer")
resolved_certs = authority.get_ordered_certificates(acme_certs)
for cert in resolved_certs:
real_cert = cert.get("cert")
# It's necessary to reload the pending cert due to detached instance: http://sqlalche.me/e/bhk3
pending_cert = pending_certificate_service.get(cert.get("pending_cert").id)
if not pending_cert or pending_cert.resolved:
# pending_cert is cleared or it was resolved by another process
log_data[
"message"
] = "Pending certificate doesn't exist anymore. Was it resolved by another process?"
current_app.logger.error(log_data)
continue
if real_cert:
# If a real certificate was returned from issuer, then create it in Lemur and mark
# the pending certificate as resolved
final_cert = pending_certificate_service.create_certificate(
pending_cert, real_cert, pending_cert.user
)
pending_certificate_service.update(
cert.get("pending_cert").id, resolved_cert_id=final_cert.id
)
pending_certificate_service.update(
cert.get("pending_cert").id, resolved=True
)
# add metrics to metrics extension
new += 1
else:
failed += 1
error_log = copy.deepcopy(log_data)
error_log["message"] = "Pending certificate creation failure"
error_log["pending_cert_id"] = pending_cert.id
error_log["last_error"] = cert.get("last_error")
error_log["cn"] = pending_cert.cn
if pending_cert.number_attempts > ACME_ADDITIONAL_ATTEMPTS:
error_log["message"] = "Deleting pending certificate"
send_pending_failure_notification(
pending_cert, notify_owner=pending_cert.notify
)
# Mark the pending cert as resolved
pending_certificate_service.update(
cert.get("pending_cert").id, resolved=True
)
else:
pending_certificate_service.increment_attempt(pending_cert)
pending_certificate_service.update(
cert.get("pending_cert").id, status=str(cert.get("last_error"))
)
# Add failed pending cert task back to queue
fetch_acme_cert.delay(id)
current_app.logger.error(error_log)
log_data["message"] = "Complete"
log_data["new"] = new
log_data["failed"] = failed
log_data["wrong_issuer"] = wrong_issuer
current_app.logger.debug(log_data)
metrics.send(f"{function}.resolved", "gauge", new)
metrics.send(f"{function}.failed", "gauge", failed)
metrics.send(f"{function}.wrong_issuer", "gauge", wrong_issuer)
print(
"[+] Certificates: New: {new} Failed: {failed} Not using ACME: {wrong_issuer}".format(
new=new, failed=failed, wrong_issuer=wrong_issuer
)
)
return log_data
@celery.task()
def fetch_all_pending_acme_certs():
"""Instantiate celery workers to resolve all pending Acme certificates"""
function = f"{__name__}.{sys._getframe().f_code.co_name}"
task_id = None
if celery.current_task:
task_id = celery.current_task.request.id
log_data = {
"function": function,
"message": "Starting job.",
"task_id": task_id,
}
if task_id and is_task_active(function, task_id, None):
log_data["message"] = "Skipping task: Task is already active"
current_app.logger.debug(log_data)
return
current_app.logger.debug(log_data)
pending_certs = pending_certificate_service.get_unresolved_pending_certs()
# We only care about certs using the acme-issuer plugin
for cert in pending_certs:
cert_authority = get_authority(cert.authority_id)
if cert_authority.plugin_name == "acme-issuer":
if datetime.now(timezone.utc) - cert.last_updated > timedelta(minutes=5):
log_data["message"] = "Triggering job for cert {}".format(cert.name)
log_data["cert_name"] = cert.name
log_data["cert_id"] = cert.id
current_app.logger.debug(log_data)
fetch_acme_cert.delay(cert.id)
metrics.send(f"{function}.success", "counter", 1)
return log_data
@celery.task()
def remove_old_acme_certs():
"""Prune old pending acme certificates from the database"""
function = f"{__name__}.{sys._getframe().f_code.co_name}"
task_id = None
if celery.current_task:
task_id = celery.current_task.request.id
log_data = {
"function": function,
"message": "Starting job.",
"task_id": task_id,
}
if task_id and is_task_active(function, task_id, None):
log_data["message"] = "Skipping task: Task is already active"
current_app.logger.debug(log_data)
return
pending_certs = pending_certificate_service.get_pending_certs("all")
# Delete pending certs more than a week old
for cert in pending_certs:
if datetime.now(timezone.utc) - cert.last_updated > timedelta(days=7):
log_data["pending_cert_id"] = cert.id
log_data["pending_cert_name"] = cert.name
log_data["message"] = "Deleting pending certificate"
current_app.logger.debug(log_data)
pending_certificate_service.delete(cert)
metrics.send(f"{function}.success", "counter", 1)
return log_data
@celery.task()
def clean_all_sources():
"""
This function will clean unused certificates from sources. This is a destructive operation and should only
be ran periodically. This function triggers one celery task per source.
"""
function = f"{__name__}.{sys._getframe().f_code.co_name}"
task_id = None
if celery.current_task:
task_id = celery.current_task.request.id
log_data = {
"function": function,
"message": "Creating celery task to clean source",
"task_id": task_id,
}
if task_id and is_task_active(function, task_id, None):
log_data["message"] = "Skipping task: Task is already active"
current_app.logger.debug(log_data)
return
sources = validate_sources("all")
for source in sources:
log_data["source"] = source.label
current_app.logger.debug(log_data)
clean_source.delay(source.label)
metrics.send(f"{function}.success", "counter", 1)
return log_data
@celery.task(soft_time_limit=3600)
def clean_source(source):
"""
This celery task will clean the specified source. This is a destructive operation that will delete unused
certificates from each source.
:param source:
:return:
"""
function = f"{__name__}.{sys._getframe().f_code.co_name}"
task_id = None
if celery.current_task:
task_id = celery.current_task.request.id
log_data = {
"function": function,
"message": "Cleaning source",
"source": source,
"task_id": task_id,
}
if task_id and is_task_active(function, task_id, (source,)):
log_data["message"] = "Skipping task: Task is already active"
current_app.logger.debug(log_data)
return
current_app.logger.debug(log_data)
try:
clean([source], True)
except SoftTimeLimitExceeded:
log_data["message"] = "Clean source: Time limit exceeded."
current_app.logger.error(log_data)
sentry.captureException()
metrics.send("celery.timeout", "counter", 1, metric_tags={"function": function})
return log_data
@celery.task()
def sync_all_sources():
"""
This function will sync certificates from all sources. This function triggers one celery task per source.
"""
function = f"{__name__}.{sys._getframe().f_code.co_name}"
task_id = None
if celery.current_task:
task_id = celery.current_task.request.id
log_data = {
"function": function,
"message": "creating celery task to sync source",
"task_id": task_id,
}
if task_id and is_task_active(function, task_id, None):
log_data["message"] = "Skipping task: Task is already active"
current_app.logger.debug(log_data)
return
sources = validate_sources("all")
for source in sources:
log_data["source"] = source.label
current_app.logger.debug(log_data)
sync_source.delay(source.label)
metrics.send(f"{function}.success", "counter", 1)
return log_data
@celery.task(soft_time_limit=7200)
def sync_source(source):
"""
This celery task will sync the specified source.
:param source:
:return:
"""
function = f"{__name__}.{sys._getframe().f_code.co_name}"
task_id = None
if celery.current_task:
task_id = celery.current_task.request.id
log_data = {
"function": function,
"message": "Syncing source",
"source": source,
"task_id": task_id,
}
if task_id and is_task_active(function, task_id, (source,)):
log_data["message"] = "Skipping task: Task is already active"
current_app.logger.debug(log_data)
return
current_app.logger.debug(log_data)
try:
sync([source])
metrics.send(
f"{function}.success", "counter", 1, metric_tags={"source": source}
)
except SoftTimeLimitExceeded:
log_data["message"] = "Error syncing source: Time limit exceeded."
current_app.logger.error(log_data)
sentry.captureException()
metrics.send(
"sync_source_timeout", "counter", 1, metric_tags={"source": source}
)
metrics.send("celery.timeout", "counter", 1, metric_tags={"function": function})
return
log_data["message"] = "Done syncing source"
current_app.logger.debug(log_data)
metrics.send(f"{function}.success", "counter", 1, metric_tags={"source": source})
return log_data
@celery.task()
def sync_source_destination():
"""
This celery task will sync destination and source, to make sure all new destinations are also present as source.
Some destinations do not qualify as sources, and hence should be excluded from being added as sources
We identify qualified destinations based on the sync_as_source attributed of the plugin.
The destination sync_as_source_name reveals the name of the suitable source-plugin.
We rely on account numbers to avoid duplicates.
"""
function = f"{__name__}.{sys._getframe().f_code.co_name}"
task_id = None
if celery.current_task:
task_id = celery.current_task.request.id
log_data = {
"function": function,
"message": "syncing AWS destinations and sources",
"task_id": task_id,
}
if task_id and is_task_active(function, task_id, None):
log_data["message"] = "Skipping task: Task is already active"
current_app.logger.debug(log_data)
return
current_app.logger.debug(log_data)
for dst in destinations_service.get_all():
if add_aws_destination_to_sources(dst):
log_data["message"] = "new source added"
log_data["source"] = dst.label
current_app.logger.debug(log_data)
log_data["message"] = "completed Syncing AWS destinations and sources"
current_app.logger.debug(log_data)
metrics.send(f"{function}.success", "counter", 1)
return log_data
@celery.task(soft_time_limit=3600)
def certificate_reissue():
"""
This celery task reissues certificates which are pending reissue
:return:
"""
function = f"{__name__}.{sys._getframe().f_code.co_name}"
task_id = None
if celery.current_task:
task_id = celery.current_task.request.id
log_data = {
"function": function,
"message": "reissuing certificates",
"task_id": task_id,
}
if task_id and is_task_active(function, task_id, None):
log_data["message"] = "Skipping task: Task is already active"
current_app.logger.debug(log_data)
return
current_app.logger.debug(log_data)
try:
cli_certificate.reissue(None, True)
except SoftTimeLimitExceeded:
log_data["message"] = "Certificate reissue: Time limit exceeded."
current_app.logger.error(log_data)
sentry.captureException()
metrics.send("celery.timeout", "counter", 1, metric_tags={"function": function})
return
log_data["message"] = "reissuance completed"
current_app.logger.debug(log_data)
metrics.send(f"{function}.success", "counter", 1)
return log_data
@celery.task(soft_time_limit=3600)
def certificate_rotate(**kwargs):
"""
This celery task rotates certificates which are reissued but having endpoints attached to the replaced cert
:return:
"""
function = f"{__name__}.{sys._getframe().f_code.co_name}"
task_id = None
if celery.current_task:
task_id = celery.current_task.request.id
region = kwargs.get("region")
log_data = {
"function": function,
"message": "rotating certificates",
"task_id": task_id,
}
if task_id and is_task_active(function, task_id, None):
log_data["message"] = "Skipping task: Task is already active"
current_app.logger.debug(log_data)
return
current_app.logger.debug(log_data)
try:
notify = current_app.config.get("ENABLE_ROTATION_NOTIFICATION", None)
if region:
log_data["region"] = region
cli_certificate.rotate_region(None, None, None, notify, True, region)
else:
cli_certificate.rotate(None, None, None, notify, True)
except SoftTimeLimitExceeded:
log_data["message"] = "Certificate rotate: Time limit exceeded."
current_app.logger.error(log_data)
sentry.captureException()
metrics.send("celery.timeout", "counter", 1, metric_tags={"function": function})
return
log_data["message"] = "rotation completed"
current_app.logger.debug(log_data)
metrics.send(f"{function}.success", "counter", 1)
return log_data
@celery.task(soft_time_limit=3600)
def endpoints_expire():
"""
This celery task removes all endpoints that have not been recently updated
:return:
"""
function = f"{__name__}.{sys._getframe().f_code.co_name}"
task_id = None
if celery.current_task:
task_id = celery.current_task.request.id
log_data = {
"function": function,
"message": "endpoints expire",
"task_id": task_id,
}
if task_id and is_task_active(function, task_id, None):
log_data["message"] = "Skipping task: Task is already active"
current_app.logger.debug(log_data)
return
current_app.logger.debug(log_data)
try:
cli_endpoints.expire(2) # Time in hours
except SoftTimeLimitExceeded:
log_data["message"] = "endpoint expire: Time limit exceeded."
current_app.logger.error(log_data)
sentry.captureException()
metrics.send("celery.timeout", "counter", 1, metric_tags={"function": function})
return
metrics.send(f"{function}.success", "counter", 1)
return log_data
@celery.task(soft_time_limit=600)
def get_all_zones():
"""
This celery syncs all zones from the available dns providers
:return:
"""
function = f"{__name__}.{sys._getframe().f_code.co_name}"
task_id = None
if celery.current_task:
task_id = celery.current_task.request.id
log_data = {
"function": function,
"message": "refresh all zones from available DNS providers",
"task_id": task_id,
}
if task_id and is_task_active(function, task_id, None):
log_data["message"] = "Skipping task: Task is already active"
current_app.logger.debug(log_data)
return
current_app.logger.debug(log_data)
try:
cli_dns_providers.get_all_zones()
except SoftTimeLimitExceeded:
log_data["message"] = "get all zones: Time limit exceeded."
current_app.logger.error(log_data)
sentry.captureException()
metrics.send("celery.timeout", "counter", 1, metric_tags={"function": function})
return
metrics.send(f"{function}.success", "counter", 1)
return log_data
@celery.task(soft_time_limit=3600)
def check_revoked():
"""
This celery task attempts to check if any certs are expired
:return:
"""
function = f"{__name__}.{sys._getframe().f_code.co_name}"
task_id = None
if celery.current_task:
task_id = celery.current_task.request.id
log_data = {
"function": function,
"message": "check if any valid certificate is revoked",
"task_id": task_id,
}
if task_id and is_task_active(function, task_id, None):
log_data["message"] = "Skipping task: Task is already active"
current_app.logger.debug(log_data)
return
current_app.logger.debug(log_data)
try:
cli_certificate.check_revoked()
except SoftTimeLimitExceeded:
log_data["message"] = "Checking revoked: Time limit exceeded."
current_app.logger.error(log_data)
sentry.captureException()
metrics.send("celery.timeout", "counter", 1, metric_tags={"function": function})
return
metrics.send(f"{function}.success", "counter", 1)
return log_data
@celery.task(soft_time_limit=3600)
def notify_expirations():
"""
This celery task notifies about expiring certs
:return:
"""
function = f"{__name__}.{sys._getframe().f_code.co_name}"
task_id = None
if celery.current_task:
task_id = celery.current_task.request.id
log_data = {
"function": function,
"message": "notify for cert expiration",
"task_id": task_id,
}
if task_id and is_task_active(function, task_id, None):
log_data["message"] = "Skipping task: Task is already active"
current_app.logger.debug(log_data)
return
current_app.logger.debug(log_data)
try:
cli_notification.expirations(
current_app.config.get("EXCLUDE_CN_FROM_NOTIFICATION", [])
)
except SoftTimeLimitExceeded:
log_data["message"] = "Notify expiring Time limit exceeded."
current_app.logger.error(log_data)
sentry.captureException()
metrics.send("celery.timeout", "counter", 1, metric_tags={"function": function})
return
metrics.send(f"{function}.success", "counter", 1)
return log_data
@celery.task(soft_time_limit=3600)
def notify_authority_expirations():
"""
This celery task notifies about expiring certificate authority certs
:return:
"""
function = f"{__name__}.{sys._getframe().f_code.co_name}"
task_id = None
if celery.current_task:
task_id = celery.current_task.request.id
log_data = {
"function": function,
"message": "notify for certificate authority cert expiration",
"task_id": task_id,
}
if task_id and is_task_active(function, task_id, None):
log_data["message"] = "Skipping task: Task is already active"
current_app.logger.debug(log_data)
return
current_app.logger.debug(log_data)
try:
cli_notification.authority_expirations()
except SoftTimeLimitExceeded:
log_data["message"] = "Notify expiring CA Time limit exceeded."
current_app.logger.error(log_data)
sentry.captureException()
metrics.send("celery.timeout", "counter", 1, metric_tags={"function": function})
return
metrics.send(f"{function}.success", "counter", 1)
return log_data
@celery.task(soft_time_limit=3600)
def send_security_expiration_summary():
"""
This celery task sends a summary about expiring certificates to the security team.
:return:
"""
function = f"{__name__}.{sys._getframe().f_code.co_name}"
task_id = None
if celery.current_task:
task_id = celery.current_task.request.id
log_data = {
"function": function,
"message": "send summary for certificate expiration",
"task_id": task_id,
}
if task_id and is_task_active(function, task_id, None):
log_data["message"] = "Skipping task: Task is already active"
current_app.logger.debug(log_data)
return
current_app.logger.debug(log_data)
try:
cli_notification.security_expiration_summary(current_app.config.get("EXCLUDE_CN_FROM_NOTIFICATION", []))
except SoftTimeLimitExceeded:
log_data["message"] = "Send summary for expiring certs Time limit exceeded."
current_app.logger.error(log_data)
sentry.captureException()
metrics.send("celery.timeout", "counter", 1, metric_tags={"function": function})
return
metrics.send(f"{function}.success", "counter", 1)
return log_data
@celery.task(soft_time_limit=3600)
def enable_autorotate_for_certs_attached_to_endpoint():
"""
This celery task automatically enables autorotation for unexpired certificates that are
attached to an endpoint but do not have autorotate enabled.
:return:
"""
function = f"{__name__}.{sys._getframe().f_code.co_name}"
task_id = None
if celery.current_task:
task_id = celery.current_task.request.id
log_data = {
"function": function,
"task_id": task_id,
"message": "Enabling autorotate to eligible certificates",
}
current_app.logger.debug(log_data)
cli_certificate.automatically_enable_autorotate()
metrics.send(f"{function}.success", "counter", 1)
return log_data
@celery.task(soft_time_limit=3600)
def deactivate_entrust_test_certificates():
"""
This celery task attempts to deactivate all not yet deactivated Entrust certificates, and should only run in TEST
:return:
"""
function = f"{__name__}.{sys._getframe().f_code.co_name}"
task_id = None
if celery.current_task:
task_id = celery.current_task.request.id
log_data = {
"function": function,
"message": "deactivate entrust certificates",
"task_id": task_id,
}
if task_id and is_task_active(function, task_id, None):
log_data["message"] = "Skipping task: Task is already active"
current_app.logger.debug(log_data)
return
current_app.logger.debug(log_data)
try:
cli_certificate.deactivate_entrust_certificates()
except SoftTimeLimitExceeded:
log_data["message"] = "Time limit exceeded."
current_app.logger.error(log_data)
sentry.captureException()
metrics.send("celery.timeout", "counter", 1, metric_tags={"function": function})
return
metrics.send(f"{function}.success", "counter", 1)
return log_data

View File

@ -2,23 +2,31 @@ import re
import unicodedata
from cryptography import x509
from cryptography.hazmat.primitives.serialization import Encoding
from flask import current_app
from lemur.common.utils import is_selfsigned
from lemur.extensions import sentry
from lemur.constants import SAN_NAMING_TEMPLATE, DEFAULT_NAMING_TEMPLATE
def text_to_slug(value):
"""Normalize a string to a "slug" value, stripping character accents and removing non-alphanum characters."""
def text_to_slug(value, joiner="-"):
"""
Normalize a string to a "slug" value, stripping character accents and removing non-alphanum characters.
A series of non-alphanumeric characters is replaced with the joiner character.
"""
# Strip all character accents: decompose Unicode characters and then drop combining chars.
value = ''.join(c for c in unicodedata.normalize('NFKD', value) if not unicodedata.combining(c))
value = "".join(
c for c in unicodedata.normalize("NFKD", value) if not unicodedata.combining(c)
)
# Replace all remaining non-alphanumeric characters with '-'. Multiple characters get collapsed into a single dash.
# Except, keep 'xn--' used in IDNA domain names as is.
value = re.sub(r'[^A-Za-z0-9.]+(?<!xn--)', '-', value)
# Replace all remaining non-alphanumeric characters with joiner string. Multiple characters get collapsed into a
# single joiner. Except, keep 'xn--' used in IDNA domain names as is.
value = re.sub(r"[^A-Za-z0-9.]+(?<!xn--)", joiner, value)
# '-' in the beginning or end of string looks ugly.
return value.strip('-')
return value.strip(joiner)
def certificate_name(common_name, issuer, not_before, not_after, san):
@ -43,12 +51,12 @@ def certificate_name(common_name, issuer, not_before, not_after, san):
temp = t.format(
subject=common_name,
issuer=issuer.replace(' ', ''),
not_before=not_before.strftime('%Y%m%d'),
not_after=not_after.strftime('%Y%m%d')
issuer=issuer.replace(" ", ""),
not_before=not_before.strftime("%Y%m%d"),
not_after=not_after.strftime("%Y%m%d"),
)
temp = temp.replace('*', "WILDCARD")
temp = temp.replace("*", "WILDCARD")
return text_to_slug(temp)
@ -64,12 +72,20 @@ def common_name(cert):
:return: Common name or None
"""
try:
return cert.subject.get_attributes_for_oid(
x509.OID_COMMON_NAME
)[0].value.strip()
subject_oid = cert.subject.get_attributes_for_oid(x509.OID_COMMON_NAME)
if len(subject_oid) > 0:
return subject_oid[0].value.strip()
return None
except Exception as e:
sentry.captureException()
current_app.logger.error("Unable to get common name! {0}".format(e))
current_app.logger.error(
{
"message": "Unable to get common name",
"error": e,
"public_key": cert.public_bytes(Encoding.PEM).decode("utf-8")
},
exc_info=True
)
def organization(cert):
@ -79,9 +95,11 @@ def organization(cert):
:return:
"""
try:
return cert.subject.get_attributes_for_oid(
x509.OID_ORGANIZATION_NAME
)[0].value.strip()
o = cert.subject.get_attributes_for_oid(x509.OID_ORGANIZATION_NAME)
if not o:
return None
return o[0].value.strip()
except Exception as e:
sentry.captureException()
current_app.logger.error("Unable to get organization! {0}".format(e))
@ -94,9 +112,11 @@ def organizational_unit(cert):
:return:
"""
try:
return cert.subject.get_attributes_for_oid(
x509.OID_ORGANIZATIONAL_UNIT_NAME
)[0].value.strip()
ou = cert.subject.get_attributes_for_oid(x509.OID_ORGANIZATIONAL_UNIT_NAME)
if not ou:
return None
return ou[0].value.strip()
except Exception as e:
sentry.captureException()
current_app.logger.error("Unable to get organizational unit! {0}".format(e))
@ -109,9 +129,11 @@ def country(cert):
:return:
"""
try:
return cert.subject.get_attributes_for_oid(
x509.OID_COUNTRY_NAME
)[0].value.strip()
c = cert.subject.get_attributes_for_oid(x509.OID_COUNTRY_NAME)
if not c:
return None
return c[0].value.strip()
except Exception as e:
sentry.captureException()
current_app.logger.error("Unable to get country! {0}".format(e))
@ -124,9 +146,11 @@ def state(cert):
:return:
"""
try:
return cert.subject.get_attributes_for_oid(
x509.OID_STATE_OR_PROVINCE_NAME
)[0].value.strip()
s = cert.subject.get_attributes_for_oid(x509.OID_STATE_OR_PROVINCE_NAME)
if not s:
return None
return s[0].value.strip()
except Exception as e:
sentry.captureException()
current_app.logger.error("Unable to get state! {0}".format(e))
@ -139,9 +163,11 @@ def location(cert):
:return:
"""
try:
return cert.subject.get_attributes_for_oid(
x509.OID_LOCALITY_NAME
)[0].value.strip()
loc = cert.subject.get_attributes_for_oid(x509.OID_LOCALITY_NAME)
if not loc:
return None
return loc[0].value.strip()
except Exception as e:
sentry.captureException()
current_app.logger.error("Unable to get location! {0}".format(e))
@ -219,29 +245,34 @@ def bitstrength(cert):
return cert.public_key().key_size
except AttributeError:
sentry.captureException()
current_app.logger.debug('Unable to get bitstrength.')
current_app.logger.debug("Unable to get bitstrength.")
def issuer(cert):
"""
Gets a sane issuer name from a given certificate.
Gets a sane issuer slug from a given certificate, stripping non-alphanumeric characters.
:param cert:
:return: Issuer
For self-signed certificates, the special value '<selfsigned>' is returned.
If issuer cannot be determined, '<unknown>' is returned.
:param cert: Parsed certificate object
:return: Issuer slug
"""
delchars = ''.join(c for c in map(chr, range(256)) if not c.isalnum())
try:
# Try organization name or fall back to CN
issuer = (cert.issuer.get_attributes_for_oid(x509.OID_ORGANIZATION_NAME)
or cert.issuer.get_attributes_for_oid(x509.OID_COMMON_NAME))
issuer = str(issuer[0].value)
for c in delchars:
issuer = issuer.replace(c, "")
return issuer
except Exception as e:
sentry.captureException()
current_app.logger.error("Unable to get issuer! {0}".format(e))
return "Unknown"
# If certificate is self-signed, we return a special value -- there really is no distinct "issuer" for it
if is_selfsigned(cert):
return "<selfsigned>"
# Try Common Name or fall back to Organization name
attrs = cert.issuer.get_attributes_for_oid(
x509.OID_COMMON_NAME
) or cert.issuer.get_attributes_for_oid(x509.OID_ORGANIZATION_NAME)
if not attrs:
current_app.logger.error(
"Unable to get issuer! Cert serial {:x}".format(cert.serial_number)
)
return "<unknown>"
return text_to_slug(attrs[0].value, "")
def not_before(cert):

View File

@ -25,6 +25,7 @@ class Hex(Field):
"""
A hex formatted string.
"""
def _serialize(self, value, attr, obj):
if value:
value = hex(int(value))[2:].upper()
@ -48,25 +49,25 @@ class ArrowDateTime(Field):
"""
DATEFORMAT_SERIALIZATION_FUNCS = {
'iso': utils.isoformat,
'iso8601': utils.isoformat,
'rfc': utils.rfcformat,
'rfc822': utils.rfcformat,
"iso": utils.isoformat,
"iso8601": utils.isoformat,
"rfc": utils.rfcformat,
"rfc822": utils.rfcformat,
}
DATEFORMAT_DESERIALIZATION_FUNCS = {
'iso': utils.from_iso,
'iso8601': utils.from_iso,
'rfc': utils.from_rfc,
'rfc822': utils.from_rfc,
"iso": utils.from_iso,
"iso8601": utils.from_iso,
"rfc": utils.from_rfc,
"rfc822": utils.from_rfc,
}
DEFAULT_FORMAT = 'iso'
DEFAULT_FORMAT = "iso"
localtime = False
default_error_messages = {
'invalid': 'Not a valid datetime.',
'format': '"{input}" cannot be formatted as a datetime.',
"invalid": "Not a valid datetime.",
"format": '"{input}" cannot be formatted as a datetime.',
}
def __init__(self, format=None, **kwargs):
@ -89,34 +90,36 @@ class ArrowDateTime(Field):
try:
return format_func(value, localtime=self.localtime)
except (AttributeError, ValueError) as err:
self.fail('format', input=value)
self.fail("format", input=value)
else:
return value.strftime(self.dateformat)
def _deserialize(self, value, attr, data):
if not value: # Falsy values, e.g. '', None, [] are not valid
raise self.fail('invalid')
raise self.fail("invalid")
self.dateformat = self.dateformat or self.DEFAULT_FORMAT
func = self.DATEFORMAT_DESERIALIZATION_FUNCS.get(self.dateformat)
if func:
try:
return arrow.get(func(value))
except (TypeError, AttributeError, ValueError):
raise self.fail('invalid')
raise self.fail("invalid")
elif self.dateformat:
try:
return dt.datetime.strptime(value, self.dateformat)
except (TypeError, AttributeError, ValueError):
raise self.fail('invalid')
raise self.fail("invalid")
elif utils.dateutil_available:
try:
return arrow.get(utils.from_datestring(value))
except TypeError:
raise self.fail('invalid')
raise self.fail("invalid")
else:
warnings.warn('It is recommended that you install python-dateutil '
'for improved datetime deserialization.')
raise self.fail('invalid')
warnings.warn(
"It is recommended that you install python-dateutil "
"for improved datetime deserialization."
)
raise self.fail("invalid")
class KeyUsageExtension(Field):
@ -131,73 +134,75 @@ class KeyUsageExtension(Field):
def _serialize(self, value, attr, obj):
return {
'useDigitalSignature': value.digital_signature,
'useNonRepudiation': value.content_commitment,
'useKeyEncipherment': value.key_encipherment,
'useDataEncipherment': value.data_encipherment,
'useKeyAgreement': value.key_agreement,
'useKeyCertSign': value.key_cert_sign,
'useCRLSign': value.crl_sign,
'useEncipherOnly': value._encipher_only,
'useDecipherOnly': value._decipher_only
"useDigitalSignature": value.digital_signature,
"useNonRepudiation": value.content_commitment,
"useKeyEncipherment": value.key_encipherment,
"useDataEncipherment": value.data_encipherment,
"useKeyAgreement": value.key_agreement,
"useKeyCertSign": value.key_cert_sign,
"useCRLSign": value.crl_sign,
"useEncipherOnly": value._encipher_only,
"useDecipherOnly": value._decipher_only,
}
def _deserialize(self, value, attr, data):
keyusages = {
'digital_signature': False,
'content_commitment': False,
'key_encipherment': False,
'data_encipherment': False,
'key_agreement': False,
'key_cert_sign': False,
'crl_sign': False,
'encipher_only': False,
'decipher_only': False
"digital_signature": False,
"content_commitment": False,
"key_encipherment": False,
"data_encipherment": False,
"key_agreement": False,
"key_cert_sign": False,
"crl_sign": False,
"encipher_only": False,
"decipher_only": False,
}
for k, v in value.items():
if k == 'useDigitalSignature':
keyusages['digital_signature'] = v
if k == "useDigitalSignature":
keyusages["digital_signature"] = v
elif k == 'useNonRepudiation':
keyusages['content_commitment'] = v
elif k == "useNonRepudiation":
keyusages["content_commitment"] = v
elif k == 'useKeyEncipherment':
keyusages['key_encipherment'] = v
elif k == "useKeyEncipherment":
keyusages["key_encipherment"] = v
elif k == 'useDataEncipherment':
keyusages['data_encipherment'] = v
elif k == "useDataEncipherment":
keyusages["data_encipherment"] = v
elif k == 'useKeyCertSign':
keyusages['key_cert_sign'] = v
elif k == "useKeyCertSign":
keyusages["key_cert_sign"] = v
elif k == 'useCRLSign':
keyusages['crl_sign'] = v
elif k == "useCRLSign":
keyusages["crl_sign"] = v
elif k == 'useKeyAgreement':
keyusages['key_agreement'] = v
elif k == "useKeyAgreement":
keyusages["key_agreement"] = v
elif k == 'useEncipherOnly' and v:
keyusages['encipher_only'] = True
keyusages['key_agreement'] = True
elif k == "useEncipherOnly" and v:
keyusages["encipher_only"] = True
keyusages["key_agreement"] = True
elif k == 'useDecipherOnly' and v:
keyusages['decipher_only'] = True
keyusages['key_agreement'] = True
elif k == "useDecipherOnly" and v:
keyusages["decipher_only"] = True
keyusages["key_agreement"] = True
if keyusages['encipher_only'] and keyusages['decipher_only']:
raise ValidationError('A certificate cannot have both Encipher Only and Decipher Only Extended Key Usages.')
if keyusages["encipher_only"] and keyusages["decipher_only"]:
raise ValidationError(
"A certificate cannot have both Encipher Only and Decipher Only Extended Key Usages."
)
return x509.KeyUsage(
digital_signature=keyusages['digital_signature'],
content_commitment=keyusages['content_commitment'],
key_encipherment=keyusages['key_encipherment'],
data_encipherment=keyusages['data_encipherment'],
key_agreement=keyusages['key_agreement'],
key_cert_sign=keyusages['key_cert_sign'],
crl_sign=keyusages['crl_sign'],
encipher_only=keyusages['encipher_only'],
decipher_only=keyusages['decipher_only']
digital_signature=keyusages["digital_signature"],
content_commitment=keyusages["content_commitment"],
key_encipherment=keyusages["key_encipherment"],
data_encipherment=keyusages["data_encipherment"],
key_agreement=keyusages["key_agreement"],
key_cert_sign=keyusages["key_cert_sign"],
crl_sign=keyusages["crl_sign"],
encipher_only=keyusages["encipher_only"],
decipher_only=keyusages["decipher_only"],
)
@ -216,69 +221,77 @@ class ExtendedKeyUsageExtension(Field):
usage_list = {}
for usage in usages:
if usage == x509.oid.ExtendedKeyUsageOID.CLIENT_AUTH:
usage_list['useClientAuthentication'] = True
usage_list["useClientAuthentication"] = True
elif usage == x509.oid.ExtendedKeyUsageOID.SERVER_AUTH:
usage_list['useServerAuthentication'] = True
usage_list["useServerAuthentication"] = True
elif usage == x509.oid.ExtendedKeyUsageOID.CODE_SIGNING:
usage_list['useCodeSigning'] = True
usage_list["useCodeSigning"] = True
elif usage == x509.oid.ExtendedKeyUsageOID.EMAIL_PROTECTION:
usage_list['useEmailProtection'] = True
usage_list["useEmailProtection"] = True
elif usage == x509.oid.ExtendedKeyUsageOID.TIME_STAMPING:
usage_list['useTimestamping'] = True
usage_list["useTimestamping"] = True
elif usage == x509.oid.ExtendedKeyUsageOID.OCSP_SIGNING:
usage_list['useOCSPSigning'] = True
usage_list["useOCSPSigning"] = True
elif usage.dotted_string == '1.3.6.1.5.5.7.3.14':
usage_list['useEapOverLAN'] = True
elif usage.dotted_string == "1.3.6.1.5.5.7.3.14":
usage_list["useEapOverLAN"] = True
elif usage.dotted_string == '1.3.6.1.5.5.7.3.13':
usage_list['useEapOverPPP'] = True
elif usage.dotted_string == "1.3.6.1.5.5.7.3.13":
usage_list["useEapOverPPP"] = True
elif usage.dotted_string == '1.3.6.1.4.1.311.20.2.2':
usage_list['useSmartCardLogon'] = True
elif usage.dotted_string == "1.3.6.1.4.1.311.20.2.2":
usage_list["useSmartCardLogon"] = True
else:
current_app.logger.warning('Unable to serialize ExtendedKeyUsage with OID: {usage}'.format(usage=usage.dotted_string))
current_app.logger.warning(
"Unable to serialize ExtendedKeyUsage with OID: {usage}".format(
usage=usage.dotted_string
)
)
return usage_list
def _deserialize(self, value, attr, data):
usage_oids = []
for k, v in value.items():
if k == 'useClientAuthentication' and v:
if k == "useClientAuthentication" and v:
usage_oids.append(x509.oid.ExtendedKeyUsageOID.CLIENT_AUTH)
elif k == 'useServerAuthentication' and v:
elif k == "useServerAuthentication" and v:
usage_oids.append(x509.oid.ExtendedKeyUsageOID.SERVER_AUTH)
elif k == 'useCodeSigning' and v:
elif k == "useCodeSigning" and v:
usage_oids.append(x509.oid.ExtendedKeyUsageOID.CODE_SIGNING)
elif k == 'useEmailProtection' and v:
elif k == "useEmailProtection" and v:
usage_oids.append(x509.oid.ExtendedKeyUsageOID.EMAIL_PROTECTION)
elif k == 'useTimestamping' and v:
elif k == "useTimestamping" and v:
usage_oids.append(x509.oid.ExtendedKeyUsageOID.TIME_STAMPING)
elif k == 'useOCSPSigning' and v:
elif k == "useOCSPSigning" and v:
usage_oids.append(x509.oid.ExtendedKeyUsageOID.OCSP_SIGNING)
elif k == 'useEapOverLAN' and v:
elif k == "useEapOverLAN" and v:
usage_oids.append(x509.oid.ObjectIdentifier("1.3.6.1.5.5.7.3.14"))
elif k == 'useEapOverPPP' and v:
elif k == "useEapOverPPP" and v:
usage_oids.append(x509.oid.ObjectIdentifier("1.3.6.1.5.5.7.3.13"))
elif k == 'useSmartCardLogon' and v:
elif k == "useSmartCardLogon" and v:
usage_oids.append(x509.oid.ObjectIdentifier("1.3.6.1.4.1.311.20.2.2"))
else:
current_app.logger.warning('Unable to deserialize ExtendedKeyUsage with name: {key}'.format(key=k))
current_app.logger.warning(
"Unable to deserialize ExtendedKeyUsage with name: {key}".format(
key=k
)
)
return x509.ExtendedKeyUsage(usage_oids)
@ -294,15 +307,17 @@ class BasicConstraintsExtension(Field):
"""
def _serialize(self, value, attr, obj):
return {'ca': value.ca, 'path_length': value.path_length}
return {"ca": value.ca, "path_length": value.path_length}
def _deserialize(self, value, attr, data):
ca = value.get('ca', False)
path_length = value.get('path_length', None)
ca = value.get("ca", False)
path_length = value.get("path_length", None)
if ca:
if not isinstance(path_length, (type(None), int)):
raise ValidationError('A CA certificate path_length (for BasicConstraints) must be None or an integer.')
raise ValidationError(
"A CA certificate path_length (for BasicConstraints) must be None or an integer."
)
return x509.BasicConstraints(ca=True, path_length=path_length)
else:
return x509.BasicConstraints(ca=False, path_length=None)
@ -317,6 +332,7 @@ class SubjectAlternativeNameExtension(Field):
:param kwargs: The same keyword arguments that :class:`Field` receives.
"""
def _serialize(self, value, attr, obj):
general_names = []
name_type = None
@ -326,52 +342,59 @@ class SubjectAlternativeNameExtension(Field):
value = name.value
if isinstance(name, x509.DNSName):
name_type = 'DNSName'
name_type = "DNSName"
elif isinstance(name, x509.IPAddress):
if isinstance(value, ipaddress.IPv4Network):
name_type = 'IPNetwork'
name_type = "IPNetwork"
else:
name_type = 'IPAddress'
name_type = "IPAddress"
value = str(value)
elif isinstance(name, x509.UniformResourceIdentifier):
name_type = 'uniformResourceIdentifier'
name_type = "uniformResourceIdentifier"
elif isinstance(name, x509.DirectoryName):
name_type = 'directoryName'
name_type = "directoryName"
elif isinstance(name, x509.RFC822Name):
name_type = 'rfc822Name'
name_type = "rfc822Name"
elif isinstance(name, x509.RegisteredID):
name_type = 'registeredID'
name_type = "registeredID"
value = value.dotted_string
else:
current_app.logger.warning('Unknown SubAltName type: {name}'.format(name=name))
current_app.logger.warning(
"Unknown SubAltName type: {name}".format(name=name)
)
continue
general_names.append({'nameType': name_type, 'value': value})
general_names.append({"nameType": name_type, "value": value})
return general_names
def _deserialize(self, value, attr, data):
general_names = []
for name in value:
if name['nameType'] == 'DNSName':
validators.sensitive_domain(name['value'])
general_names.append(x509.DNSName(name['value']))
if name["nameType"] == "DNSName":
validators.sensitive_domain(name["value"])
general_names.append(x509.DNSName(name["value"]))
elif name['nameType'] == 'IPAddress':
general_names.append(x509.IPAddress(ipaddress.ip_address(name['value'])))
elif name["nameType"] == "IPAddress":
general_names.append(
x509.IPAddress(ipaddress.ip_address(name["value"]))
)
elif name['nameType'] == 'IPNetwork':
general_names.append(x509.IPAddress(ipaddress.ip_network(name['value'])))
elif name["nameType"] == "IPNetwork":
general_names.append(
x509.IPAddress(ipaddress.ip_network(name["value"]))
)
elif name['nameType'] == 'uniformResourceIdentifier':
general_names.append(x509.UniformResourceIdentifier(name['value']))
elif name["nameType"] == "uniformResourceIdentifier":
general_names.append(x509.UniformResourceIdentifier(name["value"]))
elif name['nameType'] == 'directoryName':
elif name["nameType"] == "directoryName":
# TODO: Need to parse a string in name['value'] like:
# 'CN=Common Name, O=Org Name, OU=OrgUnit Name, C=US, ST=ST, L=City/emailAddress=person@example.com'
# or
@ -389,26 +412,32 @@ class SubjectAlternativeNameExtension(Field):
# general_names.append(x509.DirectoryName(x509.Name(BLAH))))
pass
elif name['nameType'] == 'rfc822Name':
general_names.append(x509.RFC822Name(name['value']))
elif name["nameType"] == "rfc822Name":
general_names.append(x509.RFC822Name(name["value"]))
elif name['nameType'] == 'registeredID':
general_names.append(x509.RegisteredID(x509.ObjectIdentifier(name['value'])))
elif name["nameType"] == "registeredID":
general_names.append(
x509.RegisteredID(x509.ObjectIdentifier(name["value"]))
)
elif name['nameType'] == 'otherName':
elif name["nameType"] == "otherName":
# This has two inputs (type and value), so it doesn't fit the mold of the rest of these GeneralName entities.
# general_names.append(x509.OtherName(name['type'], bytes(name['value']), 'utf-8'))
pass
elif name['nameType'] == 'x400Address':
elif name["nameType"] == "x400Address":
# The Python Cryptography library doesn't support x400Address types (yet?)
pass
elif name['nameType'] == 'EDIPartyName':
elif name["nameType"] == "EDIPartyName":
# The Python Cryptography library doesn't support EDIPartyName types (yet?)
pass
else:
current_app.logger.warning('Unable to deserialize SubAltName with type: {name_type}'.format(name_type=name['nameType']))
current_app.logger.warning(
"Unable to deserialize SubAltName with type: {name_type}".format(
name_type=name["nameType"]
)
)
return x509.SubjectAlternativeName(general_names)

View File

@ -10,20 +10,20 @@ from flask import Blueprint
from lemur.database import db
from lemur.extensions import sentry
mod = Blueprint('healthCheck', __name__)
mod = Blueprint("healthCheck", __name__)
@mod.route('/healthcheck')
@mod.route("/healthcheck")
def health():
try:
if healthcheck(db):
return 'ok'
return "ok"
except Exception:
sentry.captureException()
return 'db check failed'
return "db check failed"
def healthcheck(db):
with db.engine.connect() as connection:
connection.execute('SELECT 1;')
connection.execute("SELECT 1;")
return True

View File

@ -52,7 +52,7 @@ class InstanceManager(object):
results = []
for cls_path in class_list:
module_name, class_name = cls_path.rsplit('.', 1)
module_name, class_name = cls_path.rsplit(".", 1)
try:
module = __import__(module_name, {}, {}, class_name)
cls = getattr(module, class_name)
@ -62,10 +62,14 @@ class InstanceManager(object):
results.append(cls)
except InvalidConfiguration as e:
current_app.logger.warning("Plugin '{0}' may not work correctly. {1}".format(class_name, e))
current_app.logger.warning(
"Plugin '{0}' may not work correctly. {1}".format(class_name, e)
)
except Exception as e:
current_app.logger.exception("Unable to import {0}. Reason: {1}".format(cls_path, e))
current_app.logger.exception(
"Unable to import {0}. Reason: {1}".format(cls_path, e)
)
continue
self.cache = results

View File

@ -11,14 +11,15 @@ def convert_validity_years(data):
:param data:
:return:
"""
if data.get('validity_years'):
if data.get("validity_years"):
now = arrow.utcnow()
data['validity_start'] = now.isoformat()
data["validity_start"] = now.isoformat()
end = now.replace(years=+int(data['validity_years']))
if not current_app.config.get('LEMUR_ALLOW_WEEKEND_EXPIRATION', True):
end = now.shift(years=+int(data["validity_years"]))
if not current_app.config.get("LEMUR_ALLOW_WEEKEND_EXPIRATION", True):
if is_weekend(end):
end = end.replace(days=-2)
end = end.shift(days=-2)
data['validity_end'] = end.isoformat()
data["validity_end"] = end.isoformat()
return data

52
lemur/common/redis.py Normal file
View File

@ -0,0 +1,52 @@
"""
Helper Class for Redis
"""
import redis
import sys
from flask import current_app
from lemur.extensions import sentry
from lemur.factory import create_app
if current_app:
flask_app = current_app
else:
flask_app = create_app()
class RedisHandler:
def __init__(self, host=flask_app.config.get('REDIS_HOST', 'localhost'),
port=flask_app.config.get('REDIS_PORT', 6379),
db=flask_app.config.get('REDIS_DB', 0)):
self.host = host
self.port = port
self.db = db
def redis(self, db=0):
# The decode_responses flag here directs the client to convert the responses from Redis into Python strings
# using the default encoding utf-8. This is client specific.
function = f"{__name__}.{sys._getframe().f_code.co_name}"
try:
red = redis.StrictRedis(host=self.host, port=self.port, db=self.db, encoding="utf-8", decode_responses=True)
red.set("test", 0)
except redis.ConnectionError:
log_data = {
"function": function,
"message": "Redis Connection error",
"host": self.host,
"port": self.port
}
current_app.logger.error(log_data)
sentry.captureException()
return red
def redis_get(key, default=None):
red = RedisHandler().redis()
try:
v = red.get(key)
except redis.exceptions.ConnectionError:
v = None
if not v:
return default
return v

View File

@ -22,27 +22,26 @@ class LemurSchema(Schema):
"""
Base schema from which all grouper schema's inherit
"""
__envelope__ = True
def under(self, data, many=None):
items = []
if many:
for i in data:
items.append(
{underscore(key): value for key, value in i.items()}
)
items.append({underscore(key): value for key, value in i.items()})
return items
return {
underscore(key): value
for key, value in data.items()
}
return {underscore(key): value for key, value in data.items()}
def camel(self, data, many=None):
items = []
if many:
for i in data:
items.append(
{camelize(key, uppercase_first_letter=False): value for key, value in i.items()}
{
camelize(key, uppercase_first_letter=False): value
for key, value in i.items()
}
)
return items
return {
@ -52,14 +51,16 @@ class LemurSchema(Schema):
def wrap_with_envelope(self, data, many):
if many:
if 'total' in self.context.keys():
return dict(total=self.context['total'], items=data)
if "total" in self.context.keys():
return dict(total=self.context["total"], items=data)
return data
class LemurInputSchema(LemurSchema):
@pre_load(pass_many=True)
def preprocess(self, data, many):
if isinstance(data, dict) and data.get("owner"):
data["owner"] = data["owner"].lower()
return self.under(data, many=many)
@ -72,17 +73,17 @@ class LemurOutputSchema(LemurSchema):
def unwrap_envelope(self, data, many):
if many:
if data['items']:
if data["items"]:
if isinstance(data, InstrumentedList) or isinstance(data, list):
self.context['total'] = len(data)
self.context["total"] = len(data)
return data
else:
self.context['total'] = data['total']
self.context["total"] = data["total"]
else:
self.context['total'] = 0
data = {'items': []}
self.context["total"] = 0
data = {"items": []}
return data['items']
return data["items"]
return data
@ -108,11 +109,11 @@ def format_errors(messages):
def wrap_errors(messages):
errors = dict(message='Validation Error.')
if messages.get('_schema'):
errors['reasons'] = {'Schema': {'rule': messages['_schema']}}
errors = dict(message="Validation Error.")
if messages.get("_schema"):
errors["reasons"] = {"Schema": {"rule": messages["_schema"]}}
else:
errors['reasons'] = format_errors(messages)
errors["reasons"] = format_errors(messages)
return errors
@ -121,19 +122,19 @@ def unwrap_pagination(data, output_schema):
return data
if isinstance(data, dict):
if 'total' in data.keys():
if data.get('total') == 0:
if "total" in data.keys():
if data.get("total") == 0:
return data
marshaled_data = {'total': data['total']}
marshaled_data['items'] = output_schema.dump(data['items'], many=True).data
marshaled_data = {"total": data["total"]}
marshaled_data["items"] = output_schema.dump(data["items"], many=True).data
return marshaled_data
return output_schema.dump(data).data
elif isinstance(data, list):
marshaled_data = {'total': len(data)}
marshaled_data['items'] = output_schema.dump(data, many=True).data
marshaled_data = {"total": len(data)}
marshaled_data["items"] = output_schema.dump(data, many=True).data
return marshaled_data
return output_schema.dump(data).data
@ -153,7 +154,7 @@ def validate_schema(input_schema, output_schema):
if errors:
return wrap_errors(errors), 400
kwargs['data'] = data
kwargs["data"] = data
try:
resp = f(*args, **kwargs)
@ -168,7 +169,13 @@ def validate_schema(input_schema, output_schema):
if not resp:
return dict(message="No data found"), 404
return unwrap_pagination(resp, output_schema), 200
if callable(output_schema):
output_schema_to_use = output_schema()
else:
output_schema_to_use = output_schema
return unwrap_pagination(resp, output_schema_to_use), 200
return decorated_function
return decorator

View File

@ -7,12 +7,18 @@
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
"""
import random
import re
import string
import pem
import base64
import sqlalchemy
from cryptography import x509
from cryptography.exceptions import InvalidSignature, UnsupportedAlgorithm
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import rsa, ec
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import rsa, ec, padding
from cryptography.hazmat.primitives.serialization import load_pem_private_key, Encoding, pkcs7
from flask_restful.reqparse import RequestParser
from sqlalchemy import and_, func
@ -21,21 +27,28 @@ from lemur.exceptions import InvalidConfiguration
paginated_parser = RequestParser()
paginated_parser.add_argument('count', type=int, default=10, location='args')
paginated_parser.add_argument('page', type=int, default=1, location='args')
paginated_parser.add_argument('sortDir', type=str, dest='sort_dir', location='args')
paginated_parser.add_argument('sortBy', type=str, dest='sort_by', location='args')
paginated_parser.add_argument('filter', type=str, location='args')
paginated_parser.add_argument("count", type=int, default=10, location="args")
paginated_parser.add_argument("page", type=int, default=1, location="args")
paginated_parser.add_argument("sortDir", type=str, dest="sort_dir", location="args")
paginated_parser.add_argument("sortBy", type=str, dest="sort_by", location="args")
paginated_parser.add_argument("filter", type=str, location="args")
paginated_parser.add_argument("owner", type=str, location="args")
def base64encode(string):
# Performs Base64 encoding of string to string using the base64.b64encode() function
# which encodes bytes to bytes.
return base64.b64encode(string.encode()).decode()
def get_psuedo_random_string():
"""
Create a random and strongish challenge.
"""
challenge = ''.join(random.choice(string.ascii_uppercase) for x in range(6)) # noqa
challenge += ''.join(random.choice("~!@#$%^&*()_+") for x in range(6)) # noqa
challenge += ''.join(random.choice(string.ascii_lowercase) for x in range(6))
challenge += ''.join(random.choice(string.digits) for x in range(6)) # noqa
challenge = "".join(random.choice(string.ascii_uppercase) for x in range(6)) # noqa
challenge += "".join(random.choice("~!@#$%^&*()_+") for x in range(6)) # noqa
challenge += "".join(random.choice(string.ascii_lowercase) for x in range(6))
challenge += "".join(random.choice(string.digits) for x in range(6)) # noqa
return challenge
@ -46,10 +59,63 @@ def parse_certificate(body):
:param body:
:return:
"""
if isinstance(body, str):
body = body.encode('utf-8')
assert isinstance(body, str)
return x509.load_pem_x509_certificate(body, default_backend())
return x509.load_pem_x509_certificate(body.encode("utf-8"), default_backend())
def parse_private_key(private_key):
"""
Parses a PEM-format private key (RSA, DSA, ECDSA or any other supported algorithm).
Raises ValueError for an invalid string. Raises AssertionError when passed value is not str-type.
:param private_key: String containing PEM private key
"""
assert isinstance(private_key, str)
return load_pem_private_key(
private_key.encode("utf8"), password=None, backend=default_backend()
)
def get_key_type_from_certificate(body):
"""
Helper function to determine key type by pasrding given PEM certificate
:param body: PEM string
:return: Key type string
"""
parsed_cert = parse_certificate(body)
if isinstance(parsed_cert.public_key(), rsa.RSAPublicKey):
return "RSA{key_size}".format(
key_size=parsed_cert.public_key().key_size
)
elif isinstance(parsed_cert.public_key(), ec.EllipticCurvePublicKey):
return get_key_type_from_ec_curve(parsed_cert.public_key().curve.name)
def split_pem(data):
"""
Split a string of several PEM payloads to a list of strings.
:param data: String
:return: List of strings
"""
return re.split("\n(?=-----BEGIN )", data)
def parse_cert_chain(pem_chain):
"""
Helper function to split and parse a series of PEM certificates.
:param pem_chain: string
:return: List of parsed certificates
"""
if pem_chain is None:
return []
return [parse_certificate(cert) for cert in split_pem(pem_chain) if cert]
def parse_csr(csr):
@ -59,20 +125,53 @@ def parse_csr(csr):
:param csr:
:return:
"""
if isinstance(csr, str):
csr = csr.encode('utf-8')
assert isinstance(csr, str)
return x509.load_pem_x509_csr(csr, default_backend())
return x509.load_pem_x509_csr(csr.encode("utf-8"), default_backend())
def get_authority_key(body):
"""Returns the authority key for a given certificate in hex format"""
parsed_cert = parse_certificate(body)
authority_key = parsed_cert.extensions.get_extension_for_class(
x509.AuthorityKeyIdentifier).value.key_identifier
x509.AuthorityKeyIdentifier
).value.key_identifier
return authority_key.hex()
def get_key_type_from_ec_curve(curve_name):
"""
Give an EC curve name, return the matching key_type.
:param: curve_name
:return: key_type
"""
_CURVE_TYPES = {
ec.SECP192R1().name: "ECCPRIME192V1",
ec.SECP256R1().name: "ECCPRIME256V1",
ec.SECP224R1().name: "ECCSECP224R1",
ec.SECP384R1().name: "ECCSECP384R1",
ec.SECP521R1().name: "ECCSECP521R1",
ec.SECP256K1().name: "ECCSECP256K1",
ec.SECT163K1().name: "ECCSECT163K1",
ec.SECT233K1().name: "ECCSECT233K1",
ec.SECT283K1().name: "ECCSECT283K1",
ec.SECT409K1().name: "ECCSECT409K1",
ec.SECT571K1().name: "ECCSECT571K1",
ec.SECT163R2().name: "ECCSECT163R2",
ec.SECT233R1().name: "ECCSECT233R1",
ec.SECT283R1().name: "ECCSECT283R1",
ec.SECT409R1().name: "ECCSECT409R1",
ec.SECT571R1().name: "ECCSECT571R2",
}
if curve_name in _CURVE_TYPES.keys():
return _CURVE_TYPES[curve_name]
else:
return None
def generate_private_key(key_type):
"""
Generates a new private key based on key_type.
@ -87,22 +186,19 @@ def generate_private_key(key_type):
"""
_CURVE_TYPES = {
"ECCPRIME192V1": ec.SECP192R1(),
"ECCPRIME256V1": ec.SECP256R1(),
"ECCSECP192R1": ec.SECP192R1(),
"ECCPRIME192V1": ec.SECP192R1(), # duplicate
"ECCPRIME256V1": ec.SECP256R1(), # duplicate
"ECCSECP192R1": ec.SECP192R1(), # duplicate
"ECCSECP224R1": ec.SECP224R1(),
"ECCSECP256R1": ec.SECP256R1(),
"ECCSECP256R1": ec.SECP256R1(), # duplicate
"ECCSECP384R1": ec.SECP384R1(),
"ECCSECP521R1": ec.SECP521R1(),
"ECCSECP256K1": ec.SECP256K1(),
"ECCSECT163K1": ec.SECT163K1(),
"ECCSECT233K1": ec.SECT233K1(),
"ECCSECT283K1": ec.SECT283K1(),
"ECCSECT409K1": ec.SECT409K1(),
"ECCSECT571K1": ec.SECT571K1(),
"ECCSECT163R2": ec.SECT163R2(),
"ECCSECT233R1": ec.SECT233R1(),
"ECCSECT283R1": ec.SECT283R1(),
@ -111,25 +207,74 @@ def generate_private_key(key_type):
}
if key_type not in CERTIFICATE_KEY_TYPES:
raise Exception("Invalid key type: {key_type}. Supported key types: {choices}".format(
key_type=key_type,
choices=",".join(CERTIFICATE_KEY_TYPES)
))
raise Exception(
"Invalid key type: {key_type}. Supported key types: {choices}".format(
key_type=key_type, choices=",".join(CERTIFICATE_KEY_TYPES)
)
)
if 'RSA' in key_type:
if "RSA" in key_type:
key_size = int(key_type[3:])
return rsa.generate_private_key(
public_exponent=65537,
key_size=key_size,
backend=default_backend()
public_exponent=65537, key_size=key_size, backend=default_backend()
)
elif 'ECC' in key_type:
elif "ECC" in key_type:
return ec.generate_private_key(
curve=_CURVE_TYPES[key_type],
backend=default_backend()
curve=_CURVE_TYPES[key_type], backend=default_backend()
)
def check_cert_signature(cert, issuer_public_key):
"""
Check a certificate's signature against an issuer public key.
Before EC validation, make sure we support the algorithm, otherwise raise UnsupportedAlgorithm
On success, returns None; on failure, raises UnsupportedAlgorithm or InvalidSignature.
"""
if isinstance(issuer_public_key, rsa.RSAPublicKey):
# RSA requires padding, just to make life difficult for us poor developers :(
if cert.signature_algorithm_oid == x509.SignatureAlgorithmOID.RSASSA_PSS:
# In 2005, IETF devised a more secure padding scheme to replace PKCS #1 v1.5. To make sure that
# nobody can easily support or use it, they mandated lots of complicated parameters, unlike any
# other X.509 signature scheme.
# https://tools.ietf.org/html/rfc4056
raise UnsupportedAlgorithm("RSASSA-PSS not supported")
else:
padder = padding.PKCS1v15()
issuer_public_key.verify(
cert.signature,
cert.tbs_certificate_bytes,
padder,
cert.signature_hash_algorithm,
)
elif isinstance(issuer_public_key, ec.EllipticCurvePublicKey) and isinstance(
ec.ECDSA(cert.signature_hash_algorithm), ec.ECDSA
):
issuer_public_key.verify(
cert.signature,
cert.tbs_certificate_bytes,
ec.ECDSA(cert.signature_hash_algorithm),
)
else:
raise UnsupportedAlgorithm(
"Unsupported Algorithm '{var}'.".format(
var=cert.signature_algorithm_oid._name
)
)
def is_selfsigned(cert):
"""
Returns True if the certificate is self-signed.
Returns False for failed verification or unsupported signing algorithm.
"""
try:
check_cert_signature(cert, cert.public_key())
# If verification was successful, it's self-signed.
return True
except InvalidSignature:
return False
def is_weekend(date):
"""
Determines if a given date is on a weekend.
@ -149,8 +294,10 @@ def validate_conf(app, required_vars):
:param required_vars: list
"""
for var in required_vars:
if not app.config.get(var):
raise InvalidConfiguration("Required variable '{var}' is not set in Lemur's conf.".format(var=var))
if var not in app.config:
raise InvalidConfiguration(
"Required variable '{var}' is not set in Lemur's conf.".format(var=var)
)
# https://bitbucket.org/zzzeek/sqlalchemy/wiki/UsageRecipes/WindowedRangeQuery
@ -169,18 +316,15 @@ def column_windows(session, column, windowsize):
be computed.
"""
def int_for_range(start_id, end_id):
if end_id:
return and_(
column >= start_id,
column < end_id
)
return and_(column >= start_id, column < end_id)
else:
return column >= start_id
q = session.query(
column,
func.row_number().over(order_by=column).label('rownum')
column, func.row_number().over(order_by=column).label("rownum")
).from_self(column)
if windowsize > 1:
@ -200,9 +344,7 @@ def column_windows(session, column, windowsize):
def windowed_query(q, column, windowsize):
""""Break a Query into windows on a given column."""
for whereclause in column_windows(
q.session,
column, windowsize):
for whereclause in column_windows(q.session, column, windowsize):
for row in q.filter(whereclause).order_by(column):
yield row
@ -210,4 +352,32 @@ def windowed_query(q, column, windowsize):
def truthiness(s):
"""If input string resembles something truthy then return True, else False."""
return s.lower() in ('true', 'yes', 'on', 't', '1')
return s.lower() in ("true", "yes", "on", "t", "1")
def find_matching_certificates_by_hash(cert, matching_certs):
"""Given a Cryptography-formatted certificate cert, and Lemur-formatted certificates (matching_certs),
determine if any of the certificate hashes match and return the matches."""
matching = []
for c in matching_certs:
if parse_certificate(c.body).fingerprint(hashes.SHA256()) == cert.fingerprint(
hashes.SHA256()
):
matching.append(c)
return matching
def convert_pkcs7_bytes_to_pem(certs_pkcs7):
"""
Given a list of certificates in pkcs7 encoding (bytes), covert them into a list of PEM encoded files
:raises ValueError or ValidationError
:param certs_pkcs7:
:return: list of certs in PEM format
"""
certificates = pkcs7.load_pem_pkcs7_certificates(certs_pkcs7)
certificates_pem = []
for cert in certificates:
certificates_pem.append(pem.parse(cert.public_bytes(encoding=Encoding.PEM))[0])
return certificates_pem

View File

@ -1,45 +1,14 @@
import re
from cryptography import x509
from cryptography.exceptions import UnsupportedAlgorithm, InvalidSignature
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
from cryptography.x509 import NameOID
from flask import current_app
from marshmallow.exceptions import ValidationError
from lemur.auth.permissions import SensitiveDomainPermission
from lemur.common.utils import parse_certificate, is_weekend
from lemur.domains import service as domain_service
def public_certificate(body):
"""
Determines if specified string is valid public certificate.
:param body:
:return:
"""
try:
parse_certificate(body)
except Exception as e:
current_app.logger.exception(e)
raise ValidationError('Public certificate presented is not valid.')
def private_key(key):
"""
User to validate that a given string is a RSA private key
:param key:
:return: :raise ValueError:
"""
try:
if isinstance(key, bytes):
serialization.load_pem_private_key(key, None, backend=default_backend())
else:
serialization.load_pem_private_key(key.encode('utf-8'), None, backend=default_backend())
except Exception:
raise ValidationError('Private key presented is not valid.')
from lemur.common.utils import check_cert_signature, is_weekend
def common_name(value):
@ -47,13 +16,13 @@ def common_name(value):
# Common name could be a domain name, or a human-readable name of the subject (often used in CA names or client
# certificates). As a simple heuristic, we assume that human-readable names always include a space.
# However, to avoid confusion for humans, we also don't count spaces at the beginning or end of the string.
if ' ' not in value.strip():
if " " not in value.strip():
return sensitive_domain(value)
def sensitive_domain(domain):
"""
Checks if user has the admin role, the domain does not match sensitive domains and whitelisted domain patterns.
Checks if user has the admin role, the domain does not match sensitive domains and allowed domain patterns.
:param domain: domain name (str)
:return:
"""
@ -61,14 +30,21 @@ def sensitive_domain(domain):
# User has permission, no need to check anything
return
whitelist = current_app.config.get('LEMUR_WHITELISTED_DOMAINS', [])
if whitelist and not any(re.match(pattern, domain) for pattern in whitelist):
raise ValidationError('Domain {0} does not match whitelisted domain patterns. '
'Contact an administrator to issue the certificate.'.format(domain))
allowlist = current_app.config.get("LEMUR_ALLOWED_DOMAINS", [])
if allowlist and not any(re.match(pattern, domain) for pattern in allowlist):
raise ValidationError(
"Domain {0} does not match allowed domain patterns. "
"Contact an administrator to issue the certificate.".format(domain)
)
if any(d.sensitive for d in domain_service.get_by_name(domain)):
raise ValidationError('Domain {0} has been marked as sensitive. '
'Contact an administrator to issue the certificate.'.format(domain))
# Avoid circular import.
from lemur.domains import service as domain_service
if domain_service.is_domain_sensitive(domain):
raise ValidationError(
"Domain {0} has been marked as sensitive. "
"Contact an administrator to issue the certificate.".format(domain)
)
def encoding(oid_encoding):
@ -77,9 +53,13 @@ def encoding(oid_encoding):
:param oid_encoding:
:return:
"""
valid_types = ['b64asn1', 'string', 'ia5string']
valid_types = ["b64asn1", "string", "ia5string"]
if oid_encoding.lower() not in [o_type.lower() for o_type in valid_types]:
raise ValidationError('Invalid Oid Encoding: {0} choose from {1}'.format(oid_encoding, ",".join(valid_types)))
raise ValidationError(
"Invalid Oid Encoding: {0} choose from {1}".format(
oid_encoding, ",".join(valid_types)
)
)
def sub_alt_type(alt_type):
@ -88,10 +68,23 @@ def sub_alt_type(alt_type):
:param alt_type:
:return:
"""
valid_types = ['DNSName', 'IPAddress', 'uniFormResourceIdentifier', 'directoryName', 'rfc822Name', 'registrationID',
'otherName', 'x400Address', 'EDIPartyName']
valid_types = [
"DNSName",
"IPAddress",
"uniFormResourceIdentifier",
"directoryName",
"rfc822Name",
"registrationID",
"otherName",
"x400Address",
"EDIPartyName",
]
if alt_type.lower() not in [a_type.lower() for a_type in valid_types]:
raise ValidationError('Invalid SubAltName Type: {0} choose from {1}'.format(type, ",".join(valid_types)))
raise ValidationError(
"Invalid SubAltName Type: {0} choose from {1}".format(
type, ",".join(valid_types)
)
)
def csr(data):
@ -101,16 +94,22 @@ def csr(data):
:return:
"""
try:
request = x509.load_pem_x509_csr(data.encode('utf-8'), default_backend())
request = x509.load_pem_x509_csr(data.encode("utf-8"), default_backend())
except Exception:
raise ValidationError('CSR presented is not valid.')
raise ValidationError("CSR presented is not valid.")
# Validate common name and SubjectAltNames
try:
for name in request.subject.get_attributes_for_oid(NameOID.COMMON_NAME):
common_name(name.value)
except ValueError as err:
current_app.logger.info("Error parsing Subject from CSR: %s", err)
raise ValidationError("Invalid Subject value in supplied CSR")
try:
alt_names = request.extensions.get_extension_for_class(x509.SubjectAlternativeName)
alt_names = request.extensions.get_extension_for_class(
x509.SubjectAlternativeName
)
for name in alt_names.value.get_values_for_type(x509.DNSName):
sensitive_domain(name)
@ -119,25 +118,87 @@ def csr(data):
def dates(data):
if not data.get('validity_start') and data.get('validity_end'):
raise ValidationError('If validity start is specified so must validity end.')
if not data.get("validity_start") and data.get("validity_end"):
raise ValidationError("If validity start is specified so must validity end.")
if not data.get('validity_end') and data.get('validity_start'):
raise ValidationError('If validity end is specified so must validity start.')
if not data.get("validity_end") and data.get("validity_start"):
raise ValidationError("If validity end is specified so must validity start.")
if data.get('validity_start') and data.get('validity_end'):
if not current_app.config.get('LEMUR_ALLOW_WEEKEND_EXPIRATION', True):
if is_weekend(data.get('validity_end')):
raise ValidationError('Validity end must not land on a weekend.')
if data.get("validity_start") and data.get("validity_end"):
if not current_app.config.get("LEMUR_ALLOW_WEEKEND_EXPIRATION", True):
if is_weekend(data.get("validity_end")):
raise ValidationError("Validity end must not land on a weekend.")
if not data['validity_start'] < data['validity_end']:
raise ValidationError('Validity start must be before validity end.')
if not data["validity_start"] < data["validity_end"]:
raise ValidationError("Validity start must be before validity end.")
if data.get('authority'):
if data.get('validity_start').date() < data['authority'].authority_certificate.not_before.date():
raise ValidationError('Validity start must not be before {0}'.format(data['authority'].authority_certificate.not_before))
if data.get("authority"):
if (
data.get("validity_start").date()
< data["authority"].authority_certificate.not_before.date()
):
raise ValidationError(
"Validity start must not be before {0}".format(
data["authority"].authority_certificate.not_before
)
)
if data.get('validity_end').date() > data['authority'].authority_certificate.not_after.date():
raise ValidationError('Validity end must not be after {0}'.format(data['authority'].authority_certificate.not_after))
if (
data.get("validity_end").date()
> data["authority"].authority_certificate.not_after.date()
):
raise ValidationError(
"Validity end must not be after {0}".format(
data["authority"].authority_certificate.not_after
)
)
return data
def verify_private_key_match(key, cert, error_class=ValidationError):
"""
Checks that the supplied private key matches the certificate.
:param cert: Parsed certificate
:param key: Parsed private key
:param error_class: Exception class to raise on error
"""
if key.public_key().public_numbers() != cert.public_key().public_numbers():
raise error_class("Private key does not match certificate.")
def verify_cert_chain(certs, error_class=ValidationError):
"""
Verifies that the certificates in the chain are correct.
We don't bother with full cert validation but just check that certs in the chain are signed by the next, to avoid
basic human errors -- such as pasting the wrong certificate.
:param certs: List of parsed certificates, use parse_cert_chain()
:param error_class: Exception class to raise on error
"""
cert = certs[0]
for issuer in certs[1:]:
# Use the current cert's public key to verify the previous signature.
# "certificate validation is a complex problem that involves much more than just signature checks"
try:
check_cert_signature(cert, issuer.public_key())
except InvalidSignature:
# Avoid circular import.
from lemur.common import defaults
raise error_class(
"Incorrect chain certificate(s) provided: '%s' is not signed by '%s'"
% (
defaults.common_name(cert) or "Unknown",
defaults.common_name(issuer),
)
)
except UnsupportedAlgorithm as err:
current_app.logger.warning("Skipping chain validation: %s", err)
# Next loop will validate that *this issuer* cert is signed by the next chain cert.
cert = issuer

View File

@ -3,32 +3,51 @@
:copyright: (c) 2018 by Netflix Inc.
:license: Apache, see LICENSE for more details.
"""
from enum import IntEnum
SAN_NAMING_TEMPLATE = "SAN-{subject}-{issuer}-{not_before}-{not_after}"
DEFAULT_NAMING_TEMPLATE = "{subject}-{issuer}-{not_before}-{not_after}"
NONSTANDARD_NAMING_TEMPLATE = "{issuer}-{not_before}-{not_after}"
SUCCESS_METRIC_STATUS = 'success'
FAILURE_METRIC_STATUS = 'failure'
SUCCESS_METRIC_STATUS = "success"
FAILURE_METRIC_STATUS = "failure"
# when ACME attempts to resolve a certificate try in total 3 times
ACME_ADDITIONAL_ATTEMPTS = 2
CERTIFICATE_KEY_TYPES = [
'RSA2048',
'RSA4096',
'ECCPRIME192V1',
'ECCPRIME256V1',
'ECCSECP192R1',
'ECCSECP224R1',
'ECCSECP256R1',
'ECCSECP384R1',
'ECCSECP521R1',
'ECCSECP256K1',
'ECCSECT163K1',
'ECCSECT233K1',
'ECCSECT283K1',
'ECCSECT409K1',
'ECCSECT571K1',
'ECCSECT163R2',
'ECCSECT233R1',
'ECCSECT283R1',
'ECCSECT409R1',
'ECCSECT571R2'
"RSA2048",
"RSA4096",
"ECCPRIME192V1",
"ECCPRIME256V1",
"ECCSECP192R1",
"ECCSECP224R1",
"ECCSECP256R1",
"ECCSECP384R1",
"ECCSECP521R1",
"ECCSECP256K1",
"ECCSECT163K1",
"ECCSECT233K1",
"ECCSECT283K1",
"ECCSECT409K1",
"ECCSECT571K1",
"ECCSECT163R2",
"ECCSECT233R1",
"ECCSECT283R1",
"ECCSECT409R1",
"ECCSECT571R2",
]
# As per RFC 5280 section 5.3.1 (https://tools.ietf.org/html/rfc5280#section-5.3.1)
class CRLReason(IntEnum):
unspecified = 0,
keyCompromise = 1,
cACompromise = 2,
affiliationChanged = 3,
superseded = 4,
cessationOfOperation = 5,
certificateHold = 6,
removeFromCRL = 8,
privilegeWithdrawn = 9,
aACompromise = 10

View File

@ -9,13 +9,14 @@
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
"""
import math
from inflection import underscore
from sqlalchemy import exc, func
from sqlalchemy import exc, func, distinct
from sqlalchemy.orm import make_transient, lazyload
from sqlalchemy.sql import and_, or_
from sqlalchemy.orm import make_transient
from lemur.extensions import db
from lemur.exceptions import AttrNotFound, DuplicateError
from lemur.extensions import db
def filter_none(kwargs):
@ -43,7 +44,7 @@ def session_query(model):
:param model: sqlalchemy model
:return: query object for model
"""
return model.query if hasattr(model, 'query') else db.session.query(model)
return model.query if hasattr(model, "query") else db.session.query(model)
def create_query(model, kwargs):
@ -77,7 +78,7 @@ def add(model):
def get_model_column(model, field):
if field in getattr(model, 'sensitive_fields', ()):
if field in getattr(model, "sensitive_fields", ()):
raise AttrNotFound(field)
column = model.__table__.columns._data.get(field, None)
if column is None:
@ -100,7 +101,7 @@ def find_all(query, model, kwargs):
kwargs = filter_none(kwargs)
for attr, value in kwargs.items():
if not isinstance(value, list):
value = value.split(',')
value = value.split(",")
conditions.append(get_model_column(model, attr).in_(value))
@ -200,7 +201,7 @@ def filter(query, model, terms):
:return:
"""
column = get_model_column(model, underscore(terms[0]))
return query.filter(column.ilike('%{}%'.format(terms[1])))
return query.filter(column.ilike("%{}%".format(terms[1])))
def sort(query, model, field, direction):
@ -214,18 +215,25 @@ def sort(query, model, field, direction):
:param direction:
"""
column = get_model_column(model, underscore(field))
return query.order_by(column.desc() if direction == 'desc' else column.asc())
return query.order_by(column.desc() if direction == "desc" else column.asc())
def paginate(query, page, count):
"""
Returns the items given the count and page specified
Returns the items given the count and page specified. The items would be an empty list
if page number exceeds max page number based on count per page and total number of records.
:param query:
:param page:
:param count:
:param query: search query
:param page: current page number
:param count: results per page
"""
return query.paginate(page, count)
total = get_count(query)
# Check if input page is higher than total number of pages based on count per page and total
# In such a case Flask-SQLAlchemy pagination call results in 404
if math.ceil(total / count) < page:
return dict(items=[], total=total)
items = query.paginate(page, count).items
return dict(items=items, total=total)
def update_list(model, model_attr, item_model, items):
@ -247,10 +255,10 @@ def update_list(model, model_attr, item_model, items):
for i in items:
for item in getattr(model, model_attr):
if item.id == i['id']:
if item.id == i["id"]:
break
else:
getattr(model, model_attr).append(get(item_model, i['id']))
getattr(model, model_attr).append(get(item_model, i["id"]))
return model
@ -273,7 +281,35 @@ def get_count(q):
:param q:
:return:
"""
count_q = q.statement.with_only_columns([func.count()]).order_by(None)
disable_group_by = False
if len(q._entities) > 1:
# currently support only one entity
raise Exception("only one entity is supported for get_count, got: %s" % q)
entity = q._entities[0]
if hasattr(entity, "column"):
# _ColumnEntity has column attr - on case: query(Model.column)...
col = entity.column
if q._group_by and q._distinct:
# which query can have both?
raise NotImplementedError
if q._group_by or q._distinct:
col = distinct(col)
if q._group_by:
# need to disable group_by and enable distinct - we can do this because we have only 1 entity
disable_group_by = True
count_func = func.count(col)
else:
# _MapperEntity doesn't have column attr - on case: query(Model)...
count_func = func.count()
if q._group_by and not disable_group_by:
count_func = count_func.over(None)
count_q = (
q.options(lazyload("*"))
.statement.with_only_columns([count_func])
.order_by(None)
)
if disable_group_by:
count_q = count_q.group_by(None)
count = q.session.execute(count_q).scalar()
return count
@ -287,13 +323,13 @@ def sort_and_page(query, model, args):
:param args:
:return:
"""
sort_by = args.pop('sort_by')
sort_dir = args.pop('sort_dir')
page = args.pop('page')
count = args.pop('count')
sort_by = args.pop("sort_by")
sort_dir = args.pop("sort_dir")
page = args.pop("page")
count = args.pop("count")
if args.get('user'):
user = args.pop('user')
if args.get("user"):
user = args.pop("user")
query = find_all(query, model, args)

Some files were not shown because too many files have changed in this diff Show More