예제 #1
0
def build_pool_config(pool_name: str) -> str:
    config = AgentConfig(
        pool_name=pool_name,
        onefuzz_url=get_instance_url(),
        instrumentation_key=os.environ.get("APPINSIGHTS_INSTRUMENTATIONKEY"),
        heartbeat_queue=get_queue_sas(
            "node-heartbeat",
            account_id=get_func_storage(),
            add=True,
        ),
        telemetry_key=os.environ.get("ONEFUZZ_TELEMETRY"),
    )

    save_blob(
        "vm-scripts",
        "%s/config.json" % pool_name,
        config.json(),
        account_id=get_func_storage(),
    )

    return get_file_sas_url(
        "vm-scripts",
        "%s/config.json" % pool_name,
        account_id=get_func_storage(),
        read=True,
    )
예제 #2
0
def build_pool_config(pool: Pool) -> str:
    config = AgentConfig(
        pool_name=pool.name,
        onefuzz_url=get_agent_instance_url(),
        heartbeat_queue=get_queue_sas(
            "node-heartbeat",
            StorageType.config,
            add=True,
        ),
        instance_telemetry_key=os.environ.get(
            "APPINSIGHTS_INSTRUMENTATIONKEY"),
        microsoft_telemetry_key=os.environ.get("ONEFUZZ_TELEMETRY"),
        instance_id=get_instance_id(),
    )

    multi_tenant_domain = os.environ.get("MULTI_TENANT_DOMAIN")
    if multi_tenant_domain:
        config.multi_tenant_domain = multi_tenant_domain

    filename = f"{pool.name}/config.json"

    save_blob(
        Container("vm-scripts"),
        filename,
        config.json(),
        StorageType.config,
    )

    return config_url(Container("vm-scripts"), filename, False)
예제 #3
0
def build_pool_config(pool: Pool) -> str:
    config = AgentConfig(
        pool_name=pool.name,
        onefuzz_url=get_instance_url(),
        instrumentation_key=os.environ.get("APPINSIGHTS_INSTRUMENTATIONKEY"),
        heartbeat_queue=get_queue_sas(
            "node-heartbeat",
            StorageType.config,
            add=True,
        ),
        telemetry_key=os.environ.get("ONEFUZZ_TELEMETRY"),
        instance_id=get_instance_id(),
    )

    filename = f"{pool.name}/config.json"

    save_blob(
        Container("vm-scripts"),
        filename,
        config.json(),
        StorageType.config,
    )

    return get_file_sas_url(
        Container("vm-scripts"),
        filename,
        StorageType.config,
        read=True,
    )
예제 #4
0
def set_config(pool: Pool) -> Pool:
    pool.config = AgentConfig(
        pool_name=pool.name,
        onefuzz_url="https://%s.azurewebsites.net" % get_instance_name(),
        instrumentation_key=os.environ.get("APPINSIGHTS_INSTRUMENTATIONKEY"),
        telemetry_key=os.environ.get("ONEFUZZ_TELEMETRY"),
    )
    return pool
예제 #5
0
def build_pool_config(pool_name: str) -> str:
    agent_config = AgentConfig(
        pool_name=pool_name,
        onefuzz_url="https://%s.azurewebsites.net" % get_instance_name(),
        instrumentation_key=os.environ.get("APPINSIGHTS_INSTRUMENTATIONKEY"),
        telemetry_key=os.environ.get("ONEFUZZ_TELEMETRY"),
    )

    save_blob(
        "vm-scripts",
        "%s/config.json" % pool_name,
        agent_config.json(),
        account_id=get_func_storage(),
    )

    return get_file_sas_url(
        "vm-scripts",
        "%s/config.json" % pool_name,
        account_id=get_func_storage(),
        read=True,
    )
예제 #6
0
def set_config(pool: Pool) -> Pool:
    pool.config = AgentConfig(
        pool_name=pool.name,
        onefuzz_url=get_instance_url(),
        instrumentation_key=os.environ.get("APPINSIGHTS_INSTRUMENTATIONKEY"),
        telemetry_key=os.environ.get("ONEFUZZ_TELEMETRY"),
        heartbeat_queue=get_queue_sas(
            "node-heartbeat",
            account_id=get_func_storage(),
            add=True,
        ),
    )
    return pool
예제 #7
0
def set_config(pool: Pool) -> Pool:
    pool.config = AgentConfig(
        pool_name=pool.name,
        onefuzz_url=get_instance_url(),
        instance_telemetry_key=os.environ.get(
            "APPINSIGHTS_INSTRUMENTATIONKEY"),
        microsoft_telemetry_key=os.environ.get("ONEFUZZ_TELEMETRY"),
        heartbeat_queue=get_queue_sas(
            "node-heartbeat",
            StorageType.config,
            add=True,
        ),
        instance_id=get_instance_id(),
    )

    multi_tenant_domain = os.environ.get("MULTI_TENANT_DOMAIN")
    if multi_tenant_domain:
        pool.config.multi_tenant_domain = multi_tenant_domain

    return pool