Documentation
¶
Index ¶
- Constants
- Variables
- func DaysOutToTimeOut(targetDaysOut []int) []configv1.TimeSlice
- func GetConfigMap(name string, namespace string, clnt client.Client) (*corev1.ConfigMap, error)
- func GetSecret(name string, namespace string, clnt client.Client) (*corev1.Secret, error)
- func GetServiceAccount(serviceAccount string, namespace string, clnt client.Client) (*corev1.ServiceAccount, error)
- func LogWithLevel(s string, level int, l logr.Logger)
- func ProcessKeystoreIntoCertificates(keystoreObj keystore.KeyStore) (map[string][]x509.Certificate, error)
- func ReadKeyStoreFromBytes(byteData []byte, password []byte) (keystore.KeyStore, error)
- func SetupLabelSelectors(targetLabels []configv1.LabelSelector, ...) (labels.Selector, labels.Selector)
- func SetupNamespaceSlice(namespaces []string, cl client.Client, lggr logr.Logger, serviceAccount string, ...) ([]string, error)
- func SetupSingleLabelSelector(targetLabels []configv1.LabelSelector) (labels.Selector, error)
- type CertificateSentinelReconciler
- type HTMLKeystoreReportHeaderStructure
- type HTMLKeystoreReportLineStructure
- type HTMLKeystoreReportStructure
- type HTMLReportHeaderStructure
- type HTMLReportLineStructure
- type HTMLReportStructure
- type KeystoreSentinelReconciler
- type LoggerKeystoreReportHeaderStructure
- type LoggerKeystoreReportLineStructure
- type LoggerKeystoreReportStructure
- type LoggerReportHeaderStructure
- type LoggerReportLineStructure
- type LoggerReportStructure
- type TextSMTPReportStructure
Constants ¶
const HTMLSMTPKeystoreReportBody = `` /* 1821-byte string literal not displayed */
const HTMLSMTPKeystoreReportBodyDivider = `<div style="width:100%;"><hr /></div>`
const HTMLSMTPKeystoreReportBodyTableDivider = `<tr><td style="text-align:left"> </td></tr>`
const HTMLSMTPKeystoreReportHeader = `` /* 1230-byte string literal not displayed */
const HTMLSMTPKeystoreReportLine = `` /* 625-byte string literal not displayed */
const HTMLSMTPReportBody = `` /* 1558-byte string literal not displayed */
const HTMLSMTPReportBodyDivider = `<div style="width:100%;"><hr /></div>`
const HTMLSMTPReportBodyTableDivider = `<tr><td style="text-align:left"> </td></tr>`
const HTMLSMTPReportHeader = `` /* 1108-byte string literal not displayed */
const HTMLSMTPReportLine = `` /* 558-byte string literal not displayed */
const LoggerKeystoreReport = `` /* 450-byte string literal not displayed */
const LoggerKeystoreReportHeader = `` /* 228-byte string literal not displayed */
const LoggerKeystoreReportLine = `` /* 229-byte string literal not displayed */
const LoggerReport = `` /* 362-byte string literal not displayed */
const LoggerReportHeader = `` /* 205-byte string literal not displayed */
const LoggerReportLine = `` /* 206-byte string literal not displayed */
const TextSMTPKeystoreReportDocument = `` /* 222-byte string literal not displayed */
const TextSMTPReportDocument = `` /* 222-byte string literal not displayed */
Variables ¶
var LggrK = log.Log.WithName("keystore-sentinel-controller")
var SetLogLevel int
var SetLogLevelK int
Functions ¶
func DaysOutToTimeOut ¶
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 ¶
GetConfigMap returns a single ConfigMap 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 ¶
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 ¶
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 ¶
func (r *CertificateSentinelReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
=========================================================================================== 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 ¶
=========================================================================================== SPOT TYPES =========================================================================================== KeystoreSentinelReconciler reconciles a KeystoreSentinel object
func (*KeystoreSentinelReconciler) Reconcile ¶
func (r *KeystoreSentinelReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
=========================================================================================== 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 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 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