From a72c8db7b7835c8d2f74630b48265f1a5986e312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=B8gster?= Date: Thu, 30 Mar 2023 23:44:54 +0200 Subject: [PATCH 1/5] add workflow commands --- .github/workflows/CI.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1004061..9740dc8 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -19,6 +19,16 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Check for plain text password + run: | + search_result=$(grep -r -i -n "password[=:]" $GITHUB_WORKSPACE) + + if [[ $search_result ]]; then + echo "Sensitive data found! Check it out! \n $search_result" + exit 1 + else + echo "Sensitive data not found, everytings ok" + fi - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: @@ -57,4 +67,4 @@ jobs: with: github-token: ${{ secrets.github_token }} path-to-lcov: "./coverage.lcov" - parallel-finished: true \ No newline at end of file + parallel-finished: true From 5f46dbdd21a3afe71c5e97e9815a41e531d391a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=B8gster?= Date: Thu, 30 Mar 2023 23:49:27 +0200 Subject: [PATCH 2/5] test --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9740dc8..204a2b6 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v3 - name: Check for plain text password run: | - search_result=$(grep -r -i -n "password[=:]" $GITHUB_WORKSPACE) + search_result=$(grep -r -i -n "test_password[=:]" $GITHUB_WORKSPACE) if [[ $search_result ]]; then echo "Sensitive data found! Check it out! \n $search_result" From 1ca9ba94904a5ab70a9fc07b15e97e6263fd0771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=B8gster?= Date: Thu, 30 Mar 2023 22:15:28 +0000 Subject: [PATCH 3/5] new grep --- .github/workflows/CI.yml | 2 +- top_secret_stuff.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 204a2b6..4f09997 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v3 - name: Check for plain text password run: | - search_result=$(grep -r -i -n "test_password[=:]" $GITHUB_WORKSPACE) + search_result=$(grep -r -i -n -o -E "(password|pwd|pass)[[:space:]]*(=|:)" $GITHUB_WORKSPACE) if [[ $search_result ]]; then echo "Sensitive data found! Check it out! \n $search_result" diff --git a/top_secret_stuff.txt b/top_secret_stuff.txt index 190aa14..cb33211 100644 --- a/top_secret_stuff.txt +++ b/top_secret_stuff.txt @@ -1,2 +1,3 @@ password = "plain_text_password_1234" +pwd: asdf user = "superDuperUser" From 4e9ea61a2523ea19421263f0270feaba1a5be11c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=B8gster?= Date: Thu, 30 Mar 2023 22:18:30 +0000 Subject: [PATCH 4/5] and following letters --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 4f09997..a8b8457 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v3 - name: Check for plain text password run: | - search_result=$(grep -r -i -n -o -E "(password|pwd|pass)[[:space:]]*(=|:)" $GITHUB_WORKSPACE) + search_result=$(grep -r -i -n -o -E "(password|pwd|pass)[[:space:]]*(=|:)*[[:space:]]*[[:alpha:]]+" $GITHUB_WORKSPACE) if [[ $search_result ]]; then echo "Sensitive data found! Check it out! \n $search_result" From 6ed2e45eeabcbf7f15b16ef6522a47b146380e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=B8gster?= Date: Wed, 12 Mar 2025 08:14:57 +0100 Subject: [PATCH 5/5] Update .github/workflows/CI.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0fc1bbf..bcb7d8b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -27,7 +27,7 @@ jobs: echo "Sensitive data found! Check it out! \n $search_result" exit 1 else - echo "Sensitive data not found, everytings ok" + echo "Sensitive data not found, everything's ok" fi - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5