Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Medium Severitys Remediation #12

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a237ef2
Create main.yml
Edunova8 Mar 2, 2023
9c57815
Update main.yml
Edunova8 Mar 2, 2023
277fa0d
HttpCookie-Remediation
fernandopbarboza Apr 11, 2023
36e2f82
Missing Object Level Authorization-Remediation
fernandopbarboza Apr 11, 2023
7912632
Update 20230713
fernando-barboza Jul 13, 2023
1360b7d
Merge branch 'master' of https://github.com/Nova-8/Damm-Vulnerable-CS…
fernando-barboza Jul 13, 2023
b8e0572
Update main.yml
Edunova8 Jul 17, 2023
6e14e73
Settings update
fernando-barboza Sep 20, 2023
aa1510a
Disparo scan via IDE
fernando-barboza Sep 27, 2023
9dbda4c
Alteração SQL Injection
fernando-barboza Oct 2, 2023
b352d5c
Alteração SQL Injection
fernando-barboza Oct 2, 2023
7eb40d6
Alteração SQL Injection 20231004
fernando-barboza Oct 4, 2023
eddf8cd
Update main.yml
fernando-barboza Oct 25, 2023
0c47963
Update main.yml
fernando-barboza Oct 25, 2023
cfdfc58
Update main.yml
fernando-barboza Oct 25, 2023
0fff26e
Update main.yml
fernando-barboza Oct 31, 2023
f9a162b
Commit demostração
fernando-barboza Nov 9, 2023
4c95f37
Commit demostração
fernando-barboza Nov 9, 2023
71d219d
Merge branch 'master' of https://github.com/Nova-8/Damm-Vulnerable-CS…
fernando-barboza Nov 9, 2023
b349635
Remediação guiada por I.A
fernando-barboza Nov 21, 2023
144c6dc
Update main.yml
Edunova8 Dec 19, 2023
5e5afd3
Update main.yml
Edunova8 Jan 26, 2024
8159be0
Set up CI with Azure Pipelines
Prevelate8 Jun 16, 2024
44418f6
Update azure-pipelines.yml for Azure Pipelines
Prevelate8 Jun 16, 2024
5c4d3d0
Update main.yml
Edunova8 Jul 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Checkmarx One Scan
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Checkmarx One CLI Action
uses: checkmarx/ast-github-action@main #Github Action version
with:
project_name: ${{ github.repository }}
cx_tenant: bradesco-poc
base_uri: https://deu.ast.checkmarx.net/
cx_client_id: ${{ secrets.CANARY_OATH }}
cx_client_secret: ${{ secrets.CANARY_SECRET }}
## additional_params: --apikey ${{ secrets.API_KEY }}
additional_params: --async
Binary file not shown.
Empty file.
Binary file added .vs/Damm-Vulnerable-CSharp-API/v17/.wsuo
Binary file not shown.
3 changes: 3 additions & 0 deletions .vs/ProjectSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"CurrentProjectSetting": null
}
8 changes: 8 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"ExpandedNodes": [
"",
"\\Controllers"
],
"SelectedNode": "\\Controllers\\UsersController.cs",
"PreviewInSolutionExplorer": false
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"githubPullRequests.ignoredPullRequestBranches": [
"master"
]
}
3 changes: 2 additions & 1 deletion Controllers/AuthorizationsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public IActionResult Post([FromBody] AuthorizationRequest authorizationRequest)
[HttpGet("GetTokenSSO")]
public IActionResult GetTokenSSO()
{
var ssoCookieData = HttpContext.Request.Cookies["sso_ctx"];
//var ssoCookieData = HttpContext.Request.Cookies["sso_ctx"];
HttpCookie ssoCookieData = new HttpCookie(HttpContext.Request.Cookies["sso_ctx"]);

if(String.IsNullOrEmpty(ssoCookieData)) {
return Unauthorized();
Expand Down
3 changes: 2 additions & 1 deletion Controllers/UsersController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public IActionResult Put(int id, [FromBody] Models.UserUpdateRequest user)
return BadRequest(ModelState);
}

var existingUser = _context.Users.SingleOrDefault(m => m.ID == id);
//var existingUser = _context.Users.SingleOrDefault(m => m.ID == id);
var existingUser = _context.Users.GetById(id);
if(existingUser == null) {
return NotFound();
}
Expand Down
25 changes: 25 additions & 0 deletions Damm-Vulnerable-CSharp-API.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dvcsharp-core-api", "dvcsharp-core-api.csproj", "{86757448-E853-40A0-8BBD-13E8B77ACB38}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{86757448-E853-40A0-8BBD-13E8B77ACB38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{86757448-E853-40A0-8BBD-13E8B77ACB38}.Debug|Any CPU.Build.0 = Debug|Any CPU
{86757448-E853-40A0-8BBD-13E8B77ACB38}.Release|Any CPU.ActiveCfg = Release|Any CPU
{86757448-E853-40A0-8BBD-13E8B77ACB38}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8305D38D-03A2-4466-B287-430247E98B83}
EndGlobalSection
EndGlobal
28 changes: 28 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Starter pipeline

# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger:
- master
- main

pool:
vmImage: ubuntu-latest

steps:
- script: echo Hello, world!
displayName: 'Run a one-line script'

- script: |
echo Add other tasks to build, test, and deploy your project.
echo See https://aka.ms/yaml
displayName: 'Run a multi-line script'

- task: Checkmarx AST@2
inputs:
CheckmarxService: 'AST-admin'
projectName: '$(Build.Repository.Name)'
branchName: '$(Build.SourceBranchName)'
tenantName: 'beta_nova8'
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ services:
- .:/app
ports:
- "5000:5000"

host: "0.0.0.0"
10 changes: 3 additions & 7 deletions dvcsharp-core-api.csproj
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="DiscordRichPresence" Version="1.2.1.24" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.2.2" />
<PackageReference Include="System.Security.Claims" Version="4.3.0" />
<PackageReference Include="Anarchy-Wrapper" Version="0.6.3" />
</ItemGroup>

<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.2" />
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" />
</ItemGroup>

<ItemGroup>
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.0" />
</ItemGroup>

</Project>
</Project>