Using Samples
Protegrity delivers a sample application as part of the REST Container installation package. The sample application consists of the following items:
- Policy package.
- Sample Postman collection (to test AP-REST Container Pods serving deployed IMP).
- Autoscaling script (to push more load to the Kubernetes cluster to force autoscaling of the AP-REST Container Pods).
Run this sample application end-to-end, as a sanity test. This will enable them to confirm that the installation was completed accurately. In this section are details on the exact steps a customer must follow to run the sample application end-to-end. Those details explain usage of the components included in REST-Samples_Linux-ALL-ALL_x86-64_<AP-REST_version>.tgz archive.
The following components are included in the REST-Samples_Linux-ALL-ALL_x86-64_<AP-REST_version>.tgz archive.
- Policy Sample: Sample_App_Policy.tgz. This component consists of the sample policy that can be imported on the ESA 10.0.x for getting started with the AP-REST Containers use case. The following are the details for the policy.
Policy Name - Sample_policy
| Token Type | Data Element Name |
|---|---|
| Alphanumeric | Alphanum |
| Alphanumeric | Alphanum1 |
Autoscaling Script: Sample_App_autoscale.sh Script for making 10,000 REST calls to AP-REST. This script can be triggered to test the autoscaling of the pods.
PostMan Collection: Sample_App_PostMan_Collection_V4.json
This collection can be used to make v4 REST calls to AP-REST for protecting the data. The JSON file contains the following collections:
- Release 10 protect request
- Release 10 unprotect request
- Release 10 reprotect request
Release 10 protect request
Post Request Path: - https://{{host}}/v4/protect
Release 10 unprotect request
Post Request Path: - https://{{host}}/v4/unprotect
Release 10 protect request
Post Request Path: - https://{{host}}/v4/reprotect
Ensure that you create the host environment variable and specify the value of the hostname in the variable.
- PostMan Collection: Sample_App_PostMan_Collection.json
This collection can be used to make v1 REST calls to AP-REST for protecting the data. The JSON file contains the following collections:
- Release 1 protect request
- Release 1 unprotect request
- Release 1 reprotect request
Release 1 protect request
Post Request Path: - https://{{host}}/rest-v1/protect
Release 1 unprotect request
Post Request Path: - https://{{host}}/rest-v1/unprotect
Release 1 protect request
Post Request Path: - https://{{host}}/rest-v1/reprotect
Ensure that you create the host environment variable and specify the value of the hostname in the variable.
Running the Samples
- Ensure that the prerequisites mentioned in the section Software Requirements are followed.
- A Kubernetes environment is created. For more information about creating the cloud runtime environment, refer to the section Creating the AWS Environment.
The user must perform the following tasks.
Importing Certificates to the Postman Client
This section describes the steps to import the CA certificate, the client certificates, and keys to the Postman client, if you want to ensure secure communication between the Postman client and the NGINX container using TLS.Running the Postman Collection
This section describes the steps for protecting data for Release 1 and Release 2.Running the Autoscaling Script
This section provides an overview on the Autoscaling script.
Importing Policy Sample on the ESA
The user needs to perform the following steps to import the Sample_App_Policy.tgz file on the ESA.
To import policy sample on the ESA:
Login to the ESA as admin.
Navigate to Settings > Network > Web Settings.
In the General Settings section, change the Max File Upload Size value to the maximum value.
In the Session Management section, change the Session Timeout value to the maximum value.
Click Update.
Navigate to Settings > System > File Upload.
Click Choose File to select the Sample_App_Policy.tgz file that you want to upload.
Enter the administrator password and click Import.
After successful import, the Sample_policy should be available in the Policies section.
Importing Certificates to the Postman Client
This section describes the steps to import the CA certificate, the client certificates, and keys to the Postman client, if you want to ensure secure communication between the Postman client and the NGINX container using TLS.
To import certificates to the Postman client:
Open the Postman client.
In the header of the Postman client, click the Wrench icon, and then select Settings.
The SETTINGS dialog box appears.
Navigate to the Certificates tab.
In the CA Certificates section, click Select File and browse for the iap-ca.crt file in the iap-certs directory that you have created in the section Creating Certificates.
In the Client Certificates section, click Add Certificate.
The Add Certificate screen appears.
In the Host field, specify the value as prod.example.com.
You need to specify the ingress port number, which is 8443 by default.
In the CRT file field, click Select File to browse for the iap-client.crt file in the iap-certs directory.
In the KEY file field, click Select File to browse for the iap-client.key file in the iap-certs directory.
Click Add to add the client certificate and key to the Postman client.
Repeat steps 5 to 9 for adding client certificates for the host staging.example.com.
Running the Postman Collection
This section describes the steps for protecting data using the following Postman collections:
- Sample_App_PostMan_Collection_V4.json: Protecting data with v4 REST APIs.
- Sample_App_PostMan_Collection.json: Protecting data with v1 REST APIs.
The component consists of the Postman JSON file to generate the REST request for protecting data.
For protecting data with v4 REST APIs
Import the Postman collection Sample_App_PostMan_Collection_V4.json.
After import, the following four collections should be available:
- Release 10 protect request
- Release 10 unprotect request
- Release 10 reprotect request
Select Release 10 protect request in AP_REST SAMPLE and click Send.
The user should get response as successful 200 OK and receive protected data.
Select Release 10 unprotect request in AP_REST SAMPLE and click Send.
The user should get response as successful 200 OK and receive unprotected data.
Select Release 10 reprotect request in AP_REST SAMPLE and click Send.
The user should get response as successful 200 OK and receive reprotected data.
For protecting data with v1 REST APIs
Import the Postman collection Sample_App_PostMan_Collection.json.
After import, the following four collections should be available:
- Release 1 protect request
- Release 1 unprotect request
- Release 1 reprotect request
In the Postman collections, the name of the policy user has been incorrectly specified as policyuser. Change the name of the policy user to user1 before executing the collection.
In the Postman collections, the name of the reprotect data element has been incorrectly specified as Alphanum1. Change the name of the reprotect data element to Alphanum_1 before executing the collection.
Select Release 1 protect request in AP_REST SAMPLE and click Send.
The user should get response as successful 200 OK and receive protected data.
Select Release 1 unprotect request in AP_REST SAMPLE and click Send.
The user should get response as successful 200 OK and receive unprotected data.
Select Release 1 reprotect request in AP_REST SAMPLE and click Send.
The user should get response as successful 200 OK and receive reprotected data.
Feedback
Was this page helpful?