Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SANDBOX_WIN_SRC_SANDBOX_POLICY_H_ | 5 #ifndef SANDBOX_WIN_SRC_SANDBOX_POLICY_H_ |
| 6 #define SANDBOX_WIN_SRC_SANDBOX_POLICY_H_ | 6 #define SANDBOX_WIN_SRC_SANDBOX_POLICY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 157 // launching the sandboxed process will fail. See BrokerServices for details | 157 // launching the sandboxed process will fail. See BrokerServices for details |
| 158 // about installing an AppContainer. | 158 // about installing an AppContainer. |
| 159 // Note that currently Windows restricts the use of impersonation within | 159 // Note that currently Windows restricts the use of impersonation within |
| 160 // AppContainers, so this function is incompatible with the use of an initial | 160 // AppContainers, so this function is incompatible with the use of an initial |
| 161 // token. | 161 // token. |
| 162 virtual ResultCode SetAppContainer(const wchar_t* sid) = 0; | 162 virtual ResultCode SetAppContainer(const wchar_t* sid) = 0; |
| 163 | 163 |
| 164 // Sets a capability to be enabled for the sandboxed process' AppContainer. | 164 // Sets a capability to be enabled for the sandboxed process' AppContainer. |
| 165 virtual ResultCode SetCapability(const wchar_t* sid) = 0; | 165 virtual ResultCode SetCapability(const wchar_t* sid) = 0; |
| 166 | 166 |
| 167 // Sets the mitigation flags used when starting the process. These flags are | |
| 168 // defined in the PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY attribute for the | |
| 169 // UpdateProcThreadAttribute function. Flags that are invalid for the | |
| 170 // target OS will be silently ignored. | |
| 171 virtual ResultCode SetProcessMitigations(uint64 flags) = 0; | |
| 172 | |
|
cpu_(ooo_6.6-7.5)
2012/09/06 19:46:15
The flags are our flags but the comment can take
jschuh
2012/09/07 01:14:22
Done.
| |
| 173 // Returns the currently set mitigation policy. | |
| 174 virtual uint64 GetProcessMitigations() = 0; | |
| 175 | |
| 176 // Sets the process mitigation flags. These flags will not take effect | |
| 177 // before you call LowerToken. These flags are are defined in the | |
| 178 // PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY attribute for the | |
| 179 // UpdateProcThreadAttribute function. Flags that are invalid for the | |
| 180 // target OS will be silently ignored. Flags that are invalid after process | |
| 181 // startup will return SBOX_ERROR_BAD_PARAMS. | |
| 182 virtual ResultCode SetDelayedProcessMitigations(uint64 flags) = 0; | |
| 183 | |
| 184 // Returns the currently set delayed mitigation policy. | |
| 185 virtual uint64 GetDelayedProcessMitigations() = 0; | |
| 186 | |
| 167 // Sets the interceptions to operate in strict mode. By default, interceptions | 187 // Sets the interceptions to operate in strict mode. By default, interceptions |
| 168 // are performed in "relaxed" mode, where if something inside NTDLL.DLL is | 188 // are performed in "relaxed" mode, where if something inside NTDLL.DLL is |
| 169 // already patched we attempt to intercept it anyway. Setting interceptions | 189 // already patched we attempt to intercept it anyway. Setting interceptions |
| 170 // to strict mode means that when we detect that the function is patched we'll | 190 // to strict mode means that when we detect that the function is patched we'll |
| 171 // refuse to perform the interception. | 191 // refuse to perform the interception. |
| 172 virtual void SetStrictInterceptions() = 0; | 192 virtual void SetStrictInterceptions() = 0; |
| 173 | 193 |
| 174 // Adds a policy rule effective for processes spawned using this policy. | 194 // Adds a policy rule effective for processes spawned using this policy. |
| 175 // subsystem: One of the above enumerated windows subsystems. | 195 // subsystem: One of the above enumerated windows subsystems. |
| 176 // semantics: One of the above enumerated FileSemantics. | 196 // semantics: One of the above enumerated FileSemantics. |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 194 // A NULL value for handle_name indicates all handles of the specified type. | 214 // A NULL value for handle_name indicates all handles of the specified type. |
| 195 // An empty string for handle_name indicates the handle is unnamed. | 215 // An empty string for handle_name indicates the handle is unnamed. |
| 196 virtual ResultCode AddKernelObjectToClose(const wchar_t* handle_type, | 216 virtual ResultCode AddKernelObjectToClose(const wchar_t* handle_type, |
| 197 const wchar_t* handle_name) = 0; | 217 const wchar_t* handle_name) = 0; |
| 198 }; | 218 }; |
| 199 | 219 |
| 200 } // namespace sandbox | 220 } // namespace sandbox |
| 201 | 221 |
| 202 | 222 |
| 203 #endif // SANDBOX_WIN_SRC_SANDBOX_POLICY_H_ | 223 #endif // SANDBOX_WIN_SRC_SANDBOX_POLICY_H_ |
| OLD | NEW |