Commit Graph

424 Commits

Author SHA1 Message Date
James Munnelly
948a2cf77c Add more OWNERS files with auto-labels
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-24 19:38:31 +00:00
jetstack-bot
e930bd3ca7
Merge pull request #1244 from DanielMorsing/self-check-errs
Surface self-check errors in challenge resource
2019-01-23 14:50:16 +00:00
Daniel Morsing
336e9e353a fix missed test
Signed-off-by: Daniel Morsing <dmo@jetstack.io>
2019-01-21 13:13:05 +00:00
Daniel Morsing
88d811b34c change Check function signature
This makes the check function into a simple precondition

Signed-off-by: Daniel Morsing <dmo@jetstack.io>
2019-01-17 16:45:03 +00:00
jetstack-bot
e2e2b5998f
Merge pull request #1230 from munnerz/clear-url-on-reverify
Clear issuer account URL if the directory and account URL's hosts differ
2019-01-17 15:28:12 +00:00
Daniel Morsing
921f5c6d10 absorb every error from http self-check
Body read errors are just regular errors, so we can reclassify them
all into absorb errors

Since we only have absorb errors, flip the switch so that all errors
are absorbed. This will make it easier to surface errors into the
controller.

Signed-off-by: Daniel Morsing <dmo@jetstack.io>
2019-01-17 15:26:13 +00:00
James Munnelly
425f9c757a Clear issuer account URL if the directory and account URL's hosts differ
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-17 14:36:33 +00:00
Daniel Morsing
ac5745d8f0 Remove need for provider config in DNS self-check
Signed-off-by: Daniel Morsing <dmo@jetstack.io>
2019-01-17 14:25:19 +00:00
Daniel Morsing
dc8a4cb95e Avoid connection leaking
An empty transport will by default keep connections alive indefinitely.

Signed-off-by: Daniel Morsing <dmo@jetstack.io>
2019-01-17 14:09:15 +00:00
Daniel Morsing
d374619ba6 thread controller context into self-check
Signed-off-by: Daniel Morsing <dmo@jetstack.io>
2019-01-17 13:05:34 +00:00
Daniel Morsing
62923a9ba8 don't roundtrip url into strings and back
Signed-off-by: Daniel Morsing <dmo@jetstack.io>
2019-01-17 12:46:01 +00:00
Daniel Morsing
f72b59bee1 Disable TLS verification when self-checking
Fixes #949

Signed-off-by: Daniel Morsing <dmo@jetstack.io>
2019-01-16 13:39:27 +00:00
jetstack-bot
5f96b378e6
Merge pull request #1184 from tlmiller/feature/authnss
Control authoritative dns01 server check.
2019-01-12 15:25:07 +00:00
Thomas Miller
dacd0b45cb Control authoritative dns01 server check.
Adds cmd flag for controlling if authoritative dns servers are used to
check RR propagation or just normal resolvers.

This change is added so that constrained enviornments can control more
aspects of DNS queries performed.

- Applying PR feedback

Signed-off-by: Thomas Miller <thomas@tlm.id.au>
2019-01-12 20:17:28 +10:00
James Munnelly
21c7b2e13f Increase ACME control loop max back-off. Increase create order back-off to 1h. Fire Event when Order fails.
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-10 22:07:48 +00:00
James Munnelly
8840925e3e Fix append in CA issue function
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-09 11:39:48 +00:00
Mike Bryant
4fa6d9775c feat: Include entire certificate chain if provided
Allow a user to provide an entire certificate chain to the ca issuer. Include that chain in all generated certificates

Signed-off-by: Mike Bryant <m@ocado.com>
2019-01-09 11:39:48 +00:00
James Munnelly
3e7509b51f Remove flakey unit test in dns utils package
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-08 20:18:49 +00:00
James Munnelly
0fcc0c666c Update copyright header year
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-07 15:07:55 +00:00
James Munnelly
e3ab52861a Only follow CNAMEs if the Issuer's cnameStrategy is 'Follow'
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-12-04 13:57:13 +00:00
jetstack-bot
670cd8564f
Merge pull request #1111 from kellycampbell/udp-timeout-workaround
Retry dns queries with TCP if UDP has an i/o timeout
2018-11-30 12:12:12 +00:00
James Munnelly
943e545697 Switch issuer.Issue to return a pointer and fix up setting secret fields
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-30 11:47:08 +00:00
Kelly Campbell
a90e833c3b Retry dns queries with TCP if UDP has an i/o timeout
Signed-off-by: Kelly Campbell <kelly.a.campbell@gmail.com>
2018-11-29 10:32:55 -05:00
jetstack-bot
28162cebff
Merge pull request #1119 from munnerz/remove-requeue
Remove requeue option and fix small race in controllers
2018-11-29 13:42:16 +00:00
James Munnelly
f8fe9ef21f Remove requeue option and fix small race in controllers
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-29 12:23:21 +00:00
James Munnelly
1f68b0c583 Fix up unit tests
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-29 12:11:42 +00:00
James Munnelly
e5830af6ba Fix event log format & add additional event
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-29 12:11:42 +00:00
James Munnelly
a4a23d432c Set Certificate field on valid test order
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-29 12:11:42 +00:00
James Munnelly
34c3590052 Store a copy of the signed certificate on the Order resource after Finalize
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-29 12:11:42 +00:00
James Munnelly
a6b7cade09 Fix up event logging and add an extra event
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-28 19:16:59 +00:00
James Munnelly
dc97dde2ef Make Certificate Ready condition behaviour consistent between all issuer types
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-28 17:00:51 +00:00
James Munnelly
8f3589e59a Fire warning if retrieving an order's certificate fails
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-23 14:30:59 +00:00
James Munnelly
826441f698 Add more Event messages to ACME Certificate issuer
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-23 14:11:09 +00:00
James Munnelly
447ad2d2ea Fire Event when creating a new Order
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-23 14:10:37 +00:00
James Munnelly
a303056b16 Fix bug with ingress path cleanup
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-16 12:19:53 +00:00
James Munnelly
b279e3a3fc Add failing test to ensure non cert-manager controlled ingress paths are not cleaned up
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-16 12:19:43 +00:00
Max Ehrlich
bbd9249198 Configurable issuer duration and renewBefore Take 2 (#893)
* Configurable issuer duration and renewBefore [1/3]

This is part one of (probably) three parts manually moving the changes from commit 723015174a167d746323f506ab3575cfb243d8bd to the new master. This commit moves the basic functionality of configurable duration while skipping e2e tests and docs. It does not include new work.

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Configurable issuer duration and renewBefore [2/3]

This commit moves over most of the e2e testing updates, some things are intentionally left out as they may be obsolete

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Configurable issuer duration and renewBefore [3/3]

This commit moves the documentation changes, completely the migration of the original code to the latest master

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerunning all hack scripts with since the massive bazel update

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add missing boilerplate headers

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerun codegen hack

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerunning update-docs hack

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix failing unit tests

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix build errors in e2e tests

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerun update-deps

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Don't recreate the CA issuer, it already exists

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Need to create new issuers for the duration and renew time tests because those fields are set in the issuer, so make sure they are named uniquely

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add duration e2e tests for self-signed issuer

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add duration e2e tests for vault w/ custom mount path

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add validation to disallow acme certificates with duration and renewBefore set and update unit tests to verify

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Update docs to mention duration/renew for self-signed issuer and fix potential parsing errors with rst formatting

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Self-signed issuer was missing duration validation

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix a bug causing certificates with a short enough renew-before w.r.t their duration to be renewed instantly and forever

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Print the exact time until renewal

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Move duration and renwal validation to the issuer validation

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Update e2e tests to work with new validation

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add e2e test for the self-signed issuer

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Redo cert duration and renew before to appear as part of the CSR and not the issuer

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Updating tests to match new duration/renewbefore format

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Update e2e tests to match new format

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Update docs to reflect changing the field from issuers to certificates

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove event firing and replace with a TODO as of discussion on PR

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Run hack scripts

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove the sync unit test since without events there is no way to catch the warnings that it was testing

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Use IssuerOptions RenewBeforeExpiryDuration if certificates dont set a renewBefore value for immediate renewal checks

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Delete check on certificate data length in e2e test for certificate duration as there is no reason it should be there

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Update e2e tests since certificate creation will never generate an event

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerunning hack scripts after big rebase

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix a few problems that slipped through during the rebase

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix an e2e error that resulted from the rebase

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add unit test for the calculateTimeBeforeExpiry function

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Adding back in a bunch of missing error checks

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove unused function

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add missing boilerplate

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove unused constant

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Move log constants to function body

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerun hack scripts

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove mistakenly commited file

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove double-import of util package

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix bad function call in e2e vault issuer

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Change duration and renewBefore to be pointer fields as they are optional

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove wrong vault issuer test that got passed the rebase somehow

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Change e2e to use pointer format

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Move e2e cert tests out of issuer test file

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Move e2e self-signed issuer test to new location

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Make sure to check for nil in GenerateTemplate

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add more empty checks to be safe

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerunning hacks after rebase

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix bad function call in new e2e test

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Try not setting duration and renewbefore on acme e2e tests

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Zero checks should really just be replaced by nil tests, zero should be caught as any other too-small value

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fixed a missing nil check that got away

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Change e2e duration test format to use pointer times to better simulate API calls

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix sync unit test to match e2e test format

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix vault e2e test

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Revert changes to Certificate sync function

Signed-off-by: James Munnelly <james@munnelly.eu>

* Remove selfsigned e2e issuer.go

Signed-off-by: James Munnelly <james@munnelly.eu>

* Don't use ACME issuer in duration example and tidy up line endings

Signed-off-by: James Munnelly <james@munnelly.eu>

* Allow renewBefore to be set on ACME certificates

Signed-off-by: James Munnelly <james@munnelly.eu>

* Update renewBefore ACME docs. Remove unused fields.

Signed-off-by: James Munnelly <james@munnelly.eu>

* Rename calculateTimeBeforeExpiry to calculateDurationUntilRenew

Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-14 22:30:00 +00:00
James Munnelly
6006ad6f50 Mark issuer as invalid when parsing URLs fails
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-13 16:14:13 +00:00
James Munnelly
b9947e3247 Skip re-checking ACME account status if Issuer is ready and URL hosts match
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-13 15:52:15 +00:00
jetstack-bot
814a1d7d8e
Merge pull request #1012 from munnerz/e2e-crt-algo
Add e2e test verifying we can obtain ECDSA keys from RSA CA issuers
2018-11-07 16:47:45 +00:00
James Munnelly
544507f442 Update gofmt
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-07 12:39:36 +00:00
James Munnelly
cf402848b9 Add RSA/ECDSA unit tests for CA issuer
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-07 11:14:54 +00:00
James Munnelly
b69b65c0e1 Fix concurrent map writes in FindZoneByFqdn
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-01 11:06:37 +00:00
jetstack-bot
b1599bcd36
Merge pull request #998 from munnerz/acme-setup
Refactor ACME account generation
2018-10-26 12:31:34 +01:00
jetstack-bot
12ed381cb8
Merge pull request #972 from aslafy-z/dns/digitalocean
Add ACME DigitalOcean DNS01 provider
2018-10-26 11:54:34 +01:00
Fredrik Lack
d454a189ed
Whitelist cert-manager created ingresses
Signed-off-by: Fredrik Lack <fredrik@fre.la>
2018-10-25 15:55:35 +02:00
James Munnelly
94e01bb9f1 Refactor ACME account generation
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-24 12:41:37 +01:00
Zadkiel Aharonian
7f8a3a7970
regenerate
Signed-off-by: Zadkiel Aharonian <hello@zadkiel.fr>
2018-10-23 16:27:30 +02:00
Zadkiel Aharonian
c88624100b
Fix tests
Signed-off-by: Zadkiel Aharonian <hello@zadkiel.fr>
2018-10-23 16:25:49 +02:00
Zadkiel Aharonian
59e905cbcc
Add ACME DigitalOcean DNS01 provider
Signed-off-by: Zadkiel Aharonian <hello@zadkiel.fr>
2018-10-23 16:25:49 +02:00