How can we secure the communication between Orion and Cygnus?
How can we use cygnus with a protected Orion (pep is deployed above Orion broker)?
Thanks and best regards.
There are several ways of securing Orion->Cygnus communications:
Co-locate Orion and Cygnus in the same host, so all comunication are through localhost network interface (this solution assumes that the host itslef is properly secured, of course).
Using a firewall (e.g. iptables) so Cygnus port can be reached only from the IP where Orion runs.
Using HTTPS notifications. In order to use this option take into account that:
Cygnus should be able to receive notifications in HTTPS. I'm not fully sure about Cygnus capabilities with this regards, but my colleague #frb could provide more detail.
You need Rush to send notifications in HTTPS with Orion.
You can also explore the posibility of using a PEP proxy for Cygnus. You only need to secure one operation at Cygnus: POST /v1/notifyContext. Have a look to the PEP official documentation.
UPDATE: since verion 1.7.0, Orion implements native HTTPS notifications (i.e. without needing Rush).
Related
I have in my server a Orion Context Broker (https://github.com/telefonicaid/fiware-orion) but i need to add some restrictions to my "consumers" when they use the endpoint(s) e.g(http://myhost:1026/v2/entities). Is possible configure the local/personal Broker with token like https://fiware-orion.readthedocs.io/en/1.11.0/quick_start_guide/index.html#orion-context-broker-quick-start-guide ?
Thank you very much.
The Orion Context Broker does not offer roles and permissions directly.
To add roles and permissions to restrict an endpoint, you will need to use a PEP Proxy - which security mechanism you use to do this is up to you.
There are several OAuth2-based security components found within the FIWARE Catalogue, alternatively you could another open source PEP Proxy such as steelskin which integrates nicely with either Keyrock or Keystone
I'm trying to use Wirecloud the latest version available for a simple mashup project. I'm using the ngsi-source operator to retrieve data from Orion, but this is not possible because I often encounter an NGSI Proxy Connection Error (504 Gateway Timeout).
I tried with different installations of the NGSI Proxy in different servers and I have noticed that I have a 200 status in the inner REST calls made by the ngsi-source operator, only when the NGSI Proxy is reachable from the Wirecloud server installation (django server).
When the proxy is reachable only from my browser (local machine), I encounter the 504 status.
The NGSI Proxy has to be reachable from the Wirecloud installation?
Thanks in advance for the answers.
Currently, the NGSI proxy has to be reachable from the WireCloud instance. The url you were seeing (http://<wirecloud domain>/cdp/http/<ngsi-proxy domain>/eventsource) is caused by the use of the Cross Domain Proxy. We developed the NGSI proxy service to allow cross domain requests from browsers and the event source endpoint cannot be used without a direct connection from the client side, so I've opened a ticket in the github repo to solve this bug.
I have been trying to set up an Orion instance which would support subscription notifications to HTTPS (using Rush), but the handling of this seems to be a bit incorrect. Setting the notification url to e.g. https://www.example.com/path/ ends up at Rush as www.example.com:443/path/.
This is unsafe and not up to standards, as such a request could actually avoid https by using the same port over http. In our company we have a proxy set up which refuses such requests as "Bad Request: You're speaking plain HTTP to an SSL-enabled server port". The same error comes up in the Rush consumer output, while direct curl requests to Rush without the port work ok. See this discussion for another argument that the current requests are incorrect: https://security.stackexchange.com/questions/46015/speaking-plain-http-over-an-ssl-enabled-server-port. Google refuses such requests as well.
Our proxy is set up to redirect any http requests to https, but these do not work either, as Rush does not seem to follow the redirects.
How can we avoid this issue? Modifying our proxy would be unsafe and not following standards, changing Orion would require recompiling from sources and changing Rush to remove the port would be a bit hacky. Any changes (like adding the port or removing/changing the protocol) to the notification URL do not help.
EDIT: The command to run Orion was:
/usr/bin/contextBroker -port 1026 -logDir /var/log/contextBroker -pidpath /var/log/contextBroker/contextBroker.pid -dbhost localhost -db orion -rush localhost:5001
Rush (v 1.8.3) was installed with default values and Orion was updated from v0.14.1 to v0.23.0.
Since verion 1.7.0, Orion implements native HTTPS notifications (i.e. without needing Rush). This could help to solve the situation described in this question.
I'm trying to deploy a Fiware-based system composed by Orion CB and some webapps, and I want to include security in this deployment by using the differents security GE availables.
OrionCB runs on Centos and (i.e)authorization-pdp-authzforce runs on Ubuntu TLS. Does this means that I need to use (i.e)two VPS?
AuthZForce is not supposed to be run on the same machine as Orion Context Broker. This doesn't mean that you can't, only that you are not forced to do it.
What would make more sense to run on the same machine (but still it is not a requirement) is to run a policy enforcement proxy. At the moment there are a couple that work with FIWARE:
FIWARE Wilma PEP Proxy.
FIWARE Orion PEP.
Both of them are developd using NodeJS, so they should run on a CentOS just fine. Keep in mind that even if you use AuthZForce you still need the a PEP proxy.
I've spent most of the day trying to configure the Fiware PEP proxy Wilma to secure an Orion Context Broker i have running on a development server. The documentation here: http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/PEP_Proxy_-Wilma-_Installation_and_Administration_Guide is not clear.
Here is my setup:
A Fiware Keyrock instance running on server1, port 3000
A PEP Proxy running on server 1
An Orion Context Broker running on server2, port 1026
The manual states to edit the config.js script. Here is what i changed (Stackoverflow prevents me from entering url's so replace http.. with http:)
config.account_host = 'http..//localhost:3000';
config.keystone_host = 'http..//server1';
config.keystone_port = 3000;
config.app_host = 'server2';
config.app_port = '1026';
config.username = '***** username of the user in Keyrock *****';
config.password = '***** password of the user in Keyrock *****';
Here is the error
~/fi-ware-pep-proxy$ node server.js
express deprecated app.configure:
Check app.get('env') in an if statement server.js:30:5 Starting PEP proxy. Keystone authentication ... Error in keystone communication
Error: getaddrinfo ENOTFOUND
at errnoException (dns.js:37:11)
at Object.onanswer [as oncomplete] (dns.js:124:16)
My Orion and Keyrock instances are up and running. I can query them with curl or a browser.
I really have no idea what i should be filling in the config.js to get this set up.
I hope this helps. We are working on deploying some of the Generic Enablers, included IdM, Wilma PEP and Orion among others using docker and docker-compose.
This environment, called Fiware-devguide-APP is actually under construction, but you can test's the environment (already working) and also check our configuration here.
We are updating all the documentation!
For this, we have the images here.
Docker and docker-compose are required.
If you already have them, to start all the apps integrated in Devguide, you just have to clone the repository:
git clone https://github.com/Bitergia/fiware-devguide-app.git
And then run docker-compose using the .yml file in the fiware-devguide-app/docker/compose:
docker-compose -f docker-compose.yml up -d
So you will have up all the containers! Finally, add the ip of the devguide container (compose_devguide_1) to your /etc/hosts and you will be able to browse it :)
Explanation:
We've went through several configurations for this. I assume you are interested in IdM and Wilma PEP, so here it goes what we did:
We've installed a IdM GE from the scratch providing the users, roles, and permissions desired. Here you can find what we added at test_data method:
We've added test users
Couple organizations
Our app
Roles for the application
And permissions for the actions
Note that all those provision could have been done also using Keystone REST API
Also here you can find the Dockerfile i.e. how it has been installed.
We've installed an Authzforce for the role management as explained in the tour guide. You will need it as wilma-pep will send the PDP requests to validate requests against the resource protected.
Finally the PEP Wilma. Here you can find the configuration files.
How does it work?
Here goes the trick. Let's assume the env Authzforce (Access Control), IdM, PEP Wilma, Orion (the app to be protected) and the devguide. As we use docker-compose, all this steps are done almost at the same time! :)
In authzforce, we need to create a domain as stands in the documentation, and we do it here.
The script itself retrieves the domain ID and, it parses the config.js file of the PEP Wilma in this line using the right path.
The config.js is simple:
account_host and keystone_host are in the same container 'idm'. Docker-compose handle this by adding aliases to the /etc/hosts of each container, which makes the process much easier and we don't need to handle the IP's ourselves.
app_host and app_port are the IP and port of the app to protect, in our case is 'orion'!
config.username and config.password. We've created a user 'pepproxy' in the provision we explained before, exactly here. (Note that this user must have domain roles assigned in order to work, as done here).
And the azf configuration, which contains also the 'authzforce' host and where the path is parsed as explained before.
Adding the authzforce configuration to IdM and PEP (i.e. domain)
Get an Oauth2 token as it explains here.
Finally, with this token and everything running, you can open the compose_devguide_1. It has different resources that can be reached depending on the roles you have assigned at IdM. For example, 'user0#test.com' can access to all the resources, meanwhile the other one can access just to the restaurants.
Hope I was clear enough.
Best!
right now requests from PEPs are not directly sent to the IdM. They uses an Openstack compliant server (Keystone Proxy). So if you want to use it you have to install also this component. Any way in two weeks we are going to change this behaviour.
Hope this helps
We are installing a Fiware enviroment in a local machine; we pretend to have an orion context broker with a Keyrock idm instance. We understand that we need to use a Pep Proxy in order to check the tokens of the requests to the orion context broker. We use Keyrock idm, so we are wondering whether we can do this or not. Is there any way to use them now without installing anything else or we are supposed to install de keystone proxy too?
This is the keystone proxy that we have found:
https://github.com/ging/fi-ware-keystone-proxy
If this is the case; How do we have to configure the pep proxy? Where do we have to put the data to connect to the Keyrock idm and where are we supposed to indicate the keystone information?
new versions are ready. Now you only need Keyrock and PEP Proxy. As explained here validations go directly to IdM. Hope this helps.