RegistrySecurity クラス

定義

レジストリ キーの Windows アクセス制御セキュリティを表します。 このクラスは継承できません。

public ref class RegistrySecurity sealed : System::Security::AccessControl::NativeObjectSecurity
public sealed class RegistrySecurity : System.Security.AccessControl.NativeObjectSecurity
[System.Security.SecurityCritical]
public sealed class RegistrySecurity : System.Security.AccessControl.NativeObjectSecurity
type RegistrySecurity = class
    inherit NativeObjectSecurity
[<System.Security.SecurityCritical>]
type RegistrySecurity = class
    inherit NativeObjectSecurity
Public NotInheritable Class RegistrySecurity
Inherits NativeObjectSecurity
継承
属性

このセクションには、2 つのコード例が含まれています。 最初の例では、追加と削除時に互換性のあるルールがどのようにマージされるかを示し、2 番目の例では、継承フラグと伝達フラグがルールの追加と削除にどのように影響するかを示しています。

例 1

次のコード例は、 メソッドが RemoveAccessRule 互換性のあるルールから権限を削除する方法と、メソッドが AddAccessRule 互換性のあるルールと権限をマージする方法を示しています。

この例では、 オブジェクトを RegistrySecurity 作成し、現在のユーザー RegistryRights.ReadKey 権限を許可するルールを追加します。 次に、最初のルールと同じ継承と伝達権限を持つ ユーザー RegistryRights.SetValueに を付与し、 メソッドを RemoveAccessRule 使用してこの新しいルールを オブジェクトから削除するルールを RegistrySecurity 作成します。 SetValue は の ReadKey構成要素であるため、互換性のある規則から削除されます。 オブジェクト内のルールが RegistrySecurity 表示され、 の残りの構成要素が ReadKey表示されます。

次に、コード例は メソッドを AddAccessRule 呼び出して、右を SetValue オブジェクトのルールに RegistrySecurity マージします。

Note

この例では、セキュリティ オブジェクトを オブジェクトに RegistryKey アタッチしません。 このセクションの 2 番目の例では、セキュリティ オブジェクトをアタッチします。また、 と RegistryKey.SetAccessControlRegistryKey.GetAccessControl例も同様です。


using System;
using System.Security.AccessControl;
using System.Security.Principal;
using System.Security;
using Microsoft.Win32;

public class Example
{

    public static void Main()
    {

        string user = Environment.UserDomainName + "\\"
            + Environment.UserName;

        // Create a security object that grants no access.
        RegistrySecurity mSec = new RegistrySecurity();

        // Add a rule that grants the current user ReadKey
        // rights. ReadKey is a combination of four other 
        // rights. The rule is inherited by all 
        // contained subkeys.
        RegistryAccessRule rule = new RegistryAccessRule(user, 
            RegistryRights.ReadKey, 
            InheritanceFlags.ContainerInherit, 
            PropagationFlags.None, 
            AccessControlType.Allow);
        mSec.AddAccessRule(rule);

        // Create a rule that allows the current user only the 
        // right to query the key/value pairs of a key, using  
        // the same inheritance and propagation flags as the
        // first rule. QueryValues is a constituent of 
        // ReadKey, so when this rule is removed, using the 
        // RemoveAccessRule method, ReadKey is broken into
        // its constituent parts.
        rule = new RegistryAccessRule(user, 
            RegistryRights.QueryValues, 
            InheritanceFlags.ContainerInherit, 
            PropagationFlags.None, 
            AccessControlType.Allow);
        mSec.RemoveAccessRule(rule);

        // Display the rules in the security object.
        ShowSecurity(mSec);

        // Add the second rule back. It merges with the 
        // existing rule, so that the rule is now displayed
        // as ReadKey.
        mSec.AddAccessRule(rule);

        // Display the rules in the security object.
        ShowSecurity(mSec);
    }

    private static void ShowSecurity(RegistrySecurity security)
    {
        Console.WriteLine("\r\nCurrent access rules:\r\n");

        foreach( RegistryAccessRule ar in security.GetAccessRules(true, true, typeof(NTAccount)) )
        {
            Console.WriteLine("        User: {0}", ar.IdentityReference);
            Console.WriteLine("        Type: {0}", ar.AccessControlType);
            Console.WriteLine("      Rights: {0}", ar.RegistryRights);
            Console.WriteLine(" Inheritance: {0}", ar.InheritanceFlags);
            Console.WriteLine(" Propagation: {0}", ar.PropagationFlags);
            Console.WriteLine("   Inherited? {0}", ar.IsInherited);
            Console.WriteLine();
        }
    }
}

/* This code example produces output similar to following:

Current access rules:

        User: TestDomain\TestUser
        Type: Allow
      Rights: EnumerateSubKeys, Notify, ReadPermissions
 Inheritance: ContainerInherit
 Propagation: None
   Inherited? False


Current access rules:

        User: TestDomain\TestUser
        Type: Allow
      Rights: ReadKey
 Inheritance: ContainerInherit
 Propagation: None
   Inherited? False
 */
Option Explicit
Imports System.Security.AccessControl
Imports System.Security.Principal
Imports System.Security
Imports Microsoft.Win32

Public Class Example

    Public Shared Sub Main()

        Dim user As String = Environment.UserDomainName _ 
            & "\" & Environment.UserName

        ' Create a security object that grants no access.
        Dim mSec As New RegistrySecurity()

        ' Add a rule that grants the current user ReadKey
        ' rights. ReadKey is a combination of four other 
        ' rights. The rule is inherited by all 
        ' contained subkeys.
        Dim rule As New RegistryAccessRule(user, _
            RegistryRights.ReadKey, _
            InheritanceFlags.ContainerInherit, _
            PropagationFlags.None, _
            AccessControlType.Allow)
        mSec.AddAccessRule(rule)

        ' Create a rule that allows the current user only the 
        ' right to query the key/value pairs of a key, using  
        ' the same inheritance and propagation flags as the
        ' first rule. QueryValues is a constituent of 
        ' ReadKey, so when this rule is removed, using the 
        ' RemoveAccessRule method, ReadKey is broken into
        ' its constituent parts.
        rule = New RegistryAccessRule(user, _
            RegistryRights.QueryValues, _
            InheritanceFlags.ContainerInherit, _
            PropagationFlags.None, _
            AccessControlType.Allow)
        mSec.RemoveAccessRule(rule)

        ' Display the rules in the security object.
        ShowSecurity(mSec)

        ' Add the second rule back. It merges with the 
        ' existing rule, so that the rule is now displayed
        ' as ReadKey.
        mSec.AddAccessRule(rule)

        ' Display the rules in the security object.
        ShowSecurity(mSec)

    End Sub 

    Private Shared Sub ShowSecurity(ByVal security As RegistrySecurity)
        Console.WriteLine(vbCrLf & "Current access rules:" & vbCrLf)

        For Each ar As RegistryAccessRule In _
            security.GetAccessRules(True, True, GetType(NTAccount))

            Console.WriteLine("        User: {0}", ar.IdentityReference)
            Console.WriteLine("        Type: {0}", ar.AccessControlType)
            Console.WriteLine("      Rights: {0}", ar.RegistryRights)
            Console.WriteLine(" Inheritance: {0}", ar.InheritanceFlags)
            Console.WriteLine(" Propagation: {0}", ar.PropagationFlags)
            Console.WriteLine("   Inherited? {0}", ar.IsInherited)
            Console.WriteLine()
        Next

    End Sub
End Class 

'This code example produces output similar to following:
'
'Current access rules:
'
'        User: TestDomain\TestUser
'        Type: Allow
'      Rights: EnumerateSubKeys, Notify, ReadPermissions
' Inheritance: ContainerInherit
' Propagation: None
'   Inherited? False
'
'
'Current access rules:
'
'        User: TestDomain\TestUser
'        Type: Allow
'      Rights: ReadKey
' Inheritance: ContainerInherit
' Propagation: None
'   Inherited? False
'

例 2

次のコード例では、継承と伝達を使用したアクセス規則を示します。 この例では、 オブジェクトを RegistrySecurity 作成し、 フラグを持つ 2 つのルールを作成して ContainerInherit 追加します。 最初のルールには伝達フラグがありませんが、2 番目のルールには と InheritOnlyがありますNoPropagateInherit

プログラムは オブジェクトにルールを RegistrySecurity 表示し、 オブジェクトを RegistrySecurity 使用してサブキーを作成します。 プログラムは、子サブキーと孫サブキーを作成し、各サブキーのセキュリティを表示します。 最後に、プログラムによってテスト キーが削除されます。


using System;
using System.Security.AccessControl;
using System.Security.Principal;
using System.Security;
using Microsoft.Win32;

public class Example
{
    public static void Main()
    {
        const string TestKey = "TestKey3927";
        RegistryKey cu = Registry.CurrentUser;

        string user = Environment.UserDomainName + 
            "\\" + Environment.UserName;

        // Create a security object that grants no access.
        RegistrySecurity mSec = new RegistrySecurity();

        // Add a rule that grants the current user the right
        // to read and enumerate the name/value pairs in a key, 
        // to read its access and audit rules, to enumerate
        // its subkeys, to create subkeys, and to delete the key. 
        // The rule is inherited by all contained subkeys.
        //
        RegistryAccessRule rule = new RegistryAccessRule(user, 
           RegistryRights.ReadKey | RegistryRights.WriteKey 
               | RegistryRights.Delete, 
           InheritanceFlags.ContainerInherit, 
           PropagationFlags.None, 
           AccessControlType.Allow
        );
        mSec.AddAccessRule(rule);

        // Add a rule that allows the current user the right
        // right to set the name/value pairs in a key. 
        // This rule is inherited by contained subkeys, but
        // propagation flags limit it to immediate child 
        // subkeys.
        rule = new RegistryAccessRule(user, 
            RegistryRights.ChangePermissions, 
            InheritanceFlags.ContainerInherit, 
            PropagationFlags.InheritOnly | 
                PropagationFlags.NoPropagateInherit, 
            AccessControlType.Allow);
        mSec.AddAccessRule(rule);

        // Display the rules in the security object.
        ShowSecurity(mSec);

        // Create the test key using the security object.
        //
        RegistryKey rk = cu.CreateSubKey(TestKey, 
            RegistryKeyPermissionCheck.ReadWriteSubTree, mSec);

        // Create a child subkey and a grandchild subkey, 
        // without security.
        RegistryKey rkChild = rk.CreateSubKey("ChildKey", 
            RegistryKeyPermissionCheck.ReadWriteSubTree);
        RegistryKey rkGrandChild = 
            rkChild.CreateSubKey("GrandChildKey", 
                RegistryKeyPermissionCheck.ReadWriteSubTree);

        Show(rk);
        Show(rkChild);
        Show(rkGrandChild);

        rkGrandChild.Close();
        rkChild.Close();
        rk.Close();

        cu.DeleteSubKeyTree(TestKey);
    }

    private static void Show(RegistryKey rk)
    {
        Console.WriteLine(rk.Name);
        ShowSecurity(rk.GetAccessControl());
    }

    private static void ShowSecurity(RegistrySecurity security)
    {
        Console.WriteLine("\r\nCurrent access rules:\r\n");

        foreach( RegistryAccessRule ar in security.GetAccessRules(true, true, typeof(NTAccount)) )
        {

            Console.WriteLine("        User: {0}", ar.IdentityReference);
            Console.WriteLine("        Type: {0}", ar.AccessControlType);
            Console.WriteLine("      Rights: {0}", ar.RegistryRights);
            Console.WriteLine(" Inheritance: {0}", ar.InheritanceFlags);
            Console.WriteLine(" Propagation: {0}", ar.PropagationFlags);
            Console.WriteLine("   Inherited? {0}", ar.IsInherited);
            Console.WriteLine();
        }
    }
}

/* This code example produces output similar to following:

Current access rules:

        User: TestDomain\TestUser
        Type: Allow
      Rights: SetValue, CreateSubKey, Delete, ReadKey
 Inheritance: ContainerInherit
 Propagation: None
   Inherited? False

        User: TestDomain\TestUser
        Type: Allow
      Rights: ChangePermissions
 Inheritance: ContainerInherit
 Propagation: NoPropagateInherit, InheritOnly
   Inherited? False

HKEY_CURRENT_USER\TestKey3927

Current access rules:

        User: TestDomain\TestUser
        Type: Allow
      Rights: SetValue, CreateSubKey, Delete, ReadKey
 Inheritance: ContainerInherit
 Propagation: None
   Inherited? False

        User: TestDomain\TestUser
        Type: Allow
      Rights: ChangePermissions
 Inheritance: ContainerInherit
 Propagation: NoPropagateInherit, InheritOnly
   Inherited? False

HKEY_CURRENT_USER\TestKey3927\ChildKey

Current access rules:

        User: TestDomain\TestUser
        Type: Allow
      Rights: SetValue, CreateSubKey, Delete, ReadKey
 Inheritance: ContainerInherit
 Propagation: None
   Inherited? True

        User: TestDomain\TestUser
        Type: Allow
      Rights: ChangePermissions
 Inheritance: None
 Propagation: None
   Inherited? True

HKEY_CURRENT_USER\TestKey3927\ChildKey\GrandChildKey

Current access rules:

        User: TestDomain\TestUser
        Type: Allow
      Rights: SetValue, CreateSubKey, Delete, ReadKey
 Inheritance: ContainerInherit
 Propagation: None
   Inherited? True
 */
Option Explicit
Imports System.Security.AccessControl
Imports System.Security.Principal
Imports System.Security
Imports Microsoft.Win32

Public Class Example

    Public Shared Sub Main()

        Const TestKey As String = "TestKey3927"
        Dim cu As RegistryKey = Registry.CurrentUser

        Dim user As String = Environment.UserDomainName _ 
            & "\" & Environment.UserName

        ' Create a security object that grants no access.
        Dim mSec As New RegistrySecurity()

        ' Add a rule that grants the current user the right
        ' to read and enumerate the name/value pairs in a key, 
        ' to read its access and audit rules, to enumerate
        ' its subkeys, to create subkeys, and to delete the key. 
        ' The rule is inherited by all contained subkeys.
        '
        Dim rule As New RegistryAccessRule(user, _
            RegistryRights.ReadKey Or RegistryRights.WriteKey _
                Or RegistryRights.Delete, _
            InheritanceFlags.ContainerInherit, _
            PropagationFlags.None, _
            AccessControlType.Allow)
        mSec.AddAccessRule(rule)

        ' Add a rule that allows the current user the right
        ' right to set the name/value pairs in a key. 
        ' This rule is inherited by contained subkeys, but
        ' propagation flags limit it to immediate child 
        ' subkeys.
        rule = New RegistryAccessRule(user, _
            RegistryRights.ChangePermissions, _
            InheritanceFlags.ContainerInherit, _
            PropagationFlags.InheritOnly Or PropagationFlags.NoPropagateInherit, _
            AccessControlType.Allow)
        mSec.AddAccessRule(rule)

        ' Display the rules in the security object.
        ShowSecurity(mSec)

        ' Create the test key using the security object.
        '
        Dim rk As RegistryKey = cu.CreateSubKey(TestKey, _
            RegistryKeyPermissionCheck.ReadWriteSubTree, _
            mSec)

        ' Create a child subkey and a grandchild subkey, 
        ' without security.
        Dim rkChild As RegistryKey= rk.CreateSubKey("ChildKey", _
            RegistryKeyPermissionCheck.ReadWriteSubTree)
        Dim rkGrandChild As RegistryKey = _
            rkChild.CreateSubKey("GrandChildKey", _
                RegistryKeyPermissionCheck.ReadWriteSubTree)

        Show(rk)
        Show(rkChild)
        Show(rkGrandChild)

        rkGrandChild.Close()
        rkChild.Close()
        rk.Close()

        cu.DeleteSubKeyTree(TestKey)
    End Sub 

    Private Shared Sub Show(ByVal rk As RegistryKey)
        Console.WriteLine(rk.Name)            
        ShowSecurity(rk.GetAccessControl())
    End Sub

    Private Shared Sub ShowSecurity(ByVal security As RegistrySecurity)
        Console.WriteLine(vbCrLf & "Current access rules:" & vbCrLf)

        For Each ar As RegistryAccessRule In _
            security.GetAccessRules(True, True, GetType(NTAccount))

            Console.WriteLine("        User: {0}", ar.IdentityReference)
            Console.WriteLine("        Type: {0}", ar.AccessControlType)
            Console.WriteLine("      Rights: {0}", ar.RegistryRights)
            Console.WriteLine(" Inheritance: {0}", ar.InheritanceFlags)
            Console.WriteLine(" Propagation: {0}", ar.PropagationFlags)
            Console.WriteLine("   Inherited? {0}", ar.IsInherited)
            Console.WriteLine()
        Next

    End Sub
End Class 

'This code example produces output similar to following:
'
'Current access rules:
'
'        User: TestDomain\TestUser
'        Type: Allow
'      Rights: SetValue, CreateSubKey, Delete, ReadKey
' Inheritance: ContainerInherit
' Propagation: None
'   Inherited? False
'
'        User: TestDomain\TestUser
'        Type: Allow
'      Rights: ChangePermissions
' Inheritance: ContainerInherit
' Propagation: NoPropagateInherit, InheritOnly
'   Inherited? False
'
'HKEY_CURRENT_USER\TestKey3927
'
'Current access rules:
'
'        User: TestDomain\TestUser
'        Type: Allow
'      Rights: SetValue, CreateSubKey, Delete, ReadKey
' Inheritance: ContainerInherit
' Propagation: None
'   Inherited? False
'
'        User: TestDomain\TestUser
'        Type: Allow
'      Rights: ChangePermissions
' Inheritance: ContainerInherit
' Propagation: NoPropagateInherit, InheritOnly
'   Inherited? False
'
'HKEY_CURRENT_USER\TestKey3927\ChildKey
'
'Current access rules:
'
'        User: TestDomain\TestUser
'        Type: Allow
'      Rights: SetValue, CreateSubKey, Delete, ReadKey
' Inheritance: ContainerInherit
' Propagation: None
'   Inherited? True
'
'        User: TestDomain\TestUser
'        Type: Allow
'      Rights: ChangePermissions
' Inheritance: None
' Propagation: None
'   Inherited? True
'
'HKEY_CURRENT_USER\TestKey3927\ChildKey\GrandChildKey
'
'Current access rules:
'
'        User: TestDomain\TestUser
'        Type: Allow
'      Rights: SetValue, CreateSubKey, Delete, ReadKey
' Inheritance: ContainerInherit
' Propagation: None
'   Inherited? True

注釈

オブジェクトは RegistrySecurity 、レジストリ キーのアクセス権を指定し、アクセス試行の監査方法も指定します。 レジストリ キーへのアクセス権はルールとして表され、各アクセス規則は オブジェクトによって RegistryAccessRule 表されます。 各監査規則は、 オブジェクトによって RegistryAuditRule 表されます。

これにより、セキュリティ保護可能な各オブジェクトに、セキュリティで保護されたオブジェクトへのアクセスを制御する任意のアクセス制御リスト (DACL) が最大 1 つ、監査対象のアクセス試行を指定するシステム アクセス制御リスト (SACL) が 1 つ以上ある、基になる Windows セキュリティ システムが反映されます。 DACL と SACL は、ユーザーとグループのアクセスと監査を指定するアクセス制御エントリ (ACE) の順序付けされたリストです。 RegistryAccessRuleまたは RegistryAuditRule オブジェクトが複数の ACE を表している場合があります。

Note

Windows アクセス制御のセキュリティは、レジストリ キーにのみ適用できます。 キーに格納されている個々のキーと値のペアには適用できません。

RegistryAccessRule、および クラスはRegistrySecurity、ACL と RegistryAuditRule ACE の実装の詳細を非表示にします。 これにより、17 種類の ACE と、継承とアクセス権の伝達を正しく維持する複雑さを無視できます。 これらのオブジェクトは、次の一般的なアクセス制御エラーを防ぐためにも設計されています。

  • NULL DACL を使用してセキュリティ記述子を作成する。 DACL への null 参照を使用すると、すべてのユーザーがオブジェクトにアクセス 規則を追加でき、サービス拒否攻撃が発生する可能性があります。 新しい RegistrySecurity オブジェクトは常に空の DACL で始まり、すべてのユーザーのすべてのアクセスが拒否されます。

  • ACE の正規順序に違反しています。 DACL の ACE リストが正規の順序で保持されていない場合、ユーザーに誤ってセキュリティで保護されたオブジェクトへのアクセス権が与えられる可能性があります。 たとえば、拒否されたアクセス権は、許可されたアクセス権の前に常に表示される必要があります。 RegistrySecurity オブジェクトは内部的に正しい順序を維持します。

  • セキュリティ記述子フラグの操作。これは、リソース マネージャーの制御下でのみ必要です。

  • ACE フラグの無効な組み合わせを作成しています。

  • 継承された ACE の操作。 継承と伝達は、アクセス規則と監査規則に対する変更に応じて、リソース マネージャーによって処理されます。

  • ACL への無意味な ACE の挿入。

.NET セキュリティ オブジェクトでサポートされていない唯一の機能は、次のようなアプリケーション開発者の大半が回避すべき危険なアクティビティです。

  • リソース マネージャーによって通常実行される低レベルのタスク。

  • 正規の順序を維持しない方法でアクセス制御エントリを追加または削除する。

レジストリ キーの Windows アクセス制御セキュリティを変更するには、 メソッドを RegistryKey.GetAccessControl 使用して オブジェクトを RegistrySecurity 取得します。 規則を追加および削除してセキュリティ オブジェクトを変更し、 メソッドを RegistryKey.SetAccessControl 使用して再アタッチします。

重要

オブジェクトに対して行った変更は、 メソッドを RegistrySecurity 呼び出 RegistryKey.SetAccessControl して変更されたセキュリティ オブジェクトをレジストリ キーに割り当てるまで、レジストリ キーのアクセス レベルには影響しません。

あるレジストリ キーから別のレジストリ キーにアクセス制御セキュリティをコピーするには、 メソッドを RegistryKey.GetAccessControl 使用して、最初のレジストリ キーのアクセス規則と監査規則を表すオブジェクトを取得 RegistrySecurity し、 メソッドを RegistryKey.SetAccessControl 使用してこれらの規則を 2 番目のレジストリ キーに割り当てます。 オブジェクト パラメーターを受け取る メソッドまたは RegistryKey.CreateSubKey メソッドを使用RegistryKey.OpenSubKeyして、2 番目のレジストリ キーにルールをRegistrySecurity割り当てることもできます。

セキュリティ記述子定義言語 (SDDL) に投資しているユーザーは、 メソッドを SetSecurityDescriptorSddlForm 使用してレジストリ キーのアクセス規則を設定し、 メソッドを GetSecurityDescriptorSddlForm 使用して SDDL 形式のアクセス規則を表す文字列を取得できます。 これは、新しい開発にはお勧めしません。

コンストラクター

RegistrySecurity()

RegistrySecurity クラスの新しいインスタンスを既定値で初期化します。

プロパティ

AccessRightType

RegistrySecurity クラスでアクセス権を表すために使用する列挙型を取得します。

AccessRulesModified

この ObjectSecurity オブジェクトに関連するアクセス規則が変更されたかどうかを指定するブール値を取得または設定します。

(継承元 ObjectSecurity)
AccessRuleType

RegistrySecurity クラスでアクセス規則を表すために使用する型を取得します。

AreAccessRulesCanonical

この ObjectSecurity オブジェクトに関連するアクセス規則の順序が正規順序であるかどうかを指定するブール値を取得します。

(継承元 ObjectSecurity)
AreAccessRulesProtected

この ObjectSecurity オブジェクトに関連付けられている随意アクセス制御リスト (DACL) が保護されているかどうかを指定するブール値を取得します。

(継承元 ObjectSecurity)
AreAuditRulesCanonical

この ObjectSecurity オブジェクトに関連する監査規則の順序が正規順序であるかどうかを指定するブール値を取得します。

(継承元 ObjectSecurity)
AreAuditRulesProtected

この ObjectSecurity オブジェクトに関連付けられているシステム アクセス制御リスト (SACL) が保護されているかどうかを指定するブール値を取得します。

(継承元 ObjectSecurity)
AuditRulesModified

この ObjectSecurity オブジェクトに関連する監査規則が変更されたかどうかを指定するブール値を取得または設定します。

(継承元 ObjectSecurity)
AuditRuleType

RegistrySecurity クラスで監査規則を表すために使用する型を取得します。

GroupModified

セキュリティ保護可能なオブジェクトと関連付けられているグループが変更されているかどうかを指定するブール値を取得または設定します。

(継承元 ObjectSecurity)
IsContainer

この ObjectSecurity オブジェクトがコンテナー オブジェクトかどうかを指定するブール値を取得します。

(継承元 ObjectSecurity)
IsDS

この ObjectSecurity オブジェクトがディレクトリ オブジェクトかどうかを指定するブール値を取得します。

(継承元 ObjectSecurity)
OwnerModified

セキュリティ保護可能なオブジェクトの所有者が変更されているかどうかを指定するブール値を取得または設定します。

(継承元 ObjectSecurity)
SecurityDescriptor

このインスタンスのセキュリティ記述子を取得します。

(継承元 ObjectSecurity)

メソッド

AccessRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AccessControlType)

アクセス権、アクセス制御、およびフラグを指定して、指定したユーザーに対して新しいアクセス制御規則を作成します。

AddAccessRule(AccessRule)

指定したアクセス規則を、この CommonObjectSecurity オブジェクトに関連付けられた随意アクセス制御リスト (DACL: Discretionary Access Control List) に追加します。

(継承元 CommonObjectSecurity)
AddAccessRule(RegistryAccessRule)

新しい規則をマージできる、一致するアクセス制御を検索します。 見つからない場合は、新しい規則を追加します。

AddAuditRule(AuditRule)

指定した監査規則を、この CommonObjectSecurity オブジェクトに関連付けられたシステム アクセス制御リスト (SACL: System Access Control List) に追加します。

(継承元 CommonObjectSecurity)
AddAuditRule(RegistryAuditRule)

新しい規則をマージできる監査規則を検索します。 見つからない場合は、新しい規則を追加します。

AuditRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AuditFlags)

規則の適用対象となるユーザー、監査するアクセス権、規則の継承と反映、および規則を発生させる結果を指定して、新しい監査規則を作成します。

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetAccessRules(Boolean, Boolean, Type)

指定したセキュリティ識別子に関連付けられたアクセス規則のコレクションを取得します。

(継承元 CommonObjectSecurity)
GetAuditRules(Boolean, Boolean, Type)

指定したセキュリティ識別子に関連付けられた監査規則のコレクションを取得します。

(継承元 CommonObjectSecurity)
GetGroup(Type)

指定された所有者に関連付けられているプライマリ グループを取得します。

(継承元 ObjectSecurity)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetOwner(Type)

指定されたプライマリ グループに関連付けられている所有者を取得します。

(継承元 ObjectSecurity)
GetSecurityDescriptorBinaryForm()

この ObjectSecurity オブジェクトに関するセキュリティ記述子の情報を表すバイト値の配列を返します。

(継承元 ObjectSecurity)
GetSecurityDescriptorSddlForm(AccessControlSections)

ObjectSecurity オブジェクトに関連付けられているセキュリティ記述子の指定したセクションにあるセキュリティ記述子定義言語 (SDDL) 表現を返します。

(継承元 ObjectSecurity)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ModifyAccess(AccessControlModification, AccessRule, Boolean)

この CommonObjectSecurity オブジェクトに関連付けられている随意アクセス制御リスト (DACL) への指定された変更を適用します。

(継承元 CommonObjectSecurity)
ModifyAccessRule(AccessControlModification, AccessRule, Boolean)

この ObjectSecurity オブジェクトに関連付けられている随意アクセス制御リスト (DACL) への指定された変更を適用します。

(継承元 ObjectSecurity)
ModifyAudit(AccessControlModification, AuditRule, Boolean)

指定された変更を、この CommonObjectSecurity オブジェクトに関連付けられているシステム アクセス制御リスト (SACL) に適用します。

(継承元 CommonObjectSecurity)
ModifyAuditRule(AccessControlModification, AuditRule, Boolean)

指定された変更を、この ObjectSecurity オブジェクトに関連付けられているシステム アクセス制御リスト (SACL) に適用します。

(継承元 ObjectSecurity)
Persist(Boolean, String, AccessControlSections)

この ObjectSecurity オブジェクトに関連付けられたセキュリティ記述子の指定されたセクションを、永続ストレージに保存します。 コンストラクターと persist メソッドに渡される includeSections パラメーターの値を同一にすることをお勧めします。

(継承元 ObjectSecurity)
Persist(SafeHandle, AccessControlSections)

この NativeObjectSecurity オブジェクトに関連付けられたセキュリティ記述子の指定されたセクションを、永続ストレージに保存します。 コンストラクターと persist メソッドに渡される includeSections パラメーターの値を同一にすることをお勧めします。

(継承元 NativeObjectSecurity)
Persist(SafeHandle, AccessControlSections, Object)

この NativeObjectSecurity オブジェクトに関連付けられたセキュリティ記述子の指定されたセクションを、永続ストレージに保存します。 コンストラクターと persist メソッドに渡される includeSections パラメーターの値を同一にすることをお勧めします。

(継承元 NativeObjectSecurity)
Persist(String, AccessControlSections)

この NativeObjectSecurity オブジェクトに関連付けられたセキュリティ記述子の指定されたセクションを、永続ストレージに保存します。 コンストラクターと persist メソッドに渡される includeSections パラメーターの値を同一にすることをお勧めします。

(継承元 NativeObjectSecurity)
Persist(String, AccessControlSections, Object)

この NativeObjectSecurity オブジェクトに関連付けられたセキュリティ記述子の指定されたセクションを、永続ストレージに保存します。 コンストラクターと persist メソッドに渡される includeSections パラメーターの値を同一にすることをお勧めします。

(継承元 NativeObjectSecurity)
PurgeAccessRules(IdentityReference)

指定した IdentityReference と関連付けられているすべてのアクセス規則をすべて削除します。

(継承元 ObjectSecurity)
PurgeAuditRules(IdentityReference)

指定した IdentityReference と関連付けられている監査規則をすべて削除します。

(継承元 ObjectSecurity)
ReadLock()

読み取りアクセス用のこの ObjectSecurity オブジェクトをロックします。

(継承元 ObjectSecurity)
ReadUnlock()

読み取りアクセス用のこの ObjectSecurity オブジェクトをロック解除します。

(継承元 ObjectSecurity)
RemoveAccessRule(AccessRule)

指定したアクセス規則と同じセキュリティ識別子とアクセス マスクを含むアクセス規則を、この CommonObjectSecurity オブジェクトに関連付けられた随意アクセス制御リスト (DACL: Discretionary Access Control List) から削除します。

(継承元 CommonObjectSecurity)
RemoveAccessRule(RegistryAccessRule)

指定したアクセス規則と同じユーザーと AccessControlType (許可または拒否)、および互換性がある継承フラグと反映フラグが指定されたアクセス制御規則が検索されます。このような規則が見つかると、指定したアクセス規則に含まれる権限がその規則から削除されます。

RemoveAccessRuleAll(AccessRule)

指定したアクセス規則と同じセキュリティ識別子を含むすべてのアクセス規則を、この CommonObjectSecurity オブジェクトに関連付けられた随意アクセス制御リスト (DACL: Discretionary Access Control List) から削除します。

(継承元 CommonObjectSecurity)
RemoveAccessRuleAll(RegistryAccessRule)

指定した規則と同じユーザーおよび同じ AccessControlType (許可または拒否) が指定されたアクセス制御規則をすべて検索し、一致する規則が見つかった場合は、その規則を削除します。

RemoveAccessRuleSpecific(AccessRule)

指定したアクセス規則と完全に一致するすべてのアクセス規則を、この CommonObjectSecurity オブジェクトに関連付けられた随意アクセス制御リスト (DACL: Discretionary Access Control List) から削除します。

(継承元 CommonObjectSecurity)
RemoveAccessRuleSpecific(RegistryAccessRule)

指定した規則に正確に一致するアクセス制御規則を検索し、見つかった場合は、その規則を削除します。

RemoveAuditRule(AuditRule)

指定した監査規則と同じセキュリティ識別子とアクセス マスクを含む監査規則を、この CommonObjectSecurity オブジェクトに関連付けられたシステム アクセス制御リスト (SACL: System Access Control List) から削除します。

(継承元 CommonObjectSecurity)
RemoveAuditRule(RegistryAuditRule)

