Skip to content

Commit 2951e67

Browse files
authored
Update MITREid Connect Preparative Procedures.md
Add NGINX config settings
1 parent 941dd54 commit 2951e67

File tree

1 file changed

+76
-2
lines changed

1 file changed

+76
-2
lines changed

cc-artifacts/MITREid Connect Preparative Procedures.md

Lines changed: 76 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ NOTE: Refer to https://maven.apache.org/download.cgi for the latest version of M
1818
2. Extract the distribution using ```tar xzvf apache-ant-1.9.16-bin.tar.gz```
1919
3. Add the ```bin``` directory of the created directory ```apache-ant-1.9.16``` to the ```PATH``` environment variable by adding ```export PATH="<PATH_TO_EXTRACT>/ant-1.9.16/bin:<PATH_TO_EXTRACT>/apache-maven-3.8.7/bin:$PATH``` to ```~/bash.rc``` and executing ```source ~/.bashrc```
2020
4. Create environmental variable ANT_HOME to <PATH_TO_EXTRACT>/apache-ant-1.9.16/ by adding ```export ANT_HOME=<PATH_TO_EXTRACT>/apache-ant-1.9.16/``` to .bashrc
21+
2122
## Install Apache Tomcat
23+
2224
1. Create a user group for Tomcat
2325
```
2426
# groupadd tomcat
@@ -32,8 +34,80 @@ NOTE: Refer to https://maven.apache.org/download.cgi for the latest version of M
3234
# ant
3335
```
3436
5. Follow instructions in RUNNING.txt
35-
## Install nginx reverse proxy
36-
1. install nginx with ```sudo apt-get install nginx```
37+
38+
## Install nginx reverse proxy and certificates
39+
Gor testing purposes, self-signed certificates can be used, but it is suggested that Let's Encrypt is used for externally accessivle instances.
40+
41+
1. Install nginx with ```sudo apt-get install nginx```
42+
2. Create an intial configuration file the definition for the tomcat server in nginx (note: in this instance, mitre-connect.corp.viden.com is used as an example. Subsitute with your domain)
43+
44+
**/etc/nginx/available-sites/mitre-connect.corp.viden.com.conf**
45+
```
46+
server {
47+
server_name mitre-connect.corp.viden.com www.mitre-connect.corp.viden.com;
48+
}
49+
```
50+
3. Restart nginx using ```sudo systemctl reload nginx```
51+
4. Enable the ufw firewall and configure ton allow Nginx Full
52+
```
53+
sudo ufw allow 'Nginx Full'
54+
sudo ufw delete allow 'Nginx HTTP'
55+
```
56+
6. Create a certificate with OpenSSL ```sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt```
57+
7. Create a Diffie-Hellman group for Perfect Forward Secrecy ```sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048```
58+
8. Create a snippet for the certificates
59+
**/etc/nginx/snippets/self-signed.conf**
60+
```
61+
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
62+
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
63+
```
64+
9. Create a snippet to enable encryption settings
65+
**/etc/nginx/snippets/ssl-params.conf**
66+
```
67+
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
68+
ssl_prefer_server_ciphers on;
69+
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
70+
ssl_ecdh_curve secp384r1;
71+
ssl_session_cache shared:SSL:10m;
72+
ssl_session_tickets off;
73+
ssl_stapling on;
74+
ssl_stapling_verify on;
75+
resolver 8.8.8.8 8.8.4.4 valid=300s;
76+
resolver_timeout 5s;
77+
# Disable preloading HSTS for now. You can use the commented out header line that includes
78+
# the "preload" directive if you understand the implications.
79+
#add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
80+
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";
81+
add_header X-Frame-Options DENY;
82+
add_header X-Content-Type-Options nosniff;
83+
84+
ssl_dhparam /etc/ssl/certs/dhparam.pem;
85+
```
86+
10. Configure default file
87+
**/etc/nginx/available-sites/default**
88+
```
89+
server {
90+
listen 8080 default_server;
91+
listen [::]:8080 default_server;
92+
server_name 10.0.40.101;
93+
return 302 https://$server_name$request_uri;
94+
}
95+
96+
server {
97+
98+
# SSL configuration
99+
100+
listen 443 ssl http2 default_server;
101+
listen [::]:443 ssl http2 default_server;
102+
include snippets/self-signed.conf;
103+
include snippets/ssl-params.conf;
104+
}
105+
```
106+
TODO: Copy in ubuntu from my local to /etc/nginx/sites-available
107+
11:wq
108+
12. Enable the ufw firewall and configure to allow Nginx Full
109+
13. Restart nginx using ```sudo systemctl reload nginx```
110+
37111
## Install MITREid Connect
38112

39113
# Example Setup Script

0 commit comments

Comments
 (0)