Skip to content

Commit 94110a2

Browse files
authored
Merge pull request #41 from Cryptophobia/master
Deprecating Tcell WAF module support
2 parents 2ae9bf3 + d253929 commit 94110a2

File tree

3 files changed

+3
-24
lines changed

3 files changed

+3
-24
lines changed

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,7 @@ _Note that Kubernetes annotation maps are all of Go type `map[string]string`. A
248248
| <a name="disable-server-tokens"></a>deis-router | deployment | [router.deis.io/nginx.disableServerTokens](#disable-server-tokens) | `"false"` | Enables or disables emitting nginx version in error messages and in the “Server” response header field. |
249249
| <a name="enforce-whitelists"></a>deis-router | deployment | [router.deis.io/nginx.enforceWhitelists](#enforce-whitelists) | `"false"` | Whether to _require_ application-level whitelists that explicitly enumerate allowed clients by IP / CIDR range. With this enabled, each app will drop _all_ requests unless a whitelist has been defined. |
250250
| <a name="enable-regex-domains"></a>deis-router | deployment | [router.deis.io/nginx.enableRegexDomains](#enable-regex-domains) | `"false"` | Whether to _enable_ application-level regex domain that can be explicitly defined for specific applications. With this option enabled, each app can have its own regex domain in server_name blocks of the nginx config. This allows for useful domains like `store-number-\d*.example.com`. |
251-
| <a name="load-tcell-module"></a>deis-router | deployment | [router.deis.io/nginx.loadTcellModule](#load-tcell-module) | `"false"` | Whether to _enable_ the dynamic security nginx module provided by [Tcell](https://tcell.io/) as a [WAF](https://en.wikipedia.org/wiki/Web_application_firewall) on the router. Note this requires that you purchase a Tcell account and have application configured in the Tcell UI. The tcell_agent.config is passed through a configMap object through k8s. Example of the configMap can be found in this [gist](https://gist.github.com/Cryptophobia/648b23f234eeb9538c87b478de401a53). The open source alternative for this is Modsecurity dynamic module. |
252-
| <a name="global-tcell-app-id"></a>deis-router | deployment | [router.deis.io/nginx.globalTcellAppID](#global-tcell-app-id) | N/A | This is the global app id to insert for the Tcell module in the top-most http{} block of the nginx config. To configure an individual app id for each application, you need to use the application annotation below. The application specific app id will take precedence over the global one. |
253-
| <a name="load-modsecurity-module"></a>deis-router | deployment | [router.deis.io/nginx.loadModsecurityModule](#load-modsecurity-module) | `"false"` | Whether to _enable_ the open source dynamic security nginx module [Modsecurity](https://github.com/SpiderLabs/ModSecurity/tree/v3/master) globally for all apps as a [WAF](https://en.wikipedia.org/wiki/Web_application_firewall) on the router. The rule set that Modsecurity will use by default is the [OWASP ModSecurity Core Rule Set (CRS)](https://github.com/SpiderLabs/owasp-modsecurity-crs) and Modsecurity will be turned on to block malicious traffic on all apps if this annotation is enabled. This core rule set can be overwritten by configMap like in the example above for the Tcell module. |
251+
| <a name="load-modsecurity-module"></a>deis-router | deployment | [router.deis.io/nginx.loadModsecurityModule](#load-modsecurity-module) | `"false"` | Whether to _enable_ the open source dynamic security nginx module [Modsecurity](https://github.com/SpiderLabs/ModSecurity/tree/v3/master) globally for all apps as a [WAF](https://en.wikipedia.org/wiki/Web_application_firewall) on the router. The rule set that Modsecurity will use by default is the [OWASP ModSecurity Core Rule Set (CRS)](https://github.com/SpiderLabs/owasp-modsecurity-crs) and Modsecurity will be turned on to block malicious traffic on all apps if this annotation is enabled. This core rule set can be overwritten by configMap and mounted as a volumeMount. |
254252
| <a name="default-whitelist"></a>deis-router | deployment | [router.deis.io/nginx.defaultWhitelist](#default-whitelist) | N/A | A default (router-wide) whitelist expressed as a comma-delimited list of addresses (using IP or CIDR notation). Application-specific whitelists can either extend or override this default. |
255253
| <a name="whitelist-mode"></a>deis-router | deployment | [router.deis.io/nginx.whitelistMode](#whitelist-mode) | `"extend"` | Whether application-specific whitelists should extend or override the router-wide default whitelist (if defined). Valid values are `"extend"` and `"override"`. |
256254
| <a name="default-service-enabled"></a>deis-router | deployment | [router.deis.io/nginx.defaultServiceEnabled](#default-service-enabled) | `"false"` | Enables default back-end service for traffic hitting /. In order to work correctly both `defaultServiceIP` and `DefaultAppName` MUST also be set. |
@@ -280,7 +278,6 @@ _Note that Kubernetes annotation maps are all of Go type `map[string]string`. A
280278
| <a name="builder-tcp-timeout"></a>deis-builder | service | [router.deis.io/nginx.tcpTimeout](#builder-tcp-timeout) | `"1200s"` | nginx `proxy_timeout` setting expressed in units `ms`, `s`, `m`, `h`, `d`, `w`, `M`, or `y`. |
281279
| <a name="app-domains"></a>routable application | service | [router.deis.io/domains](#app-domains) | N/A | Comma-delimited list of domains for which traffic should be routed to the application. These may be fully qualified (e.g. `foo.example.com`) or, if not containing any `.` character, will be considered subdomains of the router's domain, if that is defined. |
282280
| <a name="app-regex-domain"></a>routable application | service | [router.deis.io/regexDomain](#app-regex-domain) | N/A | A string that represents the regex domain for which traffic should be routed to the application. This is the regex domain (e.g. `foo-store-\d*`) if not containing any `.` character and will be considered a subdomain of the router's domain, if that is defined. The regex domain cannot be a fully qualified name (e.g. `foo-store-\d*.example.com`) for safety and security right now. This feature must be enabled on the router via enable-regex-domain annotation above. |
283-
| <a name="app-tcell-app-id"></a>routable application | service | [router.deis.io/tcellAppID](#app-tcell-app-id) | N/A | This is the individual app id to insert for the Tcell module in the server{} block of the nginx config for each app. The application specific app id will take precedence over the global one if defined. |
284281
| <a name="app-certificates"></a>routable application | service | [router.deis.io/certificates](#app-certificates) | N/A | Comma delimited list of mappings between domain names (see `router.deis.io/domains`) and the certificate to be used for each. The domain name and certificate name must be separated by a colon. See the [SSL section](#ssl) below for further details. |
285282
| <a name="app-whitelist"></a>routable application | service | [router.deis.io/whitelist](#app-whitelist) | N/A | Comma-delimited list of addresses permitted to access the application (using IP or CIDR notation). These may either extend or override the router-wide default whitelist (if defined). Requests from all other addresses are denied. |
286283
| <a name="app-connect-timeout"></a>routable application | service | [router.deis.io/connectTimeout](#app-connect-timeout) | `"30s"` | nginx `proxy_connect_timeout` setting expressed in units `ms`, `s`, `m`, `h`, `d`, `w`, `M`, or `y`. |

model/model.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ type RouterConfig struct {
5757
DefaultWhitelist []string `key:"defaultWhitelist" constraint:"^((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/([0-9]|[1-2][0-9]|3[0-2]))?(\\s*,\\s*)?)+$"`
5858
WhitelistMode string `key:"whitelistMode" constraint:"^(extend|override)$"`
5959
EnableRegexDomains bool `key:"enableRegexDomains" constraint:"(?i)^(true|false)$"`
60-
LoadTcellModule bool `key:"loadTcellModule" constraint:"(?i)^(true|false)$"`
61-
GlobalTcellAppID string `key:"globalTcellAppID" constraint:"(?i)^([a-z0-9]+(-[a-z0-9]+)*)+[a-z0-9]+$"`
6260
LoadModsecurityModule bool `key:"loadModsecurityModule" constraint:"(?i)^(true|false)$"`
6361
DefaultServiceIP string `key:"defaultServiceIP"`
6462
DefaultAppName string `key:"defaultAppName"`
@@ -99,7 +97,6 @@ func newRouterConfig() (*RouterConfig, error) {
9997
EnforceWhitelists: false,
10098
WhitelistMode: "extend",
10199
EnableRegexDomains: false,
102-
LoadTcellModule: false,
103100
LoadModsecurityModule: false,
104101
RequestIDs: false,
105102
SSLConfig: newSSLConfig(),
@@ -145,7 +142,6 @@ type AppConfig struct {
145142
Name string
146143
Domains []string `key:"domains" constraint:"(?i)^((([a-z0-9]+(-*[a-z0-9]+)*)|((\\*\\.)?[a-z0-9]+(-*[a-z0-9]+)*\\.)+[a-z0-9]+(-*[a-z0-9]+)+)(\\s*,\\s*)?)+$"`
147144
RegexDomain string `key:"regexDomain"`
148-
TcellAppID string `key:"tcellAppID" constraint:"(?i)^([a-z0-9]+(-[a-z0-9]+)*)+[a-z0-9]+$"`
149145
Whitelist []string `key:"whitelist" constraint:"^((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/([0-9]|[1-2][0-9]|3[0-2]))?(\\s*,\\s*)?)+$"`
150146
ConnectTimeout string `key:"connectTimeout" constraint:"^[1-9]\\d*(ms|[smhdwMy])?$"`
151147
TCPTimeout string `key:"tcpTimeout" constraint:"^[1-9]\\d*(ms|[smhdwMy])?$"`

nginx/config.go

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ const (
1616
pid /tmp/nginx.pid;
1717
worker_processes {{ $routerConfig.WorkerProcesses }};
1818
19-
{{ if $routerConfig.LoadTcellModule -}}
20-
# Loading the Tcell nginx dynamic module
21-
load_module modules/ngx_http_tcell_agent_module.so;
22-
{{- end }}
23-
2419
{{ if $routerConfig.LoadModsecurityModule -}}
2520
# Loading the Modsecurity connector nginx dynamic module
2621
load_module modules/ngx_http_modsecurity_module.so;
@@ -39,11 +34,6 @@ http {
3934
4035
vhost_traffic_status_zone shared:vhost_traffic_status:{{ $routerConfig.TrafficStatusZoneSize }};
4136
42-
{{ if and $routerConfig.LoadTcellModule $routerConfig.GlobalTcellAppID -}}
43-
# Including the global Tcell AppID
44-
tcell_app_id {{ $routerConfig.GlobalTcellAppID }};
45-
{{- end }}
46-
4737
# The timeout value must be greater than the front facing load balancers timeout value.
4838
# Default is the deis recommended timeout value for ELB - 1200 seconds + 100s extra.
4939
keepalive_timeout {{ $routerConfig.DefaultTimeout }};
@@ -191,7 +181,7 @@ http {
191181
# set header size limits
192182
{{ if $routerConfig.HTTP2Enabled }} http2_max_header_size {{ $routerConfig.HTTP2MaxHeaderSize }}; {{ end }}
193183
{{ if $routerConfig.HTTP2Enabled }} http2_max_field_size {{ $routerConfig.HTTP2MaxFieldSize }}; {{ end }}
194-
184+
195185
set $app_name "router-default-vhost";
196186
ssl_protocols {{ $sslConfig.Protocols }};
197187
{{ if ne $sslConfig.Ciphers "" }}ssl_ciphers {{ $sslConfig.Ciphers }};{{ end }}
@@ -256,10 +246,6 @@ http {
256246
port_in_redirect off;
257247
set $app_name "{{ $appConfig.Name }}";
258248
259-
{{ if and $routerConfig.LoadTcellModule $appConfig.TcellAppID -}}
260-
tcell_app_id {{ $appConfig.TcellAppID }};
261-
{{- end }}
262-
263249
{{ if $routerConfig.LoadModsecurityModule -}}
264250
# Turning on modsecurity if modsecurity module loaded
265251
modsecurity on;
@@ -269,7 +255,7 @@ http {
269255
# set header size limits
270256
{{ if $routerConfig.HTTP2Enabled }} http2_max_header_size {{ $routerConfig.HTTP2MaxHeaderSize }}; {{ end }}
271257
{{ if $routerConfig.HTTP2Enabled }} http2_max_field_size {{ $routerConfig.HTTP2MaxFieldSize }}; {{ end }}
272-
258+
273259
{{ if index $appConfig.Certificates $domain }}
274260
listen 6443 ssl {{ if $routerConfig.HTTP2Enabled }}http2{{ end }} {{ if $routerConfig.UseProxyProtocol }}proxy_protocol{{ end }};
275261
ssl_protocols {{ $sslConfig.Protocols }};

0 commit comments

Comments
 (0)