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

Cpd #58

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open

Cpd #58

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
2d601e7
adding ShiftLeft GitHub action
Sep 7, 2023
098c53b
adding ShiftLeft build rules
Sep 7, 2023
033334a
Merge pull request #1 from elangosenthilnathan/demo-branch-1694108226
elangosenthilnathan Sep 7, 2023
c89f71e
adding ShiftLeft GitHub action
Sep 26, 2023
9e3f180
Workflow Update
elangosenthilnathan Oct 13, 2023
d6f01ef
Update shiftleft.yml
elangosenthilnathan Oct 13, 2023
a9739f2
update workflow
elangosenthilnathan Oct 13, 2023
e9333bf
Update shiftleft.yml
elangosenthilnathan Oct 13, 2023
dd362eb
Update shiftleft.yml
elangosenthilnathan Oct 14, 2023
86069aa
Update shiftleft.yml
elangosenthilnathan Oct 14, 2023
0820ba5
Update shiftleft.yml
elangosenthilnathan Oct 14, 2023
cb6645e
Update shiftleft.yml
elangosenthilnathan Oct 16, 2023
12e041b
adding ShiftLeft GitHub action
Dec 5, 2023
468dcf8
Create qwiet.yml
elangosenthilnathan Jan 26, 2024
8cc7264
Update qwiet.yml
elangosenthilnathan Jan 27, 2024
a177e84
Update qwiet.yml
elangosenthilnathan Apr 2, 2024
55c7738
Update qwiet.yml
elangosenthilnathan Apr 18, 2024
54a8657
111
elangosenthilnathan Apr 18, 2024
53d35b0
Update qwiet.yml
elangosenthilnathan Apr 29, 2024
28ce6dc
Update shiftleft.yml
elangosenthilnathan May 17, 2024
c3b2950
Update shiftleft.yml
elangosenthilnathan May 17, 2024
55566d2
1
elangosenthilnathan May 17, 2024
bcd8b8d
2
elangosenthilnathan May 17, 2024
efff9b8
Create secrets.yml
elangosenthilnathan May 22, 2024
f28a4fa
Create config.properties
elangosenthilnathan May 22, 2024
b32ddad
Update DataLoader.java
elangosenthilnathan May 22, 2024
296eb82
Update SearchController.java
elangosenthilnathan May 22, 2024
25e743c
Update qwiet.yml
elangosenthilnathan May 22, 2024
ef85cfc
Update qwiet.yml
elangosenthilnathan May 22, 2024
82024a5
Update qwiet.yml
elangosenthilnathan May 22, 2024
18f755a
Update qwiet.yml
elangosenthilnathan May 23, 2024
b4a81e0
Update qwiet.yml
elangosenthilnathan May 23, 2024
d1e2395
Create qwietai.yml
elangosenthilnathan May 23, 2024
4e8b22c
Update qwiet.yml
elangosenthilnathan May 23, 2024
579603f
Update qwietai.yml
elangosenthilnathan May 23, 2024
7a1b75f
Update qwietai.yml
elangosenthilnathan May 24, 2024
7cb53a2
Update qwietai.yml
elangosenthilnathan May 24, 2024
4e8e03b
Update qwietai.yml
elangosenthilnathan May 24, 2024
daddc31
Update qwietai.yml
elangosenthilnathan May 24, 2024
c163eb5
Update qwietai.yml
elangosenthilnathan May 24, 2024
131461a
Update qwietai.yml
elangosenthilnathan May 24, 2024
bc28248
Update qwietai.yml
elangosenthilnathan May 24, 2024
4e7d701
Update qwietai.yml
elangosenthilnathan May 24, 2024
e344877
Update qwietai.yml
elangosenthilnathan May 24, 2024
d56583c
Update shiftleft.yml
elangosenthilnathan May 28, 2024
a3d707d
Update qwietai.yml
elangosenthilnathan May 28, 2024
62a07e4
Update shiftleft.yml
elangosenthilnathan May 29, 2024
ebb5641
fixed issue with flow state-bn2
conikeec May 30, 2024
2c0dd21
demo path changes
conikeec Aug 9, 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
65 changes: 65 additions & 0 deletions .github/workflows/shiftleft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@

---
name: Qwiet

