Skip to content

ImageValidation: Add default configuration#1100

Merged
Javagedes merged 12 commits intomicrosoft:release/202405from
Javagedes:update-image-validation
Aug 12, 2024
Merged

ImageValidation: Add default configuration#1100
Javagedes merged 12 commits intomicrosoft:release/202405from
Javagedes:update-image-validation

Conversation

@Javagedes
Copy link
Copy Markdown
Contributor

@Javagedes Javagedes commented Aug 9, 2024

Description

Previously, ImageValidation was an "opt-in" plugin by setting a build variable PE_VALIDATION_PATH, however with this pull request, Image Validation will be on by default, with some default configuration that can be changed with a custom configuration yaml file.

The default requirements are:

  1. All efi binaries must not be both write and execute
  2. All efi binaries must have an image base of 0x0
  3. All dxe phase binaries must be 4k section aligned, with the one exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an IGNORE_LIST in the configuration file

{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
  • Impacts functionality?
    • Functionality - Does the change ultimately impact how firmware functions?
    • Examples: Add a new library, publish a new PPI, update an algorithm, ...
  • Impacts security?
    • Security - Does the change have a direct security impact on an application,
      flow, or firmware?
    • Examples: Crypto algorithm change, buffer overflow fix, parameter
      validation improvement, ...
  • Breaking change?
    • Breaking change - Will anyone consuming this change experience a break
      in build or boot behavior?
    • Examples: Add a new library class, move a module to a different repo, call
      a function in a new library class in a pre-existing module, ...
  • Includes tests?
    • Tests - Does the change include any explicit test code?
    • Examples: Unit tests, integration tests, robot tests, ...
  • Includes documentation?
    • Documentation - Does the change contain explicit documentation additions
      outside direct code modifications (and comments)?
    • Examples: Update readme file, add feature readme file, link to documentation
      on an a separate Web page, ...

How This Was Tested

Confirmed successful execution of the plugin on Windows with QemuQ35 and Ubuntu with QemuSbsa

Integration Instructions

Platforms that begin to fail this test will need to generate a configuration yaml file, and set a stuart build variable, PE_VALIDATION_PATH to it. It is suggested to do this in the Platform's PlatformBuild.py.

The Correct Integration is to evaluate the binary and why it is not meeting the requirements. The platform can elect to update the compilation of the binary to meet the requirements, add or override validation rules for certain MODULE_TYPEs, or simply add the binary to the ignore list. Please review the Plugin's readme.md file for more details on doing any of these things.

@github-actions github-actions bot added impact:breaking-change Requires integration attention impact:non-functional Does not have a functional impact type:documentation Improvements or additions to documentation labels Aug 9, 2024
@makubacki makubacki self-requested a review August 9, 2024 00:56
@makubacki
Copy link
Copy Markdown
Member

I'd like to review when I have more time. Please hold off on merging until I can come back.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Aug 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (release/202405@1906ad9). Learn more about missing BASE report.

Additional details and impacted files
@@                Coverage Diff                @@
##             release/202405    #1100   +/-   ##
=================================================
  Coverage                  ?    1.59%           
=================================================
  Files                     ?     1448           
  Lines                     ?   361063           
  Branches                  ?     5553           
=================================================
  Hits                      ?     5765           
  Misses                    ?   355191           
  Partials                  ?      107           
Flag Coverage Δ
MdeModulePkg 0.68% <ø> (?)
MdePkg 5.41% <ø> (?)
NetworkPkg 0.55% <ø> (?)
PolicyServicePkg 30.41% <ø> (?)
UefiCpuPkg 4.77% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread .pytool/Plugin/ImageValidation/ImageValidation.py Outdated
Comment thread .pytool/Plugin/ImageValidation/ReadMe.md
Comment thread .pytool/Plugin/ImageValidation/ReadMe.md Outdated
Comment thread .pytool/Plugin/ImageValidation/ReadMe.md
@makubacki makubacki added the type:design-change A new proposal or modification to a feature design label Aug 9, 2024
Comment thread .pytool/Plugin/ImageValidation/ReadMe.md Outdated
Comment thread .pytool/Plugin/ImageValidation/ReadMe.md Outdated
@Javagedes Javagedes merged commit 6310e1e into microsoft:release/202405 Aug 12, 2024
Javagedes added a commit that referenced this pull request Aug 12, 2024
…1104)

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

A cherry-pick of #1100 into release/202311

- [ ] Impacts functionality?
- [ ] Impacts security?
- [x] Breaking change?
- [ ] Includes tests?
- [x] Includes documentation?

## How This Was Tested

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

## Integration Instructions

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Signed-off-by: Joey Vagedes <joey.vagedes@gmail.com>
Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
apop5 pushed a commit to apop5/mu_basecore that referenced this pull request Jan 2, 2025
The addition of an PE/COFF image validation build plugin that will
verify all pe images against requirements defined in the configuration
file.

This plugin only runs if a path to a config file is provided via the
command line (PE_VALIDATION_PATH) or preferably Platform hardcoded in
the PlatformBuild.py file, so that each platform can have their own
requirements.

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

In previous iterations, the profile was determined by parsing the
makefile, looking for MODULE_TYPE. As each OS / tool chain may use a
different makefile type, this was not a reliable method. This updates
the plugin to read the INF for the compiled efi file to determine the
MODULE_TYPE and thus the profile.

The PE parsing functionality was modified to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

- Print directory paths considered invalid to aid debugging
- Build native OS file paths using os.path.join for walk dirs
- Clean up trailing whitespace throughout the file

Add gitignore style syntax for file exclusion

Contains:
- microsoft#340
- microsoft#537
- microsoft#539
- microsoft#747
- microsoft#1100
- microsoft#1127
- microsoft#1142
- microsoft#1140

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

Validated on qemuq35 that the module type was successfully parsed.

Validated pipelines build on mu_tiano_platforms

- Local build with the plugin
- Tested invalid directory printing by adding an invalid arch
  to `TARGET_ARCH` (so the directory doesn't exist in build output).

Ensured existing syntax (filename only) continues to work. Ensured
gitignore style syntax now works.

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
apop5 pushed a commit to apop5/mu_basecore that referenced this pull request Feb 2, 2025
The addition of an PE/COFF image validation build plugin that will
verify all pe images against requirements defined in the configuration
file.

This plugin only runs if a path to a config file is provided via the
command line (PE_VALIDATION_PATH) or preferably Platform hardcoded in
the PlatformBuild.py file, so that each platform can have their own
requirements.

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

In previous iterations, the profile was determined by parsing the
makefile, looking for MODULE_TYPE. As each OS / tool chain may use a
different makefile type, this was not a reliable method. This updates
the plugin to read the INF for the compiled efi file to determine the
MODULE_TYPE and thus the profile.

The PE parsing functionality was modified to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

- Print directory paths considered invalid to aid debugging
- Build native OS file paths using os.path.join for walk dirs
- Clean up trailing whitespace throughout the file

Add gitignore style syntax for file exclusion

Contains:
- microsoft#340
- microsoft#537
- microsoft#539
- microsoft#747
- microsoft#1100
- microsoft#1127
- microsoft#1142
- microsoft#1140

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

Validated on qemuq35 that the module type was successfully parsed.

Validated pipelines build on mu_tiano_platforms

- Local build with the plugin
- Tested invalid directory printing by adding an invalid arch
  to `TARGET_ARCH` (so the directory doesn't exist in build output).

Ensured existing syntax (filename only) continues to work. Ensured
gitignore style syntax now works.

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
apop5 pushed a commit to apop5/mu_basecore that referenced this pull request Feb 3, 2025
The addition of an PE/COFF image validation build plugin that will
verify all pe images against requirements defined in the configuration
file.

This plugin only runs if a path to a config file is provided via the
command line (PE_VALIDATION_PATH) or preferably Platform hardcoded in
the PlatformBuild.py file, so that each platform can have their own
requirements.

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

In previous iterations, the profile was determined by parsing the
makefile, looking for MODULE_TYPE. As each OS / tool chain may use a
different makefile type, this was not a reliable method. This updates
the plugin to read the INF for the compiled efi file to determine the
MODULE_TYPE and thus the profile.

The PE parsing functionality was modified to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

- Print directory paths considered invalid to aid debugging
- Build native OS file paths using os.path.join for walk dirs
- Clean up trailing whitespace throughout the file

Add gitignore style syntax for file exclusion

Contains:
- microsoft#340
- microsoft#537
- microsoft#539
- microsoft#747
- microsoft#1100
- microsoft#1127
- microsoft#1142
- microsoft#1140

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

Validated on qemuq35 that the module type was successfully parsed.

Validated pipelines build on mu_tiano_platforms

- Local build with the plugin
- Tested invalid directory printing by adding an invalid arch
  to `TARGET_ARCH` (so the directory doesn't exist in build output).

Ensured existing syntax (filename only) continues to work. Ensured
gitignore style syntax now works.

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
apop5 pushed a commit that referenced this pull request Feb 3, 2025
The addition of an PE/COFF image validation build plugin that will
verify all pe images against requirements defined in the configuration
file.

This plugin only runs if a path to a config file is provided via the
command line (PE_VALIDATION_PATH) or preferably Platform hardcoded in
the PlatformBuild.py file, so that each platform can have their own
requirements.

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

In previous iterations, the profile was determined by parsing the
makefile, looking for MODULE_TYPE. As each OS / tool chain may use a
different makefile type, this was not a reliable method. This updates
the plugin to read the INF for the compiled efi file to determine the
MODULE_TYPE and thus the profile.

The PE parsing functionality was modified to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

- Print directory paths considered invalid to aid debugging
- Build native OS file paths using os.path.join for walk dirs
- Clean up trailing whitespace throughout the file

Add gitignore style syntax for file exclusion

Contains:
- #340
- #537
- #539
- #747
- #1100
- #1127
- #1142
- #1140

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

Validated on qemuq35 that the module type was successfully parsed.

Validated pipelines build on mu_tiano_platforms

- Local build with the plugin
- Tested invalid directory printing by adding an invalid arch
  to `TARGET_ARCH` (so the directory doesn't exist in build output).

Ensured existing syntax (filename only) continues to work. Ensured
gitignore style syntax now works.

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
apop5 pushed a commit that referenced this pull request Feb 10, 2025
The addition of an PE/COFF image validation build plugin that will
verify all pe images against requirements defined in the configuration
file.

This plugin only runs if a path to a config file is provided via the
command line (PE_VALIDATION_PATH) or preferably Platform hardcoded in
the PlatformBuild.py file, so that each platform can have their own
requirements.

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

In previous iterations, the profile was determined by parsing the
makefile, looking for MODULE_TYPE. As each OS / tool chain may use a
different makefile type, this was not a reliable method. This updates
the plugin to read the INF for the compiled efi file to determine the
MODULE_TYPE and thus the profile.

The PE parsing functionality was modified to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

- Print directory paths considered invalid to aid debugging
- Build native OS file paths using os.path.join for walk dirs
- Clean up trailing whitespace throughout the file

Add gitignore style syntax for file exclusion

Contains:
- #340
- #537
- #539
- #747
- #1100
- #1127
- #1142
- #1140

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

Validated on qemuq35 that the module type was successfully parsed.

Validated pipelines build on mu_tiano_platforms

- Local build with the plugin
- Tested invalid directory printing by adding an invalid arch
  to `TARGET_ARCH` (so the directory doesn't exist in build output).

Ensured existing syntax (filename only) continues to work. Ensured
gitignore style syntax now works.

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
apop5 pushed a commit that referenced this pull request Feb 14, 2025
The addition of an PE/COFF image validation build plugin that will
verify all pe images against requirements defined in the configuration
file.

This plugin only runs if a path to a config file is provided via the
command line (PE_VALIDATION_PATH) or preferably Platform hardcoded in
the PlatformBuild.py file, so that each platform can have their own
requirements.

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

In previous iterations, the profile was determined by parsing the
makefile, looking for MODULE_TYPE. As each OS / tool chain may use a
different makefile type, this was not a reliable method. This updates
the plugin to read the INF for the compiled efi file to determine the
MODULE_TYPE and thus the profile.

The PE parsing functionality was modified to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

- Print directory paths considered invalid to aid debugging
- Build native OS file paths using os.path.join for walk dirs
- Clean up trailing whitespace throughout the file

Add gitignore style syntax for file exclusion

Contains:
- #340
- #537
- #539
- #747
- #1100
- #1127
- #1142
- #1140

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

Validated on qemuq35 that the module type was successfully parsed.

Validated pipelines build on mu_tiano_platforms

- Local build with the plugin
- Tested invalid directory printing by adding an invalid arch
  to `TARGET_ARCH` (so the directory doesn't exist in build output).

Ensured existing syntax (filename only) continues to work. Ensured
gitignore style syntax now works.

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
apop5 pushed a commit that referenced this pull request Feb 14, 2025
The addition of an PE/COFF image validation build plugin that will
verify all pe images against requirements defined in the configuration
file.

This plugin only runs if a path to a config file is provided via the
command line (PE_VALIDATION_PATH) or preferably Platform hardcoded in
the PlatformBuild.py file, so that each platform can have their own
requirements.

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

In previous iterations, the profile was determined by parsing the
makefile, looking for MODULE_TYPE. As each OS / tool chain may use a
different makefile type, this was not a reliable method. This updates
the plugin to read the INF for the compiled efi file to determine the
MODULE_TYPE and thus the profile.

The PE parsing functionality was modified to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

- Print directory paths considered invalid to aid debugging
- Build native OS file paths using os.path.join for walk dirs
- Clean up trailing whitespace throughout the file

Add gitignore style syntax for file exclusion

Contains:
- #340
- #537
- #539
- #747
- #1100
- #1127
- #1142
- #1140

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

Validated on qemuq35 that the module type was successfully parsed.

Validated pipelines build on mu_tiano_platforms

- Local build with the plugin
- Tested invalid directory printing by adding an invalid arch
  to `TARGET_ARCH` (so the directory doesn't exist in build output).

Ensured existing syntax (filename only) continues to work. Ensured
gitignore style syntax now works.

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
apop5 pushed a commit to apop5/mu_basecore that referenced this pull request Feb 24, 2025
The addition of an PE/COFF image validation build plugin that will
verify all pe images against requirements defined in the configuration
file.

This plugin only runs if a path to a config file is provided via the
command line (PE_VALIDATION_PATH) or preferably Platform hardcoded in
the PlatformBuild.py file, so that each platform can have their own
requirements.

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

In previous iterations, the profile was determined by parsing the
makefile, looking for MODULE_TYPE. As each OS / tool chain may use a
different makefile type, this was not a reliable method. This updates
the plugin to read the INF for the compiled efi file to determine the
MODULE_TYPE and thus the profile.

The PE parsing functionality was modified to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

- Print directory paths considered invalid to aid debugging
- Build native OS file paths using os.path.join for walk dirs
- Clean up trailing whitespace throughout the file

Add gitignore style syntax for file exclusion

Contains:
- microsoft#340
- microsoft#537
- microsoft#539
- microsoft#747
- microsoft#1100
- microsoft#1127
- microsoft#1142
- microsoft#1140

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

Validated on qemuq35 that the module type was successfully parsed.

Validated pipelines build on mu_tiano_platforms

- Local build with the plugin
- Tested invalid directory printing by adding an invalid arch
  to `TARGET_ARCH` (so the directory doesn't exist in build output).

Ensured existing syntax (filename only) continues to work. Ensured
gitignore style syntax now works.

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
apop5 pushed a commit that referenced this pull request Feb 27, 2025
The addition of an PE/COFF image validation build plugin that will
verify all pe images against requirements defined in the configuration
file.

This plugin only runs if a path to a config file is provided via the
command line (PE_VALIDATION_PATH) or preferably Platform hardcoded in
the PlatformBuild.py file, so that each platform can have their own
requirements.

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

In previous iterations, the profile was determined by parsing the
makefile, looking for MODULE_TYPE. As each OS / tool chain may use a
different makefile type, this was not a reliable method. This updates
the plugin to read the INF for the compiled efi file to determine the
MODULE_TYPE and thus the profile.

The PE parsing functionality was modified to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

- Print directory paths considered invalid to aid debugging
- Build native OS file paths using os.path.join for walk dirs
- Clean up trailing whitespace throughout the file

Add gitignore style syntax for file exclusion

Contains:
- #340
- #537
- #539
- #747
- #1100
- #1127
- #1142
- #1140

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

Validated on qemuq35 that the module type was successfully parsed.

Validated pipelines build on mu_tiano_platforms

- Local build with the plugin
- Tested invalid directory printing by adding an invalid arch
  to `TARGET_ARCH` (so the directory doesn't exist in build output).

Ensured existing syntax (filename only) continues to work. Ensured
gitignore style syntax now works.

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
apop5 pushed a commit that referenced this pull request Feb 28, 2025
The addition of an PE/COFF image validation build plugin that will
verify all pe images against requirements defined in the configuration
file.

This plugin only runs if a path to a config file is provided via the
command line (PE_VALIDATION_PATH) or preferably Platform hardcoded in
the PlatformBuild.py file, so that each platform can have their own
requirements.

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

In previous iterations, the profile was determined by parsing the
makefile, looking for MODULE_TYPE. As each OS / tool chain may use a
different makefile type, this was not a reliable method. This updates
the plugin to read the INF for the compiled efi file to determine the
MODULE_TYPE and thus the profile.

The PE parsing functionality was modified to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

- Print directory paths considered invalid to aid debugging
- Build native OS file paths using os.path.join for walk dirs
- Clean up trailing whitespace throughout the file

Add gitignore style syntax for file exclusion

Contains:
- #340
- #537
- #539
- #747
- #1100
- #1127
- #1142
- #1140

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

Validated on qemuq35 that the module type was successfully parsed.

Validated pipelines build on mu_tiano_platforms

- Local build with the plugin
- Tested invalid directory printing by adding an invalid arch
  to `TARGET_ARCH` (so the directory doesn't exist in build output).

Ensured existing syntax (filename only) continues to work. Ensured
gitignore style syntax now works.

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
apop5 pushed a commit that referenced this pull request Mar 2, 2025
The addition of an PE/COFF image validation build plugin that will
verify all pe images against requirements defined in the configuration
file.

This plugin only runs if a path to a config file is provided via the
command line (PE_VALIDATION_PATH) or preferably Platform hardcoded in
the PlatformBuild.py file, so that each platform can have their own
requirements.

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

In previous iterations, the profile was determined by parsing the
makefile, looking for MODULE_TYPE. As each OS / tool chain may use a
different makefile type, this was not a reliable method. This updates
the plugin to read the INF for the compiled efi file to determine the
MODULE_TYPE and thus the profile.

The PE parsing functionality was modified to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

- Print directory paths considered invalid to aid debugging
- Build native OS file paths using os.path.join for walk dirs
- Clean up trailing whitespace throughout the file

Add gitignore style syntax for file exclusion

Contains:
- #340
- #537
- #539
- #747
- #1100
- #1127
- #1142
- #1140

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

Validated on qemuq35 that the module type was successfully parsed.

Validated pipelines build on mu_tiano_platforms

- Local build with the plugin
- Tested invalid directory printing by adding an invalid arch
  to `TARGET_ARCH` (so the directory doesn't exist in build output).

Ensured existing syntax (filename only) continues to work. Ensured
gitignore style syntax now works.

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
apop5 pushed a commit that referenced this pull request Mar 3, 2025
The addition of an PE/COFF image validation build plugin that will
verify all pe images against requirements defined in the configuration
file.

This plugin only runs if a path to a config file is provided via the
command line (PE_VALIDATION_PATH) or preferably Platform hardcoded in
the PlatformBuild.py file, so that each platform can have their own
requirements.

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

In previous iterations, the profile was determined by parsing the
makefile, looking for MODULE_TYPE. As each OS / tool chain may use a
different makefile type, this was not a reliable method. This updates
the plugin to read the INF for the compiled efi file to determine the
MODULE_TYPE and thus the profile.

The PE parsing functionality was modified to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

- Print directory paths considered invalid to aid debugging
- Build native OS file paths using os.path.join for walk dirs
- Clean up trailing whitespace throughout the file

Add gitignore style syntax for file exclusion

Contains:
- #340
- #537
- #539
- #747
- #1100
- #1127
- #1142
- #1140

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

Validated on qemuq35 that the module type was successfully parsed.

Validated pipelines build on mu_tiano_platforms

- Local build with the plugin
- Tested invalid directory printing by adding an invalid arch
  to `TARGET_ARCH` (so the directory doesn't exist in build output).

Ensured existing syntax (filename only) continues to work. Ensured
gitignore style syntax now works.

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
apop5 pushed a commit to apop5/mu_basecore that referenced this pull request Dec 2, 2025
The addition of an PE/COFF image validation build plugin that will
verify all pe images against requirements defined in the configuration
file.

This plugin only runs if a path to a config file is provided via the
command line (PE_VALIDATION_PATH) or preferably Platform hardcoded in
the PlatformBuild.py file, so that each platform can have their own
requirements.

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

In previous iterations, the profile was determined by parsing the
makefile, looking for MODULE_TYPE. As each OS / tool chain may use a
different makefile type, this was not a reliable method. This updates
the plugin to read the INF for the compiled efi file to determine the
MODULE_TYPE and thus the profile.

The PE parsing functionality was modified to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

- Print directory paths considered invalid to aid debugging
- Build native OS file paths using os.path.join for walk dirs
- Clean up trailing whitespace throughout the file

Add gitignore style syntax for file exclusion

Contains:
- microsoft#340
- microsoft#537
- microsoft#539
- microsoft#747
- microsoft#1100
- microsoft#1127
- microsoft#1142
- microsoft#1140

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

Validated on qemuq35 that the module type was successfully parsed.

Validated pipelines build on mu_tiano_platforms

- Local build with the plugin
- Tested invalid directory printing by adding an invalid arch
  to `TARGET_ARCH` (so the directory doesn't exist in build output).

Ensured existing syntax (filename only) continues to work. Ensured
gitignore style syntax now works.

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
apop5 pushed a commit to apop5/mu_basecore that referenced this pull request Dec 15, 2025
The addition of an PE/COFF image validation build plugin that will
verify all pe images against requirements defined in the configuration
file.

This plugin only runs if a path to a config file is provided via the
command line (PE_VALIDATION_PATH) or preferably Platform hardcoded in
the PlatformBuild.py file, so that each platform can have their own
requirements.

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

In previous iterations, the profile was determined by parsing the
makefile, looking for MODULE_TYPE. As each OS / tool chain may use a
different makefile type, this was not a reliable method. This updates
the plugin to read the INF for the compiled efi file to determine the
MODULE_TYPE and thus the profile.

The PE parsing functionality was modified to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

- Print directory paths considered invalid to aid debugging
- Build native OS file paths using os.path.join for walk dirs
- Clean up trailing whitespace throughout the file

Add gitignore style syntax for file exclusion

Contains:
- microsoft#340
- microsoft#537
- microsoft#539
- microsoft#747
- microsoft#1100
- microsoft#1127
- microsoft#1142
- microsoft#1140

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

Validated on qemuq35 that the module type was successfully parsed.

Validated pipelines build on mu_tiano_platforms

- Local build with the plugin
- Tested invalid directory printing by adding an invalid arch
  to `TARGET_ARCH` (so the directory doesn't exist in build output).

Ensured existing syntax (filename only) continues to work. Ensured
gitignore style syntax now works.

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
apop5 pushed a commit to apop5/mu_basecore that referenced this pull request Dec 16, 2025
The addition of an PE/COFF image validation build plugin that will
verify all pe images against requirements defined in the configuration
file.

This plugin only runs if a path to a config file is provided via the
command line (PE_VALIDATION_PATH) or preferably Platform hardcoded in
the PlatformBuild.py file, so that each platform can have their own
requirements.

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

In previous iterations, the profile was determined by parsing the
makefile, looking for MODULE_TYPE. As each OS / tool chain may use a
different makefile type, this was not a reliable method. This updates
the plugin to read the INF for the compiled efi file to determine the
MODULE_TYPE and thus the profile.

The PE parsing functionality was modified to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

- Print directory paths considered invalid to aid debugging
- Build native OS file paths using os.path.join for walk dirs
- Clean up trailing whitespace throughout the file

Add gitignore style syntax for file exclusion

Contains:
- microsoft#340
- microsoft#537
- microsoft#539
- microsoft#747
- microsoft#1100
- microsoft#1127
- microsoft#1142
- microsoft#1140

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

Validated on qemuq35 that the module type was successfully parsed.

Validated pipelines build on mu_tiano_platforms

- Local build with the plugin
- Tested invalid directory printing by adding an invalid arch
  to `TARGET_ARCH` (so the directory doesn't exist in build output).

Ensured existing syntax (filename only) continues to work. Ensured
gitignore style syntax now works.

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
apop5 pushed a commit to apop5/mu_basecore that referenced this pull request Dec 17, 2025
The addition of an PE/COFF image validation build plugin that will
verify all pe images against requirements defined in the configuration
file.

This plugin only runs if a path to a config file is provided via the
command line (PE_VALIDATION_PATH) or preferably Platform hardcoded in
the PlatformBuild.py file, so that each platform can have their own
requirements.

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

In previous iterations, the profile was determined by parsing the
makefile, looking for MODULE_TYPE. As each OS / tool chain may use a
different makefile type, this was not a reliable method. This updates
the plugin to read the INF for the compiled efi file to determine the
MODULE_TYPE and thus the profile.

The PE parsing functionality was modified to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

- Print directory paths considered invalid to aid debugging
- Build native OS file paths using os.path.join for walk dirs
- Clean up trailing whitespace throughout the file

Add gitignore style syntax for file exclusion

Contains:
- microsoft#340
- microsoft#537
- microsoft#539
- microsoft#747
- microsoft#1100
- microsoft#1127
- microsoft#1142
- microsoft#1140

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

Validated on qemuq35 that the module type was successfully parsed.

Validated pipelines build on mu_tiano_platforms

- Local build with the plugin
- Tested invalid directory printing by adding an invalid arch
  to `TARGET_ARCH` (so the directory doesn't exist in build output).

Ensured existing syntax (filename only) continues to work. Ensured
gitignore style syntax now works.

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
apop5 pushed a commit to apop5/mu_basecore that referenced this pull request Dec 22, 2025
The addition of an PE/COFF image validation build plugin that will
verify all pe images against requirements defined in the configuration
file.

This plugin only runs if a path to a config file is provided via the
command line (PE_VALIDATION_PATH) or preferably Platform hardcoded in
the PlatformBuild.py file, so that each platform can have their own
requirements.

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

In previous iterations, the profile was determined by parsing the
makefile, looking for MODULE_TYPE. As each OS / tool chain may use a
different makefile type, this was not a reliable method. This updates
the plugin to read the INF for the compiled efi file to determine the
MODULE_TYPE and thus the profile.

The PE parsing functionality was modified to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

- Print directory paths considered invalid to aid debugging
- Build native OS file paths using os.path.join for walk dirs
- Clean up trailing whitespace throughout the file

Add gitignore style syntax for file exclusion

Contains:
- microsoft#340
- microsoft#537
- microsoft#539
- microsoft#747
- microsoft#1100
- microsoft#1127
- microsoft#1142
- microsoft#1140

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

Validated on qemuq35 that the module type was successfully parsed.

Validated pipelines build on mu_tiano_platforms

- Local build with the plugin
- Tested invalid directory printing by adding an invalid arch
  to `TARGET_ARCH` (so the directory doesn't exist in build output).

Ensured existing syntax (filename only) continues to work. Ensured
gitignore style syntax now works.

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
apop5 pushed a commit to apop5/mu_basecore that referenced this pull request Jan 7, 2026
The addition of an PE/COFF image validation build plugin that will
verify all pe images against requirements defined in the configuration
file.

This plugin only runs if a path to a config file is provided via the
command line (PE_VALIDATION_PATH) or preferably Platform hardcoded in
the PlatformBuild.py file, so that each platform can have their own
requirements.

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

In previous iterations, the profile was determined by parsing the
makefile, looking for MODULE_TYPE. As each OS / tool chain may use a
different makefile type, this was not a reliable method. This updates
the plugin to read the INF for the compiled efi file to determine the
MODULE_TYPE and thus the profile.

The PE parsing functionality was modified to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

- Print directory paths considered invalid to aid debugging
- Build native OS file paths using os.path.join for walk dirs
- Clean up trailing whitespace throughout the file

Add gitignore style syntax for file exclusion

Contains:
- microsoft#340
- microsoft#537
- microsoft#539
- microsoft#747
- microsoft#1100
- microsoft#1127
- microsoft#1142
- microsoft#1140

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

Validated on qemuq35 that the module type was successfully parsed.

Validated pipelines build on mu_tiano_platforms

- Local build with the plugin
- Tested invalid directory printing by adding an invalid arch
  to `TARGET_ARCH` (so the directory doesn't exist in build output).

Ensured existing syntax (filename only) continues to work. Ensured
gitignore style syntax now works.

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
apop5 pushed a commit that referenced this pull request Jan 10, 2026
The addition of an PE/COFF image validation build plugin that will
verify all pe images against requirements defined in the configuration
file.

This plugin only runs if a path to a config file is provided via the
command line (PE_VALIDATION_PATH) or preferably Platform hardcoded in
the PlatformBuild.py file, so that each platform can have their own
requirements.

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

In previous iterations, the profile was determined by parsing the
makefile, looking for MODULE_TYPE. As each OS / tool chain may use a
different makefile type, this was not a reliable method. This updates
the plugin to read the INF for the compiled efi file to determine the
MODULE_TYPE and thus the profile.

The PE parsing functionality was modified to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

- Print directory paths considered invalid to aid debugging
- Build native OS file paths using os.path.join for walk dirs
- Clean up trailing whitespace throughout the file

Add gitignore style syntax for file exclusion

Contains:
- #340
- #537
- #539
- #747
- #1100
- #1127
- #1142
- #1140

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

Validated on qemuq35 that the module type was successfully parsed.

Validated pipelines build on mu_tiano_platforms

- Local build with the plugin
- Tested invalid directory printing by adding an invalid arch
  to `TARGET_ARCH` (so the directory doesn't exist in build output).

Ensured existing syntax (filename only) continues to work. Ensured
gitignore style syntax now works.

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
apop5 pushed a commit that referenced this pull request Jan 12, 2026
The addition of an PE/COFF image validation build plugin that will
verify all pe images against requirements defined in the configuration
file.

This plugin only runs if a path to a config file is provided via the
command line (PE_VALIDATION_PATH) or preferably Platform hardcoded in
the PlatformBuild.py file, so that each platform can have their own
requirements.

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

In previous iterations, the profile was determined by parsing the
makefile, looking for MODULE_TYPE. As each OS / tool chain may use a
different makefile type, this was not a reliable method. This updates
the plugin to read the INF for the compiled efi file to determine the
MODULE_TYPE and thus the profile.

The PE parsing functionality was modified to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

- Print directory paths considered invalid to aid debugging
- Build native OS file paths using os.path.join for walk dirs
- Clean up trailing whitespace throughout the file

Add gitignore style syntax for file exclusion

Contains:
- #340
- #537
- #539
- #747
- #1100
- #1127
- #1142
- #1140

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

Validated on qemuq35 that the module type was successfully parsed.

Validated pipelines build on mu_tiano_platforms

- Local build with the plugin
- Tested invalid directory printing by adding an invalid arch
  to `TARGET_ARCH` (so the directory doesn't exist in build output).

Ensured existing syntax (filename only) continues to work. Ensured
gitignore style syntax now works.

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
apop5 pushed a commit that referenced this pull request Jan 15, 2026
The addition of an PE/COFF image validation build plugin that will
verify all pe images against requirements defined in the configuration
file.

This plugin only runs if a path to a config file is provided via the
command line (PE_VALIDATION_PATH) or preferably Platform hardcoded in
the PlatformBuild.py file, so that each platform can have their own
requirements.

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

In previous iterations, the profile was determined by parsing the
makefile, looking for MODULE_TYPE. As each OS / tool chain may use a
different makefile type, this was not a reliable method. This updates
the plugin to read the INF for the compiled efi file to determine the
MODULE_TYPE and thus the profile.

The PE parsing functionality was modified to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

- Print directory paths considered invalid to aid debugging
- Build native OS file paths using os.path.join for walk dirs
- Clean up trailing whitespace throughout the file

Add gitignore style syntax for file exclusion

Contains:
- #340
- #537
- #539
- #747
- #1100
- #1127
- #1142
- #1140

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

Validated on qemuq35 that the module type was successfully parsed.

Validated pipelines build on mu_tiano_platforms

- Local build with the plugin
- Tested invalid directory printing by adding an invalid arch
  to `TARGET_ARCH` (so the directory doesn't exist in build output).

Ensured existing syntax (filename only) continues to work. Ensured
gitignore style syntax now works.

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
apop5 pushed a commit that referenced this pull request Jan 28, 2026
The addition of an PE/COFF image validation build plugin that will
verify all pe images against requirements defined in the configuration
file.

This plugin only runs if a path to a config file is provided via the
command line (PE_VALIDATION_PATH) or preferably Platform hardcoded in
the PlatformBuild.py file, so that each platform can have their own
requirements.

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

In previous iterations, the profile was determined by parsing the
makefile, looking for MODULE_TYPE. As each OS / tool chain may use a
different makefile type, this was not a reliable method. This updates
the plugin to read the INF for the compiled efi file to determine the
MODULE_TYPE and thus the profile.

The PE parsing functionality was modified to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

- Print directory paths considered invalid to aid debugging
- Build native OS file paths using os.path.join for walk dirs
- Clean up trailing whitespace throughout the file

Add gitignore style syntax for file exclusion

Contains:
- #340
- #537
- #539
- #747
- #1100
- #1127
- #1142
- #1140

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

Validated on qemuq35 that the module type was successfully parsed.

Validated pipelines build on mu_tiano_platforms

- Local build with the plugin
- Tested invalid directory printing by adding an invalid arch
  to `TARGET_ARCH` (so the directory doesn't exist in build output).

Ensured existing syntax (filename only) continues to work. Ensured
gitignore style syntax now works.

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
apop5 pushed a commit that referenced this pull request Feb 5, 2026
The addition of an PE/COFF image validation build plugin that will
verify all pe images against requirements defined in the configuration
file.

This plugin only runs if a path to a config file is provided via the
command line (PE_VALIDATION_PATH) or preferably Platform hardcoded in
the PlatformBuild.py file, so that each platform can have their own
requirements.

Previously, ImageValidation was an "opt-in" plugin by setting a build
variable `PE_VALIDATION_PATH`, however with this pull request, Image
Validation will be on by default, with some default configuration that
can be changed with a custom configuration yaml file.

The default requirements are:
1. All efi binaries must not be both write and execute
2. All efi binaries must have an image base of 0x0
3. All dxe phase binaries must be 4k section aligned, with the one
exception of AARCH64 DXE_RUNTIME_DRIVERS, which must be 64k aligned.

compiled binaries that need to be opted out of, can do so by adding an
`IGNORE_LIST` in the configuration file

```json
{
  "IGNORE_LIST": ["Shell.efi", "etc"]
}
```

In previous iterations, the profile was determined by parsing the
makefile, looking for MODULE_TYPE. As each OS / tool chain may use a
different makefile type, this was not a reliable method. This updates
the plugin to read the INF for the compiled efi file to determine the
MODULE_TYPE and thus the profile.

The PE parsing functionality was modified to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

- Print directory paths considered invalid to aid debugging
- Build native OS file paths using os.path.join for walk dirs
- Clean up trailing whitespace throughout the file

Add gitignore style syntax for file exclusion

Contains:
- #340
- #537
- #539
- #747
- #1100
- #1127
- #1142
- #1140

Confirmed successful execution of the plugin on Windows with QemuQ35 and
Ubuntu with QemuSbsa

Validated on qemuq35 that the module type was successfully parsed.

Validated pipelines build on mu_tiano_platforms

- Local build with the plugin
- Tested invalid directory printing by adding an invalid arch
  to `TARGET_ARCH` (so the directory doesn't exist in build output).

Ensured existing syntax (filename only) continues to work. Ensured
gitignore style syntax now works.

Platforms that begin to fail this test will need to generate a
configuration yaml file, and set a stuart build variable,
`PE_VALIDATION_PATH` to it. It is suggested to do this in the Platform's
`PlatformBuild.py`.

**The Correct Integration** is to evaluate the binary and why it is not
meeting the requirements. The platform can elect to update the
compilation of the binary to meet the requirements, add or override
validation rules for certain MODULE_TYPEs, or simply add the binary to
the ignore list. Please review the Plugin's readme.md file for more
details on doing any of these things.

Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:breaking-change Requires integration attention impact:non-functional Does not have a functional impact type:design-change A new proposal or modification to a feature design type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants