Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix vulnerabilities reported in S360 #3414

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions lisa/sut_orchestrator/azure/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,14 @@
ResourceManagementClient,
SubscriptionClient,
)
from azure.mgmt.storage import StorageManagementClient # type: ignore
from azure.mgmt.storage.models import ( # type: ignore
Sku,
StorageAccountCreateParameters,
)
from azure.mgmt.storage import StorageManagementClient
from azure.mgmt.storage.models import Sku, StorageAccountCreateParameters
from azure.storage.blob import (
BlobClient,
BlobSasPermissions,
BlobServiceClient,
ContainerClient,
ContentSettings,
generate_blob_sas,
)
from azure.storage.fileshare import ShareServiceClient
Expand Down Expand Up @@ -1632,7 +1630,7 @@ def generate_user_delegation_sas_token(
container_name=container_name,
blob_name=blob_name,
user_delegation_key=user_delegation_key,
permission=BlobSasPermissions(read=True, write=writable), # type: ignore
permission=BlobSasPermissions(read=True, write=writable),
expiry=expiry_time,
start=start_time,
)
Expand Down Expand Up @@ -1803,12 +1801,11 @@ def copy_vhd_to_storage(
) -> str:
# get original vhd's hash key for comparing.
original_key: Optional[bytearray] = None
original_blob_client = BlobClient.from_blob_url(src_vhd_sas_url)
original_blob_client: BlobClient = BlobClient.from_blob_url(src_vhd_sas_url)
properties = original_blob_client.get_blob_properties()
if properties.content_settings:
original_key = properties.content_settings.get(
"content_md5", None
) # type: ignore
content_settings: Optional[ContentSettings] = properties.content_settings
if content_settings:
original_key = content_settings.get("content_md5", None) # type: ignore

container_client = get_or_create_storage_container(
credential=platform.credential,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def retrieve_storage_blob_url(
test_file: str = "",
is_sas: bool = False,
script: str = "",
blob_type: BlobType = BlobType.BlockBlob,
blob_type: BlobType = BlobType.BLOCKBLOB,
) -> Any:
platform = environment.platform
assert isinstance(platform, AzurePlatform)
Expand Down Expand Up @@ -123,7 +123,7 @@ def retrieve_storage_blob_url(
raise ex
# Upload blob to container if doesn't exist
container_client.upload_blob(
name=blob_name, data=blob_data, blob_type=blob_type # type: ignore
name=blob_name, data=blob_data, blob_type=blob_type
)

blob_url = blob.url
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools >= 65", "setuptools_scm[toml] >= 6.2"]
requires = ["setuptools >= 70", "setuptools_scm[toml] >= 6.2"]
build-backend = "setuptools.build_meta"


Expand Down Expand Up @@ -49,9 +49,9 @@ azure = [
"azure-mgmt-privatedns ~= 1.0.0",
"azure-mgmt-resource ~= 21.0.0",
"azure-mgmt-serialconsole ~= 1.0.0",
"azure-mgmt-storage ~= 20.0.0",
"azure-storage-blob ~= 12.11.0",
"azure-storage-file-share ~= 12.16.0",
"azure-mgmt-storage ~= 21.2.1",
"azure-storage-blob ~= 12.23.0",
"azure-storage-file-share ~= 12.18.0",
"azure-keyvault-secrets ~= 4.7.0",
"azure-keyvault-certificates ~= 4.7.0",
"msrestazure ~= 0.6.4",
Expand Down
Loading