Skip to content

Commit

Permalink
Correct Vulnerability display bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Frankccv committed Sep 20, 2023
1 parent 0ead1ae commit 93153df
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ It is recommended to use version 4.0.
#start
sudo npm start
# use another configuration file
node bin/www --config=config.json
sudo node bin/www --config=config.json
```

An option in the configuration file can be overriden by giving a new parameter when running operator, for example:
Expand Down
2 changes: 1 addition & 1 deletion www/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"client_name": "mmt-operator-kafka-client"
},
"master_node":{
"host":"lo1256calhost",
"host":"localhost",
"port":"22",
"password":"12345",
"username":"frank"
Expand Down
8 changes: 4 additions & 4 deletions www/public/js/chart/tab.remediation.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ ReportFactory.createRemediationReport = function (fPeriod) {

};
const $group = { _id: { CID: "$CID", attack: "$attack" }, count: { $sum: 1 } , "description":{ $first: "$description" },"ipAttack":{$first : "$ipAttack"}, "timestamp": {$first: "$timestamp"} };
const $project = {"_id":0 , CID: "$_id.CID", attack: "$_id.attack", description: 1, ipAttack:1 ,timestamp:1 , count: 1 } ;
const $project = { "_id":0 , CID: "$_id.CID", attack: "$_id.attack", description: 1, ipAttack:1 ,timestamp:1 , count: 1 } ;
//const $group = { _id: "$CID"};

return { query: [ {$group : $group},{ $match: $match } ,{$project : $project}] };
Expand Down Expand Up @@ -128,7 +128,7 @@ ReportFactory.createRemediationReport = function (fPeriod) {
{id : "Row",label:"Row"},
{id : "CID", label: "CID" },
{id : "description", label: "Description"} ,
{id : "attack", label: "Attack"} ,
{id : "attack", label: "Attacks"} ,
{id : "timestamp", label: "Timestamp"} ,
{id : "ipAttack", label: "IP attacker"} ,
{id: "count", label: "#"},
Expand Down Expand Up @@ -169,7 +169,7 @@ ReportFactory.createRemediationReport = function (fPeriod) {
MMTDrop.alert.success("Remediation successfully sent ", 10*1000);
// var button = document.getElementById("sancus-buttton");
//console.log(row_data[4]);
var image = document.getElementById("redAtt_"+index);
var image = document.getElementById("redAtt_"+index); //change image
image.src = "../img/green_button.png";
image.style = "width: 20px; height: 20px";
var text = document.getElementById("spanAtt_"+index);
Expand Down Expand Up @@ -289,7 +289,7 @@ var cTable = MMTDrop.chartFactory.createTable({
//{id: 1, label: "App ID"},
{id : "Row",label:"Row"},
{id : "CID", label: "CID" },
{id : "description", label: "description"} ,
{id : "description", label: "Description"} ,
{id : "attack", label: "Vulnerability id"} ,
{id : "timestamp", label: "Timestamp"} ,
{id : "count", label: "#" },
Expand Down
2 changes: 2 additions & 0 deletions www/reportReader/busReader.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ async function queryIpMongo( attackId ) {
//attacksTargeted[index] = json1[1][0];
outputJson.CID = json1[0];
outputJson.attack = json1[1][0];
console.log("attack "+json1[1][0])

outputJson.description = descriptionObj ? descriptionObj.description : "";
outputJson.ipAttack = ipAttacker ;
outputJson.timestamp = currentTimestampInSeconds ;
Expand Down

0 comments on commit 93153df

Please sign in to comment.