Skip to content

Conversation

@elayrocks
Copy link
Contributor

@elayrocks elayrocks commented Jun 11, 2024

Description

This PR is the first step in implementing data consumption quotas for SAS API Token Issuance. I created a new Azure Function App which runs periodically to execute a KQL query against Storage Account Blob Logs to aggregate the bytes read per IP address over a window of time (e.g., 24 hours). IPs which have read above a certain threshold will be added to an Azure storage table called blob storage banned ip which serves as a temporary ban list.

Please refer to the design doc for more details.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Unit test uses mocked response from log query client and writes test data to azurite. The integration/E2E test queries the log analytics workspace and writes to test table in storage account and deletes it after testing is complete.

Make sure correct roles have been assigned, run ./scripts/server to start azurite service and scripts/test --funcs [--no-integration] to run unit tests. and integration tests (optionally).

Checklist:

Please delete options that are not relevant.

  • I have performed a self-review
  • Changelog has been updated
  • Documentation has been updated
  • Unit tests pass locally (./scripts/test)
  • Code is linted and styled (./scripts/format)

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