Skip to content

fix(security): resolve CVE alerts and fix integration tests | SUMO-285325#171

Merged
shauryasethi-sumo merged 7 commits into
masterfrom
shauryasethi_AzureFunctionCVEFixes_SUMO-285325
Jun 24, 2026
Merged

fix(security): resolve CVE alerts and fix integration tests | SUMO-285325#171
shauryasethi-sumo merged 7 commits into
masterfrom
shauryasethi_AzureFunctionCVEFixes_SUMO-285325

Conversation

@shauryasethi-sumo

Copy link
Copy Markdown
Contributor

Resolved CVE alerts in package dependencies across all AppendBlobReader and BlockBlobReader target builds. All builds now report 0 vulnerabilities via npm audit.

Changes

  • Updated package-lock.json across all 6 target builds to patch vulnerable dependencies
  • Fixed AppendBlobTaskProducer crash on initial timer fire when FileOffsetMap table doesn't exist
  • Added SCM_COMMAND_IDLE_TIMEOUT=600 to ARM templates to prevent Kudu npm install timeouts
  • Switched integration tests to use fixed storage resource groups (eliminates need for subscription-level Owner)
  • Updated README with integration test prerequisites and SP permission setup

Integration Test Results

  • AppendBlobReader: All 3 tests passing
  • BlockBlobReader: All 3 tests passing

No internal references (no JIRA link, no team names, no subscription IDs, no vault names). The resource group names in the code diff are fine since they're non-sensitive by design.

The producer's queryFiles() now gracefully handles the case where
FileOffsetMap table doesn't exist yet (returns empty array instead of
throwing). Also updates expected resource count in integration test to
account for auto-created actiongroups resource.
Kudu source control deployment was timing out during npm install
for consumer/DLQ builds with larger dependency trees. Default 60s
timeout is insufficient after CVE dependency upgrades. Also fixes
expected resource count in BlockBlobReader integration test.
The ARM template reports deployment failure for sourcecontrols/web
on Consumption plan apps because the ARM poller times out before
Kudu finishes npm install, even though it eventually succeeds.
The test now catches this specific error since test_03 validates
actual functionality.
Replaces dynamic timestamp-based resource group names with fixed
names (configurable via TEST_STORAGE_RESOURCE_GROUP env var). The
tearDownClass now deletes only the storage account, not the RG.
This allows scoped User Access Administrator permission instead
of requiring subscription-level Owner.
Azure inconsistently auto-creates microsoft.insights/actiongroups
alongside Application Insights. Accept either count as valid.
- Renamed resource groups to sumo-*-integration-test-do-not-delete
- Updated READMEs with SP permissions, one-time setup, and 1Password reference
- Added TEST_STORAGE_RESOURCE_GROUP to run_integration_test.sh
- Blanked out credentials in shell scripts (public repo)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses dependency CVE alerts across the Azure Function build targets and improves integration-test stability/permissions by switching to fixed (persistent) storage resource groups, while also hardening AppendBlob task polling when the offset table is missing.

Changes:

  • Updated multiple package-lock.json files to remediate npm audit vulnerabilities across AppendBlobReader/BlockBlobReader target builds.
  • Improved integration tests to reuse fixed storage resource groups and tolerate small Azure resource-count variations.
  • Updated ARM templates to set SCM_COMMAND_IDLE_TIMEOUT=600, and adjusted AppendBlobTaskProducer polling to handle missing FileOffsetMap table.

Reviewed changes

Copilot reviewed 13 out of 19 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
BlockBlobReader/tests/test_blobreader.py Uses fixed storage RG via env var; adds deploy exception tolerance and resource-count range assertion.
BlockBlobReader/tests/run_integration_test.sh Exports fixed storage RG env var; switches to python3.
BlockBlobReader/tests/baseblockblobtest.py Changes teardown to delete only the storage account instead of the whole storage RG.
BlockBlobReader/target/producer_build/package-lock.json Dependency lock updates to resolve CVEs.
BlockBlobReader/target/dlqprocessor_build/package-lock.json Dependency lock updates (incl. msal-node update) to resolve CVEs.
BlockBlobReader/target/consumer_build/package-lock.json Dependency lock updates (incl. msal-node update) to resolve CVEs.
BlockBlobReader/src/blobreaderdeploywithPremiumPlan.json Adds SCM_COMMAND_IDLE_TIMEOUT app setting to function apps.
BlockBlobReader/src/blobreaderdeploy.json Adds SCM_COMMAND_IDLE_TIMEOUT app setting to function apps.
BlockBlobReader/README.md Updates integration test prerequisites, roles, and run instructions.
AppendBlobReader/tests/test_appendblobreader.py Uses fixed storage RG via env var; resource-count range assertion.
AppendBlobReader/tests/run_integration_test.sh Exports fixed storage RG env var; switches to python3.
AppendBlobReader/tests/baseappendblobtest.py Changes teardown to delete only the storage account instead of the whole storage RG.
AppendBlobReader/target/producer_build/package-lock.json Dependency lock updates to resolve CVEs.
AppendBlobReader/target/consumer_build/package-lock.json Dependency lock updates (incl. msal-node update) to resolve CVEs.
AppendBlobReader/target/appendblob_producer_build/package-lock.json Dependency lock updates to resolve CVEs.
AppendBlobReader/target/appendblob_producer_build/AppendBlobTaskProducer/index.js Skips polling when FileOffsetMap table is missing (TableNotFound handling).
AppendBlobReader/src/appendblobreaderdeploy.json Adds SCM_COMMAND_IDLE_TIMEOUT app setting to function apps.
AppendBlobReader/src/appendblobproducer.js Skips polling when FileOffsetMap table is missing (TableNotFound handling).
AppendBlobReader/README.md Updates integration test prerequisites, roles, and run instructions.
Files not reviewed (6)
  • AppendBlobReader/target/appendblob_producer_build/package-lock.json: Generated file
  • AppendBlobReader/target/consumer_build/package-lock.json: Generated file
  • AppendBlobReader/target/producer_build/package-lock.json: Generated file
  • BlockBlobReader/target/consumer_build/package-lock.json: Generated file
  • BlockBlobReader/target/dlqprocessor_build/package-lock.json: Generated file
  • BlockBlobReader/target/producer_build/package-lock.json: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread BlockBlobReader/tests/baseblockblobtest.py
Comment thread AppendBlobReader/tests/baseappendblobtest.py
Comment thread AppendBlobReader/src/appendblobproducer.js
Comment thread BlockBlobReader/tests/test_blobreader.py
@shauryasethi-sumo shauryasethi-sumo merged commit c69832f into master Jun 24, 2026
21 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants