Skip to content

Ensure Has PII tag and value

Description

Rationale

Applies To

  • Tags

Tags

This rule applies to all tags.

Default Rule

/**
 * @param {Object} databaseTags - database tags
 * @param [databaseTags.values] values - database tags array
 * @returns {boolean} true if database instance is using 'tagged-with-pii' tag
 */
function validate(databaseTags) {
    const tagName = "secureclouddb/tagged-with-pii"
    const tag = databaseTags.values && databaseTags.values.find(t => t.key === tagName)
    const success = tag && tag.value !== undefined

    return {
        success,
    }
}

// invoke
validate(databaseTags);