Skip to content

Configuring Proxy on an Agent

Introduction

You can configure a agent to use a proxy seperate from the system proxy. When you configure a proxy on the agent that does not touch the system proxy settings and other applications on the system have no access to this proxy configuration. If the system already has a proxy configured you can configure the agent proxy to have the agent use different proxy configuration. Without configuring the agent specific proxy the agent follows the system configuration.

Configuration

Here is how you actually configure the proxy. User and Password are optional and depend your proxy configuration, you would need to get those values from the proxy administrator. In the example below the port number for the sample proxy is 1234. Make sure you are using the latest version of the agent to run this. Check the content of the versions directory for the latest version and replace x.y.z with that version. If you don't have a versions folder, the agent in the agent folder is the latest. If you need to change the proxy configuration, just run this again and it will overwrite the existing config.

"c:\Program Files\Nanitor\Nanitor Agent\versions\x.y.z\nanitor-agent-bin.exe" proxy-set user:[email protected]:1234
sudo /usr/lib/nanitor-agent/bin/versions/x.y.z/nanitor-agent-bin proxy-set user:[email protected]:1234
sudo /Library/Nanitor/Nanitor\ Agent/versions/x.y.z/nanitor-agent-bin proxy-set user:[email protected]:1234

If successful you should get a response like Proxy URL successfully set to: proxy.company.com:1234

Clearing the configuration

To remove the agent proxy configuration and revert to the system system, just run proxy-clear.

"c:\Program Files\Nanitor\Nanitor Agent\versions\x.y.z\nanitor-agent-bin.exe" proxy-clear
sudo /usr/lib/nanitor-agent/bin/versions/x.y.z/nanitor-agent-bin proxy-clear
sudo /Library/Nanitor/Nanitor\ Agent/versions/x.y.z/nanitor-agent-bin proxy-clear

If successful you should get a response like Proxy URL successfully cleared

Checking configuration

The best way to see what is configured is to run the info command. You can also check the configuration file. See https://kb.nanitor.net/AgentTroubleshooting/ on how to find the configuration file. Here is how to run the info command.

"c:\Program Files\Nanitor\Nanitor Agent\versions\x.y.z\nanitor-agent-bin.exe" info
sudo /usr/lib/nanitor-agent/bin/versions/x.y.z/nanitor-agent-bin info
sudo /Library/Nanitor/Nanitor\ Agent/versions/x.y.z/nanitor-agent-bin info

The output should look like this

2023/03/07 15:43:07 agent_database.go:783: ▶ D 0x1 Running agent-database open
Proxy Server: None
Agent version: 3.7.0.zzzz
Server URL: https://demo.nanitor.com/api
UUID: 55d8c476-9a07-47c3-5f2b-889316624aef
Shadow Activity: false
Data Directory: /var/lib/nanitor/agent
LogFile: /var/log/nanitor/nanitor_agent.log