HELLO_wORLD
Very Senior Member
Hello all,
I have several ideas for Aegis, but I don’t know when and if I will implement them.
One is IPv6 support, but there are not many block lists yet, so not a priority.
I also experimented with filtering incoming packets from the PREROUTING mangle table, so very early after they hit the router.
The advantage is that it catches and drop packets from blocked IPs before the router tries to route them, and we gain theoretically in safety (in the very unlikely case where the router would be infected with something that would listen to packets before the routing process*) and little on CPU load (mostly softirq), but with logging on, the softirq load is higher as we can catch more packets (as the routing process is dropping some).
I don’t know if you use logging all the time, but for the ones who are looking for performance, I don’t recommend to leave it on. Logs IMHO are useful punctually, to identify what is blocked often and troubleshoot, but not left on permanently.
If you do agree on that, I might change the rules to block incoming packets from mangle PREROUTING, but maybe not.
For outgoing packets (LAN or router trying to send to blocked addresses), I will keep the in the filter table, as it allows to REJECT (and inform local devices that we refuse the connection to blocked IP). I could make simpler and block in mangle br0 PREROUTING (but would need to bypass LAN network range to not block LAN to LAN traffic) or on mangle POSTROUTING, just before it leaves the router, but I then could not REJECT, only DROP.
I think it REJECTING is a better design, as using the filter table to filter outgoing packets.
* more on theoretical improved safety if blocking at PREROUTING: a malware could still listen to blocked incoming packets like tcpdump does.
Anyway, for a malware to be in the router, it would have to be in NG and/or @Voxel code, and I think we are very safe on this side, or it would have to be introduced by anything installed by the user like @kamoj addon or Aegis. We can trust @kamoj
About Aegis: it is 100% open source and shell script based, so no secrets.
So using PREROUTING for safety is not a real argument. Only a little performance gain can justify it, but is less than 0.5% CPU gain worth it?
I have several ideas for Aegis, but I don’t know when and if I will implement them.
One is IPv6 support, but there are not many block lists yet, so not a priority.
I also experimented with filtering incoming packets from the PREROUTING mangle table, so very early after they hit the router.
The advantage is that it catches and drop packets from blocked IPs before the router tries to route them, and we gain theoretically in safety (in the very unlikely case where the router would be infected with something that would listen to packets before the routing process*) and little on CPU load (mostly softirq), but with logging on, the softirq load is higher as we can catch more packets (as the routing process is dropping some).
I don’t know if you use logging all the time, but for the ones who are looking for performance, I don’t recommend to leave it on. Logs IMHO are useful punctually, to identify what is blocked often and troubleshoot, but not left on permanently.
If you do agree on that, I might change the rules to block incoming packets from mangle PREROUTING, but maybe not.
For outgoing packets (LAN or router trying to send to blocked addresses), I will keep the in the filter table, as it allows to REJECT (and inform local devices that we refuse the connection to blocked IP). I could make simpler and block in mangle br0 PREROUTING (but would need to bypass LAN network range to not block LAN to LAN traffic) or on mangle POSTROUTING, just before it leaves the router, but I then could not REJECT, only DROP.
I think it REJECTING is a better design, as using the filter table to filter outgoing packets.
* more on theoretical improved safety if blocking at PREROUTING: a malware could still listen to blocked incoming packets like tcpdump does.
Anyway, for a malware to be in the router, it would have to be in NG and/or @Voxel code, and I think we are very safe on this side, or it would have to be introduced by anything installed by the user like @kamoj addon or Aegis. We can trust @kamoj
About Aegis: it is 100% open source and shell script based, so no secrets.
So using PREROUTING for safety is not a real argument. Only a little performance gain can justify it, but is less than 0.5% CPU gain worth it?