TMA-MSSQL2022-6.2
Ensure 'CLR Assembly Permission Set' is set to 'SAFE_ACCESS' for All CLR Assemblies
説明
Setting CLR Assembly Permission Sets to SAFE_ACCESS will hinder assemblies from accessing external system resources such as files, the network, environment variables, or the registry. Assemblies with EXTERNAL_ACCESS or UNSAFE permission sets can be used to access sensitive areas of the operating system, steal and/or transmit data and alter the state and other protection measures of the underlying Windows Operating System. Assemblies which are part of core SQL Server Engine (is_user_defined = 0) are excluded from this check as they are required for overall system functionality.
チェック方法
監査方法: SQL クエリ
sqlcmd -b -h -1 -W -Q "SET NOCOUNT ON; DECLARE @n int = 0, @k int, @db sysname, @s nvarchar(max); DECLARE c CURSOR LOCAL FAST_FORWARD FOR SELECT name FROM sys.databases WHERE state = 0 AND HAS_DBACCESS(name) = 1; OPEN c; FETCH NEXT FROM c INTO @db; WHILE @@FETCH_STATUS = 0 BEGIN SET @s = N'USE ' + QUOTENAME(@db) + N'; SELECT @k = COUNT(*) FROM (SELECT name FROM sys.assemblies WHERE is_user_defined = 1 AND permission_set_desc <> ''SAFE_ACCESS'') AS x;'; EXEC sp_executesql @s, N'@k int OUTPUT', @k = @k OUTPUT; SET @n = @n + @k; FETCH NEXT FROM c INTO @db; END; CLOSE c; DEALLOCATE c; SELECT @n;"- 期待される出力
0
修正方法
修正方法: ガイダンスまたは IaC パッチ
USE <database_name>; GO ALTER ASSEMBLY <assembly_name> WITH PERMISSION_SET = SAFE;
プロパティ
- オペレーティングシステム
- すべて
- タグ
- access-controlmssqlsqlserver-2022
- 参照
- CIS Microsoft SQL Server 2022 Benchmark v1.3.0 - 6.2 Ensure 'CLR Assembly Permission Set' is set to 'SAFE_ACCESS' for All CLR Assemblies
このホストをチェック
監査が許可されているマシンで実行してください。スキャンは読み取り専用です。
tmaegis scan --target mssql