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" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "sandbox/win/src/sandbox_types.h" | 12 #include "sandbox/win/src/sandbox_types.h" |
| 13 #include "sandbox/win/src/security_level.h" | 13 #include "sandbox/win/src/security_level.h" |
| 14 | 14 |
| 15 namespace sandbox { | 15 namespace sandbox { |
| 16 | 16 |
| 17 class TargetPolicy { | 17 class TargetPolicy { |
| 18 public: | 18 public: |
| 19 // Windows subsystems that can have specific rules. | 19 // Windows subsystems that can have specific rules. |
| 20 // Note: The process subsystem(SUBSY_PROCESS) does not evaluate the request | 20 // Note: The process subsystem(SUBSY_PROCESS) does not evaluate the request |
| 21 // exactly like the CreateProcess API does. See the comment at the top of | 21 // exactly like the CreateProcess API does. See the comment at the top of |
| 22 // process_thread_dispatcher.cc for more details. | 22 // process_thread_dispatcher.cc for more details. |
| 23 enum SubSystem { | 23 enum SubSystem { |
| 24 SUBSYS_FILES, // Creation and opening of files and pipes. | 24 SUBSYS_FILES, // Creation and opening of files and pipes. |
| 25 SUBSYS_NAMED_PIPES, // Creation of named pipes. | 25 SUBSYS_NAMED_PIPES, // Creation of named pipes. |
| 26 SUBSYS_PROCESS, // Creation of child processes. | 26 SUBSYS_PROCESS, // Creation of child processes. |
| 27 SUBSYS_REGISTRY, // Creation and opening of registry keys. | 27 SUBSYS_REGISTRY, // Creation and opening of registry keys. |
| 28 SUBSYS_SYNC, // Creation of named sync objects. | 28 SUBSYS_SYNC, // Creation of named sync objects. |
| 29 SUBSYS_HANDLES // Duplication of handles to other processes. | 29 SUBSYS_HANDLES, // Duplication of handles to other processes. |
| 30 SUBSYS_WIN32K_LOCKDOWN // Win32K Lockdown related policy. | |
| 30 }; | 31 }; |
| 31 | 32 |
| 32 // Allowable semantics when a rule is matched. | 33 // Allowable semantics when a rule is matched. |
| 33 enum Semantics { | 34 enum Semantics { |
| 34 FILES_ALLOW_ANY, // Allows open or create for any kind of access that | 35 FILES_ALLOW_ANY, // Allows open or create for any kind of access that |
| 35 // the file system supports. | 36 // the file system supports. |
| 36 FILES_ALLOW_READONLY, // Allows open or create with read access only. | 37 FILES_ALLOW_READONLY, // Allows open or create with read access only. |
| 37 FILES_ALLOW_QUERY, // Allows access to query the attributes of a file. | 38 FILES_ALLOW_QUERY, // Allows access to query the attributes of a file. |
| 38 FILES_ALLOW_DIR_ANY, // Allows open or create with directory semantics | 39 FILES_ALLOW_DIR_ANY, // Allows open or create with directory semantics |
| 39 // only. | 40 // only. |
| 40 HANDLES_DUP_ANY, // Allows duplicating handles opened with any | 41 HANDLES_DUP_ANY, // Allows duplicating handles opened with any |
| 41 // access permissions. | 42 // access permissions. |
| 42 HANDLES_DUP_BROKER, // Allows duplicating handles to the broker process. | 43 HANDLES_DUP_BROKER, // Allows duplicating handles to the broker process. |
| 43 NAMEDPIPES_ALLOW_ANY, // Allows creation of a named pipe. | 44 NAMEDPIPES_ALLOW_ANY, // Allows creation of a named pipe. |
| 44 PROCESS_MIN_EXEC, // Allows to create a process with minimal rights | 45 PROCESS_MIN_EXEC, // Allows to create a process with minimal rights |
| 45 // over the resulting process and thread handles. | 46 // over the resulting process and thread handles. |
| 46 // No other parameters besides the command line are | 47 // No other parameters besides the command line are |
| 47 // passed to the child process. | 48 // passed to the child process. |
| 48 PROCESS_ALL_EXEC, // Allows the creation of a process and return fill | 49 PROCESS_ALL_EXEC, // Allows the creation of a process and return fill |
| 49 // access on the returned handles. | 50 // access on the returned handles. |
| 50 // This flag can be used only when the main token of | 51 // This flag can be used only when the main token of |
| 51 // the sandboxed application is at least INTERACTIVE. | 52 // the sandboxed application is at least INTERACTIVE. |
| 52 EVENTS_ALLOW_ANY, // Allows the creation of an event with full access. | 53 EVENTS_ALLOW_ANY, // Allows the creation of an event with full access. |
| 53 EVENTS_ALLOW_READONLY, // Allows opening an even with synchronize access. | 54 EVENTS_ALLOW_READONLY, // Allows opening an even with synchronize access. |
| 54 REG_ALLOW_READONLY, // Allows readonly access to a registry key. | 55 REG_ALLOW_READONLY, // Allows readonly access to a registry key. |
| 55 REG_ALLOW_ANY // Allows read and write access to a registry key. | 56 REG_ALLOW_ANY, // Allows read and write access to a registry key. |
| 57 LOCKDOWN_WIN32K // Locks down the Win32K subsystem for the process. | |
|
rvargas (doing something else)
2014/06/09 20:05:57
nit: This seems a little weird. The subsystem is S
ananta
2014/06/10 00:32:10
Renamed this to FAKE_USER32_GDI32_INIT
| |
| 56 }; | 58 }; |
| 57 | 59 |
| 58 // Increments the reference count of this object. The reference count must | 60 // Increments the reference count of this object. The reference count must |
| 59 // be incremented if this interface is given to another component. | 61 // be incremented if this interface is given to another component. |
| 60 virtual void AddRef() = 0; | 62 virtual void AddRef() = 0; |
| 61 | 63 |
| 62 // Decrements the reference count of this object. When the reference count | 64 // Decrements the reference count of this object. When the reference count |
| 63 // is zero the object is automatically destroyed. | 65 // is zero the object is automatically destroyed. |
| 64 // Indicates that the caller is done with this interface. After calling | 66 // Indicates that the caller is done with this interface. After calling |
| 65 // release no other method should be called. | 67 // release no other method should be called. |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 219 // A NULL value for handle_name indicates all handles of the specified type. | 221 // A NULL value for handle_name indicates all handles of the specified type. |
| 220 // An empty string for handle_name indicates the handle is unnamed. | 222 // An empty string for handle_name indicates the handle is unnamed. |
| 221 virtual ResultCode AddKernelObjectToClose(const wchar_t* handle_type, | 223 virtual ResultCode AddKernelObjectToClose(const wchar_t* handle_type, |
| 222 const wchar_t* handle_name) = 0; | 224 const wchar_t* handle_name) = 0; |
| 223 }; | 225 }; |
| 224 | 226 |
| 225 } // namespace sandbox | 227 } // namespace sandbox |
| 226 | 228 |
| 227 | 229 |
| 228 #endif // SANDBOX_WIN_SRC_SANDBOX_POLICY_H_ | 230 #endif // SANDBOX_WIN_SRC_SANDBOX_POLICY_H_ |
| OLD | NEW |