Skip to content

Commit 3710b15

Browse files
author
Sven Schmidt
authored
Merge pull request #7 from anynines/blacklist-feature
Add blacklist feature, update nginx version
2 parents 1dae01e + 7d96c87 commit 3710b15

29 files changed

+1032
-44
lines changed

acceptance-tests/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./manifests/*.yml

acceptance-tests/Gemfile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'rspec'
4+
gem 'httparty'

acceptance-tests/Gemfile.lock

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
diff-lcs (1.3)
5+
httparty (0.15.6)
6+
multi_xml (>= 0.5.2)
7+
multi_xml (0.6.0)
8+
rspec (3.7.0)
9+
rspec-core (~> 3.7.0)
10+
rspec-expectations (~> 3.7.0)
11+
rspec-mocks (~> 3.7.0)
12+
rspec-core (3.7.0)
13+
rspec-support (~> 3.7.0)
14+
rspec-expectations (3.7.0)
15+
diff-lcs (>= 1.2.0, < 2.0)
16+
rspec-support (~> 3.7.0)
17+
rspec-mocks (3.7.0)
18+
diff-lcs (>= 1.2.0, < 2.0)
19+
rspec-support (~> 3.7.0)
20+
rspec-support (3.7.0)
21+
22+
PLATFORMS
23+
ruby
24+
25+
DEPENDENCIES
26+
httparty
27+
rspec
28+
29+
BUNDLED WITH
30+
1.15.4

acceptance-tests/README.md

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# SSL-Gateway integration tests
2+
3+
This testsuite tests the integration of the SSL-Gateway into a CloudFoundry environment.
4+
5+
## Getting Started
6+
7+
### Prerequisites
8+
9+
- bosh CLI v2
10+
- Ruby
11+
- CloudFoundry installation
12+
- a9s ConsulDNS
13+
- a9s-pg
14+
15+
### Installing
16+
17+
To install the ruby dependencies:
18+
19+
```
20+
cd integration-tests
21+
22+
bundle install
23+
```
24+
25+
## Running the tests
26+
27+
Before the testsuite can be run, the appropriate ENV variables must be set
28+
29+
env variables:
30+
- LOCALHOST_IP *required* - ip of the localhost that runs the testsuite
31+
- IAAS_CONFIG *required*
32+
- EXTERNAL_SECRETS *required*
33+
- OPS_FILE *optional* - if an ops file is required to deploy the SSL-Gateway
34+
- CF_USERNAME *required* - you need to provide a user for cf
35+
- CF_PASSWORD *required*
36+
- CF_ORG *required* - you need to provide a org and space for cf
37+
- CF_SPACE *required*
38+
39+
the app requires some domains that are registered in you `/etc/hosts` to resolve to
40+
one of the ssl-gateway nodes.
41+
42+
These domain names need to be set to the following block of env vars.
43+
- REACHABLE_SSL_BLACKLIST_DOMAIN
44+
- UNREACHABLE_SSL_BLACKLIST_DOMAIN
45+
- REACHABLE_BLACKLIST_DOMAIN
46+
- UNREACHABLE_BLACKLIST_DOMAIN
47+
- DEFAULT_APP_DOMAIN
48+
- RANDOM_DOMAIN
49+
50+
E.g. :
51+
```
52+
cat <<EOF
53+
172.27.2.12 checker.ssltest.com
54+
172.27.2.12 checker.ssltest2.com
55+
172.27.2.12 checker.ssltest3.com
56+
172.27.2.12 checker.ssltest4.com
57+
172.27.2.12 checker.misterX.com
58+
172.27.2.12 de.a9sapp.eu
59+
EOF > /etc/hosts
60+
61+
export DEFAULT_APP_DOMAIN=de.a9sapp.eu
62+
export RANDOM_DOMAIN=checker.misterX.com
63+
export UNREACHABLE_BLACKLIST_DOMAIN=checker.ssltest3.com
64+
export REACHABLE_BLACKLIST_DOMAIN=checker.ssltest4.com
65+
export UNREACHABLE_SSL_BLACKLIST_DOMAIN=checker.ssltest2.com
66+
export REACHABLE_SSL_BLACKLIST_DOMAIN=checker.ssltest.com
67+
```
68+
69+
(It doesnt matter which domain is assigned to which env var)
70+
71+
Then you need to make the domains accessable to the CloudFoundry org you specified in
72+
CF_ORG.
73+
74+
```
75+
cf login
76+
77+
cf target -o $CF_ORG -s $CF_SPACE
78+
79+
cf create-domain $CF_ORG $DEFAULT_APP_DOMAIN
80+
cf create-domain $CF_ORG $RANDOM_DOMAIN
81+
cf create-domain $CF_ORG $UNREACHABLE_BLACKLIST_DOMAIN
82+
cf create-domain $CF_ORG $REACHABLE_BLACKLIST_DOMAIN
83+
cf create-domain $CF_ORG $UNREACHABLE_SSL_BLACKLIST_DOMAIN
84+
cf create-domain $CF_ORG $REACHABLE_SSL_BLACKLIST_DOMAIN
85+
```
86+
87+
To run the testsuite
88+
89+
```
90+
cd integration-tests
91+
92+
rspec
93+
```
94+
95+
## Built With
96+
97+
* [RSpec](http://rspec.info)
98+
99+
## Authors
100+
101+
* **Dennis Groß** - *Initial work* - [gdenn](https://github.com/gdenn)
102+
103+
## License
104+
105+
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
+157
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
---
2+
name: ssl-gateway
3+
4+
releases:
5+
- name: ssl-gateway
6+
version: 12+dev.6
7+
8+
- name: rabbitmq36
9+
version: 5
10+
url: https://s3-eu-west-1.amazonaws.com/anynines-bosh-releases/rabbitmq36-5.tgz
11+
- name: a9s-consul
12+
version: latest
13+
14+
stemcells:
15+
- os: ubuntu-trusty
16+
alias: ubuntu-trusty
17+
version: ((iaas.stemcells.ubuntu-trusty.version))
18+
19+
update:
20+
canaries: 1
21+
canary_watch_time: 1000-180000
22+
max_in_flight: 50
23+
serial: true
24+
update_watch_time: 1000-180000
25+
26+
instance_groups:
27+
28+
- name: rabbitmq
29+
azs: [z1, z2, z3]
30+
vm_type: small
31+
persistent_disk_type: small
32+
instances: 1
33+
stemcell: ubuntu-trusty
34+
networks:
35+
- name: dynamic
36+
jobs:
37+
- name: rabbitmq
38+
release: rabbitmq36
39+
- name: consul
40+
release: a9s-consul
41+
properties:
42+
consul:
43+
service_name: rabbitmq
44+
45+
- name: ssl-gateway
46+
azs: [z1, z2, z3]
47+
vm_type: small
48+
persistent_disk_type: small
49+
instances: ((iaas.ssl_gateway.gateway_instances))
50+
stemcell: ubuntu-trusty
51+
jobs:
52+
- name: consul
53+
release: a9s-consul
54+
- name: nginx
55+
release: ssl-gateway
56+
- name: virtual_host_service_worker
57+
release: ssl-gateway
58+
networks:
59+
- name: public
60+
61+
properties:
62+
network: public
63+
64+
- name: gateway-api
65+
templates:
66+
- name: consul
67+
release: a9s-consul
68+
- name: virtual_host_service_api
69+
release: ssl-gateway
70+
azs: [z1, z2, z3]
71+
vm_type: small
72+
persistent_disk_type: small
73+
instances: 1
74+
stemcell: ubuntu-trusty
75+
networks:
76+
- name: dynamic
77+
properties:
78+
consul:
79+
service_name: vhost-api
80+
81+
properties:
82+
network: dynamic
83+
84+
vhost_api:
85+
postgresql_host: a9s-pg-psql-master-alias.node.dc1.((iaas.consul.domain))
86+
postgresql_db: sslgateway
87+
postgresql_username: sslgateway
88+
postgresql_password: ((/a9s_pg_sslgateway_db_password))
89+
customer_panel_secret: ((ssl_gw_customerpanel_secret))
90+
port: 3000
91+
92+
rabbitmq:
93+
admin_username: admin
94+
admin_password: ((ssl_gw_rabbitmq_password))
95+
host: ssl-gateway-rabbitmq-0.node.dc1.((iaas.consul.domain))
96+
97+
a9s_ssl_gateway:
98+
default_apps_domain: ((iaas.cf.system_domain))
99+
cf_routers: ((iaas.cf.router_ips))
100+
default_apps_domain_cert: ((default_app.certificate))
101+
default_apps_domain_ca_cert: ((default_app.ca))
102+
default_apps_domain_cert_key: ((default_app.private_key))
103+
ssh_routers: ((iaas.cf.router_ips))
104+
105+
domain_blacklist:
106+
- domain: checker.ssltest.com
107+
ca: ((ssltest.ca))
108+
certificate: ((ssltest.certificate))
109+
private_key: ((ssltest.private_key))
110+
allow:
111+
- 172.27.1.5
112+
- domain: ssltest2.com
113+
ca: ((ssltest2.ca))
114+
certificate: ((ssltest2.certificate))
115+
private_key: ((ssltest2.private_key))
116+
- domain: ssltest3.com
117+
- domain: ssltest4.com
118+
allow:
119+
- 172.27.1.5
120+
121+
consul:
122+
domain: ((iaas.consul.domain))
123+
dc: dc1
124+
agent_address: 127.0.0.1:8500
125+
server: false
126+
encrypt: ((/cdns_encrypt))
127+
cluster:
128+
join_hosts: ((iaas.consul.consul_ips))
129+
ssl_ca: ((/cdns_ssl.ca))
130+
ssl_cert: ((/cdns_ssl.certificate))
131+
ssl_key: ((/cdns_ssl.private_key))
132+
133+
variables:
134+
- name: ssl_gw_customerpanel_secret
135+
type: password
136+
- name: ssl_gw_rabbitmq_password
137+
type: password
138+
- name: default_ca
139+
type: certificate
140+
options:
141+
is_ca: true
142+
common_name: ssl_gateway_default
143+
- name: default_app
144+
type: certificate
145+
options:
146+
ca: default_ca
147+
common_name: ((iaas.cf.system_domain))
148+
- name: ssltest
149+
type: certificate
150+
options:
151+
ca: default_ca
152+
common_name: ssltest
153+
- name: ssltest2
154+
type: certificate
155+
options:
156+
ca: default_ca
157+
common_name: ssltest2

0 commit comments

Comments
 (0)