config

package
v0.0.0-...-fc01a29 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2021 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const HTMLSMTPKeystoreReportBody = `` /* 1821-byte string literal not displayed */
View Source
const HTMLSMTPKeystoreReportBodyDivider = `<div style="width:100%;"><hr /></div>`
View Source
const HTMLSMTPKeystoreReportBodyTableDivider = `<tr><td style="text-align:left">&nbsp;</td></tr>`
View Source
const HTMLSMTPKeystoreReportHeader = `` /* 1230-byte string literal not displayed */
View Source
const HTMLSMTPKeystoreReportLine = `` /* 625-byte string literal not displayed */
View Source
const HTMLSMTPReportBody = `` /* 1558-byte string literal not displayed */
View Source
const HTMLSMTPReportBodyDivider = `<div style="width:100%;"><hr /></div>`
View Source
const HTMLSMTPReportBodyTableDivider = `<tr><td style="text-align:left">&nbsp;</td></tr>`
View Source
const HTMLSMTPReportHeader = `` /* 1108-byte string literal not displayed */
View Source
const HTMLSMTPReportLine = `` /* 558-byte string literal not displayed */
View Source
const LoggerKeystoreReport = `` /* 450-byte string literal not displayed */
View Source
const LoggerKeystoreReportHeader = `` /* 228-byte string literal not displayed */
View Source
const LoggerKeystoreReportLine = `` /* 229-byte string literal not displayed */
View Source
const LoggerReport = `` /* 362-byte string literal not displayed */
View Source
const LoggerReportHeader = `` /* 205-byte string literal not displayed */
View Source
const LoggerReportLine = `` /* 206-byte string literal not displayed */
View Source
const TextSMTPKeystoreReportDocument = `` /* 222-byte string literal not displayed */
View Source
const TextSMTPReportDocument = `` /* 222-byte string literal not displayed */

Variables

View Source
var LggrK = log.Log.WithName("keystore-sentinel-controller")
View Source
var SetLogLevel int
View Source
var SetLogLevelK int

Functions

func DaysOutToTimeOut

func DaysOutToTimeOut(targetDaysOut []int) []configv1.TimeSlice

DaysOutToTimeOut converts an int slice of the number of days out to trigger an expiration alert on into a []configv1.TimeSlice time.Time array of computed date values to compare against certificate expiration dates with time.After

func GetConfigMap

func GetConfigMap(name string, namespace string, clnt client.Client) (*corev1.ConfigMap, error)

GetConfigMap returns a single ConfigMap by name in a given Namespace

func GetSecret

func GetSecret(name string, namespace string, clnt client.Client) (*corev1.Secret, error)

GetSecret returns a single Secret by name in a given Namespace

func GetServiceAccount

func GetServiceAccount(serviceAccount string, namespace string, clnt client.Client) (*corev1.ServiceAccount, error)

GetServiceAccount returns a single ServiceAccount by name in a given Namespace

func LogWithLevel

func LogWithLevel(s string, level int, l logr.Logger)

LogWithLevel implements simple log levels

func ProcessKeystoreIntoCertificates

func ProcessKeystoreIntoCertificates(keystoreObj keystore.KeyStore) (map[string][]x509.Certificate, error)

ProcessKeystoreIntoCertificates takes a JKS object and turns it into a list of decoded certificates

func ReadKeyStoreFromBytes

func ReadKeyStoreFromBytes(byteData []byte, password []byte) (keystore.KeyStore, error)

ReadKeyStoreFromBytes takes in a byte slice and password and decodes the

func SetupLabelSelectors

func SetupLabelSelectors(targetLabels []configv1.LabelSelector, targetNamespaceLabels []configv1.LabelSelector, lggr logr.Logger) (labels.Selector, labels.Selector)

SetupLabelSelectors wraps some shared functions

func SetupNamespaceSlice

func SetupNamespaceSlice(namespaces []string, cl client.Client, lggr logr.Logger, serviceAccount string, targetNamespaceLabelSelector labels.Selector, scanningInterval int) ([]string, error)

SetupNamespaceSlice sets up the shared effectiveNamespaces from the provided YAML structures

func SetupSingleLabelSelector

func SetupSingleLabelSelector(targetLabels []configv1.LabelSelector) (labels.Selector, error)

SetupSingleLabelSelector takes the YAML definition of a LabelSelector and creates the actual object to use in filtering lists

Types

type CertificateSentinelReconciler

type CertificateSentinelReconciler struct {
	// client can be used to retrieve objects from the APIServer with the cached response.
	client.Client
	Scheme *runtime.Scheme
}

=========================================================================================== SPOT TYPES =========================================================================================== CertificateSentinelReconciler reconciles a CertificateSentinel object

func (*CertificateSentinelReconciler) Reconcile

=========================================================================================== RECONCILE =========================================================================================== Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the CertificateSentinel object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile

func (*CertificateSentinelReconciler) SetupWithManager

