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

TykTechnologies / tyk / 7416

Build:
DEFAULT BRANCH: master
Ran 24 Sep 2019 03:08PM UTC
Jobs 1
Files 87
Run time 6s
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
7416

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

Jobs
ID Job ID Ran Files Coverage
2 7416.2 (LATEST_GO=true) 24 Sep 2019 03:08PM UTC 0
57.48
Travis Job 7416.2
Source Files on build 7416
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #7416
  • 1c72a1a5 on github
  • Prev Build on master (#7411)
  • Next Build on master (#7418)
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