DTSProtectionLevel 列挙型

定義

パッケージ内の機密情報の取り扱いを制御します。

public enum class DTSProtectionLevel
public enum DTSProtectionLevel
type DTSProtectionLevel = 
Public Enum DTSProtectionLevel
継承
DTSProtectionLevel

フィールド

名前 説明
DontSaveSensitive 0

機密情報はパッケージに保存されません。 機密情報は削除され、空白に置き換えられます。

EncryptSensitiveWithUserKey 1

現在のユーザーに基づく鍵のみを用いて機密性を暗号化します。 同じプロファイルを使う同じユーザーだけがパッケージを読み込めます。 別のユーザーがパッケージを開くと、機密情報は空白に置き換えられます。 暗号化処理には、DPAPI が使用されます。

EncryptSensitiveWithPassword 2

パッケージ内の機密情報のみをパスワードで暗号化します。 暗号化処理には、DPAPI が使用されます。

EncryptAllWithPassword 3

パスワードを使ってパッケージ全体を暗号化します。

EncryptAllWithUserKey 4

ユーザープロファイルに基づく鍵を使ってパッケージ全体を暗号化します。 同じプロファイルを使う同じユーザーだけがパッケージを読み込めます。

ServerStorage 5

パッケージをSQL Serverのmsdbデータベース内で暗号化します。 このオプションはパッケージがSQL Serverに保存されている場合のみサポートされます。 パッケージがファイルシステムに保存されている場合はサポートされません。 パッケージを復号できる権限のアクセス制御はSQL Serverのデータベースロールによって制御されます。 詳細については、Database-Level Roles and sysssispackages (Transact-SQL) をご覧ください。

以下の例ではパッケージを読み込み、その後、パッケージに割り当てられた ProtectionLevel を含むいくつかのパッケージプロパティを取得します。

Class PackageTest  
    {  
        static void Main(string[] args)  
        {  
            // The variable pkg points to the location of the  
            // ExecuteProcess package sample  
            // installed with the samples.  
            string pkg = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx";  

            Application app = new Application();  
            Package p = app.LoadPackage(pkg, null);  

            // Once the package is loaded, this sample can  
           // query on several properties  
            long cc = p.CertificateContext;  
            string cfn = p.CheckpointFileName;  
            DTSProtectionLevel pl = p.ProtectionLevel;  
            DTSPackageType dpt = p.PackageType;  

            Console.WriteLine("CertificateContext = " + cc);  
            Console.WriteLine("CheckpointFileName = " + cfn);  
            Console.WriteLine("ProtectionLevel = " + pl);  
            Console.WriteLine("PackageType = " + dpt);  
        }  
    }  
Class PackageTest  
    {  
        Shared  Sub Main(ByVal args() As String)  
            ' The variable pkg points to the location of the  
            ' ExecuteProcess package sample  
            ' installed with the samples.  
            Dim pkg As String =  "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx"   

            Dim app As Application =  New Application()   
            Dim p As Package =  app.LoadPackage(pkg,Nothing)   

            ' Once the package is loaded, this sample can  
           ' query on several properties  
            Dim cc As Long =  p.CertificateContext   
            Dim cfn As String =  p.CheckpointFileName   
            Dim pl As DTSProtectionLevel =  p.ProtectionLevel   
            Dim dpt As DTSPackageType =  p.PackageType   

            Console.WriteLine("CertificateContext = " + cc)  
            Console.WriteLine("CheckpointFileName = " + cfn)  
            Console.WriteLine("ProtectionLevel = " + pl)  
            Console.WriteLine("PackageType = " + dpt)  
        End Sub  
    }  

出力例:

CertificateContext = 0

CheckpointFileName =

ProtectionLevel = EncryptSensitiveWithUserKey

PackageType = Default

注釈

DontSaveSensitiveを使用する場合、パッケージ内に機密情報が含まれている場合、その機密情報は保存されません。 これが既定値です。

すべての値に対して、機密情報は次のように定義されます:

  • 接続文字列のパスワード部分です。 しかし、すべてを暗号化するオプションを選ぶと、接続文字列全体が機密扱いになります。

  • Sensitive属性でタグ付けされたタスク生成XMLノードです。

  • Sensitive属性でマークされた任意の変数。

設定ファイルに機密情報が含まれている場合は、Microsoft SQL Serverに保存するか、アクセス制御リスト(ACL)を使って場所やフォルダを保護してください。 詳細については、「 パッケージ構成を作成する」を参照してください。

パッケージ保護レベルの設定に関する詳細は、「パッケージ内の機密データAccess Control」をご覧ください。

暗号化は2つの方法で行われます。 暗号API(Crypto API)の一部であるMicrosoftデータ保護API(DPAPI)は、EncryptAllWithUserKeyおよびEncryptSensitiveWithUserKeyの保護レベルに使用されます。 TripleDESクラスはEncryptAllWithPasswordEncryptSensitiveWithPasswordの保護レベルに用いられます。

詳細については、.NETフレームワーククラスライブラリのTripleDESクラスを参照してください。

適用対象