Back to all configurations
TrustScore

Trust Score profile

Declare a Trust Score profile that scores Person nodes on verification, origin and freshness, recomputed daily, with the indykite_trust_score_profile resource.

Trust Score profile

A Trust Score profile gives every node of one type a score that says how far its data can be trusted. The score combines the chosen dimensions, each with a weight, and is recomputed on the profile's schedule; it is then readable on the node and usable in authorization conditions.

This Terraform configuration creates a profile for Person nodes that:

1. Weights verification 0.5, origin 0.3 and freshness 0.2 (the other dimensions are validity and completeness).

2. Recomputes daily (UPDATE_FREQUENCY_DAILY; the other schedules are every twelve, six or three hours).

node_classification is fixed at creation; weights and schedule can be updated.

Use case

Scenario: Person records come from several sources of different quality and a policy must favour the trustworthy ones.

- The profile is declared in version control; data owners agree on the dimensions and weights in a reviewed change.

- After the first computation the trust score and its dimensions are read like any other property, and a KBAC or ContX IQ policy can require a minimum score, as the Trust Score guide shows.

- Rebalancing the weights is an update and takes effect at the next scheduled computation.

Requirements

- ServiceAccount credentials created in the IndyKite Hub for your organization.

- IndyKite Terraform provider 0.49.0 or later, the release the example pins in required_providers; the Terraform guide lists the version each feature first appeared in.

- A project GID for project_id, and Person nodes captured with property metadata (source, verification, timestamps) for the dimensions to have something to score.

Steps

1. Put your project GID in project_id and the node type in node_classification.

2. Choose the dimensions and weights (each between 0 and 1) and the schedule, then apply.

3. After the first run, read the score on a node through ContX IQ and use it in a policy condition.

4. Adjust weights or schedule and apply again; the next computation uses the new values.

A Trust Score profile for Person nodes with three weighted dimensions and a daily schedule.

main.tf

terraform {
  required_providers {
    indykite = {
      source  = "indykite/indykite"
      version = ">= 0.49.0" # or a later release
    }
  }
}

# indykite provider integrates IndyKite platform with Terraform scripting.
# Provider for now does not support any parameters and all is set within service account credential file.
provider "indykite" {}

# A Trust Score profile scores every node of one type on the chosen dimensions,
# weighted, and recomputes on the schedule. node_classification cannot be
# changed after creation. Each weight is between 0 and 1 and the weights sum to 1.0.
resource "indykite_trust_score_profile" "person" {
  name                = "terraform-trust-score-person"
  display_name        = "Trust score for Person nodes"
  description         = "How far a Person record can be trusted: verified and well-sourced data scores highest"
  project_id          = "gid:AAAAAmluZHlraURlgAABDwAAAAA" # your project GID
  node_classification = "Person"
  dimension {
    name   = "NAME_VERIFICATION" # the data was confirmed by a trusted source
    weight = 0.5
  }
  dimension {
    name   = "NAME_ORIGIN" # where the data comes from
    weight = 0.3
  }
  dimension {
    name   = "NAME_FRESHNESS" # how recently it was updated
    weight = 0.2
  }
  # UPDATE_FREQUENCY_DAILY, _TWELVE_HOURS, _SIX_HOURS or _THREE_HOURS
  schedule = "UPDATE_FREQUENCY_DAILY"
}