diff --git a/src/faq.md b/src/faq.md index 50843d6a..da9b34f9 100644 --- a/src/faq.md +++ b/src/faq.md @@ -447,6 +447,51 @@ The reference runner and several other CWL implementations support running those Docker format containers using the Singularity engine. Directly specifying a Singularity format container is not part of the CWL standards. +## How do I specify when network access is required? + +In CWL v1.1 and above, you need to specify when network access +is required by including the `NetworkAccess` requirement. +If `networkAccess` is `true`the tool must be able to make +outgoing connections to network resources. +If `networkAccess` is `false` or not specified, tools must not +assume network access, except for localhost (the loopback device). +If `networkAccess` is not specified when it is required, the tool will fail. + +Below is an example using `curl` where `networkAccess: true` which +allows the page with the link in the yaml file to be downloaded and +saves it in a `download.hmtl` file + + +``` +cwlVersion: v1.2 +class: CommandLineTool + +requirements: + NetworkAccess: + networkAccess: true + +baseCommand: curl + +stdout: download.html + +inputs: + url: + type: string + inputBinding: + position: 1 + +outputs: + out: + type: File + outputBinding: + glob: download.html +``` + +The input yaml file will be +``` +url: https://www.commonwl.org/v1.2/ +``` + ## Debug JavaScript Expressions You can use the --js-console option of cwltool, or you can try