Skip to content

Potential fix for code scanning alert no. 6: Incomplete regular expression for hostnames #868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2025

Conversation

wata727
Copy link
Member

@wata727 wata727 commented Apr 25, 2025

Potential fix for https://github.com/terraform-linters/tflint-ruleset-aws/security/code-scanning/6

To fix the issue, the dot (.) in the regular expression should be escaped to ensure it matches a literal dot rather than any character. This can be done by replacing . with \.. Additionally, using a raw string literal (enclosed in backticks) avoids the need to double-escape the backslash, making the regular expression more readable. The corrected regular expression will be: `github\.com/terraform-linters/tflint-plugin-sdk v(.+)`.

The change should be made on line 22 of the file tools/release/main.go, where the goModRequireSDKRegexp variable is defined.


Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…ssion for hostnames

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@wata727 wata727 marked this pull request as ready for review April 25, 2025 05:50
@wata727 wata727 merged commit d74c43d into master Apr 25, 2025
12 checks passed
@wata727 wata727 deleted the alert-autofix-6 branch April 25, 2025 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant