mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-16 20:08:09 +00:00
enable configuring proxy VM sku (#1128)
This commit is contained in:
@ -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": [
|
||||
|
@ -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,
|
||||
)
|
||||
|
@ -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:
|
||||
|
Reference in New Issue
Block a user