Implement ns lookup allowlist (#1420)
The ns-lookup accepts domain names as well as suffixes, e.g.: ``` --allow-resolve=* # allow all domain names --allow-resolve=example.com # only allow example.com name resolution --allow-resolve=example.com --allow-resolve=*.example.com # allow example.com and its subdomains' name resolution ```
This commit is contained in:
@ -132,3 +132,16 @@ func (self *Module) SetWasiAddrPool(addrPool [][]byte) {
|
||||
}
|
||||
C.wasm_runtime_set_wasi_addr_pool(self.module, addrPoolPtr, addrPoolSize)
|
||||
}
|
||||
|
||||
/* Set module's wasi domain lookup pool */
|
||||
func(self *Module) SetWasiNsLookupPool(nsLookupPool[][] byte)
|
||||
{
|
||||
var nsLookupPoolPtr **C.char
|
||||
var nsLookupPoolSize C.uint
|
||||
|
||||
if (nsLookupPool != nil) {
|
||||
nsLookupPoolPtr = (**C.char)(unsafe.Pointer(&nsLookupPool[0]))
|
||||
nsLookupPoolSize = C.uint(len(nsLookupPool))
|
||||
}
|
||||
C.wasm_runtime_set_wasi_ns_lookup_pool(self.module, nsLookupPoolPtr, nsLookupPoolSize)
|
||||
}
|
||||
Reference in New Issue
Block a user