[ Note: I'm not familiar with ufdbguard. ]
To do this in squid, you first should learn about its
ACL fundamentals.
In this example case, you're going to need to have a
port ACL that allows both 8084 and 21 (along with 80 and 443, probably). You'll deny all ports except those. You're also going to have a
dst or
dstdomain ACL that allows those two hosts. (All other connections should be explicitly denied at the end of your ruleset.)
Read up on the docs, and take a stab at it...