• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

TykTechnologies / tyk / 7416 / 2

Build:
DEFAULT BRANCH: master
Ran 24 Sep 2019 03:08PM UTC
Files 87
Run time 5s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

24 Sep 2019 02:56PM UTC coverage: 57.478% (+0.1%) from 57.372%
LATEST_GO=true

push

travis-ci

buger
Add support for whitelisting ports (#2533)

Add support for whitelisting ports

This change introduces `ports_whitelist` configuration option to `tyk.conf`, which
defines which ports should the gateway allow services to be bind to.

example configuration is like this

```json
{
  "ports_whitelist": {
    "http": {
      "ranges": [
        {
          "from": 8000,
          "to": 9000
        }
      ]
    },
    "tcp": {
      "ranges": [
        {
          "from": 7001,
          "to": 7900
        }
      ]
    },
    "tls": {
      "ports": [
        6000,
        6015
      ]
    }
  }
}
```

You define the protocol `http`, `https`, `tcp` or `tls` which maps to an object 
with schema

```json
{
    "type": [
        "object"
    ],
    "additionalProperties": false,
    "properties": {
        "ranges": {
            "type": "array",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "from": {
                        "type": "integer"
                    },
                    "to": {
                        "type": "integer"
                    }
                }
            }
        }
    },
    "ports": {
        "type": "array",
        "items": {
            "type": "integer"
        }
    }
}
```


# Defining specific ports

You can  configure a specific port to be available like this.

```json
{
    "ports_whitelist": {
        "http": {
            "ports": [
                8089,
                8090
            ]
        }
    }
}
```

This configuration tells the gateway to allow `http` services only on port `8089`
and `8090`

# Defining port ranges

port ranges is the boundary of allowed ports inclusively. This helps to avoid 
tedious specifying each possible ports.

Example

```json
{
    "ports_whitelist": {
        "http": {... (continued)

9846 of 17130 relevant lines covered (57.48%)

129.56 hits per line

Source Files on job 7416.2 (LATEST_GO=true)
  • Tree
  • List 0
  • Changed 19
  • Source Changed 3
  • Coverage Changed 19
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 6748
  • Travis Job 7416.2
  • 1c72a1a5 on github
  • Prev Job for LATEST_GO=true on master (#7411.2)
  • Next Job for LATEST_GO=true on master (#7418.2)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc