STIGhubSTIGhub
STIGhub— A free STIG search and compliance tool·STIGs updated 1 hour ago
Powered by Pylon·Privacy·Terms·Feedback·© 2026 Beacon Cloud Solutions, Inc.
← Back to Oracle MySQL 9.x Security Technical Implementation Guide

V-289302

CAT II (Medium)

Database contents must be protected from unauthorized and unintended information transfer by enforcement of a data-transfer policy.

Rule ID

SV-289302r1319219_rule

STIG

Oracle MySQL 9.x Security Technical Implementation Guide

Version

V1R1

CCIs

CCI-001090

Discussion

Database content can be exposed through direct queries, alternate tools, or application paths even when applications attempt to suppress or transform sensitive data. Where policy requires masking of protected data elements in query results, relying only on application-side masking is insufficient because alternate query paths may still reveal the original values. MySQL Database Server 9.x can enforce masking within the server by applying masking policies to protected columns. A masking policy can evaluate organization-authorized users and/or organization-authorized active roles and return either the original value or a transformed value. Server-enforced masking provides consistent behavior across applications and query paths and reduces the risk of unauthorized disclosure of protected data such as Social Security Numbers (SSNs), Personally Identifiable Information (PII), Protected Health Information (PHI), and other sensitive elements designated by policy.

Check Content

Review the system documentation to identify tables and columns containing sensitive data elements that are required by policy to be masked in query results.

Review the MySQL 9.x configuration and metadata for protected columns. Verify that each sensitive column requiring masking has an approved masking policy applied at the server level.

Review masking policy definitions to verify that masking is based on organization-authorized users and/or organization-authorized active roles. Verify that unauthorized sessions receive masked values and only organization-authorized users or sessions with organization-authorized active roles are able to receive unmasked values.

Review the applied policy logic for each protected column. Examples of acceptable gatekeeper logic include CURRENT_USER_IN("organization-authorized user") and CURRENT_ROLE_IN("organization-authorized role"). Examples of acceptable masking functions include "mask_ssn()" or other approved transformations appropriate to the data type.

Example verification workflow:
1. Review the masking policy definition for the protected column.
2. Review the "ALTER TABLE...ALTER COLUMN...SET MASKING POLICY" statement or equivalent metadata.
3. Query the protected data as an unauthorized user or a session without the required active role and verify the returned value is masked.
4. Query the protected data as an organization-authorized user or a session with the required active role and verify the returned value is unmasked only when policy permits.

If a sensitive column requiring masking has no server-enforced masking policy, this is a finding.

If unauthorized sessions receive unmasked values, this is a finding.

If masking is implemented only in application code and not enforced by MySQL for data designated by policy to require masking, this is a finding.

Fix Text

For each sensitive column designated by policy for masking, define and apply a MySQL 9.x masking policy that returns the original value only for organization-authorized users and/or organization-authorized active roles and returns a transformed value for all other sessions.

Example user-based masking policy:
CREATE MASKING POLICY mask_ssn_policy(ssn_col)
  CASE WHEN CURRENT_USER_IN('organization-authorized user')
       THEN ssn_col
       ELSE mask_ssn(ssn_col)
  END;

Apply the policy to the protected column:
ALTER TABLE protected.user_profiles
  ALTER COLUMN ssn
  SET MASKING POLICY mask_ssn_policy;

Example role-based masking policy:
CREATE MASKING POLICY mask_ssn_policy(ssn_col)
  CASE WHEN CURRENT_ROLE_IN('organization-authorized role')
       THEN ssn_col
       ELSE mask_ssn(ssn_col)
  END;

Grant access to the organization-authorized role only to approved users and activate the role in accordance with site policy. Retest by querying the protected column as both authorized and unauthorized sessions and verify that unauthorized sessions receive masked output and authorized sessions receive unmasked output only as permitted.