on:
pull_request:
workflow_dispatch:

jobs:
NextGen-Static-Analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Java JDK
uses: actions/setup-java@v3
with:
java-version: 11.0.x
distribution: zulu

- name: Download ShiftLeft CLI
run: |
curl https://cdn.shiftleft.io/download/sl > ${GITHUB_WORKSPACE}/sl && chmod a+rx ${GITHUB_WORKSPACE}/sl

- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 8

- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch

- name: NextGen Static Analysis
run: ${GITHUB_WORKSPACE}/sl analyze --strict --wait --app shiftleft-java-demo --tag branch=${{ github.head_ref || steps.extract_branch.outputs.branch }} --javasrc .
env:
SHIFTLEFT_ACCESS_TOKEN: ${{ secrets.SHIFTLEFT_ACCESS_TOKEN }}
SHIFTLEFT_API_HOST: www.shiftleft.io
SHIFTLEFT_GRPC_TELEMETRY_HOST: telemetry.shiftleft.io:443
SHIFTLEFT_GRPC_API_HOST: api.shiftleft.io:443


Build-Rules:
runs-on: ubuntu-latest
needs: NextGen-Static-Analysis
steps:
- uses: actions/checkout@v3
- name: Download ShiftLeft CLI
run: |
curl https://cdn.shiftleft.io/download/sl > ${GITHUB_WORKSPACE}/sl && chmod a+rx ${GITHUB_WORKSPACE}/sl
- name: Validate Build Rules
run: |
${GITHUB_WORKSPACE}/sl check-analysis --v2 --app shiftleft-java-demo \
--github-pr-number=${{github.event.number}} \
--github-pr-user=${{ github.repository_owner }} \
--github-pr-repo=${{ github.event.repository.name }} \
--github-token=${{ secrets.GITHUB_TOKEN }}
env:
SHIFTLEFT_ACCESS_TOKEN: ${{ secrets.SHIFTLEFT_ACCESS_TOKEN }}
SHIFTLEFT_API_HOST: www.shiftleft.io
SHIFTLEFT_GRPC_TELEMETRY_HOST: telemetry.shiftleft.io:443
SHIFTLEFT_GRPC_API_HOST: api.shiftleft.io:443

3 changes: 3 additions & 0 deletions config.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
db.user=mkyong
db.password=password
db.url=localhost
26 changes: 17 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,23 @@
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.9</source>
<target>1.9</target>
<jdkToolchain>
<version>9</version>
</jdkToolchain>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
Expand Down
8 changes: 8 additions & 0 deletions secrets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: sio-secret
type: kubernetes.io/scaleio
data:
username: YWRtaW4=
password: c0NhbGVpbzEyMw==
8 changes: 8 additions & 0 deletions shiftleft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
build_rules:
- id: "No critical or high SAST findings"
finding_types:
- vuln
cvss_31_severity_ratings:
- critical
- high
threshold: 0
2 changes: 2 additions & 0 deletions src/main/java/io/shiftleft/controller/SearchController.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class SearchController {
public String doGetSearch(@RequestParam String foo, HttpServletResponse response, HttpServletRequest request) {
java.lang.Object message = new Object();
try {
String ACCESS_KEY_ID = "AKIA2E0A8F3B244C9986";
String SECRET_KEY = "7CE556A3BC234CC1FF9E8A5C324C0BB70AA21B6D";
ExpressionParser parser = new SpelExpressionParser();
Expression exp = parser.parseExpression(foo);
message = (Object) exp.getValue();
Expand Down
11 changes: 10 additions & 1 deletion src/main/java/io/shiftleft/data/DataLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,18 @@ private String getSecurePassword(String masterPassword) throws IOException {
return props.getProperty("db.password");
}

public final class Constants {

private Constants() {
// restrict instantiation
}

public static final double PI = 3.14159;
public static final double PLANCK_CONSTANT = 6.62606896e-34;
}

private boolean connectToAws() {

log.info("Start Loading AWS Properties");
log.info("AWS AccessKey is {} and SecretKey is {}", env.getProperty("aws.accesskey"),
env.getProperty("aws.secretkey"));
log.info("AWS Bucket is {}", env.getProperty("aws.bucket"));
Expand Down