15 | Timestamp:{' '} 16 | {isValidDate ? eventDate.toLocaleString() : 'Invalid Date'} 17 |
18 |19 | User: {event.username ?? 'Unknown User'} 20 |
21 | 22 |Loading chart...
; 31 | //reversed the times to show the most recent first 32 | return ( 33 |43 | Location: 44 | {currentIpLoc?.city}, {currentIpLoc?.region},{' '} 45 | {currentIpLoc?.country} 46 |
47 | {/* Make sure the chart renders only when IP is selected */} 48 |32 | Event Type: {event.type ?? 'N/A'} 33 |
34 |35 | Event: {event.name ?? 'N/A'} 36 |
37 |38 | Timestamp:{' '} 39 | {event.time.toLocaleString() ?? 'Invalid Date'} 40 |
41 |42 | Source IP: {event.source_ip ?? 'N/A'} 43 |
44 |45 | User Type: {event.user_identity_type ?? 'N/A'} 46 |
47 |48 | Raw JSON Data: 49 |
50 |{JSON.stringify(event, null, 2)}
54 | Loading events...
} 46 | {error &&{error}
} 47 | {!loading && !error && ( 48 |Loading chart...
; 39 | 40 | const handleClick = (source: string) => { 41 | setSelectedEventSource((prevSelected) => 42 | prevSelected === source ? null : source 43 | ); 44 | }; 45 | 46 | return ( 47 |Event Source: {selectedEventSource}
87 | )} 88 |
14 |
15 | # Installation and Spin-Up
16 |
17 | - Make sure you have docker installed
18 | - Create your compose.yml file
19 | - (see our starter version in [Docker Hub](https://hub.docker.com/r/trailguide/trailguide-prod), or copy the one from this repo )
20 | - run `docker compose up` on the command line
21 |
22 | # Getting Start:
23 |
24 | 1. Use the signup link to create user
25 |
26 |
27 |
28 | 2. Login
29 |
30 |
31 |
32 | 3. Copy paste the aws credentials in the fields in the profile
33 |
34 |
35 |
36 | ## Shoutouts :tada:
37 |
38 | Omnivore takes advantage of some great open source software:
39 |
40 | - [TypeScript](https://www.typescriptlang.org/) - Most of our backend and frontend are written in TypeScript.
41 | - [PostgreSQL](https://www.postgresql.org/)- For managing complex queries and storing event data, PostgreSQL is our go-to. Its reliability and performance are key to managing and analyzing extensive data, enhancing the robustness of our monitoring and analytics features.
42 | - [Docker](https://www.docker.com/)- Thanks to Docker, deploying our platform is seamless and consistent, whether locally or on the cloud. Docker allows us to containerize our ML models and backend services, ensuring reliable and scalable performance for our users.
43 | - [AWS](https://aws.amazon.com/)- AWS forms the backbone of TrailGuide, providing the infrastructure and data streams that allow us to offer real-time monitoring and security insights for AWS environments. CloudTrail logs enable us to dive deep into user activity and detect anomalies as they happen.
44 | - [Scikit-learn](https://scikit-learn.org/)- TrailGuide’s anomaly detection thrives with Scikit-learn's Isolation Forest, enabling real-time detection of unusual activity in CloudTrail logs with efficiency and accuracy.
45 | - And many more awesome libraries, just checkout our package files to see what we are using.
46 |
47 | ## Requirements for development
48 |
49 | TraildeGuide is written in TypeScript and JavaScript.
50 |
--------------------------------------------------------------------------------
/client/src/components/charts/AccessPerIp.tsx:
--------------------------------------------------------------------------------
1 | import { useState, useEffect } from 'react';
2 | import { Cell, Legend, Pie, PieChart } from 'recharts';
3 | import { CountedEvent, IPLocation } from '../../types';
4 |
5 | const COLORS = ['#0088FE', '#00C49F', '#FFBB28', '#FF8042'];
6 |
7 | export default function AccessPerIpChart({
8 | currentIp,
9 | setCurrentIp,
10 | ipLocCounts,
11 | }: {
12 | currentIp?: string;
13 | setCurrentIp: React.DispatchLoading chart...
; 62 | 63 | return ( 64 |Loading chart...
; 44 | 45 | const handleClick = (data: { name: string }) => { 46 | // Toggle selection: if already selected, deselect; otherwise, select 47 | setSelectedEventName((prevSelected) => 48 | prevSelected === data.name ? null : data.name 49 | ); 50 | }; 51 | 52 | return ( 53 |Selected Event: {selectedEventName}
97 | )} 98 |107 | Don't have an account? Sign up here 108 |
109 |You must login to see this page
; 67 | } 68 | 69 | function checkAWSCreds(component: ReactNode): ReactNode { 70 | if ( 71 | user?.aws_access_key?.length && 72 | user?.aws_region?.length > 0 && 73 | user?.aws_secret_access_key?.length > 0 74 | ) { 75 | return component; 76 | } 77 | return ( 78 |79 | You must enter your AWS credentials in the profile page to see any data 80 | here. 81 |
82 | ); 83 | } 84 | 85 | return ( 86 |
52 | Username: {user?.username ?? 'Not Logged In'}
56 |Display Name: {user?.display_name ?? 'Not Logged In'}
59 |Work Email: {user?.work_email ?? 'Not Logged In'}
62 |Work Phone: {user?.work_phone ?? 'Not Logged In'}
65 |
71 | Settings related to alerts go here...
104 |Settings related to AI features go here...
109 |