TykTechnologies / tyk

Tyk Open Source API Gateway written in Go, supporting REST, GraphQL, TCP and gRPC protocols
Other
9.75k stars 1.09k forks source link

Merging to release-5.3.6: [TT-13087] Adjust example gateway config, to have match preficing explicit by default (#6564) #6568

Closed buger closed 2 months ago

buger commented 2 months ago

User description

TT-13087 Adjust example gateway config, to have match preficing explicit by default (#6564)

User description

Description

TT-13087 Adjust example gateway config, to have match preficing explicit by default

Motivation and Context

Would be advised that Gateway users, would have by default explicit path matching settings enabled by default, as the wildcard behaviour of the path matching, can be challenging at times to configure properly.

How This Has Been Tested

Types of changes

Checklist


PR Type

enhancement, configuration changes


Description


Changes walkthrough ๐Ÿ“

Relevant files
Configuration changes
tyk.conf.example
Add explicit path matching options to example gateway config

tyk.conf.example
  • Added http_server_options section.
  • Enabled enable_strict_routes.
  • Enabled enable_path_prefix_matching.
  • Enabled enable_path_suffix_matching.
  • +5/-0     

    ๐Ÿ’ก PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information


    PR Type

    enhancement, configuration changes


    Description


    Changes walkthrough ๐Ÿ“

    Relevant files
    Configuration changes
    tyk.conf.example
    Add explicit path matching options to example gateway config

    tyk.conf.example
  • Added http_server_options section.
  • Enabled enable_strict_routes.
  • Enabled enable_path_prefix_matching.
  • Enabled enable_path_suffix_matching.
  • +5/-0     

    ๐Ÿ’ก PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    github-actions[bot] commented 2 months ago

    API Changes

    no api changes detected
    github-actions[bot] commented 2 months ago

    PR Reviewer Guide ๐Ÿ”

    โฑ๏ธ Estimated effort to review: 2 ๐Ÿ”ต๐Ÿ”ตโšชโšชโšช
    ๐Ÿงช No relevant tests
    ๐Ÿ”’ No security concerns identified
    โšก Key issues to review

    Configuration Change
    The new configuration options `enable_strict_routes`, `enable_path_prefix_matching`, and `enable_path_suffix_matching` have been added to improve path matching behavior. Ensure that these changes are well-documented and communicated to users, as they could affect existing deployments.
    github-actions[bot] commented 2 months ago

    PR Code Suggestions โœจ

    CategorySuggestion                                                                                                                                    Score
    Security
    Change the default setting of enable_path_suffix_matching to false to enhance security and routing precision ___ **Consider setting "enable_path_suffix_matching" to false by default to avoid
    unintended route matches that could lead to security issues or misrouting unless
    explicitly needed.** [tyk.conf.example [36]](https://github.com/TykTechnologies/tyk/pull/6568/files#diff-a6736b4b3cda1ee503675d7b725f6138f4eb83d7145f3afecf6087d219f2b23aR36-R36) ```diff "http_server_options": { "enable_strict_routes": true, "enable_path_prefix_matching": true, - "enable_path_suffix_matching": true + "enable_path_suffix_matching": false } ```
    Suggestion importance[1-10]: 8 Why: The suggestion addresses a potential security concern by recommending a more secure default configuration, which can prevent unintended route matches and enhance routing precision. This is an important consideration for maintaining secure and predictable behavior in the application. The existing code and improved code sections are correctly derived from the PR code diff.
    8
    sonarcloud[bot] commented 2 months ago

    Quality Gate Passed Quality Gate passed

    Issues
    0 New issues
    0 Accepted issues

    Measures
    0 Security Hotspots
    0.0% Coverage on New Code
    0.0% Duplication on New Code

    See analysis details on SonarCloud