Discovery

Custom Labels

While Gigantics provides comprehensive system labels, you may need to create custom labels for organization-specific data types or unique business requirements. Custom labels allow you to define your own data classification rules using two distinct detection mechanisms.

When to Use Custom Labels

Custom labels are useful for:

  • Organization-specific data classifications
  • Industry-specific sensitive data types
  • Internal data categories not covered by system labels
  • Business logic-based classifications

Creating Custom Labels

Accessing Custom Label Creation

  1. Navigate to the Project Settings
  2. Go to the "Labels" section
  3. Click "Create Custom Label"
  4. Fill in the label configuration details

Custom Label Properties

When creating a custom label, you need to specify several properties that control how the label behaves during discovery and processing.

Basic Information

PropertyDescriptionExample
Label NameA unique identifier for your label (will be prefixed with "custom/")CUSTOMER_LOYALTY_ID
DescriptionExplanation of what data this label coversInternal customer loyalty program identifiers
CategoryGrouping for organizational purposesCustomer Data, HR Data, Financial Data

Classification Settings

PropertyDescriptionOptions
PII StatusWhether this label represents PII dataTrue (contains PII), False (does not contain PII)
Default SeverityRisk level assigned to fields with this labelLow, Medium, High, Very High

Detection Logic

There are two types of detection logic you can configure for custom labels. Each type has specific configuration fields that control how the label is detected during discovery.

1. Metadata Hint Detection

This method applies labels based on patterns in entity (table) names and field (column) names. It's useful for structured data where naming conventions indicate sensitive data types.

FieldPurposeOptionsExample
Entity Name TypeHow to match entity/table namesExact (exact text matching), Regex (regular expressions)Regex
Entity Name TextPattern to match against table/entity namesText patterncustomer.*
Field Name TypeHow to match field/column namesExact (exact text matching), Regex (regular expressions)Regex
Field Name TextPattern to match against column/field namesText pattern^loyalty_.*_id$
2. Data Matchers Detection

This method applies labels based on patterns in the actual data values. It's useful when data content indicates sensitivity regardless of naming conventions.

FieldPurposeOptionsExample
Matcher TypeHow to match data valuesExact (exact text matching), Regex (regular expressions)Regex
Expression TextPattern to match against actual data valuesText pattern or regex^EMP\d{6}$

Custom Functions for Label Processing

You can associate custom JavaScript functions with your labels for specialized processing during data handling. These functions are created in the Project > Functions area and can be used for detection, transformation, or validation of data values during different phases of processing.

Types of Custom Functions:

  1. Detection Functions - Used during the discovery process to identify if a field should be labeled with a specific label, often with complex business logic
  2. Transformation Functions - Used during anonymization to modify the actual data values
  3. Validation Functions - Used to verify data format or content

To create a custom function for label processing:

  1. Navigate to Project Settings > Functions
  2. Click "New Function"
  3. Give your function a name and description
  4. Write your JavaScript code in the editor

Example 1 - Pattern-Based Label Detection:

// Function name: detectEmployeeID
// Description: Detects employee IDs based on format pattern
function detectEmployeeID(value) {
  // Check if value matches EMP followed by 6 digits
  const pattern = /^EMP\d{6}$/;
  return pattern.test(value);
}

Example 2 - Context-Aware Label Detection:

// Function name: detectInternalID
// Description: Detects internal IDs based on context and naming conventions
function detectInternalID(value, context) {
  // Check basic pattern
  const pattern = /^\d{8,10}$/;
  if (!pattern.test(value)) return false;
 
  // Check context clues
  const tableName = context.tableName.toLowerCase();
  const columnName = context.columnName.toLowerCase();
 
  // Match if table or column names suggest internal IDs
  if (tableName.includes('internal') || columnName.includes('internal') ||
      tableName.includes('staff') || columnName.includes('staff')) {
    return true;
  }
 
  return false;
}

Example 3 - Dictionary-Based Label Detection:

// Function name: detectDepartmentCode
// Description: Detects department codes using a predefined list
function detectDepartmentCode(value) {
  // Predefined list of valid department codes
  const departmentCodes = ['HR', 'IT', 'FIN', 'MKT', 'OPS', 'RND', 'SAL', 'SUP'];
  return departmentCodes.includes(value.toUpperCase());
}

Example Custom Labels with Detection Logic

Example 1 - Metadata Hint for Customer Loyalty IDs:

Label Name: CUSTOMER_LOYALTY_ID
Description: Internal customer loyalty program identifiers
Category: Customer Data
PII Status: True
Default Severity: Medium
Detection Type: Metadata Hint
Entity Name Type: Regex
Entity Name Text: customer.*
Field Name Type: Regex
Field Name Text: ^loyalty_.*_id$

Example 2 - Data Matcher for Custom Employee IDs:

Label Name: EMPLOYEE_ID_CODE
Description: Specific employee identification codes
Category: HR Data
PII Status: True
Default Severity: High
Detection Type: Data Matchers
Matcher Type: Regex
Expression Text: ^EMP\d{6}$

Managing Custom Labels

Editing Custom Labels

You can modify existing custom labels:

  • Change the description
  • Update PII status
  • Adjust default severity levels

Note: Changes to custom labels affect future discovery jobs but not completed ones.

Deleting Custom Labels

Delete custom labels you no longer need:

  • Only unused labels can be deleted
  • System will warn if the label is in use
  • Associated field classifications will be removed

Applying Custom Labels

Custom labels can be applied during:

  1. Discovery Process:

    • Added to the label dictionary
    • Used in automatic classification
  2. Manual Labeling:

    • Applied to specific fields during review
    • Used in the field editing interface
  3. Rules Configuration:

    • Referenced in anonymization rules
    • Used in data synthesis transformations

Custom Label Best Practices

  • Use clear, descriptive names that indicate the data type
  • Follow your organization's data classification standards
  • Regularly review and update custom labels
  • Document the business purpose of each custom label
  • Ensure consistent application across projects

After creating custom labels, you can use them in your discovery processes and adjust their sensitivity as needed.