Skip to content

ALLOWED_IPS validation too strict #17

Description

@snophey

The validation function is designed such that the examples given in the README.md do not pass validation:

validate_allowed_ips() {
    local ips="$1"
    # Validate AllowUsers entries and IP addresses
    if ! echo "$ips" | grep -E '^(AllowUsers|from) [a-zA-Z0-9@., ]+$'; then
        echo "Invalid ALLOWED_IPS format"
        exit 1
    fi
}

This example scenario from the readme would not pass validation by the above function:

ALLOWED_IPS="AllowUsers *@192.168.1.0/24 *@172.16.0.1 *@10.0.*.1"

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions