-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide support for Active Directory Certificate Services as an issue…
…r for internal PKI (#42) * Allow ADCS as cert issuer type
- Loading branch information
Showing
9 changed files
with
136 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
resource "helm_release" "adcs_issuer" { | ||
namespace = "adcs-issuer" | ||
create_namespace = true | ||
|
||
name = "adcs-issuer" | ||
repository = "https://djkormo.github.io/adcs-issuer/" | ||
chart = "adcs-issuer" | ||
version = "2.1.1" | ||
max_history = 5 | ||
|
||
set { | ||
name = "simulator.enabled" | ||
value = "false" | ||
} | ||
|
||
set { | ||
name = "simulator.exampleCertificate.enabled" | ||
value = "false" | ||
} | ||
} | ||
|
||
resource "kubectl_manifest" "adcs_credentials_secret" { | ||
depends_on = [ helm_release.adcs_issuer ] | ||
|
||
yaml_body = <<YAML | ||
apiVersion: v1 | ||
kind: Secret | ||
type: Opaque | ||
metadata: | ||
name: adcs-issuer-credentials | ||
namespace: adcs-issuer | ||
stringData: | ||
username: ${var.username} | ||
password: ${var.password} | ||
YAML | ||
} | ||
|
||
resource "kubectl_manifest" "adcs_cluster_issuer" { | ||
depends_on = [ kubectl_manifest.adcs_credentials_secret ] | ||
|
||
yaml_body = <<YAML | ||
apiVersion: adcs.certmanager.csf.nokia.com/v1 | ||
kind: ClusterAdcsIssuer | ||
metadata: | ||
name: adcs-issuer | ||
spec: | ||
caBundle: ${var.adcs_ca_bundle} | ||
credentialsRef: | ||
name: adcs-issuer-credentials | ||
retryInterval: 1h | ||
statusCheckInterval: 6h | ||
templateName: ${var.certificate_template_name} | ||
url: ${var.adcs_url} | ||
YAML | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
terraform { | ||
required_providers { | ||
helm = { | ||
source = "hashicorp/helm" | ||
version = ">= 2.9.0" | ||
} | ||
kubectl = { | ||
source = "gavinbunney/kubectl" | ||
version = ">= 1.14.0" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
variable "adcs_url" { | ||
type = string | ||
description = "URL of the ADCS web UI" | ||
} | ||
|
||
variable "username" { | ||
type = string | ||
description = "Username of the identity that will authenticate with ADCS to request certificates" | ||
} | ||
|
||
variable "password" { | ||
type = string | ||
sensitive = true | ||
description = "Password of the identity that will authenticate with ADCS to request certificates" | ||
} | ||
|
||
variable "adcs_ca_bundle" { | ||
type = string | ||
description = "Base64 encoded ca bundle for communication with ADCS. Can be obtained with 'cat bundle.pem | base64 -w 0'" | ||
} | ||
|
||
variable "certificate_template_name" { | ||
type = string | ||
description = "ADCS certificate template name to use for signing." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters