Git for JSON Object Import Data Source
Another option for making JSON data available to policies is to store that data in a Git repository and use a Git data source that automatically reads the JSON out of the Git repository.
Configure through the DAS GUI
The following section guides you through configuring
<das-id>.styra.com to access a data source stored in Git repository using the DAS GUI.
Create a DAS System
<das-id>.styra.com. To add a new system, click the ( ⨁ ) plus icon next to SYSTEMS on the left side of the navigation panel.
Fill in the following fields:
System type (required): Select any system type from the drop down list. For example, Custom.
System name (required): A user-friendly name so that you can distinguish between the different systems.
Description (optional): More details about this system.
Leave the Show errors switch ON to display the errors.
Click Add system button.
Now, your DAS system is created under the SYSTEMS on the left side of the navigation panel.
Add a Data Source
After you create your system, click the three dots (
⋮) next to it and select Add Data Source to start configuring the data source.
Now, your Custom System >> Add Data Source dialog appears.
Complete the following steps in your Custom System >> Add Data Source dialog box.
Type: An editable data source that you fill in with JSON data and publish. Click the down arrow to select the data source type. For example, select Git for JSON Object Import to pull a JSON object from Git. This refreshes regularly.
Path: Enter a new or existing path separated by
/. For example,
Data source name (required): Enter a name for the data source. For example,
Description: This field is optional.
Git authentication: Styra DAS supports either HTTPS or SSH authentication for Git. For example, select HTTPS.
Git repository (required): The subdirectory where you want to save the policies. Enter the Git repository. For example,
Access credentials (required): Enter the access credentials. If the access key and secret already exist, then click the Update access key button.
Reference: Specify a tag or branch reference. For example,
Repository path: Enter a relative path within the given repository. For example,
Refresh interval: Enter a refresh interval which is the amount of time between polling intervals. Default is
Click the arrow to expand the Advanced field.
Data transform: Specify a policy and write a query that allows you to apply Rego transformations before it is persisted as data. For example, Select Custom and fill in the following fields:
Policy: An existing policy separated by
/. For example,
Rego query: Path to the Rego rule to evaluate. For example,
Leave the Enable on-premises data source agent switch OFF. Enable on-premises data source agent shows how and where to run the data source. If set to
datasource-agentwill run on-premises setup, otherwise on SaaS.
Now, make sure you filled all the fields similar to Figure 5.
Finally, click the Add button to add a data source.
The following shows an example output which appears after the data source is created in DAS.