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

TykTechnologies / tyk / 7417
39%
master: %

Build:
Build:
LAST BUILD BRANCH: v2.9.4.8
DEFAULT BRANCH: master
Ran 24 Sep 2019 03:03PM UTC
Jobs 1
Files 0
Run time –
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

pending completion
7417

push

travis-ci

Tyk Bot
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)
Jobs
ID Job ID Ran Files Coverage
2 7417.2 (LATEST_GO=true) 24 Sep 2019 03:03PM UTC 0
Travis Job 7417.2
Source Files on build 7417
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #7417
  • 6bbc215f on github
  • Prev Build on release-2.9 (#7412)
  • Next Build on release-2.9 (#7424)
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