Skip to content

A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.

feat: search button

dextmorgn4dd9041b2e08
diff --git a/flowsint-api/app/tasks/email_scanner.py b/flowsint-api/app/tasks/email_scanner.py
index d97d0116..2608413f 100644
--- a/flowsint-api/app/tasks/email_scanner.py
+++ b/flowsint-api/app/tasks/email_scanner.py
@@ -8,7 +8,7 @@ from app.workers.email_scanner import perform_holehe_research
@celery_app.task(name="email_scan", bind=True)
def email_scan(self, email: str):
- db = get_db() # 🔥 On récupère le client ici
+ db = get_db()
try:
# Run the Holehe research
results = asyncio.run(perform_holehe_research(email))
diff --git a/flowsint-web/src/app/dashboard/layout.tsx b/flowsint-web/src/app/dashboard/layout.tsx
index 01032f8c..29fb355f 100644
--- a/flowsint-web/src/app/dashboard/layout.tsx
+++ b/flowsint-web/src/app/dashboard/layout.tsx
@@ -4,7 +4,7 @@ import {
SidebarProvider,
} from "@/components/ui/sidebar"
import { redirect } from "next/navigation";
-import { Radar, Settings } from "lucide-react";
+import { FingerprintIcon, Radar, Settings } from "lucide-react";
import { Button } from "@/components/ui/button";
import { MainNav } from "@/components/dashboard/main-nav";
import { NavUser } from "@/components/nav-user";
@@ -33,7 +33,7 @@ const DashboardLayout = async ({
<header className="sticky top-0 z-50 bg-background border-b">
<div className="flex h-12 items-center px-4">
<Link href="/dashboard" className="flex items-center gap-1">
- <Radar className="mr-2 h-6 w-6" />
+ <FingerprintIcon className="mr-2 h-6 w-6 text-primary" />
<h2 className="text-lg font-semibold mr-6">flowsint</h2>
</Link>
{/* <Separator orientation="vertical" className="h-6" /> */}
diff --git a/flowsint-web/src/components/investigations/investigation-navigation.tsx b/flowsint-web/src/components/investigations/investigation-navigation.tsx
index 03add9a8..c281acdb 100644
--- a/flowsint-web/src/components/investigations/investigation-navigation.tsx
+++ b/flowsint-web/src/components/investigations/investigation-navigation.tsx
@@ -4,9 +4,10 @@ import { cn } from "@/lib/utils"
import { Users, TimerIcon, MapIcon, WaypointsIcon } from 'lucide-react'
import Link from "next/link"
import { usePathname } from "next/navigation"
-import { memo, useMemo } from "react"
+import { Fragment, memo, useMemo } from "react"
import MoreMenu from "./more-menu"
import { ScanButton } from "./scans-drawer/scan-button"
+import { Badge } from "../ui/badge"
function InvestigationNavigation({ project_id, investigation_id }: { project_id: string, investigation_id: string }) {
const pathname = usePathname()
@@ -30,12 +31,14 @@ function InvestigationNavigation({ project_id, investigation_id }: { project_id:
name: "Timeline",
href: `/dashboard/projects/${project_id}/investigations/${investigation_id}/timeline`,
icon: TimerIcon,
+ "disabled": true,
},
{
id: "map",
name: "Map",
href: `/dashboard/projects/${project_id}/investigations/${investigation_id}/map`,
icon: MapIcon,
+ "disabled": true,
},
], [project_id, investigation_id]);
@@ -43,26 +46,34 @@ function InvestigationNavigation({ project_id, investigation_id }: { project_id:
<div className="flex items-center justify-between w-full">
<div className="flex overflow-auto">
{sections.map((section) => (
- <Link
- key={section.id}
- href={section?.href || ""}
- className={cn(
- "flex items-center text-sm gap-2 px-4 py-2 transition-colors",
- section?.href == pathname
- ? "bg-accent text-accent-foreground"
- : "text-muted-foreground hover:text-foreground hover:bg-accent/50",
- )}
- >
- <section.icon className="h-4 w-4" />
- <span>{section.name}</span>
- </Link>
+ <Fragment key={section.id}>
+ {section.disabled ?
+ <span
+ className="text-muted-foreground opacity-40 text-sm px-4 py-2 flex items-center gap-2">
+ <section.icon className="h-4 w-4" />
+ <span>{section.name}</span>
+ <Badge variant={"outline"}>Soon</Badge>
+ </span> :
+ <Link
+ href={section?.href || ""}
+ className={cn(
+ "flex items-center text-sm gap-2 px-4 py-2 transition-colors",
+ section?.href == pathname
+ ? "bg-accent text-accent-foreground"
+ : "text-muted-foreground hover:text-foreground hover:bg-accent/50",
+ )}
+ >
+ <section.icon className="h-4 w-4" />
+ <span>{section.name}</span>
+ </Link>}
+ </Fragment>
))}
</div>
<div className="flex items-center">
<MoreMenu />
<ScanButton />
</div>
- </div>
+ </div >
)
}
diff --git a/flowsint-web/src/components/investigations/scan-drawer.tsx b/flowsint-web/src/components/investigations/scan-drawer.tsx
index 8ce6bcf8..9429b131 100644
--- a/flowsint-web/src/components/investigations/scan-drawer.tsx
+++ b/flowsint-web/src/components/investigations/scan-drawer.tsx
@@ -54,7 +54,7 @@ export type Scan = {
}
export function ScanDrawer() {
- const { investigation_id } = useParams()
+ const { project_id, investigation_id } = useParams()
const [scanId, setScanId] = useQueryState("scan_id")
const [open, setOpen] = useState(Boolean(scanId))
const [searchQuery, setSearchQuery] = useState("")
@@ -63,7 +63,7 @@ export function ScanDrawer() {
const { data: currentScan = null, isLoading } = useQuery({
queryKey: ["investigations", investigation_id, "scans", scanId],
queryFn: async (): Promise<Scan | null> => {
- const res = await fetch(`/api/investigations/${investigation_id}/scans/${scanId}`)
+ const res = await fetch(`/api/projects/${project_id}/investigations/${investigation_id}/scans/${scanId}`)
if (!res.ok) {
return null
}
@@ -131,7 +131,7 @@ export function ScanDrawer() {
{/* Stats Cards */}
<div className="grid grid-cols-3 gap-4 mb-4">
- <Card className="bg-background shadow-none">
+ <Card className="bg-accent shadow-none">
<CardContent className="p-4 flex items-center gap-2">
<Shield className="h-4 w-4 text-green-500" />
<div>
@@ -140,7 +140,7 @@ export function ScanDrawer() {
</div>
</CardContent>
</Card>
- <Card className="bg-background shadow-none">
+ <Card className="bg-accent shadow-none">
<CardContent className="p-4 flex items-center gap-2">
<Clock className="h-4 w-4 text-yellow-500" />
<div>
@@ -149,7 +149,7 @@ export function ScanDrawer() {
</div>
</CardContent>
</Card>
- <Card className="bg-background shadow-none">
+ <Card className="bg-accent shadow-none">
<CardContent className="p-4 flex items-center gap-2">
<ShieldAlert className="h-4 w-4 text-destructive" />
<div>
@@ -250,7 +250,7 @@ export function ScanDrawer() {
) : (
<div className="grid grid-cols-2 md:grid-cols-3 gap-4 p-4 overflow-auto">
{filteredResults?.map((result: any, index: number) => (
- <Card key={index} className="overflow-hidden bg-background">
+ <Card key={index} className="overflow-hidden bg-accent">
<CardContent className="p-4">
{isErrorResult(result) ? (
<div className="flex items-start gap-2 text-destructive">
diff --git a/flowsint-web/src/components/investigations/sketch/graph.tsx b/flowsint-web/src/components/investigations/sketch/graph.tsx
index 76a52024..38769eff 100644
--- a/flowsint-web/src/components/investigations/sketch/graph.tsx
+++ b/flowsint-web/src/components/investigations/sketch/graph.tsx
@@ -367,11 +367,11 @@ const LayoutFlow = ({ refetch, theme }: LayoutFlowProps) => {
</TooltipProvider>
</ResizablePanel>
<ResizableHandle />
- <ResizablePanel defaultSize={20} className="h-full">
+ <ResizablePanel defaultSize={20} minSize={15} className="h-full">
<ResizablePanelGroup autoSaveId="conditional" direction="vertical">
{currentNode && <>
<ResizablePanel order={1} id="top" defaultSize={50}>
- <ProfilePanel data={currentNode.data} />
+ <ProfilePanel data={currentNode.data} type={currentNode.type} />
</ResizablePanel>
<ResizableHandle />
</>}
diff --git a/flowsint-web/src/components/investigations/sketch/profile-panel.tsx b/flowsint-web/src/components/investigations/sketch/profile-panel.tsx
index efde08e1..0414c925 100644
--- a/flowsint-web/src/components/investigations/sketch/profile-panel.tsx
+++ b/flowsint-web/src/components/investigations/sketch/profile-panel.tsx
@@ -1,219 +1,56 @@
"use client"
-import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
-import { Badge } from "@/components/ui/badge"
-import { User, MapPin, Globe, Info, AtSign, Phone, Calendar, Link2, Mail, Shield, XIcon } from "lucide-react"
-import { Separator } from "@/components/ui/separator"
-import { useFlowStore } from "@/store/flow-store"
+import { Sparkles } from "lucide-react"
import { Button } from "@/components/ui/button"
-import Link from "next/link"
import { useParams } from "next/navigation"
-import SearchEmail from "./search-email"
-import { memo } from "react"
+import { memo, useCallback } from "react"
import { cn } from "@/lib/utils"
import { CopyButton } from "@/components/copy"
-
-export default function ProfilePanel({ data, }: { data: any }) {
- const { project_id, investigation_id } = useParams()
- const { setCurrentNode } = useFlowStore()
-
- const closePanel = () => {
- setCurrentNode(null)
- }
-
- // if (type === "email") {
- // return (
- // <div className="overflow-auto h-full flex flex-col w-full !p-0 !m-0">
- // <Button className="absolute top-2 right-2" size={"icon"} variant={"ghost"} onClick={closePanel}><XIcon className="h-5 w-5" /></Button>
- // <div className="p-6 md:p-8">
- // <div className="grid grid-cols-1 gap-6">
- // {/* Left column with email info */}
- // <div className="space-y-6">
- // <div className="flex flex-col items-center gap-4">
- // <div className="bg-primary/10 p-3 rounded-full">
- // <Mail className="h-8 w-8 text-primary" />
- // </div>
- // <div className="w-full text-center">
- // <h2 className="text-xl w-full font-bold break-all">{data.email}</h2>
- // <p className="text-sm text-muted-foreground">Email Address</p>
- // </div>
- // <SearchEmail investigation_id={investigation_id as string} email={data.email} />
- // </div>
- // <Separator />
- // <div className="space-y-4 text-center">
- // <div className="space-y-1 text-center">
- // <div className="flex items-center justify-center gap-2 text-primary">
- // <Shield className="h-4 w-4" />
- // <span className="text-sm">Security Status</span>
- // </div>
- // <div className="flex gap-2 mt-1 items-center justify-center">
- // <Badge variant={data.breach_found ? "destructive" : "outline"} className="px-3 py-1">
- // {data.breach_found ? "Breach Found" : "No Breach Detected"}
- // </Badge>
- // </div>
- // </div>
- // <div className="space-y-1">
- // <div className="flex items-center justify-center gap-2 text-primary">
- // <Info className="h-4 w-4" />
- // <span className="text-sm">Email ID</span>
- // </div>
- // <p className="text-xs font-mono text-center text-muted-foreground">{data.id}</p>
- // </div>
- // </div>
- // </div>
- // {/* Right column with related info */}
- // <div className="space-y-6">
- // <div className="space-y-1">
- // <div className="flex items-center justify-center gap-2 text-primary">
- // <Link2 className="h-4 w-4" />
- // <span className="text-sm">Associated Individual</span>
- // </div>
- // <p className="text-xs font-mono text-center text-muted-foreground">{data.individual_id}</p>
- // </div>
- // <div className="space-y-1">
- // <div className="flex items-center justify-center gap-2 text-primary">
- // <Info className="h-4 w-4" />
- // <span className="text-sm">Investigation ID</span>
- // </div>
- // <p className="text-xs font-mono text-center text-muted-foreground">{data.investigation_id}</p>
- // </div>
- // </div>
- // </div>
- // </div>
- // </div>)
- // }
- // if (type === "individual")
- // return (
- // <div className="overflow-auto h-full flex flex-col w-full !p-0 !m-0">
- // <Button className="absolute top-2 right-2" size={"icon"} variant={"ghost"} onClick={closePanel}><XIcon className="h-5 w-5" /></Button>
- // <div className="p-6 md:p-8">
- // <div className="grid grid-cols-1 gap-2">
- // {/* Left column with avatar */}
- // <div className="flex flex-col items-center gap-6">
- // <div className="relative flex flex-col items-center gap-4">
- // <Avatar className="w-28 h-28 border-4">
- // <AvatarImage src={data.image_url} alt={data.full_name} />
- // <AvatarFallback className="text-2xl">
- // {data.full_name
- // .split(" ")
- // .map((n: any[]) => n[0])
- // .join("")}
- // </AvatarFallback>
- // </Avatar>
- // <Link href={`/dashboard/projects/${project_id}/individuals/${data.id}`}>
- // <Button variant={"outline"}>View</Button>
- // </Link>
- // </div>
- // <div className="space-y-1 text-center">
- // <div className="flex items-center justify-center gap-2 text-primary">
- // <User className="h-4 w-4" />
- // <span className="text-sm">Full Name</span>
- // </div>
- // <h1 className="text-2xl font-bold tracking-tight">{data.full_name}</h1>
- // </div>
-
- // <div className="space-y-1 text-center">
- // <div className="flex items-center justify-center gap-2 text-primary">
- // <Info className="h-4 w-4" />
- // <span className="text-sm">Investigation ID</span>
- // </div>
- // <p className="text-sm font-mono">{data.investigation_id}</p>
- // </div>
- // </div>
-
- // {/* Middle column */}
- // <div className="space-y-6">
- // <div className="space-y-1">
- // <div className="flex items-center justify-center gap-2 text-primary">
- // <AtSign className="h-4 w-4" />
- // <span className="text-sm text-center">Email</span>
- // </div>
- // {data?.emails?.length > 0 ? (
- // <p className="font-medium text-center">{data?.emails?.[0].email}</p>
- // ) : (
- // <p className="text-gray-500 text-center">No email available</p>
- // )}
- // </div>
-
- // <div className="space-y-1">
- // <div className="flex items-center justify-center gap-2 text-primary">
- // <Globe className="h-4 w-4" />
- // <span className="text-sm text-center">Nationality</span>
- // </div>
- // <p className="font-medium text-center">{data.nationality || "Unknown"}</p>
- // </div>
-
- // <div className="space-y-1">
- // <div className="flex items-center justify-center gap-2 text-primary">
- // <User className="h-4 w-4" />
- // <span className="text-sm text-center">Gender</span>
- // </div>
- // <p className="font-medium text-center">{data.gender || "Unknown"}</p>
- // </div>
-
- // {data?.phone_numbers?.length > 0 && (
- // <div className="space-y-1">
- // <div className="flex items-center justify-center gap-2 text-primary">
- // <Phone className="h-4 w-4" />
- // <span className="text-sm text-center">Phone Number</span>
- // </div>
- // <p className="font-medium text-center">{data?.phone_numbers?.[0]}</p>
- // </div>
- // )}
- // </div>
-
- // {/* Right column */}
- // <div className="space-y-6">
- // {data.birth_date && (
- // <div className="space-y-1">
- // <div className="flex items-center justify-center gap-2 text-primary">
- // <Calendar className="h-4 w-4" />
- // <span className="text-sm text-center">Birth Date</span>
- // </div>
- // <p className="font-medium text-center">{data.birth_date}</p>
- // </div>
- // )}
-
- // <div className="space-y-1">
- // <div className="flex items-center justify-center gap-2 text-primary">
- // <Info className="h-4 w-4" />
- // <span className="text-sm text-center">Email Security</span>
- // </div>
- // <div className="flex gap-2 mt-1 justify-center">
- // {data?.emails?.length > 0 && (
- // <Badge
- // variant={data.emails?.[0].breach_found ? "destructive" : "outline"}
- // >
- // {data.emails?.[0].breach_found ? "Breach Found" : "No Breach"}
- // </Badge>
- // )}
- // </div>
- // </div>
-
- // {data.physical_addresses?.length > 0 && (
- // <div className="space-y-1">
- // <div className="flex items-center justify-center gap-2 text-primary">
- // <MapPin className="h-4 w-4" />
- // <span className="text-sm text-center">Location</span>
- // </div>
- // <p className="font-medium text-center">{data.physical_addresses?.[0]}</p>
- // </div>
- // )}
-
- // <div className="space-y-1">
- // <div className="flex items-center justify-center gap-2 text-primary">
- // <Info className="h-4 w-4" />
- // <span className="text-sm">Individual ID</span>
- // </div>
- // <p className="text-xs font-mono text-gray-400 text-center">{data.id}</p>
- // </div>
- // </div>
- // </div>
- // </div>
- // </div>
- // )
+import { toast } from "sonner"
+import { checkEmail } from "@/lib/actions/search"
+
+export default function ProfilePanel({ data, type }: { data: any, type: string }) {
+ const { investigation_id } = useParams()
+
+ const handleCheckEmail = useCallback(() => {
+ // @ts-ignore
+ if (!data && data?.email) return
+ // @ts-ignore
+ toast.promise(checkEmail(data?.email, investigation_id), {
+ loading: "Loading...",
+ success: () => {
+ return `Scan on ${data?.email} has been launched.`
+ },
+ error: (error: any) => {
+ return (
+ <div className="overflow-hidden">
+ <p className="font-bold">An error occured.</p>
+ <pre className="overflow-auto">
+ <code>{JSON.stringify(error, null, 2)}</code>
+ </pre>
+ </div>
+ )
+ },
+ })
+ }, [data, investigation_id])
return (
- <KeyValueDisplay data={data} />
+ <div>
+ <div className="flex items-center border-b justify-between p-4 gap-2">
+ <h1 className="text-md font-semibold truncate">{data?.label}</h1>
+ <Button
+ onClick={handleCheckEmail}
+ disabled={type !== "email"}
+ className="relative min-w-[80px] h-8 overflow-hidden bg-gradient-to-r from-purple-600 to-pink-600 hover:from-purple-700 hover:to-pink-700 transition-all duration-300 px-6 py-2 text-white border-none font-medium rounded-full"
+ >
+ <span className="flex items-center gap-2">
+ <Sparkles className={'h-4 w-4 transition-transform duration-300'} />
+ <span>Search</span>
+ </span>
+ <span className="absolute inset-0 bg-black opacity-0 hover:opacity-10 transition-opacity duration-300" />
+ </Button>
+ </div>
+ <KeyValueDisplay data={data} />
+ </div>
)
}