Skip to content

Commit c450e90

Browse files
committed
clean
0 parents  commit c450e90

File tree

939 files changed

+133155
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

939 files changed

+133155
-0
lines changed

.devcontainer/devcontainer.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/universal
3+
{
4+
"name": "Default Linux Universal",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/universal:2-linux",
7+
"customizations": {
8+
"vscode": {
9+
"extensions": [
10+
"github.copilot",
11+
"github.copilot-chat",
12+
"github.vscode-pull-request-github",
13+
"github.vscode-github-actions"
14+
// "eg2.vscode-npm-script",
15+
// "angular.ng-template",
16+
// "dbaeumer.vscode-eslint",
17+
// "stylelint.vscode-stylelint"
18+
]
19+
}
20+
}
21+
22+
// Features to add to the dev container. More info: https://containers.dev/features.
23+
// "features": {},
24+
25+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
26+
// "forwardPorts": [],
27+
28+
// Use 'postCreateCommand' to run commands after the container is created.
29+
// "postCreateCommand": "export NG_CLI_ANALYTICS=ci && export NG_FORCE_TTY=false && npm i -g @angular/cli && npm install && unset NG_FORCE_TTY"
30+
31+
// Configure tool-specific properties.
32+
// "customizations": {},
33+
34+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
35+
// "remoteUser": "root"
36+
}

.dockerignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.git/
2+
monitoring/
3+
node_modules/
4+
screenshots/
5+
test/
6+
build/reports/
7+
dist/
8+
vagrant/
9+
logs/
10+
Dockerfile
11+
.npmrc
12+
/bom.json
13+
/bom.xml
14+
15+
# Pattern is *not covered* by node_modules/ above no matter what IntelliJ says!
16+
frontend/node_modules/
17+
frontend/dist/

.eslintrc.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (c) 2014-2024 Bjoern Kimminich & the OWASP Juice Shop contributors.
3+
* SPDX-License-Identifier: MIT
4+
*/
5+
6+
module.exports = {
7+
extends: 'standard-with-typescript',
8+
env: {
9+
browser: true,
10+
node: true,
11+
jasmine: true,
12+
mocha: true,
13+
jest: true
14+
},
15+
globals: {
16+
Atomics: 'readonly',
17+
SharedArrayBuffer: 'readonly'
18+
},
19+
parserOptions: {
20+
ecmaVersion: 2018,
21+
project: './tsconfig.json'
22+
},
23+
ignorePatterns: [
24+
'.eslintrc.js',
25+
'app/private/**',
26+
'vagrant/**',
27+
'frontend/**',
28+
'data/static/codefixes/**',
29+
'dist/**'
30+
],
31+
overrides: [
32+
{
33+
files: ['**/*.ts'],
34+
parser: '@typescript-eslint/parser',
35+
rules: {
36+
'no-void': 'off', // conflicting with recommendation from @typescript-eslint/no-floating-promises
37+
// FIXME warnings below this line need to be checked and fixed.
38+
'@typescript-eslint/explicit-function-return-type': 'off',
39+
'@typescript-eslint/strict-boolean-expressions': 'off',
40+
'@typescript-eslint/no-var-requires': 'off'
41+
}
42+
}
43+
]
44+
}

.gitignore

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# App
2+
node_modules/
3+
juiceshop.sqlite
4+
order_*.pdf
5+
app/
6+
!frontend/src/app
7+
uploads/complaints/*.*
8+
!uploads/complaints/.gitkeep
9+
ftp/legal.md
10+
package-lock.json
11+
i18n/*.json
12+
i18n/*.invalid
13+
!frontend/src/assets/i18n/*.json
14+
!data/static/i18n/*.json
15+
data/chatbot/*.*
16+
!data/chatbot/.gitkeep
17+
/data/juiceshop.sqlite-journal
18+
19+
# Build
20+
.nyc_output/
21+
.sass-cache/
22+
build/
23+
cache/
24+
dist/
25+
logs/
26+
vagrant/.vagrant/
27+
*.orig
28+
*.out
29+
*.log
30+
JSON
31+
JSON.map
32+
frontend/src/**/*.js
33+
/bom.json
34+
/bom.xml
35+
36+
# IDEs
37+
.idea/
38+
.vscode/
39+
out/
40+
*.eml
41+
*.iml
42+
*.iws
43+
*.swp
44+
45+
# Branch ghpages
46+
assets/
47+
!frontend/src/assets/
48+
49+
# Custom configuration files
50+
config/*.yml
51+
!config/addo.yml
52+
!config/bodgeit.yml
53+
!config/ctf.yml
54+
!config/fbctf.yml
55+
!config/default.yml
56+
!config/juicebox.yml
57+
!config/quiet.yml
58+
!config/test.yml
59+
!config/7ms.yml
60+
!config/mozilla.yml
61+
!config/unsafe.yml
62+
!config/tutorial.yml
63+
!config/oss.yml
64+
65+
# System Files
66+
.DS_Store

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

Dockerfile

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
FROM node:20-buster as installer
2+
COPY . /juice-shop
3+
WORKDIR /juice-shop
4+
RUN npm i -g typescript ts-node
5+
RUN npm install --omit=dev --unsafe-perm
6+
RUN npm dedupe --omit=dev
7+
RUN rm -rf frontend/node_modules
8+
RUN rm -rf frontend/.angular
9+
RUN rm -rf frontend/src/assets
10+
RUN mkdir logs
11+
RUN chown -R 65532 logs
12+
RUN chgrp -R 0 ftp/ frontend/dist/ logs/ data/ i18n/
13+
RUN chmod -R g=u ftp/ frontend/dist/ logs/ data/ i18n/
14+
RUN rm data/chatbot/botDefaultTrainingData.json || true
15+
RUN rm ftp/legal.md || true
16+
RUN rm i18n/*.json || true
17+
18+
ARG CYCLONEDX_NPM_VERSION=latest
19+
RUN npm install -g @cyclonedx/cyclonedx-npm@$CYCLONEDX_NPM_VERSION
20+
RUN npm run sbom
21+
22+
# workaround for libxmljs startup error
23+
FROM node:20-buster as libxmljs-builder
24+
WORKDIR /juice-shop
25+
RUN apt-get update && apt-get install -y build-essential python3
26+
COPY --from=installer /juice-shop/node_modules ./node_modules
27+
RUN rm -rf node_modules/libxmljs/build && \
28+
cd node_modules/libxmljs && \
29+
npm run build
30+
31+
FROM gcr.io/distroless/nodejs20-debian11
32+
ARG BUILD_DATE
33+
ARG VCS_REF
34+
LABEL maintainer="Bjoern Kimminich <[email protected]>" \
35+
org.opencontainers.image.title="OWASP Juice Shop" \
36+
org.opencontainers.image.description="Probably the most modern and sophisticated insecure web application" \
37+
org.opencontainers.image.authors="Bjoern Kimminich <[email protected]>" \
38+
org.opencontainers.image.vendor="Open Worldwide Application Security Project" \
39+
org.opencontainers.image.documentation="https://help.owasp-juice.shop" \
40+
org.opencontainers.image.licenses="MIT" \
41+
org.opencontainers.image.version="17.1.0" \
42+
org.opencontainers.image.url="https://owasp-juice.shop" \
43+
org.opencontainers.image.source="https://github.com/juice-shop/juice-shop" \
44+
org.opencontainers.image.revision=$VCS_REF \
45+
org.opencontainers.image.created=$BUILD_DATE
46+
WORKDIR /juice-shop
47+
COPY --from=installer --chown=65532:0 /juice-shop .
48+
COPY --chown=65532:0 --from=libxmljs-builder /juice-shop/node_modules/libxmljs ./node_modules/libxmljs
49+
USER 65532
50+
EXPOSE 3000
51+
CMD ["/juice-shop/build/app.js"]

Gruntfile.js

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
/*
2+
* Copyright (c) 2014-2024 Bjoern Kimminich & the OWASP Juice Shop contributors.
3+
* SPDX-License-Identifier: MIT
4+
*/
5+
6+
'use strict'
7+
8+
module.exports = function (grunt) {
9+
const os = grunt.option('os') || process.env.PCKG_OS_NAME || ''
10+
const platform = grunt.option('platform') || process.env.PCKG_CPU_ARCH || ''
11+
const node = grunt.option('node') || process.env.nodejs_version || process.env.PCKG_NODE_VERSION || ''
12+
13+
grunt.initConfig({
14+
pkg: grunt.file.readJSON('package.json'),
15+
16+
replace_json: {
17+
manifest: {
18+
src: 'package.json',
19+
changes: {
20+
'engines.node': (node || '<%= pkg.engines.node %>'),
21+
os: (os ? [os] : '<%= pkg.os %>'),
22+
cpu: (platform ? [platform] : '<%= pkg.cpu %>')
23+
}
24+
}
25+
},
26+
27+
compress: {
28+
pckg: {
29+
options: {
30+
mode: os === 'linux' ? 'tgz' : 'zip',
31+
archive: 'dist/<%= pkg.name %>-<%= pkg.version %>' + (node ? ('_node' + node) : '') + (os ? ('_' + os) : '') + (platform ? ('_' + platform) : '') + (os === 'linux' ? '.tgz' : '.zip')
32+
},
33+
files: [
34+
{
35+
src: [
36+
'.well-known/**',
37+
'LICENSE',
38+
'*.md',
39+
'package.json',
40+
'ctf.key',
41+
'swagger.yml',
42+
'server.ts',
43+
'config.schema.yml',
44+
'build/**',
45+
'!build/reports/**',
46+
'bom.json',
47+
'bom.xml',
48+
'config/*.yml',
49+
'data/*.ts',
50+
'data/static/**',
51+
'data/chatbot/.gitkeep',
52+
'encryptionkeys/**',
53+
'frontend/dist/frontend/**',
54+
'frontend/dist/bom/**',
55+
'frontend/src/**/*.ts',
56+
'ftp/**',
57+
'i18n/.gitkeep',
58+
'lib/**',
59+
'models/*.ts',
60+
'node_modules/**',
61+
'routes/*.ts',
62+
'uploads/complaints/.gitkeep',
63+
'views/**'
64+
],
65+
dest: 'juice-shop_<%= pkg.version %>/'
66+
}
67+
]
68+
}
69+
}
70+
})
71+
72+
grunt.registerTask('checksum', 'Create .md5 checksum files', function () {
73+
const fs = require('fs')
74+
const crypto = require('crypto')
75+
fs.readdirSync('dist/').forEach(file => {
76+
const buffer = fs.readFileSync('dist/' + file)
77+
const md5 = crypto.createHash('md5')
78+
md5.update(buffer)
79+
const md5Hash = md5.digest('hex')
80+
const md5FileName = 'dist/' + file + '.md5'
81+
grunt.file.write(md5FileName, md5Hash)
82+
grunt.log.write(`Checksum ${md5Hash} written to file ${md5FileName}.`).verbose.write('...').ok()
83+
grunt.log.writeln()
84+
})
85+
})
86+
87+
grunt.loadNpmTasks('grunt-replace-json')
88+
grunt.loadNpmTasks('grunt-contrib-compress')
89+
grunt.registerTask('package', ['replace_json:manifest', 'compress:pckg', 'checksum'])
90+
}

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright (c) 2014-2024 Bjoern Kimminich & the OWASP Juice Shop contributors
2+
3+
Permission is hereby granted, free of charge, to any person
4+
obtaining a copy of this software and associated documentation
5+
files (the "Software"), to deal in the Software without
6+
restriction, including without limitation the rights to use,
7+
copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the
9+
Software is furnished to do so, subject to the following
10+
conditions:
11+
12+
The above copyright notice and this permission notice shall be
13+
included in all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)