Posts

Showing posts from October, 2016

How to proxy SpringBoot application via Apache HTTPD

First we need to add the following to virtual host definition. ProxyPass / http://127.0.0.1:8080/ ProxyPassReverse / http://127.0.0.1:8080/ Enable the following modules: LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so Run SpringBoot application. Note that it starts on 127.0.0.1 interface. Also note that we pass extra parameter allowing for non-blocking entropy source. /opt/jdk1.8.0_101/bin/java -Dserver.address=127.0.0.1 -Djava.security.egd=file:/dev/./urandom -jar spring-boot-app.jar & Restart webserver systemctl restart httpd That's all folks!

Putty and KeePass

Image
I use KeePass as my password manager. I have a dozen SSH credentials stored there. It is some daunting work to enter credentials all the time for putty client. So I decided to automate that using URL field. My "opt" directory structure is as follow: bart@DELL-E7250 ~/OneDrive/opt $ find ./KeePass-2.33 ./KeePass-2.33/KeePass.chm ./KeePass-2.33/KeePass.config.xml ./KeePass-2.33/KeePass.exe ./KeePass-2.33/KeePass.exe.config ./KeePass-2.33/KeePass.XmlSerialize ... ./tools ./tools/PartCopy.exe ./tools/PartCopy.ini ./tools/PCATTCP.exe ./tools/PUTTY.EXE ./tools/sha1sum.exe So I decided to put the following to URL field: cmd://"{APPDIR}\..\tools\putty.exe" -ssh {USERNAME}@{TITLE} It is also possible to specify password: cmd://"{APPDIR}\..\tools\putty.exe" -ssh {USERNAME}@{TITLE} -pw {PASSWORD} Now all what I have to do is to double click URL cell and KeePass will run putty and connect to server automatically. Note that using version with pa

TLS in a hard way

Image
How I've push it to the limits. 1. Use only most secure ciphers with forward secrecy. SSLCipherSuite HIGH:MEDIUM:!SSLv3:!kRSA SSLProxyCipherSuite HIGH:MEDIUM:!SSLv3:!kRSA 2. Enable SSL. # diff httpd.conf httpd.conf.ORIGINAL 90c90 < LoadModule socache_shmcb_module modules/mod_socache_shmcb.so --- > # LoadModule socache_shmcb_module modules/mod_socache_shmcb.so 148c148 < LoadModule ssl_module modules/mod_ssl.so --- > # LoadModule ssl_module modules/mod_ssl.so 516c516 < Include conf/extra/httpd-ssl.conf --- > # Include conf/extra/httpd-ssl.conf 3. Enable vhosts. Note that SSL is enabled before vhosts (as SSL config contains VHost, and default VHost is first)... # diff httpd.conf httpd.conf.ORIGINAL 515,517c515,516 < # Secure (SSL/TLS) connections and Virtual hosts < Include conf/extra/httpd-ssl.conf < Include conf/extra/httpd-vhosts.conf --- > # Secure (SSL/TLS) connections > #Include conf/extra/httpd-ssl.conf 4. Restar

Adding web interface to OpenWRT

LuCI Web interface is nice, if only just to see nice graph: root@OpenWrt:~# opkg update root@OpenWrt:~# opkg install luci-ssl Seeing one error: Configuring luci-theme-bootstrap. //usr/lib/opkg/info/luci-theme-bootstrap.postinst: .: line 130: can't open './30_luci-theme-bootstrap' //usr/lib/opkg/info/luci-theme-bootstrap.postinst: .: line 130: can't open './30_luci-theme-bootstrap' Configuring luci-mod-admin-full. //usr/lib/opkg/info/luci-mod-admin-full.postinst: .: line 130: can't open './50_luci-mod-admin-full' //usr/lib/opkg/info/luci-mod-admin-full.postinst: .: line 130: can't open './50_luci-mod-admin-full'

Restarting OpenWRT every week

Very simply, start to edit crontab: root@OpenWrt:/etc/init.d# crontab -e Add the following line: 30 4 * * * reboot That is it!