dummy

package
v1.0.1213 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DummyCreatedAt           = time.Date(2022, time.December, 31, 23, 59, 0, 0, time.UTC)
	DummyCreatedAtPlus3Years = time.Date(2025, time.December, 31, 23, 59, 0, 0, time.UTC)

	DummyNow         = time.Now()
	DummyYearOldDate = CurrentTime.AddDate(-1, 0, 0)
)
View Source
var AWSConnection = models.Connection{
	ID:        uuid.MustParse("6c4c4c4c-0000-0000-0000-000000000001"),
	Name:      "aws-connection",
	Namespace: "default",
	Source:    models.SourceConfigFile,
	Type:      "aws",
}
View Source
var AWSScrapeConfig = models.ConfigScraper{
	ID:        uuid.New(),
	Name:      "incident-commander-db-scraper",
	Namespace: "default",
	Source:    models.SourceCRD,
	Spec:      `{}`,
}
View Source
var AlanTuring = models.Person{
	ID:    uuid.MustParse("1603957c-72e9-4747-a2e1-9e9087c31b4e"),
	Name:  "Alan Turing",
	Email: "alan@turing.com",
}
View Source
var AlanTuringConfigPermission = models.Permission{
	ID:             uuid.MustParse("5bed04a0-48e1-4445-a91a-356460ca17f1"),
	Namespace:      "default",
	Name:           "alan-turing-config-read",
	Subject:        AlanTuring.ID.String(),
	SubjectType:    models.PermissionSubjectTypePerson,
	Action:         "read",
	ObjectSelector: types.JSON(`{"configs": [{"name": "*"}]}`),
	Source:         models.SourceUI,
	CreatedAt:      DummyCreatedAt,
}
View Source
var AlanTuringReadConnectionsPermission = models.Permission{
	ID:             uuid.MustParse("7174b2c8-3f8e-43d2-ad8b-8a2a3918404d"),
	Namespace:      "default",
	Name:           "alan-turing-connections-read",
	Subject:        AlanTuring.ID.String(),
	SubjectType:    models.PermissionSubjectTypePerson,
	Action:         "read",
	ObjectSelector: types.JSON(`{"connections": [{"name": "*"}]}`),
	Source:         models.SourceUI,
	CreatedAt:      DummyCreatedAt,
}
View Source
var AlanTuringRunAllPlaybooksPermission = models.Permission{
	ID:             uuid.MustParse("e8d1252e-3bb6-4e7b-9ede-54c62c869633"),
	Namespace:      "default",
	Name:           "alan-turing-playbook-run-all",
	Subject:        AlanTuring.ID.String(),
	SubjectType:    models.PermissionSubjectTypePerson,
	Action:         "playbook:*",
	ObjectSelector: types.JSON(`{"configs": [{"name": "*"}], "playbooks": [{"name": "*"}]}`),
	Source:         models.SourceUI,
	CreatedAt:      DummyCreatedAt,
}
View Source
var AliceDBUser = models.ExternalUser{
	ID:        uuid.New(),
	Name:      "Alice",
	Tenant:    "flanksource",
	UserType:  "user",
	Email:     &appAliceEmail,
	ScraperID: AWSScrapeConfig.ID,
	CreatedAt: appUserCreatedAt,
}
View Source
var AliceExternalUser = models.ExternalUser{
	ID:        uuid.New(),
	Name:      "Alice",
	Tenant:    "flanksource",
	UserType:  "user",
	Email:     &aliceExternalUserEmail,
	ScraperID: KubeScrapeConfig.ID,
	CreatedAt: DummyCreatedAt,
}
View Source
var AliceMissionControlAdminsMembership = models.ExternalUserGroup{
	ExternalUserID:  AliceExternalUser.ID,
	ExternalGroupID: MissionControlAdminsGroup.ID,
	CreatedAt:       DummyCreatedAt,
}
View Source
var AliceRDSAccess = models.ConfigAccess{
	ID:             uuid.NewString(),
	ScraperID:      &AWSScrapeConfig.ID,
	ConfigID:       RDSInstance.ID,
	ExternalUserID: &AliceDBUser.ID,
	ExternalRoleID: &DBAdminRole.ID,
	CreatedAt:      appUserCreatedAt,
	LastReviewedAt: &appLastReviewed,
}
View Source
var AliceRDSAccessLog = models.ConfigAccessLog{
	ConfigID:       RDSInstance.ID,
	ExternalUserID: AliceDBUser.ID,
	ScraperID:      AWSScrapeConfig.ID,
	CreatedAt:      appT2h,
	MFA:            true,
	Properties:     types.JSONMap{"ip_address": "10.0.0.1"},
}
View Source
var AllDummyAgents = []models.Agent{
	GCPAgent,
	HomelabAgent,
}
View Source
var AllDummyArtifacts = []models.Artifact{
	LogisticsAPIPodLogFile,
}

Order is important since ParentIDs refer to previous components

View Source
var AllDummyConfigLocations = []models.ConfigLocation{
	{ID: KubernetesNodeA.ID, Location: "cluster://aws/us-east-1/production-eks"},
	{ID: KubernetesNodeA.ID, Location: "cluster://kubernetes/demo"},

	{ID: MissionControlNamespace.ID, Location: "cluster://kubernetes/demo"},

	{ID: LogisticsUIDeployment.ID, Location: "cluster://kubernetes/demo"},
	{ID: LogisticsUIDeployment.ID, Location: "namespace://kubernetes/demo/missioncontrol"},

	{ID: LogisticsAPIDeployment.ID, Location: "cluster://kubernetes/demo"},
	{ID: LogisticsAPIDeployment.ID, Location: "namespace://kubernetes/demo/missioncontrol"},

	{ID: LogisticsAPIPodConfig.ID, Location: "cluster://kubernetes/demo"},
	{ID: LogisticsAPIPodConfig.ID, Location: "deployment://kubernetes/demo/missioncontrol/logistics-api"},
	{ID: LogisticsAPIPodConfig.ID, Location: "namespace://kubernetes/demo/missioncontrol"},
	{ID: LogisticsAPIPodConfig.ID, Location: "node://kubernetes/demo/node-a"},
	{ID: LogisticsAPIPodConfig.ID, Location: "replicaset://kubernetes/demo/missioncontrol/logistics-api-7df4c7f6b7"},

	{ID: LogisticsAPIReplicaSet.ID, Location: "cluster://kubernetes/demo"},
	{ID: LogisticsAPIReplicaSet.ID, Location: "namespace://kubernetes/demo/missioncontrol"},
	{ID: LogisticsAPIReplicaSet.ID, Location: "deployment://kubernetes/demo/missioncontrol/logistics-api"},

	{ID: LogisticsUIReplicaSet.ID, Location: "cluster://kubernetes/demo"},
	{ID: LogisticsUIReplicaSet.ID, Location: "namespace://kubernetes/demo/missioncontrol"},
	{ID: LogisticsUIReplicaSet.ID, Location: "deployment://kubernetes/demo/missioncontrol/logistics-ui"},

	{ID: LogisticsUIPodConfig.ID, Location: "cluster://kubernetes/demo"},
	{ID: LogisticsUIPodConfig.ID, Location: "deployment://kubernetes/demo/missioncontrol/logistics-ui"},
	{ID: LogisticsUIPodConfig.ID, Location: "namespace://kubernetes/demo/missioncontrol"},
	{ID: LogisticsUIPodConfig.ID, Location: "replicaset://kubernetes/demo/missioncontrol/logistics-ui-6c8f9b4d5e"},
	{ID: LogisticsUIPodConfig.ID, Location: "node://kubernetes/demo/node-a"},

	{ID: EKSCluster.ID, Location: "account://aws/flanksource"},
	{ID: EKSCluster.ID, Location: "region://aws/us-east-1"},

	{ID: KubernetesNodeAKSPool1.ID, Location: "cluster://kubernetes/demo"},
}
View Source
var AllDummyNotifications = []models.Notification{NoMatchNotification}
View Source
var AllDummyPlaybooks = []models.Playbook{EchoConfig, RestartPod}
View Source
var AllDummyTeams = []models.Team{BackendTeam, FrontendTeam}
View Source
var AllDummyTopologies = []models.Topology{
	LogisticsTopology,
}
View Source
var AllDummyViewPanels = []models.ViewPanel{
	PipelineView,
	DevViewPanel,
}
View Source
var AllDummyViewTables = []ViewGeneratedTable{
	PodViewTable,
}
View Source
var AllDummyViews = []models.View{
	PodView,
	ViewDev,
}
View Source
var ApplicationConfigAnalyses = []models.ConfigAnalysis{
	{
		ID:            uuid.New(),
		ConfigID:      RDSInstance.ID,
		Analyzer:      "rds-public-access",
		Summary:       "RDS instance has public accessibility enabled",
		Message:       "The RDS instance incident-commander-db has PubliclyAccessible=true. Restrict access via security groups.",
		Severity:      models.SeverityHigh,
		AnalysisType:  models.AnalysisTypeSecurity,
		Status:        "open",
		FirstObserved: &appFirstObserved,
		LastObserved:  &appT30m,
	},
	{
		ID:            uuid.New(),
		ConfigID:      RDSInstance.ID,
		Analyzer:      "rds-backup-retention",
		Summary:       "RDS backup retention period is below recommended minimum",
		Message:       "Backup retention is set to 3 days. AWS recommends at least 7 days for production workloads.",
		Severity:      models.SeverityMedium,
		AnalysisType:  models.AnalysisTypeCompliance,
		Status:        "open",
		FirstObserved: &appFirstObserved,
		LastObserved:  &appT30m,
	},
}
View Source
var AzDOBuildPipeline = models.ConfigItem{
	ID:          uuid.MustParse("d4e5f6a7-b8c9-0123-defa-000000000002"),
	Name:        lo.ToPtr("order-service-build"),
	Type:        lo.ToPtr("AzureDevops::Pipeline"),
	ConfigClass: "Pipeline",
	Status:      lo.ToPtr("succeeded"),
	Health:      lo.ToPtr(models.Health("healthy")),
	Labels: lo.ToPtr(types.JSONStringMap{
		"project": "order-service",
		"team":    "platform",
	}),
	ScraperID: lo.ToPtr(AzureDevOpsScrapeConfig.ID.String()),
	Config:    lo.ToPtr(`{"id":12,"project":"order-service","defaultBranch":"refs/heads/main","lastRunStatus":"succeeded"}`),
}
View Source
var AzDOPipelineChanges = []models.ConfigChange{
	{
		ID:         uuid.MustParse("d4e5f6a7-b8c9-0123-defa-000000000010").String(),
		ConfigID:   AzDOBuildPipeline.ID.String(),
		ChangeType: "PipelineRunStarted",
		Source:     "azuredevops",
		Severity:   "info",
		Summary:    "build #88 started on main",
		CreatedAt:  &appT12h,
	},
	{
		ID:         uuid.MustParse("d4e5f6a7-b8c9-0123-defa-000000000011").String(),
		ConfigID:   AzDOBuildPipeline.ID.String(),
		ChangeType: "PipelineRunCompleted",
		Source:     "azuredevops",
		Severity:   "info",
		Summary:    "build #88 succeeded in 4m32s",
		CreatedAt:  &appT6h,
	},
	{
		ID:         uuid.MustParse("d4e5f6a7-b8c9-0123-defa-000000000012").String(),
		ConfigID:   AzDOBuildPipeline.ID.String(),
		ChangeType: "PipelineRunFailed",
		Source:     "azuredevops",
		Severity:   "high",
		Summary:    "build #87 failed: test stage timed out",
		CreatedAt:  &appT48h,
	},
	{
		ID:         uuid.MustParse("d4e5f6a7-b8c9-0123-defa-000000000013").String(),
		ConfigID:   AzDOReleasePipeline.ID.String(),
		ChangeType: "PipelineRunCompleted",
		Source:     "azuredevops",
		Severity:   "info",
		Summary:    "release #12 deployed to production",
		CreatedAt:  &appT2h,
	},
}
View Source
var AzDOReleasePipeline = models.ConfigItem{
	ID:          uuid.MustParse("d4e5f6a7-b8c9-0123-defa-000000000003"),
	Name:        lo.ToPtr("order-service-release"),
	Type:        lo.ToPtr("AzureDevops::Release"),
	ConfigClass: "Release",
	Status:      lo.ToPtr("succeeded"),
	Health:      lo.ToPtr(models.Health("healthy")),
	Labels: lo.ToPtr(types.JSONStringMap{
		"project": "order-service",
		"team":    "platform",
	}),
	ScraperID: lo.ToPtr(AzureDevOpsScrapeConfig.ID.String()),
	Config:    lo.ToPtr(`{"id":5,"project":"order-service","environments":["staging","production"]}`),
}
View Source
var AzureConfigScraper = models.ConfigScraper{
	ID:     uuid.New(),
	Name:   "Azure scraper",
	Source: "ConfigFile",
	Spec:   "{}",
}
View Source
var AzureDevOpsScrapeConfig = models.ConfigScraper{
	ID:        uuid.MustParse("d4e5f6a7-b8c9-0123-defa-000000000001"),
	Name:      "azdo-scraper",
	Namespace: "default",
	Source:    models.SourceCRD,
	Spec:      `{}`,
}
View Source
var BackendTeam = models.Team{
	ID:        uuid.New(),
	Name:      "Backend",
	Icon:      "backend",
	CreatedBy: JohnDoe.ID,
	CreatedAt: CurrentTime,
	UpdatedAt: CurrentTime,
}
View Source
var BobDBUser = models.ExternalUser{
	ID:        uuid.New(),
	Name:      "Bob",
	Tenant:    "flanksource",
	UserType:  "user",
	Email:     &appBobEmail,
	ScraperID: AWSScrapeConfig.ID,
	CreatedAt: appUserCreatedAt,
}
View Source
var BobExternalUser = models.ExternalUser{
	ID:        uuid.New(),
	Name:      "Bob",
	Tenant:    "flanksource",
	UserType:  "user",
	Email:     &bobExternalUserEmail,
	ScraperID: KubeScrapeConfig.ID,
	CreatedAt: DummyCreatedAt,
}
View Source
var BobMissionControlReadersMembership = models.ExternalUserGroup{
	ExternalUserID:  BobExternalUser.ID,
	ExternalGroupID: MissionControlReadersGroup.ID,
	CreatedAt:       DummyCreatedAt,
}
View Source
var BobRDSAccess = models.ConfigAccess{
	ID:             uuid.NewString(),
	ScraperID:      &AWSScrapeConfig.ID,
	ConfigID:       RDSInstance.ID,
	ExternalUserID: &BobDBUser.ID,
	ExternalRoleID: &DBAdminRole.ID,
	CreatedAt:      appUserCreatedAt,
}
View Source
var BobRDSAccessLog = models.ConfigAccessLog{
	ConfigID:       RDSInstance.ID,
	ExternalUserID: BobDBUser.ID,
	ScraperID:      AWSScrapeConfig.ID,
	CreatedAt:      DummyNow.Add(-1 * time.Hour),
	MFA:            false,
	Properties:     types.JSONMap{"ip_address": "10.0.0.2"},
}
View Source
var CartAPICanaryAgent = models.Canary{
	ID:        uuid.MustParse("6dc9d6dd-0b55-4801-837c-352d3abf9b70"),
	AgentID:   GCPAgent.ID,
	Name:      "dummy-cart-api-canary",
	Namespace: "cart",
	Spec:      []byte("{}"),
	CreatedAt: DummyCreatedAt,
}
View Source
var CartAPIHeathCheckAgent = models.Check{
	ID:       uuid.MustParse("eed7bd6e-529b-4693-aca9-43977bcc5ff1"),
	AgentID:  GCPAgent.ID,
	CanaryID: CartAPICanaryAgent.ID,
	Name:     "cart-api-health-check",
	Type:     "http",
	Status:   models.CheckHealthStatus(types.ComponentStatusHealthy),
}
View Source
var CharlieExternalUser = models.ExternalUser{
	ID:        uuid.New(),
	Name:      "Charlie",
	Tenant:    "flanksource",
	UserType:  "user",
	Email:     &charlieExternalUserEmail,
	ScraperID: KubeScrapeConfig.ID,
	CreatedAt: DummyCreatedAt,
}
View Source
var CharlieMissionControlReadersMembership = models.ExternalUserGroup{
	ExternalUserID:  CharlieExternalUser.ID,
	ExternalGroupID: MissionControlReadersGroup.ID,
	CreatedAt:       DummyCreatedAt,
}
View Source
var ClusterAKSNodeRelationship = models.ConfigRelationship{
	ConfigID:  KubernetesCluster.ID.String(),
	RelatedID: KubernetesNodeAKSPool1.ID.String(),
	Relation:  "ClusterNode",
}
View Source
var ClusterComponent = models.Component{
	ID:         uuid.MustParse("018681fe-8156-4b91-d178-caf8b3c2818c"),
	Name:       "cluster",
	ExternalId: "dummy/cluster",
	Type:       "KubernetesCluster",
	Status:     types.ComponentStatusHealthy,
	CreatedAt:  DummyCreatedAt,
	Tooltip:    "Kubernetes Cluster",
	Icon:       "icon-cluster",
}
View Source
var ClusterNodeARelationship = models.ConfigRelationship{
	ConfigID:  KubernetesCluster.ID.String(),
	RelatedID: KubernetesNodeA.ID.String(),
	Relation:  "ClusterNode",
}
View Source
var ClusterNodeBRelationship = models.ConfigRelationship{
	ConfigID:  KubernetesCluster.ID.String(),
	RelatedID: KubernetesNodeB.ID.String(),
	Relation:  "ClusterNode",
}
View Source
var CurrentTime = time.Now()
View Source
var DBAdminRole = models.ExternalRole{
	ID:        uuid.New(),
	Tenant:    "flanksource",
	ScraperID: &AWSScrapeConfig.ID,
	RoleType:  "IAMRole",
	Name:      "db-admin",
	CreatedAt: appUserCreatedAt,
}
View Source
var DeletedCheck, DeletedCheck1h, DeletedCheckOld models.Check
View Source
var DeploymentDiffChanges = []models.ConfigChange{
	{
		ID:         uuid.New().String(),
		ConfigID:   IncidentCommanderDeployment.ID.String(),
		ChangeType: "diff",
		Source:     "kubernetes",
		Severity:   "low",
		Summary:    "image updated: v1.2.3 -> v1.2.4",
		CreatedAt:  &appT6h,
	},
	{
		ID:         uuid.New().String(),
		ConfigID:   IncidentCommanderDeployment.ID.String(),
		ChangeType: "diff",
		Source:     "kubernetes",
		Severity:   "info",
		Summary:    "replicas scaled: 2 -> 3",
		CreatedAt:  &appT2h,
	},
}
View Source
var DevViewPanel = models.ViewPanel{
	ViewID:   ViewDev.ID,
	AgentID:  uuid.Nil,
	IsPushed: false,
	Results: types.JSON([]byte(`[
		{
			"name": "Service Status",
			"description": "Development services status overview",
			"type": "stat",
			"stat": {
				"unit": "services"
			},
			"rows": [
				{
					"namespace": "development",
					"status": "healthy",
					"value": "42"
				},
				{
					"namespace": "development",
					"status": "warning",
					"value": "5"
				},
				{
					"namespace": "development",
					"status": "error",
					"value": "2"
				}
			]
		}
	]`)),
}
View Source
var EC2InstanceA = models.ConfigItem{
	ID:          uuid.New(),
	ConfigClass: models.ConfigClassVirtualMachine,
	Health:      lo.ToPtr(models.HealthHealthy),
	Type:        lo.ToPtr("EC2::Instance"),
	ExternalID:  pq.StringArray{"aws/us-east-1", "testing/instances"},
	Tags: types.JSONStringMap{
		"account": "flanksource",
	},
	Labels: lo.ToPtr(types.JSONStringMap{
		"account":     "flanksource",
		"environment": "testing",
		"app":         "backend",
	}),
}
View Source
var EC2InstanceB = models.ConfigItem{
	ID:          uuid.New(),
	ConfigClass: models.ConfigClassVirtualMachine,
	Health:      lo.ToPtr(models.HealthHealthy),
	Type:        lo.ToPtr("EC2::Instance"),
	ExternalID:  pq.StringArray{"aws/us-west-2", "production/instances"},
	Tags: types.JSONStringMap{
		"account": "flanksource",
	},
	Labels: lo.ToPtr(types.JSONStringMap{
		"account":     "flanksource",
		"environment": "production",
		"app":         "frontend",
	}),
}
View Source
var EC2InstanceBNodeBRelationship = models.ConfigComponentRelationship{
	ConfigID:    EC2InstanceB.ID,
	ComponentID: NodeB.ID,
}
View Source
var EKSCluster = models.ConfigItem{
	ID:          uuid.New(),
	Name:        lo.ToPtr("Production EKS"),
	ConfigClass: models.ConfigClassCluster,
	Health:      lo.ToPtr(models.HealthUnknown),
	Type:        lo.ToPtr("EKS::Cluster"),
	ExternalID:  pq.StringArray{"cluster://aws/us-east-1/production-eks", "production-eks"},
	Tags: types.JSONStringMap{
		"cluster": "aws",
		"account": "flanksource",
	},
	Labels: lo.ToPtr(types.JSONStringMap{
		"account":     "flanksource",
		"cluster":     "aws",
		"environment": "production",
		"telemetry":   "enabled",
		"eks_version": "1.27",
	}),
}
View Source
var EKSClusterClusterComponentRelationship = models.ConfigComponentRelationship{
	ConfigID:    EKSCluster.ID,
	ComponentID: ClusterComponent.ID,
}
View Source
var EKSClusterCreateChange = models.ConfigChange{
	ID:            uuid.New().String(),
	ConfigID:      EKSCluster.ID.String(),
	ChangeType:    "CREATE",
	CreatedAt:     &DummyYearOldDate,
	Severity:      models.SeverityMedium,
	Source:        "CloudTrail",
	Summary:       "EKS cluster created",
	Count:         1,
	FirstObserved: &DummyYearOldDate,
}
View Source
var EKSClusterDeleteChange = models.ConfigChange{
	ID:            uuid.New().String(),
	ConfigID:      EKSCluster.ID.String(),
	ChangeType:    "DELETE",
	CreatedAt:     &DummyNow,
	Severity:      models.SeverityHigh,
	Source:        "CloudTrail",
	Summary:       "EKS cluster deleted",
	Count:         1,
	FirstObserved: &DummyNow,
}
View Source
var EKSClusterUpdateChange = models.ConfigChange{
	ID:            uuid.New().String(),
	ConfigID:      EKSCluster.ID.String(),
	ChangeType:    "UPDATE",
	CreatedAt:     lo.ToPtr(DummyNow.Add(-time.Hour * 24)),
	Severity:      models.SeverityLow,
	Source:        "CloudTrail",
	Summary:       "EKS cluster configuration updated",
	Count:         1,
	FirstObserved: lo.ToPtr(DummyNow.Add(-time.Hour * 24)),
}
View Source
var EchoConfig = models.Playbook{
	ID:          uuid.MustParse("07ffd27a-b33f-4ee6-80d6-b83430a4a16e"),
	Name:        "echo-config",
	Namespace:   "mc",
	Title:       "Echo config",
	Description: "Echos the name of the pod",
	Source:      models.SourceUI,
	Category:    "Echoer",
	Spec: []byte(`{
		"category": "Echoer",
		"description": "Echos the name of the pod",
		"configs": [
			{
				"name": "*"
			}
		],
		"actions": [
			{
				"name": "Echo name & agent",
				"exec": {
					"script": "echo \"Name: {{.config.name}} Agent: {{.agent.name}}\""
				}
			}
		]
	}`),
}
View Source
var EchoConfigRun1 = models.PlaybookRun{
	ID:         uuid.MustParse("17ffd27a-b33f-4ee6-80d6-b83430a4a16e"),
	PlaybookID: EchoConfig.ID,
	ConfigID:   &KubernetesNodeA.ID,
	Status:     models.PlaybookRunStatusCompleted,
	Spec:       []byte("{}"),
	CreatedAt:  DummyCreatedAt.Add(time.Minute),
}
View Source
var EchoConfigRun2 = models.PlaybookRun{
	ID:         uuid.MustParse("27ffd27a-b33f-4ee6-80d6-b83430a4a16e"),
	PlaybookID: EchoConfig.ID,
	ConfigID:   &EC2InstanceA.ID,
	Status:     models.PlaybookRunStatusCompleted,
	Spec:       []byte("{}"),
	CreatedAt:  DummyCreatedAt.Add(time.Minute * 10),
}
View Source
var FirstComment = models.Comment{
	ID:         uuid.New(),
	CreatedBy:  JohnWick.ID,
	Comment:    "This is a comment",
	IncidentID: LogisticsAPIDownIncident.ID,
	CreatedAt:  CurrentTime,
	UpdatedAt:  CurrentTime,
}
View Source
var FluxComponent = models.Component{
	ID:         uuid.MustParse("018cb576-11e3-a43a-75fd-3cbf5c8c804a"),
	Name:       "flux",
	ExternalId: "dummy/flux",
	Type:       "Flux",
	CreatedAt:  DummyCreatedAtPlus3Years,
	Labels:     types.JSONStringMap{"fluxcd.io/name": "flux"},
	Status:     types.ComponentStatusHealthy,
}
View Source
var FluxKustomizeFluxComponentRelationship = models.ComponentRelationship{
	ComponentID:    FluxComponent.ID,
	RelationshipID: KustomizeFluxComponent.ID,
}

Create a cyclic loop

View Source
var FrontendTeam = models.Team{
	ID:        uuid.New(),
	Name:      "Frontend",
	Icon:      "frontend",
	CreatedBy: JohnDoe.ID,
	CreatedAt: CurrentTime,
	UpdatedAt: CurrentTime,
}
View Source
var GCPAgent = models.Agent{
	ID:   uuid.MustParse("ebd4cbf7-267e-48f9-a050-eca12e535ce1"),
	Name: "GCP",
}
View Source
var GitHubIssueResponder = models.Responder{
	ID:         uuid.New(),
	IncidentID: LogisticsAPIDownIncident.ID,
	Type:       "GithubIssue",
	PersonID:   &JohnDoe.ID,
	CreatedBy:  JohnDoe.ID,
	CreatedAt:  CurrentTime,
	UpdatedAt:  CurrentTime,
}
View Source
var GitHubScrapeConfig = models.ConfigScraper{
	ID:        uuid.MustParse("c3d4e5f6-a7b8-9012-cdef-000000000001"),
	Name:      "github-scraper",
	Namespace: "default",
	Source:    models.SourceCRD,
	Spec:      `{}`,
}
View Source
var GitRepository models.ConfigItem
View Source
var HomelabAgent = models.Agent{
	ID:   uuid.MustParse("ac4b1dc5-b249-471d-89d7-ba0c5de4997b"),
	Name: "homelab",
}
View Source
var HomelabKubeScraper = models.ConfigScraper{
	ID:        uuid.MustParse("7f9a2c1d-8b3e-4f5a-9c6d-1e2f3a4b5c6d"),
	Name:      "homelab-kubernetes-scraper",
	Namespace: "default",
	AgentID:   HomelabAgent.ID,
	Source:    models.SourceUI,
	Spec: `{
    "kubernetes": [
      {
        "clusterName": "homelab",
        "namespace": "default"
      }
    ]
  }`,
}
View Source
var (
	ImportedDummyViews = map[string]models.View{}
)

