refactor: rename aggregator-agent to agent for public release
This commit is contained in:
parent
788d799266
commit
c8b0ee1040
371 changed files with 340 additions and 341 deletions
63
.gitignore
vendored
63
.gitignore
vendored
|
|
@ -255,32 +255,31 @@ Thumbs.db
|
|||
redflag-agent
|
||||
redflag-server
|
||||
redflag-agent.exe
|
||||
aggregator-agent/redflag-agent
|
||||
aggregator-agent/aggregator-agent
|
||||
aggregator-agent/redflag-agent.exe
|
||||
aggregator-agent/agent
|
||||
aggregator-agent/agent-test
|
||||
aggregator-agent/test-agent-*
|
||||
aggregator-agent/test-redflag-agent
|
||||
aggregator-server/redflag-server
|
||||
aggregator-server/server
|
||||
agent/redflag-agent
|
||||
agent/redflag-agent.exe
|
||||
agent/agent
|
||||
agent/agent-test
|
||||
agent/test-agent-*
|
||||
agent/test-redflag-agent
|
||||
server/redflag-server
|
||||
server/server
|
||||
|
||||
# Agent configuration (may contain sensitive data)
|
||||
aggregator-agent/config.json
|
||||
aggregator-agent/.agent-id
|
||||
aggregator-agent/.token
|
||||
agent/config.json
|
||||
agent/.agent-id
|
||||
agent/.token
|
||||
|
||||
# Server runtime files
|
||||
aggregator-server/logs/
|
||||
aggregator-server/data/
|
||||
aggregator-server/uploads/
|
||||
server/logs/
|
||||
server/data/
|
||||
server/uploads/
|
||||
|
||||
# Local cache files
|
||||
aggregator-agent/cache/
|
||||
aggregator-agent/*.cache
|
||||
/var/lib/aggregator/
|
||||
/var/cache/aggregator/
|
||||
/var/log/aggregator/
|
||||
agent/cache/
|
||||
agent/*.cache
|
||||
/var/lib/redflag/
|
||||
/var/cache/redflag/
|
||||
/var/log/redflag/
|
||||
|
||||
# Test files and coverage
|
||||
coverage.txt
|
||||
|
|
@ -296,7 +295,7 @@ test-results/
|
|||
dev/
|
||||
|
||||
# Development packages and scripts
|
||||
aggregator-server/scripts/
|
||||
server/scripts/
|
||||
|
||||
# Build artifacts
|
||||
*.tar.gz
|
||||
|
|
@ -417,11 +416,11 @@ secrets/
|
|||
!Screenshots/*.jpeg
|
||||
|
||||
# Core functionality (needed for working system)
|
||||
!aggregator-agent/internal/installer/
|
||||
!aggregator-agent/internal/scanner/dnf.go
|
||||
!aggregator-server/internal/api/handlers/
|
||||
!aggregator-server/internal/services/
|
||||
!aggregator-server/internal/database/migrations/
|
||||
!agent/internal/installer/
|
||||
!agent/internal/scanner/dnf.go
|
||||
!server/internal/api/handlers/
|
||||
!server/internal/services/
|
||||
!server/internal/database/migrations/
|
||||
|
||||
# Only minimal README, no other documentation
|
||||
|
||||
|
|
@ -478,14 +477,14 @@ docker-compose.dev.yml
|
|||
discord/
|
||||
discord/.env.example
|
||||
# Local bin folder (build artifacts)
|
||||
aggregator-server/bin/
|
||||
aggregator-agent/bin/
|
||||
server/bin/
|
||||
agent/bin/
|
||||
|
||||
# Local workspace files
|
||||
*.code-workspace
|
||||
# Stale WIP files (Dec 2025)
|
||||
aggregator-agent/internal/event/helpers.go
|
||||
aggregator-agent/internal/retry/
|
||||
aggregator-web/src/contexts/
|
||||
aggregator-server/internal/database/migrations/025_platform_scanner_subsystems.down.sql
|
||||
agent/internal/event/helpers.go
|
||||
agent/internal/retry/
|
||||
web/src/contexts/
|
||||
server/internal/database/migrations/025_platform_scanner_subsystems.down.sql
|
||||
vanguards-memories/
|
||||
|
|
|
|||
20
Makefile
20
Makefile
|
|
@ -7,7 +7,7 @@ help: ## Show this help message
|
|||
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-15s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
||||
|
||||
db-up: ## Start PostgreSQL database
|
||||
docker-compose up -d aggregator-db
|
||||
docker-compose up -d postgres
|
||||
@echo "Waiting for database to be ready..."
|
||||
@sleep 3
|
||||
|
||||
|
|
@ -15,29 +15,29 @@ db-down: ## Stop PostgreSQL database
|
|||
docker-compose down
|
||||
|
||||
server: ## Build and run the server
|
||||
cd aggregator-server && go mod tidy && go run cmd/server/main.go
|
||||
cd server && go mod tidy && go run cmd/server/main.go
|
||||
|
||||
agent: ## Build and run the agent
|
||||
cd aggregator-agent && go mod tidy && go run cmd/agent/main.go
|
||||
cd agent && go mod tidy && go run cmd/agent/main.go
|
||||
|
||||
build-server: ## Build server binary
|
||||
cd aggregator-server && go mod tidy && go build -o bin/aggregator-server cmd/server/main.go
|
||||
cd server && go mod tidy && go build -o bin/server cmd/server/main.go
|
||||
|
||||
build-agent: ## Build agent binary
|
||||
cd aggregator-agent && go mod tidy && go build -o bin/aggregator-agent cmd/agent/main.go
|
||||
cd agent && go mod tidy && go build -o bin/agent cmd/agent/main.go
|
||||
|
||||
build-agent-simple: ## Build agent binary with simple script
|
||||
@./scripts/build-secure-agent.sh
|
||||
|
||||
clean: ## Clean build artifacts
|
||||
rm -rf aggregator-server/bin aggregator-agent/bin
|
||||
rm -rf server/bin agent/bin
|
||||
|
||||
build-all: ## Build with go mod tidy for fresh clones
|
||||
@echo "Building all components with dependency cleanup..."
|
||||
cd aggregator-server && go mod tidy && go build -o redflag-server cmd/server/main.go
|
||||
cd aggregator-agent && go mod tidy && go build -o redflag-agent cmd/agent/main.go
|
||||
cd server && go mod tidy && go build -o redflag-server cmd/server/main.go
|
||||
cd agent && go mod tidy && go build -o redflag-agent cmd/agent/main.go
|
||||
@echo "Build complete!"
|
||||
|
||||
test: ## Run tests
|
||||
cd aggregator-server && go test ./...
|
||||
cd aggregator-agent && go test ./...
|
||||
cd server && go test ./...
|
||||
cd agent && go test ./...
|
||||
|
|
|
|||
|
|
@ -10,4 +10,4 @@ Copyright 2022 Zheng Dayu
|
|||
Licensed under the Apache License, Version 2.0
|
||||
https://github.com/ceshihao/windowsupdate
|
||||
|
||||
Included in: aggregator-agent/pkg/windowsupdate/
|
||||
Included in: agent/pkg/windowsupdate/
|
||||
|
|
@ -7,9 +7,9 @@ import (
|
|||
"runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/config"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/service"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/version"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/config"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/service"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/version"
|
||||
)
|
||||
|
||||
// CLIFlags holds all command-line flags
|
||||
|
|
@ -7,14 +7,14 @@ import (
|
|||
"runtime"
|
||||
"runtime/debug"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/agent"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/config"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/constants"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/handlers"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/migration"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/registration"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/service"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/version"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/agent"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/config"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/constants"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/handlers"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/migration"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/registration"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/service"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/version"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
module github.com/Fimeg/RedFlag/aggregator-agent
|
||||
module github.com/Fimeg/RedFlag/agent
|
||||
|
||||
go 1.23.0
|
||||
|
||||
|
|
@ -7,20 +7,20 @@ import (
|
|||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/acknowledgment"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/circuitbreaker"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/config"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/constants"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/handlers"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/logging"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/models"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/orchestrator"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/recovery"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/scanner"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/startup"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/system"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/version"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/acknowledgment"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/circuitbreaker"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/config"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/constants"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/handlers"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/logging"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/models"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/orchestrator"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/recovery"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/scanner"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/startup"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/system"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/version"
|
||||
)
|
||||
|
||||
// newCircuitBreaker creates a circuit breaker from config
|
||||
|
|
@ -7,8 +7,8 @@ import (
|
|||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/constants"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/constants"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
|
|
@ -13,9 +13,9 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/event"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/models"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/system"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/event"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/models"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/system"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
|
|
@ -4,7 +4,7 @@ package client
|
|||
//
|
||||
// F-D1-5 LOW: client.go:39 uses fmt.Printf instead of log.Printf.
|
||||
//
|
||||
// Run: cd aggregator-agent && go test ./internal/client/... -v -run TestClientMachineID
|
||||
// Run: cd agent && go test ./internal/client/... -v -run TestClientMachineID
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
|
@ -8,8 +8,8 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/constants"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/version"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/constants"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/version"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
|
|
@ -11,7 +11,7 @@ import (
|
|||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/constants"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/constants"
|
||||
)
|
||||
|
||||
const defaultCacheTTLHours = 24
|
||||
|
|
@ -10,17 +10,17 @@ package crypto
|
|||
//
|
||||
// PASS-NOW / FAIL-AFTER-FIX — documents a bug as-is; flips to fail when fix is applied.
|
||||
//
|
||||
// Run: cd aggregator-agent && go test ./internal/crypto/... -v -run TestReplay
|
||||
// cd aggregator-agent && go test ./internal/crypto/... -v -run TestOld
|
||||
// cd aggregator-agent && go test ./internal/crypto/... -v -run TestNew
|
||||
// cd aggregator-agent && go test ./internal/crypto/... -v -run TestSame
|
||||
// cd aggregator-agent && go test ./internal/crypto/... -v -run TestCross
|
||||
// Run: cd agent && go test ./internal/crypto/... -v -run TestReplay
|
||||
// cd agent && go test ./internal/crypto/... -v -run TestOld
|
||||
// cd agent && go test ./internal/crypto/... -v -run TestNew
|
||||
// cd agent && go test ./internal/crypto/... -v -run TestSame
|
||||
// cd agent && go test ./internal/crypto/... -v -run TestCross
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/client"
|
||||
)
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
@ -8,7 +8,7 @@ import (
|
|||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/client"
|
||||
)
|
||||
|
||||
// CommandVerifier handles Ed25519 signature verification for commands
|
||||
|
|
@ -10,7 +10,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/client"
|
||||
)
|
||||
|
||||
// signCommand is a test helper that signs a command using the v3 format (with agent_id).
|
||||
|
|
@ -7,7 +7,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/client"
|
||||
)
|
||||
|
||||
// Color codes for terminal output
|
||||
|
|
@ -10,7 +10,7 @@ import (
|
|||
|
||||
"sync"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/models"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/models"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -17,10 +17,10 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/acknowledgment"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/config"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/constants"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/acknowledgment"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/config"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/constants"
|
||||
)
|
||||
|
||||
// HandleUpdateAgent handles agent update commands with signature verification
|
||||
|
|
@ -8,14 +8,14 @@ import (
|
|||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/acknowledgment"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/cache"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/config"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/display"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/scanner"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/system"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/version"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/acknowledgment"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/cache"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/config"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/display"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/scanner"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/system"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/version"
|
||||
)
|
||||
|
||||
// ReportLogWithAck reports a command log to the server and tracks it for acknowledgment
|
||||
|
|
@ -8,12 +8,12 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/acknowledgment"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/config"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/models"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/orchestrator"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/scanner"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/acknowledgment"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/config"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/models"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/orchestrator"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/scanner"
|
||||
)
|
||||
|
||||
// reportLogWithAck reports a command log to the server and tracks it for acknowledgment
|
||||
|
|
@ -5,7 +5,7 @@ package logging
|
|||
// F-D1-3 LOW: example_integration.go is dead code calling machineid.ID()
|
||||
// directly, bypassing the canonical hashMachineID().
|
||||
//
|
||||
// Run: cd aggregator-agent && go test ./internal/logging/... -v -run TestExample
|
||||
// Run: cd agent && go test ./internal/logging/... -v -run TestExample
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
|
@ -9,7 +9,7 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/config"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/config"
|
||||
)
|
||||
|
||||
// SecurityEvent represents a security event on the agent side
|
||||
|
|
@ -11,9 +11,9 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/common"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/constants"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/version"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/common"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/constants"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/version"
|
||||
)
|
||||
|
||||
// AgentFileInventory represents all files associated with an agent installation
|
||||
|
|
@ -15,7 +15,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/common"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/common"
|
||||
)
|
||||
|
||||
// DockerDetection represents Docker secrets detection results
|
||||
|
|
@ -8,7 +8,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/common"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/common"
|
||||
)
|
||||
|
||||
// DockerSecretsExecutor handles the execution of Docker secrets migration
|
||||
|
|
@ -7,9 +7,9 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/common"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/event"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/models"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/common"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/event"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/models"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
|
|
@ -6,7 +6,7 @@ import (
|
|||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/config"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/config"
|
||||
)
|
||||
|
||||
// MigrationState is imported from config package to avoid duplication
|
||||
|
|
@ -7,10 +7,10 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/common"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/event"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/migration/pathutils"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/models"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/common"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/event"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/migration/pathutils"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/models"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
|
|
@ -7,10 +7,10 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/config"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/crypto"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/logging"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/config"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/crypto"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/logging"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
|
|
@ -7,7 +7,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/client"
|
||||
"github.com/docker/docker/api/types/container"
|
||||
dockerclient "github.com/docker/docker/client"
|
||||
)
|
||||
|
|
@ -7,10 +7,10 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/circuitbreaker"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/event"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/models"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/circuitbreaker"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/event"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/models"
|
||||
)
|
||||
|
||||
// Scanner represents a generic update scanner
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package orchestrator
|
||||
|
||||
import (
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/client"
|
||||
)
|
||||
|
||||
// StorageMetric represents a single storage/disk metric
|
||||
|
|
@ -5,8 +5,8 @@ import (
|
|||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/scanner"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/scanner"
|
||||
)
|
||||
|
||||
// === Type Conversion Functions ===
|
||||
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/system"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/system"
|
||||
)
|
||||
|
||||
// StorageScanner scans disk usage metrics
|
||||
|
|
@ -4,8 +4,8 @@ import (
|
|||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/system"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/system"
|
||||
)
|
||||
|
||||
// SystemScanner scans system metrics (CPU, memory, processes, uptime)
|
||||
|
|
@ -6,13 +6,13 @@ import (
|
|||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/config"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/constants"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/crypto"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/scanner"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/system"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/version"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/config"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/constants"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/crypto"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/scanner"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/system"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/version"
|
||||
)
|
||||
|
||||
// RegisterAgent registers the agent with the server
|
||||
|
|
@ -8,7 +8,7 @@ import (
|
|||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/client"
|
||||
)
|
||||
|
||||
// APTScanner scans for APT package updates
|
||||
|
|
@ -8,7 +8,7 @@ import (
|
|||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/client"
|
||||
)
|
||||
|
||||
// DNFScanner scans for DNF/RPM package updates
|
||||
|
|
@ -6,7 +6,7 @@ import (
|
|||
"os/exec"
|
||||
"strings"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/client"
|
||||
"github.com/docker/docker/api/types/container"
|
||||
dockerclient "github.com/docker/docker/client"
|
||||
)
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
package scanner
|
||||
|
||||
import "github.com/Fimeg/RedFlag/aggregator-agent/internal/client"
|
||||
import "github.com/Fimeg/RedFlag/agent/internal/client"
|
||||
|
||||
// WindowsUpdateScanner stub for non-Windows platforms
|
||||
type WindowsUpdateScanner struct{}
|
||||
|
|
@ -5,7 +5,7 @@ package scanner
|
|||
//
|
||||
// F-C1-3 HIGH: No post-install state verification for Windows Updates.
|
||||
//
|
||||
// Run: cd aggregator-agent && go test ./internal/scanner/... -v -run TestWindowsUpdate
|
||||
// Run: cd agent && go test ./internal/scanner/... -v -run TestWindowsUpdate
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
|
@ -7,7 +7,7 @@ package scanner
|
|||
// F-C1-5 HIGH: Service runAgent() is duplicated, missing B-2 fixes.
|
||||
// F-C1-7 LOW: Service runAgent() uses emojis in logs.
|
||||
//
|
||||
// Run: cd aggregator-agent && go test ./internal/scanner/... -v -run TestWindowsService
|
||||
// Run: cd agent && go test ./internal/scanner/... -v -run TestWindowsService
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
|
@ -9,8 +9,8 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/pkg/windowsupdate"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/agent/pkg/windowsupdate"
|
||||
"github.com/go-ole/go-ole"
|
||||
"github.com/scjalliance/comshim"
|
||||
)
|
||||
|
|
@ -11,7 +11,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/client"
|
||||
)
|
||||
|
||||
// WingetPackage represents a single package from winget output
|
||||
|
|
@ -5,7 +5,7 @@ package scanner
|
|||
//
|
||||
// F-C1-6 LOW: Winget scanner uses fmt.Printf not structured logging.
|
||||
//
|
||||
// Run: cd aggregator-agent && go test ./internal/scanner/... -v -run TestWingetScanner
|
||||
// Run: cd agent && go test ./internal/scanner/... -v -run TestWingetScanner
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
|
@ -7,7 +7,7 @@ package scanner
|
|||
// breaks on package names with spaces.
|
||||
// F-C1-8 LOW: No winget parsing tests existed before this file.
|
||||
//
|
||||
// Run: cd aggregator-agent && go test ./internal/scanner/... -v -run TestWinget
|
||||
// Run: cd agent && go test ./internal/scanner/... -v -run TestWinget
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
|
@ -6,7 +6,7 @@ package scanner
|
|||
// F-C1-1 HIGH: Winget located via exec.LookPath (PATH only).
|
||||
// When running as SYSTEM service, winget is not in PATH.
|
||||
//
|
||||
// Run: cd aggregator-agent && go test ./internal/scanner/... -v -run TestWinget
|
||||
// Run: cd agent && go test ./internal/scanner/... -v -run TestWinget
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
|
@ -5,7 +5,7 @@ package service
|
|||
import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/config"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/config"
|
||||
)
|
||||
|
||||
// Stub implementations for non-Windows platforms
|
||||
|
|
@ -12,16 +12,16 @@ import (
|
|||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/acknowledgment"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/config"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/constants"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/handlers"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/installer"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/logging"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/orchestrator"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/recovery"
|
||||
"github.com/Fimeg/RedFlag/aggregator-agent/internal/system"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/acknowledgment"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/client"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/config"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/constants"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/handlers"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/installer"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/logging"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/orchestrator"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/recovery"
|
||||
"github.com/Fimeg/RedFlag/agent/internal/system"
|
||||
"golang.org/x/sys/windows/svc"
|
||||
"golang.org/x/sys/windows/svc/debug"
|
||||
"golang.org/x/sys/windows/svc/eventlog"
|
||||
|
|
@ -5,7 +5,7 @@ package system
|
|||
// F-D1-1: All machine ID paths in GetMachineID() produce consistent format.
|
||||
// The divergence is only in main.go's inline fallback.
|
||||
//
|
||||
// Run: cd aggregator-agent && go test ./internal/system/... -v -run TestHash
|
||||
// Run: cd agent && go test ./internal/system/... -v -run TestHash
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
|
|
@ -5,7 +5,7 @@ package system
|
|||
//
|
||||
// F-D1-4 LOW: getWindowsMachineID() redundantly retries machineid.ID().
|
||||
//
|
||||
// Run: cd aggregator-agent && go test ./internal/system/... -v -run TestWindows
|
||||
// Run: cd agent && go test ./internal/system/... -v -run TestWindows
|
||||
|
||||
import (
|
||||
"os"
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue