Skip to content
Snippets Groups Projects
Commit 9a68d2e3 authored by Jörg Sachse's avatar Jörg Sachse
Browse files

chore: enhance IP Regex to reduce false positives

parent edf63ad1
No related branches found
No related tags found
No related merge requests found
#!/bin/bash #!/usr/bin/env bash
# #
# An example hook script to verify what is about to be committed. # An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should # Called by "git commit" with no arguments. The hook should
...@@ -103,7 +103,7 @@ echo "SUCCESS: URL detection stage." ...@@ -103,7 +103,7 @@ echo "SUCCESS: URL detection stage."
### IP address detection stage ### IP address detection stage
# This is pretty basic regex matching, but it's a start. # This is pretty basic regex matching, but it's a start.
IP_REGEX='[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' IP_REGEX='[^a-zA-ZäöÜÄÖÜß/\\\-][0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'
${GREP_CMD} ${GREP_EXCLUDES} -e "${IP_REGEX}" "${REPOPATH}" | grep -v "127.0.0" ${GREP_CMD} ${GREP_EXCLUDES} -e "${IP_REGEX}" "${REPOPATH}" | grep -v "127.0.0"
if [[ ${?} -eq 0 ]]; then if [[ ${?} -eq 0 ]]; then
echo "ERROR: found IP address." echo "ERROR: found IP address."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment