Repository: allero-io/allero (language: go)

Issue:
[New Rule] Prevent usage of plain text password
Many actions need a username and password.

Prevent usage of password that are not stored in github secrets.

Docker Login:
```
   name: Login to JFrog 🐸  
        uses: docker/login-action@v1
        with:
          registry: <your artifactory>.jfrog.io
          username: ${{ secrets.JFROG_USER_WRITER }}
          password: **this_is_my_password**
```


SonarQube:

```
  sonarQubeTrigger:
    name: SonarQube Trigger
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: SonarQube Scan
      uses: kitabisa/sonarqube-action@master
      with:
        host: ${{ secrets.SONARQUBE_HOST }}
        login: **this_is_my_password**

```

UploadBinary

```
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: Upload deb package to Bintray
      uses: bpicode/github-action-upload-bintray@master
      with:
        file: ./path/to/example-package_1.0_amd64.deb
        api_user: example-user
        api_key: **this_is_my_api_key**

```




Discussion / hints:

Fix patch:
diff --git a/pkg/rulesConfig/defaultRules/github/prevent-password-plain-text.json b/pkg/rulesConfig/defaultRules/github/prevent-password-plain-text.json
new file mode 100644
index 0000000..4dc852a
--- /dev/null
+++ b/pkg/rulesConfig/defaultRules/github/prevent-password-plain-text.json
@@ -0,0 +1,55 @@
+{
+    "description": "Prevent use of password as plain text",
+    "failureMessage": "a password key is used without obfuscation. We recommend using github secrets manager instead",
+    "schema": {
+        "type": "object",
+        "additionalProperties": {
+          "type": "object",
+          "properties": {
+            "repositories": {
+              "type": "object",
+              "additionalProperties": {
+                "type": "object",
+                "properties": {
+                  "github-actions-workflows": {
+                    "type": "object",
+                    "additionalProperties": {
+                      "properties": {
+                        "content": {
+                          "properties": {
+                            "jobs": {
+                              "type": "object",
+                              "additionalProperties": {
+                                "properties": {
+                                  "steps": {
+                                    "type": "array",
+                                    "items": {
+                                      "type": "object",
+                                      "properties": {
+                                        "with": {
+                                          "type": "object",
+                                          "patternProperties": {
+                                            ".*password.*": {
+                                              "type": "string",
+                                              "pattern": "\\${{.*}}( *|$)"
+                                            }
+                                          }
+                                        }
+                                      }
+                                    }
+                                  }
+                                }
+                              }
+                            }
+                          }
+                        }
+                      }
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+}


Test patch: