Skip to content

Utilize YAML for terminal behavior - #702

Open
1000TurquoisePogs wants to merge 3 commits into
v3.x/stagingfrom
fix/v3/terminal-allowlist
Open

Utilize YAML for terminal behavior#702
1000TurquoisePogs wants to merge 3 commits into
v3.x/stagingfrom
fix/v3/terminal-allowlist

Conversation

@1000TurquoisePogs

Copy link
Copy Markdown
Member

Proposed changes

Adds per-component allowList support to the terminal WebSocket proxy, enabling operators to restrict which hostnames TN3270 and VT terminal sessions may connect to. When configured, any connection attempt to a host not in the list is rejected with WebSocket close code 4003 and logged as ZWED0181W. Also adds the ZWED0181W log message definition that the proxy code references.

Files changed:

  • plugins/terminal-proxy/lib/terminalProxy.js — reads components.tn3270-ng2.allowList / components.vt-ng2.allowList from zowe.yaml; rejects unlisted hosts with WS close code 4003 (Forbidden)
  • plugins/terminal-proxy/lib/assets/i18n/log/messages_en.json — adds ZWED0181W: "Host %s rejected, not in allowList. %s"

PR Checklist

  • If the changes in this PR are meant for the next release / mainline, this PR targets the "staging" branch.
  • My code follows the style guidelines of this project (see: Contributing guideline)
  • I have made corresponding changes to the documentation
  • Relevant update to CHANGELOG.md
  • My changes generate no new warnings

Testing

AllowList enforcement:

  1. Add the following to zowe.yaml:
    components:
      tn3270-ng2:
        allowList:
          - allowed-host.example.com
  2. Start the app-server and open the TN3270 app.
  3. Attempt to connect to allowed-host.example.com — connection should proceed normally.
  4. Attempt to connect to any other host — the connection should be rejected immediately with WS close code 4003; the TN3270 app should display "Connection forbidden".
  5. Check the app-server log for a ZWED0181W warning identifying the rejected host.

No allowList (default behavior):

  1. Remove the allowList key entirely from zowe.yaml.
  2. Verify all connection attempts proceed as before — no change in behavior.

VT allowList:

  1. Repeat the above steps with components.vt-ng2.allowList and the VT terminal app.

Further comments

The allowList is optional and defaults to null when absent. The check is an exact string match (Array.includes). WS close code 4003 was chosen as an application-level "Forbidden" code, complementing the existing 4000 (going away) and 4999 (internal error) codes already used by the proxy. The corresponding frontend changes (displaying "Connection forbidden" on code 4003) are in the tn3270-ng2 and vt-ng2 PRs.

Signed-off-by: 1000TurquoisePogs <sgrady@rocketsoftware.com>
Signed-off-by: 1000TurquoisePogs <sgrady@rocketsoftware.com>
Signed-off-by: 1000TurquoisePogs <sgrady@rocketsoftware.com>
@sonarqubecloud

sonarqubecloud Bot commented Aug 3, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Ready for Review

Development

Successfully merging this pull request may close these issues.

1 participant