RegistrySecurity.AuditRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AuditFlags) Método
Definição
Cria uma nova regra de auditoria, especificando o usuário ao qual a regra se aplica, os direitos de acesso para auditoria, a herança e a propagação da regra e o resultado que dispara a regra.Creates a new audit rule, specifying the user the rule applies to, the access rights to audit, the inheritance and propagation of the rule, and the outcome that triggers the rule.
public:
override System::Security::AccessControl::AuditRule ^ AuditRuleFactory(System::Security::Principal::IdentityReference ^ identityReference, int accessMask, bool isInherited, System::Security::AccessControl::InheritanceFlags inheritanceFlags, System::Security::AccessControl::PropagationFlags propagationFlags, System::Security::AccessControl::AuditFlags flags);
public override System.Security.AccessControl.AuditRule AuditRuleFactory (System.Security.Principal.IdentityReference identityReference, int accessMask, bool isInherited, System.Security.AccessControl.InheritanceFlags inheritanceFlags, System.Security.AccessControl.PropagationFlags propagationFlags, System.Security.AccessControl.AuditFlags flags);
override this.AuditRuleFactory : System.Security.Principal.IdentityReference * int * bool * System.Security.AccessControl.InheritanceFlags * System.Security.AccessControl.PropagationFlags * System.Security.AccessControl.AuditFlags -> System.Security.AccessControl.AuditRule
Public Overrides Function AuditRuleFactory (identityReference As IdentityReference, accessMask As Integer, isInherited As Boolean, inheritanceFlags As InheritanceFlags, propagationFlags As PropagationFlags, flags As AuditFlags) As AuditRule
Parâmetros
- identityReference
- IdentityReference
Um IdentityReference que identifica o usuário ou o grupo ao qual a regra se aplica.An IdentityReference that identifies the user or group the rule applies to.
- accessMask
- Int32
Uma combinação bit a bit de valores RegistryRights que especifica os direitos de acesso a serem auditados e convertidos em um inteiro.A bitwise combination of RegistryRights values specifying the access rights to audit, cast to an integer.
- isInherited
- Boolean
Um valor booliano que especifica se a regra é herdada.A Boolean value specifying whether the rule is inherited.
- inheritanceFlags
- InheritanceFlags
Uma combinação bit a bit de valores InheritanceFlags que especificam como a regra é herdada por subchaves.A bitwise combination of InheritanceFlags values specifying how the rule is inherited by subkeys.
- propagationFlags
- PropagationFlags
Uma combinação bit a bit de valores PropagationFlags que modificam o modo como a regra é herdada por subchaves.A bitwise combination of PropagationFlags values that modify the way the rule is inherited by subkeys. Sem sentido se o valor de inheritanceFlags for None.Meaningless if the value of inheritanceFlags is None.
- flags
- AuditFlags
Uma combinação bit a bit de valores AuditFlags que especifica se a auditoria deve ser realizada em caso de acesso com êxito, com falha ou ambos.A bitwise combination of AuditFlags values specifying whether to audit successful access, failed access, or both.
Retornos
Um objeto RegistryAuditRule que representa a regra de auditoria especificada para o usuário especificado com os sinalizadores especificados.A RegistryAuditRule object representing the specified audit rule for the specified user, with the specified flags. O tipo de retorno do método é a classe base, AuditRule, mas o valor retornado pode ser convertido com segurança para a classe derivada.The return type of the method is the base class, AuditRule, but the return value can be cast safely to the derived class.
Exceções
accessMask, inheritanceFlags, propagationFlags ou flags especifica um valor inválido.accessMask, inheritanceFlags, propagationFlags, or flags specifies an invalid value.
identityReference é null.identityReference is null.
- ou --or-
accessMask é zero.accessMask is zero.
identityReference não e do tipo SecurityIdentifier nem de um tipo como NTAccount que pode ser convertido para o tipo SecurityIdentifier.identityReference is neither of type SecurityIdentifier, nor of a type such as NTAccount that can be converted to type SecurityIdentifier.
Comentários
A maneira recomendada para criar regras de auditoria é usar os construtores da RegistryAuditRule classe.The recommended way to create audit rules is to use the constructors of the RegistryAuditRule class.
Observação
Embora você possa especificar o InheritanceFlags.ObjectInherit sinalizador, não há nenhum ponto para fazer isso.Although you can specify the InheritanceFlags.ObjectInherit flag, there is no point in doing so. Para fins de controle de auditoria, os pares de nome/valor em uma subchave não são objetos separados.For the purposes of audit control, the name/value pairs in a subkey are not separate objects. Os direitos de auditoria para pares de nome/valor são controlados pelos direitos da subchave.The audit rights to name/value pairs are controlled by the rights of the subkey. Além disso, como todas as subchaves são contêineres (ou seja, elas podem conter outras subchaves), elas não são afetadas pelo ObjectInherit sinalizador.Furthermore, since all subkeys are containers (that is, they can contain other subkeys), they are not affected by the ObjectInherit flag. Finalmente, a especificação do ObjectInherit sinalizador complica desnecessariamente a manutenção das regras, pois ela interfere na combinação normal de regras compatíveis.Finally, specifying the ObjectInherit flag needlessly complicates the maintenance of rules, because it interferes with the normal combination of compatible rules.