diff --git a/docs/webhook_events.md b/docs/webhook_events.md index 967e94a8b..ddbb7432b 100644 --- a/docs/webhook_events.md +++ b/docs/webhook_events.md @@ -644,7 +644,8 @@ Each event will be submitted via HTTP POST to the user provided URL. "allow_pool_management": true, "allowed_aad_tenants": [ "00000000-0000-0000-0000-000000000000" - ] + ], + "proxy_vm_sku": "Standard_B2s" } } ``` @@ -676,6 +677,11 @@ Each event will be submitted via HTTP POST to the user provided URL. }, "title": "Allowed Aad Tenants", "type": "array" + }, + "proxy_vm_sku": { + "default": "Standard_B2s", + "title": "Proxy Vm Sku", + "type": "string" } }, "required": [ @@ -5621,6 +5627,11 @@ Each event will be submitted via HTTP POST to the user provided URL. }, "title": "Allowed Aad Tenants", "type": "array" + }, + "proxy_vm_sku": { + "default": "Standard_B2s", + "title": "Proxy Vm Sku", + "type": "string" } }, "required": [ diff --git a/src/api-service/__app__/onefuzzlib/proxy.py b/src/api-service/__app__/onefuzzlib/proxy.py index 0f822436f..c7c75bbb2 100644 --- a/src/api-service/__app__/onefuzzlib/proxy.py +++ b/src/api-service/__app__/onefuzzlib/proxy.py @@ -36,12 +36,12 @@ from .azure.ip import get_public_ip from .azure.queue import get_queue_sas from .azure.storage import StorageType from .azure.vm import VM +from .config import InstanceConfig from .events import send_event from .extension import proxy_manager_extensions from .orm import ORMMixin, QueryFilter from .proxy_forward import ProxyForward -PROXY_SKU = "Standard_B2s" PROXY_IMAGE = "Canonical:UbuntuServer:18.04-LTS:latest" PROXY_LOG_PREFIX = "scaleset-proxy: " PROXY_LIFESPAN = datetime.timedelta(days=7) @@ -69,10 +69,11 @@ class Proxy(ORMMixin): return ("region", "proxy_id") def get_vm(self) -> VM: + sku = InstanceConfig.fetch().proxy_vm_sku vm = VM( name="proxy-%s" % base58.b58encode(self.proxy_id.bytes).decode(), region=self.region, - sku=PROXY_SKU, + sku=sku, image=PROXY_IMAGE, auth=self.auth, ) diff --git a/src/pytypes/onefuzztypes/models.py b/src/pytypes/onefuzztypes/models.py index 8d4d4d8de..4ce0c4822 100644 --- a/src/pytypes/onefuzztypes/models.py +++ b/src/pytypes/onefuzztypes/models.py @@ -802,6 +802,7 @@ class InstanceConfig(BaseModel): # if set, only admins can manage pools or scalesets allow_pool_management: bool = Field(default=True) + proxy_vm_sku: str = Field(default="Standard_B2s") allowed_aad_tenants: List[UUID] def update(self, config: "InstanceConfig") -> None: