Skip to content
Closed
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
37 changes: 37 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "wiz-cli"
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
wiz-cli-iac-scan:
name: "Wiz-cli IaC Scan"
runs-on: ubuntu-latest
env:
SCAN_PATH: "." # Set the relative path in the repo to scan

# Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest
defaults:
run:
shell: bash

steps:
# Checkout the repository to the GitHub Actions runner
- name: Check out repository
uses: actions/checkout@v2

- name: Download Wiz CLI
run: curl -o wizcli https://downloads.wiz.io/wizcli/latest/wizcli-linux-amd64 && chmod +x wizcli

- name: Authenticate to Wiz
run: ./wizcli auth --id "$WIZ_CLIENT_ID" --secret "$WIZ_CLIENT_SECRET"
env:
WIZ_CLIENT_ID: ${{ secrets.WIZ_CLIENT_ID }}
WIZ_CLIENT_SECRET: ${{ secrets.WIZ_CLIENT_SECRET }}

- name: Run wiz CLI IaC scan
run: ./wizcli iac scan --path $SCAN_PATH --policy "$POLICY"
9 changes: 9 additions & 0 deletions src/SQLInjection.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import java.sql.*;
import javax.servlet.http.HttpServletRequest;

public class SQLInjection {
public static ResultSet doQuery(HttpServletRequest request, Connection connection) throws SQLException {
String customerName = request.getParameter("customerName");
String query = "SELECT account_balance FROM user_data WHERE user_name = " + customerName;
Statement statement = connection.createStatement();
ResultSet results = statement.executeQuery(query);