Policy API reference guide
curl \
--request POST \
--header "Content-Type: application/json" \
--header "Authorization: Bearer dea464c07bd07300095caa8" \
--data @example-payload.json \
https://demo.immuta.com/policy/global{
"type": "data",
"template": false,
"ownerRestrictions": null,
"actions": [{
"type": "masking",
"rules": [{
"type": "masking",
"exceptions": null,
"config": {
"fields": [{
"name": "Discovered.PII",
"displayName": "Discovered > PII",
"hasLeafNodes": false,
"source": "curated"
}],
"maskingConfig": {
"type": "Consistent Value",
"metadata": {}
}
}
}],
"description": ""
}],
"circumstances": [{
"operator": "or",
"type": "columnTags",
"columnTag": {
"name": "Discovered.PII",
"displayName": "Discovered > PII",
"hasLeafNodes": false,
"source": "curated"
}
}],
"name": "Mask PII",
"certification": {
"text": "This certifies that all columns containing PII in this data source have been tagged appropriately.",
"label": "Certified",
"tags": [],
"recertify": true
},
"staged": false
}{
"id": 8,
"policyKey": "Mask PII",
"name": "Mask PII",
"type": "data",
"template": false,
"staged": false,
"systemGenerated": false,
"deleted": false,
"certification": {
"tags": [],
"text": "This certifies that all columns containing PII in this data source have been tagged appropriately.",
"label": "Certified",
"recertify": true
},
"actions": [{
"type": "masking",
"rules": [{
"type": "masking",
"config": {
"fields": [{
"name": "Discovered.PII",
"source": "curated",
"hasLeafNodes": false
}],
"maskingConfig": {
"type": "Consistent Value",
"metadata": {}
}
},
"exceptions": null
}],
"description": null
}],
"circumstances": [{
"type": "columnTags",
"operator": "or",
"columnTag": {
"name": "Discovered.PII",
"hasLeafNodes": false
}
}],
"metadata": null,
"clonedFrom": null,
"createdBy": 2,
"createdAt": "2021-09-21T18:35:48.615Z",
"updatedAt": "2021-09-21T18:35:48.615Z",
"createdByName": "Katie",
"ownerRestrictions": null
}curl \
--request POST \
--header "Content-Type: application/json" \
--header "Authorization: Bearer dea464c07bd07300095caa8" \
--data @example-payload.json \
https://demo.immuta.com/policy/handler/2{
"jsonPolicies": [{
"type": "masking",
"rules": [{
"type": "masking",
"config": {
"fields": ["amount"],
"maskingConfig": {
"type": "Consistent Value",
"metadata": {
"constant": null
}
}
},
"exceptions": null
}],
"createdAt": "2021-09-20T20:03:18.001Z",
"createdBy": 2,
"description": null
}, {
"type": "masking",
"rules": [{
"type": "masking",
"config": {
"fields": ["geo_latitude"],
"maskingConfig": {
"type": "Consistent Value",
"metadata": {}
}
},
"exceptions": null
}],
"createdAt": "2021-09-20T20:02:02.213Z",
"createdBy": 2,
"description": null
}, {
"type": "prerequisite",
"rules": [{
"type": "prerequisite",
"exceptions": null,
"config": {
"qualifications": {
"operator": "and",
"conditions": [{
"type": "purposes",
"value": "Re-identification Prohibited"
}]
}
}
}],
"description": ""
}],
"dataSourcePolicyHandler": {
"handlerId": 26,
"visibilitySchema": {
"fields": []
}
}
}{
"id": 42,
"dataSourceId": 2,
"createdBy": 2,
"ca": ["-----BEGIN CERTIFICATE-----\ncertificatedata\n-----END CERTIFICATE-----"],
"jsonPolicies": [
{
"type": "masking",
"rules": [
{
"type": "masking",
"config": {
"fields": [
"amount"
],
"maskingConfig": {
"type": "Consistent Value",
"metadata": {
"constant": null
}
}
},
"exceptions": null
}
],
"createdAt": "2021-09-20T20:03:18.001Z",
"createdBy": 2,
"description": null
},
{
"type": "masking",
"rules": [
{
"type": "masking",
"config": {
"fields": [
"geo_latitude"
],
"maskingConfig": {
"type": "Consistent Value",
"metadata": {}
}
},
"exceptions": null
}
],
"createdAt": "2021-09-20T20:02:02.213Z",
"createdBy": 2,
"description": null
},
{
"type": "prerequisite",
"rules": [
{
"type": "prerequisite",
"config": {
"qualifications": {
"operator": "and",
"conditions": [
{
"type": "purposes",
"value": "Re-identification Prohibited"
}
]
}
},
"exceptions": null
}
],
"createdAt": "2021-09-20T20:05:35.925Z",
"createdBy": 2,
"description": null
}
],
"createdAt": "2021-09-21T18:49:34.021Z",
"updatedAt": "2021-09-21T18:49:34.021Z"
}curl \
--request POST \
--header "Content-Type: application/json" \
--header "Authorization: Bearer dea464c07bd07300095caa8" \
--data @example-payload.json \
https://demo.immuta.com/policy/global/applyPolicy{
"policyId": 1,
"dataSourceId": 1,
"merged": false
}curl \
--request PUT \
--header "Content-Type: application/json" \
--header "Authorization: Bearer dea464c07bd07300095caa8" \
--data @example-payload.json \
https://demo.immuta.com/policy/global/8{
"id": 8,
"policyKey": "Mask PII",
"name": "Mask PII",
"type": "data",
"template": false,
"staged": false,
"systemGenerated": false,
"deleted": false,
"certification": {
"tags": ["Discovered.PII"],
"text": "This certifies that all columns containing PII in this data source have been tagged appropriately.",
"label": "Certified"
},
"actions": [{
"type": "masking",
"rules": [{
"type": "masking",
"config": {
"fields": [{
"name": "Discovered.PII",
"source": "curated",
"hasLeafNodes": false,
"displayName": "Discovered > PII"
}],
"maskingConfig": {
"type": "Consistent Value",
"metadata": {}
}
},
"exceptions": null
}],
"description": "This policy masks all PII for data sources with columns tagged Discovered.PII."
}],
"circumstances": [{
"type": "columnTags",
"operator": "or",
"columnTag": {
"name": "Discovered.PII",
"hasLeafNodes": false,
"displayName": "Discovered > PII"
}
}],
"metadata": null,
"clonedFrom": null,
"createdBy": 2,
"createdAt": "2021-09-21T18:35:48.615Z",
"updatedAt": "2021-09-21T18:41:36.054Z",
"createdByName": "Katie",
"ownerRestrictions": null
}{
"id": 6,
"policyKey": "mask-pii",
"name": "Mask PII",
"type": "data",
"template": false,
"createdBy": 2,
"createdByName": "Kate",
"createdAt": "2021-09-14",
"updatedAt": "2021-09-15",
"actions": [
{
"type": "masking",
"rules": [
{
"type": "masking",
"exceptions": null,
"config": {
"fields": [
{
"name": "Discovered.PII",
"hasLeafNodes": false,
"source": "curated"
}
],
"maskingConfig": {
"type": "Consistent Value",
"metadata": {}
}
}
}
],
"description": "This policy masks all PII for data sources with columns tagged Discovered.PII."
}
],
"circumstances": [
{
"operator": "or",
"type": "columnTags",
"columnTag": {
"name": "Discovered.PII",
"hasLeafNodes": false
}
}
],
"clonedFrom": 0,
"staged": false,
"systemGenerated": false,
"deleted": false,
"certification": {
"label": "string",
"text": "string",
"tags": [
"string"
],
"recertify": false
}
}curl \
--request POST \
--header "Content-Type: application/json" \
--header "Authorization: Bearer dea464c07bd07300095caa8" \
https://demo.immuta.com/policy/search?scope=global&searchText=mask{
"count": 1,
"hits": [{
"name": "Mask PII",
"createdBy": "Katie",
"state": "active",
"isNotApplied": false,
"scope": "global",
"type": "data",
"globalPolicyId": 8,
"policyId": null,
"dataSourceId": null,
"createdAt": "2021-09-21T18:35:48.615Z",
"detailLabels": {
"ruleType": ["masking"],
"tags": ["Discovered.PII"]
},
"enforcedOn": {
"count": 1,
"hits": [{
"id": 1,
"name": "Public Credit Accounts"
}]
}
}]
}curl \
--request GET \
--header "Content-Type: application/json" \
--header "Authorization: Bearer dea464c07bd07300095caa8" \
https://demo.immuta.com/policy/global/1{
"id": 1,
"policyKey": "New Column Added",
"name": "New Column Added",
"type": "data",
"template": false,
"staged": false,
"systemGenerated": true,
"deleted": false,
"certification": null,
"actions": [
{
"type": "masking",
"rules": [
{
"type": "masking",
"config": {
"fields": [
{
"name": "New",
"source": "curated",
"hasLeafNodes": false
}
],
"maskingConfig": {
"type": "Consistent Value",
"metadata": {
"constant": null
}
}
},
"exceptions": null
}
],
"description": null
}
],
"circumstances": [
{
"type": "columnTags",
"operator": "or",
"columnTag": {
"name": "New",
"hasLeafNodes": false
}
}
],
"metadata": null,
"clonedFrom": null,
"createdBy": 1,
"createdAt": "2021-09-09T13:47:03.448Z",
"updatedAt": "2021-09-16T14:10:05.694Z",
"createdByName": "Immuta System Account",
"ownerRestrictions": null
}curl \
--request GET \
--header "Content-Type: application/json" \
--header "Authorization: Bearer dea464c07bd07300095caa8" \
https://demo.immuta.com/policy/global?nameOnly=true[
{
"name": "Mask PII",
"id": 6,
"type": "data"
},
{
"name": "New Column Added",
"id": 1,
"type": "data"
}
]curl \
--request GET \
--header "Content-Type: application/json" \
--header "Authorization: Bearer dea464c07bd07300095caa8" \
https://demo.immuta.com/policy/global/appliedTo/6{
"count": 1
}curl \
--request GET \
--header "Content-Type: application/json" \
--header "Authorization: Bearer dea464c07bd07300095caa8" \
https://demo.immuta.com/policy/dataSourcePolicies/2[
{
"type": "masking",
"rules": [
{
"type": "masking",
"config": {
"fields": [
"amount"
],
"maskingConfig": {
"type": "Consistent Value",
"metadata": {
"constant": null
}
}
},
"exceptions": null
}
],
"createdAt": "2021-09-20T20:03:18.001Z",
"createdBy": 2,
"description": null
},
{
"type": "masking",
"rules": [
{
"type": "masking",
"config": {
"fields": [
"geo_latitude"
],
"maskingConfig": {
"type": "Consistent Value",
"metadata": {}
}
},
"exceptions": null
}
],
"createdAt": "2021-09-20T20:02:02.213Z",
"createdBy": 2,
"description": null
},
{
"type": "prerequisite",
"rules": [
{
"type": "prerequisite",
"config": {
"qualifications": {
"operator": "and",
"conditions": [
{
"type": "purposes",
"value": "Re-identification Prohibited"
}
]
}
},
"exceptions": null
}
],
"createdAt": "2021-09-20T20:05:35.925Z",
"createdBy": 2,
"description": null
}
]curl \
--request GET \
--header "Content-Type: application/json" \
--header "Authorization: Bearer dea464c07bd07300095caa8" \
https://demo.immuta.com/policy/diff/3?currentHandlerId=47&previousHandlerId=46{
"current": [{
"type": "rowOrObjectRestriction",
"rules": [{
"type": "visibility",
"config": {
"predicate": "(`city` in (@groups()))",
"qualifications": {
"operator": "and",
"conditions": [{
"type": "groups",
"field": "city"
}]
}
},
"exceptions": null
}],
"createdAt": "2021-09-28T18:46:00.868Z",
"createdBy": 2,
"description": null
}],
"previous": [{
"type": "rowOrObjectRestriction",
"rules": [{
"type": "visibility",
"config": {
"predicate": "(`city` in (@groups()))",
"qualifications": {
"operator": "and",
"conditions": [{
"type": "groups",
"field": "city"
}]
}
},
"exceptions": null
}],
"createdAt": "2021-09-28T18:46:00.868Z",
"createdBy": 2,
"description": null
}],
"hasChanges": false
}curl \
--request GET \
--header "Content-Type: application/json" \
--header "Authorization: Bearer dea464c07bd07300095caa8" \
https://demo.immuta.com/policy/handler/1{
"id": 44,
"dataSourceId": 1,
"rules": "rule masking_0_0 { when { model_0_0 : MaskingModel ; } then { Masked(model_0_0, 0, 0) } } rule masking_5_0 { when { model_5_0 : MaskingModel ; } then { Masked(model_5_0, 5, 0) } } rule masking_6_0 { when { model_6_0 : MaskingModel ; } then { Masked(model_6_0, 6, 0) } }",
"jsonPolicies": [
{
"type": "masking",
"rules": [
{
"type": "masking",
"config": {
"fields": [
"email"
],
"maskingConfig": {
"type": "Consistent Value",
"metadata": {
"constant": null
}
}
},
"exceptions": null
}
],
"createdAt": "2021-09-21T19:27:27.589Z",
"createdBy": 2,
"description": null
},
{
"type": "masking",
"rules": [
{
"type": "masking",
"config": {
"fields": [
"email"
],
"maskingConfig": {
"type": "Consistent Value",
"metadata": {}
}
},
"exceptions": null
}
],
"global": {
"id": 0,
"tag": "Discovered.PII",
"name": "string",
"reason": "test",
"staged": false,
"deleted": false,
"conflict": "existingMasking",
"disabled": true,
"metadata": {
"HEDReportVersion": "string",
"certificationExpirationInterval": "string"
},
"template": false,
"createdAt": "2021-09-14T00:00:00.000Z",
"createdBy": "Katie",
"policyKey": "string",
"updatedAt": "2021-09-14T00:00:00.000Z",
"clonedFrom": 0,
"certification": true,
"createdByName": "Katie",
"changedOnApply": [],
"systemGenerated": false,
"ownerRestrictions": null
},
"description": null
},
{
"type": "masking",
"rules": [
{
"type": "masking",
"config": {
"fields": [
"last_name"
],
"maskingConfig": {
"type": "Consistent Value",
"metadata": {}
}
},
"exceptions": null
}
],
"global": {
"id": 0,
"tag": "Discovered.PII",
"name": "string",
"reason": "test",
"staged": false,
"deleted": false,
"conflict": null,
"disabled": true,
"metadata": {
"HEDReportVersion": "string",
"certificationExpirationInterval": "string"
},
"template": false,
"createdAt": "2021-09-14T00:00:00.000Z",
"createdBy": "Katie",
"policyKey": "string",
"updatedAt": "2021-09-14T00:00:00.000Z",
"clonedFrom": 0,
"certification": true,
"createdByName": "Katie",
"changedOnApply": [],
"systemGenerated": false,
"ownerRestrictions": null
},
"description": null
},
{
"type": "masking",
"rules": [
{
"type": "masking",
"config": {
"fields": [
"ssn"
],
"maskingConfig": {
"type": "Consistent Value",
"metadata": {}
}
},
"exceptions": null
}
],
"global": {
"id": 0,
"tag": "Discovered.PII",
"name": "string",
"reason": "test",
"staged": false,
"deleted": false,
"conflict": null,
"disabled": true,
"metadata": {
"HEDReportVersion": "string",
"certificationExpirationInterval": "string"
},
"template": false,
"createdAt": "2021-09-14T00:00:00.000Z",
"createdBy": "Katie",
"policyKey": "string",
"updatedAt": "2021-09-14T00:00:00.000Z",
"clonedFrom": 0,
"certification": true,
"createdByName": "Katie",
"changedOnApply": [],
"systemGenerated": false,
"ownerRestrictions": null
},
"description": null
},
{
"type": "masking",
"rules": [
{
"type": "masking",
"config": {
"fields": [
"email"
],
"maskingConfig": {
"type": "Consistent Value",
"metadata": {}
}
},
"exceptions": null
}
],
"global": {
"id": 8,
"tag": "Discovered.PII",
"name": "Mask PII",
"reason": null,
"staged": false,
"deleted": false,
"conflict": "existingMasking",
"disabled": true,
"metadata": null,
"template": false,
"createdAt": "2021-09-21T18:35:48.615Z",
"createdBy": "Katie",
"policyKey": "Mask PII",
"updatedAt": "2021-09-21T18:41:54.299Z",
"clonedFrom": null,
"certification": true,
"createdByName": "Katie",
"changedOnApply": [],
"systemGenerated": false,
"ownerRestrictions": null
},
"description": "This policy masks all PII for data sources with columns tagged Discovered.PII."
},
{
"type": "masking",
"rules": [
{
"type": "masking",
"config": {
"fields": [
"last_name"
],
"maskingConfig": {
"type": "Consistent Value",
"metadata": {}
}
},
"exceptions": null
}
],
"global": {
"id": 8,
"tag": "Discovered.PII",
"name": "Mask PII",
"reason": null,
"staged": false,
"deleted": false,
"conflict": null,
"disabled": false,
"metadata": null,
"template": false,
"createdAt": "2021-09-21T18:35:48.615Z",
"createdBy": "Katie",
"policyKey": "Mask PII",
"updatedAt": "2021-09-21T18:41:54.299Z",
"clonedFrom": null,
"certification": true,
"createdByName": "Katie",
"changedOnApply": [],
"systemGenerated": false,
"ownerRestrictions": null
},
"description": "This policy masks all PII for data sources with columns tagged Discovered.PII."
},
{
"type": "masking",
"rules": [
{
"type": "masking",
"config": {
"fields": [
"ssn"
],
"maskingConfig": {
"type": "Consistent Value",
"metadata": {}
}
},
"exceptions": null
}
],
"global": {
"id": 8,
"tag": "Discovered.PII",
"name": "Mask PII",
"reason": null,
"staged": false,
"deleted": false,
"conflict": null,
"disabled": false,
"metadata": null,
"template": false,
"createdAt": "2021-09-21T18:35:48.615Z",
"createdBy": "Katie",
"policyKey": "Mask PII",
"updatedAt": "2021-09-21T18:41:54.299Z",
"clonedFrom": null,
"certification": true,
"createdByName": "Katie",
"changedOnApply": [],
"systemGenerated": false,
"ownerRestrictions": null
},
"description": "This policy masks all PII for data sources with columns tagged Discovered.PII."
}
],
"createdAt": "2021-09-21T19:27:27.977Z",
"updatedAt": "2021-09-21T19:27:27.977Z"
}curl \
--request DELETE \
--header "Content-Type: application/json" \
--header "Authorization: Bearer dea464c07bd07300095caa8" \
https://demo.immuta.com/policy/global/6{
"id": 6,
"policyKey": "mask-pii",
"name": "Mask PII",
"type": "data",
"template": false,
"staged": false,
"systemGenerated": false,
"deleted": false,
"certification": {
"tags": [
"string"
],
"text": "string",
"label": "string"
},
"actions": [
{
"type": "masking",
"rules": [
{
"type": "masking",
"config": {
"fields": [
{
"name": "Discovered.PII",
"source": "curated",
"hasLeafNodes": false
}
],
"maskingConfig": {
"type": "Consistent Value",
"metadata": {}
}
},
"exceptions": null
}
],
"description": "This policy masks all PII for data sources with columns tagged Discovered.PII."
}
],
"circumstances": [
{
"type": "columnTags",
"operator": "or",
"columnTag": {
"name": "Discovered.PII",
"hasLeafNodes": false
}
}
],
"metadata": null,
"clonedFrom": 0,
"createdBy": 2,
"createdAt": "2021-09-14T00:00:00.000Z",
"updatedAt": "2021-09-15T18:46:17.661Z",
"createdByName": "Katie",
"ownerRestrictions": null
}