Commit Graph

320 Commits

Author SHA1 Message Date
James Munnelly
48edcd2f96 Run gofmt 2018-03-23 18:50:45 +00:00
James Munnelly
bf3570af0d Add OwnerReferences to HTTP solver resources 2018-03-23 18:50:45 +00:00
James Munnelly
cfc11f324b Fix bugs in http challenge solver 2018-03-23 18:50:45 +00:00
James Munnelly
36c825fa48 Set order.URL in createOrder 2018-03-23 18:50:45 +00:00
James Munnelly
d617bec346 Don't use order URL as a pod label. Cleanup existing resources if multiple exist. 2018-03-23 18:50:45 +00:00
James Munnelly
393e146543 Fix arguments to ensureIngress 2018-03-23 18:50:45 +00:00
James Munnelly
c9dfd408b7 Run gofmt 2018-03-23 18:50:45 +00:00
James Munnelly
42c5599305 Rename integration test framework to unit 2018-03-23 18:50:45 +00:00
James Munnelly
0a0747dac7 Move OrderURL into OrderStatus struct and fix up http solver 2018-03-23 18:50:45 +00:00
James Munnelly
7a44cb3e0e Make HTTP challenge solver async 2018-03-23 18:50:45 +00:00
James Munnelly
de59fc70ee Add pick challenge type unit test 2018-03-23 18:50:45 +00:00
James Munnelly
eccc3d5a8e Change log level of useful messages 2018-03-23 18:50:45 +00:00
James Munnelly
d0d30a0fc2 Disable check for acme account being valid 2018-03-23 18:50:45 +00:00
James Munnelly
e25f832033 Replace calls to acme.GetAccount with acme.CreateAccount 2018-03-23 18:50:45 +00:00
James Munnelly
13e2584ff3 Log events when creating orders 2018-03-23 18:50:45 +00:00
James Munnelly
8de002a697 Never overwrite an acme private key 2018-03-23 18:50:45 +00:00
James Munnelly
8542e1c3a4 Use order finalize url when finalizing 2018-03-23 18:50:45 +00:00
James Munnelly
058387cd44 Fix bug causing skipTLSVerify to be ignore during acme registration 2018-03-23 18:50:45 +00:00
James Munnelly
599fa90f57 Agree to terms of service when registering acme account 2018-03-23 18:50:45 +00:00
James Munnelly
a2ad31c849 Fix acme http test and remove old acme prepare test 2018-03-23 18:50:45 +00:00
James Munnelly
23f694cf0d Add skipTLSVerify field to ACME issuer spec 2018-03-23 18:50:45 +00:00
James Munnelly
32b6e9cbef Fix http_test.go 2018-03-23 18:50:44 +00:00
James Munnelly
7dc50cdea6 Rewrite acme issuer for acme v2 2018-03-23 18:50:44 +00:00
Louis Taylor
d6c7244028
Add limits to http validation pod 2018-03-23 16:30:34 +00:00
Euan Kemp
78b1b8d69d issuer/acme/dns: refactor provider construction
Previously, each provider's package-level 'New' function was being
called.

That made mocking it out for a different function that records data or
returns different output quite difficult.

This PR introduces an additional layer of abstraction in the form of
effectively a vtable struct for the dns providers. It's defaulted to the
same package-level constructors as before, but unit tests in the dns
package can easily override it.

A new test for the previously-introduced route53 trimming behavior is
also added.
2018-03-14 01:25:15 -07:00
Euan Kemp
8aefbb1470 Trim aws credentials for acme dns route53 provider
AWS credentials don't contain whitespace, and it's very easy to
accidentally include spaces or newlines at the end of secrets.
2018-03-14 01:09:25 -07:00
Adarsh J
c4a93bcff5 Use Google's DNS IPs instead of domain
If /etc/resolv.conf does not have any entries, then its unlikely
that the domain name representation of google's DNS would get
resolved too. Hence using IP address directly makes sense.
2018-02-28 02:06:02 +05:30
Tom Wieczorek
f681f5a6b1
Add ACME DNS-01 provider for Akamai FastDNS 2018-02-22 09:50:11 +01:00
jetstack-ci-bot
058a259f7a
Merge pull request #321 from twz123/fix-log-warning
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Log potential errors while waiting for DNS record propagation

**What this PR does / why we need it**:
This helps debugging, e.g. if there are network problems.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2018-02-21 13:39:28 +00:00
Tom Wieczorek
822500c439
Log potential errors while waiting for DNS record propagation
This helps debugging, e.g. if there are network problems.
2018-02-21 10:19:36 +01:00
mwieczorek
cc89fe59aa Added Azure DNS support for DNS01 challange 2018-02-13 10:34:06 +01:00
James Munnelly
ea1dc8f58f Fix panic when ACME server returns a genuine error 2018-01-10 11:46:23 +00:00
James Munnelly
5f196cbe31 Fix panic in acme authorize function 2017-12-01 23:24:09 +00:00
James Munnelly
b67340b134 Fix checking for expired ACME authorizations 2017-12-01 17:37:24 +00:00
jetstack-bot
e32147b695
Merge pull request #183 from munnerz/fix-issue-loop
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Improve validation of certificates. Fix bug in checking certificate validity

**What this PR does / why we need it**:

Improves the validation of dnsNames and commonNames on certificate resources.
Fixes a bug in checking certificate validity.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

Fixes #176, fixes #175

**Release note**:
```release-note
Fix a bug in checking certificate validity and improve validation of dnsNames and commonName
```
2017-11-04 01:00:30 +00:00
jetstack-bot
04a6705ce5
Merge pull request #184 from munnerz/acme-validation
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add basic validation to ACME issuer

**What this PR does / why we need it**:

Improves validation of existing certificate resources

**Release note**:
```release-note
Fix bugs when checking validity of certificate resources
```
2017-11-04 00:29:24 +00:00
James Munnelly
6ac437699d Improve validation of certificates. Fix bug in checking certificate validity 2017-11-03 23:48:18 +00:00
James Munnelly
422f8fc4be Add basic validation to ACME issuer 2017-11-03 23:35:58 +00:00
James Munnelly
01fa76e00a Add solverFor and wait.go unit tests for acme dns solver 2017-11-03 23:34:37 +00:00
James Munnelly
fa7e052ac1 Move to github.com/jetstack/cert-manager repo 2017-11-03 16:41:39 +00:00
James Munnelly
6bd606a7ce Fix ClusterIssuers. Update test name. Add comments. 2017-11-03 15:51:34 +00:00
James Munnelly
eb4be6859e Update controllers and issuers for new SharedInformerFactory 2017-11-03 15:26:19 +00:00
James Munnelly
7875268247 Fix imports 2017-11-03 14:48:41 +00:00
jetstack-bot
97b84201eb
Merge pull request #173 from munnerz/only-create-service
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Only ever create http01 solver service instead of also updating

**What this PR does / why we need it**:

Previously the ensureService function was written to update a service if it already exists. There should never be a case where the http01 solver needs to update an existing *service*, so this PR simplifies this functionality into a simple `createService` function.

**Release note**:
```release-note
NONE
```
2017-10-27 19:03:37 +01:00
James Munnelly
85800ba81b Only ever create http01 solver service instead of also updating 2017-10-27 16:44:39 +01:00
James Munnelly
df47b56a52 Allow rediscovering lost/not set ACME account URIs 2017-10-27 16:09:30 +01:00
James Munnelly
a4a40bdf2d Fix checking for invalid data in issuer secrets 2017-10-26 22:47:17 +01:00
jetstack-bot
bc44f708dd Merge pull request #166 from munnerz/fix-http01
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Error if existing presented key and expected key do not match

**What this PR does / why we need it**:

A type in the HTTP01 solver caused it to not return an error if the key presented by the ingress and the expected key do not match.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

Fixes #163 

**Special notes for your reviewer**:

**Release note**:

```release-note
Fix bug in ACME HTTP01 solver causing self-check to return true before paths have propagated
```
2017-10-26 22:07:31 +01:00
James Munnelly
a05b67dc4b Error if existing presented key and expected key do not match 2017-10-26 21:53:02 +01:00
James Munnelly
dc22822394 Fix panic in ACME issuer setup 2017-10-26 21:21:48 +01:00
jetstack-bot
d5a5c63333 Merge pull request #156 from munnerz/require-5-http-passes
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Ensure ACME HTTP01 reachability test passes 5 times before issuing certificate

**What this PR does / why we need it**:

See #154 for details. Sometimes HTTP routes have not propagated yet when using a controller such as GCLB. This forces us to wait for 5 consecutive passes of the HTTP01 self-check before proceeding.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

Closes #154 

**Special notes for your reviewer**:

* This adds an extra 10s delay onto *any* HTTP01 validation
* The '5 tries' number is hardcoded into the HTTP01 solver

**Release note**:

```release-note
Ensure 5 consecutive HTTP01 self-checks to pass before issuing ACME certificate
```
2017-10-26 14:18:48 +01:00
James Munnelly
16cde96fd8 Ensure ACME HTTP01 reachability test passes 5 times before issuing certificate 2017-10-26 12:10:35 +01:00
James Munnelly
8c9d235e8d Ensure Present and CleanUp run in serial 2017-10-26 10:46:17 +01:00
James Munnelly
14cf0d495f Consistent use of glog 2017-10-16 14:50:27 +01:00
James Munnelly
59e2af767a Perform Issuer/ClusterIssuer status updates in controller 2017-10-16 12:59:46 +01:00
James Munnelly
1f278d659b Refactor e2e setup into scripts. Speed up e2e tests.
Build images whilst services are starting

Exit on setup boulder errors

Install nsenter

Don't build nsenter

Turn up e2e pod verbosity

Set pullPolicy IfNotPresent on HTTP challenge solver
2017-10-16 12:58:47 +01:00
James Munnelly
9f79eea7d1 Use pods instead of jobs for acme solver 2017-10-13 20:15:53 +01:00
James Munnelly
9d933d9e11 Only update certificate status in the controller package to stop conflicts 2017-10-13 20:15:29 +01:00
James Munnelly
29f44c2ed6 Fix domain authorization check 2017-10-13 18:28:40 +01:00
James Munnelly
a62afaa1e7 Merge pull request #120 from jetstack-experimental/fix-http-cleanup
Fix ACME HTTP Cleanup function
2017-10-13 18:09:33 +01:00
James Munnelly
213d895865 Fix ACME HTTP Cleanup function 2017-10-13 17:59:39 +01:00
James Munnelly
a9eb7ee8a7 Check authorizations account URI before attempting to reuse authorization 2017-10-13 16:56:05 +01:00
James Munnelly
01e5833825 Make acmesolver image configurable through CLI. Use tagged version as default. 2017-10-13 16:39:06 +01:00
James Munnelly
c7a83606ce Merge pull request #115 from jetstack-experimental/explicity-challenge-mech
Add HTTP01 field to issuer.spec. Default HTTP01 challenges to disabled.
2017-10-13 15:37:39 +01:00
James Munnelly
79c775e389 Add HTTP01 field to issuer.spec. Default HTTP01 challenges to disabled. 2017-10-13 14:54:26 +01:00
James Munnelly
2600cb8e14 Fix up altName->dnsName change 2017-10-13 14:04:14 +01:00
James Munnelly
45a67dc748 Merge pull request #109 from jetstack-experimental/cn-altname
Use CommonName and AltNames fields on Certificate resource
2017-10-13 13:21:47 +01:00
James Munnelly
a4b1d346c7 Fix invalid check for empty certificate domains 2017-10-13 13:05:21 +01:00
James Munnelly
e080d1da25 Add LICENSE files for files from github.com/xenolf/lego library 2017-10-13 12:57:31 +01:00
James Munnelly
f8107e6fcc Use CommonName and AltNames fields on Certificate resource 2017-10-13 12:50:07 +01:00
James Munnelly
a2d9733f21 Update implementation for new field names/types 2017-10-13 11:43:52 +01:00
James Munnelly
cd4b482410 Check Secret namespace in ClusterIssuer checks. Add TODO. 2017-09-22 09:52:09 +01:00
James Munnelly
dc608f709d Support Certificates referencing ClusterIssuers 2017-09-22 01:46:05 +01:00
James Munnelly
852e250a69 Add clusterissuer controller 2017-09-22 00:10:42 +01:00
James Munnelly
7c425ee86f Switch issuer implementations to use GenericIssuer 2017-09-21 23:27:41 +01:00
James Munnelly
c4980baaca Use context throughout issuer implementation 2017-09-21 20:45:43 +01:00
James Munnelly
8d0d8d1e62 Merge pull request #79 from jetstack-experimental/issuer-ca
Add initial basic CA issuer implementation
2017-09-14 13:43:15 +01:00
James Munnelly
03acdf3a8c Don't regenerate svcName 2017-09-12 21:57:45 +01:00
James Munnelly
dc29817673 Use shorter names for http solver resources 2017-09-12 21:41:37 +01:00
James Munnelly
d506d35cf1 Don't log issuance & renew success/failure twice 2017-09-11 10:47:59 +01:00
James Munnelly
9ba1a35fa1 Update ACME Issue & Renew methods 2017-09-11 10:47:59 +01:00
James Munnelly
ac8e0c6918 Make authorization chan buffered 2017-09-11 02:19:17 +01:00
James Munnelly
98daf0b1ba Add events for ACME prepare method 2017-09-11 02:02:00 +01:00
James Munnelly
d0e02d3d4e Make UpdateStatusCondition work on a *Issuer 2017-09-10 23:07:06 +01:00
James Munnelly
89588bb281 Split GetKeyPair method into two methods 2017-09-10 22:54:55 +01:00
James Munnelly
2e551f58b5 Update ACME implementation for new structure. Add util/pki. 2017-09-10 21:13:37 +01:00
James Munnelly
dc4335754f Move kube related utilities out of cmd 2017-09-10 21:11:34 +01:00
James Munnelly
f66855bd03 Add event recording. Split out cmd entrypoint. 2017-09-09 18:27:35 +01:00
James Munnelly
35d672ef39 Add comments to top level packages 2017-09-09 11:42:50 +01:00
James Munnelly
7540beb74b Update imports 2017-09-09 02:13:03 +01:00
James Munnelly
a958f4462d Switch to using Conditions for Issuer status 2017-09-08 22:22:00 +01:00
James Munnelly
00389b6da3 Refactor Issuer interface to allow returning updated Status 2017-09-08 21:41:15 +01:00
Martell Malone
c4d07a3d51 Fix cloudflare error message 2017-09-04 17:34:16 +01:00
James Munnelly
ddd6151d4a Update acme http solver image 2017-08-31 12:28:08 +01:00
James Munnelly
95aa3aab95 Update references to cert-manager informers 2017-08-22 12:13:13 +01:00
Christian Simon
32dff6079c Fix secret access key link 2017-08-12 14:54:53 +01:00
Christian Simon
301edc7812 Implement provider route 53 2017-08-09 12:17:56 +01:00
Christian Simon
8c2e92a5d1 Adds upstream DNS provider route53 2017-08-08 22:53:03 +01:00
James Munnelly
ee8d34c16f Add cloudflare dns01 provider 2017-08-07 18:28:35 +01:00
James Munnelly
cf6faacd56 Update Issuer CloudDNS config service account to use a SecretKeySelector 2017-08-07 18:07:33 +01:00
James Munnelly
7937b0384c Update import paths 2017-08-07 14:46:58 +01:00
James Munnelly
3503100676 Clean up job resource after validation attempt 2017-08-07 13:52:21 +01:00
James Munnelly
54f708c7c9 Add comments. Remove unused code. 2017-08-07 12:07:32 +01:00
James Munnelly
5e0eb7102f Fix ingress path 2017-08-07 01:57:41 +01:00
James Munnelly
a02f2ba03d Add CleanUp functions for HTTP01 solver 2017-08-07 01:36:42 +01:00
James Munnelly
7d8683bd16 Move solver into standalone binary. Launch Jobs to solve HTTP01 challenges. 2017-08-06 23:51:10 +01:00
James Munnelly
dc80101476 Check for DNS propagation before accept authorization from ACME 2017-08-05 17:39:56 +01:00
James Munnelly
45a1ab2f2b Initial support for CloudDNS 2017-08-05 02:53:37 +01:00
James Munnelly
deeff88b03 Use ACMeStatus() helper 2017-08-05 01:21:14 +01:00
James Munnelly
42a5321510 Watch for certificate and ingress deletion in Certificate controller 2017-08-05 01:00:40 +01:00
James Munnelly
3fb49ad049 Refactor control loops to be more akin to kube-controller-manager 2017-08-05 00:35:54 +01:00
James Munnelly
92d4fef10e Update k8s.io dependencies. Update to new DeepCopy generator. 2017-07-22 13:47:38 +01:00
James Munnelly
630654a6d4 Update import paths 2017-07-22 12:19:40 +01:00
James Munnelly
268ae4ee89 Refactor common functions into util. Add renewals. 2017-07-22 11:45:30 +01:00
James Munnelly
2d55f48328 Implement basic certificate issuer 2017-07-22 02:54:06 +01:00
James Munnelly
6ae604a66a Add temporary static http01 solver 2017-07-22 02:53:46 +01:00
James Munnelly
2075a737b4 Return privateKeyPem in generatePrivateKey 2017-07-22 02:52:21 +01:00
James Munnelly
b0c6b59c51 Fix up acme certificate authorization 2017-07-22 02:51:49 +01:00
James Munnelly
afbe0ba9c5 add start of authorization 2017-07-22 01:23:25 +01:00
James Munnelly
95cba8ab5f Add acme issuer. Implement 'Setup' method. Now manages ACME accounts. 2017-07-21 15:18:39 +01:00