public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Zhichao" <zhichao.gao@intel.com>
To: devel@edk2.groups.io
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>,
	Jian J Wang <jian.j.wang@intel.com>,
	Hao A Wu <hao.a.wu@intel.com>, Ray Ni <ray.ni@intel.com>,
	Star Zeng <star.zeng@intel.com>,
	Liming gao <liming.gao@intel.com>,
	Sean Brogan <sean.brogan@microsoft.com>,
	Michael Turner <Michael.Turner@microsoft.com>
Subject: [PATCH 1/5] MdeModulePkg: Add header file for SecurityLockAuditLib
Date: Mon, 22 Jul 2019 12:02:00 +0800	[thread overview]
Message-ID: <20190722040204.33108-2-zhichao.gao@intel.com> (raw)
In-Reply-To: <20190722040204.33108-1-zhichao.gao@intel.com>

From: Bret Barkelew <Bret.Barkelew@microsoft.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2006

Add header file for SecurityLockAuditLib and add its
file path to dec file.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
---
 .../Include/Library/SecurityLockAuditLib.h    | 47 +++++++++++++++++++
 MdeModulePkg/MdeModulePkg.dec                 |  4 ++
 2 files changed, 51 insertions(+)
 create mode 100644 MdeModulePkg/Include/Library/SecurityLockAuditLib.h

diff --git a/MdeModulePkg/Include/Library/SecurityLockAuditLib.h b/MdeModulePkg/Include/Library/SecurityLockAuditLib.h
new file mode 100644
index 0000000000..db3b145aba
--- /dev/null
+++ b/MdeModulePkg/Include/Library/SecurityLockAuditLib.h
@@ -0,0 +1,47 @@
+/** @file
+
+  This library implements the necessary functions
+  to log hardware and software security locks for post-processing
+
+  Copyright (c) 2018, Microsoft Corporation
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef __SECURITY_LOCK_LIB_H__
+#define __SECURITY_LOCK_LIB_H__
+
+
+#define SECURITY_LOCK_REPORT_EVENT(LockMessage,LockType) \
+      SecurityLockReportEvent (&gEfiCallerIdGuid, __FUNCTION__, LockMessage, LockType);
+
+/**
+  Enum to hold the various lock types for use in post-processing
+
+**/
+typedef enum {
+  SOFTWARE_LOCK = 0,
+  HARDWARE_LOCK,
+} LOCK_TYPE;
+
+
+/**
+  Function for security Lock event logging and reporting
+
+  @param[in] Module                   GUID of calling module
+  @param[in] Function                 Name of calling function
+  @param[in] LockEventText            Event text explaining what is locked
+  @param[in] LockType                 Enumerated lock type for differentiation
+
+**/
+VOID
+EFIAPI
+SecurityLockReportEvent (
+  IN GUID           *Module,
+  IN CONST CHAR8    *Function,
+  IN CONST CHAR8    *LockEventText,
+  IN LOCK_TYPE      LockType
+  );
+
+#endif
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 12e0bbf579..ee2828dd8e 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -153,6 +153,10 @@
   #
   DisplayUpdateProgressLib|Include/Library/DisplayUpdateProgressLib.h
 
+  ##  @libraryclass  Provides a way for logging security locks
+  #
+  SecurityLockAuditLib|Include/Library/SecurityLockAuditLib.h
+
 [Guids]
   ## MdeModule package token space guid
   # Include/Guid/MdeModulePkgTokenSpace.h
-- 
2.21.0.windows.1


  reply	other threads:[~2019-07-22  4:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22  4:01 [PATCH 0/5] Add new lib SecurityLockAuditLib to log message for security event Gao, Zhichao
2019-07-22  4:02 ` Gao, Zhichao [this message]
2019-07-22 20:27   ` [edk2-devel] [PATCH 1/5] MdeModulePkg: Add header file for SecurityLockAuditLib Laszlo Ersek
2019-07-22  4:02 ` [PATCH 2/5] MdeModulePkg/SecurityLockAuditDebugLib: Add lib instance Gao, Zhichao
2019-07-22 20:34   ` [edk2-devel] " Laszlo Ersek
2019-07-22 20:45     ` Laszlo Ersek
2019-07-22 21:06       ` Michael D Kinney
2019-07-23  3:26     ` Wu, Hao A
2019-07-22  4:02 ` [PATCH 3/5] MdeModulePkg/SecurityLockAuditLibNull: Add null version lib Gao, Zhichao
2019-07-22  4:02 ` [PATCH 4/5] MdeModulePkg: Add SecuritAuditLib to dec file Gao, Zhichao
2019-07-22 20:27   ` [edk2-devel] " Laszlo Ersek
2019-07-22  4:02 ` [PATCH 5/5] MdeModulePkg/PiSmmIpl: Use SecurityLockAuditLib for debug Gao, Zhichao
2019-07-22 20:40   ` [edk2-devel] " Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190722040204.33108-2-zhichao.gao@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox