wmerfalen / knockd-specification-rfc

An RFC for a knockd implementation
1 stars 0 forks source link

Protocol's Features #2

Open the-moisrex opened 1 year ago

the-moisrex commented 1 year ago

Some features that comes to my mind:

What do you think? Let's talk about each and every one of them and even more and let's see which ones are good to be included in the protocol and which ones don't need to.

wmerfalen commented 1 year ago

So I will start with the things that I'm not interested in incorporating.

No problem with packets being received out-of-order

The way I have the code setup, ports have to be knocked in a specific sequence. I don't plan on changing that, though I also don't care if a fork of the code implements that.

No identifiable feedback to the client when the wrong sequence is knocked

This is the current behavior

MAC address authentication will be difficult because I'm almost positive most gateway interfaces will stamp their own MAC address onto outgoing traffic. This would have to be a LAN feature

... to be continued. It's late and I need sleep. Will add more comments in a day or so

the-moisrex commented 1 year ago

I'm okay with your current project, my intention is to design a protocol here and write the RFC, not to implement one; the implementation comes after when we have a good enough document to base it on.

Yes, MAC address authentication needs to be a local thing, but we also can let the client send (include it in the hash) its own MAC address. Even though the attacker would be able to choose any MAC address to send, but I think of this as a feature that would let the client and server config files to be able to specify a MAC address to restrict the port to.

We can separate the MAC address authentication in two parts:

At least that's what I think so far!

I'm aware that we're living in different time-zones. It's okay.

the-moisrex commented 1 year ago

Regarding out-of-order sequences,

well that's a big problem to solve. I think it can be a math problem to solve. Instead of a ASCII-to-Port-number conversion, we might be able to find a way to add some sort of sequencing built into the ASCII-to-Port algorithm. Do you have any ideas for that?

If we use a DNS-Based port knocking (which I don't think it's a good idea) (explained here) this problem won't exist at all because we're just doing one knock.

But one-knock protocols shouldn't be called port-knocking at all, we could just write a simple service for that. That's not what we want.

wmerfalen commented 1 year ago

So the reason I don't have a payload that is encrypted (or a payload at all) is because the method of unlocking a port is the act of using the port numbers in the packet. If we added any data to the body of the packets, then we're just creating a different type of authentication system. I'm just using port numbers

the-moisrex commented 1 year ago

Yes that's what I would want too. The act of calling the ports, that's it. I don't like to send or get anything other than the ports. The sequence of the port numbers is the hash itself.

wmerfalen commented 1 year ago

I'm not interested in working on this if you're not going to help with the implementation. This was more your idea than mine

the-moisrex commented 1 year ago

I understand.

My idea was to create a Secure Port Knocking Protocol, and then we would implement it, not to continue working on knockd. Knockd seems great, but I don't want to bound ourselves to the design decisions made during knockd while we're writing the RFC.

wmerfalen commented 1 year ago

Well, if you want to create a secure port knocking daemon, the last thing you do is make it a kernel module.

wmerfalen commented 1 year ago

I won't write anything that is a kernel module

the-moisrex commented 1 year ago

I'm still deciding if it's a good idea to make it a kernel module or a daemon.

I'm still leaning toward a kernel module because then we can involve the firewall rules.

Imagine something like this in nftables:

table inet door {
   pknoker {
      str "username:password"
   }

   chain inbound {
      knock @pknocker;
      ip addr in @pknocker accept;
   }
}
the-moisrex commented 1 year ago

I won't write anything that is a kernel module

I understand.

Why do you think it's a better idea to write it as a daemon?

wmerfalen commented 1 year ago

Not interested in making it a kernel module. Not interested in keeping it ran as root. If you have ideas for how to remove the root capability, I'm all ears. All the suggestions so far have been pretty terrible