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

Developer #9

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
69 changes: 69 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# 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

pool:
vmImage: ubuntu-latest


stages:
- stage: SAST
jobs:
- job:
steps:
- task: Maven@4
inputs:
mavenPomFile: 'pom.xml'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
javaHomeOption: 'JDKVersion'
mavenVersionOption: 'Default'
mavenAuthenticateFeed: false
effectivePomSkip: false
sonarQubeRunAnalysis: false
- task: SonarCloudPrepare@1
inputs:
SonarCloud: 'Sonarcloud'
organization: 'fabianes00'
projectKey: 'Fabianes00_spring-boot-kubernetes'
projectName: 'spring-boot-kubernetes'
- task: Maven@4
inputs:
mavenPomFile: 'pom.xml'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
javaHomeOption: 'JDKVersion'
mavenVersionOption: 'Default'
mavenAuthenticateFeed: false
effectivePomSkip: false
sonarQubeRunAnalysis: true
sqMavenPluginVersionChoice: 'latest'

- task: sonarcloud-buildbreaker@2
inputs:
SonarCloud: 'Sonarcloud'
organization: 'fabianes00'

- stage: SCA
jobs:
- job:
steps:
- task: Maven@4
inputs:
mavenPomFile: 'pom.xml'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
javaHomeOption: 'JDKVersion'
mavenVersionOption: 'Default'
mavenAuthenticateFeed: false
effectivePomSkip: false
sonarQubeRunAnalysis: false
- task: dependency-check-build-task@6
inputs:
projectName: 'spring-boot-kubernetes'
scanPath: '$(Build.SourcesDirectory)/target'
format: 'HTML'
7 changes: 7 additions & 0 deletions src/main/Credentials.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import org.h2.security.SHA256;

public class Credentials {
String inputString = "s3cr37";
byte[] key = inputString.getBytes();
SHA256.getHMAC(key, message); // Noncompliant
}
30 changes: 30 additions & 0 deletions src/main/java/org/soyphea/k8s/Credentials2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package org.soyphea.k8s;

public class Credentials2 {
/*
public void getCredentials() {
String inputString = "s3cr37";
byte[] key = inputString.getBytes();
}

protected void doGet(HttpServletRequest req, HttpServletResponse resp) {
String input = req.getParameter("input");

ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("JavaScript");
engine.eval(input); // Noncompliant
}
*/

public void run(javax.servlet.http.HttpServletRequest request) throws ClassNotFoundException {
String name = request.getParameter("name");
Class clazz = Class.forName(name); // Noncompliant
}

public void run2(javax.servlet.http.HttpServletRequest request) throws ClassNotFoundException {
String name = request.getParameter("name");
Class clazz = Class.forName(name); // Noncompliant


}
}