Create the Entitlements Policy ENTERPRISE
To connect your Entitlements to <das-id>.styra.com
, you must create a new Entitlements System.
Add a System
To add a system:
In the Styra DAS UI, navigate to
Your Workspace
>> SYSTEMS and click the ( ⨁ ) plus icon above the systems list in your DAS instance.Figure 1 - Create a New System
Select a System type from the list of available types. In this case, select Entitlements.
Type a user-friendly System name (required) that helps you identify the target for a set of policies. For example, if the System type is Entitlements, then you should provide a name that helps you recognize which Entitlements system you are managing.
Type an optional Description to provide additional details.
If you want to configure the systems through the Quick Start, then enable the Launch Quick Start (switch on) and return to this tutorial once you have completed the Quick Start.
Click Add system.
Figure 2 - Add Entitlements System
Install the Styra DAS Docker Containers
After creating a new Entitlements system, the DAS UI displays the Install page. You can also find the installation instructions under Your System
>> Settings >> Install page. This page gives you the instructions to download the requirements and start enforcing policies in your laptop (or your CI/CD pipeline).
To install the Styra DAS Docker Containers:
On the Install page, select Entitlements Playground.
Run the installation commands one after the other in your terminal to install the Styra DAS Docker containers.
Figure 3 - Install the Styra DAS Docker containers
When you run the installation commands, verify the expected output on your terminal as shown in Figure 4.
Figure 4 - Expected Output
tipKeep the terminal window open and return to your web browser. For the rest of the tutorial, use your web browser more often than your terminal window.
Add Rules
You can add rules using the Entitlements Playground or through the Styra DAS UI.
Use the Entitlements Playground
To add a rule using the Entitlements Playground:
Navigate to Your System
>> Policy >> rules.rego to see a blank screen as shown in Figure 5. If you have already added some rules here (during the Quick Start), then you must delete those rules.

In your web browser, open a new tab and enter the local host URL to see the Entitlements playground, as shown in Figure 6.

This web application is running inside the Docker container that you launched earlier, and allows you to experiment with policies as you create them.
Now, enter a simple request using the format displayed in Figure 7.
Action: Enter GET.
Resource: Enter /cars.
Click the Submit button.

Figure 7 shows Allowed: false
which is not the desired behavior. The expected result is to have all cars listed and accessible to every user.
Use the GUI
To add a rule using the Styra DAS UI:
Now, return to the Styra DAS UI and use the following instructions to create a policy that will allow all requests.
Click on the Add rule button.
Figure 8 - Add Rules
Search and click on the Generic Allow/Deny Rule.
Click on the Enforce button at the top of the rule card to enable it.
Click on the Publish button to publish your changes.
Figure 9 - Search and Publish a Rule
View Results in Entitlements Playground
After you publish a rule, do the following to view your results in the Entitlement Playground.
Navigate to your Entitlements Playground tab and wait for it to receive the bundle update. The Last Bundle Update section displays when the last bundle update was received. The bundle update is displayed within 60-90 seconds of clicking the Publish button.
Click on the Submit button again to see your results as shown in Figure 10.
Figure 10 - View Results
Now, you can see the following results on your Entitlements Playground:
The request is displayed as allowed (
Allowed:true
) rather than denied.The
enforced
field in the result now contains an object with allowed set to true and the messageRequest was matched
object was generated by the Generic Allow/Deny Rule.
Add a Rule for a Specific Request
The above rule allows any request. You can add a rule for a specific request using the following instructions.
To add a rule that accesses only /cars
:
Navigate to the Styra DAS UI.
Select the filter icon located in the top-right of the card as shown in Figure 11.
Figure 11 - Select the Filter
Switch ON the Actions and Resources toggles.
Figure 12 - Enable the Actions and Resources
Fill in the following fields:
- actions: Enter
GET
. - resources: Enter
/cars
.
Figure 13 - Set the Filters
- actions: Enter
Click on the Publish button to publish your changes.
Return to the Entitlements playground and click the Submit button again. The request should still be allowed.
Now, change the entries in the following fields and click Submit again. This request should be denied.
- actions: Enter
POST
. - resources: Enter
/cars
.
- actions: Enter