The PDP policies used to be stored by the PDP in its own database and administered in its own GUI. This is deprecated and this guide describes how to migrate your rules management into Manage. The PDP remains as the server (with only an API) which decides on the policies at login time.
Because Manage did not exist yet at the time, the PDP was built with a separate admin GUI and database storage of its policies. Although necessary at the time, this is now inconvenient because Manage does not proviode any information that/which rules exist for an entity, there's two admin UIs to work in which leads to confusion, there's only loose referential checking possible (e.g. renaming an entityID drops any associated policies on the floor), and two UIs need to be maintained codewise.
Now that Manage is there, we can move storage of the policies into the Manage backend (MongoDB) and frontend, so we can make use of the existing facilities for managing the history, integrate the admin UI and enforce referential integrity.
The storage in Manage is done in JSON format. Upon PUSH in Manage this is sent to the PDP-server which translates it to XACML and stores it in its local database for runtime evaluation. The PUSH in Manage is when policy changes become active, no delays anymore.
A new policies table is added to PDP next to the existing one. Manage can import the existing policies, process and store them and push them to the new table.
The migration can be done in two stages:
- A new table exists besides the old one but is not used for policy evaluation. Manage can pull from the current table (as often as desired), and push back to the new table. Manage can then also show any differences between current and new, so certainty can be gained that the conversion is successful. Changing policies at this time still happens from PDP GUI.
- The Manage PUSH can be switched to push to update the current table, so anything stored in Manage will determine the content of the actual policy evaluation. The new table is no longer used and the PDP GUI also not.
To migrate your rules from PDP to Manage, you need:
- OpenConext-pdp >= 4.1.0 (>= 5.1 preferred), << 7.0.0
- OpenConext-manage >= 7.4.0 (>= 7.4.9 preferred), << 9.0.0
- OpenConext-dashboard (when using), >= 12.3.17
In PDP's application.properties, set pushTestMode=True:
policy.enforcement.point.user.name=pdp_admin
policy.enforcement.point.user.password=secret
[...]
manage.pushTestMode=True
Ensure that Manage's application.yml contains a PUSH section for PDP (look for the credentials in the PDP application.properties under policy.enforcement.point.user.* as listed above) and a Spring MySQL datasouce (for comparing the result, only needed during the migration).
push:
pdp:
url: http://localhost:8081/pdp/api/manage/push
policy_url: http://localhost:8081/pdp/api/manage/policies
decide_url: http://localhost:8081/pdp/api/manage/decide
user: pdp_admin
name: OpenConext PDP
password: secret
enabled: true
spring:
datasource:
url: jdbc:mysql://localhost:3306/pdpserver?permitMysqlScheme
username: root
password:
driverClassName: org.mariadb.jdbc.Driver
Now in Manage, you can ask Manage to import all policies from PDP under the Policies tab. This will report what it does and if you push it back, it also provides ways to compare.
You can view the imported policies under a related entity (e.g. an SP) in the Policies tab for that entity. You can also get an overview of all policies in the Policies tab which is located at the second level (where you can find "Service Providers" etc).
You can repeat the fetch and push as often as you like as long as manage.pushTestMode=False.
Ready to take Manage into production as the storage for policies? Do the following:
- Disable any access to the PDP GUI from now on so no more changes are made there. Shut down Dashboard (when using) so no changes are made.
- In Manage: do the final "Policies -> Import Policies from PDP"
- Change PDP feature flag
manage.pushTestModetoFalseand restart - In Manage, press Push
- In Dashboard (when using), switch
dashboard.feature.pdpSourcefrom PDP to Manage. Restart & re-enable Dashboard
When the migration is fully done, you can at your convenience upgrade PDP to 7.0.0 or higher (will drop the unused admin GUI), and/or Manage to 9.0.0 or higher (drops the migration code).
You can remove the spring.datasource for pdp from Manage's config.