Skip to content

Commit

Permalink
SK-1407: Merge branch 'main' into SK-1407/add-pr-template
Browse files Browse the repository at this point in the history
  • Loading branch information
saileshwar-skyflow committed Nov 27, 2024
2 parents f53c55b + aebc314 commit 68a8715
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Semgrep

# Run workflow each time code is pushed to your repository.
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Semgrep
run: pip install semgrep

- name: Run Semgrep
run: |
semgrep --config .semgreprules/customRule.yml --config auto --severity ERROR --sarif . > results.sarif
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
# Path to SARIF file relative to the root of the repository
sarif_file: results.sarif

- name: Upload results
uses: actions/upload-artifact@v4
with:
name: semgrep-results
path: results.sarif
30 changes: 30 additions & 0 deletions .semgreprules/customRule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
rules:
- id: check-sensitive-info
message: >-
Potential sensitive information found: $1
severity: ERROR
languages:
- yaml
- go
- javascript
- java
- python
- golang
- docker
patterns:
- pattern-regex: (?i)\b(api[_-]key|api[_-]token|api[_-]secret[_-]key|api[_-]password|token|secret[_-]key|password|auth[_-]key|auth[_-]token|AUTH_PASSWORD)\s*[:=]\s*(['"]?)((?!YOUR_EXCLUSION_PATTERN_HERE)[A-Z]+.*?)\2

- id: check-logger-appconfig
message: >-
Potential Logging configuration found: $1
severity: ERROR
languages:
- yaml
- go
- javascript
- java
- python
- golang
- docker
patterns:
- pattern-regex: log\.Logger\(\).*(appConfig).*
2 changes: 1 addition & 1 deletion samples/get_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def token_provider():
"redaction" : "<REDACTION_TYPE>",
"table": "<TABLE_NAME>",
"columnName": "<UNIQUE_COLUMN_NAME>",
"columnValues": "[<COLUMN_VALUE_1>,<COLUMN_VALUE_2>]",
"columnValues": ["<COLUMN_VALUE_1>", "<COLUMN_VALUE_2>"],
}
]}

Expand Down

0 comments on commit 68a8715

Please sign in to comment.