auto find the orborus container

This commit is contained in:
yashsinghcodes
2025-11-24 16:44:06 +05:30
parent 28a9dda437
commit b1f23f814e
+23
View File
@@ -2416,6 +2416,27 @@ func main() {
}
if swarmConfig == "run" || swarmConfig == "swarm" || isKubernetes == "true" {
if os.Getenv("SHUFFLE_EC2_INSTANCE") == "true" {
log.Printf("[INFO] Detected AWS EC2 instance. Setting up Docker Swarm with AWS optimizations.")
containers, err := dockercli.ContainerList(ctx, container.ListOptions{})
if err == nil {
for _, container := range containers {
if strings.Contains(container.Image, "shuffle-orborus") {
if len(container.Names) != 0 {
if strings.Contains(container.Names[0], "shuffle-orborus") {
containerName = container.Names[0]
containerName = strings.TrimPrefix(containerName, "/")
os.Setenv("ORBORUS_CONTAINER_NAME", containerName)
log.Printf("[DEBUG] Found orborus container name: %s", containerName)
}
}
}
}
} else {
log.Printf("[ERROR] Failed to find orborus container: %s", err)
}
}
if isKubernetes != "true" {
checkSwarmService(ctx)
}
@@ -2750,6 +2771,8 @@ func main() {
fmt.Sprintf("/detections/Sigma"),
org,
true,
"LOW",
"TENZIR_START",
)
if err != nil {