WaverleyLabs / fwknop

Client and Gateway Modules for Software Defined Perimeter (SDP)
GNU General Public License v2.0
88 stars 51 forks source link

SDP Client more 30 seconds access timeout #2

Open Joncheski opened 6 years ago

Joncheski commented 6 years ago

Dear, I want SDP Client to have more than 30 seconds open session. I tried to make a change to SDP Gateway in the file access.conf, but there are no changes. Will you be able to tell me which configurations I need to change and where to increase the time of the client's session.

SPA Field Values: ================= Random Value: 1319806268186699 SDP Client ID: 55564 Username: root Timestamp: 1532524149 FKO Version: 2.0.2 Message Type: 1 (Service access msg) Message String: 192.168.218.2,2 Nat Access: Server Auth: Client Timeout: 0 Digest Type: 3 (SHA256) HMAC Type: 3 (SHA256) Encryption Type: 1 (Rijndael) Encryption Mode: 2 (CBC) Disable SDP Mode: 0 (SDP Mode Enabled) Encoded SDP ID: DNkAAA Encoded Data: 1319806268186699:1532524149:1:MTkyLjE2OC4yMTguMiwy SPA Data Digest: DVwDkql2vADS7Bm4ve7YoGeEFOvGBBZU12JTUNMkbAA HMAC: nEe3cdJ/0TCSeEOIeEwROdAMHmaJ/DR6K9/gEKREOKo Final SPA Data: DNkAAA9KfSeZDAT5EXDbxoUc1OE1pyJIts+qMYdHfr78Ph2J1tJoX5xG1MobUTgF1IVpzhY+kC9AxLPi73dG5NFipV8A0/iJGJ3LATZHmP9kFkuRG43hGDgjLP616WSQPncdNi7vu8z6a8DkCgnEe3cdJ/0TCSeEOIeEwROdAMHmaJ/DR6K9/gEKREOKo

Generating SPA packet: protocol: udp source port: destination port: 62201 IP/host: 192.168.82.156 (sdp_com.c:590) Starting connection attempt 1 (sdp_com.c:371) Connected with ECDHE-RSA-AES128-GCM-SHA256 encryption (sdp_com.c:703) Server certificates: (sdp_com.c:705) Subject: /O=####/CN=#### (sdp_com.c:708) Issuer: /O=####/CN=#### (sdp_ctrl_client.c:627) Credentials-good message received (sdp_message.c:258) Received credential update message (sdp_ctrl_client.c:637) Credential update received (sdp_ctrl_client.c:1960) All new credentials stored successfully (sdp_ctrl_client.c:1562) SDP Control Client Exiting SDP ctrl client ran successfully send_spa_packet: bytes sent: 189

Best regards, Goce Joncheski

hydrolucid commented 6 years ago

Just to make sure I understand your question, are you referring to the firewall timeout that closes a port on the gateway 30 seconds after the client sends a SPA packet?

hydrolucid commented 6 years ago

Assuming you are referring to the gateway/server closing an opened port after 30 seconds, I want to point out a couple items:

  1. If the client device connects to a service through that open port, the port can be closed without interrupting the service. This works in cases like ssh connections. It does get a little trickier with HTTP, but see 2.
  2. With HTTP, the server is often configured by default not to reuse TCP connections, so each HTTP request from a browser creates a new TCP connection. This means after the firewall port is closed, the next request looks like a totally new TCP connection and is rejected. BUT, you can configure the HTTP server to reuse connections and you also set a timeout. In our testing, we usually set up the HTTP server to timeout after 10 minutes. This means as long as the user on the client performs some sort of HTTP request every 10 minutes, the connection does not time out, and access is maintained long after the firewall port is closed. See here for information on configuring these features on Apache.

Back to your original question. Our version of SDP does not use access.conf by default, because the gateway now gets its access data from the controller instead. Unfortunately, we did not get around to making an equivalent configuration parameter to change the timeout on the controller and pass this parameter to the gateway, so it currently can only use the default timeout coded on the gateway. You can change the default and recompile the gateway code. The line of code to change is here.

Joncheski commented 6 years ago

Exactly, that was my question. After sending a SPA package to SDP Gateway, it has an open access port for only 30 seconds. And I found it in the code where to change those 30 seconds to be default, but for each change you need to re-deploy the entire Gateway. Is there any other solution than re-deploy, when it can not be taken from a configuration file? I use proxy as ngnix. But after that 30 seconds there is no data flow and information and all packets and sessions are closed.