Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Add Compute Gallery images support #1450

Merged
merged 9 commits into from
Nov 18, 2021
Merged

Add Compute Gallery images support #1450

merged 9 commits into from
Nov 18, 2021

Conversation

puhley
Copy link
Contributor

@puhley puhley commented Nov 13, 2021

Summary of the Pull Request

The documentation for using custom images while fuzzing states that Compute Gallery images are supported. However, the existing code for handling custom images does not properly address Compute Gallery resource IDs. The code only handles references to Azure Images. This pull request adds support for Compute Gallery resource IDs as discussed in issue #1443 . In addition, it corrects an error within the existing code where an attempt to retrieve a "name" parameter is performed on the image "os_type". The "os_type" is a string and does not have a "name" parameter. This pull request removes the invalid "name" reference and converts the string using ".lower()" similar to the default code path.

PR Checklist

Info on Pull Request

This pull request includes a check to determine whether the resource ID refers to a "galleries" resource type. If the resource ID is confirmed to be a Compute Gallery reference, then it will use the corresponding ComputeManagementClient methods and properties to retrieve the OS type. If an Azure Image reference is provided, then the code has been changed to provide the lower case value of the OS type. Since it was unknown what existing dependencies relied on the previous behavior, the code defaults to the existing approach of assuming an Azure Image reference was given.

Validation Steps Performed

This was tested locally within what is assumed to be a simple deployment environment. More robust testing is welcomed.

Copy link
Member

@ranweiler ranweiler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, @puhley. I have some small suggested changes, and a few comments, but the latter are more for us to follow up with.

src/api-service/__app__/onefuzzlib/azure/image.py Outdated Show resolved Hide resolved
src/api-service/__app__/onefuzzlib/azure/image.py Outdated Show resolved Hide resolved
src/api-service/__app__/onefuzzlib/azure/image.py Outdated Show resolved Hide resolved
@ranweiler
Copy link
Member

Running integration tests.

@ranweiler ranweiler merged commit 58091c2 into microsoft:main Nov 18, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Dec 19, 2021
@Porges
Copy link
Member

Porges commented Sep 20, 2022

@puhley out of interest, what type (distro/version) of Linux images are you deploying? We might need to make our agent binary "less portable" in order to comply with some security policies, so I'm trying to gather information on what distros are currently in use.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants