Skip to content

Commit efd8642

Browse files
author
kadraman
committed
Using mongodb-memory for demos
1 parent cf07d8f commit efd8642

File tree

14 files changed

+1814
-293
lines changed

14 files changed

+1814
-293
lines changed
Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
22
# More GitHub Actions for Azure: https://github.com/Azure/actions
33

4-
name: Build and deploy Node.js app to Azure Web App - insecureapi
4+
name: Build and deploy Node.js app to Azure Web App
55

66
on:
77
push:
@@ -14,24 +14,18 @@ jobs:
1414
runs-on: ubuntu-latest
1515
permissions:
1616
contents: read #This is required for actions/checkout
17-
1817
steps:
1918
- uses: actions/checkout@v4
20-
2119
- name: Set up Node.js version
2220
uses: actions/setup-node@v3
2321
with:
2422
node-version: '20.x'
25-
2623
- name: npm install, build, and test
2724
run: |
2825
npm install
2926
npm run build --if-present
30-
npm run test --if-present
31-
3227
- name: Zip artifact for deployment
3328
run: zip release.zip ./* -r
34-
3529
- name: Upload artifact for deployment job
3630
uses: actions/upload-artifact@v4
3731
with:
@@ -41,17 +35,16 @@ jobs:
4135
deploy:
4236
runs-on: ubuntu-latest
4337
needs: build
44-
45-
38+
permissions:
39+
contents: read #This is required for actions/checkout
40+
id-token: write # Required for Azure authentication
4641
steps:
4742
- name: Download artifact from build job
4843
uses: actions/download-artifact@v4
4944
with:
5045
name: node-app
51-
5246
- name: Unzip artifact for deployment
5347
run: unzip release.zip
54-
5548
- name: 'Deploy to Azure Web App'
5649
id: deploy-to-webapp
5750
uses: azure/webapps-deploy@v3

.github/workflows/fod.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ jobs:
131131
- name: Run Fortify on Demand SAST and SCA Scan
132132
uses: fortify/github-action@v2
133133
with:
134-
sast-scan: ${{ github.event.inputs.runFoDSASTScan }}
135-
debricked-sca-scan: ${{ github.event.inputs.runFoDOSSScan }}
134+
sast-scan: true
135+
debricked-sca-scan: false
136136
env:
137137
FOD_URL: ${{ vars.FOD_URL }}
138138
#FOD_TENANT: ${{secrets.FOD_TENANT}}
@@ -189,7 +189,7 @@ jobs:
189189
fcli fod session login --url $FOD_API_URI --client-id $FOD_CLIENT_ID --client-secret $FOD_CLIENT_SECRET --fod-session github-actions
190190
rm -f $PACKAGE_FILE
191191
debricked resolve
192-
zip $PACKAGE_FILE requirements.txt.pip.debricked.lock debricked-config.yaml
192+
zip $PACKAGE_FILE package-lock.json debricked-config.yaml
193193
fcli fod oss-scan start --release "${FOD_RELEASE}" -f $PACKAGE_FILE --store curScan --fod-session github-actions
194194
sleep 10
195195
echo "fod_scan_id=$(fcli util var contents curScan -o 'expr={scanId}')" >> $GITHUB_OUTPUT

config/default.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"App": {
3-
"name": "IWA-API",
3+
"name": "InsecureRestAPI",
44
"version": "1.0",
5-
"description": "IWA-API - An insecure Node/Express REST API for use in Fortify demonstrations.",
6-
"port": 3000,
5+
"description": "InsecureRestAPI - An insecure NodeJS/Express/MongoDB REST API.",
6+
"port": 5000,
77
"dbConfig": {
88
"host": "127.0.0.1",
99
"port": 27017,
@@ -16,7 +16,7 @@
1616
"audience": "https://iwa-api.onfortify.com"
1717
},
1818
"apiConfig": {
19-
"url": "http://localhost:3000",
19+
"url": "http://localhost:5000",
2020
"version": "v1",
2121
"description": "Development server"
2222
},

config/production.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"App": {
33
"dbConfig": {
4-
"host": "mongodb",
4+
"host": "127.0.0.1",
55
"port": 27017,
66
"user": "iwa",
77
"password": "iwa",
88
"database": "iwa"
99
},
1010
"apiConfig": {
11-
"url": "https://iwa-api.onfortify.com",
11+
"url": "https://insecureapi.azurewebsites.net",
1212
"version": "v1",
1313
"description": "Production server"
1414
},

config/test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"database": "iwa-test"
99
},
1010
"apiConfig": {
11-
"url": "https://localhost:3000",
11+
"url": "https://localhost:5000",
1212
"version": "v1",
1313
"description": "Test Server"
1414
},

migrations/001-schema.sql

Lines changed: 0 additions & 58 deletions
This file was deleted.

migrations/002-data.sql

Lines changed: 0 additions & 89 deletions
This file was deleted.

0 commit comments

Comments
 (0)