指定した規則と同じユーザー、および互換性のある継承フラグと反映フラグが指定された監査制御規則が検索されます。互換性のある規則が見つかると、指定した規則に含まれる権限がその規則から削除されます。

RemoveAuditRuleAll(AuditRule)

指定した監査規則と同じセキュリティ識別子を含むすべての監査規則を、この CommonObjectSecurity オブジェクトに関連付けられたシステム アクセス制御リスト (SACL: System Access Control List) から削除します。

(継承元 CommonObjectSecurity)
RemoveAuditRuleAll(RegistryAuditRule)

指定した規則と同じユーザーが設定されているすべての監査規則を検索し、見つかった場合はそれらの規則を削除します。

RemoveAuditRuleSpecific(AuditRule)

指定した監査規則と完全に一致するすべての監査規則を、この CommonObjectSecurity オブジェクトに関連付けられたシステム アクセス制御リスト (SACL: System Access Control List) から削除します。

(継承元 CommonObjectSecurity)
RemoveAuditRuleSpecific(RegistryAuditRule)

指定した規則に正確に一致する監査規則を検索し、見つかった場合は、その規則を削除します。

ResetAccessRule(AccessRule)

この CommonObjectSecurity オブジェクトに関連付けられた随意アクセス制御リスト (DACL: Discretionary Access Control List) 内のすべてのアクセス規則を削除し、指定したアクセス規則を追加します。

(継承元 CommonObjectSecurity)
ResetAccessRule(RegistryAccessRule)

AccessControlType に関係なく、指定した規則と同じユーザーが指定されたすべてのアクセス制御規則を削除し、指定した規則を追加します。

SetAccessRule(AccessRule)

指定したアクセス規則と同じセキュリティ識別子と修飾子を含むすべてのアクセス規則を、この CommonObjectSecurity オブジェクトに関連付けられた随意アクセス制御リスト (DACL: Discretionary Access Control List) から削除し、指定したアクセス規則を追加します。

(継承元 CommonObjectSecurity)
SetAccessRule(RegistryAccessRule)

指定した規則と同じユーザーおよび同じ AccessControlType (許可または拒否) が指定されたすべてのアクセス制御規則を削除し、指定した規則を追加します。

SetAccessRuleProtection(Boolean, Boolean)

この ObjectSecurity オブジェクトに関連付けられたアクセス規則の保護を設定または削除します。 保護されたアクセス規則を親オブジェクトが継承によって変更することはできません。

(継承元 ObjectSecurity)
SetAuditRule(AuditRule)

指定した監査規則と同じセキュリティ識別子と修飾子を含むすべての監査規則を、この CommonObjectSecurity オブジェクトに関連付けられたシステム アクセス制御リスト (SACL: System Access Control List) から削除し、指定した監査規則を追加します。

(継承元 CommonObjectSecurity)
SetAuditRule(RegistryAuditRule)

AuditFlags 値に関係なく、指定した規則と同じユーザーが指定されたすべての監査規則を削除し、指定した規則を追加します。

SetAuditRuleProtection(Boolean, Boolean)

この ObjectSecurity オブジェクトに関連付けられた監査規則の保護を設定または削除します。 保護された監査規則は、親オブジェクトによる継承によって変更できません。

(継承元 ObjectSecurity)
SetGroup(IdentityReference)

この ObjectSecurity オブジェクトに関連付けられているセキュリティ記述子のプライマリ グループを設定します。

(継承元 ObjectSecurity)
SetOwner(IdentityReference)

このObjectSecurity オブジェクトに関連付けられているセキュリティ記述子の所有者を設定します。

(継承元 ObjectSecurity)
SetSecurityDescriptorBinaryForm(Byte[])

バイト値の指定された配列から、この ObjectSecurity オブジェクトに関するセキュリティ記述子を設定します。

(継承元 ObjectSecurity)
SetSecurityDescriptorBinaryForm(Byte[], AccessControlSections)

バイト値の指定された配列から、この ObjectSecurity オブジェクトに関するセキュリティ記述子の指定されたセクションを設定します。

(継承元 ObjectSecurity)
SetSecurityDescriptorSddlForm(String)

指定したセキュリティ記述子定義言語 (SDDL) 文字列から、ObjectSecurity オブジェクトのセキュリティ記述子を設定します。

(継承元 ObjectSecurity)
SetSecurityDescriptorSddlForm(String, AccessControlSections)

指定したセキュリティ記述子定義言語 (SDDL) 文字列から、ObjectSecurity オブジェクトのセキュリティ記述子の指定したセクションを設定します。

(継承元 ObjectSecurity)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)
WriteLock()

書き込みアクセス用のこの ObjectSecurity オブジェクトをロックします。

(継承元 ObjectSecurity)
WriteUnlock()

書き込みアクセス用にこの ObjectSecurity オブジェクトのロックを解除します。

(継承元 ObjectSecurity)

適用対象