1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 source_set("sandbox") {
9 "src/app_container.cc",
10 "src/app_container.h",
11 "src/broker_services.cc",
12 "src/broker_services.h",
13 "src/crosscall_client.h",
14 "src/crosscall_params.h",
15 "src/crosscall_server.cc",
16 "src/crosscall_server.h",
17 "src/eat_resolver.cc",
19 "src/filesystem_dispatcher.cc",
20 "src/filesystem_dispatcher.h",
21 "src/filesystem_interception.cc",
22 "src/filesystem_interception.h",
23 "src/filesystem_policy.cc",
24 "src/filesystem_policy.h",
25 "src/handle_closer.cc",
26 "src/handle_closer.h",
27 "src/handle_closer_agent.cc",
28 "src/handle_closer_agent.h",
29 "src/handle_dispatcher.cc",
30 "src/handle_dispatcher.h",
31 "src/handle_interception.cc",
32 "src/handle_interception.h",
33 "src/handle_policy.cc",
34 "src/handle_policy.h",
35 "src/handle_table.cc",
37 "src/interception.cc",
39 "src/interception_agent.cc",
40 "src/interception_agent.h",
41 "src/interception_internal.h",
43 "src/internal_types.h",
47 "src/named_pipe_dispatcher.cc",
48 "src/named_pipe_dispatcher.h",
49 "src/named_pipe_interception.cc",
50 "src/named_pipe_interception.h",
51 "src/named_pipe_policy.cc",
52 "src/named_pipe_policy.h",
54 "src/policy_broker.cc",
55 "src/policy_broker.h",
56 "src/policy_engine_opcodes.cc",
57 "src/policy_engine_opcodes.h",
58 "src/policy_engine_params.h",
59 "src/policy_engine_processor.cc",
60 "src/policy_engine_processor.h",
61 "src/policy_low_level.cc",
62 "src/policy_low_level.h",
63 "src/policy_params.h",
64 "src/policy_target.cc",
65 "src/policy_target.h",
66 "src/process_mitigations.cc",
67 "src/process_mitigations.h",
68 "src/process_thread_dispatcher.cc",
69 "src/process_thread_dispatcher.h",
70 "src/process_thread_interception.cc",
71 "src/process_thread_interception.h",
72 "src/process_thread_policy.cc",
73 "src/process_thread_policy.h",
74 "src/registry_dispatcher.cc",
75 "src/registry_dispatcher.h",
76 "src/registry_interception.cc",
77 "src/registry_interception.h",
78 "src/registry_policy.cc",
79 "src/registry_policy.h",
82 "src/restricted_token_utils.cc",
83 "src/restricted_token_utils.h",
84 "src/restricted_token.cc",
85 "src/restricted_token.h",
86 "src/sandbox_factory.h",
87 "src/sandbox_globals.cc",
88 "src/sandbox_nt_types.h",
89 "src/sandbox_nt_util.cc",
90 "src/sandbox_nt_util.h",
91 "src/sandbox_policy_base.cc",
92 "src/sandbox_policy_base.h",
93 "src/sandbox_policy.h",
94 "src/sandbox_types.h",
95 "src/sandbox_utils.cc",
96 "src/sandbox_utils.h",
99 "src/security_level.h",
100 "src/service_resolver.cc",
101 "src/service_resolver.h",
102 "src/shared_handles.cc",
103 "src/shared_handles.h",
104 "src/sharedmem_ipc_client.cc",
105 "src/sharedmem_ipc_client.h",
106 "src/sharedmem_ipc_server.cc",
107 "src/sharedmem_ipc_server.h",
110 "src/sync_dispatcher.cc",
111 "src/sync_dispatcher.h",
112 "src/sync_interception.cc",
113 "src/sync_interception.h",
114 "src/sync_policy.cc",
116 "src/target_interceptions.cc",
117 "src/target_interceptions.h",
118 "src/target_process.cc",
119 "src/target_process.h",
120 "src/target_services.cc",
121 "src/target_services.h",
124 "src/win2k_threadpool.cc",
125 "src/win2k_threadpool.h",
130 if (cpu_arch == "x64" ){
132 "src/interceptors_64.cc",
133 "src/interceptors_64.h",
134 "src/resolver_64.cc",
135 "src/service_resolver_64.cc",
138 } else if (cpu_arch == "x86") {
140 "src/resolver_32.cc",
141 "src/service_resolver_32.cc",
142 "src/sidestep_resolver.cc",
143 "src/sidestep_resolver.h",
144 "src/sidestep/ia32_modrm_map.cpp",
145 "src/sidestep/ia32_opcode_map.cpp",
146 "src/sidestep/mini_disassembler_types.h",
147 "src/sidestep/mini_disassembler.cpp",
148 "src/sidestep/mini_disassembler.h",
149 "src/sidestep/preamble_patcher_with_stub.cpp",
150 "src/sidestep/preamble_patcher.h",
162 if (cpu_arch == "x86") {
163 # Make a target that copies the wow_helper files to the out dir.
165 # TODO(brettw) we can probably just build this now that we have proper
167 copy("copy_wow_helper") {
169 "wow_helper/wow_helper.exe",
170 "wow_helper/wow_helper.pdb",
172 outputs = [ "$root_out_dir/{{source_file_part}}" ]
176 test("sbox_integration_tests") {
178 "src/app_container_test.cc",
179 "src/file_policy_test.cc",
180 "src/handle_inheritance_test.cc",
181 "src/handle_policy_test.cc",
182 "tests/integration_tests/integration_tests_test.cc",
183 "src/handle_closer_test.cc",
184 "src/integrity_level_test.cc",
185 "src/ipc_ping_test.cc",
186 "src/named_pipe_policy_test.cc",
187 "src/policy_target_test.cc",
188 "src/process_mitigations_test.cc",
189 "src/process_policy_test.cc",
190 "src/registry_policy_test.cc",
191 "src/sync_policy_test.cc",
192 "src/sync_policy_test.h",
193 "src/unload_dll_test.cc",
194 "tests/common/controller.cc",
195 "tests/common/controller.h",
196 "tests/common/test_utils.cc",
197 "tests/common/test_utils.h",
198 "tests/integration_tests/integration_tests.cc",
207 test("sbox_validation_tests") {
209 "tests/common/controller.cc",
210 "tests/common/controller.h",
211 "tests/validation_tests/unit_tests.cc",
212 "tests/validation_tests/commands.cc",
213 "tests/validation_tests/commands.h",
214 "tests/validation_tests/suite.cc",
223 test("sbox_unittests") {
225 "src/app_container_unittest.cc",
226 "src/interception_unittest.cc",
227 "src/service_resolver_unittest.cc",
228 "src/restricted_token_unittest.cc",
229 "src/job_unittest.cc",
230 "src/sid_unittest.cc",
231 "src/policy_engine_unittest.cc",
232 "src/policy_low_level_unittest.cc",
233 "src/policy_opcodes_unittest.cc",
234 "src/ipc_unittest.cc",
235 "src/threadpool_unittest.cc",
236 "src/win_utils_unittest.cc",
237 "tests/common/test_utils.cc",
238 "tests/common/test_utils.h",
239 "tests/unit_tests/unit_tests.cc",
248 test("sandbox_poc") {
250 "sandbox_poc/main_ui_window.cc",
251 "sandbox_poc/main_ui_window.h",
252 "sandbox_poc/resource.h",
253 "sandbox_poc/sandbox.cc",
254 "sandbox_poc/sandbox.h",
255 "sandbox_poc/sandbox.ico",
256 "sandbox_poc/sandbox.rc",
259 configs -= [ "//build/config/win:console" ]
260 configs += [ "//build/config/win:windowed" ]
262 libs = [ "comctl32.lib" ]
270 shared_library("pocdll") {
272 "sandbox_poc/pocdll/exports.h",
273 "sandbox_poc/pocdll/fs.cc",
274 "sandbox_poc/pocdll/handles.cc",
275 "sandbox_poc/pocdll/invasive.cc",
276 "sandbox_poc/pocdll/network.cc",
277 "sandbox_poc/pocdll/pocdll.cc",
278 "sandbox_poc/pocdll/processes_and_threads.cc",
279 "sandbox_poc/pocdll/registry.cc",
280 "sandbox_poc/pocdll/spyware.cc",
281 "sandbox_poc/pocdll/utils.h",
284 defines = [ "POCDLL_EXPORTS" ]