### Example Request to List Resources by Tag Source: https://docs.privacera.com/user-guide/governance-hub/tags-and-metadata.html?q= An example HTTP GET request to list resources tagged with 'COUNTRY', filtered by service and path, with pagination parameters. ```http GET /api/v1/metadata/tags/COUNTRY/resources/by-path?serviceName=privacera_snowflake&path=PS_SF_DB/OMNI_SCHEMA&page=0&size=10 ``` -------------------------------- ### Example Tag Configurations Source: https://docs.privacera.com/user-guide/governance-hub/tags-and-metadata.html?q= Demonstrates how to configure tags with different resource types and attribute requirements. Use these examples to understand how to restrict tag applicability and define necessary metadata. ```plaintext RESTRICTED → All Resources SENSITIVE → column DATA_CLASS → column, table ``` -------------------------------- ### Example Request for Retrieving Resource Metadata Source: https://docs.privacera.com/user-guide/governance-hub/tags-and-metadata.html An example of an HTTP GET request to retrieve metadata for a resource, specifying the 'resourceKey'. ```http GET /api/v1/metadata/resources/metadata?resourceKey=/customer_db/public/users_table ``` -------------------------------- ### Example Request for Retrieving Resource Metadata Source: https://docs.privacera.com/user-guide/governance-hub/tags-and-metadata.html?q= An example of an HTTP GET request to retrieve metadata for a specific resource, using a placeholder for the service name and resource path. ```http GET /api/v1/metadata/resources/metadata?resourceKey=/customer_db/public/users_table ``` -------------------------------- ### Data Masking Techniques Examples Source: https://docs.privacera.com/user-guide/privacera-encryption/schemes/masking-schemes.html Illustrates common data masking techniques with examples of input and output. ```text somebody@BigCo.com → _(null)_ ``` ```text somebody@BigCo.com → xxxxx ``` ```text somebody@BigCo.com → xxxxxxxx@xxxxx.xxx ``` ```text somebody@BigCo.com → [hashed_value] ``` ```text somebody@BigCo.com → soxxxxxxxx@xxxxx.xxx ``` ```text somebody@BigCo.com → xxxxxxxx@xxxxo.com ``` -------------------------------- ### Resource-Based Access Policy Example Source: https://docs.privacera.com/user-guide/governance-hub/data-catalog.html?q= This example demonstrates a direct assignment of 'SELECT' permission on a specific table to user groups. ```text Resource: specific_table_name Type: Access Permission: SELECT Affected Parties: user_group_a, user_group_b Policy Type: Resource-Based ``` -------------------------------- ### Example config directory structure Source: https://docs.privacera.com/user-guide/privacera-encryption/privacera-custom-encryptor/setup.html?q= This shows the expected files in the 'config/' directory after setting up crypto.properties and action.properties. ```text config/ ├── crypto.properties ├── action.properties ├── global-truststore.p12 └── feu-pegv2-secrets-keystore.jks ``` -------------------------------- ### Example Tag Configurations Source: https://docs.privacera.com/user-guide/governance-hub/tags-and-metadata.html Illustrates how tags can be configured to apply to all resources or specific resource types. ```text RESTRICTED → All Resources SENSITIVE → column DATA_CLASS → column, table ``` -------------------------------- ### Install NFS Utilities on Ubuntu Source: https://docs.privacera.com/resources/known-issues/index.html?q= Installs the NFS utilities required for mounting EFS on Ubuntu systems. ```bash sudo apt update sudo apt install -y nfs-common ``` -------------------------------- ### Example Response for Systems and Applications Source: https://docs.privacera.com/resources/api-reference/discovery-scan-api-userguide.html?q= An example JSON response detailing systems and applications. Extract 'id', 'name', and 'uniqueCode' for use in subsequent API calls. ```json { "content": [ { "id": 2, "name": "aws", "applications": [ { "id": 3, "updatedByUserName": "padmin", "name": "AWS_S3", "description": "Created by System", "systemId": 2, "properties": "", "enableDiscovery": true, "reDiscovery": false, "applicationProperties": [], "type": "aws_s3", "uniqueCode": "aws_s3", "topicName": "privacera_scan_worker_aws_s3_XXXX", "active": true } ], "active": true } ] } ``` -------------------------------- ### Example Request to List Resources by Tag Source: https://docs.privacera.com/user-guide/governance-hub/tags-and-metadata.html Demonstrates how to filter resources by service name and path prefix, and paginate results. ```HTTP GET /api/v1/metadata/tags/COUNTRY/resources/by-path?serviceName=privacera_snowflake&path=PS_SF_DB/OMNI_SCHEMA&page=0&size=10 ``` -------------------------------- ### Bulk Tagging Example Source: https://docs.privacera.com/user-guide/governance-hub/tags-and-metadata.html?q= Demonstrates how to apply multiple tags to different resources in a single API call. ```APIDOC ## Bulk Tagging Example ### Description Apply multiple tags to various resources efficiently in one request. ### Request Body ```json { "tagResourceMappings": [ { "tagName": "DATA_CLASSIFICATION", "resourcePath": "finance_db/transactions/payment_details/credit_card", "serviceName": "privacera_snowflake", "serviceType": "SNOWFLAKE", "tagAttributes": { "classification_level": "Restricted", "data_owner": "finance_team" } }, { "tagName": "COMPLIANCE_TAG", "resourcePath": "finance_db/transactions/payment_details", "serviceName": "snowflake_snowflake", "serviceType": "SNOWFLAKE", "tagAttributes": { "regulation_type": "PCI-DSS" } } ] } ``` ``` -------------------------------- ### Example config directory structure Source: https://docs.privacera.com/user-guide/privacera-encryption/privacera-custom-encryptor/setup.html This illustrates the expected file structure within the `config/` directory after setting up `crypto.properties`, `action.properties`, and the truststore files. ```text config/ ├── crypto.properties ├── action.properties ├── global-truststore.p12 └── feu-pegv2-secrets-keystore.jks ``` -------------------------------- ### Example Request for Next Page of Resources Source: https://docs.privacera.com/user-guide/governance-hub/tags-and-metadata.html Demonstrates how to fetch the subsequent page of results by incrementing the 'page' query parameter. ```HTTP GET /api/v1/metadata/tags/COUNTRY/resources/by-path?serviceName=privacera_snowflake&path=PS_SF_DB/OMNI_SCHEMA&page=1&size=1 ``` -------------------------------- ### Tag-Based Access Policy Example Source: https://docs.privacera.com/user-guide/governance-hub/data-catalog.html?q= This example shows how permissions are applied to resources based on their tags, granting 'SELECT' access to a specific group for resources tagged as 'SENSITIVE'. ```text Resource: table_with_sensitive_tag Type: Access Permission: SELECT Affected Parties: authorized_users_group Policy Type: Tag-Based (applies to resources tagged with SENSITIVE) ``` -------------------------------- ### Example JWT Header JSON Source: https://docs.privacera.com/resources/design/access-management/jwt_token_user_identity.html?q= An example of a JWT header, specifying the algorithm, token type, and key ID. ```json { "alg": "RS256", "typ": "JWT", "kid": "1234567890" } ``` -------------------------------- ### Install NFS Utilities on Redhat/CentOS Source: https://docs.privacera.com/resources/known-issues/index.html?q= Installs the NFS utilities required for mounting EFS on Redhat or CentOS systems. ```bash sudo yum install -y nfs-utils ``` -------------------------------- ### Databricks Unity Catalog Audit Log Example Source: https://docs.privacera.com/user-guide/access-management/audits/access_audits.html This example shows the structure of an audit log fetched from Databricks Unity Catalog, where the SQL statement is stored in the 'resource' field. ```json { "resource": "SELECT * FROM db1.table1", "result": "ALLOW" } ``` -------------------------------- ### Example Response for Listing Resources by Tag Source: https://docs.privacera.com/user-guide/governance-hub/tags-and-metadata.html Shows a successful response containing resource details, including applied tags and pagination information. ```JSON { "eventTime": 1780294519989, "status": "SUCCESS", "totalCount": 1, "number": 0, "pageSize": 10, "totalPages": 1, "hasNext": true, "hasPrevious": false, "content": [ { "id": "414d538196c21bb24d5a584991c37b49f0ea6fc396ea1d8f8ef83b95900ae7cf", "name": "CITY", "type": "COLUMN", "parentPath": "privacera_snowflake/PS_SF_DB/OMNI_SCHEMA/OMNI_TABLE_1", "serviceName": "privacera_snowflake", "serviceType": "SNOWFLAKE", "tags": [ { "tagName": "COUNTRY", "attributes": {} } ] } ], "filters": { "tagId": "COUNTRY", "includeChildCount": false }, "sortBy": "name", "sortOrder": "asc" } ``` -------------------------------- ### Available Schemes Response Source: https://docs.privacera.com/resources/api-reference/peg-rest-api-on-privacera-self-managed.html?q= Example JSON response listing available schemes, their descriptions, algorithms, formats, and permissions. ```json { "schemes": [ { "name": "SYSTEM_EMAIL", "description": "Standard email encryption scheme", "algorithm": "FPE", "format": "EMAIL", "scope": "ALL", "systemDefined": true, "permissions": ["ENCRYPT", "DECRYPT"] }, { "name": "SYSTEM_SSN", "description": "Social Security Number encryption", "algorithm": "FPE", "format": "SSN", "scope": "ALL", "systemDefined": true, "permissions": ["ENCRYPT", "DECRYPT"] } ], "responseStatus": "SUCCESS" } ``` -------------------------------- ### Hashing Example Source: https://docs.privacera.com/user-guide/privacera-encryption/schemes/masking-schemes.html Demonstrates the SHA-256 hashing of an email address. Hashing is a one-way transformation. ```text Input: "john.doe@example.com" SHA-256 Hash: "8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918" ``` -------------------------------- ### Example ABAC Macro Usage Source: https://docs.privacera.com/user-guide/access-management/access_policy_definition/abac/abac_macros.html?q= Demonstrates the output format for different types of ABAC macros. Use `_Q` variants for SQL-style IN clauses. ```plaintext HAS_USER_ATTR('dept') → true / false ``` ```plaintext GET_TAG_NAMES() → PII,CONFIDENTIAL ``` ```plaintext GET_UG_ATTR_Q('state') → 'CA','NY','TX' ``` -------------------------------- ### Dynamic Policy Example with TAG_GET_CHILD_RES and GET_CHILD_TAG_ATTR Source: https://docs.privacera.com/user-guide/access-management/access_policy_definition/tbac/tag_based_row_filtering.html?q= This example demonstrates how TAG_GET_CHILD_RES and GET_CHILD_TAG_ATTR macros can be used to create a fully dynamic policy. The policy dynamically determines the membership tier column and its allowed values from tags, avoiding hardcoded column names or filter values. ```SQL TAG_GET_CHILD_RES('MEMBER_TIER') → membership_tier GET_CHILD_TAG_ATTR('MEMBER_TIER', 'allowed_tiers') → "GOLD,PLATINUM,DIAMOND" Final filter: membership_tier IN ('GOLD','PLATINUM','DIAMOND') ``` -------------------------------- ### TAG_GET_CHILD_RES and GET_CHILD_TAG_ATTR Macro Example Source: https://docs.privacera.com/user-guide/access-management/access_policy_definition/tbac/tag_based_row_filtering.html Demonstrates how TAG_GET_CHILD_RES and GET_CHILD_TAG_ATTR macros dynamically construct a row filter. This example shows the resolution process and the final filter applied. ```sql TAG_GET_CHILD_RES('MEMBER_TIER') → membership_tier GET_CHILD_TAG_ATTR('MEMBER_TIER', 'allowed_tiers') → "GOLD,PLATINUM,DIAMOND" Final filter: membership_tier IN ('GOLD','PLATINUM','DIAMOND') ``` -------------------------------- ### Deployment Environment Tag Example Source: https://docs.privacera.com/user-guide/governance-hub/tags-and-metadata.html?q= Defines a tag for specifying the deployment environment of resources. Use values like Production, Staging, Development, or Test. ```text Tag: DEPLOYMENT_ENV Resource Types: All Resources Attributes: - environment (String, Required): "Production", "Staging", "Development", "Test" ``` -------------------------------- ### crypto.properties Configuration Example Source: https://docs.privacera.com/user-guide/privacera-encryption/privacera-custom-encryptor/setup.html This is a sample configuration for the 'crypto.properties' file, specifying Privacera Encryption Engine (PEG) connection details and security settings. ```properties privacera.peg.base.url= privacera.peg.native.jwtToken=jceks:peg_v2_feu_jwt_token privacera.peg.username= privacera.peg.server.ssl.enabled=true privacera.peg.server.signed.ssl.enabled=false ``` -------------------------------- ### SHA-256 Hashing Example Source: https://docs.privacera.com/user-guide/privacera-encryption/schemes/masking-schemes.html?q= Demonstrates the SHA-256 hashing of an email address. Hashing is a one-way transformation that cannot be reversed. ```text Input: "john.doe@example.com" SHA-256 Hash: "8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918 ``` -------------------------------- ### Snowflake Resource Hierarchy Example Source: https://docs.privacera.com/user-guide/access-management/service_definition/index.html Illustrates the multi-level resource hierarchy in Snowflake. Policies can be written and enforced at varying levels of granularity. ```text Database → Schema → Table → Column ``` -------------------------------- ### Start Offline Scan Source: https://docs.privacera.com/resources/api-reference/discovery-scan-api-userguide.html?q= Initiates the actual scanning process for the configured resources. This is the second step after resource configuration. ```APIDOC ## POST /api/data/dic/application/config/bulk ### Description Start the actual scanning process for configured resources. ### Method POST ### Endpoint /api/data/dic/application/config/bulk ``` -------------------------------- ### Deployment Environment Tag Example Source: https://docs.privacera.com/user-guide/governance-hub/tags-and-metadata.html Defines a tag for specifying the deployment environment of resources. Use for Production, Staging, Development, or Test environments. ```yaml Tag: DEPLOYMENT_ENV Resource Types: All Resources Attributes: - environment (String, Required): "Production", "Staging", "Development", "Test" ``` -------------------------------- ### Creating a Data Classification Tag Source: https://docs.privacera.com/user-guide/governance-hub/tags-and-metadata.html This example demonstrates how to create a new tag with attribute definitions using the API. ```APIDOC ## Creating a Data Classification Tag ### Description Use this API to create a new tag with specified attributes. ### Method POST ### Endpoint /api/v1/metadata/tags ### Request Body - **tag** (object) - Required - Contains tag details. - **name** (string) - Required - The name of the tag. - **type** (string) - Required - The type of the tag (e.g., 'Confidential'). - **description** (string) - Optional - A description for the tag. - **attributeDefinitions** (object) - Optional - Definitions for tag attributes. - **attributeName** (object) - Required - Defines an attribute. - **type** (string) - Required - The data type of the attribute (e.g., 'string'). - **required** (boolean) - Required - Whether the attribute is mandatory. - **description** (string) - Optional - Description of the attribute. - **source** (string) - Required - The source of the tag (e.g., 'API'). ### Request Example ```json { "tag": { "name": "DATA_CLASSIFICATION", "type": "Confidential", "description": "Tag for classifying data sensitivity levels", "attributeDefinitions": { "classification_level": { "type": "string", "required": true, "description": "Classification level: Public, Internal, Confidential, Restricted" }, "data_owner": { "type": "string", "required": false, "description": "Data owner responsible for the classified data" } }, "source": "API" } } ``` ``` -------------------------------- ### Get Application Systems Source: https://docs.privacera.com/resources/api-reference/discovery-scan-api-userguide.html?q= Retrieves application ID, code, and name from the system. This is a prerequisite step before configuring resources for scanning. ```APIDOC ## GET /api/data/dic/systems ### Description Get application ID, code, and name from the system. ### Method GET ### Endpoint /api/data/dic/systems ``` -------------------------------- ### Custom Regex for International NZ Numbers (No Plus) Source: https://docs.privacera.com/user-guide/discovery/scanning/classification/models.html?q= Extend detection to international NZ phone number formats that do not start with a '+'. This example matches numbers starting with '0064'. ```yaml ADDITIONAL_REGEX_INTL_NO_PLUS: ^(0064\s?2[01]\d{3}\s?\d{4})$ ``` -------------------------------- ### Example VIN Source: https://docs.privacera.com/user-guide/discovery/scanning/classification/models.html?q= An example of a valid 17-character Vehicle Identification Number. ```text 1HGCM82633A123456 ``` -------------------------------- ### Create Data Directories Source: https://docs.privacera.com/user-guide/privacera-encryption/feu/steps.html?q= Creates input, output, and meta directories for storing sample data. Ensure you replace with your actual username. ```bash mkdir -p /home//customer_data/protect/input mkdir -p /home//customer_data/protect/output mkdir -p /home//customer_data/protect/meta ``` -------------------------------- ### Create Sample Data File Source: https://docs.privacera.com/user-guide/privacera-encryption/feu/steps.html?q= Creates a CSV file named 'customer_data_with_header.csv' in the input directory with sample customer data. ```text name,email ram,ram@gmail.com tom,tom@gmail.com ``` -------------------------------- ### New CPU Variable Format Source: https://docs.privacera.com/resources/known-issues/index.html?h=kno Example of the required new CPU variable format for AuditServer, compatible with Kubernetes. ```yaml AUDITSERVER_K8S_CPU_REQUESTS: "0.5" AUDITSERVER_K8S_CPU_LIMITS: "1.0" ``` -------------------------------- ### Navigate to Sizing Configuration File Source: https://docs.privacera.com/resources/known-issues/index.html?q= Use this command to navigate to the directory containing the sizing configuration file. ```bash cd ~/privacera/privacera-manager/config/custom-vars/ vi vars.sizing.yaml ``` -------------------------------- ### Example Dynamic Policy for Environment-Specific Restrictions Source: https://docs.privacera.com/user-guide/governance-hub/tags-and-metadata.html Dynamically control access based on resource environment tags and other specific tags. ```policy Policy: Restricted Data by Environment Condition: - HAS_TAG('DEPLOYMENT_ENV') - TAG.environment == 'Production' - HAS_TAG('RESTRICTED') Action: Read Principals: Analysts_Group ``` -------------------------------- ### Create Sample Data File Source: https://docs.privacera.com/user-guide/privacera-encryption/feu/steps.html Creates a CSV file with sample customer data, including a header row. ```text name,email ram,ram@gmail.com tom,tom@gmail.com ``` -------------------------------- ### Tag-Based Access Policy Example Source: https://docs.privacera.com/user-guide/governance-hub/data-catalog.html This snippet shows how permissions are applied to resources based on their assigned tags, enabling scalable policy management. ```text Resource: table_with_sensitive_tag Type: Access Permission: SELECT Affected Parties: authorized_users_group Policy Type: Tag-Based (applies to resources tagged with SENSITIVE) ``` -------------------------------- ### Example JWT Payload JSON Source: https://docs.privacera.com/resources/design/access-management/jwt_token_user_identity.html?q= An example of a JWT payload containing claims such as issuer, subject, issued at, expiration, audience, and scope. ```json { "iss": "https://testidp.example.com/issuer/websec", "sub": "infra_test_user", "iat": "1721223184", "exp": "1721283133", "aud": "https://dataserver.example.com", "scope": [ "infra_test_group" ] } ``` -------------------------------- ### Any Role Membership Macro Example Source: https://docs.privacera.com/user-guide/access-management/access_policy_definition/abac/abac_macros.html?q= Demonstrates a macro that checks if a user is in any role. This simplifies policies for users with multiple role assignments. ```plaintext IS_IN_ANY_ROLE ``` -------------------------------- ### Row-Level Filtering Example Source: https://docs.privacera.com/user-guide/governance-hub/data-catalog.html?q= This example illustrates a row-level filter that restricts access to data based on a specific condition, in this case, the 'REGION' column. ```text Resource: table_name Type: Row Level Filter Permission: SELECT Affected Parties: regional_users Policy Rule: (REGION = 'North_America') ``` -------------------------------- ### Compile and Run with Maven Source: https://docs.privacera.com/user-guide/privacera-encryption/privacera-custom-encryptor/setup.html?q= Use Maven to compile the project and then execute the PrivaceraEncryptor main class. ```bash mvn compile mvn exec:java -Dexec.mainClass="com.privacera.encryption.example.PrivaceraEncryptor" ``` -------------------------------- ### Column Masking Example Source: https://docs.privacera.com/user-guide/governance-hub/data-catalog.html?q= This example demonstrates column masking, where sensitive data in a specific column is obscured using a hashing technique for a designated group. ```text Resource: sensitive_column Type: Masking Permission: SELECT Affected Parties: analysts_group Policy Rule: Mask Type: MASK_HASH ``` -------------------------------- ### Import Connector from File Source: https://docs.privacera.com/user-guide/runtime-plane/runtime-api-reference/connector/import.html This snippet demonstrates how to import a connector by referencing a local JSON file containing the connector configuration. This is useful for managing larger or more complex connector definitions. ```bash curl -X POST "https://api.privaceracloud.com/v2/runtime/connector/import" \ -H "Content-Type: application/json" \ -H "x-pcloud-key: " \ -d @connector-import.json ``` -------------------------------- ### Resource-Based Access Policy Example Source: https://docs.privacera.com/user-guide/governance-hub/data-catalog.html This snippet illustrates a direct permission assignment to a specific table, defining who can access it and what operations are allowed. ```text Resource: specific_table_name Type: Access Permission: SELECT Affected Parties: user_group_a, user_group_b Policy Type: Resource-Based ``` -------------------------------- ### Create Directories for FEU Source: https://docs.privacera.com/user-guide/privacera-encryption/feu/steps.html Sets up the necessary input, output, and meta directories for the FEU operations. ```bash mkdir -p /home//customer_data/protect/input mkdir -p /home//customer_data/protect/output mkdir -p /home//customer_data/protect/meta ``` -------------------------------- ### Copy HA Sample Configuration Source: https://docs.privacera.com/resources/known-issues/index.html?q= Navigate to the custom-vars directory and copy the HA sample configuration file for Kubernetes. ```bash cd ~/privacera/privacera-manager/config/custom-vars cp ../sample-vars/vars.kubernetes.ha.yml ./ ``` -------------------------------- ### Date (DD/MM) Data Validation Examples Source: https://docs.privacera.com/user-guide/privacera-encryption/data-validation.html Provides examples of protecting and unprotecting dates in DD/MM format when data validation is active. Incorrect date formats result in errors. ```text Protect/ Unprotect | Input | Response ---|---|--- Protect | 123 | PRIV_PEG_ENC_ERROR_4 Protect | 26/12/2012 | 16/04/2036 Unprotect | PRIV_PEG_ENC_ERROR_4 | PRIV_PEG_ENC_ERROR_4 Unprotect | 16/04/2036 | 26/12/2012 ``` -------------------------------- ### Set up AWS CLI profile Source: https://docs.privacera.com/user-guide/AWS/aws-cli.html?q= Configure a specific AWS CLI profile to work with Privacera DataServer. Replace `` with your desired profile name. ```bash . ~/privacera_aws.sh --profile ``` -------------------------------- ### ECDSA JWK Example in JWKS Source: https://docs.privacera.com/resources/design/access-management/jwt_token_user_identity.html?q= An example of a JSON Web Key Set (JWKS) containing an ECDSA JWK, as returned by a JWKS service. This key is used for verifying JWT signatures. ```json { "keys": [ { "kty": "EC", "crv": "P-256", "x": "your-x-coordinate", "y": "your-y-coordinate", "kid": "your-unique-key-id", "exp": "your-expiration-time" } ]} ``` -------------------------------- ### Navigate to Configuration Directory Source: https://docs.privacera.com/user-guide/privacera-encryption/privacera-custom-encryptor/setup.html Change the current directory to the 'crypto-config' folder after extracting the package. ```bash cd crypto-config ``` -------------------------------- ### RSA JWK Example in JWKS Source: https://docs.privacera.com/resources/design/access-management/jwt_token_user_identity.html?q= An example of a JSON Web Key Set (JWKS) containing an RSA JWK, as returned by a JWKS service. This key is used for verifying JWT signatures. ```json { "keys": [ { "alg": "RS256", "kty": "RSA", "use": "sig", "x5c": [ "your-x509-cert-chain" ], "n": "your-rsa-public-modulus", "e": "your-base64url-encoded-exponent", "kid": "your-unique-key-id", "x5t#S256": "your-unique-thumbprint-sha256", "exp": "your-expiration-time" } ]} ``` -------------------------------- ### Configure token for Privacera Source: https://docs.privacera.com/user-guide/AWS/aws-cli.html?q= Run this command and enter your Privacera Access Key and Secret Token when prompted to configure the CLI. ```bash source privacera_aws.sh --config-token ``` -------------------------------- ### Get Role by ID Source: https://docs.privacera.com/resources/api-reference/ranger-java-api.html?q= Retrieves an existing role from Apache Ranger using its ID via a GET request. Returns the `RangerRole` object upon success or throws `RangerServiceException` on error. ```APIDOC ## Retrieve Role by ID ### Description This method sends a GET request to the Ranger Admin server to retrieve an existing role. The role to be retrieved is identified by the `roleId` parameter. If the retrieval is successful, the method returns the retrieved `RangerRole` object. If an error occurs during the API call, a `RangerServiceException` is thrown. ### Method Signature `public RangerRole getRole(long roleId) throws RangerServiceException` ### Parameters #### Path Parameters - `roleId` (long) - Required - The ID of the role to be retrieved. #### Query Parameters - None #### Request Body - None ### Request Example ```java try { RangerRole role = rangerAdminClient.getRole(1); System.out.println("Role Name: " + role.getName()); } catch (RangerServiceException e) { // Handle exception } ``` ### Response #### Success Response (200 OK) - `RangerRole` - The retrieved `RangerRole` object. #### Response Example ```json { "id": 1, "name": "existing_role", "description": "An existing role" // ... other role properties } ``` ### Exceptions - `RangerServiceException` - If an error occurs during the API call. ``` -------------------------------- ### Get Role by Name Source: https://docs.privacera.com/resources/api-reference/ranger-java-api.html Retrieves a role by its name. This method sends a GET request to the Ranger Admin server. The role to be retrieved is identified by `roleName`. Returns the `RangerRole` object on success or throws `RangerServiceException` on error. ```APIDOC ## Get Role by Name ### Description Retrieves an existing role in Apache Ranger by its name. This method sends a GET request to the Ranger Admin server. ### Method Signature ```java public RangerRole getRole(String roleName, String execUser, String serviceName) throws RangerServiceException ``` ### Parameters #### Path Parameters - `roleName` (String) - Required - The name of the role to be retrieved. - `execUser` (String) - Required - The user executing the request. - `serviceName` (String) - Required - The name of the service. ### Returns - `RangerRole` - The retrieved `RangerRole` object. ### Exceptions - `RangerServiceException` - If an error occurs during the API call. ``` -------------------------------- ### Get Systems and Applications Source: https://docs.privacera.com/resources/api-reference/discovery-scan-api-userguide.html?q= Retrieves a list of systems and their applications. Replace placeholder values with your actual Privacera portal URL, username, and password. The response contains IDs and names needed for further API calls. ```bash curl -X GET "https:///api/data/dic/systems?size=15" \ -H "Accept: application/json" \ -u "USERNAME:PASSWORD" ``` -------------------------------- ### Get Role by Name Source: https://docs.privacera.com/resources/api-reference/ranger-java-api.html?q= Retrieves an existing role from Apache Ranger using its name via a GET request. Requires `roleName`, `execUser`, and `serviceName`. Returns the `RangerRole` object upon success or throws `RangerServiceException` on error. ```APIDOC ## Retrieve Role by Name ### Description This method sends a GET request to the Ranger Admin server to retrieve an existing role. The role to be retrieved is identified by the `roleName` parameter. If the retrieval is successful, the method returns the retrieved `RangerRole` object. If an error occurs during the API call, a `RangerServiceException` is thrown. ### Method Signature `public RangerRole getRole(String roleName, String execUser, String serviceName) throws RangerServiceException` ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - `roleName` (String) - Required - The name of the role to be retrieved. - `execUser` (String) - Required - The user executing the request. - `serviceName` (String) - Required - The name of the service. ### Request Example ```java try { RangerRole role = rangerAdminClient.getRole("existing_role", "admin_user", "my_service"); System.out.println("Role ID: " + role.getId()); } catch (RangerServiceException e) { // Handle exception } ``` ### Response #### Success Response (200 OK) - `RangerRole` - The retrieved `RangerRole` object. #### Response Example ```json { "id": 1, "name": "existing_role", "description": "An existing role" // ... other role properties } ``` ### Exceptions - `RangerServiceException` - If an error occurs during the API call. ``` -------------------------------- ### Create Meta Data File Source: https://docs.privacera.com/user-guide/privacera-encryption/feu/steps.html?q= Creates a meta file named 'customer_data_meta.txt' specifying column names and their associated schemes. ```text COLUMN_NAME|SCHEME_NAME email|SYSTEM_EMAIL ``` -------------------------------- ### Get Role by ID Source: https://docs.privacera.com/resources/api-reference/ranger-java-api.html Retrieves a role by its unique identifier. This method sends a GET request to the Ranger Admin server. The role to be retrieved is identified by `roleId`. Returns the `RangerRole` object on success or throws `RangerServiceException` on error. ```APIDOC ## Get Role by ID ### Description Retrieves an existing role in Apache Ranger by its ID. This method sends a GET request to the Ranger Admin server. ### Method Signature ```java public RangerRole getRole(long roleId) throws RangerServiceException ``` ### Parameters #### Path Parameters - `roleId` (long) - Required - The ID of the role to be retrieved. ### Returns - `RangerRole` - The retrieved `RangerRole` object. ### Exceptions - `RangerServiceException` - If an error occurs during the API call. ``` -------------------------------- ### Get All Role Names Source: https://docs.privacera.com/resources/api-reference/ranger-java-api.html Retrieves all role names for a given service. This method sends a GET request to the Ranger Admin server. The service is identified by `serviceName`. Returns a list of role names on success or throws `RangerServiceException` on error. ```APIDOC ## Get All Role Names ### Description Retrieves all role names for a specific service in Apache Ranger. This method sends a GET request to the Ranger Admin server. ### Method Signature ```java public List getAllRoleNames(String execUser, String serviceName) throws RangerServiceException ``` ### Parameters #### Path Parameters - `execUser` (String) - Required - The user executing the request. - `serviceName` (String) - Required - The name of the service. ### Returns - `List` - A list of role names. ### Exceptions - `RangerServiceException` - If an error occurs during the API call. ``` -------------------------------- ### Download privacera_aws.sh script using wget Source: https://docs.privacera.com/user-guide/AWS/aws-cli.html Use this command to download the `privacera_aws.sh` script from the Privacera Portal using `wget`. Replace `` with your portal's hostname. ```bash wget http:///api/cam/download/script \ -O ~/privacera_aws.sh ``` -------------------------------- ### Get All Role Names for Service Source: https://docs.privacera.com/resources/api-reference/ranger-java-api.html?q= Retrieves a list of all role names for a specific service in Apache Ranger via a GET request. Requires `execUser` and `serviceName`. Returns a list of role names upon success or throws `RangerServiceException` on error. ```APIDOC ## Retrieve All Role Names for Service ### Description This method sends a GET request to the Ranger Admin server to retrieve all role names for a service. The service is identified by the `serviceName` parameter. If the retrieval is successful, the method returns a list of role names. If an error occurs during the API call, a `RangerServiceException` is thrown. ### Method Signature `public List getAllRoleNames(String execUser, String serviceName) throws RangerServiceException` ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - `execUser` (String) - Required - The user executing the request. - `serviceName` (String) - Required - The name of the service. ### Request Example ```java try { List roleNames = rangerAdminClient.getAllRoleNames("admin_user", "my_service"); for (String roleName : roleNames) { System.out.println(roleName); } } catch (RangerServiceException e) { // Handle exception } ``` ### Response #### Success Response (200 OK) - `List` - A list of role names. #### Response Example ```json [ "role1", "role2", "role3" ] ``` ### Exceptions - `RangerServiceException` - If an error occurs during the API call. ``` -------------------------------- ### Get Security Zone by Name Source: https://docs.privacera.com/resources/api-reference/ranger-java-api.html Retrieves an existing security zone identified by its name. This method sends a GET request to the Ranger Admin server. It returns the retrieved security zone object upon success or throws a RangerServiceException on failure. ```APIDOC ## Get Security Zone by Name ### Description Retrieves an existing security zone identified by its name. This method sends a GET request to the Ranger Admin server. It returns the retrieved security zone object upon success or throws a RangerServiceException on failure. ### Method GET ### Endpoint /ranger/api/v1/securityzone?zoneName={zoneName} ### Parameters #### Query Parameters - **zoneName** (String) - Required - The name of the security zone to be retrieved. ### Response #### Success Response (200) - **RangerSecurityZone** - The retrieved security zone object. ### Exceptions - **RangerServiceException** - If an error occurs during the API call. ``` -------------------------------- ### Get Security Zone by ID Source: https://docs.privacera.com/resources/api-reference/ranger-java-api.html Retrieves an existing security zone identified by its ID. This method sends a GET request to the Ranger Admin server. It returns the retrieved security zone object upon success or throws a RangerServiceException on failure. ```APIDOC ## Get Security Zone by ID ### Description Retrieves an existing security zone identified by its ID. This method sends a GET request to the Ranger Admin server. It returns the retrieved security zone object upon success or throws a RangerServiceException on failure. ### Method GET ### Endpoint /ranger/api/v1/securityzone/{zoneId} ### Parameters #### Path Parameters - **zoneId** (long) - Required - The ID of the security zone to be retrieved. ### Response #### Success Response (200) - **RangerSecurityZone** - The retrieved security zone object. ### Exceptions - **RangerServiceException** - If an error occurs during the API call. ``` -------------------------------- ### Enable Debug Logging for FEU Source: https://docs.privacera.com/user-guide/privacera-encryption/feu/troubleshooting.html?q= Create a logback.xml file to enable debug logging for the FEU. Place this file in the same directory as the privacera-file-encryption.jar. ```xml %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n INFO logs/encrypt-cli.log logs/encrypt-cli.log.%i 1 ${MAX_LOG_FILES:-10} ${MAX_LOG_FILE_SIZE:-10MB} UTF-8 %d %p [%t] %c:%L - %m%n reparin ``` -------------------------------- ### Get Schemes by User Source: https://docs.privacera.com/resources/api-reference/peg-rest-api-on-privacera-self-managed.html?q= Retrieves a list of schemes on which the user has permissions. ```APIDOC ## GET /api/public/crypto/schemes/byuser ### Description Gets a list of schemes on which the user has permissions. ### Method GET ### Endpoint https:///api/public/crypto/schemes/byuser ### Parameters #### Query Parameters - **user** (string) - Optional - Username for impersonation if authorized ### Response #### Success Response (200) - **schemes** (array of strings) - List of available schemes. ``` -------------------------------- ### Default Role Attribute Example Source: https://docs.privacera.com/user-guide/access-management/access_policy_definition/abac/abac_attributes.html?q= Access the default role name attribute. ```plaintext URATTR['']._name ``` -------------------------------- ### Get Available Schemes Source: https://docs.privacera.com/resources/api-reference/peg-rest-api-on-privacera-self-managed.html?q= Retrieves a list of available encryption and masking schemes. ```APIDOC ## GET /api/public/crypto/schemes/byuser ### Description Retrieves a list of available encryption and masking schemes that can be used with the API. ### Method GET ### Endpoint `/api/public/crypto/schemes/byuser` ### Parameters None ### Request Example ``` curl -X GET \ -H "Authorization: Bearer " \ 'https:///api/public/crypto/schemes/byuser' ``` ### Response #### Success Response (200) - **schemes** (array of objects) - A list of available schemes, each with properties like name, description, algorithm, format, scope, systemDefined, and permissions. - **responseStatus** (string) - The status of the operation (e.g., "SUCCESS"). #### Response Example ```json { "schemes": [ { "name": "SYSTEM_EMAIL", "description": "Standard email encryption scheme", "algorithm": "FPE", "format": "EMAIL", "scope": "ALL", "systemDefined": true, "permissions": ["ENCRYPT", "DECRYPT"] }, { "name": "SYSTEM_SSN", "description": "Social Security Number encryption", "algorithm": "FPE", "format": "SSN", "scope": "ALL", "systemDefined": true, "permissions": ["ENCRYPT", "DECRYPT"] } ], "responseStatus": "SUCCESS" } ``` ``` -------------------------------- ### List S3 Buckets using AWS CLI Source: https://docs.privacera.com/user-guide/AWS/aws-cli.html After configuring the AWS CLI with Privacera, test access by listing all S3 buckets. ```bash aws s3 ls s3:// ``` -------------------------------- ### Configure Resource for Discovery Scanning (Bulk) Source: https://docs.privacera.com/resources/api-reference/discovery-scan-api-userguide.html?q= Use this cURL command to configure resources for discovery scanning by creating a landing zone. Replace placeholder values with your actual configuration details. ```bash curl -X POST "https:///api/data/dic/application/config/bulk" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -u "USERNAME:PASSWORD" \ -d ' [ { "appId": "APP_ID", "rescanEnabled": false, "configType": "L", "type": "I", "resource": "RESOURCE_PATH" } ]' ``` -------------------------------- ### Sample Java Implementation for Privacera Encryptor Source: https://docs.privacera.com/user-guide/privacera-encryption/privacera-custom-encryptor/setup.html A complete Java class demonstrating how to load `crypto.properties` and `action.properties`, and then perform protect and unprotect operations using the `Encryptor` class. Ensure the `config/` directory is in the user's current directory. ```java package com.privacera.encryption.example; import com.privacera.custom.encryptor.Encryptor; import java.io.*; import java.nio.file.*; import java.util.*; public class PrivaceraEncryptor { private static final String CONFIG_PATH = Paths.get(System.getProperty("user.dir"), "config").toString() + File.separator; public static void main(String[] args) throws Exception { String username = loadUsername(); System.out.println("Loaded username: " + (username != null ? username : "not found")); Encryptor encryptor = new Encryptor(); List rows = loadActions(); rows.sort(Comparator.comparing(r -> r[3]) // scheme .thenComparing(r -> r[0])); // action for (String[] r : rows) { String action = r[0]; // protect | unprotect String field = r[1]; // field name String data = r[2]; // field value (plain or encrypted) String scheme = r[3]; // scheme name System.out.println("\n=== Processing field: " + field + " ==="); System.out.println("Original: " + data); if ("protect".equalsIgnoreCase(action)) { System.out.println("Encrypted: " + encryptor.protect(data, scheme)); } else if ("unprotect".equalsIgnoreCase(action)) { System.out.println("Decrypted: " + encryptor.unprotect(data, scheme)); } } encryptor.cleanup(); } private static String loadUsername() throws IOException { Properties p = new Properties(); try (FileInputStream fis = new FileInputStream( Paths.get(CONFIG_PATH, "crypto.properties").toFile())) { p.load(fis); String u = p.getProperty("privacera.peg.username"); return (u != null && !u.trim().isEmpty()) ? u.trim() : null; } } private static List loadActions() throws IOException { List rows = new ArrayList<>(); Path file = Paths.get(CONFIG_PATH, "action.properties"); try (BufferedReader br = Files.newBufferedReader(file)) { String line; while ((line = br.readLine()) != null) { line = line.trim(); if (line.isEmpty() || line.startsWith("#")) continue; String[] parts = line.split(",", 4); if (parts.length == 4) { rows.add(new String[]{ parts[0].trim(), parts[1].trim(), parts[2].trim(), parts[3].trim() }); } } } return rows; } } ``` -------------------------------- ### Multi-Data Masking Response Source: https://docs.privacera.com/resources/api-reference/peg-rest-api-on-privacera-self-managed.html?q= Example JSON response after successfully masking multiple data elements. ```json { "datas": [ ["user*@*******.***", "user*@*******.***"], ["XXX-XX-6789", "XXX-XX-4321"], ["XXXX-XXXX-XXXX-1111", "XXXX-XXXX-XXXX-4444"] ], "responseStatus": "SUCCESS" } ``` -------------------------------- ### Multi-Data Unprotection Response Source: https://docs.privacera.com/resources/api-reference/peg-rest-api-on-privacera-self-managed.html?q= Example JSON response after successfully unprotecting multiple data elements. ```json { "datas": [ ["user1@*****.***", "user2@*****.***"], ["123-45-6789", "987-65-4321"] ], "responseStatus": "SUCCESS" } ``` -------------------------------- ### Run with Java Classpath Source: https://docs.privacera.com/user-guide/privacera-encryption/privacera-custom-encryptor/setup.html Execute the Privacera Custom Encryptor directly using the Java classpath. Ensure all necessary JAR files and the main class are included. ```bash java -cp ".:privacera-encryption-native.jar:slf4j-api-2.0.6.jar:logback-classic-1.3.14.jar:logback-core-1.3.14.jar" \ com.privacera.encryption.example.PrivaceraEncryptor ``` -------------------------------- ### Multi-Data Protection Response Source: https://docs.privacera.com/resources/api-reference/peg-rest-api-on-privacera-self-managed.html?q= Example JSON response after successfully protecting multiple data elements. ```json { "datas": [ ["a1b2@cDe3.fGh", "j4k5@lMn6.oPq"], ["XXX-XX-6789", "XXX-XX-4321"], ["XXXX-XXXX-XXXX-1111", "XXXX-XXXX-XXXX-4444"] ], "responseStatus": "SUCCESS" } ``` -------------------------------- ### Project Directory Structure for Configuration Source: https://docs.privacera.com/user-guide/privacera-encryption/privacera-custom-encryptor/setup.html This structure shows the required files and their placement within the 'config/' directory of your project. ```text config/ ├── crypto.properties ├── global-truststore.p12 └── feu-pegv2-secrets-keystore.jks ``` -------------------------------- ### Run with Maven Source: https://docs.privacera.com/user-guide/privacera-encryption/privacera-custom-encryptor/setup.html Execute the Privacera Custom Encryptor using Maven commands. This method compiles the project and then runs the main class. ```bash mvn compile mvn exec:java -Dexec.mainClass="com.privacera.encryption.example.PrivaceraEncryptor" ``` -------------------------------- ### Single Data Masking Response Source: https://docs.privacera.com/resources/api-reference/peg-rest-api-on-privacera-self-managed.html?q= Example JSON response after successfully masking a single data element. ```json { "data": "XXX-XX-6789", "responseStatus": "SUCCESS" } ``` -------------------------------- ### Single Data Unprotection Response Source: https://docs.privacera.com/resources/api-reference/peg-rest-api-on-privacera-self-managed.html?q= Example JSON response after successfully unprotecting a single data element. ```json { "data": "user@*****.***", "responseStatus": "SUCCESS" } ``` -------------------------------- ### Enable Debug Logging for FEU Source: https://docs.privacera.com/user-guide/privacera-encryption/feu/troubleshooting.html Create a logback.xml file in the FEU configuration directory to enable debug logging for the 'com.privacera' package and configure console and rolling file appenders. ```xml %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n INFO logs/encrypt-cli.log logs/encrypt-cli.log.%i 1 ${MAX_LOG_FILES:-10} ${MAX_LOG_FILE_SIZE:-10MB} UTF-8 %d %p [%t] %c:%L - %m%n reparin ```