Closed
Description
When I deployed infisical with the issuer-controller-manager to integrate with cert-manager in my k8s.
Container images:
- infisical/infisical:v0.112.0-postgres
- infisical/pki-issuer:v0.1.3
When I deploy this certificate (Using argoCD):
---
# https://cert-manager.io/docs/reference/api-docs/#cert-manager.io/v1.CertificateSpec
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: skynet-infisical-rah-rsa2048
namespace: infisical-system
spec:
dnsNames:
- skynet-infisical-rah-rsa2048
commonName: skynet-infisical-rah-rsa2048 # the common name for the certificate
secretName: skynet-infisical-rah-rsa2048-tls # the name of the Kubernetes Secret to create and store the certificate and private key in
issuerRef:
name: issuer-infisical-rah-rsa2048
group: infisical-issuer.infisical.com
kind: Issuer
namespace: infisical-system
privateKey: # the algorithm and key size to use
algorithm: RSA
#size: 256
size: 2048
duration: 48h # the ttl for the certificate
renewBefore: 12h # the time before the certificate expiry that the certificate should be automatically renewed
Using this PKI-issuer I was trying certificateTemplateId & caId, root & Intermediate CA:
apiVersion: infisical-issuer.infisical.com/v1alpha1
kind: Issuer
#kind: ClusterIssuer
metadata:
#name: issuer-infisical-cluster
name: issuer-infisical-rah-rsa2048
namespace: infisical-system
spec:
#url: "https://infisical.mywebsite.co" # the URL of your Infisical instance
url: "http://infisical-infisical.infisical-system.svc.cluster.local:8080" # the URL of your Infisical instance
# you should only fill in the caId or the certificateTemplateId field but not both!!!!
caId: e4630169 # the ID of the CA you want to use to issue certificates
# you should only fill in the caId or the certificateTemplateId field but not both!!!!
# https://infisical.mywebsite.co/cert-mgr/e7a786c/ca/b0479d93
#certificateTemplateId: cfa567c8 # the ID of the certificate template you want to use to issue certificates against
authentication:
universalAuth:
# https://infisical.mywebsite.co/organization/identities/351f9800
clientId: 54267ea # the Client ID from step 1
secretRef: # reference to the Secret created in step 4
name: "issuer-infisical-client-secret"
key: "clientSecret"
In the issuer controller's logs, I see the strange message CertificateRequest has not been approved yet,
and my certificate never gets to the ready status.
"CertificateRequest has not been approved yet. Ignoring.","controller":"certificaterequest","controllerGroup":"cert-manager.io","controllerKind":"CertificateRequest","CertificateRequest":{"name":"skynet-infisical-rta-rsa2048-1","namespace":"infisical-system"},"namespace":"infisical-system","name":"skynet-infisical-rta-rsa2048-1","reconcileID":"bfb7cad9-d867-45b5-b3a3-0139e731b7a6"}
In the infisical UI I have:
- Created CA and Intermediate CA certificates and installed Intermediate with my root CA.
- Created a template for the root & Intermediate CA.
- I tried both Intermediate & root CA in my Issuer resource using their templates as well as just root and intermediate CA IDs without templates.
- The template for intermediate CA has both common name (CN) and Alternative Names (SAN) set to
.*
withMax TTL 1y
, and in theKey Usage
, I have selected all possible checkboxes to be checked (includingCRL Sign
,Certificate Sign
and all others). - Also I have created a Machine identity
cert-manager
in theOrganization Access Control
with the Organization RoleAdmin
- In the identity I have set
Authentication
:Universal Auth
, with bothAccess Token Trusted IPs
andClient Secret Trusted IPs
set to0.0.0.0, ::
- Then I copied the
Client ID
& createdClient Secrets
saved into my secretissuer-infisical-client-secret
and the Issuer resource. - Then I assigned the identity
cert-manager
to my cert-manager projectk8s-so
with my root & intermediate CAs with the Project role Admin - In the Identity I have also added
Project Additional Privileges
:Certificate Authorities
Actions: Read
,Certificates
:Actions: Read, Create, Modify, Remove
andCertificate Templates
:Actions: Read
.
Why does the certificate never get approved by the infisical's PKI issuer?
I was following this pki-issuer guide. FYI I think PKI issuer documentation is too generic and lacks Insifical's RBAC settings and explanations specific to the PKI Issuer.
Metadata
Metadata
Assignees
Labels
No labels