Skip to content

Commit

Permalink
Messy Refactor
Browse files Browse the repository at this point in the history
Updated index.js
Now supports hotloading of multiple configuration files.
Now evals callbacks on port triggers (from rules.json)
This feature will soon be removed; risky.

Now setTimeout to 2 seconds to load final counters into rules.

Minor changes to layout of rules.json.
  • Loading branch information
Dustyn Blackmore committed Apr 21, 2018
1 parent 0be5c22 commit 6444da5
Show file tree
Hide file tree
Showing 5 changed files with 224 additions and 73 deletions.
151 changes: 104 additions & 47 deletions src/config/rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,170 +4,227 @@
"_1": "ICMP",
"1": {
"global": {
"allowed": false
"allowed": false,
"acceptAction": null,
"rejectAction": null
},
"trusted": {
"allowed": true
"allowed": true,
"acceptAction": null,
"rejectAction": null
},
"untrusted": {
"allowed": false
"allowed": false,
"acceptAction": null,
"rejectAction": null
}
},
"_2": "IGMP",
"2": {
"global": {
"allowed": false
"allowed": false,
"acceptAction": null,
"rejectAction": null
},
"trusted": {
"allowed": true
"allowed": true,
"acceptAction": null,
"rejectAction": null
},
"untrusted": {
"allowed": false
"allowed": false,
"acceptAction": null,
"rejectAction": null
}
},
"_6": "TCP",
"6": {
"global": {
"allowed": false
"allowed": false,
"acceptAction": null,
"rejectAction": null
},
"trusted": {
"allowed": false
"allowed": false,
"acceptAction": null,
"rejectAction": null
},
"untrusted": {
"allowed": false
"allowed": false,
"acceptAction": null,
"rejectAction": null
}
},
"_17": "UDP",
"17": {
"global": {
"allowed": false
"allowed": false,
"acceptAction": null,
"rejectAction": null
},
"trusted": {
"allowed": false
"allowed": false,
"acceptAction": null,
"rejectAction": null
},
"untrusted": {
"allowed": false
"allowed": false,
"acceptAction": null,
"rejectAction": null
}
}
},
"outgoing": {
"_1": "ICMP",
"1": {
"global": {
"allowed": false
"allowed": false,
"acceptAction": null,
"rejectAction": null
},
"trusted": {
"allowed": true
"allowed": true,
"acceptAction": null,
"rejectAction": null
},
"untrusted": {
"allowed": false
"allowed": false,
"acceptAction": null,
"rejectAction": null
}
},
"_2": "IGMP",
"2": {
"global": {
"allowed": false
"allowed": false,
"acceptAction": null,
"rejectAction": null
},
"trusted": {
"allowed": true
"allowed": true,
"acceptAction": null,
"rejectAction": null
},
"untrusted": {
"allowed": false
"allowed": false,
"acceptAction": null,
"rejectAction": null
}
},
"_6": "TCP",
"6": {
"global": {
"allowed": true,
"acceptAction": null,
"rejectAction": null,
"ports": {
"22": {
"callback": null
},
"80": {
"callback": null
},
"443": {
"callback": null
"acceptAction": null,
"rejectAction": null
},
"993": {
"callback": null
},
"9092": {
"callback": null
"acceptAction": null,
"rejectAction": null
}
}
},
"trusted": {
"allowed": true,
"acceptAction": null,
"rejectAction": null,
"ports": {
"22": {
"callback": null
"acceptAction": null,
"rejectAction": null
},
"80": {
"callback": null
"acceptAction": null,
"rejectAction": null
},
"139": {
"callback": null
"acceptAction": null,
"rejectAction": null
},
"445": {
"callback": null
"acceptAction": null,
"rejectAction": null
},
"465": {
"callback": null
"acceptAction": null,
"rejectAction": null
},
"1900": {
"callback": null
"acceptAction": null,
"rejectAction": null
},
"9092": {
"callback": null
"acceptAction": null,
"rejectAction": null
}
}
},
"untrusted": {
"allowed": false
"allowed": false,
"acceptAction": null,
"rejectAction": null
}
},
"_17": "UDP",
"17": {
"global": {
"allowed": true,
"acceptAction": null,
"rejectAction": null,
"ports": {
"53": {
"callback": null
"acceptAction": "((packet) => { console.log(packet) })",
"rejectAction": null
},
"500": {
"callback": null
"acceptAction": null,
"rejectAction": null
},
"1701": {
"callback": null
"acceptAction": null,
"rejectAction": null
},
"4500": {
"callback": null
"acceptAction": null,
"rejectAction": null
}
}
},
"trusted": {
"allowed": true,
"acceptAction": null,
"rejectAction": null,
"ports": {
"123": {
"callback": null
"acceptAction": null,
"rejectAction": null
},
"137": {
"callback": null
"acceptAction": null,
"rejectAction": null
},
"138": {
"callback": null
"acceptAction": null,
"rejectAction": null
},
"1900": {
"callback": null
"acceptAction": null,
"rejectAction": null
},
"5353": {
"callback": null
"acceptAction": null,
"rejectAction": null
}
}
},
"untrusted": {
"allowed": false
"allowed": false,
"acceptAction": null,
"rejectAction": null
}
}
}
Expand Down
Loading

0 comments on commit 6444da5

Please sign in to comment.