func (r *CertificateSentinelReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type HTMLKeystoreReportHeaderStructure

type HTMLKeystoreReportHeaderStructure struct {
	APIVersion                     string
	Kind                           string
	Namespace                      string
	Name                           string
	Key                            string
	KeystoreAlias                  string
	CommonName                     string
	IsCA                           string
	CertificateAuthorityCommonName string
	ExpirationDate                 string
	TriggeredDaysOut               string
	RowStyles                      string
	CellStyles                     string
}

HTMLReportHeaderStructure provides the struct for the htmlReportHeader template

type HTMLKeystoreReportLineStructure

type HTMLKeystoreReportLineStructure struct {
	APIVersion                     string
	Kind                           string
	Namespace                      string
	Name                           string
	Key                            string
	KeystoreAlias                  string
	CommonName                     string
	IsCA                           string
	CertificateAuthorityCommonName string
	ExpirationDate                 string
	TriggeredDaysOut               string
	RowStyles                      string
	CellStyles                     string
}

HTMLReportLineStructure provides the struct for the htmlReportLine template

type HTMLKeystoreReportStructure

type HTMLKeystoreReportStructure struct {
	Namespace          string
	Name               string
	DateSent           string
	ClusterAPIEndpoint string
	TotalKeystores     string
	KeystoresAtRisk    string
	TotalCerts         string
	ExpiringCerts      string
	TableRows          string
	THead              string
	TFoot              string
	BodyDivider        string
}

HTMLReportStructure provides the overall structure to the HTMLSMTPReport template

type HTMLReportHeaderStructure

type HTMLReportHeaderStructure struct {
	APIVersion                     string
	Kind                           string
	Namespace                      string
	Name                           string
	Key                            string
	CommonName                     string
	IsCA                           string
	CertificateAuthorityCommonName string
	ExpirationDate                 string
	TriggeredDaysOut               string
	RowStyles                      string
	CellStyles                     string
}

HTMLReportHeaderStructure provides the struct for the htmlReportHeader template

type HTMLReportLineStructure

type HTMLReportLineStructure struct {
	APIVersion                     string
	Kind                           string
	Namespace                      string
	Name                           string
	Key                            string
	CommonName                     string
	IsCA                           string
	CertificateAuthorityCommonName string
	ExpirationDate                 string
	TriggeredDaysOut               string
	RowStyles                      string
	CellStyles                     string
}

HTMLReportLineStructure provides the struct for the htmlReportLine template

type HTMLReportStructure

type HTMLReportStructure struct {
	Namespace          string
	Name               string
	DateSent           string
	ClusterAPIEndpoint string
	TotalCerts         string
	ExpiringCerts      string
	TableRows          string
	THead              string
	TFoot              string
	BodyDivider        string
}

HTMLReportStructure provides the overall structure to the HTMLSMTPReport template

type KeystoreSentinelReconciler

type KeystoreSentinelReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

=========================================================================================== SPOT TYPES =========================================================================================== KeystoreSentinelReconciler reconciles a KeystoreSentinel object

func (*KeystoreSentinelReconciler) Reconcile

=========================================================================================== RECONCILE =========================================================================================== Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the KeystoreSentinel object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile

func (*KeystoreSentinelReconciler) SetupWithManager

func (r *KeystoreSentinelReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type LoggerKeystoreReportHeaderStructure

type LoggerKeystoreReportHeaderStructure struct {
	APIVersion                     string
	Kind                           string
	Namespace                      string
	Name                           string
	Key                            string
	KeystoreAlias                  string
	CommonName                     string
	IsCA                           string
	CertificateAuthorityCommonName string
	ExpirationDate                 string
	TriggeredDaysOut               string
}

LoggerReportHeaderStructure provides the structure for the LoggerReport header

type LoggerKeystoreReportLineStructure

type LoggerKeystoreReportLineStructure struct {
	APIVersion                     string
	Kind                           string
	Namespace                      string
	Name                           string
	Key                            string
	KeystoreAlias                  string
	CommonName                     string
	IsCA                           string
	CertificateAuthorityCommonName string
	ExpirationDate                 string
	TriggeredDaysOut               string
}

loggerReportLineStructure provides the struct for the loggerReportLine template

type LoggerKeystoreReportStructure

type LoggerKeystoreReportStructure struct {
	Namespace          string
	Name               string
	DateSent           string
	ClusterAPIEndpoint string
	TotalKeystores     string
	KeystoresAtRisk    string
	TotalCerts         string
	ExpiringCerts      string
	ReportLines        string
	Header             string
	Footer             string
	Divider            string
}

loggerReportStructure provides the overall structure to the loggerReport template

type LoggerReportHeaderStructure

type LoggerReportHeaderStructure struct {
	APIVersion                     string
	Kind                           string
	Namespace                      string
	Name                           string
	Key                            string
	CommonName                     string
	IsCA                           string
	CertificateAuthorityCommonName string
	ExpirationDate                 string
	TriggeredDaysOut               string
}

LoggerReportHeaderStructure provides the structure for the LoggerReport header

type LoggerReportLineStructure

type LoggerReportLineStructure struct {
	APIVersion                     string
	Kind                           string
	Namespace                      string
	Name                           string
	Key                            string
	CommonName                     string
	IsCA                           string
	CertificateAuthorityCommonName string
	ExpirationDate                 string
	TriggeredDaysOut               string
}

loggerReportLineStructure provides the struct for the loggerReportLine template

type LoggerReportStructure

type LoggerReportStructure struct {
	Namespace          string
	Name               string
	DateSent           string
	ClusterAPIEndpoint string
	TotalCerts         string
	ExpiringCerts      string
	ReportLines        string
	Header             string
	Footer             string
	Divider            string
}

loggerReportStructure provides the overall structure to the loggerReport template

type TextSMTPReportStructure

type TextSMTPReportStructure struct {
	Content string
}

TextSMTPReportStructure is just a wrapper for the text-report in an HTML document

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL