Closed superken4169 closed 4 years ago
If you pulled down the latest release zip file, there is a .env file where you run the docker-compose start.sh file. It is this file here: https://raw.githubusercontent.com/Cingulara/openrmf-docs/master/scripts/.env
Make sure that is pointing to your correct name/ip for Keycloak. That ENV is used in the APIs to authenticate correctly the JWT. Check that first and let me know.
You will want to run ./stop.sh, then edit that .env file with VI or NANO, then ./start.sh and log back in. Kill your browser cache. And you can log into the :9001 keycloak, go to the openrmf realm, then find your user and remove any active sessions as well just to make sure it forces you to log in again.
also, I believe for docker-compose the web interface is going to use 8080 by default. In Kubernetes, I do a config mapping to make the api.js point to a specific URL and port. If you want to change 8080, you may need to do a similar volume mount on the api.js and change the file.
The file inside the openrmf web container is at /usr/share/nginx/html/js/apis.js. If you understand docker-compose you can do a mount to change that file and have the file locally. The raw file is at https://raw.githubusercontent.com/Cingulara/openrmf-web/develop/js/apis.js. Not sure that is a problem but could be.
The 8180 should be the same in the keycloak setup for the client as well as what you are accessing in the docker-compose top of the file for the port you open externally for the web container.
FYI, I actually run Keycloak locally using Docker. I have that info in here: https://github.com/Cingulara/openrmf-docs/tree/master/scripts/keycloak
If that helps at all.
What ever machine you are running this on should have a static IP. If not put a reservation in for DHCP. The IP address is what should go in your env file.
I am a Linux, Docker novice. I am somewhat familiar with Linux but this is the very first time using Docker.
The server has a static IP address.
My .env file says
JWT-AUTHORITY=http://
After creating my Ubuntu VM then giving it a new address and updating the hostname I followed the instructions below
sudo apt -y update
sudo apt -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common unzip default-jdk mongodb-server
** Docker sudo apt remove docker docker-engine docker.io containerd runc
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu disco stable"
sudo apt update
sudo apt install -y docker-ce
sudo apt-get install -y docker-compose
** Keycloak cd /opt
sudo wget https://downloads.jboss.org/keycloak/8.0.1/keycloak-8.0.1.tar.gz
sudo tar -xvzf keycloak-8.0.1.tar.gz
sudo mv keycloak-8.0.1 /opt/keycloak
sudo groupadd keycloak
sudo useradd -r -g keycloak -d /opt/keycloak -s /sbin/nologin keycloak
sudo chown -R keycloak: keycloak
sudo chmod o+x /opt/keycloak/bin/
cd /etc/
sudo mkdir keycloak
sudo cp /opt/keycloak/docs/contrib/scripts/systemd/wildfly.conf /etc/keycloak/keycloak.conf
sudo cp /opt/keycloak/docs/contrib/scripts/systemd/launch.sh /opt/keycloak/bin/
sudo chown keycloak: /opt/keycloak/bin/launch.sh
sudo nano /opt/keycloak/bin/launch.sh
i don't know if this will help or not, but thought I should include it. This is the exact link that I it's redirecting. "http://<my keycloak/openrmf IP>:9001/auth/realms/openrmf/protocol/openid-connect/auth?client_id=openrmf&redirect_uri=http%3A%2F%2F<keycloak/openrmf IP>%3A8080%2F&state=d50957aa-ad7f-4b61-8298-765fbe056b3b&response_mode=fragment&response_type=code&scope=openid&nonce=abb6698c-b016-4b20-8dc2-71e0e4a0a787"
Since your Keycloak came up correctly, I believe you have this setup right. We can work through this and then I can update the documentation to make sure I have it right.
Have you added a new user / registered a user in Keycloak to use with OpenRMF? You can do that 1 of two ways. If you setup the keycloak information like https://github.com/Cingulara/openrmf-docs/blob/master/keycloak.md talks on, then you should be able to register a new user. And it would automatically have the Reader role if you have auto assign roles setup.
The other way would be to go into the Keycloak UI, go to the openrmf realm, and then go to the Users area in Keycloak. Add a new user, set the email and login information, set the password, and then under the roles add the Administrator role. That would give you all permissions.
Yes, I have created 2 users, both users contain all of the roles available.
So you go to OpenRMF, you get redirected to Keycloak, you log in, and what happens? Are you allowed to do a screenshot?
Does it redirect back to OpenRMF but not show data?
And can you view the Javascript Console Log to see if it is giving you any errors? If in Chrome, you can right-click the screen and choose "Inspect". I think IE/Edge it is F11 or F12.
If I go to port 8080, the OpenRMF dashboard displays briefly before going to that URL that I uploaded earlier and displays The site cannot be reached on the screen. At no point to I receive a screen to login to OpenRMF
If I go to the same IP address port 8180, I can change Keycloak settings, change anything want.
When go to inspect on Chrome under network There are some errors
Request URL: http://<IP of keycloak/openrmf>:9001/auth/realms/openrmf/protocol/openid-connect/auth?client_id=openrmf&redirect_uri=http%3A%2F%2F<IP of keycloak/openrmf>%3A8080%2F&state=e8525a45-9e65-4cf9-8460-7cb48dbd6b16&response_mode=fragment&response_type=code&scope=openid&nonce=1d78d55c-92ed-403c-8d9d-e9738d6a9f89 Referrer Policy: no-referrer-when-downgrade Provisional headers are shown DNT: 1 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Mobile Safari/537.36 client_id: openrmf redirect_uri: http://1<IP of keycloak/openrmf>:8080/ state: e8525a45-9e65-4cf9-8460-7cb48dbd6b16 response_mode: fragment response_type: code scope: openid nonce: 1d78d55c-92ed-403c-8d9d-e9738d6a9f89
The line below should have your local IP or name or whatever you have locally to access it. If this is the right thing below you put earlier. I have my 192.168 type IP in there for local stuff redirecting to keycloak. The web UI is setup this file https://github.com/Cingulara/openrmf-web/blob/master/js/auth.js w/in the container to go to port 9001 on whatever you access the web UI through. And it should get you a login page just like the login page on the https://demo.openrmf.io/ once we get all this worked out.
JWT-AUTHORITY=http://:9001/auth/realms/openrmf
You definitely need to get to a login page though. The redirection on that auth.js goes from the OpenRMF page right to a login page in Keycloak. This JWT-AUTHORITY above is for the APIs to validate your calls. The Web UI logs you in to Keycloak and then redirects you back to the calling page in OpenRMF you were looking to access.
Without being able to see your screen, I would dbl check the 2 lines in the .env file, and then double check your Keycloak screens against the screenshots at the bottom of the https://github.com/Cingulara/openrmf-docs/blob/master/keycloak.md. I have had a couple people recently pull this down and have it work so we just need to see what small tweak is needed here. You have a lot of the main pieces already working.
copied and pasted directly from the .env file. I will verify the Keycloak screens right now. thank you.
JWT-AUTHORITY=http://
JWT-AUTHORITY=http://:9001/auth/realms/openrmf
That is not right. It should be something like the below with an IP or name. And that should match the name you are doing to OpenRMF with.
JWT-AUTHORITY=http://192.168.1.23:9001/auth/realms/openrmf
And if all on one box, the IP should match the return URL on the Valid Redirect URIs in Keycloak. The valid redirect URIs ends in /* to allow any path to use Keycloak. So /systems.html, /charts.html, /checklists.html, etc.
But those are for the APIs to communicate with the web UI. The Web UI should redirect to keycloak when setup and give you a login page to use.
i.e. the steps when this is all working are like so:
the IP does show up, I redacted it before I sent the comment.
JWT-AUTHORITY=http://xxx.xx.xx.xxx:9001/auth/realms/openrmf
JWT-CLIENT=openrmf
All of my Keycloak screens looks like the screenshots in the documentation.
Do the instructions I used to install everything look right? I'm going to try wiping this VM out and creating a new one. This is the best alternative to using that abysmal STIG Viewer.
Yes I hate that stupid viewer. It literally makes my eyes roll in the back of my head twice before I can ever even used.
You could also look at the kecloak information I have under the scripts directory in the docs repo. I run mine under docker, and just expose port 9001 so I can connect to it. I’ve had a few people do it that way and it seems to work. And I keep a named volume for the database so that the data will persist even after shutting it down and starting a back up.
You could try using that separately just to get that working. And then fire up the tool separate start shell script.
On Thu, Jan 2, 2020 at 11:36 AM superken4169 notifications@github.com wrote:
the IP does show up, I redacted it before I sent the comment. JWT-AUTHORITY=http://xxx.xx.xx.xxx:9001/auth/realms/openrmf JWT-CLIENT=openrmf
All of my Keycloak screens looks like the screenshots in the documentation.
Do the instructions I used to install everything look right? I'm going to try wiping this VM out and creating a new one. This is the best alternative to using that abysmal STIG Viewer.
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Cingulara/openrmf-docs/issues/69?email_source=notifications&email_token=AK776OJ3V3FLYWXEOD2C4XTQ3YJYXA5CNFSM4KBYAOL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH6YJDI#issuecomment-570262669, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK776OIZ2VM5WQRI5J7BIOLQ3YJYXANCNFSM4KBYAOLQ .
-- Dale Bingham CTO and Chief Technology Evangelist Cingulara https://www.cingulara.com 410-984-0001
I will run it from the Docker then. What do I need to do to get that script on to my server?
Copy these three files into their own directory.
run chmod +x *.sh
in that directory to make those shell scripts executable.
run ./start.sh
It will load up on port 9001
Thank you. I will let you know the outcome.
Also, make sure Keycloak is running on 9001 as all this script setup assumes it is. that may be the culprit after talking to @degthat8412
The auth.js assumes 9001 in the redirection to log into keycloak w/in the JS. That is one hard port that is in there. I have to redo some things to allow that to change. So for now, it is 9001.
FYI @superken4169 I have a slack channel just for this tool. If you want to shoot me an email dale.bingham@cingulara.com w/ your good email address to use I can send you an invite. There are a few smart people in there that can help you as well.
Ok, we are cooking with fire now. It worked much better that way and significantly shortened my installation guide for this project. It's updating Checklists right now. It's been running for a little while now, about 5 minutes. How long is it supposed to take?
hmmmm when you upload checklists it should only take seconds actually.
Did you upload CKL files? or XCCDF DISA SCAP scan files? You may want to again do the developer tools in Chrome and see if the JS is telling you an error message. OR if there is something else not working right.
If you upload Nessus SCAP scan files, they do not parse YET and I am working on that now.
Nope, I just logged in. Then it came up saying that it was updating checklists and has been that way ever since.
Here are the errors in the order that they appear. I think they are errors because the text is red.
General:
Request URL: https://cdn.datatables.net/1.10.16/css/dataTables.bootstrap4.min.css
Referrer Policy: no-referrer-when-downgrade
Request Headers
Provisional headers are shown
DNT: 1
Referer: http://
General:
Request URL: https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js
Referrer Policy: no-referrer-when-downgrade
Request Headers
Provisional headers are shown
DNT: 1
Referer: http://
General:
Request URL: https://cdn.datatables.net/1.10.16/js/dataTables.bootstrap4.min.js
Referrer Policy: no-referrer-when-downgrade
Request Headers:
Provisional headers are shown
DNT: 1
Referer: http://
General:
Request URL: http://
The IP was redacted on the last comment
are you at ALL hooked to the Internet? I believe there are 1 or 2 referenced JS or CSS files that are pointing to their HTTPS:// online locations from the looks of it.
If not then I will have to find them, put them locally, and update the docker containers. I do not think you are but I need to fix those to be local anyway..
You also can get the latest by doing a stop.sh
for only OpenRMF, copy the contents from here https://raw.githubusercontent.com/Cingulara/openrmf-docs/develop/scripts/docker-compose.yml into your current docker-compose.yml (or just save overtop the old one) and then run start.sh
to run the latest code fixes and updates.
You may want to kill your browser cache/images/cookies and then reload to see the latest setup and fixes for this tool. I apologize for all the back-and-forth. I have been making a lot of updates lately and want to make sure you have the latest and most stable version.
Another option: try going right to http://{ip address}:8080/upload.html and seeing if you can just upload 1 checklist and add it to a new system. You probably have to click the 'add system' link on the Upload page. Then follow the information from https://cingulara.github.io/openrmf-docs/uploading.html to upload a single CKL file or DISA SCAP XCCDF file and see what you get.
I am curious if having 0 data in there is making it fault somehow. It does not with mine locally but I have 0.10.7 running.
I've rebooted and it still does the same thing with Chrome. I tried IE and it does not look right at all. Finally, I tried Firefox and it comes up correctly. I've uploaded 20 checklist and everything looks good. I just need to find out why I cannot open it in Chrome at this time. Can you recommend an Open-source SCAP/STIG scanner that can scan Windows clients and servers? Thank you so much for all your assistance. I currently use OpenVAS (Alienvault version) for vulnerability scanning. It does not specifically look for SCAP compliance, but do you think I can use the vulnerability reports from that??
DISA has a SCAP scanner but you may need a license for it? @degthat8412 may know better.
https://www.open-scap.org/tools/scap-workbench/ works however I am not 100% sure the out from it. https://www.open-scap.org/tools/scap-workbench/#download has information on downloading it.
I would be curious how their "export" looks in open scap.
as for the Chrome on Ubuntu 19 server running this tool, I am not sure why it would fail if Firefox worked fine. Unless you had to kill cache/etc. and restart chrome to see. If FF worked Chrome should. I use Chrome all day long and it should be fine.
IE is horrible and needs to die off. Vulnerability hell. It and Flash. MS Edge though I need to test drive and see what has to be tweaked.
I did not answer your OpenVAS question. I have never heard of that and will have to check that one out. If it does the same XCCDF format export as the DISA SCAP tool then it may work. Otherwise we would need to write a connector for that.
The server is Ubuntu. The client I am using to access is Windows. I'm sure it's a setting. When figure out what the setting causing my problem is, I will let you know. I don't use IE if I can possibly help it. For me, IE stands for Is Extinct. Just to verify, in order to create systems, I need to upload a Nessus Scan file or a file with the same XCCDF format as the DISA SCAP tool. I don't actually have the DISA SCAP tool. That's why I am looking for a different scanner. I really appreciate all of your help. Thank you so much.
DISA has a SCAP scanner does not require a license but you do need a CaC card. MS Edge is supposed to be using Chromium so that might make it a possible browser. :) I have heard of OpenVAS but have not had time to play with it. This also says it can perform SCAP scans. https://sourceforge.net/projects/retinacommunity/
@superken4169 Yes, to make a new system you can just upload a new CKL file or XCCDF DISA SCAP scan file. Or in the newest version 0.10.7 of OpenRMF, you can go to Systems and click the "Add" button. Fill in fields and save. Then upload a CKL file or XCCDF file as spoken on earlier after you save a new System. And if you want, email me as I said above and I can add you do our Slack channel for this tool.
I'm going to see about downloading version 0.10.7 and installing it. I don't have a CaC, I retired before they started issuing CAC cards.
Ok, well if you are going to use 0.10.7, run ./stop.sh
in the directory where you are using OpenRMF, then overwrite the docker-compose file with the 0.10.7 version, then ./start.sh
to pull the latest updates and run. https://raw.githubusercontent.com/Cingulara/openrmf-docs/develop/scripts/docker-compose.yml is the file to use.
Also, clear cache and then reload the web browser to it.
I've installed a standalone instance of OpenRMF on an Ubuntu 19 server VM. Followed the instructions on Installing Docker, KeyCloak, MongoDB, OpenRMF and OpenRMF realm within Keycloak. When I try to get to the web interface (http://openrmf_IP:8080), the interface comes up then immediately redirects to http://openrmf_IP::9001/auth/realms/openrmf/protocol/openid-connect/auth?client_id=openrmf&redirect_uri=http. OpenRMF and Keycloak are on the same VM. The share the IP but none of the same ports. I set the bind offset in Keycloak to 100 so that the Keycloak port is 8180 instead of 8080. I have no idea what I'm doing wrong. Please help
Installation Instruction sources: https://nspeaks.com/install-docker-on-ubuntu-19-10/ https://computingforgeeks.com/how-to-install-latest-docker-compose-on-linux/ installed version 8 instead of version 6
https://medium.com/@hasnat.saeed/setup-keycloak-server-on-ubuntu-18-04-ed8c7c79a2d9
https://github.com/Cingulara/openrmf-docs
https://github.com/Cingulara/openrmf-docs/blob/master/keycloak.md