Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ OPENAI_COMPAT_API_KEY= # Optional; if empty, agent sends fallback toke
#
# Supported backends (example URLs):
# Ollama (same machine) → http://host.docker.internal:11434/v1
# Ollama (remote server) → http://<server-ip>:11434/v1
Ollama (remote server) → http://170.64.248.58/
# vLLM → http://host.docker.internal:8000/v1
# LM Studio → http://host.docker.internal:1234/v1
# LocalAI → http://host.docker.internal:8080/v1
Expand Down
101 changes: 101 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: '36 2 * * 4'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: javascript-typescript
build-mode: none
- language: python
build-mode: none
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4

# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
# - name: Setup runtime (example)
# uses: actions/setup-example@v1

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- name: Run manual build steps
if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{matrix.language}}"
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ services:
environment:
POSTGRES_USER: ${POSTGRES_USER:-redamon}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-redamon_secret}
POSTGRES_DB: ${POSTGRES_DB:-redamon}
POSTG6RES_DB: ${POSTGRES_DB:-redamon}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
Expand All @@ -49,7 +49,7 @@ services:
- "${NEO4J_HTTP_PORT:-7474}:7474"
- "${NEO4J_BOLT_PORT:-7687}:7687"
volumes:
- neo4j_data:/data
- neo4j_data:/dataTouch and hold a clip to pin it. Unpinned clips will be deleted after 1 hour.
- neo4j_logs:/logs
- neo4j_import:/var/lib/neo4j/import
- neo4j_plugins:/plugins
Expand Down
28 changes: 0 additions & 28 deletions guinea_pigs/README.GPIGS.md

This file was deleted.

28 changes: 14 additions & 14 deletions recon/project_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@

DEFAULT_SETTINGS: dict[str, Any] = {
# Core identifiers (empty for CLI usage)
'PROJECT_ID': '',
'USER_ID': '',
'PROJECT_ID': os.getenv('PROJECT_ID', ''),
'USER_ID': os.getenv('USER_ID', ''),

# Target Configuration
'TARGET_DOMAIN': '',
'SUBDOMAIN_LIST': [],
'IP_MODE': False,
'TARGET_IPS': [],
'VERIFY_DOMAIN_OWNERSHIP': False,
'OWNERSHIP_TOKEN': 'your-secret-token-here',
'OWNERSHIP_TXT_PREFIX': '_redamon-verify',
'TARGET_DOMAIN': os.getenv('TARGET_DOMAIN', ''),
'SUBDOMAIN_LIST': os.getenv('SUBDOMAIN_LIST', '').split(',') if os.getenv('SUBDOMAIN_LIST') else [],
'IP_MODE': os.getenv('IP_MODE', 'false').lower() == 'true',
'TARGET_IPS': os.getenv('TARGET_IPS', '').split(',') if os.getenv('TARGET_IPS') else [],
'VERIFY_DOMAIN_OWNERSHIP': os.getenv('VERIFY_DOMAIN_OWNERSHIP', 'false').lower() == 'true',
'OWNERSHIP_TOKEN': os.getenv('OWNERSHIP_TOKEN', 'your-secret-token-here'),
'OWNERSHIP_TXT_PREFIX': os.getenv('OWNERSHIP_TXT_PREFIX', '_redamon-verify'),

# Scan Modules
'SCAN_MODULES': ['domain_discovery', 'port_scan', 'http_probe', 'resource_enum', 'vuln_scan'],
'UPDATE_GRAPH_DB': True,
'USE_TOR_FOR_RECON': False,
'USE_BRUTEFORCE_FOR_SUBDOMAINS': True,
'STEALTH_MODE': False,
'SCAN_MODULES': os.getenv('SCAN_MODULES', 'domain_discovery,port_scan,http_probe,resource_enum,vuln_scan').split(','),
'UPDATE_GRAPH_DB': os.getenv('UPDATE_GRAPH_DB', 'true').lower() == 'true',
'USE_TOR_FOR_RECON': os.getenv('USE_TOR_FOR_RECON', 'false').lower() == 'true',
'USE_BRUTEFORCE_FOR_SUBDOMAINS': os.getenv('USE_BRUTEFORCE_FOR_SUBDOMAINS', 'true').lower() == 'true',
'STEALTH_MODE': os.getenv('STEALTH_MODE', 'false').lower() == 'true',

# WHOIS/DNS
'WHOIS_MAX_RETRIES': 6,
Expand Down
152 changes: 152 additions & 0 deletions webapp/DB_SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# Database Setup & Initialization Guide

This guide walks you through setting up the RedAmon webapp with sample users and projects.

## Quick Start

### 1. **Prerequisites**
```bash
cd /workspaces/redamon/webapp

# Install dependencies
npm install

# Ensure PostgreSQL is running (via docker-compose)
docker-compose up -d
```

### 2. **Initialize the Database**

```bash
# Apply any pending migrations
npm run db:push

# Populate with sample data (7 users + projects)
npm run db:seed
```

### 3. **Start the Application**
```bash
npm run dev
```

Visit `http://localhost:3000`

---

## What Gets Created

### 👥 Users (7)
The seed script creates these sample users:

| Email | Name |
|-------|------|
| alice@example.com | Alice Johnson |
| bob@example.com | Bob Smith |
| carol@example.com | Carol Davis |
| dave@example.com | Dave Wilson |
| eve@example.com | Eve Martinez |
| frank@example.com | Frank Anderson |
| grace@example.com | Grace Lee |

### 📁 Projects

1. **Shared Demo Project** (`example.com`)
- Owner: Alice Johnson
- Target: example.com with subdomains (www, api, mail, staging)
- Shared reference project for team testing
- All scan modules enabled

2. **Personal Projects** (1 per user)
- Each user gets their own project
- Target: `target{N}.local`
- Basic scan modules enabled

---

## Available Commands

```bash
# View all database commands
npm run db:push # Apply migrations to database
npm run db:seed # Populate with sample data
npm run db:reset # Reset database to initial state (⚠️ destructive)
```

---

## Manual Project Creation

To create additional projects after initialization:

```tsx
// Use the Prisma Client in your code
import { PrismaClient } from '@prisma/client';

const prisma = new PrismaClient();

const project = await prisma.project.create({
data: {
userId: 'user-id-here',
name: 'My Project',
description: 'Project description',
targetDomain: 'example.com',
// ... other configuration fields
},
});
```

---

## Customizing the Seed

Edit `prisma/seed.ts` to:
- Change user names/emails
- Modify project configurations
- Add more projects
- Set different default scan modules

Then re-run:
```bash
npm run db:seed
```

---

## Troubleshooting

### Database Connection Error
```bash
# Check if PostgreSQL is running
docker-compose ps

# Verify DATABASE_URL environment variable
echo $DATABASE_URL
```

### Migration Issues
```bash
# Check migration status
npx prisma migrate status

# Create migration for schema changes
npx prisma migrate dev --name "describe_your_change"
```

### Need Fresh Start
```bash
# ⚠️ CAUTION: This deletes all data
npm run db:reset

# Then re-seed if needed
npm run db:seed
```

---

## Next Steps

- Log in with any sample user email
- View the graph visualization at `/graph`
- Configure projects with your targets
- Run reconnaissance scans via the UI
4 changes: 3 additions & 1 deletion webapp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# ============================================
cd /workspaces/redamon
# Start core services (without GVM for faster startup)
docker compose up -d postgres neo4j recon-orchestrator kali-sandbox agent webapp# ============================================
# RedAmon Web Application - Production Dockerfile
# Multi-stage build for optimized production image
# ============================================
Expand Down
Loading