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

build binary in .net #51

Merged
merged 15 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
ac3c35c
Generating the basics with https://github.com/OWASP/wrongsecrets/issu…
commjoen Feb 27, 2024
8f621a6
Configuring basics for https://github.com/OWASP/wrongsecrets/issues/1243
commjoen Feb 27, 2024
688d523
Setting up quickbuild setup for dotnet as i could not sleep https://g…
commjoen Feb 27, 2024
1f12ad3
Setting up quickbuild setup for dotnet as i could not sleep https://g…
commjoen Feb 27, 2024
5d950a9
Setting up initial appcode for dotnet as i could not sleep https://gi…
commjoen Feb 27, 2024
b7c59e4
setup github actions for dotnet https://github.com/OWASP/wrongsecrets…
commjoen Feb 27, 2024
3dada5f
setup github actions for dotnet https://github.com/OWASP/wrongsecrets…
commjoen Feb 27, 2024
0e528d7
setup github actions for dotnet https://github.com/OWASP/wrongsecrets…
commjoen Feb 27, 2024
6759378
setup github actions for dotnet https://github.com/OWASP/wrongsecrets…
commjoen Feb 27, 2024
4987365
setup initial challenge https://github.com/OWASP/wrongsecrets/issues/…
commjoen Feb 27, 2024
c97b7b9
finalize quickbuild.sh https://github.com/OWASP/wrongsecrets/issues/…
commjoen Feb 27, 2024
f128b3a
fix rust chain issues https://github.com/OWASP/wrongsecrets/issues/1243
commjoen Feb 29, 2024
0ce3469
Add nuget to dependabot https://github.com/OWASP/wrongsecrets/issues/…
commjoen Mar 1, 2024
9a045b8
Add badge to readme https://github.com/OWASP/wrongsecrets/issues/1243
commjoen Mar 1, 2024
c469933
Add badge to readme https://github.com/OWASP/wrongsecrets/issues/1243
commjoen Mar 1, 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
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ updates:
directory: "/rust"
schedule:
interval: "monthly"

- package-ecosystem: "nuget"
directory: "/dotnet/dotnetproject"
schedule:
interval: "monthly"
33 changes: 33 additions & 0 deletions .github/workflows/compile_dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: dotnet package

on:
workflow_dispatch:
push:
paths:
- 'dotnet/**'
- '.github/**'
pull_request:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
runtime: [ 'osx-x64','osx-arm64','win-x64','win-arm64','linux-x64','linux-arm64','linux-musl-x64','linux-musl-arm64']
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Build and Package ${{ matrix.runtime }}
run: |
cd dotnet/dotnetproject
dotnet build dotnetproject.csproj --runtime ${{ matrix.runtime }} --self-contained true
dotnet publish dotnetproject.csproj --runtime ${{ matrix.runtime }} /p:PublishSingleFile=true
ls /home/runner/work/wrongsecrets-binaries/wrongsecrets-binaries/dotnet/dotnetproject/bin/Release/net8.0/${{ matrix.runtime }}/publish/
- name: Uploading executables
uses: actions/upload-artifact@v4
with:
name: executable-dotnet-${{ matrix.runtime }}
path: /home/runner/work/wrongsecrets-binaries/wrongsecrets-binaries/dotnet/dotnetproject/bin/Release/net8.0/${{ matrix.runtime }}/publish/
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ wrongsecrets-golang
wrongsecrets-golang-*
wrongsecrets-rust
wrongsecrets-rust-*
wrongsecrets-dotnet
wrongsecrets-dotnet-*

dockcross/
.vscode/
Expand All @@ -84,3 +86,8 @@ target/

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
dotnet/dotnetproject/bin/
dotnet/dotnetproject/obj/Release/

#MACOS
.DS_Store
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![ Compile CPlus](https://github.com/OWASP/wrongsecrets-binaries/actions/workflows/compile_cplus.yml/badge.svg)](https://github.com/OWASP/wrongsecrets-binaries/actions/workflows/compile_cplus.yml)
[![Compile GoLang](https://github.com/OWASP/wrongsecrets-binaries/actions/workflows/compile_golang.yml/badge.svg)](https://github.com/OWASP/wrongsecrets-binaries/actions/workflows/compile_golang.yml)
[![Compile Rust](https://github.com/OWASP/wrongsecrets-binaries/actions/workflows/compile_rust.yml/badge.svg)](https://github.com/OWASP/wrongsecrets-binaries/actions/workflows/compile_rust.yml)
[![dotnet package](https://github.com/OWASP/wrongsecrets-binaries/actions/workflows/compile_dotnet.yml/badge.svg)](https://github.com/OWASP/wrongsecrets-binaries/actions/workflows/compile_dotnet.yml)

This is a supportive repository for [OWASP WrongSecrets](https://github.com/OWASP/wrongsecrets).
Here we create our binaries which are included in the official project.
Expand Down
36 changes: 36 additions & 0 deletions dotnet/dotnetproject/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

String getSecret()
{
return "This is a dotnet secret, huray.";
}

String evalAnswer(String answer)
{
if (String.Compare(answer, getSecret()) == 0)
{
return "This is correct! Congrats!";
}
else
{
return "This is incorrect. Try again";
}
}

if (args.Length == 0)
{
Console.WriteLine("Welcome to the wrongsecrets dotnet binary which hides a secret.");
Console.WriteLine("Use args spoil or a string to guess the password.");
}
else
{
if (args[0] == "spoil")
{
Console.WriteLine("spoil called");
Console.WriteLine(getSecret());
}
else
{
Console.WriteLine(evalAnswer(args[0]));
}
}

15 changes: 15 additions & 0 deletions dotnet/dotnetproject/dotnetproject.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifiers>osx-x64;osx-arm64;win-x64;win-arm64;linux-x64;linux-arm64;linux-musl-x64;linux-musl-arm64</RuntimeIdentifiers>
<Runtime>osx-x64;osx-arm64;win-x64;win-arm64;linux-x64;linux-arm64;linux-musl-x64;linux-musl-arm64</Runtime>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<self-contained>True</self-contained>
</PropertyGroup>



</Project>
173 changes: 173 additions & 0 deletions dotnet/dotnetproject/obj/dotnetproject.csproj.nuget.dgspec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
{
"format": 1,
"restore": {
"/Users/razr/workspace/owasp/wrongsecrets-binaries/dotnet/dotnetproject/dotnetproject.csproj": {}
},
"projects": {
"/Users/razr/workspace/owasp/wrongsecrets-binaries/dotnet/dotnetproject/dotnetproject.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "/Users/razr/workspace/owasp/wrongsecrets-binaries/dotnet/dotnetproject/dotnetproject.csproj",
"projectName": "dotnetproject",
"projectPath": "/Users/razr/workspace/owasp/wrongsecrets-binaries/dotnet/dotnetproject/dotnetproject.csproj",
"packagesPath": "/Users/razr/.nuget/packages/",
"outputPath": "/Users/razr/workspace/owasp/wrongsecrets-binaries/dotnet/dotnetproject/obj/",
"projectStyle": "PackageReference",
"configFilePaths": [
"/Users/razr/.nuget/NuGet/NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"downloadDependencies": [
{
"name": "Microsoft.AspNetCore.App.Runtime.linux-arm64",
"version": "[8.0.1, 8.0.1]"
},
{
"name": "Microsoft.AspNetCore.App.Runtime.linux-musl-arm64",
"version": "[8.0.1, 8.0.1]"
},
{
"name": "Microsoft.AspNetCore.App.Runtime.linux-musl-x64",
"version": "[8.0.1, 8.0.1]"
},
{
"name": "Microsoft.AspNetCore.App.Runtime.linux-x64",
"version": "[8.0.1, 8.0.1]"
},
{
"name": "Microsoft.AspNetCore.App.Runtime.osx-arm64",
"version": "[8.0.1, 8.0.1]"
},
{
"name": "Microsoft.AspNetCore.App.Runtime.win-arm64",
"version": "[8.0.1, 8.0.1]"
},
{
"name": "Microsoft.AspNetCore.App.Runtime.win-x64",
"version": "[8.0.1, 8.0.1]"
},
{
"name": "Microsoft.NETCore.App.Host.linux-arm64",
"version": "[8.0.1, 8.0.1]"
},
{
"name": "Microsoft.NETCore.App.Host.linux-musl-arm64",
"version": "[8.0.1, 8.0.1]"
},
{
"name": "Microsoft.NETCore.App.Host.linux-musl-x64",
"version": "[8.0.1, 8.0.1]"
},
{
"name": "Microsoft.NETCore.App.Host.linux-x64",
"version": "[8.0.1, 8.0.1]"
},
{
"name": "Microsoft.NETCore.App.Host.osx-arm64",
"version": "[8.0.1, 8.0.1]"
},
{
"name": "Microsoft.NETCore.App.Host.win-arm64",
"version": "[8.0.1, 8.0.1]"
},
{
"name": "Microsoft.NETCore.App.Host.win-x64",
"version": "[8.0.1, 8.0.1]"
},
{
"name": "Microsoft.NETCore.App.Runtime.linux-arm64",
"version": "[8.0.1, 8.0.1]"
},
{
"name": "Microsoft.NETCore.App.Runtime.linux-musl-arm64",
"version": "[8.0.1, 8.0.1]"
},
{
"name": "Microsoft.NETCore.App.Runtime.linux-musl-x64",
"version": "[8.0.1, 8.0.1]"
},
{
"name": "Microsoft.NETCore.App.Runtime.linux-x64",
"version": "[8.0.1, 8.0.1]"
},
{
"name": "Microsoft.NETCore.App.Runtime.osx-arm64",
"version": "[8.0.1, 8.0.1]"
},
{
"name": "Microsoft.NETCore.App.Runtime.win-arm64",
"version": "[8.0.1, 8.0.1]"
},
{
"name": "Microsoft.NETCore.App.Runtime.win-x64",
"version": "[8.0.1, 8.0.1]"
}
],
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "/usr/local/Cellar/dotnet/8.0.1/libexec/sdk/8.0.101/PortableRuntimeIdentifierGraph.json"
}
},
"runtimes": {
"linux-arm64": {
"#import": []
},
"linux-musl-arm64": {
"#import": []
},
"linux-musl-x64": {
"#import": []
},
"linux-x64": {
"#import": []
},
"osx-arm64": {
"#import": []
},
"osx-x64": {
"#import": []
},
"win-arm64": {
"#import": []
},
"win-x64": {
"#import": []
}
}
}
}
}
15 changes: 15 additions & 0 deletions dotnet/dotnetproject/obj/dotnetproject.csproj.nuget.g.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/Users/razr/.nuget/packages/</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/Users/razr/.nuget/packages/</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.8.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="/Users/razr/.nuget/packages/" />
</ItemGroup>
</Project>
2 changes: 2 additions & 0 deletions dotnet/dotnetproject/obj/dotnetproject.csproj.nuget.g.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
Loading
Loading