Version: SG FLX
Community

Proxies

Some Signals’ actions (e.g. Webhook action) and HTTP Input may need an HTTP proxy to connect to the target endpoint. If no additional proxy configuration is provided for the action or input then requests will be sent directly to the target endpoint, which in this case may be inaccessible. To overcome this inconvenience, it is possible to define which proxy should be used by a Signals component to route requests. An example of such a configuration is visible below.

{
  "proxy": "http://localhost:127.0.0.1:8090"
}

The above configuration directly defines proxy which is present in the field proxy. This means that it might be necessary to update such configuration in many various Signals components when the proxy address changes.

To simplify proxy management Search Guard offers a REST API which can be used for proxies management. The proxies are created via the REST API and then referenced by id in the configuration like in the below example

{
  "proxy": "my-proxy-id"
}

The proxy can be modified with the REST API and all Signals components which referenced the proxy by id will start using the newer configuration on the fly.

Signals supports also global configuration of an HTTP proxy which is used for all Signals actions and checks which create HTTP connections. This global configuration may be overridden on action or check level as described above.

The global proxy can be configured via REST API, using the Signals setting http.proxy.

Proxy management

The following REST API is defined to perform CRUD (create, read, update, delete) operations on the proxies.

REST API for managing global Signals settings.

Example

The following watch uses proxy in the HTTP Input and Webhook action configuration.

{
  "trigger": {
    "schedule": {
      "interval": [
        "30s"
      ]
    }
  },
  "actions": [
    {
      "type": "webhook",
      "name": "testhook",
      "throttle_period": "0",
      "request": {
        "method": "GET",
        "url": "http://localhost:8080/test"
      },
      "proxy": "my-proxy-id"
    }
  ],
  "checks": [
    {
      "type": "http",
      "name": "testhttp",
      "target": "samplejson",
      "request": {
        "url": "http://localhost:8080/test",
        "method": "GET"
      },
      "proxy": "127.0.0.1:9199"
    }
  ],
  "active": true,
  "log_runtime_data": false,
  "_meta": {}
}


Not what you were looking for? Try the search.