Skip to content

Commit

Permalink
Apply just C3
Browse files Browse the repository at this point in the history
  • Loading branch information
Frankccv committed Oct 15, 2023
1 parent 6c46e67 commit 22a0f4c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions www/routes/sancus/remediation.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ router.post("",async function(req, res) {
console.log("Received "+req.query.CID+" "+req.query.AttackId+" "+ req.query.IP +" "+req.query.type);
//produceMessage();
//_publishMessage( "testTopic", "ciao" )
if(req.query.CID=="C3"){
var scriptCode = config.master_node.command;
const command_ip = scriptCode.replace(/IP_ATT/g, req.query.IP);
console.log("Command "+command_ip);
Expand All @@ -98,14 +99,17 @@ router.post("",async function(req, res) {
deleteDocuments(req.query.CID,req.query.AttackId,"remediationVuln");

// res.sendFile('index.html', { root: __dirname + "../views/" } )
if(result==true){
res.status(204).end()//204: The server has successfully fulfilled the request and that there is no additional content to send in the response payload body.
if(result==true){
res.status(204).end()//204: The server has successfully fulfilled the request and that there is no additional content to send in the response payload body.

}
}
else
res.status(500).send( "Error:Message not published on KafkaBus" );

// res.status(400).end()//204: The server has not fulfilled the request and that there is no additional content to send in the response payload body.
}
else
res.status(500).send( "Cannot apply the selected remediation" );

});

Expand Down

0 comments on commit 22a0f4c

Please sign in to comment.