Giter VIP home page Giter VIP logo

cert-operator's Introduction

CircleCI

cert-operator

Cert Operator creates, configures, and manages certificates for Kubernetes clusters running on the Giant Swarm platform.

Most of the functionality currently provided by this project is now supported natively by Kubernetes' Cluster API (CAPI). As we move more platform functionality to use CAPI workflows, this project will eventually be deprecated.

About

cert-operator is responsible for provisioning certificates used by components of the Giant Swarm platform. It reconciles CertConfig Custom Resources (CRs) and configures Hashicorp vault accordingly. For a given CertConfig, cert-operator ensures:

  • vault is accessible
  • the necessary vault PKI backend has been created
  • a root CA for the associated workload cluster has been created using the PKI backend

Secrets are then created in the management cluster containing the certificates, signed by the root CA, used for establishing connections with and within the workload cluster. Currently, cert-operator handles creation of kubeconfigs for workload cluster access for the following components:

  • the Giant Swarm API
  • app-operator
  • aws/azure/kvm-operator
  • calico
  • etcd
  • node-operator
  • Prometheus

Compatibility

provider cert-operator cluster-operator
AWS < 1.0.0* < 3.6.1
AWS >= 1.0.1 >= 3.6.1
all others >= 1.0.1 >= 0.24.1
all others < 1.0.1 < 0.24.0*

* cert-operator v1.0.0 and cluster-operator v0.24.0 have known issues. Use v1.0.1 or v0.24.1 instead.

Prior to version 1.0.0, cert-operator reconciled based on the spec.versionBundle.version field of the CertConfig CR.

In version 1.0.0 and later, the CR field is ignored, and the operator reconciles CertConfigs which have the cert-operator.giantswarm.io/version label set to the operator's version.

In a typical pre-CAPI Giant Swarm release, cluster-operator creates the CertConfigs necessary for each cluster. cluster-operator prior to version 3.6.1 (AWS) and 0.24.0 (Azure and KVM) did not set the appropriate label and still used the older hardcoded versionBundle. The two methods are not compatible.

Prerequisites

Getting Project

Download the latest release: https://github.com/giantswarm/cert-operator/releases/latest

Clone the git repository: https://github.com/giantswarm/cert-operator.git

Download the latest docker image from here: https://quay.io/repository/giantswarm/cert-operator

How to build

Dependencies

Building the standard way

go build github.com/giantswarm/cert-operator

Running cert-operator

See this guide.

Contact

Contributing & Reporting Bugs

See CONTRIBUTING for details on submitting patches, the contribution workflow as well as reporting bugs.

License

cert-operator is under the Apache 2.0 license. See the LICENSE file for details.

Credit

Secrets

The cert-operator is deployed via Kubernetes.

Here the plain Vault token has to be inserted.

service:
  vault:
    config:
      token: 'TODO'

Here the base64 representation of the data structure above has to be inserted.

apiVersion: v1
kind: Secret
metadata:
  name: cert-operator-secret
  namespace: giantswarm
type: Opaque
data:
  secret.yaml: 'TODO'

To create the secret manually do this.

kubectl create -f ./path/to/secret.yaml

cert-operator's People

Contributors

anvddriesch avatar architectbot avatar bdehri avatar bradbeam avatar calvix avatar corest avatar dependabot-preview[bot] avatar dependabot[bot] avatar fgimenez avatar fiunchinho avatar github-actions[bot] avatar josephsalisbury avatar kopiczko avatar kubasobon avatar marcelmue avatar marians avatar marieroque avatar oponder avatar pipo02mix avatar renovate[bot] avatar rossf7 avatar stone-z avatar taylorbot avatar teemow avatar theobrigitte avatar tomahawk28 avatar tuommaki avatar whites11 avatar xh3b4sd avatar yulianedyalkova avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cert-operator's Issues

Reporting Vulnerability

Hello!

I hope you are doing well!

We are a security research team. Our tool automatically detected a vulnerability in this repository. We want to disclose it responsibly. GitHub has a feature called Private vulnerability reporting, which enables security research to privately disclose a vulnerability. Unfortunately, it is not enabled for this repository.

Can you enable it, so that we can report it?

Thanks in advance!

PS: you can read about how to enable private vulnerability reporting here: https://docs.github.com/en/code-security/security-advisories/repository-security-advisories/configuring-private-vulnerability-reporting-for-a-repository

Not enough permissions in Vault for new healthz check

I think this change #63 breaks kvm install for me

I can be wrong, but let me describe what i'm getting.

I have cert-operator configured with token that we're generating here

And cert-oprator and I getting permission denied for /v1/sys/mounts path, but with token i can issue new cert (see below)?

[rs@tpad tmp]$ export VAULT_TOKEN=XXXXXXXXX
[rs@tpad tmp]$ export VAULT_ADDR=http://172.16.238.2:8200
[rs@tpad tmp]$ curl -H "X-Vault-Token: $VAULT_TOKEN" http://172.16.238.2:8200/v1/sys/mounts
{"errors":["permission denied"]}
[rs@tpad tmp]$ echo '{"ttl": "3460h", "common_name": "foobarcert.g8s.local"}' | vault write pki-g8s/issue/role-g8s -
Key                     Value
---                     -----
certificate             -----BEGIN CERTIFICATE-----
MIIDVTCCAj2gAwIBAgIUPhOQo21jqD12mbKVZs0/NndIXt8wDQYJKoZIhvcNAQEL

Reconfigure `resyncPeriod`

We reverted this value in #48, but having a timeout actually makes sense.

The CoreOS people say they usually set it to 10 minutes, FWIW.

Revert changes for setting allowed domains

The change to certctl to set CN and O for RBAC introduced a bug where the allowed domains were cleared for guest cluster Vault roles.

A temp fix was made to correct the allowed domains. Now certctl only sets the allowed domains if the vault role doesn't exist. This is the correct behavior and the temp fix can now be removed.

Dependabot can't parse your go.mod

Dependabot couldn't parse the go.mod found at /go.mod.

The error Dependabot encountered was:

go: github.com/giantswarm/[email protected] requires
	gopkg.in/[email protected] requires
	gopkg.in/[email protected]: invalid version: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /opt/go/gopath/pkg/mod/cache/vcs/9241c28341fcedca6a799ab7a465dd6924dc5d94044cbfabb75778817250adfc: exit status 128:
	fatal: The remote end hung up unexpectedly

View the update logs.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

circleci
.circleci/config.yml
  • architect 4.37.0
dockerfile
Dockerfile
  • alpine 3.17.3
github-actions
.github/workflows/tidy.yml
  • actions/checkout v3.5.2
gomod
go.mod
  • go 1.21
  • github.com/giantswarm/apiextensions/v6 v6.5.0
  • github.com/giantswarm/certs/v4 v4.0.0
  • github.com/giantswarm/exporterkit v1.0.0
  • github.com/giantswarm/k8sclient/v7 v7.0.1
  • github.com/giantswarm/microendpoint v1.0.0
  • github.com/giantswarm/microerror v0.4.0
  • github.com/giantswarm/microkit v1.0.0
  • github.com/giantswarm/micrologger v1.0.0
  • github.com/giantswarm/operatorkit/v7 v7.0.0
  • github.com/giantswarm/vaultcrt v0.2.0
  • github.com/giantswarm/vaultpki v0.2.0
  • github.com/giantswarm/vaultrole v0.2.0
  • github.com/hashicorp/vault/api v1.9.0
  • github.com/prometheus/client_golang v1.15.0
  • github.com/spf13/viper v1.15.0
  • github.com/stretchr/testify v1.8.2
  • k8s.io/api v0.25.4
  • k8s.io/apimachinery v0.25.4
  • k8s.io/client-go v0.25.4
  • sigs.k8s.io/controller-runtime v0.13.1
kubernetes
examples/cert-operator-lab-chart/templates/deployment.yaml
  • Deployment extensions/v1beta1
helm/cert-operator/templates/deployment.yaml

  • Check this box to trigger a request for Renovate to run again on this repository

Reporting a vulnerability

Hello!

I hope you are doing well!

We are a security research team. Our tool automatically detected a vulnerability in this repository. We want to disclose it responsibly. GitHub has a feature called Private vulnerability reporting, which enables security research to privately disclose a vulnerability. Unfortunately, it is not enabled for this repository.

Can you enable it, so that we can report it?

Thanks in advance!

PS: you can read about how to enable private vulnerability reporting here: https://docs.github.com/en/code-security/security-advisories/repository-security-advisories/configuring-private-vulnerability-reporting-for-a-repository

Allow certificate creation in namespaces

Currently all secrets created in default namespace. I want to be able to control this behaviour.

Current behaviour. I created TPO in namespace, but secrets created in default namespace.

apiVersion: giantswarm.io/v1
kind: Certificate
metadata:
  labels:
    clusterComponent: node-controller
    clusterID: efk16
  name: efk16-node-controller
  namespace: efk16
spec:
  allowBareDomains: true
  clusterComponent: node-controller
  clusterID: efk16
  commonName: node-controller.efk16.g8s.fra-1.giantswarm.io
  ttl: 4320h
~|⇒ kubectl get certificate -n efk16                          
NAME                    KIND
efk16-node-controller   Certificate.v1.giantswarm.io
~|⇒ kubectl get secrets -n default | grep efk16-node-controller
efk16-node-controller   Opaque                                3         11s

Expected behaviour:
If spec ->namespace is set create resulted secrets in specified namespace.

Need to check certificatetpr exists before starting the watch

Error below can happen if the watch starts before the TPR has been created.

{"caller":"github.com/giantswarm/cert-operator/service/crt/service.go:131","info":"starting watch","time":"17-05-16 08:16:03.222"}
E0516 08:16:03.224005       1 reflector.go:199] github.com/giantswarm/cert-operator/vendor/k8s.io/client-go/tools/cache/reflector.go:94: Failed to list *certificatetpr.CustomObject: the server could not find the requested resource

We should check the TPR exists and this should be fixed in operatorkit as it applies to all operators.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.