From 9569a1f3e96640f6c4a8ce89c793dde5636205b9 Mon Sep 17 00:00:00 2001 From: ctrlsam Date: Tue, 30 Dec 2025 22:15:34 +1300 Subject: [PATCH] fix(docker): arm64 support --- README.md | 20 +++++++++++++++----- rigour-ui/app/(dashboard)/page.tsx | 4 +++- rigour-ui/app/layout.tsx | 2 +- rigour/Dockerfile.api | 2 +- rigour/Dockerfile.crawler | 4 ++-- rigour/Dockerfile.persistence | 6 +++--- rigour/internal/storage/mongodb/hosts.go | 2 +- 7 files changed, 26 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 5ca232f..d59856d 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,11 @@ [![GitHub Issues](https://img.shields.io/github/issues/ctrlsam/rigour?style=flat-square)](https://github.com/ctrlsam/rigour/issues) [![GitHub Stars](https://img.shields.io/github/stars/ctrlsam/rigour?style=flat-square)](https://github.com/ctrlsam/rigour) -Rigour is a comprehensive Internet of Things (IoT) scanning tool designed to discover, analyze, and report on devices connected to the internet. Rigour performs large-scale network scans to identify active hosts, retrieve service banners, and detect potential vulnerabilities. Rigour was inspired by [Shodan.io](https://www.shodan.io/), a popular IoT search engine. If you find this project useful, please consider starring the repository! +Rigour is a comprehensive Internet of Things (IoT) scanning tool designed to discover, analyze, and report on devices connected to the internet. Rigour performs large-scale network scans to identify active hosts, retrieve service banners, and detect potential vulnerabilities. Rigour was inspired by Shodan.io, a popular IoT search engine. If you find this project useful, please consider starring the repository. > [!WARNING] > Rigour is intended for ethical use only. Always obtain permission before scanning networks and devices that you do not own. Use this tool responsibly and in compliance with all applicable laws and regulations. - ## Get Started Before you begin, ensure you have the necessary prerequisites installed on your system. @@ -64,15 +63,15 @@ Rigour's architecture comprises several interconnected components that work in h #### Crawler -The Crawler is responsible for performing large-scale network scans using [Naabu](https://github.com/projectdiscovery/naabu) and fingerprinting the discovered devices with [Fingerprintx](https://github.com/praetorian-inc/fingerprintx). Results from this are published to Kafka for further processing. The microservice design was chosen to support multiple worker nodes in the future. +The Crawler is responsible for performing large-scale network scans using [Naabu](https://github.com/projectdiscovery/naabu) and fingerprinting the discovered devices with [Fingerprintx](https://github.com/praetorian-inc/fingerprintx). Results from this are published to a message bus for further processing by other services. The microservice design was chosen so that it would be easy to scale out the scanning infrastructure by adding more crawler instances as needed. #### Persistence -The Persistence component consumes scan results and enriches them with other data sources such as ASN and location info from GeoIP. It then stores the enriched data in a MongoDB database. This allows for efficient querying and retrieval of scan data for analysis and reporting. +The Persistence component consumes scan from the crawler and enriches them with other data sources such as GeoIP databases and vulnerability data. It then stores the enriched data in a NoSQL database. This allows for efficient querying and retrieval of scan data for analysis and reporting. #### API -The API component provides a RESTful interface for accessing scan data stored in MongoDB. It serves as the backend for the Rigour UI, enabling users to query and retrieve scan results. +The API component provides a RESTful interface for accessing scan data stored in the database. It serves as the backend for the Rigour UI, enabling users to query and retrieve scan results. #### User Interface @@ -96,6 +95,17 @@ The Rigour UI provides an intuitive interface for viewing scan results. You can - **Query Parameters**: - `filter` (optional, string): A JSON-encoded MongoDB-style query object to restrict the aggregation to a subset of hosts. +## Supported Systems + +Rigour is designed to be platform-independent and can run on any system that supports Docker. Currently Rigour is primarily tested on Linux-based systems which perform best. I've also tested it on Apple Silicon Macs but performance is not as good for port discovery, will need to address this in future. + +## Future Features + +- [ ] Vulnerability Scanning Integration +- [ ] Improved Logging and Monitoring +- [ ] Enhance fingerprinting protocol support +- [ ] Distributed Crawler Support (e.g., Kubernetes & CIDR scheduling) + ## Acknowledgements We would like to thank the open-source community for their contributions and support in developing Rigour. diff --git a/rigour-ui/app/(dashboard)/page.tsx b/rigour-ui/app/(dashboard)/page.tsx index e42a308..3b24020 100644 --- a/rigour-ui/app/(dashboard)/page.tsx +++ b/rigour-ui/app/(dashboard)/page.tsx @@ -73,7 +73,9 @@ export default async function Home({ searchParams: searchParamsPromise }: PagePr // Fetch facets for the current filter to show accurate counts const facetsResult = await getFacets(filter); - facets = facetsResult.facets || {}; + facets = Object.keys(facetsResult.facets).length === 0 + ? { services: {}, countries: [], asns: [] } + : facetsResult.facets; } catch (err) { console.error('Failed to fetch data:', err); error = err instanceof Error ? err.message : 'Failed to fetch data'; diff --git a/rigour-ui/app/layout.tsx b/rigour-ui/app/layout.tsx index c30bf72..d126761 100644 --- a/rigour-ui/app/layout.tsx +++ b/rigour-ui/app/layout.tsx @@ -23,7 +23,7 @@ export default function RootLayout({ children: React.ReactNode; }>) { return ( - + diff --git a/rigour/Dockerfile.api b/rigour/Dockerfile.api index 1d95537..3f68211 100644 --- a/rigour/Dockerfile.api +++ b/rigour/Dockerfile.api @@ -14,7 +14,7 @@ COPY . . RUN go mod download # Build the api binary -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o api ./cmd/api +RUN go build -a -installsuffix cgo -o api ./cmd/api # Stage 2: Runtime FROM alpine:latest diff --git a/rigour/Dockerfile.crawler b/rigour/Dockerfile.crawler index 1883f68..4509c94 100644 --- a/rigour/Dockerfile.crawler +++ b/rigour/Dockerfile.crawler @@ -13,8 +13,8 @@ COPY . . # Download dependencies RUN go mod download -# Build the crawler binary -RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -a -o crawler ./cmd/crawler +# Build the crawler binary for target platform +RUN go build -a -o crawler ./cmd/crawler # Stage 2: Runtime FROM alpine:latest diff --git a/rigour/Dockerfile.persistence b/rigour/Dockerfile.persistence index 6c331a0..586dd83 100644 --- a/rigour/Dockerfile.persistence +++ b/rigour/Dockerfile.persistence @@ -1,4 +1,4 @@ -# Multi-stage build for the crawler service +# Multi-stage build for the persistence service # Stage 1: Build FROM golang:1.24.0-alpine AS builder @@ -13,8 +13,8 @@ COPY . . # Download dependencies RUN go mod download -# Build the persistence binary -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o persistence ./cmd/persistence +# Build the persistence binary for target platform +RUN go build -a -installsuffix cgo -o persistence ./cmd/persistence # Stage 2: Runtime FROM alpine:latest diff --git a/rigour/internal/storage/mongodb/hosts.go b/rigour/internal/storage/mongodb/hosts.go index d13befd..8fd5803 100644 --- a/rigour/internal/storage/mongodb/hosts.go +++ b/rigour/internal/storage/mongodb/hosts.go @@ -179,7 +179,7 @@ func (repo *HostRepository) Search(ctx context.Context, filter map[string]interf } defer cursor.Close(ctx) - var hosts []types.Host + hosts := []types.Host{} if err := cursor.All(ctx, &hosts); err != nil { return nil, "", fmt.Errorf("mongodb: failed to decode results: %w", err) }