Skip to content

Commit

Permalink
Merge pull request #315 from SaintAngeLs/notification_service_update
Browse files Browse the repository at this point in the history
#305 vulnerabilities issues update
  • Loading branch information
SaintAngeLs authored Jul 22, 2024
2 parents 300c4a3 + 995496e commit 9615ccf
Show file tree
Hide file tree
Showing 6 changed files with 168 additions and 4 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL analyzer"

on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]
schedule:
- cron: '40 18 * * 1'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
security-events: write
packages: read
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: csharp
build-mode: none
- language: javascript-typescript
build-mode: none
- language: python
build-mode: none

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}

- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
33 changes: 33 additions & 0 deletions .github/workflows/gitguardian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: GitGuardian Secret Detection

on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]
schedule:
- cron: '0 1 * * *'

jobs:
gitguardian:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install GitGuardian
run: |
python -m pip install --upgrade pip
pip install ggshield
- name: Run GitGuardian scan
env:
GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}
run: |
ggshield secret scan path --show-secrets .
33 changes: 33 additions & 0 deletions .github/workflows/ossaranalyzer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: OSSAR Analysis

on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '41 6 * * 2'

permissions:
contents: read

jobs:
OSSAR-Scan:
permissions:
contents: read
security-events: write
actions: read
runs-on: windows-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run OSSAR
uses: github/ossar-action@v1
id: ossar

- name: Upload OSSAR results
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ${{ steps.ossar.outputs.sarifFile }}
32 changes: 32 additions & 0 deletions .github/workflows/securitycodescan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: SecurityCodeScan Analysis

on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '45 14 * * 3'

jobs:
SCS:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: nuget/setup-nuget@v1
- uses: microsoft/setup-msbuild@v1.0.2

- name: Set up projects for analysis
uses: security-code-scan/security-code-scan-add-action@v1

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Convert sarif for uploading to GitHub
uses: security-code-scan/security-code-scan-results-action@v1

- name: Upload sarif
uses: github/codeql-action/upload-sarif@v2
2 changes: 1 addition & 1 deletion .github/workflows/vulnerability_check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Remove appsettings files
name: Vulnerability check and Remove appsettings files

on:
push:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ public override async Task OnConnectedAsync()
if (!string.IsNullOrEmpty(userId))
{
await Groups.AddToGroupAsync(Context.ConnectionId, userId);
_logger.LogInformation($"======================================================================================User {userId} connected with connection ID: {Context.ConnectionId}");
}
else
{
_logger.LogWarning("=========================================================================================User ID is missing in the query string.");
_logger.LogWarning("User ID is missing in the query string.");
}
await base.OnConnectedAsync();
}
Expand All @@ -36,7 +35,7 @@ public override async Task OnDisconnectedAsync(Exception exception)
if (!string.IsNullOrEmpty(userId))
{
await Groups.RemoveFromGroupAsync(Context.ConnectionId, userId);
_logger.LogInformation($"User {userId} disconnected with connection ID: {Context.ConnectionId}");
// _logger.LogInformation($"User {userId} disconnected with connection ID: {Context.ConnectionId}");
}
await base.OnDisconnectedAsync(exception);
}
Expand Down

0 comments on commit 9615ccf

Please sign in to comment.