testutil

package
v0.0.0-...-b23332f Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Forwarding     = true
	ClusterIssuer  = "test-ca-clusterissuer"
	Issuer         = "test-ca-issuer"
	ImageRegistry  = "test-registry.com/test-repo"
	PullPolicy     = "Always"
	SplunkHost     = "test-splunk.fyre.ibm.com"
	SplunkIP       = "7.7.7.7"
	SplunkPort     = 8088
	SplunkToken    = "aaaa"
	SplunkTLS      = false
	SplunkEnable   = true
	QRadarHost     = "test-qradar.fyre.ibm.com"
	QRadarIP       = "6.6.6.6"
	QRadarPort     = 514
	QRadarHostname = "test-syslog"
	QRadarTLS      = false
	QRadarEnable   = true

	BadPort = 1111
)
View Source
const DummySplunkConfig = `` /* 285-byte string literal not displayed */

Variables

View Source
var BadCommonAuditSecurityCtx = corev1.SecurityContext{
	AllowPrivilegeEscalation: &trueVar,
	Privileged:               &trueVar,
	ReadOnlyRootFilesystem:   &trueVar,
	RunAsNonRoot:             &falseVar,
	RunAsUser:                &rootUser,
}
View Source
var BadPorts = []corev1.ServicePort{
	{
		Name:     constant.AuditLoggingComponentName,
		Protocol: "TCP",
		Port:     BadPort,
		TargetPort: intstr.IntOrString{
			Type:   intstr.Int,
			IntVal: BadPort,
		},
	},
}
View Source
var BadQRadarConfig = `` /* 441-byte string literal not displayed */
View Source
var BadQRadarConfigMissingTLS = `
remoteSyslog.conf: |-
    <store>
        @type remote_syslog
        host ` + QRadarHost + `
        port ` + strconv.Itoa(QRadarPort) + `
        hostname ` + QRadarHostname + `
        protocol tcp
        ca_file /fluentd/etc/tls/qradar.crt
        packet_size 4096
        program fluentd
        <buffer>
            @type file
        </buffer>
        <format>
            @type single_value
            message_key message
        </format>
    </store>`
View Source
var ExpectedFluentdConfig = `` /* 329-byte string literal not displayed */
View Source
var ExpectedQRadarConfig = `
remoteSyslog.conf: |-
    <store>
        @type remote_syslog
        host ` + QRadarHost + `
        port ` + strconv.Itoa(QRadarPort) + `
        hostname ` + QRadarHostname + `
        tls ` + strconv.FormatBool(QRadarTLS) + `
        protocol tcp
        ca_file /fluentd/etc/tls/qradar.crt
        packet_size 4096
        program fluentd
        <format>
            @type single_value
            message_key message
        </format>
    </store>`
View Source
var ExpectedSourceConfig = `` /* 1301-byte string literal not displayed */
View Source
var ExpectedSplunkConfig = `
splunkHEC.conf: |-
    <store>
        @type splunk_hec
        hec_host ` + SplunkHost + `
        hec_port ` + strconv.Itoa(SplunkPort) + `
        hec_token ` + SplunkToken + `
        protocol http
        ca_file /fluentd/etc/tls/splunkCA.pem
        source ${tag}
    </store>`
View Source
var HostAliases = []corev1.HostAlias{
	{
		IP:        SplunkIP,
		Hostnames: []string{SplunkHost},
	},
	{
		IP:        QRadarIP,
		Hostnames: []string{QRadarHost},
	},
}
View Source
var Replicas = int32(3)

Functions

func AuditLoggingObj

func AuditLoggingObj(name string) *operatorv1alpha1.AuditLogging

func CommonAuditObj

func CommonAuditObj(name, namespace string) *operatorv1.CommonAudit

func GetFluentdConfig

func GetFluentdConfig(rg *regexp.Regexp, cmData string) string

func NamespaceObj

func NamespaceObj(name string) *corev1.Namespace

Types

This section is empty.

Jump to

Keyboard shortcuts

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