Hoverfly does not intercept my own defined host in destination - hoverfly

When I start hoverfly in simulate mode (or as a webserver, it doesn't matter) and define some destination then I must do request via proxy (or straight to localhost:8500 in case of webserver).
Is there a way to start hoverfly and define destination, for example as "my-host" so that I could do requests straight to http://my-host/some-path instead of using proxy or localhost:8500?
P.S. this way works in integration tests when I use hoverfly-java but doesn't work via CLI

Hoverfly is bind to loopback interface by default, meaning that you can only access to it on localhost. To access it remotely, you can specify the IP address it listens on. For example, setting 0.0.0.0 to listen on all network interfaces. [Source]
Try:
hoverctl start --listen-on-host 0.0.0.0 webserver
So if your "my-host" ip is 10.10.10.136. Then your requests would look like
http://10.10.10.136:8500/some-path

Related

How can I access services via subdomain instead of ip + port?

I have a little server in my local network that provides several web services. Each service can be accessed by entering the ip of the server followed by the respective port.
Now I always have to remember which service is behind which port and it would be nicer to have specific subdomains forwarded to these ports. For example
ip:1234 -> foo.server.local
ip:4321 -> bar.server.local
How can this be done? I have pihole running on the server and had hoped to get this done using pihole but I was not successful.
What you are looking for is to set up a Domain Name Server (DNS). phoenixnap.com/kb/raspberry-pi-dns-server This guide should help.
You use a domain to direct to an IP:port combo. Like you could direct 123.12.12.12:8080 to some.thing and 123.12.12.12:8081 to any.address.
The domain name is arbitrary and masks the whole IP:port address.

How to block access to a specific port on docker

I have a docker container which exposes a RESTful API on a specific port (e.g. 4567) on a host machine. According to security requirements, I need to block all requests coming to this port (i.e. 4567) except the one coming from a specific application (say a scheduler like oozie). I'm not very familiar with firewalls, but I'm guessing the first part (blocking on access to the port) can be done in the firewall, but how can I open access to only one application?

How to change 0.0.0.0:8090 address to mastery.local in docker

I have a container called web, it contains my application and apache webserver. When I put to browser address 0.0.0.0:8090 i get my working application. But i need to change this address to mastery.local. How do I do that without using /etc/hosts file.
This can only be achieved via DNS resolution.
The simplest way would be to add this entry to the /etc/hosts.
As an alternative you could setup an dedicated DNS server on your machine which resolves this address to 0.0.0.0 and then configure your machine to use this DNS server.

etc/hosts with port number (fix for foreman)

I am using Foreman specifing port 3000. How can I access my application by writting myapp.local in the browser instead of typing 0.0.0.0:3000?
I have added:
0.0.0.0 myapp.local
But when doing myapp.local it defaults to the default localhost for Apache, not the Rails app.
Short answer: You can't.
The host table is meant to map hostnames to IP addresses (Wiki). Ports come in at a different point.
However, you can specify the port Foreman should run on:
-p, --port
Specify which port to use as the base for this application. Should be a multiple of 1000.
I don't know the Foreman but as you connect to it with your browser than I assume it talks via HTTP. If so you can use proxy settings to point to that host:port. Try FoxyProxy. It's more like a workaround rather than a real solution but it should work (as far as it's not HTTPS)
If you're using Linux than another way is to use LD_PRELOAD to overwrite connect glibc function. It's quite low level hack but it's not so complicated.
Another way in Linux would be to make netfilter rule (iptables) to NAT the connection. It's not nice either as you'll need root level change to achieve simple thing.

I can't access port from outside

I'm using a dedicated server on aruba with ZyWall firewall. I have two ports listening in the server, using telnet from inside I can connect to both the ports. If I try to telnet from outside I can access only to one of them.
I have not internal firewall, and I don't understand how I can see if the ZyWall is blocking the port access or it is forwarding all connections to that port to another ip.
Have you any suggestion?
I found the solution. I accessed the firewall web interface from a firefox installed in the dedicated server behind the firewall (the web interface is not accessible from outside), then I made two steps:
I added a rule on which I permit the access to the target port. I made this using the "Service" tab in the Security->Firewall menĂ¹.
In the matrix between LAN, WAN, DMZ etc.. I modified the rule "from WAN to LAN" and I added the rule made in the previous step.
Now it works!

Resources