Populated by ImportViews in init()

View Source
var IncidentCommanderDeployment = models.ConfigItem{
	ID:          uuid.New(),
	Name:        lo.ToPtr("incident-commander"),
	Type:        lo.ToPtr("Kubernetes::Deployment"),
	ConfigClass: "Deployment",
	Status:      lo.ToPtr("Running"),
	Health:      lo.ToPtr(models.Health("healthy")),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app":       "incident-commander",
		"namespace": "mc",
	}),
	ScraperID: lo.ToPtr(AWSScrapeConfig.ID.String()),
	Config:    lo.ToPtr(`{"replicas": 3, "readyReplicas": 3}`),
}
View Source
var IncidentCommanderWorkerDeployment = models.ConfigItem{
	ID:          uuid.New(),
	Name:        lo.ToPtr("incident-commander-worker"),
	Type:        lo.ToPtr("Kubernetes::Deployment"),
	ConfigClass: "Deployment",
	Status:      lo.ToPtr("Running"),
	Health:      lo.ToPtr(models.Health("healthy")),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app":       "incident-commander-worker",
		"namespace": "mc",
	}),
	ScraperID: lo.ToPtr(AWSScrapeConfig.ID.String()),
	Config:    lo.ToPtr(`{"replicas": 2, "readyReplicas": 2}`),
}
View Source
var JiraResponder = models.Responder{
	ID:         uuid.New(),
	IncidentID: LogisticsAPIDownIncident.ID,
	Type:       "Jira",
	PersonID:   &JohnWick.ID,
	CreatedBy:  JohnWick.ID,
	CreatedAt:  CurrentTime,
	UpdatedAt:  CurrentTime,
}
View Source
var JobHistoryCanaryFailure = models.JobHistory{
	ID:           uuid.MustParse("018f9b10-ecb8-75c1-fefa-9d589fb99c65"),
	Name:         "Canary1",
	ResourceType: "canary",
	Status:       models.StatusFailed,
}
View Source
var JobHistoryCanarySuccess = models.JobHistory{
	ID:           uuid.MustParse("018f9b11-7639-c442-4b62-92fe7fdd4f5c"),
	Name:         "Canary1",
	ResourceType: "canary",
	Status:       models.StatusSuccess,
}
View Source
var JobHistoryCanaryWarning = models.JobHistory{
	ID:           uuid.MustParse("018f9b11-188c-4d71-c826-e356b535ed96"),
	Name:         "Canary1",
	ResourceType: "canary",
	Status:       models.StatusWarning,
}
View Source
var JobHistoryTopologySuccess = models.JobHistory{
	ID:           uuid.MustParse("018f9b11-40f7-e43e-cef5-f9441d77ce5b"),
	Name:         "Topology1",
	ResourceType: "topology",
	Status:       models.StatusSuccess,
}
View Source
var JohnDoe = models.Person{
	ID:    uuid.MustParse("01653e30-39a6-482a-8a9c-2bb8debaf440"),
	Name:  "John Doe",
	Email: "john@doe.com",
}
View Source
var JohnDoeExternalUser = models.ExternalUser{
	ID:        uuid.New(),
	Name:      "John Doe",
	Tenant:    "flanksource",
	UserType:  "user",
	Email:     &johnDoeExternalUserEmail,
	ScraperID: KubeScrapeConfig.ID,
	CreatedAt: DummyCreatedAt,
}
View Source
var JohnDoeMissionControlAdminsMembership = models.ExternalUserGroup{
	ExternalUserID:  JohnDoeExternalUser.ID,
	ExternalGroupID: MissionControlAdminsGroup.ID,
	CreatedAt:       DummyCreatedAt,
}
View Source
var JohnWick = models.Person{
	ID:    uuid.MustParse("3b6e2e89-b7ab-4751-a2d1-1e205fa478f6"),
	Name:  "John Wick",
	Email: "john@wick.com",
}
View Source
var KubeScrapeConfig = models.ConfigScraper{
	ID:        uuid.New(),
	Name:      "kubernetes-scraper",
	Namespace: "default",
	Source:    models.SourceUI,
	Spec: `{
    "kubernetes": [
      {
        "clusterName": "demo",
        "kubeconfig": {
          "value": "testdata/my-kube-config.yaml"
        }
      }
    ]
  }`,
}
View Source
var KubernetesAppDeployment = models.ConfigItem{
	ID:          uuid.MustParse("a1b2c3d4-e5f6-7890-abcd-000000000002"),
	Name:        lo.ToPtr("frontend"),
	Type:        lo.ToPtr("Kubernetes::Deployment"),
	ConfigClass: "Deployment",
	Status:      lo.ToPtr("Running"),
	Health:      lo.ToPtr(models.Health("healthy")),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app":       "frontend",
		"namespace": "default",
	}),
	ScraperID: lo.ToPtr(KubernetesAppScrapeConfig.ID.String()),
	Config:    lo.ToPtr(`{"replicas": 3, "readyReplicas": 3, "image": "frontend:v2.1.0"}`),
}
View Source
var KubernetesAppDiffChanges = []models.ConfigChange{
	{
		ID:         uuid.MustParse("a1b2c3d4-e5f6-7890-abcd-000000000010").String(),
		ConfigID:   KubernetesAppDeployment.ID.String(),
		ChangeType: "diff",
		Source:     "kubernetes",
		Severity:   "low",
		Summary:    "image updated: v2.0.9 -> v2.1.0",
		CreatedAt:  &appT48h,
	},
	{
		ID:         uuid.MustParse("a1b2c3d4-e5f6-7890-abcd-000000000011").String(),
		ConfigID:   KubernetesAppDeployment.ID.String(),
		ChangeType: "diff",
		Source:     "kubernetes",
		Severity:   "info",
		Summary:    "replicas scaled: 2 -> 3",
		CreatedAt:  &appT12h,
	},
	{
		ID:         uuid.MustParse("a1b2c3d4-e5f6-7890-abcd-000000000012").String(),
		ConfigID:   KubernetesAppIngress.ID.String(),
		ChangeType: "diff",
		Source:     "kubernetes",
		Severity:   "medium",
		Summary:    "TLS certificate renewed",
		CreatedAt:  &appT6h,
	},
}
View Source
var KubernetesAppIngress = models.ConfigItem{
	ID:          uuid.MustParse("a1b2c3d4-e5f6-7890-abcd-000000000004"),
	Name:        lo.ToPtr("frontend"),
	Type:        lo.ToPtr("Kubernetes::Ingress"),
	ConfigClass: "Ingress",
	Status:      lo.ToPtr("Active"),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app":       "frontend",
		"namespace": "default",
	}),
	ScraperID: lo.ToPtr(KubernetesAppScrapeConfig.ID.String()),
	Config:    lo.ToPtr(`{"host": "frontend.example.com", "tls": true}`),
}
View Source
var KubernetesAppScrapeConfig = models.ConfigScraper{
	ID:        uuid.MustParse("a1b2c3d4-e5f6-7890-abcd-000000000001"),
	Name:      "kubernetes-app-scraper",
	Namespace: "default",
	Source:    models.SourceCRD,
	Spec:      `{}`,
}
View Source
var KubernetesAppService = models.ConfigItem{
	ID:          uuid.MustParse("a1b2c3d4-e5f6-7890-abcd-000000000003"),
	Name:        lo.ToPtr("frontend"),
	Type:        lo.ToPtr("Kubernetes::Service"),
	ConfigClass: "Service",
	Status:      lo.ToPtr("Active"),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app":       "frontend",
		"namespace": "default",
	}),
	ScraperID: lo.ToPtr(KubernetesAppScrapeConfig.ID.String()),
	Config:    lo.ToPtr(`{"type": "ClusterIP", "clusterIP": "10.96.0.100", "port": 80}`),
}
View Source
var KubernetesCluster = models.ConfigItem{
	ID:          uuid.New(),
	Name:        lo.ToPtr("demo"),
	ConfigClass: models.ConfigClassCluster,
	ScraperID:   lo.ToPtr(KubeScrapeConfig.ID.String()),
	Type:        lo.ToPtr("Kubernetes::Cluster"),
	Health:      lo.ToPtr(models.HealthUnknown),
	ExternalID: []string{
		"cluster://kubernetes/demo",
	},
	Tags: types.JSONStringMap{
		"cluster": "demo",
	},
	Labels: lo.ToPtr(types.JSONStringMap{
		"cluster":     "demo",
		"environment": "development",
		"telemetry":   "enabled",
	}),
}
View Source
var KubernetesClusterClusterComponentRelationship = models.ConfigComponentRelationship{
	ConfigID:    KubernetesCluster.ID,
	ComponentID: ClusterComponent.ID,
}
View Source
var KubernetesNodeA = models.ConfigItem{
	ID:          uuid.New(),
	Name:        lo.ToPtr("node-a"),
	ConfigClass: models.ConfigClassNode,
	Config:      lo.ToPtr(`{"apiVersion":"v1", "kind":"Node", "metadata": {"name": "node-a"}}`),
	Type:        lo.ToPtr("Kubernetes::Node"),
	ExternalID:  pq.StringArray{"aws/us-east-1/clusters", "node://kubernetes/demo/node-a", "kubernetes/nodes"},
	CreatedAt:   DummyCreatedAt.Add(time.Hour * 24),
	Status:      lo.ToPtr("healthy"),
	Tags: types.JSONStringMap{
		"cluster": "aws",
		"account": "flanksource",
		"region":  "us-east-1",
	},
	Health: lo.ToPtr(models.HealthHealthy),
	Labels: lo.ToPtr(types.JSONStringMap{
		"cluster": "aws",
		"account": "flanksource",
		"role":    "worker",
		"region":  "us-east-1",
	}),
	Properties: &types.Properties{
		{Name: "memory", Value: lo.ToPtr(int64(64))},
		{Name: "region", Text: "us-east-1"},
	},
	CostTotal30d: 50,
}
View Source
var KubernetesNodeAChange = models.ConfigChange{
	ID:            uuid.New().String(),
	ConfigID:      KubernetesNodeA.ID.String(),
	ChangeType:    "CREATE",
	CreatedAt:     &DummyYearOldDate,
	Severity:      models.SeverityInfo,
	Source:        "Kubernetes",
	Summary:       "Kubernetes node created",
	Count:         1,
	FirstObserved: &DummyYearOldDate,
}
View Source
var KubernetesNodeAKSPool1 = models.ConfigItem{
	ID:          uuid.New(),
	Name:        lo.ToPtr("aks-pool-1"),
	ConfigClass: models.ConfigClassNode,
	ScraperID:   lo.ToPtr(KubeScrapeConfig.ID.String()),
	Type:        lo.ToPtr("Kubernetes::Node"),
	CreatedAt:   DummyCreatedAt,
	Status:      lo.ToPtr("healthy"),
	Config:      lo.ToPtr(`{"apiVersion":"v1", "kind":"Node", "metadata": {"name": "aks-pool-1"}}`),
	ExternalID: []string{
		"node://kubernetes/aks-pool-1",
	},
	Tags: types.JSONStringMap{
		"cluster":      "demo",
		"subscription": "018fbd67-bb86-90e1-07c9-243eedc73892",
	},
	Health: lo.ToPtr(models.HealthHealthy),
	Labels: lo.ToPtr(types.JSONStringMap{
		"cluster":      "demo",
		"subscription": "018fbd67-bb86-90e1-07c9-243eedc73892",
	}),
	Properties: &types.Properties{
		{Name: "memory", Value: lo.ToPtr(int64(64))},
	},
	CostTotal30d: 100,
}
View Source
var KubernetesNodeB = models.ConfigItem{
	ID:          uuid.New(),
	Name:        lo.ToPtr("node-b"),
	Config:      lo.ToPtr(`{"apiVersion":"v1", "kind":"Node", "metadata": {"name": "node-b"}}`),
	ConfigClass: models.ConfigClassNode,
	Type:        lo.ToPtr("Kubernetes::Node"),
	ExternalID:  pq.StringArray{"aws/us-west-2/clusters", "node://kubernetes/node-b", "kubernetes/nodes"},
	CreatedAt:   DummyCreatedAt.Add(time.Hour * 24 * 2),
	Status:      lo.ToPtr("healthy"),
	Tags: types.JSONStringMap{
		"cluster": "aws",
		"account": "flanksource",
	},
	Health: lo.ToPtr(models.HealthHealthy),
	Labels: lo.ToPtr(types.JSONStringMap{
		"cluster":        "aws",
		"account":        "flanksource",
		"role":           "worker",
		"region":         "us-west-2",
		"storageprofile": "managed",
	}),
	Properties: &types.Properties{
		{Name: "memory", Value: lo.ToPtr(int64(32))},
		{Name: "region", Text: "us-west-2"},
		{Name: "os", Text: "linux"},
	},
	CostTotal30d: 80,
}
View Source
var Kustomization models.ConfigItem
View Source
var KustomizeComponent = models.Component{
	ID:         uuid.MustParse("018cb576-4c81-91da-e59d-f25464b8bf91"),
	Name:       "kustomize-component",
	ExternalId: "dummy/kustomize-component",
	Type:       "FluxKustomize",
	CreatedAt:  DummyCreatedAt,
	ParentId:   &FluxComponent.ID,
	Status:     types.ComponentStatusHealthy,
	Properties: []*models.Property{{Name: "name", Text: "kustomize"}},
}
View Source
var KustomizeFluxComponent = models.Component{
	ID:         uuid.MustParse("018cb576-8036-10d8-edf1-cb49be2c0d93"),
	Name:       "kustomize-flux-component",
	ExternalId: "dummy/kustomize-flux-component",
	Type:       "Application",
	CreatedAt:  DummyCreatedAt,
	Status:     types.ComponentStatusHealthy,
	ParentId:   &KustomizeComponent.ID,
	Selectors: types.ResourceSelectors{
		{LabelSelector: "fluxcd.io/name=flux"},
	},
}
View Source
var Logistics = models.Component{
	ID:         uuid.MustParse("018681fc-e54f-bd4f-42be-068a9a69eeb5"),
	Name:       "logistics",
	Type:       "Entity",
	ExternalId: "dummy/logistics",
	Labels:     types.JSONStringMap{"telemetry": "enabled"},
	Owner:      "logistics-team",
	CreatedAt:  DummyCreatedAt,
	Status:     types.ComponentStatusHealthy,
	Health:     lo.ToPtr(models.HealthHealthy),
}
View Source
var LogisticsAPI = models.Component{
	ID:         uuid.MustParse("018681fd-5770-336f-227c-259435D7fc6b"),
	Name:       "logistics-api",
	ExternalId: "dummy/logistics-api",
	Type:       "Application",
	Status:     types.ComponentStatusHealthy,
	Labels:     types.JSONStringMap{"telemetry": "enabled"},
	Owner:      "logistics-team",
	ParentId:   &Logistics.ID,
	Path:       Logistics.ID.String(),
	CreatedAt:  DummyCreatedAt,
}
View Source
var LogisticsAPICanary = models.Canary{
	ID:        uuid.MustParse("0186b7a5-a2a4-86fd-c326-3a2104a2777f"),
	Name:      "dummy-logistics-api-canary",
	Namespace: "logistics",
	Spec:      []byte("{}"),
	CreatedAt: DummyCreatedAt,
}
View Source
var LogisticsAPIDeployment = models.ConfigItem{
	ID:          uuid.New(),
	Name:        lo.ToPtr("logistics-api"),
	Health:      lo.ToPtr(models.HealthHealthy),
	ConfigClass: models.ConfigClassDeployment,
	ScraperID:   lo.ToPtr(KubeScrapeConfig.ID.String()),
	ExternalID: []string{
		"deployment://kubernetes/demo/missioncontrol/logistics-api",
	},
	Tags: map[string]string{
		"namespace": "missioncontrol",
		"cluster":   "demo",
	},
	Config: lo.ToPtr(`{
      "apiVersion": "apps/v1",
      "kind": "Deployment",
      "metadata": {
        "name": "logistics-api",
        "namespace": "missioncontrol",
        "labels": {
          "app": "logistics-api"
        }
      },
      "spec": {
        "replicas": 3,
        "selector": {
          "matchLabels": {
            "app": "logistics-api"
          }
        },
        "template": {
          "metadata": {
            "labels": {
              "app": "logistics-api"
            }
          },
          "spec": {
            "containers": [
              {
                "name": "logistics-api",
                "image": "logistics-api:latest",
                "ports": [
                  {
                    "containerPort": 80
                  }
                ],
                "resources": {
                  "requests": {
                    "memory": "128Mi",
                    "cpu": "100m"
                  },
                  "limits": {
                    "memory": "256Mi",
                    "cpu": "500m"
                  }
                }
              }
            ]
          }
        }
      }
    }`),
	Type: lo.ToPtr("Kubernetes::Deployment"),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app": "logistics-api",
	}),
}
View Source
var LogisticsAPIDownHypothesis = models.Hypothesis{
	ID:         uuid.New(),
	IncidentID: LogisticsAPIDownIncident.ID,
	Title:      "Logistics DB database error hypothesis",
	CreatedBy:  JohnDoe.ID,
	Type:       "solution",
	Status:     "possible",
}
View Source
var LogisticsAPIDownIncident = models.Incident{
	ID:          uuid.MustParse("7c05a739-8a1c-4999-85f7-d93d03f32044"),
	Title:       "Logistics API is down",
	CreatedBy:   JohnDoe.ID,
	Type:        models.IncidentTypeAvailability,
	Status:      models.IncidentStatusOpen,
	Severity:    "Blocker",
	CommanderID: &JohnDoe.ID,
}
View Source
var LogisticsAPIHealthHTTPCheck = models.Check{
	ID:       uuid.MustParse("0186b7a4-0593-73e9-7e3d-5b3446336c1d"),
	CanaryID: LogisticsAPICanary.ID,
	Name:     "logistics-api-health-check",
	Type:     "http",
	Status:   "healthy",
	Labels: map[string]string{
		"app":       "logistics",
		"cluster":   "production-us",
		"namespace": "logistics",
		"env":       "production",
		"region":    "us-east-1",
		"pod":       "logistics-api-7b9d4f5c6-x2k4m",
		"pod_hash":  "7b9d4f5c6",
	},
}
View Source
var LogisticsAPIHealthHTTPCheckComponentRelationship = models.CheckComponentRelationship{
	ComponentID: LogisticsAPI.ID,
	CheckID:     LogisticsAPIHealthHTTPCheck.ID,
	CanaryID:    LogisticsAPIHealthHTTPCheck.CanaryID,
}
View Source
var LogisticsAPIHomeHTTPCheck = models.Check{
	ID:       uuid.MustParse("0186b7a4-625a-6a38-a9a7-e5e6b44ffec3"),
	CanaryID: LogisticsAPICanary.ID,
	Name:     "logistics-api-home-check",
	Type:     "http",
	Status:   "healthy",
	Labels: map[string]string{
		"app":       "logistics",
		"cluster":   "production-us",
		"namespace": "logistics",
		"env":       "production",
		"instance":  "i-0abc123def456",
		"revision":  "12345",
	},
}
View Source
var LogisticsAPIHomeHTTPCheckComponentRelationship = models.CheckComponentRelationship{
	ComponentID: LogisticsAPI.ID,
	CheckID:     LogisticsAPIHomeHTTPCheck.ID,
	CanaryID:    LogisticsAPIHomeHTTPCheck.CanaryID,
}
View Source
var LogisticsAPIPod = models.Component{
	ID:         uuid.MustParse("018681ff-80ed-d10d-21ef-c74f152b085b"),
	Name:       "logistics-api-7df4c7f6b7-x9k2m",
	Icon:       "icon-kubernetes-pod",
	Tooltip:    "Logistic API Pod",
	ExternalId: "dummy/logistics-api-7df4c7f6b7-x9k2m",
	Type:       "KubernetesPod",
	Status:     types.ComponentStatusHealthy,
	ParentId:   &PodsComponent.ID,
	CreatedAt:  DummyCreatedAt,
	Path:       fmt.Sprintf("%s.%s", ClusterComponent.ID.String(), PodsComponent.ID.String()),
	Properties: []*models.Property{{Name: "memory", Unit: "bytes", Value: lo.ToPtr(int64(100))}},
}
View Source
var LogisticsAPIPodConfig = models.ConfigItem{
	ID:          uuid.New(),
	ConfigClass: models.ConfigClassPod,
	ScraperID:   lo.ToPtr(KubeScrapeConfig.ID.String()),
	Name:        lo.ToPtr("logistics-api-7df4c7f6b7-x9k2m"),
	Type:        lo.ToPtr("Kubernetes::Pod"),
	Health:      lo.ToPtr(models.HealthHealthy),
	CreatedAt:   DummyCreatedAt,
	Status:      lo.ToPtr("Running"),
	ExternalID: []string{
		"pod://kubernetes/demo/missioncontrol/logistics-api-7df4c7f6b7-x9k2m",
	},
	ParentID: lo.ToPtr(LogisticsAPIReplicaSet.ID),
	Config: lo.ToPtr(`{
      "apiVersion": "v1",
      "kind": "Pod",
      "metadata": {
        "name": "logistics-api-7df4c7f6b7-x9k2m",
        "namespace": "missioncontrol",
        "labels": {
          "app": "logistics-api"
        }
      },
      "spec": {
        "containers": [
          {
            "name": "logistics-api",
            "image": "logistics-api:latest",
            "ports": [
              {
                "containerPort": 80
              }
            ],
            "resources": {
              "requests": {
                "memory": "128Mi",
                "cpu": "100m"
              },
              "limits": {
                "memory": "256Mi",
                "cpu": "500m"
              }
            }
          }
        ]
      },
      "status": {
        "phase": "Running"
      }
    }`),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app": "logistics-api",
	}),
	Tags: map[string]string{
		"namespace": "missioncontrol",
		"cluster":   "demo",
	},
	CostTotal30d: 5,
}
View Source
var LogisticsAPIPodLogFile = models.Artifact{
	ID:       uuid.MustParse("018d411b-a35c-9d53-d223-454bdb173569"),
	Path:     "/logs/pods",
	Filename: "logistics-api.txt",
	Size:     1024,
}
View Source
var LogisticsAPIPodNodeAComponentRelationship = models.ComponentRelationship{
	ComponentID:    LogisticsAPIPod.ID,
	RelationshipID: NodeA.ID,
}
View Source
var LogisticsAPIReplicaSet = models.ConfigItem{
	ID:          uuid.New(),
	ConfigClass: "ReplicaSet",
	ScraperID:   lo.ToPtr(KubeScrapeConfig.ID.String()),
	Name:        lo.ToPtr("logistics-api-7df4c7f6b7"),
	Type:        lo.ToPtr("Kubernetes::ReplicaSet"),
	Health:      lo.ToPtr(models.HealthHealthy),
	ExternalID: []string{
		"replicaset://kubernetes/demo/missioncontrol/logistics-api-7df4c7f6b7",
	},
	Tags: map[string]string{
		"namespace": "missioncontrol",
		"cluster":   "demo",
	},
	ParentID: lo.ToPtr(LogisticsAPIDeployment.ID),
	Config: lo.ToPtr(`{
      "apiVersion": "apps/v1",
      "kind": "ReplicaSet",
      "metadata": {
        "name": "logistics-api-7df4c7f6b7",
        "namespace": "missioncontrol",
        "labels": {
          "app": "logistics-api"
        }
      },
      "spec": {
        "replicas": 3,
        "selector": {
          "matchLabels": {
            "app": "logistics-api"
          }
        },
        "template": {
          "metadata": {
            "labels": {
              "app": "logistics-api"
            }
          },
          "spec": {
            "containers": [
              {
                "name": "logistics-api",
                "image": "logistics-api:latest",
                "ports": [
                  {
                    "containerPort": 80
                  }
                ],
                "resources": {
                  "requests": {
                    "memory": "128Mi",
                    "cpu": "100m"
                  },
                  "limits": {
                    "memory": "256Mi",
                    "cpu": "500m"
                  }
                }
              }
            ]
          }
        }
      }
    }`),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app": "logistics-api",
	}),
}
View Source
var LogisticsDB = models.Component{
	ID:           uuid.MustParse("018681fe-4529-c50f-26fd-530fa9c57319"),
	Name:         "logistics-db",
	ExternalId:   "dummy/logistics-db",
	Type:         "Database",
	Status:       types.ComponentStatusUnhealthy,
	StatusReason: "database not accepting connections",
	ParentId:     &LogisticsAPI.ID,
	Path:         Logistics.ID.String() + "." + LogisticsAPI.ID.String(),
	CreatedAt:    DummyCreatedAt,
}
View Source
var LogisticsDBCanary = models.Canary{
	ID:        uuid.MustParse("0186b7a5-f246-3628-0d68-30bffc13244d"),
	Name:      "dummy-logistics-db-canary",
	Namespace: "logistics",
	Spec:      []byte("{}"),
	CreatedAt: DummyCreatedAt,
}
View Source
var LogisticsDBCheck = models.Check{
	ID:       uuid.MustParse("0186b7a4-9338-7142-1b10-25dc49030218"),
	CanaryID: LogisticsDBCanary.ID,
	Name:     "logistics-db-check",
	Type:     "postgres",
	Status:   "unhealthy",
	Labels: map[string]string{
		"app":       "logistics",
		"cluster":   "staging-eu",
		"namespace": "logistics",
		"env":       "staging",
		"region":    "eu-west-1",
	},
}
View Source
var LogisticsDBCheckComponentRelationship = models.CheckComponentRelationship{
	ComponentID: LogisticsDB.ID,
	CheckID:     LogisticsDBCheck.ID,
	CanaryID:    LogisticsDBCheck.CanaryID,
}
View Source
var LogisticsDBErrorEvidence = models.Evidence{
	ID:           uuid.New(),
	HypothesisID: LogisticsAPIDownHypothesis.ID,
	ComponentID:  &LogisticsDB.ID,
	CreatedBy:    JohnDoe.ID,
	Description:  "Logisctics DB attached component",
	Type:         "component",
}
View Source
var LogisticsDBRDS = models.ConfigItem{
	ID:          uuid.New(),
	ConfigClass: models.ConfigClassDatabase,
	Health:      lo.ToPtr(models.HealthHealthy),
	Type:        lo.ToPtr("Logistics::DB::RDS"),
	ExternalID:  pq.StringArray{"aws/us-east-1/rds", "logistics"},
	Labels: lo.ToPtr(types.JSONStringMap{
		"database":    "logistics",
		"environment": "production",
		"region":      "us-east-1",
		"size":        "large",
	}),
	Tags: map[string]string{
		"namespace": "missioncontrol",
	},
}
View Source
var LogisticsDBRDSLogisticsDBComponentRelationship = models.ConfigComponentRelationship{
	ConfigID:    LogisticsDBRDS.ID,
	ComponentID: LogisticsDB.ID,
}
View Source
var LogisticsTopology = models.Topology{
	ID:        uuid.MustParse("df39086e-506b-4ad9-9af7-baf5275c382b"),
	Name:      "logistics",
	Namespace: "default",
	Source:    models.SourceUI,
}
View Source
var LogisticsUI = models.Component{
	ID:         uuid.MustParse("018681fd-c1ff-16ee-dff0-8c8796e4263e"),
	Name:       "logistics-ui",
	Type:       "Application",
	ExternalId: "dummy/logistics-ui",
	Status:     types.ComponentStatusHealthy,
	Owner:      "logistics-team",
	ParentId:   &Logistics.ID,
	Path:       Logistics.ID.String(),
	CreatedAt:  DummyCreatedAt,
}
View Source
var LogisticsUIDeployment = models.ConfigItem{
	ID:          uuid.New(),
	Name:        lo.ToPtr("logistics-ui"),
	ConfigClass: models.ConfigClassDeployment,
	ScraperID:   lo.ToPtr(KubeScrapeConfig.ID.String()),
	Health:      lo.ToPtr(models.HealthHealthy),
	Type:        lo.ToPtr("Kubernetes::Deployment"),
	Config: lo.ToPtr(`{
      "apiVersion": "apps/v1",
      "kind": "Deployment",
      "metadata": {
        "name": "logistics-ui",
        "namespace": "missioncontrol",
        "labels": {
          "app": "logistics-ui",
          "owner": "team-2"
        }
      },
      "spec": {
        "replicas": 1,
        "selector": {
          "matchLabels": {
            "app": "logistics-ui"
          }
        },
        "template": {
          "metadata": {
            "labels": {
              "app": "logistics-ui",
              "owner": "team-2",
              "environment": "production",
              "version": "2.0.1"
            }
          },
          "spec": {
            "containers": [
              {
                "name": "logistics-ui",
                "image": "logistics-ui:2.0.1",
                "ports": [
                  {
                    "containerPort": 8080
                  }
                ],
                "env": [
                  {
                    "name": "API_ENDPOINT",
                    "value": "http://logistics-api"
                  }
                ],
                "resources": {
                  "requests": {
                    "memory": "64Mi",
                    "cpu": "50m"
                  },
                  "limits": {
                    "memory": "128Mi",
                    "cpu": "250m"
                  }
                }
              }
            ]
          }
        }
      }
    }`),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app":         "logistics-ui",
		"environment": "production",
		"owner":       "team-2",
		"version":     "2.0.1",
	}),
	Tags: map[string]string{
		"namespace": "missioncontrol",
		"cluster":   "demo",
	},
}
View Source
var LogisticsUIPod = models.Component{
	ID:         uuid.MustParse("018681ff-b6c1-a14d-2fd4-8c7dac94cddd"),
	Name:       "logistics-ui-6c8f9b4d5e-m7n8p",
	Icon:       "icon-kubernetes-pod",
	Tooltip:    "Logistic UI Pod",
	Type:       "KubernetesPod",
	ExternalId: "dummy/logistics-ui-6c8f9b4d5e-m7n8p",
	Status:     types.ComponentStatusHealthy,
	ParentId:   &PodsComponent.ID,
	CreatedAt:  DummyCreatedAt,
	Path:       fmt.Sprintf("%s.%s", ClusterComponent.ID.String(), PodsComponent.ID.String()),
	Properties: []*models.Property{{Name: "memory", Unit: "bytes", Value: lo.ToPtr(int64(200))}},
}
View Source
var LogisticsUIPodConfig = models.ConfigItem{
	ID:          uuid.New(),
	ConfigClass: models.ConfigClassPod,
	ScraperID:   lo.ToPtr(KubeScrapeConfig.ID.String()),
	Name:        lo.ToPtr("logistics-ui-6c8f9b4d5e-m7n8p"),
	Type:        lo.ToPtr("Kubernetes::Pod"),
	Health:      lo.ToPtr(models.HealthHealthy),
	CreatedAt:   DummyCreatedAt,
	Status:      lo.ToPtr("Running"),
	ParentID:    lo.ToPtr(LogisticsUIReplicaSet.ID),
	Config: lo.ToPtr(`{
      "apiVersion": "v1",
      "kind": "Pod",
      "metadata": {
        "name": "logistics-ui-6c8f9b4d5e-m7n8p",
        "namespace": "missioncontrol",
        "labels": {
          "app": "logistics-ui",
          "owner": "team-2"
        }
      },
      "spec": {
        "containers": [
          {
            "name": "logistics-ui",
            "image": "logistics-ui:2.0.1",
            "ports": [
              {
                "containerPort": 8080
              }
            ],
            "env": [
              {
                "name": "API_ENDPOINT",
                "value": "http://logistics-api"
              }
            ],
            "resources": {
              "requests": {
                "memory": "64Mi",
                "cpu": "50m"
              },
              "limits": {
                "memory": "128Mi",
                "cpu": "250m"
              }
            }
          }
        ]
      },
      "status": {
        "phase": "Running"
      }
    }`),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app":         "logistics-ui",
		"environment": "production",
		"owner":       "team-2",
		"version":     "2.0.1",
	}),
	Tags: map[string]string{
		"cluster":   "demo",
		"namespace": "missioncontrol",
	},
}
View Source
var LogisticsUIPodNodeAComponentRelationship = models.ComponentRelationship{
	ComponentID:    LogisticsUIPod.ID,
	RelationshipID: NodeA.ID,
}
View Source
var LogisticsUIReplicaSet = models.ConfigItem{
	ID:          uuid.New(),
	ConfigClass: "ReplicaSet",
	ScraperID:   lo.ToPtr(KubeScrapeConfig.ID.String()),
	Name:        lo.ToPtr("logistics-ui-6c8f9b4d5e"),
	Type:        lo.ToPtr("Kubernetes::ReplicaSet"),
	Health:      lo.ToPtr(models.HealthHealthy),
	ExternalID: []string{
		"replicaset://kubernetes/demo/missioncontrol/logistics-ui-6c8f9b4d5e",
	},
	Tags: map[string]string{
		"namespace": "missioncontrol",
		"cluster":   "demo",
	},
	ParentID: lo.ToPtr(LogisticsUIDeployment.ID),
	Config: lo.ToPtr(`{
      "apiVersion": "apps/v1",
      "kind": "ReplicaSet",
      "metadata": {
        "name": "logistics-ui-6c8f9b4d5e",
        "namespace": "missioncontrol",
        "labels": {
          "app": "logistics-ui",
          "owner": "team-2"
        }
      },
      "spec": {
        "replicas": 1,
        "selector": {
          "matchLabels": {
            "app": "logistics-ui"
          }
        },
        "template": {
          "metadata": {
            "labels": {
              "app": "logistics-ui",
              "owner": "team-2",
              "environment": "production",
              "version": "2.0.1"
            }
          },
          "spec": {
            "containers": [
              {
                "name": "logistics-ui",
                "image": "logistics-ui:2.0.1",
                "ports": [
                  {
                    "containerPort": 8080
                  }
                ],
                "env": [
                  {
                    "name": "API_ENDPOINT",
                    "value": "http://logistics-api"
                  }
                ],
                "resources": {
                  "requests": {
                    "memory": "64Mi",
                    "cpu": "50m"
                  },
                  "limits": {
                    "memory": "128Mi",
                    "cpu": "250m"
                  }
                }
              }
            ]
          }
        }
      }
    }`),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app":         "logistics-ui",
		"environment": "production",
		"owner":       "team-2",
		"version":     "2.0.1",
	}),
}
View Source
var LogisticsWorker = models.Component{
	ID:         uuid.MustParse("018681fe-010a-6647-74ad-58b3a136dfe4"),
	Name:       "logistics-worker",
	ExternalId: "dummy/logistics-worker",
	Type:       "Application",
	Status:     types.ComponentStatusHealthy,
	ParentId:   &LogisticsAPI.ID,
	Path:       Logistics.ID.String() + "." + LogisticsAPI.ID.String(),
	CreatedAt:  DummyCreatedAt,
}
View Source
var LogisticsWorkerDeployment = models.ConfigItem{
	ID:          uuid.New(),
	Name:        lo.ToPtr("logistics-worker"),
	ConfigClass: models.ConfigClassDeployment,
	ScraperID:   lo.ToPtr(KubeScrapeConfig.ID.String()),
	Health:      lo.ToPtr(models.HealthHealthy),
	Type:        lo.ToPtr("Kubernetes::Deployment"),
	Config: lo.ToPtr(`{
      "apiVersion": "apps/v1",
      "kind": "Deployment",
      "metadata": {
        "name": "logistics-worker",
        "namespace": "missioncontrol",
        "labels": {
          "app": "logistics-worker",
          "owner": "team-3"
        }
      },
      "spec": {
        "replicas": 1,
        "selector": {
          "matchLabels": {
            "app": "logistics-worker"
          }
        },
        "template": {
          "metadata": {
            "labels": {
              "app": "logistics-worker"
            }
          },
          "spec": {
            "containers": [
              {
                "name": "logistics-worker",
                "image": "logistics-worker:1.5.0",
                "env": [
                  {
                    "name": "QUEUE_URL",
                    "value": "redis://redis:6379"
                  },
                  {
                    "name": "DATABASE_URL",
                    "value": "postgres://logistics-db:5432/logistics"
                  }
                ],
                "resources": {
                  "requests": {
                    "memory": "256Mi",
                    "cpu": "100m"
                  },
                  "limits": {
                    "memory": "512Mi",
                    "cpu": "500m"
                  }
                }
              }
            ]
          }
        }
      }
    }`),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app":         "logistics-worker",
		"environment": "production",
		"owner":       "team-3",
		"version":     "1.5.0",
	}),
	Tags: map[string]string{
		"namespace": "missioncontrol",
		"cluster":   "demo",
	},
}
View Source
var LogisticsWorkerPod = models.Component{
	ID:         uuid.MustParse("018681ff-e578-a926-e366-d2dc0646eafa"),
	Name:       "logistics-worker-79cb67d8f5-lr66n",
	Icon:       "icon-kubernetes-pod",
	Tooltip:    "Logistic Worker Pod",
	ExternalId: "dummy/logistics-worker-79cb67d8f5-lr66n",
	Type:       "KubernetesPod",
	Status:     types.ComponentStatusHealthy,
	ParentId:   &PodsComponent.ID,
	CreatedAt:  DummyCreatedAt,
	Path:       fmt.Sprintf("%s.%s", ClusterComponent.ID.String(), PodsComponent.ID.String()),
	Properties: []*models.Property{{Name: "memory", Unit: "bytes", Value: lo.ToPtr(int64(300))}},
}
View Source
var LogisticsWorkerPodNodeBComponentRelationship = models.ComponentRelationship{
	ComponentID:    LogisticsWorkerPod.ID,
	RelationshipID: NodeB.ID,
}
View Source
var MSSQLBackupChanges = []models.ConfigChange{
	{
		ID:         uuid.MustParse("b2c3d4e5-f6a7-8901-bcde-000000000010").String(),
		ConfigID:   MSSQLProdDatabase.ID.String(),
		ChangeType: "BackupCompleted",
		Source:     "mssql",
		Details:    types.JSON(`{"status":"success","size":"12.4GB","type":"FULL"}`),
		CreatedAt:  &appT48h,
	},
	{
		ID:         uuid.MustParse("b2c3d4e5-f6a7-8901-bcde-000000000011").String(),
		ConfigID:   MSSQLProdDatabase.ID.String(),
		ChangeType: "BackupCompleted",
		Source:     "mssql",
		Details:    types.JSON(`{"status":"success","size":"12.7GB","type":"FULL"}`),
		CreatedAt:  &appT24h,
	},
}
View Source
var MSSQLDbReaderRole = models.ExternalRole{
	ID:        uuid.MustParse("b2c3d4e5-f6a7-8901-bcde-000000000031"),
	Tenant:    "mssql",
	ScraperID: &MSSQLScrapeConfig.ID,
	RoleType:  "Fixed",
	Name:      "db_datareader",
	CreatedAt: appUserCreatedAt,
}
View Source
var MSSQLDeployment = models.ConfigItem{
	ID:          uuid.MustParse("b2c3d4e5-f6a7-8901-bcde-000000000004"),
	Name:        lo.ToPtr("mssql"),
	Type:        lo.ToPtr("Kubernetes::StatefulSet"),
	ConfigClass: "Deployment",
	Status:      lo.ToPtr("Running"),
	Health:      lo.ToPtr(models.Health("healthy")),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app":       "mssql",
		"namespace": "default",
	}),
	ScraperID: lo.ToPtr(MSSQLScrapeConfig.ID.String()),
	Config:    lo.ToPtr(`{"replicas": 1, "readyReplicas": 1, "image": "mcr.microsoft.com/azure-sql-edge:latest"}`),
}
View Source
var MSSQLDiffChanges = []models.ConfigChange{
	{
		ID:         uuid.MustParse("b2c3d4e5-f6a7-8901-bcde-000000000012").String(),
		ConfigID:   MSSQLProdDatabase.ID.String(),
		ChangeType: "diff",
		Source:     "mssql",
		Severity:   "medium",
		Summary:    "schema migration: added column orders.fulfilled_at",
		CreatedAt:  &appT48h,
	},
	{
		ID:         uuid.MustParse("b2c3d4e5-f6a7-8901-bcde-000000000013").String(),
		ConfigID:   MSSQLServer.ID.String(),
		ChangeType: "diff",
		Source:     "mssql",
		Severity:   "low",
		Summary:    "server collation updated",
		CreatedAt:  &appT12h,
	},
}
View Source
var MSSQLProdDatabase = models.ConfigItem{
	ID:          uuid.MustParse("b2c3d4e5-f6a7-8901-bcde-000000000003"),
	Name:        lo.ToPtr("prod"),
	Type:        lo.ToPtr("MSSQL::Database"),
	ConfigClass: "Database",
	Status:      lo.ToPtr("online"),
	Health:      lo.ToPtr(models.Health("healthy")),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app":       "mssql",
		"namespace": "default",
	}),
	ScraperID: lo.ToPtr(MSSQLScrapeConfig.ID.String()),
	Config:    lo.ToPtr(`{"recovery_model":"FULL","is_encrypted":true,"compatibility_level":160,"is_read_only":false}`),
}
View Source
var MSSQLReadDBAccess = models.ConfigAccess{
	ID:             "b2c3d4e5-f6a7-8901-bcde-000000000041",
	ScraperID:      &MSSQLScrapeConfig.ID,
	ConfigID:       MSSQLProdDatabase.ID,
	ExternalUserID: &MSSQLReadUser.ID,
	ExternalRoleID: &MSSQLDbReaderRole.ID,
	CreatedAt:      appUserCreatedAt,
}
View Source
var MSSQLReadUser = models.ExternalUser{
	ID:        uuid.MustParse("b2c3d4e5-f6a7-8901-bcde-000000000021"),
	Name:      "app_readonly",
	Tenant:    "mssql",
	UserType:  "SqlLogin",
	Email:     &mssqlReadEmail,
	ScraperID: MSSQLScrapeConfig.ID,
	CreatedAt: appUserCreatedAt,
}
View Source
var MSSQLSAAccessLog = models.ConfigAccessLog{
	ConfigID:       MSSQLServer.ID,
	ExternalUserID: MSSQLSAUser.ID,
	ScraperID:      MSSQLScrapeConfig.ID,
	CreatedAt:      appT2h,
	MFA:            false,
	Properties:     types.JSONMap{"ip_address": "10.0.0.5"},
}
View Source
var MSSQLSAServerAccess = models.ConfigAccess{
	ID:             "b2c3d4e5-f6a7-8901-bcde-000000000040",
	ScraperID:      &MSSQLScrapeConfig.ID,
	ConfigID:       MSSQLServer.ID,
	ExternalUserID: &MSSQLSAUser.ID,
	ExternalRoleID: &MSSQLSysAdminRole.ID,
	CreatedAt:      appUserCreatedAt,
	LastReviewedAt: &appLastReviewed,
}
View Source
var MSSQLSAUser = models.ExternalUser{
	ID:        uuid.MustParse("b2c3d4e5-f6a7-8901-bcde-000000000020"),
	Name:      "sa",
	Tenant:    "mssql",
	UserType:  "SqlLogin",
	Email:     &mssqlSAEmail,
	ScraperID: MSSQLScrapeConfig.ID,
	CreatedAt: appUserCreatedAt,
}
View Source
var MSSQLScrapeConfig = models.ConfigScraper{
	ID:        uuid.MustParse("b2c3d4e5-f6a7-8901-bcde-000000000001"),
	Name:      "mssql-scraper",
	Namespace: "default",
	Source:    models.SourceCRD,
	Spec:      `{}`,
}
View Source
var MSSQLServer = models.ConfigItem{
	ID:          uuid.MustParse("b2c3d4e5-f6a7-8901-bcde-000000000002"),
	Name:        lo.ToPtr("mssql"),
	Type:        lo.ToPtr("MSSQL::Server"),
	ConfigClass: "Database",
	Status:      lo.ToPtr("online"),
	Health:      lo.ToPtr(models.Health("healthy")),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app":       "mssql",
		"namespace": "default",
	}),
	ScraperID: lo.ToPtr(MSSQLScrapeConfig.ID.String()),
	Config:    lo.ToPtr(`{"Edition":"Developer Edition","ProductVersion":"16.0.4131.2","IsHadrEnabled":true,"Collation":"SQL_Latin1_General_CP1_CI_AS"}`),
}
View Source
var MSSQLSysAdminRole = models.ExternalRole{
	ID:        uuid.MustParse("b2c3d4e5-f6a7-8901-bcde-000000000030"),
	Tenant:    "mssql",
	ScraperID: &MSSQLScrapeConfig.ID,
	RoleType:  "Fixed",
	Name:      "sysadmin",
	CreatedAt: appUserCreatedAt,
}
View Source
var MissionControlAdminsGroup = models.ExternalGroup{
	ID:        uuid.New(),
	ScraperID: KubeScrapeConfig.ID,
	Tenant:    "flanksource",
	Name:      "mission-control-admins",
	GroupType: "group",
	CreatedAt: DummyCreatedAt,
}
View Source
var MissionControlNamespace = models.ConfigItem{
	ID:          uuid.New(),
	Name:        lo.ToPtr("missioncontrol"),
	Type:        lo.ToPtr("Kubernetes::Namespace"),
	ConfigClass: models.ConfigClassNamespace,
	Config:      lo.ToPtr(`{"apiVersion":"v1", "kind":"Namespace", "metadata": {"name": "missioncontrol"}}`),
	ScraperID:   lo.ToPtr(KubeScrapeConfig.ID.String()),
	ExternalID: []string{
		"namespace://kubernetes/demo/missioncontrol",
	},
}
View Source
var MissionControlNamespaceAccessLog = models.ConfigAccessLog{
	ConfigID:       MissionControlNamespace.ID,
	ExternalUserID: JohnDoeExternalUser.ID,
	ScraperID:      KubeScrapeConfig.ID,
	CreatedAt:      DummyCreatedAt.Add(30 * time.Minute),
	MFA:            true,
	Properties: types.JSONMap{
		"ip_address": "203.0.113.42",
		"user_agent": "kubectl/v1.27.2 (linux/amd64)",
	},
}
View Source
var MissionControlNamespaceAdminsGroupAccess = models.ConfigAccess{
	ID:              uuid.NewString(),
	ScraperID:       &KubeScrapeConfig.ID,
	ConfigID:        MissionControlNamespace.ID,
	ExternalGroupID: &MissionControlAdminsGroup.ID,
	CreatedAt:       DummyCreatedAt,
}
View Source
var MissionControlNamespaceAliceAccessLog = models.ConfigAccessLog{
	ConfigID:       MissionControlNamespace.ID,
	ExternalUserID: AliceExternalUser.ID,
	ScraperID:      KubeScrapeConfig.ID,
	CreatedAt:      DummyCreatedAt.Add(45 * time.Minute),
	MFA:            false,
	Properties: types.JSONMap{
		"ip_address": "203.0.113.43",
		"user_agent": "kubectl/v1.27.2 (linux/amd64)",
	},
}
View Source
var MissionControlNamespaceBobAccessLog = models.ConfigAccessLog{
	ConfigID:       MissionControlNamespace.ID,
	ExternalUserID: BobExternalUser.ID,
	ScraperID:      KubeScrapeConfig.ID,
	CreatedAt:      DummyCreatedAt.Add(60 * time.Minute),
	MFA:            true,
	Properties: types.JSONMap{
		"ip_address": "203.0.113.44",
		"user_agent": "kubectl/v1.27.2 (linux/amd64)",
	},
}
View Source
var MissionControlNamespaceCharlieAccessLog = models.ConfigAccessLog{
	ConfigID:       MissionControlNamespace.ID,
	ExternalUserID: CharlieExternalUser.ID,
	ScraperID:      KubeScrapeConfig.ID,
	CreatedAt:      DummyCreatedAt.Add(90 * time.Minute),
	MFA:            false,
	Properties: types.JSONMap{
		"ip_address": "203.0.113.45",
		"user_agent": "kubectl/v1.27.2 (linux/amd64)",
	},
}
View Source
var MissionControlNamespaceConfigAccess = models.ConfigAccess{
	ID:             uuid.NewString(),
	ScraperID:      &KubeScrapeConfig.ID,
	ConfigID:       MissionControlNamespace.ID,
	ExternalUserID: &JohnDoeExternalUser.ID,
	ExternalRoleID: &MissionControlNamespaceViewerRole.ID,
	CreatedAt:      DummyCreatedAt,
	LastReviewedAt: &missionControlAccessReviewedAt,
}
View Source
var MissionControlNamespaceReadersGroupAccess = models.ConfigAccess{
	ID:              uuid.NewString(),
	ScraperID:       &KubeScrapeConfig.ID,
	ConfigID:        MissionControlNamespace.ID,
	ExternalGroupID: &MissionControlReadersGroup.ID,
	CreatedAt:       DummyCreatedAt,
}
View Source
var MissionControlNamespaceViewerRole = models.ExternalRole{
	ID:        uuid.New(),
	Tenant:    "flanksource",
	ScraperID: &KubeScrapeConfig.ID,
	RoleType:  "ClusterRole",
	Name:      "namespace-viewer",
	CreatedAt: DummyCreatedAt,
}
View Source
var MissionControlPodsViewer = models.Person{
	ID:    uuid.MustParse("b5c6d7e8-f9a0-4b5c-9d8e-7f6e5a4b3c2d"),
	Name:  "Mission Control Pods Viewer",
	Email: "pods-viewer@example.com",
}
View Source
var MissionControlPodsViewerReadScopePermission = models.Permission{
	ID:             uuid.MustParse("c8d9e0f1-a2b3-4c5d-8e9f-0a1b2c3d4e5f"),
	Namespace:      "default",
	Name:           "mission-control-pods-viewer-scope-read",
	Subject:        MissionControlPodsViewer.ID.String(),
	SubjectType:    models.PermissionSubjectTypePerson,
	Action:         "read",
	ObjectSelector: types.JSON(`{"scopes": [{"name": "mission-control-pods"}]}`),
	Source:         models.SourceUI,
	CreatedAt:      DummyCreatedAt,
}
View Source
var MissionControlReadersGroup = models.ExternalGroup{
	ID:        uuid.New(),
	ScraperID: KubeScrapeConfig.ID,
	Tenant:    "flanksource",
	Name:      "mission-control-readers",
	GroupType: "group",
	CreatedAt: DummyCreatedAt,
}
View Source
var MsPlannerResponder = models.Responder{
	ID:         uuid.New(),
	IncidentID: UIDownIncident.ID,
	Type:       "MSPlanner",
	PersonID:   &JohnWick.ID,
	CreatedBy:  JohnDoe.ID,
	CreatedAt:  CurrentTime,
	UpdatedAt:  CurrentTime,
}
View Source
var Namespace models.ConfigItem
View Source
var NginxHelmRelease = models.ConfigItem{
	ID:          uuid.New(),
	Name:        lo.ToPtr("nginx-ingress"),
	ConfigClass: "HelmRelease",
	Health:      lo.ToPtr(models.HealthHealthy),
	Type:        lo.ToPtr("Helm::Release"),
	Status:      lo.ToPtr("deployed"),
	ExternalID:  pq.StringArray{"kubernetes/ingress-nginx", "helm/nginx"},
	Config: lo.ToPtr(`{
      "apiVersion": "helm.toolkit.fluxcd.io/v2beta1",
      "kind": "HelmRelease",
      "metadata": {
        "name": "nginx-ingress",
        "namespace": "ingress-nginx"
      },
      "spec": {
        "chart": {
          "spec": {
            "chart": "ingress-nginx",
            "version": "4.8.0",
            "sourceRef": {
              "kind": "HelmRepository",
              "name": "ingress-nginx"
            }
          }
        },
        "interval": "5m",
        "values": {
          "controller": {
            "replicaCount": 2
          }
        }
      }
    }`),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app":         "nginx-ingress",
		"environment": "production",
		"owner":       "platform-team",
		"version":     "4.8.0",
		"chart":       "ingress-nginx",
	}),
	Tags: map[string]string{
		"namespace": "ingress-nginx",
		"chart":     "ingress-nginx",
		"release":   "nginx-ingress",
	},
}
View Source
var NginxHelmReleaseUpgradeV1 = models.ConfigChange{
	ID:            uuid.New().String(),
	ConfigID:      NginxHelmRelease.ID.String(),
	ChangeType:    "UPDATE",
	CreatedAt:     lo.ToPtr(DummyNow.Add(-time.Hour * 72)),
	Severity:      models.SeverityInfo,
	Source:        "Flux",
	Summary:       "Helm chart upgraded from 4.7.0 to 4.7.1",
	Count:         1,
	FirstObserved: lo.ToPtr(DummyNow.Add(-time.Hour * 72)),
}

Nginx Helm Release version upgrade changes

View Source
var NginxHelmReleaseUpgradeV2 = models.ConfigChange{
	ID:            uuid.New().String(),
	ConfigID:      NginxHelmRelease.ID.String(),
	ChangeType:    "UPDATE",
	CreatedAt:     lo.ToPtr(DummyNow.Add(-time.Hour * 48)),
	Severity:      models.SeverityInfo,
	Source:        "Flux",
	Summary:       "Helm chart upgraded from 4.7.1 to 4.7.2",
	Count:         1,
	FirstObserved: lo.ToPtr(DummyNow.Add(-time.Hour * 48)),
}
View Source
var NginxHelmReleaseUpgradeV3 = models.ConfigChange{
	ID:            uuid.New().String(),
	ConfigID:      NginxHelmRelease.ID.String(),
	ChangeType:    "UPDATE",
	CreatedAt:     lo.ToPtr(DummyNow.Add(-time.Hour * 24)),
	Severity:      models.SeverityInfo,
	Source:        "Flux",
	Summary:       "Helm chart upgraded from 4.7.2 to 4.8.0",
	Count:         1,
	FirstObserved: lo.ToPtr(DummyNow.Add(-time.Hour * 24)),
}
View Source
var NginxIngressPod = models.ConfigItem{
	ID:          uuid.New(),
	Name:        lo.ToPtr("nginx-ingress-controller-7d9b8f6c4-xplmn"),
	ConfigClass: "Pod",
	Health:      lo.ToPtr(models.HealthHealthy),
	Type:        lo.ToPtr("Kubernetes::Pod"),
	Status:      lo.ToPtr("Running"),
	ParentID:    lo.ToPtr(NginxHelmRelease.ID),
	ExternalID:  pq.StringArray{"kubernetes/ingress-nginx/pods"},
	Config: lo.ToPtr(`{
      "apiVersion": "v1",
      "kind": "Pod",
      "metadata": {
        "name": "nginx-ingress-controller-7d9b8f6c4-xplmn",
        "namespace": "ingress-nginx",
        "labels": {
          "app.kubernetes.io/component": "controller",
          "app.kubernetes.io/instance": "nginx-ingress",
          "app.kubernetes.io/name": "ingress-nginx",
          "helm.sh/chart": "ingress-nginx-4.8.0"
        }
      },
      "spec": {
        "containers": [
          {
            "name": "controller",
            "image": "registry.k8s.io/ingress-nginx/controller:v1.8.1",
            "ports": [
              {
                "containerPort": 80,
                "name": "http"
              },
              {
                "containerPort": 443,
                "name": "https"
              }
            ]
          }
        ]
      },
      "status": {
        "phase": "Running",
        "conditions": [
          {
            "type": "Ready",
            "status": "True"
          }
        ]
      }
    }`),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app":                         "ingress-nginx",
		"app.kubernetes.io/component": "controller",
		"app.kubernetes.io/instance":  "nginx-ingress",
		"app.kubernetes.io/name":      "ingress-nginx",
		"helm.sh/chart":               "ingress-nginx-4.8.0",
	}),
	Tags: map[string]string{
		"namespace": "ingress-nginx",
		"pod":       "nginx-ingress-controller",
		"release":   "nginx-ingress",
	},
}
View Source
var NoMatchNotification = models.Notification{
	ID:        uuid.MustParse("605dcaaa-9637-4ff3-bb57-233b8a151e3a"),
	Name:      "no-match-notification",
	Namespace: "default",
	CreatedAt: time.Now(),
	UpdatedAt: time.Now(),
	Title:     "The title",
	Template:  "The body",
	Filter:    "false",
	PersonID:  &JohnDoe.ID,
	Source:    models.SourceUI,
	Events:    []string{"config.unhealthy", "config.warn"},
}
View Source
var NodeA = models.Component{
	ID:         uuid.MustParse("018681fe-f5aa-37e9-83f7-47b5b0232d5e"),
	Name:       "node-a",
	Icon:       "icon-kubernetes-node",
	Tooltip:    "Node A",
	ExternalId: "dummy/node-a",
	Type:       "KubernetesNode",
	Status:     types.ComponentStatusHealthy,
	ParentId:   &NodesComponent.ID,
	CreatedAt:  DummyCreatedAt,
	Path:       fmt.Sprintf("%s.%s", ClusterComponent.ID.String(), NodesComponent.ID.String()),
}
View Source
var NodeB = models.Component{
	ID:         uuid.MustParse("018681ff-227e-4d71-b38e-0693cc862213"),
	Name:       "node-b",
	Icon:       "icon-kubernetes-node",
	Tooltip:    "Node B",
	ExternalId: "dummy/node-b",
	Type:       "KubernetesNode",
	Status:     types.ComponentStatusHealthy,
	ParentId:   &NodesComponent.ID,
	CreatedAt:  DummyCreatedAt,
	Path:       fmt.Sprintf("%s.%s", ClusterComponent.ID.String(), NodesComponent.ID.String()),
}
View Source
var NodesComponent = models.Component{
	ID:         uuid.MustParse("018681fe-b27e-7627-72c2-ad18e93f72f4"),
	Name:       "Nodes",
	Icon:       "icon-kubernetes-node",
	Tooltip:    "Kubernetes Nodes",
	ExternalId: "dummy/nodes",
	Type:       "KubernetesNodes",
	Status:     types.ComponentStatusHealthy,
	ParentId:   &ClusterComponent.ID,
	CreatedAt:  DummyCreatedAt,
	Path:       ClusterComponent.ID.String(),
}
View Source
var PaymentsAPI = models.Component{
	ID:         uuid.MustParse("4643e4de-6215-4c71-9600-9cf69b2cbbee"),
	AgentID:    GCPAgent.ID,
	Name:       "payments-api",
	ExternalId: "dummy/payments-api",
	Type:       "Application",
	CreatedAt:  DummyCreatedAt,
	Status:     types.ComponentStatusHealthy,
}
View Source
var PipelineView = models.ViewPanel{
	ViewID:   PodView.ID,
	AgentID:  uuid.Nil,
	IsPushed: false,
	Results: types.JSON([]byte(`[
		{
			"name": "Average Duration",
			"description": "Create Release average duration",
			"type": "number",
			"number": {
				"unit": "seconds"
			},
			"rows": [
				{
					"repository_full_name": "flanksource/canary-checker",
					"value": "100"
				},
				{
					"repository_full_name": "flanksource/config-db",
					"value": "200"
				},
				{
					"repository_full_name": "flanksource/duty",
					"value": "300"
				}
			]
		}
	]`)),
}
View Source
var PodView = models.View{
	ID:        uuid.New(),
	Name:      "pods",
	Namespace: "default",
	Labels: types.JSONStringMap{
		"environment": "production",
		"team":        "platform",
		"version":     "v1.2.0",
	},
	Spec: types.JSON([]byte(`{
   "display": {
      "title": "Pods",
      "icon": "pod"
   },
   "queries": {
      "pods": {
         "configs": {
            "types": [
               "Kubernetes::Pod"
            ]
         }
      }
   },
   "panels": [
      {
         "name": "Pods",
         "description": "Number of Pods",
         "type": "gauge",
         "gauge": {
            "min": "0",
            "max": "100",
            "thresholds": [
               {
                  "value": 0,
                  "color": "green"
               },
               {
                  "value": 60,
                  "color": "orange"
               },
               {
                  "value": 90,
                  "color": "red"
               }
            ]
         },
         "query": "SELECT COUNT(*) AS value FROM pods"
      }
   ],
   "columns": [
      {
         "name": "id",
         "type": "string",
         "primaryKey": true
      },
      {
         "name": "name",
         "type": "string"
      },
      {
         "name": "status",
         "type": "status"
      }
   ]
}`)),
	Source:    "KubernetesCRD",
	CreatedBy: lo.ToPtr(JohnDoe.ID),
	CreatedAt: DummyCreatedAt,
}
View Source
var PodViewTable = ViewGeneratedTable{
	View: PodView,
	Rows: []map[string]any{
		{
			"id":     NginxIngressPod.ID.String(),
			"name":   *NginxIngressPod.Name,
			"status": *NginxIngressPod.Status,
		},
		{
			"id":     LogisticsAPIPodConfig.ID.String(),
			"name":   *LogisticsAPIPodConfig.Name,
			"status": *LogisticsAPIPodConfig.Status,
		},
		{
			"id":     LogisticsUIPodConfig.ID.String(),
			"name":   *LogisticsUIPodConfig.Name,
			"status": *LogisticsUIPodConfig.Status,
		},
	},
}
View Source
var PodsComponent = models.Component{
	ID:         uuid.MustParse("018681ff-559f-7183-19d1-7d898b4e1413"),
	Name:       "Pods",
	Icon:       "icon-kubernetes-pod",
	Tooltip:    "Kubernetes Pods",
	ExternalId: "dummy/pods",
	Type:       "KubernetesPods",
	Status:     types.ComponentStatusHealthy,
	ParentId:   &ClusterComponent.ID,
	CreatedAt:  DummyCreatedAt,
	Path:       ClusterComponent.ID.String(),
}
View Source
var PopAPIDBChanges = []models.ConfigChange{
	{
		ID:         uuid.MustParse("c3d4e5f6-a7b8-9012-cdef-000000000012").String(),
		ConfigID:   PopAPIDatabase.ID.String(),
		ChangeType: "BackupCompleted",
		Source:     "postgresql",
		Details:    types.JSON(`{"status":"success","size":"512MB"}`),
		CreatedAt:  &appT24h,
	},
}
View Source
var PopAPIDatabase = models.ConfigItem{
	ID:          uuid.MustParse("c3d4e5f6-a7b8-9012-cdef-000000000003"),
	Name:        lo.ToPtr("pop-api-db"),
	Type:        lo.ToPtr("PostgreSQL::Database"),
	ConfigClass: "Database",
	Status:      lo.ToPtr("available"),
	Health:      lo.ToPtr(models.Health("healthy")),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app": "pop-api",
		"env": "production",
	}),
	ScraperID: lo.ToPtr(GitHubScrapeConfig.ID.String()),
	Config:    lo.ToPtr(`{"version":"16.2","encoding":"UTF8","size_mb":512}`),
}
View Source
var PopAPIRepo = models.ConfigItem{
	ID:          uuid.MustParse("c3d4e5f6-a7b8-9012-cdef-000000000002"),
	Name:        lo.ToPtr("pop-api"),
	Type:        lo.ToPtr("GitHub::Repository"),
	ConfigClass: "Repository",
	Status:      lo.ToPtr("active"),
	Health:      lo.ToPtr(models.Health("healthy")),
	Labels: lo.ToPtr(types.JSONStringMap{
		"org":  "flanksource",
		"lang": "Go",
	}),
	ScraperID: lo.ToPtr(GitHubScrapeConfig.ID.String()),
	Config:    lo.ToPtr(`{"default_branch":"main","stars":42,"open_issues":3,"visibility":"public"}`),
}
View Source
var PopAPIRepoDiffChanges = []models.ConfigChange{
	{
		ID:         uuid.MustParse("c3d4e5f6-a7b8-9012-cdef-000000000010").String(),
		ConfigID:   PopAPIRepo.ID.String(),
		ChangeType: "diff",
		Source:     "github",
		Severity:   "info",
		Summary:    "PR #124 merged: add connection pooling",
		CreatedAt:  &appT48h,
	},
	{
		ID:         uuid.MustParse("c3d4e5f6-a7b8-9012-cdef-000000000011").String(),
		ConfigID:   PopAPIRepo.ID.String(),
		ChangeType: "diff",
		Source:     "github",
		Severity:   "low",
		Summary:    "tag pushed: v0.9.3",
		CreatedAt:  &appT12h,
	},
}
View Source
var PostgresConnection = models.Connection{
	ID:        uuid.MustParse("6c4c4c4c-0000-0000-0000-000000000002"),
	Name:      "postgres-connection",
	Namespace: "production",
	Source:    models.SourceConfigFile,
	Type:      "postgres",
}
View Source
var RDSBackupChanges = []models.ConfigChange{
	{
		ID:         uuid.New().String(),
		ConfigID:   RDSInstance.ID.String(),
		ChangeType: "BackupCompleted",
		Source:     "AWS",
		Details:    types.JSON(`{"status":"success","size":"4.2GB"}`),
		CreatedAt:  &appT48h,
	},
	{
		ID:         uuid.New().String(),
		ConfigID:   RDSInstance.ID.String(),
		ChangeType: "BackupCompleted",
		Source:     "AWS",
		Details:    types.JSON(`{"status":"success","size":"4.3GB"}`),
		CreatedAt:  &appT24h,
	},
	{
		ID:         uuid.New().String(),
		ConfigID:   RDSInstance.ID.String(),
		ChangeType: "BackupRestored",
		Source:     "AWS",
		Details:    types.JSON(`{"status":"success"}`),
		CreatedAt:  &appT12h,
	},
}
View Source
var RDSInstance = models.ConfigItem{
	ID:          uuid.New(),
	Name:        lo.ToPtr("incident-commander-db"),
	Type:        lo.ToPtr("AWS::RDS::Instance"),
	ConfigClass: "Database",
	Tags:        types.JSONStringMap{"region": "us-east-1", "account-name": "flanksource-prod"},
	Labels: lo.ToPtr(types.JSONStringMap{
		"app":          "incident-commander-db",
		"region":       "us-east-1",
		"account-name": "flanksource-prod",
	}),
	ScraperID: lo.ToPtr(AWSScrapeConfig.ID.String()),
	Config:    lo.ToPtr(`{"engine": "postgres", "status": "available", "instanceClass": "db.t3.medium"}`),
}
View Source
var RLSTestUserMissionControlPodsScope = models.Scope{
	ID:          uuid.MustParse("a1b2c3d4-e5f6-4a5b-9c8d-7e6f5a4b3c2d"),
	Name:        "mission-control-pods",
	Namespace:   "missioncontrol",
	Description: "Scope for accessing pods in the missioncontrol namespace",
	Source:      models.SourceUI,
	CreatedAt:   DummyCreatedAt,
	UpdatedAt:   DummyCreatedAt,
	Targets: types.JSON(`[
    {
      "config": {
        "namespace": "missioncontrol",
        "tagSelector": "type=pod"
      }
    }
  ]`),
}
View Source
var RedisHelmRelease = models.ConfigItem{
	ID:          uuid.New(),
	Name:        lo.ToPtr("redis"),
	ConfigClass: "HelmRelease",
	Health:      lo.ToPtr(models.HealthHealthy),
	Type:        lo.ToPtr("Helm::Release"),
	Status:      lo.ToPtr("deployed"),
	ExternalID:  pq.StringArray{"kubernetes/database", "helm/redis"},
	Config: lo.ToPtr(`{
      "apiVersion": "helm.toolkit.fluxcd.io/v2beta1",
      "kind": "HelmRelease",
      "metadata": {
        "name": "redis",
        "namespace": "database"
      },
      "spec": {
        "chart": {
          "spec": {
            "chart": "redis",
            "version": "18.1.5",
            "sourceRef": {
              "kind": "HelmRepository",
              "name": "bitnami"
            }
          }
        },
        "interval": "10m",
        "values": {
          "replica": {
            "replicaCount": 1
          },
          "auth": {
            "enabled": true
          }
        }
      }
    }`),
	Labels: lo.ToPtr(types.JSONStringMap{
		"app":         "redis",
		"environment": "production",
		"owner":       "data-team",
		"version":     "18.1.5",
		"chart":       "redis",
	}),
	Tags: map[string]string{
		"namespace": "database",
		"chart":     "redis",
		"release":   "redis",
	},
}
View Source
var RedisHelmReleaseUpgradeV1 = models.ConfigChange{
	ID:            uuid.New().String(),
	ConfigID:      RedisHelmRelease.ID.String(),
	ChangeType:    "UPDATE",
	CreatedAt:     lo.ToPtr(DummyNow.Add(-time.Hour * 96)),
	Severity:      models.SeverityInfo,
	Source:        "Flux",
	Summary:       "Helm chart upgraded from 18.0.2 to 18.1.0",
	Count:         1,
	FirstObserved: lo.ToPtr(DummyNow.Add(-time.Hour * 96)),
}

Redis Helm Release version upgrade changes

View Source
var RedisHelmReleaseUpgradeV2 = models.ConfigChange{
	ID:            uuid.New().String(),
	ConfigID:      RedisHelmRelease.ID.String(),
	ChangeType:    "UPDATE",
	CreatedAt:     lo.ToPtr(DummyNow.Add(-time.Hour * 60)),
	Severity:      models.SeverityInfo,
	Source:        "Flux",
	Summary:       "Helm chart upgraded from 18.1.0 to 18.1.3",
	Count:         1,
	FirstObserved: lo.ToPtr(DummyNow.Add(-time.Hour * 60)),
}
View Source
var RedisHelmReleaseUpgradeV3 = models.ConfigChange{
	ID:         uuid.New().String(),
	ConfigID:   RedisHelmRelease.ID.String(),
	ChangeType: "UPDATE",
	CreatedAt:  lo.ToPtr(DummyNow.Add(-time.Hour * 36)),
	Severity:   models.SeverityInfo,
	Source:     "Flux",
	Summary:    "Helm chart upgraded from 18.1.3 to 18.1.5",
	Details: []byte(`{
		"old_version": "18.1.3",
		"new_version": "18.1.5"
	}`),
	Count:         1,
	FirstObserved: lo.ToPtr(DummyNow.Add(-time.Hour * 36)),
}
View Source
var RestartPod = models.Playbook{
	ID:          uuid.MustParse("17ffd27a-b33f-4ee6-80d6-b83430a4a16f"),
	Name:        "restart-pod",
	Namespace:   "mc",
	Title:       "Restart Pod",
	Description: "Restarts a Kubernetes pod",
	Source:      models.SourceUI,
	Category:    "Kubernetes",
	Spec: []byte(`{
		"category": "Kubernetes",
		"description": "Restarts a Kubernetes pod",
		"configs": [
			{
				"type": "Kubernetes::Pod"
			}
		],
		"actions": [
			{
				"name": "Delete pod",
				"exec": {
					"script": "kubectl delete pod {{.config.name}} -n {{.config.tags.namespace}}"
				}
			}
		]
	}`),
}
View Source
var RestartPodRun1 = models.PlaybookRun{
	ID:         uuid.MustParse("37ffd27a-b33f-4ee6-80d6-b83430a4a16e"),
	PlaybookID: RestartPod.ID,
	ConfigID:   &LogisticsAPIDeployment.ID,
	Status:     models.PlaybookRunStatusCompleted,
	Spec:       []byte("{}"),
	CreatedAt:  DummyCreatedAt.Add(time.Minute * 20),
}
View Source
var RestartPodRun2 = models.PlaybookRun{
	ID:         uuid.MustParse("47ffd27a-b33f-4ee6-80d6-b83430a4a16e"),
	ConfigID:   &LogisticsAPIDeployment.ID,
	PlaybookID: RestartPod.ID,
	Status:     models.PlaybookRunStatusFailed,
	Spec:       []byte("{}"),
	CreatedAt:  DummyCreatedAt.Add(time.Minute * 30),
}
View Source
var SecondComment = models.Comment{
	ID:         uuid.New(),
	CreatedBy:  JohnDoe.ID,
	Comment:    "A comment by John Doe",
	IncidentID: LogisticsAPIDownIncident.ID,
	CreatedAt:  CurrentTime,
	UpdatedAt:  CurrentTime,
}
View Source
var SlackResponder = models.Responder{
	ID:         uuid.New(),
	IncidentID: UIDownIncident.ID,
	Type:       "Slack",
	TeamID:     &BackendTeam.ID,
	CreatedBy:  JohnDoe.ID,
	CreatedAt:  CurrentTime,
	UpdatedAt:  CurrentTime,
}
View Source
var TelegramResponder = models.Responder{
	ID:         uuid.New(),
	IncidentID: UIDownIncident.ID,
	Type:       "Telegram",
	PersonID:   &JohnDoe.ID,
	CreatedBy:  JohnDoe.ID,
	CreatedAt:  CurrentTime,
	UpdatedAt:  CurrentTime,
}
View Source
var ThirdComment = models.Comment{
	ID:         uuid.New(),
	CreatedBy:  JohnDoe.ID,
	Comment:    "Another comment by John Doe",
	IncidentID: LogisticsAPIDownIncident.ID,
	CreatedAt:  CurrentTime,
	UpdatedAt:  CurrentTime,
}
View Source
var UICanary = models.Canary{
	ID:        uuid.MustParse("c69f14cd-0041-4012-89f8-b5ed446ed8e9"),
	Name:      "ui-canary",
	Namespace: "cart",
	Spec:      []byte("{}"),
	CreatedAt: DummyCreatedAt,
	DeletedAt: lo.ToPtr(DummyCreatedAt.Add(time.Hour)),
}
View Source
var UIDownIncident = models.Incident{
	ID:          uuid.MustParse("0c00b8a6-5bf8-42a4-98fe-2d39ddcb67cb"),
	Title:       "UI is down",
	CreatedBy:   JohnDoe.ID,
	Type:        models.IncidentTypeAvailability,
	Status:      models.IncidentStatusOpen,
	Severity:    "Blocker",
	CommanderID: &JohnWick.ID,
}
View Source
var ViewDev = models.View{
	ID:        uuid.New(),
	Name:      "Dev Dashboard",
	Namespace: "development",
	Labels: types.JSONStringMap{
		"environment": "development",
		"team":        "platform",
		"version":     "v1.1.0",
	},
	Spec: types.JSON([]byte(`{
	  "queries": {
			"services": {
				"configs": {
					"types": [
						"Kubernetes::Service"
					]
				}
			}
		},
	  "panels": [
		{
		  "name": "Services",
		  "description": "Number of Services",
		  "type": "stat",
		  "query": "SELECT COUNT(*) AS value FROM services"
		}
	  ]
	}`)),
	Source:    "KubernetesCRD",
	CreatedBy: lo.ToPtr(JohnDoe.ID),
	CreatedAt: DummyCreatedAt,
}

Functions

func AllDummyCheckStatuses

func AllDummyCheckStatuses() []models.CheckStatus

func AllDummyChecks

func AllDummyChecks() []models.Check

func AllDummyConfigAnalysis

func AllDummyConfigAnalysis() []models.ConfigAnalysis

func DeleteAll added in v1.0.561

func DeleteAll[T models.DBTable](gormDB *gorm.DB, items []T) error

func GetConfig added in v1.0.660

func GetConfig(configType, namespace, name string) models.ConfigItem

func ImportConfigs added in v1.0.660

func ImportConfigs(data []byte) (configs []models.ConfigItem, relationships []models.ConfigRelationship, err error)

func ImportViews added in v1.0.1074

func ImportViews(data []byte) ([]models.View, error)

Types

type DummyData

type DummyData struct {
	People []models.Person
	Agents []models.Agent

	Playbooks    []models.Playbook
	PlaybookRuns []models.PlaybookRun
	Connections  []models.Connection

	Topologies             []models.Topology
	Components             []models.Component
	ComponentRelationships []models.ComponentRelationship

	Configs                      []models.ConfigItem
	ConfigLocations              []models.ConfigLocation
	ConfigRelationships          []models.ConfigRelationship
	ConfigScrapers               []models.ConfigScraper
	ConfigChanges                []models.ConfigChange
	ConfigAnalyses               []models.ConfigAnalysis
	ConfigComponentRelationships []models.ConfigComponentRelationship

	ExternalUsers      []models.ExternalUser
	ExternalRoles      []models.ExternalRole
	ExternalGroups     []models.ExternalGroup
	ExternalUserGroups []models.ExternalUserGroup
	ConfigAccesses     []models.ConfigAccess
	ConfigAccessLogs   []models.ConfigAccessLog

	Notifications []models.Notification

	Teams      []models.Team
	Incidents  []models.Incident
	Hypotheses []models.Hypothesis
	Responders []models.Responder
	Evidences  []models.Evidence
	Comments   []models.Comment

	Views      []models.View
	ViewPanels []models.ViewPanel
	ViewTables []ViewGeneratedTable

	Canaries                    []models.Canary
	Checks                      []models.Check
	CheckStatuses               []models.CheckStatus
	CheckComponentRelationships []models.CheckComponentRelationship

	Artifacts    []models.Artifact
	JobHistories []models.JobHistory

	Permissions []models.Permission
	Scopes      []models.Scope
}

func GenerateDynamicDummyData

func GenerateDynamicDummyData(db *gorm.DB) DummyData

GenerateDynamicDummyData is similar to GetStaticDummyData() except that the ids are randomly generated on call.

func GetAllApplicationDummyData added in v1.0.1195

func GetAllApplicationDummyData() DummyData

GetAllApplicationDummyData merges all application archetypes into a single DummyData. The original GetApplicationDummyData() is kept unchanged for backward compatibility.

func GetApplicationDummyData added in v1.0.1195

func GetApplicationDummyData() DummyData

GetApplicationDummyData returns mock data for an application (RDS instance, deployments, backup/restore changes, security findings, users and access records).

func GetAzDevOpsDummyData added in v1.0.1195

func GetAzDevOpsDummyData() DummyData

func GetKubernetesAppDummyData added in v1.0.1195

func GetKubernetesAppDummyData() DummyData

func GetMSSQLAppDummyData added in v1.0.1195

func GetMSSQLAppDummyData() DummyData

func GetPopAPIDummyData added in v1.0.1195

func GetPopAPIDummyData() DummyData

func GetStaticDummyData

func GetStaticDummyData(db *gorm.DB) DummyData

func (*DummyData) Delete

func (t *DummyData) Delete(gormDB *gorm.DB) error

func (*DummyData) Populate

func (t *DummyData) Populate(ctx context.Context) error

type ViewGeneratedTable added in v1.0.1041

type ViewGeneratedTable struct {
	View models.View
	Rows []map[string]any
}

Jump to

Keyboard shortcuts

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