SHARMAN-4090 WAN SSH is successful without authentication#354
Open
umasankar098 wants to merge 4 commits into
Open
SHARMAN-4090 WAN SSH is successful without authentication#354umasankar098 wants to merge 4 commits into
umasankar098 wants to merge 4 commits into
Conversation
Reason for change: Creating a firewall rule to block SSH using WAN IP from LAN client Test Procedure: NA Risks: LOW Priority: P1 Signed-off-by: usi096 <umasankar.srinivasan@sky.uk>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces firewall rules intended to prevent LAN clients from reaching the device’s SSH service via the device’s WAN IP address (port 10022), addressing SHARMAN-4090.
Changes:
- Add IPv4
INPUTrules to reject LAN-interface TCP/10022 traffic destined to the current WAN IPv4 address. - Attempt to add an IPv6
INPUTrule to drop TCP/10022 via a directip6tablescommand.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| FIREWALL_DEBUG("Entering do_block_lan_access_to_wan_ssh\n"); | ||
| fprintf(fp, "-I INPUT 1 -i %s -d %s -p tcp --dport 10022 -j REJECT\n", lan_ifname, current_wan_ipaddr); | ||
| fprintf(fp, "-I INPUT 2 -i %s -d %s -p tcp --dport 10022 -j ACCEPT\n", lan_ifname, current_lan_ipaddr); |
| FIREWALL_DEBUG("Entering do_block_lan_access_to_wan_ssh\n"); | ||
| fprintf(fp, "-I INPUT 1 -i %s -d %s -p tcp --dport 10022 -j REJECT\n", lan_ifname, current_wan_ipaddr); | ||
| fprintf(fp, "-I INPUT 2 -i %s -d %s -p tcp --dport 10022 -j ACCEPT\n", lan_ifname, current_lan_ipaddr); | ||
| v_secure_system("ip6tables -I INPUT 1 -p tcp --dport 10022 -j DROP"); |
Reason for change: Creating a firewall rule to block SSH using WAN IP from LAN client Test Procedure: NA Risks: LOW Priority: P1 Signed-off-by: usi096 <umasankar.srinivasan@sky.uk>
Reason for change: Creating a firewall rule to block SSH using WAN IP from LAN client Test Procedure: NA Risks: LOW Priority: P1 Signed-off-by: usi096 <umasankar.srinivasan@sky.uk>
| { | ||
| FIREWALL_DEBUG("Entering do_block_lan_access_to_wan_ssh\n"); | ||
| fprintf(fp, "-I INPUT 1 -i %s -d %s -p tcp --dport 10022 -j REJECT\n", lan_ifname, current_wan_ipaddr); | ||
| fprintf(fp, "-I INPUT 2 -i %s -d %s -p tcp --dport 10022 -j ACCEPT\n", lan_ifname, lan_ipaddr); |
Comment on lines
+521
to
+523
| #if defined(_SR213_PRODUCT_REQ_) | ||
| fprintf(fp, "-I INPUT 1 -p tcp --dport 10022 -j DROP\n"); | ||
| #endif |
Reason for change: Creating a firewall rule to block SSH using WAN IP from LAN client Test Procedure: NA Risks: LOW Priority: P1 Signed-off-by: usi096 <umasankar.srinivasan@sky.uk>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reason for change: Creating a firewall rule to block SSH using WAN IP from LAN client
Test Procedure: NA
Risks: LOW
Priority: P1