SQL Server must protect against a user falsely repudiating by use of system-versioned tables (Temporal Tables).

From MS SQL Server 2016 Database Security Technical Implementation Guide

Part of SRG-APP-000080-DB-000063

Associated with: CCI-000166

SV-93775r1_rule SQL Server must protect against a user falsely repudiating by use of system-versioned tables (Temporal Tables).

Vulnerability discussion

Non-repudiation of actions taken is required in order to maintain data integrity. Examples of particular actions taken by individuals include creating information, sending a message, approving information (e.g., indicating concurrence or signing a contract), and receiving a message.Non-repudiation protects against later claims by a user of not having created, modified, or deleted a particular data item or collection of data in the database. In designing a database, the organization must define the types of data and the user actions that must be protected from repudiation. The implementation must then include building audit features into the application data tables and configuring SQL Server's audit tools to capture the necessary audit trail. Design and implementation also must ensure that applications pass individual user identification to SQL Server, even where the application connects to SQL Server with a standard, shared account. Applications should use temporal tables to track the changes and history of sensitive data.

Check content

Check the server documentation to determine if collecting and keeping historical versions of a table is required. If not, this is not a finding. Find all of the temporal tables in the database using the following query: SELECT SCHEMA_NAME(T.schema_id) AS schema_name, T.name AS table_name, T.temporal_type_desc, SCHEMA_NAME(H.schema_id) + '.' + H.name AS history_table FROM sys.tables T JOIN sys.tables H ON T.history_table_id = H.object_id WHERE T.temporal_type != 0 ORDER BY schema_name, table_name Using the system documentation, determine which tables are required to be temporal tables. If any tables listed in the documentation are not in the above list, this is a finding. Ensure a field exists documenting the login and/or user who last modified the record. If this does not exist, this is a finding. Review the system documentation to determine the history retention period. Navigate to the table in Object Explorer >> Right-click on the table and select Script Table As >> CREATE To >> New Query Editor Window Locate the line that contains "SYSTEM_VERSIONING". Locate the text that states "HISTORY_RETENTION_PERIOD". If this text is missing, or is set to a value less than the documented history retention period, this is a finding.

Fix text

Alter sensitive tables to utilize system versioning. Alter non-temporal table to define periods for system versioning .  ALTER TABLE InsurancePolicy   ADD PERIOD FOR SYSTEM_TIME (SysStartTime, SysEndTime),   SysStartTime datetime2 GENERATED ALWAYS AS ROW START HIDDEN NOT NULL DEFAULT GETUTCDATE(),   SysEndTime datetime2 GENERATED ALWAYS AS ROW END HIDDEN NOT NULL DEFAULT CONVERT(DATETIME2, '9999-12-31 23:59:59.99999999');   Enable system versioning with 1-year retention for historical data. ALTER TABLE InsurancePolicy SET (SYSTEM_VERSIONING = ON (HISTORY_RETENTION_PERIOD = 1 YEAR)); https://msdn.microsoft.com/en-us/library/ms190273.aspx#Anchor_16

Pro Tips

Lavender hyperlinks in small type off to the right (of CSS class id, if you view the page source) point to globally unique URIs for each document and item. Copy the link location and paste anywhere you need to talk unambiguously about these things.

You can obtain data about documents and items in other formats. Simply provide an HTTP header Accept: text/turtle or Accept: application/rdf+xml.

Powered by sagemincer