-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add security scanning and remove debug printing (#34)
* Add security scanning and remove debug printing * Use v10000 instead of main
- Loading branch information
1 parent
67fc885
commit 66bee48
Showing
4 changed files
with
52 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: "Security Scan" | ||
|
||
# Run workflow each time code is pushed to your repository and on a schedule. | ||
# The scheduled workflow runs every at 00:00 on Sunday UTC time. | ||
on: | ||
push: | ||
branches: [ "v10000" ] | ||
pull_request: | ||
branches: [ "v10000" ] | ||
schedule: | ||
- cron: '0 0 * * 0' | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
env: | ||
GO111MODULE: on | ||
steps: | ||
- name: Checkout Source | ||
uses: actions/checkout@v4 | ||
- name: Run Gosec Security Scanner | ||
uses: securego/gosec@master | ||
with: | ||
# we let the report trigger content trigger a failure using the GitHub Security features. | ||
args: '-no-fail -fmt sarif -out 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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env python3 | ||
# coding: UTF-8 | ||
|
||
# Update client.go | ||
updatedClientLines = [] | ||
with open("client.go", 'r') as clientFile: | ||
for line in clientFile: | ||
# Skip unused imports | ||
if "\"log\"" in line or "\"net/http/httputil\"" in line: | ||
continue | ||
# Remove debug lines for printing request contents | ||
if "c.cfg.Debug" in line: | ||
# advance iterator to skip the expected lines | ||
for i in range(7): | ||
line = clientFile.readline() | ||
updatedClientLines.append(line) | ||
|
||
with open("client.go", 'w') as clientFile: | ||
for line in updatedClientLines: | ||
clientFile.write(line) | ||
|