Skip to content

Potential fix for code scanning alert no. 11: Incomplete regular expression for hostnames #384

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-azurerm/security/code-scanning/11

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) for the regular expression can improve readability and avoid the need to double-escape backslashes.

The updated regular expression will be: `github\.com/terraform-linters/tflint-plugin-sdk v(.+)`. This ensures that the pattern matches only github.com and not unintended variations.

The change will be made on line 22 of the file tools/release/main.go.


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

…ession 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 06:07
@wata727 wata727 enabled auto-merge (squash) April 25, 2025 06:09
@wata727 wata727 merged commit 46f5ab5 into master Apr 25, 2025
13 checks passed
@wata727 wata727 deleted the alert-autofix-11 branch April 25, 2025 06:09
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