Projects STRLCPY Sirius Commits ab2f7cd7
🤬
  • ■ ■ ■ ■ ■ ■
    API/API/agents/agents.go
    skipped 66 lines
    67 67   log.Println(taskResponse)
    68 68   
    69 69   //DB Connection
    70  - client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
     70 + client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017"))
    71 71   if err != nil {
    72 72   log.Fatal(err)
    73 73   }
    skipped 44 lines
    118 118   
    119 119  func RegisterAgent(agent siriusDB.SiriusAgent) {
    120 120   //DB Connection
    121  - client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
     121 + client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017"))
    122 122   if err != nil {
    123 123   log.Fatal(err)
    124 124   }
    skipped 22 lines
    147 147   
    148 148  func TaskAgent(agent siriusDB.SiriusAgent) {
    149 149   //DB Connection
    150  - client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
     150 + client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017"))
    151 151   if err != nil {
    152 152   log.Fatal(err)
    153 153   }
    skipped 37 lines
    191 191   
    192 192  func GetTasks(agent siriusDB.SiriusAgent) []siriusDB.Task {
    193 193   //DB Connection
    194  - client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
     194 + client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017"))
    195 195   if err != nil {
    196 196   log.Fatal(err)
    197 197   }
    skipped 32 lines
  • ■ ■ ■ ■
    API/API/data/data.go
    skipped 32 lines
    33 33   
    34 34  func TerminalHistory(c *gin.Context) {
    35 35   //DB Connection
    36  - client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
     36 + client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017"))
    37 37   if err != nil {
    38 38   log.Fatal(err)
    39 39   }
    skipped 60 lines
  • ■ ■ ■ ■ ■
    API/API/hosts/AddHost.go
    skipped 28 lines
    29 29   
    30 30  func AddHost(host siriusDB.SVDBHost) {
    31 31   log.Println(host)
     32 + log.Println("===========================================")
    32 33   
    33 34   //DB Connection
    34  - client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
     35 + client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017"))
    35 36   if err != nil {
    36 37   log.Fatal(err)
    37 38   }
    skipped 26 lines
    64 65   fmt.Println(result.InsertedID)
    65 66   return "result"
    66 67  }
     68 + 
  • ■ ■ ■ ■
    API/API/hosts/GetHost.go
    skipped 30 lines
    31 31  func GetHost(hostRequest siriusDB.SVDBHost) siriusDB.SVDBHost {
    32 32   
    33 33   //Get the host data from the database
    34  - client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
     34 + client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017"))
    35 35   if err != nil {
    36 36   log.Fatal(err)
    37 37   }
    skipped 24 lines
  • ■ ■ ■ ■
    API/API/hosts/UpdateHost.go
    skipped 30 lines
    31 31  func UpdateHost(updateRequest siriusDB.SVDBHost) {
    32 32   
    33 33   //DB Connection
    34  - client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
     34 + client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017"))
    35 35   if err != nil {
    36 36   log.Fatal(err)
    37 37   }
    skipped 47 lines
  • ■ ■ ■ ■
    API/API/svdb/GetCPE.go
    skipped 55 lines
    56 56   }
    57 57   
    58 58   //DB Connection
    59  - client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
     59 + client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017"))
    60 60   if err != nil {
    61 61   log.Fatal(err)
    62 62   }
    skipped 85 lines
  • ■ ■ ■ ■
    API/API/svdb/UpdateVuln.go
    skipped 31 lines
    32 32   }
    33 33   
    34 34   //DB Connection
    35  - client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
     35 + client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017"))
    36 36   if err != nil {
    37 37   log.Fatal(err)
    38 38   }
    skipped 40 lines
  • ■ ■ ■ ■ ■ ■
    API/Dockerfile
     1 +# Go API Dockerfile
     2 + 
     3 +FROM golang:1.20-bullseye
     4 +WORKDIR /api
     5 +COPY . .
     6 +RUN go build -o ./tmp/sirius-api ./sirius-api.go
     7 +CMD ["./tmp/sirius-api"]
     8 +EXPOSE 8080
  • ■ ■ ■ ■ ■ ■
    API/lib/db/db.go
    skipped 115 lines
    116 116   log.Println("Updating Sirius General Purpose Vulnerability Database...")
    117 117   
    118 118   //DB Connection
    119  - client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
     119 + client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017"))
    120 120   if err != nil {
    121 121   log.Fatal(err)
    122 122   }
    skipped 36 lines
    159 159   
    160 160  func DatabaseConnect() *mongo.Client {
    161 161   //DB Connection
    162  - client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
     162 + client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017"))
    163 163   if err != nil {
    164 164   log.Fatal(err)
    165 165   }
    skipped 8 lines
    174 174   
    175 175  func GetHosts() []SVDBHost {
    176 176   //DB Connection
    177  - client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
     177 + client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017"))
    178 178   if err != nil {
    179 179   log.Fatal(err)
    180 180   }
    skipped 11 lines
    192 192   
    193 193  func GetFinding(request FindingRequest) []SVDBEntry {
    194 194   //DB Connection
    195  - client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
     195 + client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017"))
    196 196   if err != nil {
    197 197   log.Fatal(err)
    198 198   }
    skipped 19 lines
    218 218   }
    219 219   }
    220 220   
    221  - fmt.Println(findingList)
     221 + //fmt.Println(findingList)
    222 222   return findingList
    223 223  }
    224 224   
    225 225  func listHosts(client *mongo.Client) []SVDBHost {
    226  - client, err := mongo.Connect(context.TODO())
     226 + //client, err := mongo.Connect(context.TODO())
    227 227   hostCollection := client.Database("Sirius").Collection("Hosts")
    228 228   
    229 229   var host SVDBHost
    skipped 30 lines
    260 260   log.Println(host)
    261 261   
    262 262   //DB Connection
    263  - client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
     263 + client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017"))
    264 264   if err != nil {
    265 265   log.Fatal(err)
    266 266   }
    skipped 15 lines
    282 282   log.Println("Got host update report")
    283 283   
    284 284   //DB Connection
    285  - client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
     285 + client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017"))
    286 286   if err != nil {
    287 287   log.Fatal(err)
    288 288   }
    skipped 13 lines
    302 302  //Add CVE API Endpoint?
    303 303  func NewCVE(host string, cve string) {
    304 304   //DB Connection
    305  - client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
     305 + client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017"))
    306 306   if err != nil {
    307 307   log.Fatal(err)
    308 308   }
    skipped 330 lines
  • API/tmp/sirius-api
    Binary file.
  • ■ ■ ■ ■ ■ ■
    UI/.gitignore
    skipped 22 lines
    23 23  *.sln
    24 24  *.sw?
    25 25   
     26 +# Custom Sirius
     27 +src/sirius/testdata/*
  • ■ ■ ■ ■ ■ ■
    UI/Dockerfile
     1 +# syntax=docker/dockerfile:1
     2 +
     3 +FROM node:18-alpine
     4 +WORKDIR /app
     5 +COPY . .
     6 +RUN yarn install
     7 +CMD ["yarn", "run", "dev"]
     8 +EXPOSE 5173
  • ■ ■ ■ ■ ■ ■
    UI/package.json
    1 1  {
    2  - "name": "test-admin",
     2 + "name": "sirius-scan",
    3 3   "private": true,
    4 4   "version": "0.0.0",
    5 5   "type": "module",
    6 6   "scripts": {
    7  - "dev": "vite",
     7 + "dev": "vite --host",
    8 8   "build": "tsc && vite build",
    9 9   "preview": "vite preview"
    10 10   },
    skipped 5 lines
    16 16   "ra-data-json-server": "^4.6.2",
    17 17   "react": "^18.2.0",
    18 18   "react-admin": "^4.6.2",
    19  - "react-dom": "^18.2.0"
     19 + "react-dom": "^18.2.0",
     20 + "rsuite": "^5.28.0"
    20 21   },
    21 22   "devDependencies": {
    22 23   "@types/react": "^18.0.26",
    skipped 7 lines
  • ■ ■ ■ ■ ■
    UI/src/App.tsx
    skipped 25 lines
    26 26  import purple from '@mui/material/colors/purple';
    27 27  import green from '@mui/material/colors/green';
    28 28   
     29 + 
     30 +// What is the Sirius theme color schema?
     31 +// Main options:
     32 +// #428dd1 - light blue
     33 +// #1b2a3b - darker scheme
     34 +// #00274b - darker scheme but more blue
     35 + 
    29 36  const theme = {
    30 37   ...defaultTheme,
    31 38   palette: {
    skipped 4 lines
    36 43   main: green[500],
    37 44   },
    38 45   background: {
    39  - default: '#fafafb',
     46 + default: '#eaeaea',
    40 47   },
    41 48   },
    42 49  };
    skipped 26 lines
  • ■ ■ ■ ■
    UI/src/sirius/SingleReport.tsx
    skipped 25 lines
    26 26   const reportTitle = reportType + " Report";
    27 27   
    28 28   return (
    29  - <Container sx={{marginTop: 12, marginLeft: 3}}>
     29 + <Container sx={{marginTop: 8, marginLeft: 3}}>
    30 30   <Paper>
    31 31   <Box sx={{
    32 32   backgroundColor: "primary.main",
    skipped 34 lines
  • ■ ■ ■ ■ ■
    UI/src/sirius/components/VulnReport.tsx
    1 1  import * as React from 'react';
     2 +import { useSearchParams } from 'react-router-dom';
    2 3  import { Card, CardContent, CardHeader, Paper } from "@mui/material";
    3 4  import { Container } from "@mui/material";
    4 5  import Tabs from '@mui/material/Tabs';
    skipped 15 lines
    20 21  export default function VulnReportTabs() {
    21 22   const [value, setValue] = React.useState(0);
    22 23   const [vulnList, setVulnList] = React.useState([]);
     24 + const [queryParameters] = useSearchParams()
    23 25   
    24 26   React.useEffect(() => {
    25 27   //Get the list of vulnerabilities
    skipped 1 lines
    27 29   const requestOptions = {
    28 30   method: 'POST',
    29 31   headers: { 'Content-Type': 'application/json' },
    30  - body: JSON.stringify({ CVE: ['CVE-2022-32168'] })
     32 + body: JSON.stringify({ CVE: [queryParameters.get("id")] })
    31 33   };
    32 34   fetch('http://localhost:8080/api/svdb/get/finding', requestOptions)
    33 35   .then((response) => response.json())
    skipped 72 lines
  • UI/yarn.lock
    Diff is too large to be displayed.
  • ■ ■ ■ ■ ■ ■
    docker-compose.yaml
     1 +version: '3.4'
     2 +services:
     3 + mongo:
     4 + image: mongo
     5 + restart: always
     6 + ports:
     7 + - 27017:27017
     8 + 
     9 + sirius-api:
     10 + build: ./API/
     11 + restart: always
     12 + ports:
     13 + - "8080:8080"
     14 + depends_on:
     15 + - mongo
     16 + 
     17 + 
Please wait...
Page is in error, reload to recover