signed_policy.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2019 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.
  4. #ifndef SANDBOX_WIN_SRC_SIGNED_POLICY_H_
  5. #define SANDBOX_WIN_SRC_SIGNED_POLICY_H_
  6. #include <stdint.h>
  7. #include "base/win/scoped_handle.h"
  8. #include "sandbox/win/src/crosscall_server.h"
  9. #include "sandbox/win/src/policy_engine_opcodes.h"
  10. #include "sandbox/win/src/policy_low_level.h"
  11. #include "sandbox/win/src/sandbox_policy.h"
  12. namespace sandbox {
  13. // This class centralizes most of the knowledge related to signed policy
  14. class SignedPolicy {
  15. public:
  16. // Creates the required low-level policy rules to evaluate a high-level
  17. // policy rule.
  18. static bool GenerateRules(const wchar_t* name,
  19. Semantics semantics,
  20. LowLevelPolicy* policy);
  21. // Performs the desired policy action on a request.
  22. // client_info is the target process that is making the request and
  23. // eval_result is the desired policy action to accomplish.
  24. static NTSTATUS CreateSectionAction(
  25. EvalResult eval_result,
  26. const ClientInfo& client_info,
  27. const base::win::ScopedHandle& local_file_handle,
  28. HANDLE* section_handle);
  29. };
  30. } // namespace sandbox
  31. #endif // SANDBOX_WIN_SRC_SIGNED_POLICY_H_