監査ポリシー プログラム
auditpol
- C:\Windows\system32\auditpol.exe /?
Output:
使用法: AuditPol コマンド [<サブコマンド><オプション>]
コマンド (1 回の実行で使用できるコマンドは 1 つのみ)
/? ヘルプ (状況に応じた) を表示します。
/get 現在の監査ポリシーを表示します。
/set 監査ポリシーを設定します。
/list 選択可能なポリシー要素を表示します。
/backup 監査ポリシーをファイルに保存します。
/restore ファイルから監査ポリシーを復元します。
/clear 監査ポリシーの内容を消去します。
/remove 指定されたユーザーのユーザーごとの監査ポリシーを削除します。
/resourceSACL グローバル リソース SACL
各コマンドの詳細については、AuditPol <コマンド> /? を使用してください
Usage: AuditPol command [<sub-command><options>]
Commands (only one command permitted per execution)
/? Help (context-sensitive)
/get Displays the current audit policy.
/set Sets the audit policy.
/list Displays selectable policy elements.
/backup Saves the audit policy to a file.
/restore Restores the audit policy from a file.
/clear Clears the audit policy.
/remove Removes the per-user audit policy for a user account.
/resourceSACL Configure global resource SACLs
Use AuditPol <command> /? for details on each command
Return Code: 0
auditpol get
- C:\Windows\system32\auditpol.exe /get /?
Output:
使用法: AuditPol /get [/user[:<ユーザー名>|<{sid}>]]
[/category:*|<名前>|<{guid}>[,:<名前>|<{guid}>...]]
[/subcategory:<名前>|<{guid}>[,:<名前>|<{guid}>...]]
[/option:<オプション名>]
[/sd]
[/r]
このコマンドは、現在の監査ポリシーを表示します。
コマンド
/? ヘルプ (状況に応じた) を表示します。
/user ユーザーごとの監査ポリシーが必要なユーザーのための
セキュリティ プリンシパル。/category オプションまたは
/subcategory オプションを指定する必要があります。ユーザー
は、SID または名前で指定できます。ユーザー アカウント
を指定しない場合は、システム監査ポリシーが必要です。
/category GUID または名前で指定される 1 つ以上の監査カテゴリ。
アスタリスク ("*") を使用して、すべての監査カテゴリが照会
されるように指定することもできます。
/subcategory GUID または名前で指定される 1 つ以上の監査
サブカテゴリ。
/sd 監査ポリシーへのアクセスを委任するために使用される
セキュリティ記述子を取得します。
/option CrashOnAuditFail、FullPrivilegeAuditing、
AuditBaseObjects、または AuditBaseDirectories
のための既存ポリシーを取得します。
/r レポート (CSV) 形式で出力を表示します。
使用例:
auditpol /get /user:ドメイン\ユーザー /Category:"詳細追跡","オブジェクト
アクセス"
auditpol /get /Subcategory:{0cce9212-69ae-11d9-bed3-505054503030} /r
auditpol /get /option:CrashOnAuditFail
auditpol /get /user:{S-1-5-21-397123417-1234567} /Category:"システム"
auditpol /get /sd
Usage: AuditPol /get [/user[:<username>|<{sid}>]]
[/category:*|<name>|<{guid}>[,:<name>|<{guid}>...]]
[/subcategory:<name>|<{guid}>[,:<name>|<{guid}>...]]
[/option:<option name>]
[/sd]
[/r]
This command displays the current audit policy.
Commands
/? Help (context-sensitive)
/user The security principal for whom the per-user audit
policy is queried. Either the /category or /subcategory
option must be specified. The user may be specified as
a SID or name. If no user account is specified, then
the system audit policy is queried.
/category One or more audit categories specified by GUID or name.
An asterisk ("*") may be used to indicate that all audit
categories should be queried.
/subcategory One or more audit subcategories specified by GUID or
name.
/sd Retrieves the security descriptor used to delegate
access to the audit policy.
/option Retrieve existing policy for CrashOnAuditFail,
FullPrivilegeAuditing, AuditBaseObjects or
AuditBaseDirectories.
/r Display the output in report (CSV) format.
Sample usage:
auditpol /get /user:domain\user /Category:"Detailed Tracking","Object Access"
auditpol /get /Subcategory:{0cce9212-69ae-11d9-bed3-505054503030} /r
auditpol /get /option:CrashOnAuditFail
auditpol /get /user:{S-1-5-21-397123417-1234567} /Category:"System"
auditpol /get /sd
Return Code: 0
auditpol set
- C:\Windows\system32\auditpol.exe /set /?
Output:
使用法: AuditPol /set
[/user[:<ユーザー名>|<{sid}>][/include][/exclude]]
[/category:<名前>|<{guid}>[,:<名前>|<{guid}>...]]
[/success:<enable>|<disable>][/failure:<enable>|<disable>]
[/subcategory:<名前>|<{guid}>[,:<名前>|<{guid}>...]]
[/success:<enable>|<disable>][/failure:<enable>|<disable>]
[/option:<オプション名> /value:<enable>|<disable>]
このコマンドは、現在の監査ポリシーを設定します。
コマンド
/? ヘルプ (状況に応じた) を表示します。
/user ユーザーごとの監査ポリシーが必要なユーザーのための
category/subcategory によって指定されるセキュリティ プリンシパルが設定されます。
カテゴリまたはサブカテゴリのオプションを、SID または名前で
指定しなければなりません。
/include /user と一緒に指定します。システム監査ポリシーで指定されて
いなくても、そのユーザーのユーザーごとのポリシーによって
監査が生成されるように指定します。この設定は、
既定の設定であり、/include オプションも
/exclude オプションも明示的に指定されて
いない場合は自動的に適用されます。
/exclude /user と一緒に指定します。システム監査ポリシーの有無にかかわらず、
そのユーザーのユーザーごとのポリシーによって監査が
行われないように指定します。この設定は、Administrators ローカル
グループのメンバーであるユーザーにとって好ましい設定ではありません。
/category GUID または名前で指定される 1 つ以上の監査カテゴリ。
ユーザーを指定しなかった場合は、システム ポリシーが設定されます。
/subcategory GUID または名前で指定される 1 つ以上の監査サブカテゴリ。
ユーザーを指定しなかった場合は、システム ポリシーが設定されます。
/success 成功の監査を指定します。/success オプションも /failure も
明示的に指定しなかった場合は、この設定が既定の設定になり、
自動的に適用されます。この設定は、
設定を enable にするか disable にするかを示す
パラメーターと一緒に使用しなければなりません。
/failure 失敗の監査を指定します。この設定は、
設定を enable にするか disable にするかを示すパラメーターと一緒に
使用しなければなりません。
/option CrashOnAuditFail、FullPrivilegeAuditing、
AuditBaseObjects、または AuditBaseDirectories
のための監査ポリシーを設定します
/sd 監査ポリシーへのアクセスを委任するために使用される
セキュリティ記述子を設定します。セキュリティ記述子は、
SDDL を使用して指定しなければなりません。セキュリティ記述子は、
DACL を持っていなければなりません。
例:
auditpol /set /user:ドメイン\ユーザー /Category:"システム" /success:enable /include
auditpol /set /subcategory:{0cce9212-69ae-11d9-bed3-505054503030} /failure:disable
auditpol /set /option:CrashOnAuditFail /value:enable
auditpol /set /sd:D:(A;;DCSWRPDTRC;;;BA)(A;;DCSWRPDTRC;;;SY)
コマンドは正常に実行されました。
Usage: AuditPol /set
[/user[:<username>|<{sid}>][/include][/exclude]]
[/category:<name>|<{guid}>[,:<name>|<{guid}>...]]
[/success:<enable>|<disable>][/failure:<enable>|<disable>]
[/subcategory:<name>|<{guid}>[,:<name>|<{guid}>...]]
[/success:<enable>|<disable>][/failure:<enable>|<disable>]
[/option:<option name> /value:<enable>|<disable>]
This command sets the current audit policy.
Commands
/? Help (context-sensitive)
/user The security principal for whom per-user audit policy
specified by the category/subcategory is set. Either
the category or subcategory option must be specified,
as a SID or name.
/include Specified with /user; indicates that user's per-user
policy will cause audit to be generated even if not
specified by the system audit policy. This setting is
the default and is automatically applied if neither
the /include nor /exclude options are explicitly
specified.
/exclude Specified with /user; indicates that the user's per-user
policy will cause audit to be suppressed regardless of
the system audit policy. This setting is not honored for
users who are members of the Administrators local group.
/category One or more audit categories specified by GUID or name.
If no user is specified, the system policy is set.
/subcategory One or more audit subcategories specified by GUID or
name. If no user is specified, system policy is set.
/success Specifies success auditing. This setting is the default
and is automatically applied if neither the /success nor
/failure options are explicitly specified. This setting
must be used with a parameter indicating whether to
enable or disable the setting.
/failure Specifies failure auditing. This setting must be used with
a parameter indicating whether to enable or disable the
setting.
/option Set the audit policy for CrashOnAuditFail,
FullPrivilegeAuditing, AuditBaseObjects or
AuditBaseDirectories.
/sd Sets the security descriptor used to delegate access
to the audit policy. The security descriptor must be
specified using SDDL. The security descriptor must have a
DACL.
Example:
auditpol /set /user:domain\user /Category:"System" /success:enable /include
auditpol /set /subcategory:{0cce9212-69ae-11d9-bed3-505054503030} /failure:disable
auditpol /set /option:CrashOnAuditFail /value:enable
auditpol /set /sd:D:(A;;DCSWRPDTRC;;;BA)(A;;DCSWRPDTRC;;;SY)
The command was successfully executed.
Return Code: 0
auditpol list
- C:\Windows\system32\auditpol.exe /list /?
Output:
使用法: AuditPol /list
[/user|/category|/subcategory[:<カテゴリ名>|<{guid}>|*]
[/v] [/r]
このコマンドは、監査ポリシー カテゴリ、サブカテゴリを一覧表示するか、またはユーザーごとの
監査ポリシーが定義されているユーザーを一覧表示します。
コマンド
/? ヘルプ (状況に応じた) を表示します。
/user ユーザーごとの監査ポリシーが定義されている
すべてのユーザーを取得します。/v オプションと一緒に指定した場合は、
ユーザーの SID も表示されます。
/category システムが理解できるカテゴリの名前を
表示します。/v オプションと一緒に使用すると、カテゴリの
GUID も表示されます。
/subcategory 指定されたカテゴリ内のサブカテゴリについて、システムが理解できる
サブカテゴリの名前を表示します。
/v オプションと一緒に使用すると、
サブカテゴリの GUID も表示されます。
例:
auditpol /list /user
auditpol /list /category /v
auditpol /list /subcategory:"詳細追跡","オブジェクト アクセス"
Usage: AuditPol /list
[/user|/category|/subcategory[:<categoryname>|<{guid}>|*]
[/v] [/r]
This command lists audit policy categories, subcategories, or lists users for
whom per-user audit policy is defined.
Commands
/? Help (context-sensitive)
/user Retrieves all users for whom per-user audit policy
has been defined. If used with the /v option, the
sid of the user is also displayed.
/category Displays the names of categories understood by the
system. If used with the /v option, the category
GUID is also displayed.
/subcategory Displays the names of subcategories understood by the
system, for subcategories in a specified category.
The subcategory GUIDs are also displayed if the /v
option is used.
Example:
auditpol /list /user
auditpol /list /category /v
auditpol /list /subcategory:"Detailed Tracking","Object Access"
Return Code: 0
auditpol backup
- C:\Windows\system32\auditpol.exe /backup /?
Output:
使用法: AuditPol /backup /file:<ファイル名>
このコマンドは、システム監査ポリシーの設定とすべてのユーザーのユーザーごとの
監査ポリシーの設定とすべての監査オプションを 1 つのファイルにバックアップします。
バックアップは、CSV 形式のテキスト ファイルに書き込まれます。
オプション
/? ヘルプ (状況に応じた) を表示します。
/file 監査ポリシーのバックアップ先とするファイルの名前を
指定します。
例:
auditpol /backup /file:c:\auditpolicy.csv
コマンドは正常に実行されました。
Usage: AuditPol /backup /file:<filename>
This command backs up system audit policy settings and per-user audit policy
settings for all users and all auditing options into a file. The backup will
be written to a CSV-formatted text file.
Options
/? Help (context-sensitive).
/file Specifies the name of the file to which the audit policy
will be backed-up.
Example:
auditpol /backup /file:c:\auditpolicy.csv
The command was successfully executed.
Return Code: 0
auditpol restore
- C:\Windows\system32\auditpol.exe /restore /?
Output:
使用法: AuditPol /restore /file:<ファイル名>
このコマンドは、/backup コマンドで作成したファイルからシステム監査ポリシーの設定、
すべてのユーザーのユーザーごとの監査ポリシーの設定、およびすべての監査オプションを
復元します。
Options
/? ヘルプ (状況に応じた) を表示します。
/file 読み取る監査ポリシーの入ったファイルを
指定します。このファイルは、/backup オプションで作成されたものか、
またはそのファイル形式の構文に従ったファイルでなければ
なりません。
例:
auditpol /restore /file:c:\auditpolicy.csv
コマンドは正常に実行されました。
Usage: AuditPol /restore /file:<filename>
This command restores system audit policy settings, per-user audit policy
settings for all users and all auditing options from a file created with the
/backup command.
Options
/? Help (context-sensitive).
/file Specifies the file where the audit policy should be
read from. The file must have been created by the
/backup option or must be syntactically consistent
with that file format.
Example:
auditpol /restore /file:c:\auditpolicy.csv
The command was successfully executed.
Return Code: 0
auditpol clear
- C:\Windows\system32\auditpol.exe /clear /?
Output:
使用法: AuditPol /clear [/y]
このコマンドは、すべてのユーザーのユーザーごとの監査ポリシーを削除し、すべてのサブカテゴリの
システム監査ポリシーをリセットし、すべての監査オプションを無効に設定します。
オプション
/? ヘルプ (状況に応じた) を表示します。
/y すべての監査ポリシーの内容を消去するかを確認するプロンプトが
表示されないようにします。
例:
auditpol /clear
auditpol /clear /y
コマンドは正常に実行されました。
Usage: AuditPol /clear [/y]
This command deletes per-user audit policy for all users, resets system
audit policy for all subcategories and sets all the auditing options to disabled.
Options
/? Help (context-sensitive).
/y Suppresses the prompt to confirm if all the audit policy
should be cleared.
Example:
auditpol /clear
auditpol /clear /y
The command was successfully executed.
Return Code: 0
auditpol remove
- C:\Windows\system32\auditpol.exe /remove /?
Output:
使用法: AuditPol /remove [/user[:<ユーザー名>|<{sid}>]]
[/allusers]
このコマンドは、指定されたアカウントのユーザーごとの監査ポリシーを削除します。
オプション
/? ヘルプ (状況に応じた) を表示します。
/user ユーザーごとの監査ポリシーを削除するユーザーの
SID またはユーザー名を指定します。
/allusers すべてのユーザーのユーザーごとの監査ポリシーを削除します。
例:
auditpol /remove /user:{S-1-5-21-397123417-1234567}
auditpol /remove /allusers
コマンドは正常に実行されました。
Usage: AuditPol /remove [/user[:<username>|<{sid}>]]
[/allusers]
This command removes per-user audit policy for a specified account.
Options
/? Help (context-sensitive).
/user Specifies the SID or user name for the user for whom
per-user audit policy is to be deleted
/allusers Deletes per-user audit policy for all users.
Example:
auditpol /remove /user:{S-1-5-21-397123417-1234567}
auditpol /remove /allusers
The command was successfully executed.
Return Code: 0
auditpol resourceSACL
- C:\Windows\system32\auditpol.exe /resourceSACL /?
Output:
使用法: AuditPol /resourceSACL
[/set /type:<リソース> [/success] [/failure] /user:<ユーザー>
[/access:<アクセス フラグ>] [/condition:<式>]]
[/remove /type:<リソース> /user:<ユーザー> [/type:<リソース>]]
[/clear [/type:<リソース>]]
[/view [/user:<ユーザー>] [/type:<リソース>]]
このコマンドはグローバル オブジェクト アクセスの監査の設定を構成します。
イベントがシステムによって生成されるためには、対応するオブジェクト アクセス
サブカテゴリを有効にする必要があります。詳細については、「auditpol /set /?」を
入力してください。
コマンド
/? コマンドのヘルプを表示します。
/set 指定したリソースの種類のリソース システム アクセス制御リストに
新規エントリを追加する、または既存のエントリを更新します。
/remove 指定したユーザーのすべてのエントリをリソースの種類で指定
したグローバル オブジェクト アクセス監査リストから削除
します。
/clear 指定したリソースの種類のグローバル オブジェクト アクセス
監査リストからすべてのエントリを削除します。
/view 指定したリソースの種類とユーザーのグローバル オブジェクト
アクセス監査のエントリを一覧表示します。ユーザーの指定
はオプションです。
引数
/type オブジェクト アクセス監査を構成するリソース。
サポートされる引数値は File と Key です。これらの値では
大文字と小文字が区別されることに注意してください。
File: ディレクトリとファイル。
Key: レジストリ キー。
/success 成功の監査を指定します。
/failure 失敗の監査を指定します。
/user ユーザーを次のいずれかの形式で指定します。
- ドメイン名\アカウント (例: DOM\Administrators)
- スタンドアロン サーバー\グループ
- アカウント (LookupAccountName API を参照)
- {S-1-x-x-x-x}。x は 10 進数表記です。
また、SID 全体を中かっこで囲む必要があります。
例: {S-1-5-21-5624481-130208933-164394174-1001}
警告: SID 形式を使用する場合、アカウントが存在するかどうかの
チェックは行われません。
/access アクセス許可は、次の 2 種類のいずれかの形式で指定
できます。
- 単一の権限を連続して指定する:
汎用的なアクセス権:
GA - 汎用すべて
GR - 汎用読み取り
GW - 汎用書き込み
GX - 汎用実行
ファイルのアクセス権:
FA - ファイルへのすべてのアクセス
FR - ファイルの汎用読み取り
FW - ファイルへの汎用書き込み
FX - ファイルの汎用実行
レジストリ キーのアクセス権:
KA - キーへのすべてのアクセス
KR - キーの読み取り
KW - キーへの書き込み
KX - キーの実行
例: '/access:FRFW' を実行すると監査イベントの読み取りと
書き込みの操作が可能になります。
- 16 進数の値はアクセス マスク (例: 0x1200a9) を示します。
これは、SDDL 標準に含まれないリソース固有のビット マスクを
使用する場合に有用です。省略した場合は、フル アクセスが
使用されます。
/condition 次のような属性に基づく式を追加します。
ドキュメントの秘密度は HBI です ("High")
"(@Resource.Sensitivity == \"High\")"
例:
auditpol /resourceSACL /set /type:Key /user:MYDOMAIN\myuser /success
auditpol /resourceSACL /set /type:File /user:MYDOMAIN\myuser /success
/failure /access:FRFW
auditpol /resourceSACL /set /type:File /user:everyone /success
/failure /access:FRFW /condition:"(@Resource.Sensitivity == \"High\")"
auditpol /resourceSACL /type:File /clear
auditpol /resourceSACL /remove /type:File
/user:{S-1-5-21-56248481-1302087933-1644394174-1001}
auditpol /resourceSACL /type:File /view
auditpol /resourceSACL /type:File /view /user:MYDOMAIN\myuser
コマンドは正常に実行されました。
Usage: AuditPol /resourceSACL
[/set /type:<resource> [/success] [/failure] /user:<user>
[/access:<access flags>] [/condition:<expression>]]
[/remove /type:<resource> /user:<user> [/type:<resource>]]
[/clear [/type:<resource>]]
[/view [/user:<user>] [/type:<resource>]]
This command configures settings for global object access auditing. The
corresponding object access subcategory needs to be enabled for the events
to be generated by the system. Type auditpol /set /? for more information.
Commands
/? Displays Help for the command.
/set Adds a new entry to or updates an existing entry in the
resource system access control list for the resource type
specified.
/remove Removes all entries for the given user from the global
object access auditing list specified by the resource
type.
/clear Removes all entries from the global object access auditing
list for the specified resource type.
/view Lists the global object access auditing entries for the
specified resource type and user. Specifying a user is
optional.
Arguments
/type The resource for which object access auditing is being
configured. The supported argument values are File and
Key. Note that these values are case sensitive.
File: Directories and files.
Key: Registry keys.
/success Specifies success auditing.
/failure Specifies failure auditing.
/user Specifies a user in one of the following forms:
- DomainName\Account (such as DOM\Administrators)
- StandaloneServer\Group
- Account (see LookupAccountName API)
- {S-1-x-x-x-x}. x is expressed in decimal, and the entire
SID must be enclosed in curly braces.
For example: {S-1-5-21-5624481-130208933-164394174-1001}
Warning: If SID form is used, no check is done to verify
the existence of this account.
/access Specifies a permission mask that can be specified in one
of two forms:
- A sequence of simple rights:
Generic access rights:
GA - GENERIC ALL
GR - GENERIC READ
GW - GENERIC WRITE
GX - GENERIC EXECUTE
Access rights for files:
FA - FILE ALL ACCESS
FR - FILE GENERIC READ
FW - FILE GENERIC WRITE
FX - FILE GENERIC EXECUTE
Access rights for registry keys:
KA - KEY ALL ACCESS
KR - KEY READ
KW - KEY WRITE
KX - KEY EXECUTE
For example: '/access:FRFW' will enable audit events
for read and write operations.
- A hex value representing the access mask (such as
0x1200a9).
This is useful when using resource-specific bit masks
that are not part of the SDDL standard. If omitted,
Full access is used.
/condition Appends an attribute based expression like the following:
Document sensitivity is HBI ("High")
"(@Resource.Sensitivity == \"High\")"
Examples:
auditpol /resourceSACL /set /type:Key /user:MYDOMAIN\myuser /success
auditpol /resourceSACL /set /type:File /user:MYDOMAIN\myuser /success
/failure /access:FRFW
auditpol /resourceSACL /set /type:File /user:everyone /success
/failure /access:FRFW /condition:"(@Resource.Sensitivity == \"High\")"
auditpol /resourceSACL /type:File /clear
auditpol /resourceSACL /remove /type:File
/user:{S-1-5-21-56248481-1302087933-1644394174-1001}
auditpol /resourceSACL /type:File /view
auditpol /resourceSACL /type:File /view /user:MYDOMAIN\myuser
The command was successfully executed.
Return Code: 0
C:\Windows\system32\auditpol.exe
c:\>ver
Microsoft Windows [Version 10.0.19045.2075]
| File | Info |
|---|---|
| File Size | 41984bytes |
| Creation Time | 2022/07/08 08:50:26 |
| LastWrite Time | 2022/07/08 08:50:26 |
| ProductVersion | 10.0.19041.1889 |
| FileVersion | 10.0.19041.1889 (WinBuild.160101.0800) |
| Hash | Value |
|---|---|
| MD5 | 0cbbb1ffe1af93272d498fb8fbbffcc6 |
| SHA1 | e6a50645a361d5c763802ffa6e3c749fb81e96d7 |
| SHA224 | 68a580fee58fff3a078495ce6b4fe54c3d1e814a6571aeb756393583 |
| SHA256 | d1c6ec7f394b59d067dfd47a6a65978e4c2cc73437457a4b78209e5f516471cc |
| SHA384 | b0ac794adc7b01cb5d0889986fab9ca8e3caf948158b993830bd158926acb71d147c2e2762cc5cbf5467a8cccb5e7e58 |
| SHA512 | a979571b537c0c00a102721b1790e5adc78e0fd4cf120785a12ff810592c878f2c0e20b079d9ad0e213b9b3e517de2e989fa59dd9433ab047e916b98a9de2ab6 |