Compare commits
892 Commits
Author | SHA1 | Date | |
---|---|---|---|
386ebfe142 | |||
ee31633822 | |||
4018212304 | |||
833e09fced | |||
f1f5c352df | |||
e58373ffff | |||
ae02d98d37 | |||
3b55ef5ffe | |||
705ec85f35 | |||
1f1fb73f86 | |||
e169650ebc | |||
2589aa3fa4 | |||
51c007c545 | |||
5089c107ba | |||
69a93f30d2 | |||
80e01d680b | |||
0658fcefcd | |||
d41d21b2e6 | |||
939f860ddd | |||
d047c41e86 | |||
8dd66fc0ff | |||
d496c929b3 | |||
f8dda37027 | |||
48fd7f310e | |||
5107e111bf | |||
dd2e9f074d | |||
ec954046db | |||
6be9635f51 | |||
f7dd69e382 | |||
fc6b0f28df | |||
f13632578d | |||
b23b428763 | |||
32a41debad | |||
fafddda82a | |||
5bf33db78f | |||
20d7015dff | |||
2fbc52e6a2 | |||
ab0433bb67 | |||
f2f7f36a6d | |||
3ad51e6d6b | |||
9e6ed11aa7 | |||
2bd6b36210 | |||
bcaf4485c2 | |||
cd2e1c1c09 | |||
22af35a9a7 | |||
c7e04cef97 | |||
fa2769cb25 | |||
1a64fcd8d4 | |||
36bdd9b1a0 | |||
6a875bdaa6 | |||
6a92f651f8 | |||
ad97e2c9a3 | |||
e709a501cb | |||
76af488d16 | |||
981fcb3ebc | |||
cc0d0fa2a6 | |||
a4104fdf8b | |||
720414eba6 | |||
541c424eb9 | |||
be2a6aa0bd | |||
e5ab24a1fc | |||
b0174a6b26 | |||
cb8739ac06 | |||
cb6c8af3bb | |||
672d752e0e | |||
8241d98a38 | |||
86d3868d9e | |||
2f007babec | |||
7742444a99 | |||
98bcef9a5e | |||
c3f9772a27 | |||
01d3453c41 | |||
eb163c8df1 | |||
ff67ee6484 | |||
ccdede647b | |||
4b32cc36a7 | |||
9e15e95001 | |||
dc71975f27 | |||
b79a9c6b2c | |||
a7b9954d0f | |||
dfa0e1cdca | |||
8e6d87d429 | |||
5adf1d1dd7 | |||
5164514789 | |||
f28bb09724 | |||
7602781a5b | |||
b6dff3f32b | |||
360cdc7239 | |||
74ca2ff12a | |||
fbf18440fb | |||
b7a1edd04a | |||
14bb53d43a | |||
906ab766df | |||
902af04dd4 | |||
05bef55c80 | |||
5933d226af | |||
b7ff89243a | |||
835104c88f | |||
246b4de1b8 | |||
49109154a8 | |||
efca784acf | |||
14a6efedf3 | |||
ef4b7ce1a7 | |||
68a69e9b07 | |||
93265a3686 | |||
ae87f7eb49 | |||
38bae09f82 | |||
75b63ea179 | |||
dd89e56f6e | |||
2cb9c52a7a | |||
e89a59b053 | |||
40456f25b9 | |||
f5604df256 | |||
32bd895632 | |||
ffe400cb76 | |||
897afa3c2b | |||
96ec4aa909 | |||
a1796f2577 | |||
362248a065 | |||
9403bbb851 | |||
0c285eef5b | |||
1461263b60 | |||
61f2bfa9ec | |||
04d1293a33 | |||
9af514f3eb | |||
8e567b0f86 | |||
a4218b0016 | |||
42369816c9 | |||
3492655f1d | |||
e75cfbeb11 | |||
7ec6826abc | |||
825193bbb5 | |||
a14e84d5c5 | |||
14ab2faeaf | |||
8e47eac263 | |||
6aaa743302 | |||
0e08c4bde0 | |||
f7871942da | |||
c8fad66973 | |||
9cc0ae5c38 | |||
9a37a27a3c | |||
453a09e0b4 | |||
d566080a79 | |||
4ce098f39b | |||
f22e4f55c1 | |||
15ea31a4df | |||
032b90d483 | |||
a050fa9669 | |||
60bd04b9aa | |||
91af9a0ef7 | |||
486b81f8ec | |||
eed0feed06 | |||
e9df66ca1f | |||
1381daf06e | |||
ac542ad8b8 | |||
a2677cee58 | |||
a641a19615 | |||
a91d45dea5 | |||
81c551552b | |||
69a370f438 | |||
3aa791bc1b | |||
a53ba0af5c | |||
a1071e9c00 | |||
70cda80176 | |||
ac0cb3560c | |||
d9712e7589 | |||
cfe763f98d | |||
4869616176 | |||
30abcc0a1a | |||
38f1d52bf3 | |||
e49f5d610f | |||
04d065fd87 | |||
d345a9a716 | |||
2d8d898fb7 | |||
ad9ee094b4 | |||
cb2277628c | |||
5869b64ee0 | |||
6ae9e44e84 | |||
d0f36f5227 | |||
5d45fd6260 | |||
b3f7a5338e | |||
b858484b97 | |||
b76330f20f | |||
ee1d4b0ac1 | |||
abf431fffb | |||
3e8dbc9bc9 | |||
721edc9985 | |||
82198424df | |||
ba2cb7d14f | |||
de453fad84 | |||
59c96f9890 | |||
f7d3fd586e | |||
798afc756b | |||
59aaab52a9 | |||
14621003d7 | |||
23f67b3d25 | |||
1c6de07a54 | |||
cda852f4e8 | |||
1d6a5ca01b | |||
c574a6610b | |||
ae6d448aa0 | |||
b8bdb8f432 | |||
3300c47c03 | |||
d077a76063 | |||
43d13dd1f9 | |||
072d99040f | |||
4d5968da1a | |||
5a3843cf1f | |||
5fd0f03fd4 | |||
1cd115ace5 | |||
a9f8ff1090 | |||
e114360a5f | |||
b16e60f691 | |||
f959e0387e | |||
425eb03a6e | |||
8e312204ee | |||
2e733f8594 | |||
4e308d7880 | |||
935871c39a | |||
ce6e4d2090 | |||
68a53bc5dc | |||
459d9ad74c | |||
e40a26f193 | |||
59e04dee6e | |||
5a16ea514a | |||
8d2d82764f | |||
dedb2f9fef | |||
8b89667d9d | |||
d4da2d0efa | |||
c798e4be32 | |||
1ebd50cb5b | |||
f2ab5c1968 | |||
ead1d6fffb | |||
9b81cb44fa | |||
142631c7a0 | |||
e78549fb72 | |||
431da30946 | |||
ad5ab4ca2e | |||
522f6b5fff | |||
c6789d7ce3 | |||
215b3b4e78 | |||
00c4be63f0 | |||
2e581d6bdb | |||
b20f6492a3 | |||
74b218b2a7 | |||
b219854f81 | |||
dea4a9d2a9 | |||
6d3f38e2df | |||
60c7fdd0db | |||
bce4c775bf | |||
8bed91a8dc | |||
e78420fa8e | |||
f676b3a3d6 | |||
8b4240889a | |||
262afedb08 | |||
9dbd41c830 | |||
3aab59e326 | |||
0f7a556b9c | |||
48b3c6a07d | |||
649fce6f42 | |||
b1495a8cd5 | |||
69c19d19d4 | |||
89f43229ab | |||
8235ea0f58 | |||
6bee0f3fa6 | |||
574039902d | |||
090263b279 | |||
74cca6d185 | |||
f3e3cbd45f | |||
db3015e0bc | |||
fa9b5ae87d | |||
36cf028334 | |||
488a8e934a | |||
753a2db958 | |||
37e9359c9e | |||
7b8523dcab | |||
dac011db78 | |||
41879c4603 | |||
641d75e734 | |||
e4ec90db8a | |||
d5f78351a2 | |||
ef6993c636 | |||
2d2dc22e19 | |||
db9e1c4c4f | |||
317573c897 | |||
ba8444dd85 | |||
219aad0bbc | |||
1cbaade9ab | |||
98d17433f1 | |||
11a7814626 | |||
5311db8564 | |||
ae156a4a0f | |||
9576c6b9da | |||
6c83457231 | |||
060851a4a2 | |||
671691a5ed | |||
f326755190 | |||
99edda6029 | |||
717f852680 | |||
c42d6b15c3 | |||
dfa3242aeb | |||
23762885fa | |||
60087e441d | |||
2e8d0dd9b5 | |||
966d7a7aed | |||
851fd9ae03 | |||
637d393889 | |||
2dad97bdcb | |||
90ea59cfca | |||
c695614fac | |||
304312018b | |||
3a2bfc9c24 | |||
3d0f879c12 | |||
61720b29ea | |||
75700597e6 | |||
39740e069e | |||
5739705d8a | |||
9b72610510 | |||
c4a046bd12 | |||
f520c3589c | |||
832d6432fc | |||
f4838e1233 | |||
70771ee854 | |||
9dea696c4c | |||
2398949396 | |||
57c008a697 | |||
2614044918 | |||
1aad57ba55 | |||
54610868fe | |||
4831338649 | |||
3bb7ee46bd | |||
1a9ce15e99 | |||
9063b4137f | |||
d7ae3a4391 | |||
db66c1dd02 | |||
608728b135 | |||
88eb4d7b26 | |||
58bc94d1f6 | |||
6f532683a1 | |||
6b68a12449 | |||
27bf08ad5c | |||
52b66ed506 | |||
a5350060e1 | |||
4f649234a9 | |||
96412da04e | |||
0015394582 | |||
9cb63a7c43 | |||
561fb1f7f4 | |||
3b7481c2a7 | |||
f1768bd9a5 | |||
407e19638f | |||
122cc323f2 | |||
9509993a8f | |||
25e66ae412 | |||
089952e9ad | |||
efc5a870a0 | |||
0638cae6e5 | |||
b8abc99faf | |||
e921fb66a9 | |||
e25f7a7560 | |||
c4ae9ae2ab | |||
c4153ecbfb | |||
bb6d06713f | |||
14022d88c9 | |||
d4966b5e71 | |||
b3840e60e3 | |||
3ece45b3d4 | |||
6b7678fb1d | |||
6c25cf8e43 | |||
c4c28f544f | |||
3b050a856a | |||
71d9c4b61a | |||
a8118a14cd | |||
5f3dff4921 | |||
208aa42fdb | |||
cd3fb8040f | |||
9d5fa6f4ef | |||
6797033a09 | |||
9eee726eb5 | |||
4e371b63d0 | |||
edd6b7d7cf | |||
5de82c0a06 | |||
71f2d2968f | |||
0d7daf60d9 | |||
bb80e11665 | |||
8088465652 | |||
035c8662d4 | |||
a831d949b2 | |||
4c45a1e68c | |||
f79ad452d2 | |||
59076fc9ef | |||
b6aa677594 | |||
681a20a7c3 | |||
c5ec2d40a1 | |||
b5e5dd1d13 | |||
9c0b7f8233 | |||
5dd6b31905 | |||
f40b6ffd31 | |||
7313fc6c08 | |||
fe2ac1b8d4 | |||
ba74898441 | |||
1d477bd0e8 | |||
48b604d6d9 | |||
2ab8a838c3 | |||
e07a2aff48 | |||
7d48427d4f | |||
d8844216cc | |||
ab3cd118c9 | |||
8da4342430 | |||
ddf6ac9bdb | |||
f7b794bf68 | |||
1a83e2825e | |||
66bd1d8c1a | |||
531db87876 | |||
cac5985873 | |||
c03b8e22bf | |||
710adfae20 | |||
9b87fd602c | |||
28299f3ced | |||
689e3de7a4 | |||
25dae3a4a8 | |||
d73875e8e8 | |||
e783c0c1f1 | |||
2a6b3d189e | |||
96d11697d4 | |||
a0933d83d5 | |||
9fdbbf69d6 | |||
1f00d461a8 | |||
6dc679e7b8 | |||
00873cfe3f | |||
e932253f06 | |||
8d7142e6d3 | |||
e0ac4a1083 | |||
f140875156 | |||
18d43f16d3 | |||
aee4b74202 | |||
b481ed70e8 | |||
fd7fb4cfbc | |||
663224d06a | |||
7536770769 | |||
6c14f4987c | |||
3d38ed7680 | |||
1a11702979 | |||
0319c477b1 | |||
45c7949118 | |||
9b906a2a29 | |||
686d8b0c85 | |||
d080b3ef06 | |||
dad9c75ee0 | |||
35c1305ce9 | |||
261f947777 | |||
c8ef848657 | |||
f29b923eef | |||
6fe5831f11 | |||
cf00454f8b | |||
e8d086ac9b | |||
3ec4592fb2 | |||
d7a2596670 | |||
9c431eb2a3 | |||
1be9397c21 | |||
82ad0a7cc7 | |||
4777dab57a | |||
a5cb5b0e8e | |||
30d38f9b56 | |||
ec236a4ff5 | |||
57e6a84cef | |||
2b01cbcb75 | |||
f774364461 | |||
04f1b9a282 | |||
71dea87653 | |||
dceb375d5e | |||
5e6f825e64 | |||
361249c666 | |||
fb2e11fe11 | |||
a56f41e0ea | |||
43c25dc3bb | |||
6e9a52a05e | |||
f7c8a271aa | |||
7a4f6e6fd3 | |||
aec051a9f1 | |||
bf52e7a992 | |||
0982bd982c | |||
75a174ff7b | |||
2283f945a9 | |||
ff530e926e | |||
139651615e | |||
924a53c22a | |||
c93563da3f | |||
73553d91d3 | |||
f0d1555a09 | |||
6d36e7db74 | |||
e01c2a35ce | |||
7d9f24c86b | |||
18eee4df58 | |||
e61c943f97 | |||
d2e23f6b8e | |||
ffbc808e26 | |||
ae674b9297 | |||
33c73a7dca | |||
216b29fca2 | |||
ee0988effe | |||
67440a6cc8 | |||
6c8921a951 | |||
b395be9bd0 | |||
7ad3996f2f | |||
b65644edee | |||
ea38973068 | |||
7d0a63ac95 | |||
f9e78739f3 | |||
656fa40182 | |||
99435a1073 | |||
9471e53818 | |||
d814522223 | |||
2eaf263e81 | |||
41f252970b | |||
63a1097466 | |||
bc0d803123 | |||
12de48ebbb | |||
62fbd6d340 | |||
e36b4c3910 | |||
97f66545e0 | |||
27125acd22 | |||
1aa98be908 | |||
cb667094f2 | |||
703b6c676e | |||
00deb66ad9 | |||
2a5e8dfdac | |||
98537426f2 | |||
529e8d73e1 | |||
d8d32c60cb | |||
9b0c4e62c2 | |||
aa2eac0cd8 | |||
8fdfbbd3fb | |||
80b8326766 | |||
a4da1a76e8 | |||
e57c9d05b6 | |||
2b2e267594 | |||
4bafc19883 | |||
48d926491f | |||
203b5fe717 | |||
0ac8b7c716 | |||
331d9c8dd4 | |||
c6c0cc60f9 | |||
bb7fb3f197 | |||
93830ac15b | |||
5df6e987eb | |||
a242347ee0 | |||
89037c3dfb | |||
bcacf94c6f | |||
5a11a5dae9 | |||
b8e68d13b8 | |||
a8106f6671 | |||
2d5919dfc6 | |||
b190b08258 | |||
256c0d05aa | |||
53c16c8b82 | |||
875f0487bd | |||
5c2d9cd8e9 | |||
e976dbe10f | |||
f586bded4d | |||
7c32232faa | |||
2be2de8ce1 | |||
27a61f0f70 | |||
0915bf3d7f | |||
df49fcdb39 | |||
e8caeedf53 | |||
d27577c1c4 | |||
cec60447c4 | |||
e859c9c37b | |||
3883563c7d | |||
5c41e6080c | |||
7daaac9a3f | |||
84f67b5a7e | |||
64d3cdfc86 | |||
4878ea637e | |||
0588daff9d | |||
37b5abea80 | |||
aa22bfb528 | |||
bbb0b607b2 | |||
8b61811278 | |||
3d7974aa45 | |||
8c7eaf87d6 | |||
587c44b52e | |||
1d9abef80f | |||
74961c5632 | |||
2f39f48747 | |||
387a0e8e7d | |||
66821df6f0 | |||
49e0f75fb5 | |||
30b2c8b4d6 | |||
b7a90345b2 | |||
2a26cc3cc7 | |||
0bd14d9178 | |||
06a8bd8b0e | |||
44a9a776bf | |||
43504b9a7b | |||
5fa11a1b4b | |||
8bc91ba4ec | |||
94b936036a | |||
72e13889d0 | |||
91e6f70919 | |||
b02a01d35e | |||
6d974b5fa8 | |||
cfce7763f0 | |||
63502d6328 | |||
971062561d | |||
e7b69c4953 | |||
8944bfcc1d | |||
6327b82204 | |||
f209c424b4 | |||
73c2313658 | |||
760c3f2990 | |||
98a32c7cdf | |||
09baecb3e9 | |||
6cf3740c04 | |||
e873752eac | |||
4cdd649a5a | |||
ea04d6ef35 | |||
72ae0d503b | |||
f66ad51721 | |||
b22deec5b8 | |||
af565b5035 | |||
eb29ed00ff | |||
58dc5d2d41 | |||
600c6203ef | |||
fffbb3c804 | |||
dd8b067a55 | |||
596383fd59 | |||
90da672be2 | |||
0098f07d00 | |||
6b669df025 | |||
7733ea0c85 | |||
295b5a4772 | |||
2ee3b22207 | |||
990bf079d3 | |||
362671e67e | |||
46f92dad3b | |||
3a7601d348 | |||
2962ddbb3e | |||
1cfd8dd843 | |||
61d8051b5f | |||
7db39765c6 | |||
718b113f86 | |||
551f87dbd9 | |||
dbba0fc188 | |||
8dd0957c39 | |||
50c88738c2 | |||
baff6b06f3 | |||
41998a0143 | |||
46e71a8bcd | |||
3b0c09add7 | |||
002ce6e8a6 | |||
1bcddaf710 | |||
cd3f7ea924 | |||
14f4b42ba5 | |||
26e3803de0 | |||
6fe7582dfb | |||
4e6c721545 | |||
75b1895122 | |||
083eb1b567 | |||
d2a2716a9a | |||
0529289f6d | |||
adc8891160 | |||
2fdde982eb | |||
2334b3c02d | |||
8667a85865 | |||
78ff54b910 | |||
bca50e8ca5 | |||
6e36cc1ea4 | |||
4050e899ff | |||
1c2648e0a9 | |||
24bbb636f8 | |||
7291651967 | |||
528c05a859 | |||
e625d4008b | |||
53050d7198 | |||
5ebf838cd2 | |||
a49dd6c348 | |||
c0dd773b90 | |||
bd86dc6ee0 | |||
d6dae9ef75 | |||
941ca5e9a1 | |||
5bc48193b6 | |||
e9b1a10a52 | |||
c58ff9d0cb | |||
4948380aa1 | |||
6c86929aa6 | |||
c25643afe2 | |||
7be519e724 | |||
98f75e34d5 | |||
5ba6492684 | |||
72968d9619 | |||
631fedb752 | |||
4f59bf545e | |||
5d5ba53473 | |||
7b8e3cdb52 | |||
9be4361afc | |||
b0e3a06b50 | |||
9170dcb87f | |||
dc5f9880af | |||
ed490a5ecf | |||
81d6e12ae1 | |||
c3ee0b7662 | |||
959a3c6420 | |||
3fa10c4b10 | |||
ec225558b9 | |||
dd1009bc54 | |||
bf45a0a8e5 | |||
f81a6852db | |||
6699456ee1 | |||
ecbbb5258e | |||
1520c7571f | |||
5921a06747 | |||
b6e4995d11 | |||
a2f28460c0 | |||
0797c3e2bf | |||
f9a4061604 | |||
580e50f558 | |||
3d58049af6 | |||
bca8b3c650 | |||
1252e3dc21 | |||
63a50df7a1 | |||
f9e552f1cd | |||
2233550fe1 | |||
cb18295f9f | |||
651698d96c | |||
4d7d0058c3 | |||
e3fba396de | |||
3536fd0b6d | |||
bc84e8f207 | |||
14dbd47675 | |||
898dd90c6f | |||
ac12a009e4 | |||
699b1bfd89 | |||
ad77a7ab24 | |||
b7278590f5 | |||
9dd93d88d9 | |||
4c767cb977 | |||
12123ef13b | |||
c7da546249 | |||
a41ff0083c | |||
701a99cf8f | |||
844808bfa7 | |||
81aac93dfe | |||
e5ec2c1ee0 | |||
b0fbeaff2c | |||
b47bb96534 | |||
3b9b695ef1 | |||
1d2575a211 | |||
56fc983414 | |||
268adbcf7e | |||
f383454440 | |||
bae3e75ae2 | |||
a7b82985d4 | |||
3d282e163c | |||
7068c84c6a | |||
0030c7bdfb | |||
89f6a73275 | |||
cf0e4e40cf | |||
dfd51f8b54 | |||
5e8c610fbf | |||
71514fc39b | |||
1734170e9e | |||
c89afe6334 | |||
9af0054b5b | |||
26aa72e721 | |||
c510bd9bf1 | |||
6bf853d953 | |||
b298440985 | |||
c7a714a590 | |||
93620f148b | |||
ecb7688e08 | |||
0de784eb32 | |||
4691bc5fd5 | |||
fc2c99bcb4 | |||
7292a577e3 | |||
396c1c1d47 | |||
2911788679 | |||
985148ede3 | |||
9587550bc5 | |||
9a0995dae5 | |||
4e07e0ebfa | |||
6e95fdfe56 | |||
e045bc692d | |||
589872ad47 | |||
5f4889cefe | |||
55793dd153 | |||
1edceb0aa8 | |||
d2b6725f3b | |||
6e003bc088 | |||
f8a7a61e85 | |||
eaf68d38c5 | |||
8d7ecb19d7 | |||
e0cf5b4a84 | |||
5b524d3a94 | |||
dda6f674a3 | |||
e06d4642eb | |||
4a8fdcf887 | |||
fd96ba18f1 | |||
60ef35e241 | |||
9d7886d572 | |||
7a0820bf89 | |||
ea9c1a453d | |||
63ca11a1bb | |||
5378d72600 | |||
93d6d0e6b7 | |||
84860e65f6 | |||
a73bf58d36 | |||
0ff6000511 | |||
91d9db5f80 | |||
ac1b9e8311 | |||
9d49373486 | |||
ead78d40e6 | |||
7b5bb6d6f1 | |||
408a637649 | |||
e96ab488ff | |||
31f7ea6985 | |||
6cf96f971d | |||
0b9a027c19 | |||
186f24f1df | |||
089dd56a15 | |||
6cfefba0ee | |||
20e45da8ae | |||
e34faa13d6 | |||
927bbad488 | |||
6a5ca43e7e | |||
5d28ef9fbe | |||
9aa674e326 | |||
84e3fcde07 | |||
6209b3fe8d | |||
a1db8e8bd9 | |||
6b4a488c8c | |||
0e160c19f5 | |||
8050a2b56d | |||
11ffa5702c | |||
32927c8109 | |||
8b8a89a8ab | |||
e4ca0c4836 | |||
e422da4c64 | |||
76daac0db5 | |||
245ba2c3d1 | |||
672d78eebc | |||
f4eb96fc6a | |||
46fedf3764 | |||
f30db3abfc | |||
58d4b81df2 | |||
a922c00182 | |||
2ae1b4955f | |||
f21fe7f2c3 | |||
13a4b69cbe | |||
98efc1235f | |||
b99b554522 | |||
3cd349bb4b | |||
04ccf9a422 | |||
ee11381a63 | |||
2cc6c232e2 | |||
dec55d52ca | |||
568fa82270 | |||
bad60c43c0 | |||
a6b9235711 | |||
253a2f16ed | |||
e801b0917d | |||
ae92ac6808 | |||
a9ac00a075 | |||
0120c7c3a6 | |||
5bbdb8893c | |||
e3e7ed004f | |||
05d8b590f3 | |||
114fbc5760 | |||
32311a80da | |||
d3ee9431d8 | |||
4811a9d563 | |||
c6e86861fe | |||
b64aa43760 | |||
dd7f4074cd | |||
8c10000e4e | |||
43b82027f5 | |||
5eed385d5d | |||
75d0405da1 | |||
157b982394 | |||
a11e6911cd | |||
5614cda0bf | |||
69d44aed5b | |||
f6911b49a7 | |||
24cf806787 | |||
1ac305e9b9 | |||
c6f1c5cd2a | |||
74218de135 | |||
1f6d7fdc39 | |||
cce1945f23 | |||
45d48a8776 | |||
50904cf69b |
16
.editorconfig
Normal file
16
.editorconfig
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = true
|
||||||
|
max_line_length = 120
|
||||||
|
tab_width = 4
|
||||||
|
ij_continuation_indent_size = 8
|
||||||
|
ij_formatter_off_tag = @formatter:off
|
||||||
|
ij_formatter_on_tag = @formatter:on
|
||||||
|
ij_formatter_tags_enabled = false
|
||||||
|
ij_wrap_on_typing = true
|
||||||
|
ij_java_names_count_to_use_import_on_demand = 999
|
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
custom: https://owasp.org/donate/?reponame=www-project-webgoat&title=OWASP+WebGoat
|
7
.github/dependabot.yml
vendored
Normal file
7
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
# Maintain dependencies for GitHub Actions
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
10
.github/lock.yml
vendored
Normal file
10
.github/lock.yml
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
daysUntilLock: 365
|
||||||
|
skipCreatedBefore: false
|
||||||
|
exemptLabels: []
|
||||||
|
lockLabel: false
|
||||||
|
lockComment: >
|
||||||
|
This thread has been automatically locked because it has not had
|
||||||
|
recent activity after it was closed. :lock: Please open a new issue
|
||||||
|
for regressions or related bugs.
|
||||||
|
setLockReason: false
|
10
.github/stale.yml
vendored
Normal file
10
.github/stale.yml
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
daysUntilStale: 90
|
||||||
|
daysUntilClose: 14
|
||||||
|
onlyLabels:
|
||||||
|
- waiting-for-input
|
||||||
|
- wontfix
|
||||||
|
staleLabel: stale
|
||||||
|
markComment: >
|
||||||
|
This issue has been automatically marked as `stale` because it has not had recent activity. :calendar: It will be _closed automatically_ in one week if no further activity occurs.
|
||||||
|
closeComment: false
|
54
.github/workflows/branch_build.yml
vendored
Normal file
54
.github/workflows/branch_build.yml
vendored
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
name: "Branch build"
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches-ignore:
|
||||||
|
- main
|
||||||
|
- develop
|
||||||
|
- release/*
|
||||||
|
jobs:
|
||||||
|
install-notest:
|
||||||
|
if: "github.repository != 'WebGoat/WebGoat'"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: "Package and linting"
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: set up JDK 17
|
||||||
|
uses: actions/setup-java@v2
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: 17
|
||||||
|
architecture: x64
|
||||||
|
- name: Cache Maven packages
|
||||||
|
uses: actions/cache@v2.1.7
|
||||||
|
with:
|
||||||
|
path: ~/.m2
|
||||||
|
key: ubuntu-latest-m2-${{ hashFiles('**/pom.xml') }}
|
||||||
|
restore-keys: ubuntu-latest-m2
|
||||||
|
- name: Test with Maven
|
||||||
|
run: mvn install -DskipTests
|
||||||
|
|
||||||
|
testing:
|
||||||
|
if: "github.repository != 'WebGoat/WebGoat'"
|
||||||
|
needs: install-notest
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
args:
|
||||||
|
- mvn -pl '!webgoat-integration-tests' test
|
||||||
|
- mvn -pl webgoat-integration-tests test
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: set up JDK 17
|
||||||
|
uses: actions/setup-java@v2
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: 17
|
||||||
|
architecture: x64
|
||||||
|
- name: Cache Maven packages
|
||||||
|
uses: actions/cache@v2.1.7
|
||||||
|
with:
|
||||||
|
path: ~/.m2
|
||||||
|
key: ubuntu-latest-m2-${{ hashFiles('**/pom.xml') }}
|
||||||
|
restore-keys: ubuntu-latest-m2
|
||||||
|
- name: Test with Maven
|
||||||
|
run: ${{ matrix.args }}
|
45
.github/workflows/pr_build.yml
vendored
Normal file
45
.github/workflows/pr_build.yml
vendored
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
name: "Pull request build"
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- '.txt'
|
||||||
|
- '*.MD'
|
||||||
|
- '*.md'
|
||||||
|
- 'LICENSE'
|
||||||
|
- 'docs/**'
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- release/*
|
||||||
|
tags-ignore:
|
||||||
|
- '*'
|
||||||
|
paths-ignore:
|
||||||
|
- '.txt'
|
||||||
|
- '*.MD'
|
||||||
|
- '*.md'
|
||||||
|
- 'LICENSE'
|
||||||
|
- 'docs/**'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
|
java: [17]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up JDK ${{ matrix.java }}
|
||||||
|
uses: actions/setup-java@v2
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: ${{ matrix.java }}
|
||||||
|
architecture: x64
|
||||||
|
- name: Cache Maven packages
|
||||||
|
uses: actions/cache@v2.1.7
|
||||||
|
with:
|
||||||
|
path: ~/.m2
|
||||||
|
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
||||||
|
restore-keys: ${{ runner.os }}-m2
|
||||||
|
- name: Build with Maven
|
||||||
|
run: mvn package
|
135
.github/workflows/release.yml
vendored
Normal file
135
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
name: "Release Pipeline"
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- v*
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
if: github.repository == 'WebGoat/WebGoat'
|
||||||
|
name: Release WebGoat
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
environment:
|
||||||
|
name: release
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2.3.4
|
||||||
|
|
||||||
|
- name: "Get tag name"
|
||||||
|
id: tag
|
||||||
|
uses: dawidd6/action-get-tag@v1
|
||||||
|
|
||||||
|
- name: Set up JDK 15
|
||||||
|
uses: actions/setup-java@v2
|
||||||
|
with:
|
||||||
|
distribution: 'zulu'
|
||||||
|
java-version: 15
|
||||||
|
architecture: x64
|
||||||
|
|
||||||
|
- name: Cache Maven packages
|
||||||
|
uses: actions/cache@v2.1.7
|
||||||
|
with:
|
||||||
|
path: ~/.m2
|
||||||
|
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
||||||
|
restore-keys: ${{ runner.os }}-m2
|
||||||
|
|
||||||
|
- name: "Set labels for ${{ github.ref }}"
|
||||||
|
run: |
|
||||||
|
echo "WEBGOAT_TAG_VERSION=${{ steps.tag.outputs.tag }}" >> $GITHUB_ENV
|
||||||
|
WEBGOAT_MAVEN_VERSION=${{ steps.tag.outputs.tag }}
|
||||||
|
echo "WEBGOAT_MAVEN_VERSION=${WEBGOAT_MAVEN_VERSION:1}" >> $GITHUB_ENV
|
||||||
|
- name: Build with Maven
|
||||||
|
run: |
|
||||||
|
mvn versions:set -DnewVersion=${{ env.WEBGOAT_MAVEN_VERSION }}
|
||||||
|
mvn install -DskipTests
|
||||||
|
|
||||||
|
- name: "Create release"
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
draft: false
|
||||||
|
files: |
|
||||||
|
webgoat-server/target/webgoat-server-${{ env.WEBGOAT_MAVEN_VERSION }}.jar
|
||||||
|
webwolf/target/webwolf-${{ env.WEBGOAT_MAVEN_VERSION }}.jar
|
||||||
|
body: |
|
||||||
|
## Version ${{ steps.tag.outputs.tag }}
|
||||||
|
|
||||||
|
### New functionality
|
||||||
|
|
||||||
|
- test
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
- [#743 - Character encoding errors](https://github.com/WebGoat/WebGoat/issues/743)
|
||||||
|
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
Special thanks to the following contributors providing us with a pull request:
|
||||||
|
|
||||||
|
- Person 1
|
||||||
|
- Person 2
|
||||||
|
|
||||||
|
And everyone who provided feedback through Github.
|
||||||
|
|
||||||
|
|
||||||
|
Team WebGoat
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: "Set up QEMU"
|
||||||
|
uses: docker/setup-qemu-action@v1.1.0
|
||||||
|
with:
|
||||||
|
platforms: all
|
||||||
|
|
||||||
|
- name: "Set up Docker Buildx"
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: "Login to dockerhub"
|
||||||
|
uses: docker/login-action@v1.9.0
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: "Build and push"
|
||||||
|
uses: docker/build-push-action@v2.7.0
|
||||||
|
with:
|
||||||
|
context: ./docker
|
||||||
|
file: docker/Dockerfile
|
||||||
|
push: true
|
||||||
|
platforms: linux/amd64, linux/arm64, linux/arm/v7
|
||||||
|
tags: |
|
||||||
|
webgoat/goatandwolf:${{ env.WEBGOAT_TAG_VERSION }}
|
||||||
|
webgoat/goatandwolf:latest
|
||||||
|
build-args: |
|
||||||
|
webgoat_version=${{ env.WEBGOAT_MAVEN_VERSION }}
|
||||||
|
|
||||||
|
- name: "Image digest"
|
||||||
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||||
|
new_version:
|
||||||
|
if: github.repository == 'WebGoat/WebGoat'
|
||||||
|
name: Update development version
|
||||||
|
needs: [ release ]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
environment:
|
||||||
|
name: release
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2.3.4
|
||||||
|
with:
|
||||||
|
ref: develop
|
||||||
|
token: ${{ secrets.WEBGOAT_DEPLOYER_TOKEN }}
|
||||||
|
|
||||||
|
- name: Set up JDK 15
|
||||||
|
uses: actions/setup-java@v2
|
||||||
|
with:
|
||||||
|
java-version: 15
|
||||||
|
architecture: x64
|
||||||
|
|
||||||
|
- name: Set version to next snapshot
|
||||||
|
run: |
|
||||||
|
mvn build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT versions:commit
|
||||||
|
|
||||||
|
- name: Commit pom.xml
|
||||||
|
run: |
|
||||||
|
git config user.name webgoat-github
|
||||||
|
git config user.email owasp.webgoat@gmail.com
|
||||||
|
find . -name 'pom.xml' | xargs git add
|
||||||
|
git commit -m "Updating to the new development version"
|
||||||
|
git push
|
17
.github/workflows/welcome.yml
vendored
Normal file
17
.github/workflows/welcome.yml
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
name: Welcome
|
||||||
|
|
||||||
|
on:
|
||||||
|
issues:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
greeting:
|
||||||
|
if: github.repository == 'WebGoat/WebGoat'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/first-interaction@v1.1.0
|
||||||
|
with:
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
issue-message: 'Thanks for submitting your first issue, we will have a look as quickly as possible.'
|
||||||
|
pr-message: 'Thanks so much for your contribution, really appreciated! We will have a look and merge it if everything checks out!'
|
18
.gitignore
vendored
18
.gitignore
vendored
@ -14,7 +14,9 @@
|
|||||||
/.settings/org.eclipse.wst.validation.prefs
|
/.settings/org.eclipse.wst.validation.prefs
|
||||||
/.externalToolBuilders/
|
/.externalToolBuilders/
|
||||||
.project
|
.project
|
||||||
/target
|
*/target/*
|
||||||
|
*.pmd
|
||||||
|
mongo-data/*
|
||||||
.classpath
|
.classpath
|
||||||
.idea/
|
.idea/
|
||||||
.settings/
|
.settings/
|
||||||
@ -29,6 +31,7 @@ src/main/webapp/plugin_lessons/*.jar
|
|||||||
src/main/webapp/users/*.props
|
src/main/webapp/users/*.props
|
||||||
classes/*
|
classes/*
|
||||||
*.iml
|
*.iml
|
||||||
|
pom.xml.versionsBackup
|
||||||
|
|
||||||
/*.iml
|
/*.iml
|
||||||
.extract/*
|
.extract/*
|
||||||
@ -39,3 +42,16 @@ webgoat-lessons/**/target
|
|||||||
**/*.jar
|
**/*.jar
|
||||||
**/.DS_Store
|
**/.DS_Store
|
||||||
webgoat-server/mongo-data/*
|
webgoat-server/mongo-data/*
|
||||||
|
webgoat-lessons/vulnerable-components/dependency-reduced-pom.xml
|
||||||
|
**/.sts4-cache/*
|
||||||
|
**/.vscode/*
|
||||||
|
**/.factorypath
|
||||||
|
/.sonatype
|
||||||
|
**/bin/*
|
||||||
|
webgoat.lck
|
||||||
|
webgoat.log
|
||||||
|
webgoat.properties
|
||||||
|
webgoat.script
|
||||||
|
TestClass.class
|
||||||
|
**/*.flattened-pom.xml
|
||||||
|
/.gitconfig
|
||||||
|
117
.mvn/wrapper/MavenWrapperDownloader.java
vendored
Normal file
117
.mvn/wrapper/MavenWrapperDownloader.java
vendored
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2007-present the original author or authors.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import java.net.*;
|
||||||
|
import java.io.*;
|
||||||
|
import java.nio.channels.*;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
public class MavenWrapperDownloader {
|
||||||
|
|
||||||
|
private static final String WRAPPER_VERSION = "0.5.5";
|
||||||
|
/**
|
||||||
|
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
|
||||||
|
*/
|
||||||
|
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
|
||||||
|
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
|
||||||
|
* use instead of the default one.
|
||||||
|
*/
|
||||||
|
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
|
||||||
|
".mvn/wrapper/maven-wrapper.properties";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path where the maven-wrapper.jar will be saved to.
|
||||||
|
*/
|
||||||
|
private static final String MAVEN_WRAPPER_JAR_PATH =
|
||||||
|
".mvn/wrapper/maven-wrapper.jar";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Name of the property which should be used to override the default download url for the wrapper.
|
||||||
|
*/
|
||||||
|
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
|
||||||
|
|
||||||
|
public static void main(String args[]) {
|
||||||
|
System.out.println("- Downloader started");
|
||||||
|
File baseDirectory = new File(args[0]);
|
||||||
|
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
|
||||||
|
|
||||||
|
// If the maven-wrapper.properties exists, read it and check if it contains a custom
|
||||||
|
// wrapperUrl parameter.
|
||||||
|
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
|
||||||
|
String url = DEFAULT_DOWNLOAD_URL;
|
||||||
|
if(mavenWrapperPropertyFile.exists()) {
|
||||||
|
FileInputStream mavenWrapperPropertyFileInputStream = null;
|
||||||
|
try {
|
||||||
|
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
|
||||||
|
Properties mavenWrapperProperties = new Properties();
|
||||||
|
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
|
||||||
|
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
|
||||||
|
} catch (IOException e) {
|
||||||
|
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if(mavenWrapperPropertyFileInputStream != null) {
|
||||||
|
mavenWrapperPropertyFileInputStream.close();
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
// Ignore ...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("- Downloading from: " + url);
|
||||||
|
|
||||||
|
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
|
||||||
|
if(!outputFile.getParentFile().exists()) {
|
||||||
|
if(!outputFile.getParentFile().mkdirs()) {
|
||||||
|
System.out.println(
|
||||||
|
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
|
||||||
|
try {
|
||||||
|
downloadFileFromURL(url, outputFile);
|
||||||
|
System.out.println("Done");
|
||||||
|
System.exit(0);
|
||||||
|
} catch (Throwable e) {
|
||||||
|
System.out.println("- Error downloading");
|
||||||
|
e.printStackTrace();
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
|
||||||
|
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
|
||||||
|
String username = System.getenv("MVNW_USERNAME");
|
||||||
|
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
|
||||||
|
Authenticator.setDefault(new Authenticator() {
|
||||||
|
@Override
|
||||||
|
protected PasswordAuthentication getPasswordAuthentication() {
|
||||||
|
return new PasswordAuthentication(username, password);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
URL website = new URL(urlString);
|
||||||
|
ReadableByteChannel rbc;
|
||||||
|
rbc = Channels.newChannel(website.openStream());
|
||||||
|
FileOutputStream fos = new FileOutputStream(destination);
|
||||||
|
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
|
||||||
|
fos.close();
|
||||||
|
rbc.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
2
.mvn/wrapper/maven-wrapper.properties
vendored
Normal file
2
.mvn/wrapper/maven-wrapper.properties
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip
|
||||||
|
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
|
53
.travis.yml
53
.travis.yml
@ -1,53 +0,0 @@
|
|||||||
services:
|
|
||||||
- docker
|
|
||||||
language: java
|
|
||||||
jdk:
|
|
||||||
- oraclejdk8
|
|
||||||
install: "/bin/true"
|
|
||||||
script:
|
|
||||||
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
|
|
||||||
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH"
|
|
||||||
- if [ ! -z "${TRAVIS_TAG}" ]; then mvn versions:set -DnewVersion=${TRAVIS_TAG:1}; fi
|
|
||||||
- mvn clean install -q
|
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- "$HOME/.m2"
|
|
||||||
before_deploy:
|
|
||||||
- export WEBGOAT_SERVER_TARGET_DIR=$HOME/build/$TRAVIS_REPO_SLUG/webgoat-server/target
|
|
||||||
- export WEBWOLF_TARGET_DIR=$HOME/build/$TRAVIS_REPO_SLUG/webwolf/target
|
|
||||||
- export WEBGOAT_ARTIFACTS_FOLDER=$HOME/build/$TRAVIS_REPO_SLUG/Deployable_Artifacts/
|
|
||||||
- mkdir -p $WEBGOAT_ARTIFACTS_FOLDER
|
|
||||||
- cp -fa $WEBGOAT_SERVER_TARGET_DIR/*.jar $WEBGOAT_ARTIFACTS_FOLDER/
|
|
||||||
- cp -fa $WEBWOLF_TARGET_DIR/*.jar $WEBGOAT_ARTIFACTS_FOLDER/
|
|
||||||
- echo "Contents of artifacts folder:"
|
|
||||||
- ls $WEBGOAT_ARTIFACTS_FOLDER
|
|
||||||
deploy:
|
|
||||||
- provider: script
|
|
||||||
skip_cleanup: true
|
|
||||||
script: bash scripts/deploy-webgoat.sh
|
|
||||||
on:
|
|
||||||
repo: WebGoat/WebGoat
|
|
||||||
tags: true
|
|
||||||
- provider: script
|
|
||||||
skip_cleanup: true
|
|
||||||
script: bash scripts/deploy-webgoat.sh
|
|
||||||
on:
|
|
||||||
repo: WebGoat/WebGoat
|
|
||||||
branch: develop
|
|
||||||
- provider: releases
|
|
||||||
skip_cleanup: true
|
|
||||||
overwrite: true
|
|
||||||
api_key:
|
|
||||||
#api-key from webgoat-github user
|
|
||||||
secure: pJOLBnl6427PcVg/tVy/qB18JC7b8cKpffau+IP0pjdSt7KUfBdBY3QuJ7mrM65zRoVILzggLckaew2PlRmYQRdumyWlyRn44XiJ9KO4n6Bsufbz+ictB4ggtozpp9+I9IIUh1TmqypL9lhkX2ONM9dSHmyblYpAAgMuYSK8FYc=
|
|
||||||
file_glob: true
|
|
||||||
file: $WEBGOAT_ARTIFACTS_FOLDER/*
|
|
||||||
on:
|
|
||||||
repo: WebGoat/WebGoat
|
|
||||||
tags: true
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
#Docker login
|
|
||||||
- secure: XgPc0UKRTUI70I4YWNQpThPPWeQIxkmzh1GNoR/SSDC2GPIBq3EfkkbSQewqil8stTy+S1/xSzc0JXG8NTn7UOxHVHA/2nhI6jX9E+DKtXQ89YwmaDNQjkbMjziAtDCIex+5TRykxNfkxj6VPYbDssrzI7iJXOIZVj/HoyO3O5E=
|
|
||||||
#Docker password
|
|
||||||
- secure: aly5TKBUK9sIiqtMbytNNPZHQhC0a7Yond5tEtuJ8fO+j/KZB4Uro3I6BhzYjGWFb5Kndd0j2TXHPFvtOl402J1CmFsY3v0BhilQd0g6zOssp5T0A73m8Jgq4ItV8wQJJy2bQsXqL1B+uFYieYPiMchj7JxWW0vBn7TV5b68l6U=
|
|
60
CODE_OF_CONDUCT.md
Normal file
60
CODE_OF_CONDUCT.md
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
# Contributor Covenant Code of Conduct
|
||||||
|
|
||||||
|
## Our Pledge
|
||||||
|
|
||||||
|
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||||
|
|
||||||
|
## Our Standards
|
||||||
|
|
||||||
|
Examples of behavior that contributes to creating a positive environment include:
|
||||||
|
|
||||||
|
- Using welcoming and inclusive language
|
||||||
|
- Being respectful of differing viewpoints and experiences
|
||||||
|
- Gracefully accepting constructive criticism
|
||||||
|
- Focusing on what is best for the community
|
||||||
|
- Showing empathy towards other community members
|
||||||
|
|
||||||
|
Examples of unacceptable behavior by participants include:
|
||||||
|
|
||||||
|
- The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||||
|
- Trolling, insulting/derogatory comments, and personal or political attacks
|
||||||
|
- Public or private harassment
|
||||||
|
- Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||||
|
- Misusing the context of the WebGoat project for commercial goals (e.g. adding sales pitches to the codebase or to communication channels used by the project, such as Slack).
|
||||||
|
- Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||||
|
|
||||||
|
## Our Responsibilities
|
||||||
|
|
||||||
|
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||||
|
|
||||||
|
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||||
|
|
||||||
|
## Disclaimer
|
||||||
|
|
||||||
|
The WebGoat project and its materials are conceived for educational and research purposes only.
|
||||||
|
|
||||||
|
Refrain from violating the laws in your country by carefully consulting them before executing any tests against web applications or other assets utilizing the WebGoat (or Webwolf) materials.
|
||||||
|
|
||||||
|
The WebGoat project is also NOT supporting unethical activities in any way. If you come across such requests, please reach out to the project leaders and raise this to them.
|
||||||
|
|
||||||
|
Neither OWASP, the WebGoat project leaders, authors or anyone else involved in this project is going to take responsibility for your actions.
|
||||||
|
|
||||||
|
The intention of the WebGoat is not to encourage hacking or malicious activities! Instead, the goal of the project is to learn different hacking techniques and offer ways to reduce or mitigate that risk.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community includes using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||||
|
|
||||||
|
## Enforcement
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at nanne.baars@owasp.org.
|
||||||
|
|
||||||
|
All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||||
|
|
||||||
|
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||||
|
|
||||||
|
## Attribution
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org "Contributor Covenant homepage"), [version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html "Code of Conduct version 1.4").
|
||||||
|
|
||||||
|
For answers to common questions about this code of conduct, see [the Contributor Covenant FAQ](https://www.contributor-covenant.org/faq)
|
98
CONTRIBUTING.md
Normal file
98
CONTRIBUTING.md
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
# Contributing
|
||||||
|
[](https://github.com/WebGoat/WebGoat/graphs/contributors)
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
This document describes how you can contribute to WebGoat. Please read it carefully.
|
||||||
|
|
||||||
|
**Table of Contents**
|
||||||
|
|
||||||
|
* [How to Contribute to the Project](#how-to-contribute-to-the-project)
|
||||||
|
* [How to set up your Contributor Environment](#how-to-set-up-your-contributor-environment)
|
||||||
|
* [How to get your PR Accepted](#how-to-get-your-pr-accepted)
|
||||||
|
|
||||||
|
## How to Contribute to the project
|
||||||
|
|
||||||
|
There are a couple of ways on how you can contribute to the project:
|
||||||
|
|
||||||
|
* **File [issues](https://github.com/WebGoat/WebGoat/issues "Webgoat Issues")** for missing content or errors. Explain what you think is missing and give a suggestion as to where it could be added.
|
||||||
|
* **Create a [pull request (PR)](https://github.com/WebGoat/WebGoat/pulls "Create a pull request")**. This is a direct contribution to the project and may be merged after review. You should ideally [create an issue](https://github.com/WebGoat/WebGoat/issues "WebGoat Issues") for any PR you would like to submit, as we can first review the merit of the PR and avoid any unnecessary work. This is of course not needed for small modifications such as correcting typos.
|
||||||
|
* **Help out financially** by donating via [OWASP donations](https://owasp.org/donate/?reponame=www-project-webgoat&title=OWASP+WebGoat).
|
||||||
|
|
||||||
|
## How to get your PR accepted
|
||||||
|
|
||||||
|
Your PR is valuable to us, and to make sure we can integrate it smoothly, we have a few items for you to consider. In short:
|
||||||
|
The minimum requirements for code contributions are:
|
||||||
|
|
||||||
|
1. The code _must_ be compliant with the configured Checkstyle and PMD rules.
|
||||||
|
2. All new and changed code _should_ have a corresponding unit and/or integration test.
|
||||||
|
3. New and changed lessons _must_ have a corresponding integration test.
|
||||||
|
4. [Status checks](https://docs.github.com/en/github/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks) should pass for your last commit.
|
||||||
|
|
||||||
|
Additionally, the following guidelines can help:
|
||||||
|
|
||||||
|
### Keep your pull requests limited to a single issue
|
||||||
|
|
||||||
|
Pull requests should be as small/atomic as possible. Large, wide-sweeping changes in a pull request will be **rejected**, with comments to isolate the specific code in your pull request. Some examples:
|
||||||
|
|
||||||
|
* If you are making spelling corrections in the docs, don't modify other files.
|
||||||
|
* If you are adding new functions don't '*cleanup*' unrelated functions. That cleanup belongs in another pull request.
|
||||||
|
|
||||||
|
|
||||||
|
### Write a good commit message
|
||||||
|
|
||||||
|
* Explain why you make the changes. [More infos about a good commit message.](https://betterprogramming.pub/stop-writing-bad-commit-messages-8df79517177d)
|
||||||
|
|
||||||
|
* If you fix an issue with your commit, please close the issue by [adding one of the keywords and the issue number](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) to your commit message.
|
||||||
|
|
||||||
|
For example: `Fix #545` or `Closes #10`
|
||||||
|
|
||||||
|
## How to set up your Contributor Environment
|
||||||
|
|
||||||
|
1. Create a GitHub account. Multiple different GitHub subscription plans are available, but you only need a free one. Follow [these steps](https://help.github.com/en/articles/signing-up-for-a-new-github-account "Signing up for a new GitHub account") to set up your account.
|
||||||
|
2. Fork the repository. Creating a fork means creating a copy of the repository on your own account, which you can modify without any impact on this repository. GitHub has an [article that describes all the needed steps](https://help.github.com/en/articles/fork-a-repo "Fork a repo").
|
||||||
|
3. Clone your own repository to your host computer so that you can make modifications. If you followed the GitHub tutorial from step 2, you have already done this.
|
||||||
|
4. Go to the newly cloned directory "WebGoat" and add the remote upstream repository:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ git remote -v
|
||||||
|
origin git@github.com:<your Github handle>/WebGoat.git (fetch)
|
||||||
|
origin git@github.com:<your Github handle>/WebGoat.git (push)
|
||||||
|
|
||||||
|
$ git remote add upstream git@github.com:WebGoat/WebGoat.git
|
||||||
|
|
||||||
|
$ git remote -v
|
||||||
|
origin git@github.com:<your Github handle>/WebGoat.git (fetch)
|
||||||
|
origin git@github.com:<your Github handle>/WebGoat.git (push)
|
||||||
|
upstream git@github.com:OWASP/WebGoat.git (fetch)
|
||||||
|
upstream git@github.com:OWASP/WebGoat.git (push)
|
||||||
|
```
|
||||||
|
|
||||||
|
See also the GitHub documentation on "[Configuring a remote for a fork](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/configuring-a-remote-for-a-fork "Configuring a remote for a fork")".
|
||||||
|
5. Choose what to work on, based on any of the outstanding [issues](https://github.com/WebGoat/WebGoat/issues "WebGoat Issues").
|
||||||
|
6. Create a branch so that you can cleanly work on the chosen issue: `git checkout -b FixingIssue66`
|
||||||
|
7. Open your favorite editor and start making modifications. We recommend using the [IntelliJ Idea](https://www.jetbrains.com/idea/).
|
||||||
|
8. After your modifications are done, push them to your forked repository. This can be done by executing the command `git add MYFILE` for every file you have modified, followed by `git commit -m 'your commit message here'` to commit the modifications and `git push` to push your modifications to GitHub.
|
||||||
|
9. Create a Pull Request (PR) by going to your fork, <https://github.com/Your_Github_Handle/WebGoat> and click on the "New Pull Request" button. The target branch should typically be the Master branch. When submitting a PR, be sure to follow the checklist that is provided in the PR template. The checklist itself will be filled out by the reviewer.
|
||||||
|
10. Your PR will be reviewed and comments may be given. In order to process a comment, simply make modifications to the same branch as before and push them to your repository. GitHub will automatically detect these changes and add them to your existing PR.
|
||||||
|
11. When starting on a new PR in the future, make sure to always keep your local repo up to date:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ git fetch upstream
|
||||||
|
$ git merge upstream/develop
|
||||||
|
```
|
||||||
|
|
||||||
|
See also the following article for further explanation on "[How to Keep a Downstream git Repository Current with Upstream Repository Changes](https://medium.com/sweetmeat/how-to-keep-a-downstream-git-repository-current-with-upstream-repository-changes-10b76fad6d97 "How to Keep a Downstream git Repository Current with Upstream Repository Changes")".
|
||||||
|
|
||||||
|
If at any time you want to work on a different issue, you can simply switch to a different branch, as explained in step 5.
|
||||||
|
|
||||||
|
> Tip: Don't try to work on too many issues at once though, as it will be a lot more difficult to merge branches the longer they are open.
|
||||||
|
|
||||||
|
## What not to do
|
||||||
|
|
||||||
|
Although we greatly appreciate any and all contributions to the project, there are a few things that you should take into consideration:
|
||||||
|
|
||||||
|
* The WebGoat project should not be used as a platform for advertisement for commercial tools, companies or individuals. Write-ups should be written with free and open-source tools in mind and commercial tools are typically not accepted, unless as a reference in the security tools section.
|
||||||
|
* Unnecessary self-promotion of tools or blog posts is frowned upon. If you have a relation with on of the URLs or tools you are referencing, please state so in the PR so that we can verify that the reference is in line with the rest of the guide.
|
||||||
|
|
||||||
|
Please be sure to take a careful look at our [Code of Conduct](https://github.com/WebGoat/WebGoat/blob/master/CODE_OF_CONDUCT.md) for all the details.
|
19
COPYRIGHT.txt
Normal file
19
COPYRIGHT.txt
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
This file is part of WebGoat, an Open Web Application Security Project utility. For details, please see http://www.owasp.org/
|
||||||
|
|
||||||
|
Copyright (c) 2002 - $today.year Bruce Mayhew
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||||
|
GNU General Public License as published by the Free Software Foundation; either version 2 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
||||||
|
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License along with this program; if
|
||||||
|
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||||
|
02111-1307, USA.
|
||||||
|
|
||||||
|
Getting Source ==============
|
||||||
|
|
||||||
|
Source for this application is maintained at https://github.com/WebGoat/WebGoat, a repository for free software projects.
|
@ -5,25 +5,30 @@
|
|||||||
|
|
||||||
For WebGoat we use milestone releases first before we release the official version, we use `v8.0.0.M3` while tagging
|
For WebGoat we use milestone releases first before we release the official version, we use `v8.0.0.M3` while tagging
|
||||||
and 8.0.0.M3 in the `pom.xml`. When we create the final release we remove the milestone release and use
|
and 8.0.0.M3 in the `pom.xml`. When we create the final release we remove the milestone release and use
|
||||||
`v8.0.0` and 8.0.0 in the `pom.xml`
|
`v8.0.0` in the `pom.xml`
|
||||||
|
|
||||||
|
### Release notes:
|
||||||
|
Update the release notes with the correct version. Use `git shortlog -s -n --since "SEP 31 2019"` for the list of
|
||||||
|
committers.
|
||||||
|
|
||||||
At the moment we use Gitflow, for a release you create a new release branch and take the following steps:
|
At the moment we use Gitflow, for a release you create a new release branch and take the following steps:
|
||||||
|
|
||||||
```
|
```
|
||||||
git checkout develop
|
git checkout develop
|
||||||
git flow release start <version>
|
git flow release start <version>
|
||||||
mvn versions:set <<version>
|
|
||||||
git commit -am "New release, updaing pom.xml"
|
|
||||||
git flow release publish
|
git flow release publish
|
||||||
```
|
|
||||||
|
|
||||||
Now we can make a new release, be sure you committed all your changes.
|
<<Make changes if necessary>>
|
||||||
|
<<Update RELEASE_NOTES.md>>
|
||||||
|
|
||||||
```
|
git flow release finish <version>
|
||||||
git tag v8.0.0.M3
|
git push origin develop
|
||||||
git push origin v8.0.0.M3
|
git push origin main
|
||||||
|
git push --tags
|
||||||
```
|
```
|
||||||
|
|
||||||
Now Travis takes over and will create the release in Github and on Docker Hub.
|
Now Travis takes over and will create the release in Github and on Docker Hub.
|
||||||
|
|
||||||
|
NOTE: the `mvn versions:set` command above is just there to make sure the master branch contains the latest version
|
||||||
|
|
||||||
|
|
19
LICENSE.txt
Normal file
19
LICENSE.txt
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
This file is part of WebGoat, an Open Web Application Security Project utility. For details, please see http://www.owasp.org/
|
||||||
|
|
||||||
|
Copyright (c) 2002 - 2019 Bruce Mayhew
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||||
|
GNU General Public License as published by the Free Software Foundation; either version 2 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
||||||
|
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License along with this program; if
|
||||||
|
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||||
|
02111-1307, USA.
|
||||||
|
|
||||||
|
Getting Source ==============
|
||||||
|
|
||||||
|
Source for this application is maintained at https://github.com/WebGoat/WebGoat, a repository for free software projects.
|
1
PULL_REQUEST_TEMPLATE.md
Normal file
1
PULL_REQUEST_TEMPLATE.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
Thank you for submitting a pull request to the WebGoat!
|
159
README.MD
159
README.MD
@ -1,159 +0,0 @@
|
|||||||
# WebGoat: A deliberately insecure Web Application
|
|
||||||
|
|
||||||
[](https://travis-ci.org/WebGoat/WebGoat)
|
|
||||||
[](https://coveralls.io/github/WebGoat/WebGoat?branch=master)
|
|
||||||
[](https://www.codacy.com/app/dm/WebGoat)
|
|
||||||
[](https://www.versioneye.com/user/projects/562da95ae346d7000e0369aa)
|
|
||||||
[](https://www.owasp.org/index.php/OWASP_Project_Inventory#tab=Labs_Projects)
|
|
||||||
|
|
||||||
# Important
|
|
||||||
|
|
||||||
This is the development version of WebGoat 8, if you are looking for a released stable version please go to: https://github.com/WebGoat/WebGoat/wiki/Running-WebGoat
|
|
||||||
|
|
||||||
|
|
||||||
# Introduction
|
|
||||||
|
|
||||||
WebGoat is a deliberately insecure web application maintained by [OWASP](http://www.owasp.org/) designed to teach web
|
|
||||||
application security lessons.
|
|
||||||
|
|
||||||
This program is a demonstration of common server-side application flaws. The
|
|
||||||
exercises are intended to be used by people to learn about application security and
|
|
||||||
penetration testing techniques.
|
|
||||||
|
|
||||||
**WARNING 1:** *While running this program your machine will be extremely
|
|
||||||
vulnerable to attack. You should disconnect from the Internet while using
|
|
||||||
this program.* WebGoat's default configuration binds to localhost to minimize
|
|
||||||
the exposure.
|
|
||||||
|
|
||||||
**WARNING 2:** *This program is for educational purposes only. If you attempt
|
|
||||||
these techniques without authorization, you are very likely to get caught. If
|
|
||||||
you are caught engaging in unauthorized hacking, most companies will fire you.
|
|
||||||
Claiming that you were doing security research will not work as that is the
|
|
||||||
first thing that all hackers claim.*
|
|
||||||
|
|
||||||
# Run Instructions:
|
|
||||||
|
|
||||||
## 1. Run using Docker
|
|
||||||
|
|
||||||
From time to time we publish a new development preview of WebGoat 8 on Docker HUB, you can download this version
|
|
||||||
[https://hub.docker.com/r/webgoat/webgoat-8.0/](https://hub.docker.com/r/webgoat/webgoat-8.0/).
|
|
||||||
First install Docker, then open a command shell/window and type:
|
|
||||||
|
|
||||||
```Shell
|
|
||||||
docker pull webgoat/webgoat-8.0
|
|
||||||
docker run -p 8080:8080 -it webgoat/webgoat-8.0 /home/webgoat/start.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
Wait for the Docker container to start, and run `docker ps` to verify it's running.
|
|
||||||
|
|
||||||
- If you are using `docker-machine`, verify the machine IP using `docker-machine env`
|
|
||||||
- If you are using `boot2docker` on OSX, verify the IP by running `docker network inspect bridge`
|
|
||||||
- Otherwise, the host will be bound to localhost
|
|
||||||
|
|
||||||
Once you have the IP and port, you'll want to navigate to the `/WebGoat` path in the URL. For example:
|
|
||||||
|
|
||||||
```
|
|
||||||
http://192.168.99.100:8080/WebGoat
|
|
||||||
```
|
|
||||||
|
|
||||||
Here you'll be able to register a new user and get started.
|
|
||||||
|
|
||||||
_Please note: this version may not be completely in sync with the develop branch._
|
|
||||||
|
|
||||||
## 2. Standalone
|
|
||||||
|
|
||||||
Download the latest WebWolf release from [https://github.com/WebGoat/WebGoat/releases](https://github.com/WebGoat/WebGoat/releases)
|
|
||||||
|
|
||||||
```Shell
|
|
||||||
java -jar webgoat-server-<<version>>.jar
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## 3. Run from the sources
|
|
||||||
|
|
||||||
### Prerequisites:
|
|
||||||
|
|
||||||
* Java 8
|
|
||||||
* Maven > 3.2.1
|
|
||||||
* Your favorite IDE
|
|
||||||
* Git, or Git support in your IDE
|
|
||||||
|
|
||||||
Open a command shell/window:
|
|
||||||
|
|
||||||
```Shell
|
|
||||||
git clone git@github.com:WebGoat/WebGoat.git
|
|
||||||
```
|
|
||||||
|
|
||||||
Now let's start by compiling the project.
|
|
||||||
|
|
||||||
```Shell
|
|
||||||
cd WebGoat
|
|
||||||
git checkout develop
|
|
||||||
mvn clean install
|
|
||||||
```
|
|
||||||
|
|
||||||
Now we are ready to run the project. WebGoat 8.x is using Spring-Boot.
|
|
||||||
|
|
||||||
```Shell
|
|
||||||
mvn -pl webwolf spring-boot:run
|
|
||||||
```
|
|
||||||
... you should be running webgoat on localhost:8080/WebGoat momentarily
|
|
||||||
|
|
||||||
To change IP addresss add the following variable to WebGoat/webgoat-container/src/main/resources/application.properties file
|
|
||||||
|
|
||||||
```server.address=x.x.x.x
|
|
||||||
```
|
|
||||||
|
|
||||||
# Vagrant
|
|
||||||
|
|
||||||
We supply a complete development environment using Vagrant, to run WebGoat with Vagrant you must first have Vagrant and Virtualbox installed.
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ cd WebGoat/webgoat-images/vagrant-users
|
|
||||||
$ vagrant up
|
|
||||||
```
|
|
||||||
|
|
||||||
Once the provisioning is complete login to the Virtualbox with username vagrant and password vagrant.
|
|
||||||
The source code will be available in the home directory.
|
|
||||||
|
|
||||||
|
|
||||||
# Building a new Docker image
|
|
||||||
|
|
||||||
WebGoat now has Docker support for x86 and ARM (raspberry pi).
|
|
||||||
### Docker on x86
|
|
||||||
On x86 you can build a container with the following commands:
|
|
||||||
|
|
||||||
```Shell
|
|
||||||
cd WebGoat/
|
|
||||||
mvn install
|
|
||||||
cd webgoat-server
|
|
||||||
docker build -t webgoat/webgoat-8.0 .
|
|
||||||
docker tag webgoat/webgoat-8.0 webgoat/webgoat-8.0:8.0
|
|
||||||
docker login
|
|
||||||
docker push webgoat/webgoat-8.0
|
|
||||||
```
|
|
||||||
|
|
||||||
### Docker on ARM (Raspberry Pi)
|
|
||||||
On a Raspberry Pi (it has yet been tested with a Raspberry Pi 3 and the hypriot Docker image) you need to build JFFI for
|
|
||||||
ARM first. This is needed by the docker-maven-plugin ([see here](https://github.com/spotify/docker-maven-plugin/issues/233)):
|
|
||||||
|
|
||||||
```Shell
|
|
||||||
sudo apt-get install build-essential
|
|
||||||
git clone https://github.com/jnr/jffi.git
|
|
||||||
cd jffi
|
|
||||||
ant jar
|
|
||||||
cd build/jni
|
|
||||||
sudo cp libjffi-1.2.so /usr/lib
|
|
||||||
```
|
|
||||||
|
|
||||||
When you have done this you can build the Docker container using the following commands:
|
|
||||||
|
|
||||||
```Shell
|
|
||||||
cd WebGoat/
|
|
||||||
mvn install
|
|
||||||
cd webgoat-server
|
|
||||||
mvn docker:build -Drpi=true
|
|
||||||
docker tag webgoat/webgoat-8.0 webgoat/webgoat-8.0:8.0
|
|
||||||
docker login
|
|
||||||
docker push webgoat/webgoat-8.0
|
|
||||||
```
|
|
116
README.md
Normal file
116
README.md
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
# WebGoat 8: A deliberately insecure Web Application
|
||||||
|
|
||||||
|
[](https://github.com/WebGoat/WebGoat/actions/workflows/pr_build.yml)
|
||||||
|
[](https://jdk.java.net/)
|
||||||
|
[](https://owasp.org/projects/)
|
||||||
|
[](https://github.com/WebGoat/WebGoat/releases/latest)
|
||||||
|
[](https://gitter.im/OWASPWebGoat/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||||
|
[](https://github.com/WebGoat/WebGoat/discussions)
|
||||||
|
|
||||||
|
# Introduction
|
||||||
|
|
||||||
|
WebGoat is a deliberately insecure web application maintained by [OWASP](http://www.owasp.org/) designed to teach web
|
||||||
|
application security lessons.
|
||||||
|
|
||||||
|
This program is a demonstration of common server-side application flaws. The
|
||||||
|
exercises are intended to be used by people to learn about application security and
|
||||||
|
penetration testing techniques.
|
||||||
|
|
||||||
|
**WARNING 1:** *While running this program your machine will be extremely
|
||||||
|
vulnerable to attack. You should disconnect from the Internet while using
|
||||||
|
this program.* WebGoat's default configuration binds to localhost to minimize
|
||||||
|
the exposure.
|
||||||
|
|
||||||
|
**WARNING 2:** *This program is for educational purposes only. If you attempt
|
||||||
|
these techniques without authorization, you are very likely to get caught. If
|
||||||
|
you are caught engaging in unauthorized hacking, most companies will fire you.
|
||||||
|
Claiming that you were doing security research will not work as that is the
|
||||||
|
first thing that all hackers claim.*
|
||||||
|
|
||||||
|
# Installation instructions:
|
||||||
|
|
||||||
|
For more details check [the Contribution guide](/CONTRIBUTING.md)
|
||||||
|
|
||||||
|
## 1. Run using Docker
|
||||||
|
|
||||||
|
Every release is also published on [DockerHub](https://hub.docker.com/r/webgoat/goatandwolf).
|
||||||
|
|
||||||
|
The easiest way to start WebGoat as a Docker container is to use the all-in-one docker container. This is a docker image that has WebGoat and WebWolf running inside.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
|
||||||
|
docker run -it -p 127.0.0.1:80:8888 -p 127.0.0.1:8080:8080 -p 127.0.0.1:9090:9090 -e TZ=Europe/Amsterdam webgoat/goatandwolf:v8.2.2
|
||||||
|
```
|
||||||
|
|
||||||
|
The landing page will be located at: http://localhost
|
||||||
|
WebGoat will be located at: http://localhost:8080/WebGoat
|
||||||
|
WebWolf will be located at: http://localhost:9090/WebWolf
|
||||||
|
|
||||||
|
**Important**: *Change the ports if necessary, for example use `127.0.0.1:7777:9090` to map WebWolf to `http://localhost:7777/WebGoat`*
|
||||||
|
|
||||||
|
**Important**: *Choose the correct timezone, so that the docker container and your host are in the same timezone. As it is important for the validity of JWT tokens used in certain exercises.*
|
||||||
|
|
||||||
|
|
||||||
|
## 2. Standalone
|
||||||
|
|
||||||
|
Download the latest WebGoat and WebWolf release from [https://github.com/WebGoat/WebGoat/releases](https://github.com/WebGoat/WebGoat/releases)
|
||||||
|
|
||||||
|
```shell
|
||||||
|
java -Dfile.encoding=UTF-8 -jar webgoat-server-8.2.2.jar [--server.port=8080] [--server.address=localhost] [--hsqldb.port=9001]
|
||||||
|
java -Dfile.encoding=UTF-8 -jar webwolf-8.2.2.jar [--server.port=9090] [--server.address=localhost] [--hsqldb.port=9001]
|
||||||
|
```
|
||||||
|
|
||||||
|
WebGoat will be located at: http://localhost:8080/WebGoat and
|
||||||
|
WebWolf will be located at: http://localhost:9090/WebWolf (change ports if necessary)
|
||||||
|
|
||||||
|
## 3. Run from the sources
|
||||||
|
|
||||||
|
### Prerequisites:
|
||||||
|
|
||||||
|
* Java 17
|
||||||
|
* Maven > 3.2.1
|
||||||
|
* Your favorite IDE
|
||||||
|
* Git, or Git support in your IDE
|
||||||
|
|
||||||
|
Open a command shell/window:
|
||||||
|
|
||||||
|
```Shell
|
||||||
|
git clone git@github.com:WebGoat/WebGoat.git
|
||||||
|
```
|
||||||
|
|
||||||
|
Now let's start by compiling the project.
|
||||||
|
|
||||||
|
```Shell
|
||||||
|
cd WebGoat
|
||||||
|
git checkout <<branch_name>>
|
||||||
|
mvn clean install
|
||||||
|
```
|
||||||
|
|
||||||
|
Now we are ready to run the project. WebGoat 8.x is using Spring-Boot.
|
||||||
|
|
||||||
|
```Shell
|
||||||
|
mvn -pl webgoat-server spring-boot:run
|
||||||
|
```
|
||||||
|
... you should be running webgoat on localhost:8080/WebGoat momentarily
|
||||||
|
|
||||||
|
|
||||||
|
To change the IP address add the following variable to the WebGoat/webgoat-container/src/main/resources/application.properties file:
|
||||||
|
|
||||||
|
```
|
||||||
|
server.address=x.x.x.x
|
||||||
|
```
|
||||||
|
|
||||||
|
## 4. Run with custom menu
|
||||||
|
|
||||||
|
For specialist only. There is a way to set up WebGoat with a personalized menu. You can leave out some menu categories or individual lessons by setting certain environment variables.
|
||||||
|
|
||||||
|
For instance running as a jar on a Linux/macOS it will look like this:
|
||||||
|
```Shell
|
||||||
|
export EXCLUDE_CATEGORIES="CLIENT_SIDE,GENERAL,CHALLENGE"
|
||||||
|
export EXCLUDE_LESSONS="SqlInjectionAdvanced,SqlInjectionMitigations"
|
||||||
|
java -jar webgoat-server/target/webgoat-server-v8.2.2-SNAPSHOT.jar
|
||||||
|
```
|
||||||
|
Or in a docker run it would (once this version is pushed into docker hub) look like this:
|
||||||
|
```Shell
|
||||||
|
docker run -d -p 80:8888 -p 8080:8080 -p 9090:9090 -e TZ=Europe/Amsterdam -e EXCLUDE_CATEGORIES="CLIENT_SIDE,GENERAL,CHALLENGE" -e EXCLUDE_LESSONS="SqlInjectionAdvanced,SqlInjectionMitigations" webgoat/goatandwolf
|
||||||
|
```
|
115
RELEASE_NOTES.md
Normal file
115
RELEASE_NOTES.md
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
# WebGoat release notes
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
|
||||||
|
### New functionality
|
||||||
|
|
||||||
|
- Update the Docker startup script, it is now possible to pass `skip-nginx` or set `SKIP_NGINX` as environment variable.
|
||||||
|
|
||||||
|
## Version 8.2.2
|
||||||
|
|
||||||
|
### New functionality
|
||||||
|
|
||||||
|
- Docker image now supports nginx when browsing to http://localhost a landing page is shown.
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
- [#1039 jwt-7-Code review](https://github.com/WebGoat/WebGoat/issues/1039)
|
||||||
|
- [#1031 SQL Injection (intro) 5: Data Control Language (DCL) the wiki's solution is not correct](https://github.com/WebGoat/WebGoat/issues/1031)
|
||||||
|
- [#1027 Webgoat 8.2.1 Vulnerable_Components_12 Shows internal server error](https://github.com/WebGoat/WebGoat/issues/1027)
|
||||||
|
|
||||||
|
|
||||||
|
## Version 8.2.1
|
||||||
|
|
||||||
|
### New functionality
|
||||||
|
|
||||||
|
- New Docker image for arm64 architecture is now available (for Apple M1)
|
||||||
|
|
||||||
|
|
||||||
|
## Version 8.2.0
|
||||||
|
|
||||||
|
### New functionality
|
||||||
|
|
||||||
|
- Add new zip slip lesson (part of path traversal)
|
||||||
|
- SQL lessons are now separate for each user, database are now per user and no longer shared across users
|
||||||
|
- Moved to Java 15 & Spring Boot 2.4 & moved to JUnit 5
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
- [#974 SQL injection Intro 5 not solvable](https://github.com/WebGoat/WebGoat/issues/974)
|
||||||
|
- [#962 SQL-Lesson 5 (Advanced) Solvable with wrong anwser](https://github.com/WebGoat/WebGoat/issues/962)
|
||||||
|
- [#961 SQl-Injection lesson 4 not deleting created row](https://github.com/WebGoat/WebGoat/issues/961)
|
||||||
|
- [#949 Challenge: Admin password reset always solvable](https://github.com/WebGoat/WebGoat/issues/949)
|
||||||
|
- [#923 - Upgrade to Java 15](https://github.com/WebGoat/WebGoat/issues/923)
|
||||||
|
- [#922 - Vulnerable components lesson](https://github.com/WebGoat/WebGoat/issues/922)
|
||||||
|
- [#891 - Update the OWASP website with the new all-in-one Docker container](https://github.com/WebGoat/WebGoat/issues/891)
|
||||||
|
- [#844 - Suggestion: Update navigation](https://github.com/WebGoat/WebGoat/issues/844)
|
||||||
|
- [#843 - Bypass front-end restrictions: Field restrictions - confusing text in form](https://github.com/WebGoat/WebGoat/issues/843)
|
||||||
|
- [#841 - XSS - Reflected XSS confusing instruction and success messages](https://github.com/WebGoat/WebGoat/issues/841)
|
||||||
|
- [#839 - SQL Injection (mitigation) Order by clause confusing](https://github.com/WebGoat/WebGoat/issues/839)
|
||||||
|
- [#838 - SQL mitigation (filtering) can only be passed by updating table](https://github.com/WebGoat/WebGoat/issues/838)
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
Special thanks to the following contributors providing us with a pull request:
|
||||||
|
|
||||||
|
- nicholas-quirk
|
||||||
|
- VijoPlays
|
||||||
|
- aolle
|
||||||
|
- trollingHeifer
|
||||||
|
- maximmasiutin
|
||||||
|
- toshihue
|
||||||
|
- avivmu
|
||||||
|
- KellyMarchewa
|
||||||
|
- NatasG
|
||||||
|
- gabe-sky
|
||||||
|
|
||||||
|
|
||||||
|
## Version 8.1.0
|
||||||
|
|
||||||
|
### New functionality
|
||||||
|
|
||||||
|
- Added new lessons for cryptography and path-traversal
|
||||||
|
- Extra content added to the XXE lesson
|
||||||
|
- Explanation of the assignments will be part of WebGoat, in this release we added detailed descriptions on how to solve the XXE lesson. In the upcoming releases new explanations will be added. If you want to contribute please create a pull request on Github.
|
||||||
|
- Docker improvements + docker stack for complete container with nginx
|
||||||
|
- Included JWT token decoding and generation, since jwt.io does not support None anymore
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
- [#743 - Character encoding errors](https://github.com/WebGoat/WebGoat/issues/743)
|
||||||
|
- [#811 - Flag submission fails](https://github.com/WebGoat/WebGoat/issues/811)
|
||||||
|
- [#810 - Scoreboard for challenges shows csrf users](https://github.com/WebGoat/WebGoat/issues/810)
|
||||||
|
- [#788 - strange copy in constructor](https://github.com/WebGoat/WebGoat/issues/788)
|
||||||
|
- [#760 - Execution of standalone jar fails (Flyway migration step](https://github.com/WebGoat/WebGoat/issues/760)
|
||||||
|
- [#766 - Unclear objective of vulnerable components practical assignment](https://github.com/WebGoat/WebGoat/issues/766)
|
||||||
|
- [#708 - Seems like the home directory of WebGoat always use @project.version@](https://github.com/WebGoat/WebGoat/issues/708)
|
||||||
|
- [#719 - WebGoat: 'Contact Us' email link in header is not correctly set](https://github.com/WebGoat/WebGoat/issues/719)
|
||||||
|
- [#715 - Reset lesson doesn't reset the "HTML lesson" => forms stay succesful](https://github.com/WebGoat/WebGoat/issues/715)
|
||||||
|
- [#725 - Vulnerable Components lesson 12 broken due to too new dependency](https://github.com/WebGoat/WebGoat/issues/725)
|
||||||
|
- [#716 - On M26 @project.version@ is not "interpreted" #7](https://github.com/WebGoat/WebGoat/issues/716)
|
||||||
|
- [#721 couldn't be able to run CSRF lesson 3: Receive Whitelabel Error Page](https://github.com/WebGoat/WebGoat/issues/721)
|
||||||
|
- [#724 - Dead link in VulnerableComponents lesson 11](https://github.com/WebGoat/WebGoat/issues/724)
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
Special thanks to the following contributors providing us with a pull request:
|
||||||
|
|
||||||
|
- Satoshi SAKAO
|
||||||
|
- Philippe Lafoucrière
|
||||||
|
- Cotonne
|
||||||
|
- Tiago Mussi
|
||||||
|
- thegoodcrumpets
|
||||||
|
- Atharva Vaidya
|
||||||
|
- torleif
|
||||||
|
- August Detlefsen
|
||||||
|
- Choe Hyeong Jin
|
||||||
|
|
||||||
|
And everyone who provided feedback through Github.
|
||||||
|
|
||||||
|
|
||||||
|
Team WebGoat
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
|||||||
version: 0.1
|
|
||||||
|
|
||||||
phases:
|
|
||||||
build:
|
|
||||||
commands:
|
|
||||||
- mvn package
|
|
||||||
|
|
||||||
artifacts:
|
|
||||||
files:
|
|
||||||
- webgoat-server/target/webgoat-server-8.0-SNAPSHOT.jar
|
|
||||||
discard-paths: yes
|
|
||||||
|
|
259
config/checkstyle/checkstyle.xml
Executable file
259
config/checkstyle/checkstyle.xml
Executable file
@ -0,0 +1,259 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE module PUBLIC
|
||||||
|
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
|
||||||
|
"http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Checkstyle configuration that checks the Google coding conventions from Google Java Style
|
||||||
|
that can be found at https://google.github.io/styleguide/javaguide.html.
|
||||||
|
|
||||||
|
Checkstyle is very configurable. Be sure to read the documentation at
|
||||||
|
http://checkstyle.sf.net (or in your downloaded distribution).
|
||||||
|
|
||||||
|
To completely disable a check, just comment it out or delete it from the file.
|
||||||
|
|
||||||
|
Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<module name="Checker">
|
||||||
|
<property name="charset" value="UTF-8"/>
|
||||||
|
|
||||||
|
<property name="severity" value="error"/>
|
||||||
|
|
||||||
|
<property name="fileExtensions" value="java, properties, xml"/>
|
||||||
|
<!-- Checks for whitespace -->
|
||||||
|
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
|
||||||
|
|
||||||
|
<module name="SuppressionFilter">
|
||||||
|
<property name="file" value="${suppressionsLocation}" default="target/checkstyle-suppressions.xml"/>
|
||||||
|
</module>
|
||||||
|
<module name="TreeWalker">
|
||||||
|
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">
|
||||||
|
<property name="maximum" value="0"/>
|
||||||
|
<property name="format" value="org\.junit\.Assert\.assert"/>
|
||||||
|
<property name="message"
|
||||||
|
value="Please use AssertJ imports."/>
|
||||||
|
<property name="ignoreComments" value="true"/>
|
||||||
|
</module>
|
||||||
|
<module
|
||||||
|
name="com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck">
|
||||||
|
<property name="regexp" value="true"/>
|
||||||
|
<property name="illegalPkgs"
|
||||||
|
value="^sun.*, ^org\.apache\.commons\.(?!compress|dbcp2|lang|lang3|logging|io|pool2).*, ^org\.flywaydb\.core\.internal.*, ^org\.testcontainers\.shaded.*"/>
|
||||||
|
<property name="illegalClasses"
|
||||||
|
value="^com\.hazelcast\.util\.Base64, ^org\.junit\.rules\.ExpectedException, ^org\.slf4j\.LoggerFactory, ^reactor\.core\.support\.Assert, ^com\.google\.common\.collect\.Maps, ^com\.google\.common\.collect\.Sets, ^com\.google\.common\.collect\.Lists"/>
|
||||||
|
</module>
|
||||||
|
<module
|
||||||
|
name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">
|
||||||
|
<property name="maximum" value="0"/>
|
||||||
|
<property name="format"
|
||||||
|
value="assertThatExceptionOfType\((NullPointerException|IllegalArgumentException|IOException|IllegalStateException)\.class\)"/>
|
||||||
|
<property name="message"
|
||||||
|
value="Please use specialized AssertJ assertThat*Exception method."/>
|
||||||
|
<property name="ignoreComments" value="true"/>
|
||||||
|
</module>
|
||||||
|
<module
|
||||||
|
name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">
|
||||||
|
<property name="maximum" value="0"/>
|
||||||
|
<property name="format"
|
||||||
|
value="@SneakyThrows"/>
|
||||||
|
<property name="message"
|
||||||
|
value="Please use a unchecked exceptions instead of @SneakyThrows gives compiler warnings"/>
|
||||||
|
<property name="ignoreComments" value="true"/>
|
||||||
|
</module>
|
||||||
|
<module name="OuterTypeFilename"/>
|
||||||
|
<module name="IllegalTokenText">
|
||||||
|
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
|
||||||
|
<property name="format"
|
||||||
|
value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
|
||||||
|
<property name="message"
|
||||||
|
value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>
|
||||||
|
</module>
|
||||||
|
<module name="AvoidEscapedUnicodeCharacters">
|
||||||
|
<property name="allowEscapesForControlCharacters" value="true"/>
|
||||||
|
<property name="allowByTailComment" value="true"/>
|
||||||
|
<property name="allowNonPrintableEscapes" value="true"/>
|
||||||
|
</module>
|
||||||
|
<module name="OneTopLevelClass">
|
||||||
|
<property name="severity" value="warning"/>
|
||||||
|
</module>
|
||||||
|
<module name="NoLineWrap"/>
|
||||||
|
<module name="EmptyBlock">
|
||||||
|
<property name="option" value="TEXT"/>
|
||||||
|
<property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
|
||||||
|
</module>
|
||||||
|
<module name="WhitespaceAround">
|
||||||
|
<property name="allowEmptyConstructors" value="true"/>
|
||||||
|
<property name="allowEmptyMethods" value="true"/>
|
||||||
|
<property name="allowEmptyTypes" value="true"/>
|
||||||
|
<property name="allowEmptyLoops" value="true"/>
|
||||||
|
<message key="ws.notFollowed"
|
||||||
|
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
|
||||||
|
<message key="ws.notPreceded"
|
||||||
|
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
|
||||||
|
</module>
|
||||||
|
<module name="OneStatementPerLine"/>
|
||||||
|
<module name="MultipleVariableDeclarations"/>
|
||||||
|
<module name="ArrayTypeStyle"/>
|
||||||
|
<module name="MissingSwitchDefault"/>
|
||||||
|
<module name="FallThrough"/>
|
||||||
|
<module name="UpperEll"/>
|
||||||
|
<module name="ModifierOrder"/>
|
||||||
|
<module name="EmptyLineSeparator">
|
||||||
|
<property name="allowNoEmptyLineBetweenFields" value="true"/>
|
||||||
|
</module>
|
||||||
|
<module name="SeparatorWrap">
|
||||||
|
<property name="id" value="SeparatorWrapDot"/>
|
||||||
|
<property name="tokens" value="DOT"/>
|
||||||
|
<property name="option" value="nl"/>
|
||||||
|
</module>
|
||||||
|
<module name="SeparatorWrap">
|
||||||
|
<property name="id" value="SeparatorWrapComma"/>
|
||||||
|
<property name="tokens" value="COMMA"/>
|
||||||
|
<property name="option" value="EOL"/>
|
||||||
|
</module>
|
||||||
|
<module name="SeparatorWrap">
|
||||||
|
<!-- ELLIPSIS is EOL until https://github.com/google/styleguide/issues/258 -->
|
||||||
|
<property name="id" value="SeparatorWrapEllipsis"/>
|
||||||
|
<property name="tokens" value="ELLIPSIS"/>
|
||||||
|
<property name="option" value="EOL"/>
|
||||||
|
</module>
|
||||||
|
<module name="SeparatorWrap">
|
||||||
|
<!-- ARRAY_DECLARATOR is EOL until https://github.com/google/styleguide/issues/259 -->
|
||||||
|
<property name="id" value="SeparatorWrapArrayDeclarator"/>
|
||||||
|
<property name="tokens" value="ARRAY_DECLARATOR"/>
|
||||||
|
<property name="option" value="EOL"/>
|
||||||
|
</module>
|
||||||
|
<module name="SeparatorWrap">
|
||||||
|
<property name="id" value="SeparatorWrapMethodRef"/>
|
||||||
|
<property name="tokens" value="METHOD_REF"/>
|
||||||
|
<property name="option" value="nl"/>
|
||||||
|
</module>
|
||||||
|
<module name="PackageName">
|
||||||
|
<property name="format" value="^[a-z]+(\.[a-z_][a-z0-9_]*)*$"/>
|
||||||
|
<message key="name.invalidPattern"
|
||||||
|
value="Package name ''{0}'' must match pattern ''{1}''."/>
|
||||||
|
</module>
|
||||||
|
<module name="TypeName">
|
||||||
|
<message key="name.invalidPattern"
|
||||||
|
value="Type name ''{0}'' must match pattern ''{1}''."/>
|
||||||
|
</module>
|
||||||
|
<module name="MemberName">
|
||||||
|
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
|
||||||
|
<message key="name.invalidPattern"
|
||||||
|
value="Member name ''{0}'' must match pattern ''{1}''."/>
|
||||||
|
</module>
|
||||||
|
<module name="ParameterName">
|
||||||
|
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9_]*)?$"/>
|
||||||
|
<message key="name.invalidPattern"
|
||||||
|
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
|
||||||
|
</module>
|
||||||
|
<module name="CatchParameterName">
|
||||||
|
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
|
||||||
|
<message key="name.invalidPattern"
|
||||||
|
value="Catch parameter name ''{0}'' must match pattern ''{1}''."/>
|
||||||
|
</module>
|
||||||
|
<module name="LocalVariableName">
|
||||||
|
<property name="tokens" value="VARIABLE_DEF"/>
|
||||||
|
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
|
||||||
|
<message key="name.invalidPattern"
|
||||||
|
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
|
||||||
|
</module>
|
||||||
|
<module name="ClassTypeParameterName">
|
||||||
|
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
|
||||||
|
<message key="name.invalidPattern"
|
||||||
|
value="Class type name ''{0}'' must match pattern ''{1}''."/>
|
||||||
|
</module>
|
||||||
|
<module name="MethodTypeParameterName">
|
||||||
|
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
|
||||||
|
<message key="name.invalidPattern"
|
||||||
|
value="Method type name ''{0}'' must match pattern ''{1}''."/>
|
||||||
|
</module>
|
||||||
|
<module name="InterfaceTypeParameterName">
|
||||||
|
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
|
||||||
|
<message key="name.invalidPattern"
|
||||||
|
value="Interface type name ''{0}'' must match pattern ''{1}''."/>
|
||||||
|
</module>
|
||||||
|
<module name="NoFinalizer"/>
|
||||||
|
<module name="GenericWhitespace">
|
||||||
|
<message key="ws.followed"
|
||||||
|
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
|
||||||
|
<message key="ws.preceded"
|
||||||
|
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
|
||||||
|
<message key="ws.illegalFollow"
|
||||||
|
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
|
||||||
|
<message key="ws.notPreceded"
|
||||||
|
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
|
||||||
|
</module>
|
||||||
|
<module name="AbbreviationAsWordInName">
|
||||||
|
<property name="ignoreFinal" value="false"/>
|
||||||
|
<property name="allowedAbbreviationLength" value="4"/>
|
||||||
|
<property name="severity" value="warning"/>
|
||||||
|
</module>
|
||||||
|
<module name="OverloadMethodsDeclarationOrder"/>
|
||||||
|
<module name="VariableDeclarationUsageDistance"/>
|
||||||
|
<module name="CustomImportOrder">
|
||||||
|
<property name="sortImportsInGroupAlphabetically" value="false"/>
|
||||||
|
<property name="separateLineBetweenGroups" value="true"/>
|
||||||
|
<property name="customImportOrderRules" value="THIRD_PARTY_PACKAGE###STATIC"/>
|
||||||
|
</module>
|
||||||
|
<module name="MethodParamPad"/>
|
||||||
|
<module name="NoWhitespaceBefore">
|
||||||
|
<property name="tokens" value="COMMA, SEMI, POST_INC, POST_DEC, DOT, ELLIPSIS, METHOD_REF"/>
|
||||||
|
<property name="allowLineBreaks" value="true"/>
|
||||||
|
</module>
|
||||||
|
<module name="ParenPad"/>
|
||||||
|
<module name="OperatorWrap">
|
||||||
|
<property name="option" value="NL"/>
|
||||||
|
<property name="tokens"
|
||||||
|
value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR, METHOD_REF "/>
|
||||||
|
</module>
|
||||||
|
<module name="AnnotationLocation">
|
||||||
|
<property name="id" value="AnnotationLocationMostCases"/>
|
||||||
|
<property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
|
||||||
|
</module>
|
||||||
|
<module name="AnnotationLocation">
|
||||||
|
<property name="id" value="AnnotationLocationVariables"/>
|
||||||
|
<property name="tokens" value="VARIABLE_DEF"/>
|
||||||
|
<property name="allowSamelineMultipleAnnotations" value="true"/>
|
||||||
|
</module>
|
||||||
|
<module name="NonEmptyAtclauseDescription"/>
|
||||||
|
<module name="JavadocTagContinuationIndentation"/>
|
||||||
|
<module name="SummaryJavadoc">
|
||||||
|
<property name="forbiddenSummaryFragments"
|
||||||
|
value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
|
||||||
|
<property name="severity" value="warning"/>
|
||||||
|
</module>
|
||||||
|
<module name="JavadocParagraph">
|
||||||
|
<property name="severity" value="warning"/>
|
||||||
|
</module>
|
||||||
|
<module name="AtclauseOrder">
|
||||||
|
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
|
||||||
|
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
|
||||||
|
<property name="severity" value="warning"/>
|
||||||
|
</module>
|
||||||
|
<module name="JavadocMethod">
|
||||||
|
<property name="tokens" value="CLASS_DEF,INTERFACE_DEF,ENUM_DEF,METHOD_DEF,ANNOTATION_FIELD_DEF"/>
|
||||||
|
<property name="scope" value="public"/>
|
||||||
|
<property name="allowMissingParamTags" value="true"/>
|
||||||
|
<property name="allowMissingThrowsTags" value="true"/>
|
||||||
|
<property name="allowMissingReturnTag" value="true"/>
|
||||||
|
<property name="minLineCount" value="2"/>
|
||||||
|
<property name="allowedAnnotations" value="Override, Test"/>
|
||||||
|
<property name="allowThrowsTagsForSubclasses" value="true"/>
|
||||||
|
<property name="severity" value="warning"/>
|
||||||
|
</module>
|
||||||
|
<module name="MethodName">
|
||||||
|
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
|
||||||
|
<message key="name.invalidPattern"
|
||||||
|
value="Method name ''{0}'' must match pattern ''{1}''."/>
|
||||||
|
</module>
|
||||||
|
<module name="SingleLineJavadoc">
|
||||||
|
<property name="ignoreInlineTags" value="false"/>
|
||||||
|
</module>
|
||||||
|
<module name="EmptyCatchBlock">
|
||||||
|
<property name="exceptionVariableName" value="expected"/>
|
||||||
|
</module>
|
||||||
|
<module name="CommentsIndentation"/>
|
||||||
|
</module>
|
||||||
|
</module>
|
11
config/checkstyle/suppressions.xml
Normal file
11
config/checkstyle/suppressions.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE suppressions PUBLIC
|
||||||
|
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
|
||||||
|
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
|
||||||
|
<suppressions>
|
||||||
|
<suppress files="MD5.java" checks="[a-zA-Z0-9]*" />
|
||||||
|
<suppress files="VulnerableComponentsLesson.java" checks="[a-zA-Z0-9]*" />
|
||||||
|
<suppress files="ContentTypeAssignment.java" checks="IllegalImportCheck" />
|
||||||
|
<suppress files="SimpleXXE.java" checks="IllegalImportCheck" />
|
||||||
|
<suppress files="HtmlTamperingTask.java" checks="ParameterName" />
|
||||||
|
</suppressions>
|
42
config/dependency-check/project-suppression.xml
Normal file
42
config/dependency-check/project-suppression.xml
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
|
||||||
|
<suppress base="true">
|
||||||
|
<notes><![CDATA[
|
||||||
|
This suppresses false positives identified on spring framework.
|
||||||
|
]]></notes>
|
||||||
|
<cpe>cpe:/a:pivotal_software:spring_framework</cpe>
|
||||||
|
<cve>CVE-2020-5398</cve>
|
||||||
|
</suppress>
|
||||||
|
<suppress base="true">
|
||||||
|
<notes><![CDATA[
|
||||||
|
This suppresses false positives identified on spring framework.
|
||||||
|
]]></notes>
|
||||||
|
<cpe>cpe:/a:redhat:undertow</cpe>
|
||||||
|
<cve>CVE-2019-14888</cve>
|
||||||
|
</suppress>
|
||||||
|
<suppress base="true">
|
||||||
|
<notes><![CDATA[
|
||||||
|
This suppresses false positives identified on spring framework.
|
||||||
|
]]></notes>
|
||||||
|
<cpe>cpe:/a:pivotal_software:spring_security</cpe>
|
||||||
|
<cve>CVE-2018-1258</cve>
|
||||||
|
</suppress>
|
||||||
|
<suppress base="true">
|
||||||
|
<cpe>cpe:/a:jruby:jruby</cpe>
|
||||||
|
<cve>CVE-2018-1000613</cve>
|
||||||
|
<cve>CVE-2018-1000180</cve>
|
||||||
|
<cve>CVE-2017-18640</cve>
|
||||||
|
<cve>CVE-2011-4838</cve>
|
||||||
|
</suppress>
|
||||||
|
<suppress base="true"><!-- vulnerable components lesson -->
|
||||||
|
<cpe>cpe:/a:xstream_project:xstream</cpe>
|
||||||
|
<cve>CVE-2017-7957</cve>
|
||||||
|
<cve>CVE-2016-3674</cve>
|
||||||
|
<cve>CVE-2020-26217</cve>
|
||||||
|
<cve>CVE-2020-26258</cve>
|
||||||
|
</suppress>
|
||||||
|
<suppress base="true"><!-- webgoat-server -->
|
||||||
|
<cpe>cpe:/a:postgresql:postgresql</cpe>
|
||||||
|
<cve>CVE-2018-10936</cve>
|
||||||
|
</suppress>
|
||||||
|
</suppressions>
|
1746
config/pmd/pmd-ruleset.xml
Normal file
1746
config/pmd/pmd-ruleset.xml
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,34 +0,0 @@
|
|||||||
version: '2.0'
|
|
||||||
|
|
||||||
services:
|
|
||||||
mongo:
|
|
||||||
image: mongo:latest
|
|
||||||
expose:
|
|
||||||
- "27017"
|
|
||||||
volumes:
|
|
||||||
- './mongo-data:/data/db'
|
|
||||||
webgoat:
|
|
||||||
build: webgoat-server/
|
|
||||||
command: "sh /home/webgoat/start.sh"
|
|
||||||
ports:
|
|
||||||
- "8080:8080"
|
|
||||||
depends_on:
|
|
||||||
[mongo, activemq]
|
|
||||||
environment:
|
|
||||||
WG_MONGO_PORT: 27017
|
|
||||||
WG_MONGO_HOST: mongo
|
|
||||||
WG_MQ_HOST: activemq
|
|
||||||
WG_MQ_PORT: 61616
|
|
||||||
WG_INTERNAL_MONGO: "false"
|
|
||||||
webwolf:
|
|
||||||
build: webwolf/
|
|
||||||
command: "sh /home/webwolf/start.sh"
|
|
||||||
depends_on:
|
|
||||||
- webgoat
|
|
||||||
ports:
|
|
||||||
- "8081:8081"
|
|
||||||
environment:
|
|
||||||
WG_MONGO_PORT: 27017
|
|
||||||
WG_MONGO_HOST: mongo
|
|
||||||
WG_MQ_HOST: activemq
|
|
||||||
WG_MQ_PORT: 61616
|
|
22
docker/Dockerfile
Normal file
22
docker/Dockerfile
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
FROM eclipse-temurin:17_35-jdk-focal
|
||||||
|
|
||||||
|
RUN apt-get update
|
||||||
|
RUN useradd -ms /bin/bash webgoat
|
||||||
|
RUN apt-get -y install apt-utils nginx
|
||||||
|
RUN chgrp -R 0 /home/webgoat
|
||||||
|
RUN chmod -R g=u /home/webgoat
|
||||||
|
|
||||||
|
USER webgoat
|
||||||
|
|
||||||
|
COPY --chown=webgoat nginx.conf /etc/nginx/nginx.conf
|
||||||
|
COPY --chown=webgoat index.html /usr/share/nginx/html/
|
||||||
|
COPY --chown=webgoat target/webgoat-server-*.jar /home/webgoat/webgoat.jar
|
||||||
|
COPY --chown=webgoat target/webwolf-*.jar /home/webgoat/webwolf.jar
|
||||||
|
COPY --chown=webgoat start.sh /home/webgoat
|
||||||
|
RUN chmod +x /home/webgoat/start.sh
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
EXPOSE 9090
|
||||||
|
|
||||||
|
WORKDIR /home/webgoat
|
||||||
|
ENTRYPOINT ["./start.sh"]
|
13
docker/Readme.md
Normal file
13
docker/Readme.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Docker all-in-one image
|
||||||
|
|
||||||
|
## Docker build
|
||||||
|
|
||||||
|
```shell
|
||||||
|
docker build --no-cache --build-arg webgoat_version=8.2.0-SNAPSHOT -t webgoat/goatandwolf:latest .
|
||||||
|
```
|
||||||
|
|
||||||
|
## Docker run
|
||||||
|
|
||||||
|
```shell
|
||||||
|
docker run -p 127.0.0.1:80:8888 -p 127.0.0.1:8080:8080 -p 127.0.0.1:9090:9090 -e TZ=Europe/Amsterdam webgoat/goatandwolf:latest
|
||||||
|
```
|
70
docker/index.html
Normal file
70
docker/index.html
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<style>
|
||||||
|
|
||||||
|
.p1 {
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.webgoat {
|
||||||
|
float: left;
|
||||||
|
margin-right: 250px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.webwolf {
|
||||||
|
float: left;
|
||||||
|
width: 40%;
|
||||||
|
height: 40%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#images {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
|
||||||
|
<h1>
|
||||||
|
<center>
|
||||||
|
Landing page for WebGoat and WebWolf
|
||||||
|
</center>
|
||||||
|
</h1>
|
||||||
|
<blockquote class="p1">
|
||||||
|
WebGoat is a deliberately insecure web application maintained by <a href="http://www.owasp.org/">OWASP</a> designed
|
||||||
|
to teach web
|
||||||
|
application security lessons.
|
||||||
|
|
||||||
|
This program is a demonstration of common server-side application flaws. The
|
||||||
|
exercises are intended to be used by people to learn about application security and
|
||||||
|
penetration testing techniques.
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
<p class="p1">Click on one of the images to go to WebGoat or WebWolf</p>
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
<div id="images">
|
||||||
|
<a href="http://127.0.0.1:8080/WebGoat" title="Open WebGoat" target="_blank"><img class="webgoat"
|
||||||
|
src="http://127.0.0.1:8080/WebGoat/css/img/logoBG.jpg"></a>
|
||||||
|
<a href="http://127.0.0.1:9090/WebWolf" title="Open WebWolf" target="_blank"><img class="webwolf"
|
||||||
|
src="http://127.0.0.1:9090/images/wolf.png"></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
140
docker/nginx.conf
Normal file
140
docker/nginx.conf
Normal file
@ -0,0 +1,140 @@
|
|||||||
|
error_log /tmp/error.log;
|
||||||
|
pid /tmp/nginx.pid;
|
||||||
|
|
||||||
|
worker_processes 1;
|
||||||
|
|
||||||
|
events { worker_connections 1024; }
|
||||||
|
|
||||||
|
http {
|
||||||
|
|
||||||
|
client_body_temp_path /tmp/client_body;
|
||||||
|
fastcgi_temp_path /tmp/fastcgi_temp;
|
||||||
|
proxy_temp_path /tmp/proxy_temp;
|
||||||
|
scgi_temp_path /tmp/scgi_temp;
|
||||||
|
uwsgi_temp_path /tmp/uwsgi_temp;
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
|
||||||
|
upstream docker-webgoat {
|
||||||
|
server 127.0.0.1:8080;
|
||||||
|
}
|
||||||
|
|
||||||
|
upstream docker-webwolf {
|
||||||
|
server 127.0.0.1:9090;
|
||||||
|
}
|
||||||
|
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Host $server_name;
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 8888;
|
||||||
|
server_name www.webgoat.local;
|
||||||
|
|
||||||
|
root /var/www;
|
||||||
|
|
||||||
|
access_log /tmp/goataccess.log;
|
||||||
|
error_log /tmp/goaterror.log;
|
||||||
|
|
||||||
|
location ~* \.(png|jpg|jpeg|gif|ico|woff|otf|ttf|mvc|svg|txt|pdf|docx?|xlsx?)$ {
|
||||||
|
access_log off;
|
||||||
|
proxy_pass http://docker-webgoat;
|
||||||
|
proxy_redirect off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html;
|
||||||
|
add_header Cache-Control no-cache;
|
||||||
|
expires 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /WebGoat {
|
||||||
|
proxy_pass http://docker-webgoat;
|
||||||
|
proxy_redirect off;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 8888;
|
||||||
|
server_name www.webwolf.local;
|
||||||
|
|
||||||
|
root /var/www;
|
||||||
|
|
||||||
|
access_log /tmp/wolfaccess.log;
|
||||||
|
error_log /tmp/wolferror.log;
|
||||||
|
|
||||||
|
location /WebGoat/PasswordReset/ForgotPassword/create-password-reset-link {
|
||||||
|
proxy_pass http://docker-webgoat;
|
||||||
|
proxy_redirect off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /PasswordReset/reset/reset-password {
|
||||||
|
proxy_pass http://docker-webwolf;
|
||||||
|
proxy_redirect off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /files {
|
||||||
|
proxy_pass http://docker-webwolf;
|
||||||
|
proxy_redirect off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /tmpdir {
|
||||||
|
proxy_pass http://docker-webwolf;
|
||||||
|
proxy_redirect off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /webjars {
|
||||||
|
proxy_pass http://docker-webwolf;
|
||||||
|
proxy_redirect off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /css {
|
||||||
|
proxy_pass http://docker-webwolf;
|
||||||
|
proxy_redirect off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /login {
|
||||||
|
proxy_pass http://docker-webwolf;
|
||||||
|
proxy_redirect off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /images {
|
||||||
|
proxy_pass http://docker-webwolf;
|
||||||
|
proxy_redirect off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /mail {
|
||||||
|
proxy_pass http://docker-webwolf;
|
||||||
|
proxy_redirect off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /upload {
|
||||||
|
proxy_pass http://docker-webwolf;
|
||||||
|
proxy_redirect off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /js {
|
||||||
|
proxy_pass http://docker-webwolf;
|
||||||
|
proxy_redirect off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /landing {
|
||||||
|
proxy_pass http://docker-webwolf;
|
||||||
|
proxy_redirect off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /logout {
|
||||||
|
proxy_pass http://docker-webwolf;
|
||||||
|
proxy_redirect off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /WebWolf {
|
||||||
|
proxy_pass http://docker-webwolf;
|
||||||
|
proxy_redirect off;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
40
docker/pom.xml
Normal file
40
docker/pom.xml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<artifactId>webgoat-all-in-one-docker</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.owasp.webgoat</groupId>
|
||||||
|
<artifactId>webgoat-parent</artifactId>
|
||||||
|
<version>8.2.3-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-antrun-plugin</artifactId>
|
||||||
|
<version>3.0.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>install</phase>
|
||||||
|
<configuration>
|
||||||
|
<target>
|
||||||
|
<copy file="../webgoat-server/target/webgoat-server-${project.version}.jar" tofile="target/webgoat-server-${project.version}.jar"/>
|
||||||
|
<copy file="../webwolf/target/webwolf-${project.version}.jar" tofile="target/webwolf-${project.version}.jar"/>
|
||||||
|
</target>
|
||||||
|
</configuration>
|
||||||
|
<goals>
|
||||||
|
<goal>run</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
72
docker/start.sh
Executable file
72
docker/start.sh
Executable file
@ -0,0 +1,72 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cd /home/webgoat
|
||||||
|
|
||||||
|
function should_start_nginx() {
|
||||||
|
if [[ -v "${SKIP_NGINX}" ]]; then
|
||||||
|
return 1
|
||||||
|
else
|
||||||
|
for i in "${commandline_args[@]}" ; do [[ $i == "skip-nginx" ]] && return 1 ; done
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
function nginx() {
|
||||||
|
if should_start_nginx; then
|
||||||
|
echo "Starting nginx..."
|
||||||
|
service nginx start
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function webgoat() {
|
||||||
|
echo "Starting WebGoat...."
|
||||||
|
java \
|
||||||
|
-Duser.home=/home/webgoat \
|
||||||
|
-Dfile.encoding=UTF-8 \
|
||||||
|
--add-opens java.base/java.lang=ALL-UNNAMED \
|
||||||
|
--add-opens java.base/java.util=ALL-UNNAMED \
|
||||||
|
--add-opens java.base/java.lang.reflect=ALL-UNNAMED \
|
||||||
|
--add-opens java.base/java.text=ALL-UNNAMED \
|
||||||
|
--add-opens java.desktop/java.beans=ALL-UNNAMED \
|
||||||
|
--add-opens java.desktop/java.awt.font=ALL-UNNAMED \
|
||||||
|
--add-opens java.base/sun.nio.ch=ALL-UNNAMED \
|
||||||
|
--add-opens java.base/java.io=ALL-UNNAMED \
|
||||||
|
-jar webgoat.jar --server.address=0.0.0.0 > webgoat.log
|
||||||
|
}
|
||||||
|
|
||||||
|
function webwolf() {
|
||||||
|
echo "Starting WebWolf..."
|
||||||
|
java -Duser.home=/home/webgoat -Dfile.encoding=UTF-8 -jar webwolf.jar --server.address=0.0.0.0 > webwolf.log
|
||||||
|
}
|
||||||
|
|
||||||
|
function write_start_message() {
|
||||||
|
until $(curl --output /dev/null --silent --head --fail http://0.0.0.0:8080/WebGoat/health); do
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
echo "
|
||||||
|
__ __ _ _____ _
|
||||||
|
\ \ / / | | / ____| | |
|
||||||
|
\ \ /\ / / ___ | |__ | | __ ___ __ _ | |_
|
||||||
|
\ \/ \/ / / _ \ | '_ \ | | |_ | / _ \ / _' | | __|
|
||||||
|
\ /\ / | __/ | |_) | | |__| | | (_) | | (_| | | |_
|
||||||
|
\/ \/ \___| |_.__/ \_____| \___/ \__,_| \__|
|
||||||
|
" >> webgoat.log
|
||||||
|
echo "WebGoat and WebWolf successfully started..." >> webgoat.log
|
||||||
|
pidof nginx >/dev/null && echo "Browse to http://localhost to get started" >> webgoat.log || echo "Browse to http://localhost:8080/WebGoat or http://localhost:9090/WebWolf to get started" >> webgoat.log
|
||||||
|
}
|
||||||
|
|
||||||
|
function tail_log_file() {
|
||||||
|
touch webgoat.log
|
||||||
|
tail -300f webgoat.log
|
||||||
|
}
|
||||||
|
|
||||||
|
commandline_args=("$@")
|
||||||
|
|
||||||
|
nginx
|
||||||
|
webgoat &
|
||||||
|
webwolf &
|
||||||
|
write_start_message &
|
||||||
|
tail_log_file
|
||||||
|
|
||||||
|
|
||||||
|
|
5
docs/README.md
Normal file
5
docs/README.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# WebGoat landing page
|
||||||
|
|
||||||
|
Old Github page which now redirects to OWASP website.
|
||||||
|
|
||||||
|
|
14
docs/index.html
Normal file
14
docs/index.html
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="refresh" content="0;url=https://owasp.org/www-project-webgoat/" />
|
||||||
|
<link rel="canonical" href="https://owasp.org/www-project-webgoat/" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>
|
||||||
|
The page been moved to <a href="https://owasp.org/www-project-webgoat/">https://owasp.org/www-project-webgoat/</a>
|
||||||
|
</h1>
|
||||||
|
</body>
|
||||||
|
</html>
|
310
mvnw
vendored
Executable file
310
mvnw
vendored
Executable file
@ -0,0 +1,310 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
# or more contributor license agreements. See the NOTICE file
|
||||||
|
# distributed with this work for additional information
|
||||||
|
# regarding copyright ownership. The ASF licenses this file
|
||||||
|
# to you under the Apache License, Version 2.0 (the
|
||||||
|
# "License"); you may not use this file except in compliance
|
||||||
|
# with the License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing,
|
||||||
|
# software distributed under the License is distributed on an
|
||||||
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
# KIND, either express or implied. See the License for the
|
||||||
|
# specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# Maven2 Start Up Batch script
|
||||||
|
#
|
||||||
|
# Required ENV vars:
|
||||||
|
# ------------------
|
||||||
|
# JAVA_HOME - location of a JDK home dir
|
||||||
|
#
|
||||||
|
# Optional ENV vars
|
||||||
|
# -----------------
|
||||||
|
# M2_HOME - location of maven2's installed home dir
|
||||||
|
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||||
|
# e.g. to debug Maven itself, use
|
||||||
|
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||||
|
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if [ -z "$MAVEN_SKIP_RC" ] ; then
|
||||||
|
|
||||||
|
if [ -f /etc/mavenrc ] ; then
|
||||||
|
. /etc/mavenrc
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "$HOME/.mavenrc" ] ; then
|
||||||
|
. "$HOME/.mavenrc"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
# OS specific support. $var _must_ be set to either true or false.
|
||||||
|
cygwin=false;
|
||||||
|
darwin=false;
|
||||||
|
mingw=false
|
||||||
|
case "`uname`" in
|
||||||
|
CYGWIN*) cygwin=true ;;
|
||||||
|
MINGW*) mingw=true;;
|
||||||
|
Darwin*) darwin=true
|
||||||
|
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
|
||||||
|
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
|
||||||
|
if [ -z "$JAVA_HOME" ]; then
|
||||||
|
if [ -x "/usr/libexec/java_home" ]; then
|
||||||
|
export JAVA_HOME="`/usr/libexec/java_home`"
|
||||||
|
else
|
||||||
|
export JAVA_HOME="/Library/Java/Home"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -z "$JAVA_HOME" ] ; then
|
||||||
|
if [ -r /etc/gentoo-release ] ; then
|
||||||
|
JAVA_HOME=`java-config --jre-home`
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$M2_HOME" ] ; then
|
||||||
|
## resolve links - $0 may be a link to maven's home
|
||||||
|
PRG="$0"
|
||||||
|
|
||||||
|
# need this for relative symlinks
|
||||||
|
while [ -h "$PRG" ] ; do
|
||||||
|
ls=`ls -ld "$PRG"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
PRG="$link"
|
||||||
|
else
|
||||||
|
PRG="`dirname "$PRG"`/$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
saveddir=`pwd`
|
||||||
|
|
||||||
|
M2_HOME=`dirname "$PRG"`/..
|
||||||
|
|
||||||
|
# make it fully qualified
|
||||||
|
M2_HOME=`cd "$M2_HOME" && pwd`
|
||||||
|
|
||||||
|
cd "$saveddir"
|
||||||
|
# echo Using m2 at $M2_HOME
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||||
|
if $cygwin ; then
|
||||||
|
[ -n "$M2_HOME" ] &&
|
||||||
|
M2_HOME=`cygpath --unix "$M2_HOME"`
|
||||||
|
[ -n "$JAVA_HOME" ] &&
|
||||||
|
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||||
|
[ -n "$CLASSPATH" ] &&
|
||||||
|
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Mingw, ensure paths are in UNIX format before anything is touched
|
||||||
|
if $mingw ; then
|
||||||
|
[ -n "$M2_HOME" ] &&
|
||||||
|
M2_HOME="`(cd "$M2_HOME"; pwd)`"
|
||||||
|
[ -n "$JAVA_HOME" ] &&
|
||||||
|
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$JAVA_HOME" ]; then
|
||||||
|
javaExecutable="`which javac`"
|
||||||
|
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
|
||||||
|
# readlink(1) is not available as standard on Solaris 10.
|
||||||
|
readLink=`which readlink`
|
||||||
|
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
|
||||||
|
if $darwin ; then
|
||||||
|
javaHome="`dirname \"$javaExecutable\"`"
|
||||||
|
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
|
||||||
|
else
|
||||||
|
javaExecutable="`readlink -f \"$javaExecutable\"`"
|
||||||
|
fi
|
||||||
|
javaHome="`dirname \"$javaExecutable\"`"
|
||||||
|
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
|
||||||
|
JAVA_HOME="$javaHome"
|
||||||
|
export JAVA_HOME
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$JAVACMD" ] ; then
|
||||||
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||||
|
else
|
||||||
|
JAVACMD="$JAVA_HOME/bin/java"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD="`which java`"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
echo "Error: JAVA_HOME is not defined correctly." >&2
|
||||||
|
echo " We cannot execute $JAVACMD" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$JAVA_HOME" ] ; then
|
||||||
|
echo "Warning: JAVA_HOME environment variable is not set."
|
||||||
|
fi
|
||||||
|
|
||||||
|
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
|
||||||
|
|
||||||
|
# traverses directory structure from process work directory to filesystem root
|
||||||
|
# first directory with .mvn subdirectory is considered project base directory
|
||||||
|
find_maven_basedir() {
|
||||||
|
|
||||||
|
if [ -z "$1" ]
|
||||||
|
then
|
||||||
|
echo "Path not specified to find_maven_basedir"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
basedir="$1"
|
||||||
|
wdir="$1"
|
||||||
|
while [ "$wdir" != '/' ] ; do
|
||||||
|
if [ -d "$wdir"/.mvn ] ; then
|
||||||
|
basedir=$wdir
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
|
||||||
|
if [ -d "${wdir}" ]; then
|
||||||
|
wdir=`cd "$wdir/.."; pwd`
|
||||||
|
fi
|
||||||
|
# end of workaround
|
||||||
|
done
|
||||||
|
echo "${basedir}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# concatenates all lines of a file
|
||||||
|
concat_lines() {
|
||||||
|
if [ -f "$1" ]; then
|
||||||
|
echo "$(tr -s '\n' ' ' < "$1")"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
BASE_DIR=`find_maven_basedir "$(pwd)"`
|
||||||
|
if [ -z "$BASE_DIR" ]; then
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
##########################################################################################
|
||||||
|
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||||
|
# This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||||
|
##########################################################################################
|
||||||
|
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Found .mvn/wrapper/maven-wrapper.jar"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
|
||||||
|
fi
|
||||||
|
if [ -n "$MVNW_REPOURL" ]; then
|
||||||
|
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
|
||||||
|
else
|
||||||
|
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
|
||||||
|
fi
|
||||||
|
while IFS="=" read key value; do
|
||||||
|
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
|
||||||
|
esac
|
||||||
|
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Downloading from: $jarUrl"
|
||||||
|
fi
|
||||||
|
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
|
||||||
|
if $cygwin; then
|
||||||
|
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v wget > /dev/null; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Found wget ... using wget"
|
||||||
|
fi
|
||||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||||
|
wget "$jarUrl" -O "$wrapperJarPath"
|
||||||
|
else
|
||||||
|
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
|
||||||
|
fi
|
||||||
|
elif command -v curl > /dev/null; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Found curl ... using curl"
|
||||||
|
fi
|
||||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||||
|
curl -o "$wrapperJarPath" "$jarUrl" -f
|
||||||
|
else
|
||||||
|
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Falling back to using Java to download"
|
||||||
|
fi
|
||||||
|
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
|
||||||
|
# For Cygwin, switch paths to Windows format before running javac
|
||||||
|
if $cygwin; then
|
||||||
|
javaClass=`cygpath --path --windows "$javaClass"`
|
||||||
|
fi
|
||||||
|
if [ -e "$javaClass" ]; then
|
||||||
|
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo " - Compiling MavenWrapperDownloader.java ..."
|
||||||
|
fi
|
||||||
|
# Compiling the Java class
|
||||||
|
("$JAVA_HOME/bin/javac" "$javaClass")
|
||||||
|
fi
|
||||||
|
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||||
|
# Running the downloader
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo " - Running MavenWrapperDownloader.java ..."
|
||||||
|
fi
|
||||||
|
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
##########################################################################################
|
||||||
|
# End of extension
|
||||||
|
##########################################################################################
|
||||||
|
|
||||||
|
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo $MAVEN_PROJECTBASEDIR
|
||||||
|
fi
|
||||||
|
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
||||||
|
|
||||||
|
# For Cygwin, switch paths to Windows format before running java
|
||||||
|
if $cygwin; then
|
||||||
|
[ -n "$M2_HOME" ] &&
|
||||||
|
M2_HOME=`cygpath --path --windows "$M2_HOME"`
|
||||||
|
[ -n "$JAVA_HOME" ] &&
|
||||||
|
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
|
||||||
|
[ -n "$CLASSPATH" ] &&
|
||||||
|
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
|
||||||
|
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
|
||||||
|
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Provide a "standardized" way to retrieve the CLI args that will
|
||||||
|
# work with both Windows and non-Windows executions.
|
||||||
|
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
|
||||||
|
export MAVEN_CMD_LINE_ARGS
|
||||||
|
|
||||||
|
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||||
|
|
||||||
|
exec "$JAVACMD" \
|
||||||
|
$MAVEN_OPTS \
|
||||||
|
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
||||||
|
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
||||||
|
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
|
182
mvnw.cmd
vendored
Normal file
182
mvnw.cmd
vendored
Normal file
@ -0,0 +1,182 @@
|
|||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
@REM Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
@REM or more contributor license agreements. See the NOTICE file
|
||||||
|
@REM distributed with this work for additional information
|
||||||
|
@REM regarding copyright ownership. The ASF licenses this file
|
||||||
|
@REM to you under the Apache License, Version 2.0 (the
|
||||||
|
@REM "License"); you may not use this file except in compliance
|
||||||
|
@REM with the License. You may obtain a copy of the License at
|
||||||
|
@REM
|
||||||
|
@REM http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
@REM
|
||||||
|
@REM Unless required by applicable law or agreed to in writing,
|
||||||
|
@REM software distributed under the License is distributed on an
|
||||||
|
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
@REM KIND, either express or implied. See the License for the
|
||||||
|
@REM specific language governing permissions and limitations
|
||||||
|
@REM under the License.
|
||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
@REM Maven2 Start Up Batch script
|
||||||
|
@REM
|
||||||
|
@REM Required ENV vars:
|
||||||
|
@REM JAVA_HOME - location of a JDK home dir
|
||||||
|
@REM
|
||||||
|
@REM Optional ENV vars
|
||||||
|
@REM M2_HOME - location of maven2's installed home dir
|
||||||
|
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
||||||
|
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
|
||||||
|
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||||
|
@REM e.g. to debug Maven itself, use
|
||||||
|
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||||
|
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
||||||
|
@echo off
|
||||||
|
@REM set title of command window
|
||||||
|
title %0
|
||||||
|
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
|
||||||
|
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
||||||
|
|
||||||
|
@REM set %HOME% to equivalent of $HOME
|
||||||
|
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
||||||
|
|
||||||
|
@REM Execute a user defined script before this one
|
||||||
|
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
||||||
|
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
||||||
|
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
|
||||||
|
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
|
||||||
|
:skipRcPre
|
||||||
|
|
||||||
|
@setlocal
|
||||||
|
|
||||||
|
set ERROR_CODE=0
|
||||||
|
|
||||||
|
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
||||||
|
@setlocal
|
||||||
|
|
||||||
|
@REM ==== START VALIDATION ====
|
||||||
|
if not "%JAVA_HOME%" == "" goto OkJHome
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Error: JAVA_HOME not found in your environment. >&2
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||||
|
echo location of your Java installation. >&2
|
||||||
|
echo.
|
||||||
|
goto error
|
||||||
|
|
||||||
|
:OkJHome
|
||||||
|
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
||||||
|
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||||
|
echo location of your Java installation. >&2
|
||||||
|
echo.
|
||||||
|
goto error
|
||||||
|
|
||||||
|
@REM ==== END VALIDATION ====
|
||||||
|
|
||||||
|
:init
|
||||||
|
|
||||||
|
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
||||||
|
@REM Fallback to current working directory if not found.
|
||||||
|
|
||||||
|
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
||||||
|
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
||||||
|
|
||||||
|
set EXEC_DIR=%CD%
|
||||||
|
set WDIR=%EXEC_DIR%
|
||||||
|
:findBaseDir
|
||||||
|
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
||||||
|
cd ..
|
||||||
|
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
||||||
|
set WDIR=%CD%
|
||||||
|
goto findBaseDir
|
||||||
|
|
||||||
|
:baseDirFound
|
||||||
|
set MAVEN_PROJECTBASEDIR=%WDIR%
|
||||||
|
cd "%EXEC_DIR%"
|
||||||
|
goto endDetectBaseDir
|
||||||
|
|
||||||
|
:baseDirNotFound
|
||||||
|
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
||||||
|
cd "%EXEC_DIR%"
|
||||||
|
|
||||||
|
:endDetectBaseDir
|
||||||
|
|
||||||
|
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
||||||
|
|
||||||
|
@setlocal EnableExtensions EnableDelayedExpansion
|
||||||
|
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
||||||
|
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
||||||
|
|
||||||
|
:endReadAdditionalConfig
|
||||||
|
|
||||||
|
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
||||||
|
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
|
||||||
|
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||||
|
|
||||||
|
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
|
||||||
|
|
||||||
|
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
|
||||||
|
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
|
||||||
|
)
|
||||||
|
|
||||||
|
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||||
|
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||||
|
if exist %WRAPPER_JAR% (
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Found %WRAPPER_JAR%
|
||||||
|
)
|
||||||
|
) else (
|
||||||
|
if not "%MVNW_REPOURL%" == "" (
|
||||||
|
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
|
||||||
|
)
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Couldn't find %WRAPPER_JAR%, downloading it ...
|
||||||
|
echo Downloading from: %DOWNLOAD_URL%
|
||||||
|
)
|
||||||
|
|
||||||
|
powershell -Command "&{"^
|
||||||
|
"$webclient = new-object System.Net.WebClient;"^
|
||||||
|
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
|
||||||
|
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
|
||||||
|
"}"^
|
||||||
|
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
|
||||||
|
"}"
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Finished downloading %WRAPPER_JAR%
|
||||||
|
)
|
||||||
|
)
|
||||||
|
@REM End of extension
|
||||||
|
|
||||||
|
@REM Provide a "standardized" way to retrieve the CLI args that will
|
||||||
|
@REM work with both Windows and non-Windows executions.
|
||||||
|
set MAVEN_CMD_LINE_ARGS=%*
|
||||||
|
|
||||||
|
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
|
||||||
|
if ERRORLEVEL 1 goto error
|
||||||
|
goto end
|
||||||
|
|
||||||
|
:error
|
||||||
|
set ERROR_CODE=1
|
||||||
|
|
||||||
|
:end
|
||||||
|
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
||||||
|
|
||||||
|
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
|
||||||
|
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
||||||
|
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
|
||||||
|
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
|
||||||
|
:skipRcPost
|
||||||
|
|
||||||
|
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
||||||
|
if "%MAVEN_BATCH_PAUSE%" == "on" pause
|
||||||
|
|
||||||
|
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
|
||||||
|
|
||||||
|
exit /B %ERROR_CODE%
|
@ -1,31 +0,0 @@
|
|||||||
# AWS
|
|
||||||
|
|
||||||
- This contains the various platform Quick Starts for Getting WebGoat Deployed into AWS.
|
|
||||||
- This IaaS quickstart uses AWS CloudFormation to perform most of the provisioning
|
|
||||||
- This IaaS quickstart is composed of three independent bundles
|
|
||||||
- Code pipeline and Build
|
|
||||||
- Deploying to EC2
|
|
||||||
- Deploying to ECS
|
|
||||||
|
|
||||||
|
|
||||||
It is Assumed:
|
|
||||||
- You have an AWS Account
|
|
||||||
- You know what an S3 bucket is
|
|
||||||
- You have seen the IAM console and have permissions to create IAM Roles
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Code Pipeline and Build
|
|
||||||
|
|
||||||
This Quickstart is for those that just want to perform builds with AWS. It Triggers off of Github to perform builds of `webgoat-server`
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## EC2
|
|
||||||
|
|
||||||
(WIP) This uses AWS CodePipeline, CodeBuild, and CodeDeploy to land WebGoat to Running EC2 instances
|
|
||||||
|
|
||||||
## ECS
|
|
||||||
|
|
||||||
(WIP) This uses AWS CodePipeline, CodeBuild, ECR, to land a container onto an ECS cluster
|
|
@ -1,101 +0,0 @@
|
|||||||
{
|
|
||||||
"AWSTemplateFormatVersion": "2010-09-09",
|
|
||||||
"Description": "IAM Roles for Code Build WebGoat IaaS Quickstart",
|
|
||||||
"Parameters": {
|
|
||||||
"qsS3BucketName": {
|
|
||||||
"Description": "Name of the S3 Bucket for artifacts",
|
|
||||||
"Type": "String",
|
|
||||||
"MinLength": "1"
|
|
||||||
},
|
|
||||||
"qsRoleName": {
|
|
||||||
"Description": "Name of the IAM role that CodeBuild Will Use",
|
|
||||||
"Type": "String",
|
|
||||||
"Default": "SimpleCodeBuildRole",
|
|
||||||
"MinLength": "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Resources": {
|
|
||||||
"qsCodeBuildRole": {
|
|
||||||
"Type": "AWS::IAM::Role",
|
|
||||||
"Properties": {
|
|
||||||
"AssumeRolePolicyDocument": {
|
|
||||||
"Version": "2012-10-17",
|
|
||||||
"Statement": [
|
|
||||||
{
|
|
||||||
"Effect": "Allow",
|
|
||||||
"Principal": {
|
|
||||||
"Service": [
|
|
||||||
"codebuild.amazonaws.com"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Action": [
|
|
||||||
"sts:AssumeRole"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Path": "/webgoat/",
|
|
||||||
"RoleName": {
|
|
||||||
"Ref": "qsRoleName"
|
|
||||||
},
|
|
||||||
"ManagedPolicyArns": [
|
|
||||||
"arn:aws:iam::aws:policy/AWSCodeCommitFullAccess",
|
|
||||||
"arn:aws:iam::aws:policy/AWSCodeBuildDeveloperAccess",
|
|
||||||
"arn:aws:iam::aws:policy/AWSCodeDeployDeployerAccess"
|
|
||||||
],
|
|
||||||
"Policies": [
|
|
||||||
{
|
|
||||||
"PolicyName": "CloudWatchLogs",
|
|
||||||
"PolicyDocument": {
|
|
||||||
"Version": "2012-10-17",
|
|
||||||
"Statement": [
|
|
||||||
{
|
|
||||||
"Effect": "Allow",
|
|
||||||
"Resource": [
|
|
||||||
{"Fn::Join": [ "",["arn:aws:logs:*:", { "Ref": "AWS::AccountId" }, ":log-group:/aws/codebuild*" ] ]}
|
|
||||||
],
|
|
||||||
"Action": [
|
|
||||||
"logs:CreateLogGroup",
|
|
||||||
"logs:CreateLogStream",
|
|
||||||
"logs:PutLogEvents"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"PolicyName": "S3buckets",
|
|
||||||
"PolicyDocument": {
|
|
||||||
"Version": "2012-10-17",
|
|
||||||
"Statement": [
|
|
||||||
{
|
|
||||||
"Effect": "Allow",
|
|
||||||
"Resource": [
|
|
||||||
{
|
|
||||||
"Fn::Join": [
|
|
||||||
"",
|
|
||||||
[
|
|
||||||
"arn:aws:s3:::",
|
|
||||||
{
|
|
||||||
"Ref": "qsS3BucketName"
|
|
||||||
},
|
|
||||||
"*"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"arn:aws:s3:::codepipeline-*"
|
|
||||||
],
|
|
||||||
"Action": [
|
|
||||||
"s3:Put*",
|
|
||||||
"s3:Get*",
|
|
||||||
"s3:List*"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,127 +0,0 @@
|
|||||||
{
|
|
||||||
"AWSTemplateFormatVersion": "2010-09-09",
|
|
||||||
"Description": "IAM Role for Code Pipeline WebGoat IaaS Quickstart",
|
|
||||||
"Parameters": {
|
|
||||||
"qsS3BucketName": {
|
|
||||||
"Description": "Name of the S3 Bucket for artifacts",
|
|
||||||
"Type": "String",
|
|
||||||
"MinLength": "1"
|
|
||||||
},
|
|
||||||
"qsRoleName": {
|
|
||||||
"Description": "Name of the IAM role that CodePipeline Will Use",
|
|
||||||
"Type": "String",
|
|
||||||
"Default": "SimpleCodePipelineRole",
|
|
||||||
"MinLength": "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Resources": {
|
|
||||||
"qsCodePipelineRole": {
|
|
||||||
"Type": "AWS::IAM::Role",
|
|
||||||
"Properties": {
|
|
||||||
"AssumeRolePolicyDocument": {
|
|
||||||
"Version": "2012-10-17",
|
|
||||||
"Statement": [
|
|
||||||
{
|
|
||||||
"Sid": "",
|
|
||||||
"Effect": "Allow",
|
|
||||||
"Principal": {
|
|
||||||
"Service": "codepipeline.amazonaws.com"
|
|
||||||
},
|
|
||||||
"Action": "sts:AssumeRole"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Path": "/webgoat/",
|
|
||||||
"RoleName": {
|
|
||||||
"Ref": "qsRoleName"
|
|
||||||
},
|
|
||||||
"ManagedPolicyArns": [
|
|
||||||
"arn:aws:iam::aws:policy/AWSCodeCommitFullAccess",
|
|
||||||
"arn:aws:iam::aws:policy/AWSCodeBuildDeveloperAccess",
|
|
||||||
"arn:aws:iam::aws:policy/AWSCodeDeployDeployerAccess"
|
|
||||||
],
|
|
||||||
"Policies": [
|
|
||||||
{
|
|
||||||
"PolicyName": "CloudWatchLogsPipeline",
|
|
||||||
"PolicyDocument": {
|
|
||||||
"Version": "2012-10-17",
|
|
||||||
"Statement": [
|
|
||||||
{
|
|
||||||
"Effect": "Allow",
|
|
||||||
"Resource": [
|
|
||||||
{"Fn::Join": [ "",["arn:aws:logs:*:", { "Ref": "AWS::AccountId" }, ":log-group:/aws/*" ] ]}
|
|
||||||
],
|
|
||||||
"Action": [
|
|
||||||
"logs:CreateLogGroup",
|
|
||||||
"logs:CreateLogStream",
|
|
||||||
"logs:PutLogEvents"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"PolicyName": "MiscComputeOpen",
|
|
||||||
"PolicyDocument": {
|
|
||||||
"Version": "2012-10-17",
|
|
||||||
"Statement": [
|
|
||||||
{
|
|
||||||
"Effect": "Allow",
|
|
||||||
"Resource": "*",
|
|
||||||
"Action": [
|
|
||||||
"lambda:InvokeFunction",
|
|
||||||
"lambda:ListFunctions",
|
|
||||||
"elasticbeanstalk:*",
|
|
||||||
"ec2:*",
|
|
||||||
"elasticloadbalancing:*",
|
|
||||||
"autoscaling:*",
|
|
||||||
"cloudwatch:*",
|
|
||||||
"s3:*",
|
|
||||||
"sns:*",
|
|
||||||
"cloudformation:*",
|
|
||||||
"rds:*",
|
|
||||||
"sqs:*",
|
|
||||||
"ecs:*",
|
|
||||||
"iam:PassRole"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"PolicyName": "S3buckets",
|
|
||||||
"PolicyDocument": {
|
|
||||||
"Version": "2012-10-17",
|
|
||||||
"Statement": [
|
|
||||||
{
|
|
||||||
"Effect": "Allow",
|
|
||||||
"Resource": [
|
|
||||||
{
|
|
||||||
"Fn::Join": [
|
|
||||||
"",
|
|
||||||
[
|
|
||||||
"arn:aws:s3:::",
|
|
||||||
{
|
|
||||||
"Ref": "qsS3BucketName"
|
|
||||||
},
|
|
||||||
"*"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"arn:aws:s3:::codepipeline-*",
|
|
||||||
"arn:aws:s3:::elasticbeanstalk*"
|
|
||||||
],
|
|
||||||
"Action": [
|
|
||||||
"s3:Put*",
|
|
||||||
"s3:Get*",
|
|
||||||
"s3:List*"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,123 +0,0 @@
|
|||||||
AWSTemplateFormatVersion: "2010-09-09"
|
|
||||||
|
|
||||||
Description: >
|
|
||||||
AWS Cloud Formation for creating an AWS CodePipeline that checks a git repo for changes and then performs a build using code build
|
|
||||||
|
|
||||||
|
|
||||||
Parameters:
|
|
||||||
qsPipelineName:
|
|
||||||
Description: The name of the AWS Code Pipeline
|
|
||||||
Type: String
|
|
||||||
Default: WG-pipeline
|
|
||||||
MinLength: 1
|
|
||||||
qsPipelineRoleARN:
|
|
||||||
Description: The complete ARN to the IAM role that code pipeline should use
|
|
||||||
Type: String
|
|
||||||
MinLength: 1
|
|
||||||
qsCodeRepo:
|
|
||||||
Description: The Repository
|
|
||||||
Type: String
|
|
||||||
MinLength: 1
|
|
||||||
qsRepoBranch:
|
|
||||||
Description: The Branch in the Repository
|
|
||||||
Type: String
|
|
||||||
MinLength: 1
|
|
||||||
qsGitHubUser:
|
|
||||||
Description: The GitHub User Id
|
|
||||||
Type: String
|
|
||||||
MinLength: 1
|
|
||||||
qsGitHubAPIToken:
|
|
||||||
Description: The GitHub Personal Access token do not use password
|
|
||||||
NoEcho: true
|
|
||||||
Type: String
|
|
||||||
MinLength: 1
|
|
||||||
qsS3PipelineArtifacts:
|
|
||||||
Description: Where Code Pipeline will state artifacts in S3
|
|
||||||
Type: String
|
|
||||||
MinLength: 1
|
|
||||||
qsS3CodeBuildArtifacts:
|
|
||||||
Description: Where Code Build will upload Artifacts can be same as codepipeline
|
|
||||||
Type: String
|
|
||||||
MinLength: 1
|
|
||||||
qsCodeBuildName:
|
|
||||||
Description: Name of the AWS Code Build
|
|
||||||
Type: String
|
|
||||||
Default: WG-mvnBuilder
|
|
||||||
MinLength: 1
|
|
||||||
qsKMSKeyARN:
|
|
||||||
Description: The KMS ARN that the IAM Role is allowed to use
|
|
||||||
Type: String
|
|
||||||
MinLength: 1
|
|
||||||
qsCodeRoleArn:
|
|
||||||
Description: The IAM Role ARN for CodePipeline and CodeDeploy
|
|
||||||
Type: String
|
|
||||||
MinLength: 1
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Resources:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
stkcbrCodeBuild:
|
|
||||||
Type: AWS::CodeBuild::Project
|
|
||||||
Properties:
|
|
||||||
Artifacts:
|
|
||||||
Type: CODEPIPELINE
|
|
||||||
Description: Builds WebGoat Jar using build file in repo
|
|
||||||
EncryptionKey: !Ref 'qsKMSKeyARN'
|
|
||||||
Environment:
|
|
||||||
ComputeType: BUILD_GENERAL1_SMALL
|
|
||||||
Image: aws/codebuild/java:openjdk-8
|
|
||||||
Type: LINUX_CONTAINER
|
|
||||||
Name: !Ref 'qsCodeBuildName'
|
|
||||||
ServiceRole: !Ref 'qsCodeRoleArn'
|
|
||||||
TimeoutInMinutes: 10
|
|
||||||
Source:
|
|
||||||
Type: CODEPIPELINE
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
stkcplPipeline:
|
|
||||||
Type: AWS::CodePipeline::Pipeline
|
|
||||||
Properties:
|
|
||||||
Name: !Ref 'qsPipelineName'
|
|
||||||
RoleArn: !Ref 'qsPipelineRoleARN'
|
|
||||||
ArtifactStore:
|
|
||||||
Location: !Ref 'qsS3PipelineArtifacts'
|
|
||||||
Type: S3
|
|
||||||
Stages:
|
|
||||||
- Name: CodeRepo
|
|
||||||
Actions:
|
|
||||||
- Name: CodeSource
|
|
||||||
ActionTypeId:
|
|
||||||
Category: Source
|
|
||||||
Owner: ThirdParty
|
|
||||||
Provider: GitHub
|
|
||||||
Version: 1
|
|
||||||
Configuration:
|
|
||||||
Branch: !Ref 'qsRepoBranch'
|
|
||||||
Repo: !Ref 'qsCodeRepo'
|
|
||||||
Owner: !Ref 'qsGitHubUser'
|
|
||||||
OAuthToken: !Ref 'qsGitHubAPIToken'
|
|
||||||
OutputArtifacts:
|
|
||||||
- Name: MySource
|
|
||||||
RunOrder: '1'
|
|
||||||
- Name: Build
|
|
||||||
Actions:
|
|
||||||
- Name: CodeBuild
|
|
||||||
ActionTypeId:
|
|
||||||
Category: Build
|
|
||||||
Owner: AWS
|
|
||||||
Provider: CodeBuild
|
|
||||||
Version: 1
|
|
||||||
InputArtifacts:
|
|
||||||
- Name: MySource
|
|
||||||
Configuration:
|
|
||||||
ProjectName: !Ref stkcbrCodeBuild
|
|
||||||
OutputArtifacts:
|
|
||||||
- Name: MyBuild
|
|
||||||
RunOrder: '2'
|
|
||||||
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
|||||||
# Serverless MVN builds Featuring AWS
|
|
||||||
|
|
||||||
This Quick Start forms the basis for the other AWS quickstarts. This only BUILDS the `webgoat-server` spring boot jar. If you want to also run it on AWS skip to the other AWS quickstarts
|
|
||||||
|
|
||||||
Before you Begin
|
|
||||||
1. Do you have an AWS Account?
|
|
||||||
2. Can you create an S3 Bucket?
|
|
||||||
3. Can you create a KMS Key?
|
|
||||||
4. Do you know what Cloud Formation is?
|
|
||||||
5. Do you have enough permissions to do any real work in said AWS Account?
|
|
||||||
|
|
||||||
If you said no to any of those...hop over to [docs](https://aws.amazon.com/documentation/) and learn (but don't do) how to create those.
|
|
||||||
|
|
||||||
|
|
||||||
You will also need:
|
|
||||||
1. A GitHub Account
|
|
||||||
2. Fork of WebGoat
|
|
||||||
3. Personal access Token with `Admin:repo_hook` and `repo`
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Create Pre-requisites
|
|
||||||
|
|
||||||
First pick an AWS region and stick with it for ALL the quickstarts. This one was mostly executed on US-east-1/2 but any region with KMS, CodePipeline, and CodeBuild will work. eu-Central-1, ap-southeast-1 and sa-east-1 have reported success also.
|
|
||||||
|
|
||||||
|
|
||||||
1. Create an S3 bucket and call it something meaningfull like `webgoat-stash-username` or something or use an existing bucket you have access to.
|
|
||||||
2. Create a KMS Key. Make sure you are a key administrator so you can add key users later.
|
|
||||||
|
|
||||||
## Deploy IAM role Cloud Formation Stacks
|
|
||||||
|
|
||||||
In this folder there are two json cloudformation templates:
|
|
||||||
-`01_IAM_codebuild.json`
|
|
||||||
-`01_IAM_codepipeline.json`
|
|
||||||
|
|
||||||
You will use the CloudFormation templates to create two roles. One for CodePipeline and the Other for CodeBuild. You will use the name of the bucket you just created as a parameter.
|
|
||||||
|
|
||||||
## Update KMS Key
|
|
||||||
|
|
||||||
Access the KMS key you created earlier...add the two IAM roles you just created and Key Users
|
|
||||||
|
|
||||||
## Finally the Pipeline
|
|
||||||
|
|
||||||
You will use the yaml cloudformation template `01_codepiplinebuild.yml` to create the code building pipeline.
|
|
||||||
|
|
||||||
Some of the parameters you will need to pass:
|
|
||||||
1. The S3 bucket (twice)
|
|
||||||
2. The Github Branch name (master? develop? yourbranchname?)
|
|
||||||
3. The Github user (if you forked it would be your username)
|
|
||||||
4. You personal access token for GitHub
|
|
||||||
5. The name or the repo (WebGoat! ...unless you renamed and did a whole bunch of fancy git magic)
|
|
||||||
6. The ARN of the KMS key
|
|
||||||
7. The ARN of the role for the codebuild for parameter qsCodeRoleArn
|
|
||||||
8. The ARN for codepipeline
|
|
||||||
|
|
||||||
If this Stack successfully deploys a build will begin based on the latest commit automatically. You will have a funky named zip file (without the .zip ending) in a folder in the S3 bucket in a few minutes.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Congratulations. You just Deployed a two step AWS Codepipeline that looks for codechanges and then performs a build.
|
|
||||||
|
|
||||||
... ON to the next AWS Quickstart
|
|
||||||
|
|
||||||
|
|
@ -1,80 +0,0 @@
|
|||||||
# GKE - DockerHub
|
|
||||||
|
|
||||||
This Quickstart shows how to create a Kubernettes Cluster using Google Cloud Platform's [GKE](https://cloud.google.com/container-engine/) and WebGoat's Docker [Image](https://hub.docker.com/r/webgoat/webgoat-8.0/).
|
|
||||||
|
|
||||||
To be Successfull with this Quickstart
|
|
||||||
|
|
||||||
1. You have a Google Cloud Platform account and have enough access rights to create Compute Engine and Container Engine Resources
|
|
||||||
2. You know how to `git clone`
|
|
||||||
3. You have the gcloud SDK install and initialized somewhere ( do not use the google cloud shell)
|
|
||||||
|
|
||||||
|
|
||||||
Remeber to perform a 'gcloud auth login' before using the gcloud commands below.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Create Kubernettes Cluster
|
|
||||||
|
|
||||||
You can create a cluster using the Google Cloud Console. The Default settings will suffice. For this QuickStart the cluster name used is `owaspbasiccluster`. The `PROJECTNAME` is whatever your project is. The `REGION` is a region/zone near you.
|
|
||||||
|
|
||||||
If you want to use the gcloud sdk from a properly initialized gcloud commandline environment use the following command
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
gcloud container --project "PROJECTNAME" clusters create "owaspbasiccluster" --zone "REGION" --machine-type "n1-standard-1" --image-type "COS" --disk-size "100" --scopes "https://www.googleapis.com/auth/compute","https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/logging.write","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/servicecontrol","https://www.googleapis.com/auth/service.management.readonly","https://www.googleapis.com/auth/trace.append","https://www.googleapis.com/auth/source.read_only" --num-nodes "3" --network "default" --enable-cloud-logging --no-enable-cloud-monitoring
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
The command creates a similar cluster with more of the options set explicitly.
|
|
||||||
|
|
||||||
## Set up Kubectl
|
|
||||||
|
|
||||||
Using the commandline gcloud SDK environment you need to set-up 'kubectl'
|
|
||||||
|
|
||||||
If you have not already installed 'Kubectl' you can do so with the following command using `gcloud`
|
|
||||||
- `gcloud components install kubectl`
|
|
||||||
|
|
||||||
Then you just run:
|
|
||||||
- `gcloud container clusters get-credentials owaspbasiccluster --zone REGION --project PROJECTNAME`
|
|
||||||
|
|
||||||
|
|
||||||
## Deploy WebGoat Deployment
|
|
||||||
|
|
||||||
Time to deploy the latest DockerImage for WebGoat!
|
|
||||||
|
|
||||||
|
|
||||||
Let's First Make a namespace for this:
|
|
||||||
- `kubectl create namespace webgoat`
|
|
||||||
|
|
||||||
Now it is time to make the magic happen!
|
|
||||||
|
|
||||||
- `kubectl create -f /where_you_git_cloned_webgoat/platformQuickStart/GCP/GKE-Docker/webgoat_noDNSnoTLS.yml`
|
|
||||||
|
|
||||||
This should complete with no errors.
|
|
||||||
|
|
||||||
Use the following command to see information/status about the deployment
|
|
||||||
- `kubectl describe deployment webgoat-dpl --namespace=webgoat`
|
|
||||||
|
|
||||||
After a few minutes the service endpoint should be ready. You can check the status with
|
|
||||||
- `kubectl describe service webgoatsvc --namespace=webgoat`
|
|
||||||
|
|
||||||
In the output you should see a message like "Created load..." after a "Creating load..." which means that the public facing loadbalancer (even thou there is just one container running!) is ready.
|
|
||||||
|
|
||||||
|
|
||||||
If you want to see the Kubernetes dashboard you can run `kubectl proxy` (in a new terminal window) and then navigate to http://localhost:8001/ui .
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Test Deployment
|
|
||||||
|
|
||||||
From the previous `describe service` command the `LoadBalancer Ingress:` line should have the external IP. The line below should give the port.
|
|
||||||
|
|
||||||
So.....
|
|
||||||
|
|
||||||
[IP]:[PORT]/WebGoat in your browser!
|
|
||||||
|
|
||||||
DONE
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: webgoatapp
|
|
||||||
name: webgoatsvc
|
|
||||||
namespace: webgoat
|
|
||||||
spec:
|
|
||||||
ports:
|
|
||||||
-
|
|
||||||
port: 8080
|
|
||||||
protocol: TCP
|
|
||||||
selector:
|
|
||||||
app: webgoatapp
|
|
||||||
type: LoadBalancer
|
|
||||||
---
|
|
||||||
apiVersion: extensions/v1beta1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: webgoat-dpl
|
|
||||||
namespace: webgoat
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
name: webgoatapp
|
|
||||||
labels:
|
|
||||||
app: webgoatapp
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
-
|
|
||||||
image: webgoat/webgoat-8.0
|
|
||||||
name: webgoat
|
|
||||||
ports:
|
|
||||||
-
|
|
||||||
containerPort: 8080
|
|
||||||
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
|||||||
# WebGoat on GCP!
|
|
||||||
|
|
||||||
This folder contains sub folders for the various ways you could deploy WebGoat on Google Cloud Platform
|
|
||||||
|
|
||||||
It is assumed:
|
|
||||||
1. You have a Google Cloud Platform Account
|
|
||||||
2. You can use Git
|
|
||||||
3. You can use a Linux/Mac/Google Cloud Shell
|
|
||||||
|
|
||||||
|
|
||||||
## GKE Docker
|
|
||||||
|
|
||||||
Uses GKE to run the latest DockerHub version of WebGoat8
|
|
||||||
|
|
||||||
## AppEngine
|
|
||||||
|
|
||||||
WIP
|
|
@ -1,22 +0,0 @@
|
|||||||
# OWASP WebGoat Platform Quick Starts
|
|
||||||
|
|
||||||
Want to Run WebGoat? Want to run WebGoat in the Cloud? Don't want to be cloud Expert?
|
|
||||||
|
|
||||||
Do we have a solution for you!
|
|
||||||
|
|
||||||
|
|
||||||
Additionally, Each IaaS/PaaS will have their deployment steps broken down giving the *app-guy-new-to-cloud* an opportunity to learn how said platform works.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## AWS
|
|
||||||
|
|
||||||
Multi-Part Quickstart. Starts with simple pipeline that just builds code to a deploying onto EC2 instances and then containers using ECS/ECR
|
|
||||||
|
|
||||||
## GCP
|
|
||||||
|
|
||||||
Get WebGoat Running on GKE and AppEngine
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
54
platformQuickStarts/helm/Readme.md
Normal file
54
platformQuickStarts/helm/Readme.md
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
# Helm chart deployment on OpenShift K8S clusters
|
||||||
|
|
||||||
|
This helm chart can be used on a OpenShift Code Ready Container environment or an OpenShift Cloud Container environment.
|
||||||
|
|
||||||
|
With the OpenShift CRC (Code Ready Container) cluster you run an entire environment on your local machine. (> 4 vCPU, >8GB mem)
|
||||||
|
|
||||||
|
See the Red Hat documentation for general understanding of OpenShift. Make sure helm is installed as well.
|
||||||
|
|
||||||
|
https://developers.redhat.com/developer-sandbox
|
||||||
|
|
||||||
|
## CRC commands
|
||||||
|
|
||||||
|
crc config set cpus 6
|
||||||
|
crc config set memory 12288
|
||||||
|
crc setup
|
||||||
|
crc start
|
||||||
|
eval $(crc oc-env)
|
||||||
|
oc login -u developer https://api.crc.testing:6443
|
||||||
|
oc new-project demo-project
|
||||||
|
|
||||||
|
The example without modification uses *demo-project* as the project/namespace for installing WebGoat and WebWolf.
|
||||||
|
|
||||||
|
|
||||||
|
## Helm install this example on your local Code Ready Container environment
|
||||||
|
|
||||||
|
helm install goat1 ./webgoat
|
||||||
|
|
||||||
|
## Helm install on single node Developer Sandbox (cloud)
|
||||||
|
|
||||||
|
oc login --token=sha256~phDWy6Wm_oJQW6kmOHEbLkRdDIXU6b70hRVmdSYWolM --server=https://api.sandbox-m2.rz9k.p1.openshiftapps.com:6443
|
||||||
|
helm install --set namespace=renezubcevic-dev --set accessMode=ReadWriteOnce --set urlpostfix=.apps.sandbox-m2.rz9k.p1.openshiftapps.com goat1 ./webgoat
|
||||||
|
|
||||||
|
A code ready container looks the same for all developers on their local machine, but a developer sandbox requires other credentials from your account in the cloud and different namespace and urlpostfix and also a different access mode for the persistent storage.
|
||||||
|
Of course the token here is a fake.
|
||||||
|
|
||||||
|
## uninstall
|
||||||
|
|
||||||
|
helm uninstall goat1
|
||||||
|
|
||||||
|
The URL on a Code Ready Container is build from router name + namespace + default extension .apps-crc.testing:
|
||||||
|
|
||||||
|
+ [https://webgoat-1-goat-demo-project.apps-crc.testing/WebGoat](https://webgoat-1-goat-demo-project.apps-crc.testing/WebGoat)
|
||||||
|
+ [http://webwolf-1-wolf-demo-project.apps-crc.testing/WebWolf](http://webwolf-1-wolf-demo-project.apps-crc.testing/WebWolf)
|
||||||
|
|
||||||
|
## Explanation
|
||||||
|
|
||||||
|
deployment.yaml contains two K8S deployment elements. Both use the same Persistent Volume Claim and use the same Volume mapping.
|
||||||
|
They both use the same image but with other entrypoint and command arguments. The java.io.dir is also mapped to this persistent volume mapping. The number of pods is 1 for both WebGoat and WebWolf. WebGoat uses the WEBWOLF_HOST parameter to know where the external address of WebWolf is defined. WebWolf uses WEBGOAT_HOST to define the internal service address to WebGoat for connecting to the HSQL database
|
||||||
|
|
||||||
|
persistent-storage-claim.yaml contains the OpenShift K8S extension for requestig a volume with Read-Write access that will survive any pod replacements.
|
||||||
|
|
||||||
|
service.yaml defines the service ports for both WebGoat and WebWolf
|
||||||
|
|
||||||
|
route-goat defines an https endpoint toward the 8080 port. route-wolf defines an http port towards the 9090 port.
|
23
platformQuickStarts/helm/modsec/.helmignore
Normal file
23
platformQuickStarts/helm/modsec/.helmignore
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Patterns to ignore when building packages.
|
||||||
|
# This supports shell glob matching, relative path matching, and
|
||||||
|
# negation (prefixed with !). Only one pattern per line.
|
||||||
|
.DS_Store
|
||||||
|
# Common VCS dirs
|
||||||
|
.git/
|
||||||
|
.gitignore
|
||||||
|
.bzr/
|
||||||
|
.bzrignore
|
||||||
|
.hg/
|
||||||
|
.hgignore
|
||||||
|
.svn/
|
||||||
|
# Common backup files
|
||||||
|
*.swp
|
||||||
|
*.bak
|
||||||
|
*.tmp
|
||||||
|
*.orig
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
|
.vscode/
|
9
platformQuickStarts/helm/modsec/Chart.yaml
Normal file
9
platformQuickStarts/helm/modsec/Chart.yaml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
name: modsec
|
||||||
|
description: ModSecurity Core Rule Set
|
||||||
|
|
||||||
|
type: application
|
||||||
|
|
||||||
|
version: 0.1.0
|
||||||
|
|
||||||
|
appVersion: "latest"
|
@ -0,0 +1,18 @@
|
|||||||
|
kind: ConfigMap
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: {{ .Values.modsec_server.name }}-configmap-modsec
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/part-of: {{ .Values.modsec_server.name }}
|
||||||
|
data:
|
||||||
|
PARANOIA: '1'
|
||||||
|
EXECUTING_PARANOIA: '2'
|
||||||
|
ANOMALYIN: '5'
|
||||||
|
ANOMALYOUT: '5'
|
||||||
|
ALLOWED_METHODS: 'GET POST'
|
||||||
|
ALLOWED_REQUEST_CONTENT_TYPE: "text/xml|application/xml|text/plain"
|
||||||
|
MAX_FILE_SIZE: '5242880'
|
||||||
|
PORT: '8001'
|
||||||
|
RESTRICTED_EXTENSIONS: '.conf/'
|
||||||
|
BACKEND: 'http://{{ .Values.webgoat_server.name }}-service:8080'
|
45
platformQuickStarts/helm/modsec/templates/deployment.yaml
Normal file
45
platformQuickStarts/helm/modsec/templates/deployment.yaml
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
kind: Deployment
|
||||||
|
apiVersion: apps/v1
|
||||||
|
metadata:
|
||||||
|
name: {{ .Values.modsec_server.name }}
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: {{ .Values.modsec_server.name }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: {{ .Values.modsec_server.name }}
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- resources:
|
||||||
|
limits:
|
||||||
|
memory: "2Gi"
|
||||||
|
cpu: "1"
|
||||||
|
requests:
|
||||||
|
memory: "1Gi"
|
||||||
|
cpu: "0.5"
|
||||||
|
name: modsec
|
||||||
|
ports:
|
||||||
|
- containerPort: 8001
|
||||||
|
protocol: TCP
|
||||||
|
image: {{ .Values.modsec_server.image }}
|
||||||
|
imagePullPolicy: Always
|
||||||
|
terminationMessagePolicy: File
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: {{ .Values.modsec_server.name }}-configmap-modsec
|
||||||
|
restartPolicy: Always
|
||||||
|
terminationGracePeriodSeconds: 30
|
||||||
|
dnsPolicy: ClusterFirst
|
||||||
|
securityContext: {}
|
||||||
|
schedulerName: default-scheduler
|
||||||
|
strategy:
|
||||||
|
type: RollingUpdate
|
||||||
|
rollingUpdate:
|
||||||
|
maxUnavailable: 25%
|
||||||
|
maxSurge: 25%
|
||||||
|
revisionHistoryLimit: 10
|
||||||
|
progressDeadlineSeconds: 600
|
16
platformQuickStarts/helm/modsec/templates/route-modsec.yml
Normal file
16
platformQuickStarts/helm/modsec/templates/route-modsec.yml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: route.openshift.io/v1
|
||||||
|
kind: Route
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: {{ .Values.modsec_server.name }}
|
||||||
|
name: {{ .Values.modsec_server.name }}-modsec
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
spec:
|
||||||
|
path: /
|
||||||
|
port:
|
||||||
|
targetPort: 8001
|
||||||
|
to:
|
||||||
|
kind: Service
|
||||||
|
name: {{ .Values.modsec_server.name }}-service
|
||||||
|
weight: 100
|
||||||
|
wildcardPolicy: None
|
16
platformQuickStarts/helm/modsec/templates/service.yaml
Normal file
16
platformQuickStarts/helm/modsec/templates/service.yaml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: {{ .Values.modsec_server.name }}
|
||||||
|
name: {{ .Values.modsec_server.name }}-service
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: 8001-tcp
|
||||||
|
port: 8001
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 8001
|
||||||
|
selector:
|
||||||
|
app: {{ .Values.modsec_server.name }}
|
||||||
|
sessionAffinity: None
|
13
platformQuickStarts/helm/modsec/values.yaml
Normal file
13
platformQuickStarts/helm/modsec/values.yaml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
namespace: demo-project
|
||||||
|
urlpostfix: .apps-crc.testing
|
||||||
|
accessMode: ReadWriteMany
|
||||||
|
|
||||||
|
modsec_server:
|
||||||
|
name: modsec-1
|
||||||
|
#image: docker.io/franbuehler/modsecurity-crs-rp
|
||||||
|
#image: docker.io/owasp/modsecurity-crs
|
||||||
|
image: docker.io/chrira/modsecurity-crs-rp:openshift
|
||||||
|
|
||||||
|
webgoat_server:
|
||||||
|
name: webgoat-1
|
||||||
|
|
23
platformQuickStarts/helm/webgoat/.helmignore
Normal file
23
platformQuickStarts/helm/webgoat/.helmignore
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Patterns to ignore when building packages.
|
||||||
|
# This supports shell glob matching, relative path matching, and
|
||||||
|
# negation (prefixed with !). Only one pattern per line.
|
||||||
|
.DS_Store
|
||||||
|
# Common VCS dirs
|
||||||
|
.git/
|
||||||
|
.gitignore
|
||||||
|
.bzr/
|
||||||
|
.bzrignore
|
||||||
|
.hg/
|
||||||
|
.hgignore
|
||||||
|
.svn/
|
||||||
|
# Common backup files
|
||||||
|
*.swp
|
||||||
|
*.bak
|
||||||
|
*.tmp
|
||||||
|
*.orig
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
|
.vscode/
|
9
platformQuickStarts/helm/webgoat/Chart.yaml
Normal file
9
platformQuickStarts/helm/webgoat/Chart.yaml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
name: webgoat
|
||||||
|
description: WebGoat Learning Environment
|
||||||
|
|
||||||
|
type: application
|
||||||
|
|
||||||
|
version: 0.1.0
|
||||||
|
|
||||||
|
appVersion: "8.2.3-SNAPSHOT"
|
@ -0,0 +1,11 @@
|
|||||||
|
kind: ConfigMap
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: {{ .Values.webwolf_server.name }}-configmap
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/part-of: {{ .Values.webgoat_server.name }}
|
||||||
|
data:
|
||||||
|
TZ: 'Europe/Amsterdam'
|
||||||
|
WEBGOAT_HOST: {{ .Values.webgoat_server.name }}-service
|
||||||
|
|
13
platformQuickStarts/helm/webgoat/templates/configmap.yaml
Normal file
13
platformQuickStarts/helm/webgoat/templates/configmap.yaml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
kind: ConfigMap
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: {{ .Values.webgoat_server.name }}-configmap
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/part-of: {{ .Values.webgoat_server.name }}
|
||||||
|
data:
|
||||||
|
TZ: 'Europe/Amsterdam'
|
||||||
|
EXCLUDE_CATEGORIES: 'CLIENT_SIDE'
|
||||||
|
EXCLUDE_LESSONS: 'SqlInjectionAdvanced'
|
||||||
|
WEBWOLF_HOST: '{{ .Values.webwolf_server.name }}-wolf-{{ .Values.namespace }}{{ .Values.urlpostfix }}'
|
||||||
|
WEBWOLF_PORT: '80'
|
159
platformQuickStarts/helm/webgoat/templates/deployment.yaml
Normal file
159
platformQuickStarts/helm/webgoat/templates/deployment.yaml
Normal file
@ -0,0 +1,159 @@
|
|||||||
|
kind: Deployment
|
||||||
|
apiVersion: apps/v1
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/part-of: {{ .Values.webgoat_server.name }}
|
||||||
|
name: {{ .Values.webgoat_server.name }}
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: {{ .Values.webgoat_server.name }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: {{ .Values.webgoat_server.name }}
|
||||||
|
spec:
|
||||||
|
volumes:
|
||||||
|
- name: webgoat-volume-1
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: {{ .Values.webgoat_server.name }}-pvc
|
||||||
|
containers:
|
||||||
|
- resources:
|
||||||
|
limits:
|
||||||
|
memory: "2Gi"
|
||||||
|
cpu: "1"
|
||||||
|
requests:
|
||||||
|
memory: "1Gi"
|
||||||
|
cpu: "0.5"
|
||||||
|
name: webgoat
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
protocol: TCP
|
||||||
|
#livenessProbe:
|
||||||
|
# failureThreshold: 3
|
||||||
|
# periodSeconds: 10
|
||||||
|
# httpGet:
|
||||||
|
# path: /WebGoat
|
||||||
|
# port: 8080
|
||||||
|
#readinessProbe:
|
||||||
|
# failureThreshold: 3
|
||||||
|
# periodSeconds: 10
|
||||||
|
# initialDelaySeconds: 60
|
||||||
|
## httpGet:
|
||||||
|
# path: /WebGoat
|
||||||
|
# port: 8080
|
||||||
|
image: {{ .Values.webgoat_server.image }}
|
||||||
|
command:
|
||||||
|
- 'java'
|
||||||
|
args: ["-Duser.home=/home/webgoat",
|
||||||
|
"--add-opens","java.base/java.lang=ALL-UNNAMED",
|
||||||
|
"--add-opens","java.base/java.util=ALL-UNNAMED",
|
||||||
|
"--add-opens","java.base/java.lang.reflect=ALL-UNNAMED",
|
||||||
|
"--add-opens","java.base/java.text=ALL-UNNAMED",
|
||||||
|
"--add-opens","java.desktop/java.beans=ALL-UNNAMED",
|
||||||
|
"--add-opens","java.desktop/java.awt.font=ALL-UNNAMED",
|
||||||
|
"--add-opens","java.base/sun.nio.ch=ALL-UNNAMED",
|
||||||
|
"--add-opens","java.base/java.io=ALL-UNNAMED",
|
||||||
|
"-Djava.io.tmpdir=/home/webgoat/.webgoat-{{ .Chart.AppVersion }}",
|
||||||
|
"-Dfile.encoding=UTF-8",
|
||||||
|
"-jar","/home/webgoat/webgoat.jar",
|
||||||
|
"--server.address=0.0.0.0"]
|
||||||
|
imagePullPolicy: Always
|
||||||
|
volumeMounts:
|
||||||
|
- name: webgoat-volume-1
|
||||||
|
mountPath: /home/webgoat/.webgoat-{{ .Chart.AppVersion }}
|
||||||
|
terminationMessagePolicy: File
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: {{ .Values.webgoat_server.name }}-configmap
|
||||||
|
- secretRef:
|
||||||
|
name: {{ .Values.webgoat_server.name }}-secret
|
||||||
|
restartPolicy: Always
|
||||||
|
terminationGracePeriodSeconds: 30
|
||||||
|
dnsPolicy: ClusterFirst
|
||||||
|
securityContext: {}
|
||||||
|
schedulerName: default-scheduler
|
||||||
|
strategy:
|
||||||
|
type: RollingUpdate
|
||||||
|
rollingUpdate:
|
||||||
|
maxUnavailable: 25%
|
||||||
|
maxSurge: 25%
|
||||||
|
revisionHistoryLimit: 10
|
||||||
|
progressDeadlineSeconds: 600
|
||||||
|
---
|
||||||
|
kind: Deployment
|
||||||
|
apiVersion: apps/v1
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/part-of: {{ .Values.webgoat_server.name }}
|
||||||
|
name: {{ .Values.webwolf_server.name }}
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: {{ .Values.webwolf_server.name }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: {{ .Values.webwolf_server.name }}
|
||||||
|
spec:
|
||||||
|
volumes:
|
||||||
|
- name: webgoat-volume-1
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: {{ .Values.webgoat_server.name }}-pvc
|
||||||
|
containers:
|
||||||
|
- resources:
|
||||||
|
limits:
|
||||||
|
memory: "2Gi"
|
||||||
|
cpu: "1"
|
||||||
|
requests:
|
||||||
|
memory: "1Gi"
|
||||||
|
cpu: "0.5"
|
||||||
|
name: webwolf
|
||||||
|
ports:
|
||||||
|
- containerPort: 9090
|
||||||
|
protocol: TCP
|
||||||
|
#livenessProbe:
|
||||||
|
# failureThreshold: 3
|
||||||
|
# periodSeconds: 10
|
||||||
|
# httpGet:
|
||||||
|
# path: /WebWolf
|
||||||
|
# port: 9090
|
||||||
|
#readinessProbe:
|
||||||
|
#failureThreshold: 3
|
||||||
|
#periodSeconds: 10
|
||||||
|
#initialDelaySeconds: 100
|
||||||
|
#httpGet:
|
||||||
|
# path: /WebWolf
|
||||||
|
# port: 9090
|
||||||
|
image: {{ .Values.webwolf_server.image }}
|
||||||
|
command:
|
||||||
|
- 'java'
|
||||||
|
args: ["-Duser.home=/home/webgoat",
|
||||||
|
"-Djava.io.tmpdir=/home/webgoat/.webgoat-{{ .Chart.AppVersion }}",
|
||||||
|
"-Dfile.encoding=UTF-8",
|
||||||
|
"-jar","/home/webgoat/webwolf.jar",
|
||||||
|
"--server.address=0.0.0.0"]
|
||||||
|
imagePullPolicy: Always
|
||||||
|
volumeMounts:
|
||||||
|
- name: webgoat-volume-1
|
||||||
|
mountPath: /home/webgoat/.webgoat-{{ .Chart.AppVersion }}
|
||||||
|
terminationMessagePolicy: File
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: {{ .Values.webwolf_server.name }}-configmap
|
||||||
|
restartPolicy: Always
|
||||||
|
terminationGracePeriodSeconds: 30
|
||||||
|
dnsPolicy: ClusterFirst
|
||||||
|
securityContext: {}
|
||||||
|
schedulerName: default-scheduler
|
||||||
|
strategy:
|
||||||
|
type: RollingUpdate
|
||||||
|
rollingUpdate:
|
||||||
|
maxUnavailable: 25%
|
||||||
|
maxSurge: 25%
|
||||||
|
revisionHistoryLimit: 10
|
||||||
|
progressDeadlineSeconds: 600
|
@ -0,0 +1,13 @@
|
|||||||
|
kind: PersistentVolumeClaim
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: '{{ .Values.webgoat_server.name }}-pvc'
|
||||||
|
namespace: '{{ .Values.namespace }}'
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- '{{ .Values.accessMode }}'
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
|
#volumeName: pv0028
|
||||||
|
volumeMode: Filesystem
|
19
platformQuickStarts/helm/webgoat/templates/route-goat.yml
Normal file
19
platformQuickStarts/helm/webgoat/templates/route-goat.yml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
apiVersion: route.openshift.io/v1
|
||||||
|
kind: Route
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: {{ .Values.webgoat_server.name }}
|
||||||
|
name: {{ .Values.webgoat_server.name }}-goat
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
spec:
|
||||||
|
tls:
|
||||||
|
termination: edge
|
||||||
|
insecureEdgeTerminationPolicy: Redirect
|
||||||
|
path: /WebGoat
|
||||||
|
port:
|
||||||
|
targetPort: 8080
|
||||||
|
to:
|
||||||
|
kind: Service
|
||||||
|
name: {{ .Values.webgoat_server.name }}-service
|
||||||
|
weight: 100
|
||||||
|
wildcardPolicy: None
|
16
platformQuickStarts/helm/webgoat/templates/route-wolf.yml
Normal file
16
platformQuickStarts/helm/webgoat/templates/route-wolf.yml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: route.openshift.io/v1
|
||||||
|
kind: Route
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: {{ .Values.webwolf_server.name }}
|
||||||
|
name: {{ .Values.webwolf_server.name }}-wolf
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
spec:
|
||||||
|
path: /
|
||||||
|
port:
|
||||||
|
targetPort: 9090
|
||||||
|
to:
|
||||||
|
kind: Service
|
||||||
|
name: {{ .Values.webwolf_server.name }}-service
|
||||||
|
weight: 100
|
||||||
|
wildcardPolicy: None
|
7
platformQuickStarts/helm/webgoat/templates/secrets.yaml
Normal file
7
platformQuickStarts/helm/webgoat/templates/secrets.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ .Values.webgoat_server.name }}-secret
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
stringData:
|
||||||
|
ADMIN_PASSWORD: admin
|
39
platformQuickStarts/helm/webgoat/templates/service.yaml
Normal file
39
platformQuickStarts/helm/webgoat/templates/service.yaml
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: {{ .Values.webgoat_server.name }}
|
||||||
|
app.kubernetes.io/part-of: {{ .Values.webgoat_server.name }}
|
||||||
|
name: {{ .Values.webgoat_server.name }}-service
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: 8080-tcp
|
||||||
|
port: 8080
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 8080
|
||||||
|
- name: 9001-tcp
|
||||||
|
port: 9001
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 9001
|
||||||
|
selector:
|
||||||
|
app: {{ .Values.webgoat_server.name }}
|
||||||
|
sessionAffinity: None
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: {{ .Values.webwolf_server.name }}
|
||||||
|
app.kubernetes.io/part-of: {{ .Values.webgoat_server.name }}
|
||||||
|
name: {{ .Values.webwolf_server.name }}-service
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: 9090-tcp
|
||||||
|
port: 9090
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 9090
|
||||||
|
selector:
|
||||||
|
app: {{ .Values.webwolf_server.name }}
|
||||||
|
sessionAffinity: None
|
14
platformQuickStarts/helm/webgoat/values.yaml
Normal file
14
platformQuickStarts/helm/webgoat/values.yaml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
namespace: demo-project
|
||||||
|
urlpostfix: .apps-crc.testing
|
||||||
|
accessMode: ReadWriteMany
|
||||||
|
|
||||||
|
webgoat_server:
|
||||||
|
name: webgoat-1
|
||||||
|
image: docker.io/webgoat/goatandwolf:openshift
|
||||||
|
|
||||||
|
webwolf_server:
|
||||||
|
name: webwolf-1
|
||||||
|
image: docker.io/webgoat/goatandwolf:openshift
|
||||||
|
|
||||||
|
|
||||||
|
|
365
pom.xml
365
pom.xml
@ -1,11 +1,18 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.owasp.webgoat</groupId>
|
<groupId>org.owasp.webgoat</groupId>
|
||||||
<artifactId>webgoat-parent</artifactId>
|
<artifactId>webgoat-parent</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<version>8.0.0.M3</version>
|
<version>8.2.3-SNAPSHOT</version>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>2.5.4</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
<name>WebGoat Parent Pom</name>
|
<name>WebGoat Parent Pom</name>
|
||||||
<description>Parent Pom for the WebGoat Project. A deliberately insecure Web Application</description>
|
<description>Parent Pom for the WebGoat Project. A deliberately insecure Web Application</description>
|
||||||
@ -14,15 +21,9 @@
|
|||||||
|
|
||||||
<organization>
|
<organization>
|
||||||
<name>OWASP</name>
|
<name>OWASP</name>
|
||||||
<url>https://webgoat.github.io/</url>
|
<url>https://github.com/WebGoat/WebGoat/</url>
|
||||||
</organization>
|
</organization>
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
|
||||||
<version>1.5.5.RELEASE</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<licenses>
|
<licenses>
|
||||||
<license>
|
<license>
|
||||||
<name>GNU General Public License, version 2</name>
|
<name>GNU General Public License, version 2</name>
|
||||||
@ -50,6 +51,16 @@
|
|||||||
<name>Jason White</name>
|
<name>Jason White</name>
|
||||||
<email>jason.white@owasp.org</email>
|
<email>jason.white@owasp.org</email>
|
||||||
</developer>
|
</developer>
|
||||||
|
<developer>
|
||||||
|
<id>zubcevic</id>
|
||||||
|
<name>René Zubcevic</name>
|
||||||
|
<email>rene.zubcevic@owasp.org</email>
|
||||||
|
</developer>
|
||||||
|
<developer>
|
||||||
|
<id>aolle</id>
|
||||||
|
<name>Àngel Ollé Blázquez</name>
|
||||||
|
<email>angel@olleb.com</email>
|
||||||
|
</developer>
|
||||||
<developer>
|
<developer>
|
||||||
<id>jwayman</id>
|
<id>jwayman</id>
|
||||||
<name>Jeff Wayman</name>
|
<name>Jeff Wayman</name>
|
||||||
@ -100,70 +111,28 @@
|
|||||||
<url>https://github.com/WebGoat/WebGoat/issues</url>
|
<url>https://github.com/WebGoat/WebGoat/issues</url>
|
||||||
</issueManagement>
|
</issueManagement>
|
||||||
|
|
||||||
<ciManagement>
|
|
||||||
<system>Travis CI</system>
|
|
||||||
<url>https://travis-ci.org/WebGoat/WebGoat</url>
|
|
||||||
</ciManagement>
|
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
|
||||||
|
|
||||||
<!-- Use UTF-8 Encoding -->
|
<!-- Use UTF-8 Encoding -->
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
<!-- This build number will be ubdated by Travis-CI -->
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
<build.number>build</build.number>
|
|
||||||
|
|
||||||
<!-- Shared properties with plugins and version numbers across submodules-->
|
<!-- Shared properties with plugins and version numbers across submodules-->
|
||||||
<activation.version>1.1.1</activation.version>
|
<asciidoctorj.version>2.5.2</asciidoctorj.version>
|
||||||
<axis-ant.version>1.4</axis-ant.version>
|
|
||||||
<axis-jaxrpc.version>1.4</axis-jaxrpc.version>
|
|
||||||
<axis-saaj.version>1.4</axis-saaj.version>
|
|
||||||
<axis.version>1.4</axis.version>
|
|
||||||
<build-helper-maven-plugin.version>1.9.1</build-helper-maven-plugin.version>
|
|
||||||
<cobertura-maven-plugin.version>2.7</cobertura-maven-plugin.version>
|
|
||||||
<commons-collections.version>3.2.1</commons-collections.version>
|
<commons-collections.version>3.2.1</commons-collections.version>
|
||||||
<commons-digester.version>2.1</commons-digester.version>
|
<commons-lang3.version>3.12.0</commons-lang3.version>
|
||||||
<commons-discovery.version>0.5</commons-discovery.version>
|
<commons-io.version>2.6</commons-io.version>
|
||||||
<commons-fileupload.version>1.3.1</commons-fileupload.version>
|
<guava.version>30.1-jre</guava.version>
|
||||||
<commons-io.version>2.4</commons-io.version>
|
<lombok.version>1.18.20</lombok.version>
|
||||||
<commons-lang3.version>3.4</commons-lang3.version>
|
<wiremock.version>2.27.2</wiremock.version>
|
||||||
<coveralls-maven-plugin.version>4.0.0</coveralls-maven-plugin.version>
|
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
|
||||||
<gatling.version>2.2.5</gatling.version>
|
<maven-failsafe-plugin.version>2.22.0</maven-failsafe-plugin.version>
|
||||||
<gatling-plugin.version>2.2.4</gatling-plugin.version>
|
<maven-jar-plugin.version>3.1.2</maven-jar-plugin.version>
|
||||||
<guava.version>18.0</guava.version>
|
<maven-javadoc-plugin.version>3.1.1</maven-javadoc-plugin.version>
|
||||||
<h2.version>1.4.190</h2.version>
|
<maven-source-plugin.version>3.1.0</maven-source-plugin.version>
|
||||||
<hsqldb.version>2.3.2</hsqldb.version>
|
<maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
|
||||||
<j2h.version>1.3.1</j2h.version>
|
<java.version>17</java.version>
|
||||||
<jackson-core.version>2.6.3</jackson-core.version>
|
|
||||||
<jackson-databind.version>2.6.3</jackson-databind.version>
|
|
||||||
<javaee-api.version>6.0</javaee-api.version>
|
|
||||||
<javax.transaction-api.version>1.2</javax.transaction-api.version>
|
|
||||||
<jcl-over-slf4j.version>1.7.12</jcl-over-slf4j.version>
|
|
||||||
<jtds.version>1.3.1</jtds.version>
|
|
||||||
<junit.version>4.12</junit.version>
|
|
||||||
<mail-api.version>1.5.4</mail-api.version>
|
|
||||||
<maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>
|
|
||||||
<maven-failsafe-plugin.version>2.19</maven-failsafe-plugin.version>
|
|
||||||
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
|
|
||||||
<maven-jar-plugin.version>2.6</maven-jar-plugin.version>
|
|
||||||
<maven-javadoc-plugin.version>2.10.4</maven-javadoc-plugin.version>
|
|
||||||
<maven-release-plugin.version>2.5.2</maven-release-plugin.version>
|
|
||||||
<maven-source-plugin.version>3.0.1</maven-source-plugin.version>
|
|
||||||
<maven-surefire-plugin.version>2.19</maven-surefire-plugin.version>
|
|
||||||
<nexus-staging-maven-plugin.version>1.6.6</nexus-staging-maven-plugin.version>
|
|
||||||
<scala.version>2.11.7</scala.version>
|
|
||||||
<sauce_junit.version>2.1.20</sauce_junit.version>
|
|
||||||
<selenium-java.version>2.48.2</selenium-java.version>
|
|
||||||
<spring.security.version>3.2.4.RELEASE</spring.security.version>
|
|
||||||
<standard.version>1.1.2</standard.version>
|
|
||||||
<tiles.version>3.0.5</tiles.version>
|
|
||||||
<tomcat-catalina.version>7.0.65</tomcat-catalina.version>
|
|
||||||
<tomcat7-maven-plugin.version>2.3-SNAPSHOT</tomcat7-maven-plugin.version>
|
|
||||||
<versioneye-maven-plugin.version>3.5.1</versioneye-maven-plugin.version>
|
|
||||||
<wsdl4j.version>1.6.3</wsdl4j.version>
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
@ -171,127 +140,15 @@
|
|||||||
<module>webgoat-lessons</module>
|
<module>webgoat-lessons</module>
|
||||||
<module>webgoat-server</module>
|
<module>webgoat-server</module>
|
||||||
<module>webwolf</module>
|
<module>webwolf</module>
|
||||||
|
<module>webgoat-integration-tests</module>
|
||||||
|
<module>docker</module><!-- copy required jars in preparation of docker all-in-one build -->
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<distributionManagement>
|
|
||||||
<snapshotRepository>
|
|
||||||
<id>ossrh</id>
|
|
||||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
|
||||||
</snapshotRepository>
|
|
||||||
<repository>
|
|
||||||
<id>ossrh</id>
|
|
||||||
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
|
||||||
</repository>
|
|
||||||
</distributionManagement>
|
|
||||||
|
|
||||||
<pluginRepositories>
|
|
||||||
<pluginRepository>
|
|
||||||
<id>apache.snapshots</id>
|
|
||||||
<url>http://repository.apache.org/snapshots/</url>
|
|
||||||
<!-- The releases element here is due to an issue in Maven 2.0 that will be
|
|
||||||
fixed in future releases. This should be able to be disabled altogether. -->
|
|
||||||
<releases>
|
|
||||||
<updatePolicy>daily</updatePolicy>
|
|
||||||
</releases>
|
|
||||||
<snapshots>
|
|
||||||
<updatePolicy>daily</updatePolicy>
|
|
||||||
</snapshots>
|
|
||||||
</pluginRepository>
|
|
||||||
</pluginRepositories>
|
|
||||||
|
|
||||||
<profiles>
|
|
||||||
<profile>
|
|
||||||
<id>release</id>
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.owasp.webgoat.lesson</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>dist</artifactId>
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
<version>1.0</version>
|
|
||||||
<type>zip</type>
|
|
||||||
<scope>provided</scope>
|
|
||||||
<classifier>plugins</classifier>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-dependency-plugin</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>unpack-lesson</id>
|
|
||||||
<goals>
|
|
||||||
<goal>unpack-dependencies</goal>
|
|
||||||
</goals>
|
|
||||||
<phase>generate-resources</phase>
|
|
||||||
<configuration>
|
|
||||||
<outputDirectory>${project.basedir}/webgoat-container/src/main/webapp/plugin_lessons</outputDirectory>
|
|
||||||
<includeArtifactIds>dist</includeArtifactIds>
|
|
||||||
<includes>*.jar</includes>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.sonatype.plugins</groupId>
|
|
||||||
<artifactId>nexus-staging-maven-plugin</artifactId>
|
|
||||||
<version>${nexus-staging-maven-plugin.version}</version>
|
|
||||||
<extensions>true</extensions>
|
|
||||||
<configuration>
|
|
||||||
<serverId>ossrh</serverId>
|
|
||||||
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
|
|
||||||
<autoReleaseAfterClose>false</autoReleaseAfterClose>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
|
||||||
<version>${maven-source-plugin.version}</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>attach-sources</id>
|
|
||||||
<goals>
|
|
||||||
<goal>jar-no-fork</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
|
||||||
<version>${maven-javadoc-plugin.version}</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>attach-javadocs</id>
|
|
||||||
<goals>
|
|
||||||
<goal>jar</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-gpg-plugin</artifactId>
|
|
||||||
<version>${maven-gpg-plugin.version}</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>sign-artifacts</id>
|
|
||||||
<phase>verify</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>sign</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<keyname>WebGoat</keyname>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</profile>
|
|
||||||
</profiles>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
@ -303,52 +160,132 @@
|
|||||||
<artifactId>commons-exec</artifactId>
|
<artifactId>commons-exec</artifactId>
|
||||||
<version>1.3</version>
|
<version>1.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.xml.bind</groupId>
|
||||||
|
<artifactId>jaxb-api</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-release-plugin</artifactId>
|
|
||||||
<version>${maven-release-plugin.version}</version>
|
|
||||||
<configuration>
|
|
||||||
<autoVersionSubmodules>true</autoVersionSubmodules>
|
|
||||||
<useReleaseProfile>false</useReleaseProfile>
|
|
||||||
<releaseProfiles>release</releaseProfiles>
|
|
||||||
<tagNameFormat>@{project.version}</tagNameFormat>
|
|
||||||
<goals>deploy</goals>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.eluder.coveralls</groupId>
|
|
||||||
<artifactId>coveralls-maven-plugin</artifactId>
|
|
||||||
<version>${coveralls-maven-plugin.version}</version>
|
|
||||||
<configuration>
|
|
||||||
<repoToken />
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<artifactId>cobertura-maven-plugin</artifactId>
|
<artifactId>flatten-maven-plugin</artifactId>
|
||||||
<version>${cobertura-maven-plugin.version}</version>
|
<version>1.2.5</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<check />
|
</configuration>
|
||||||
<format>xml</format>
|
<executions>
|
||||||
<maxmem>256m</maxmem>
|
<execution>
|
||||||
<!-- aggregated reports for multi-module projects -->
|
<id>flatten</id>
|
||||||
<aggregate>true</aggregate>
|
<phase>process-resources</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>flatten</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>${maven-compiler-plugin.version}</version>
|
||||||
|
<configuration>
|
||||||
|
<source>15</source>
|
||||||
|
<target>15</target>
|
||||||
|
<encoding>UTF-8</encoding>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>com.versioneye</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>versioneye-maven-plugin</artifactId>
|
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||||
<version>${versioneye-maven-plugin.version}</version>
|
<version>3.1.2</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<apiKey>a1e4a9da4ed34ee44cab</apiKey>
|
<encoding>UTF-8</encoding>
|
||||||
<projectId>562da95be346d7000e0369ac</projectId>
|
<consoleOutput>true</consoleOutput>
|
||||||
|
<failsOnError>true</failsOnError>
|
||||||
|
<configLocation>config/checkstyle/checkstyle.xml</configLocation>
|
||||||
|
<suppressionsLocation>config/checkstyle/suppressions.xml</suppressionsLocation>
|
||||||
|
<suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-pmd-plugin</artifactId>
|
||||||
|
<version>3.14.0</version>
|
||||||
|
<configuration>
|
||||||
|
<targetJdk>15</targetJdk>
|
||||||
|
<failurePriority>1</failurePriority><!-- 5 means fail even on the lowest priority, 0 means never fail -->
|
||||||
|
<rulesets>
|
||||||
|
<!--suppress UnresolvedMavenProperty -->
|
||||||
|
<ruleset>${maven.multiModuleProjectDirectory}/config/pmd/pmd-ruleset.xml</ruleset>
|
||||||
|
</rulesets>
|
||||||
|
<failOnViolation>true</failOnViolation>
|
||||||
|
<printFailingErrors>true</printFailingErrors>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>check</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>owasp</id>
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>false</activeByDefault>
|
||||||
|
</activation>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.owasp</groupId>
|
||||||
|
<artifactId>dependency-check-maven</artifactId>
|
||||||
|
<version>6.1.3</version>
|
||||||
|
<configuration>
|
||||||
|
<failBuildOnCVSS>7</failBuildOnCVSS>
|
||||||
|
<skipProvidedScope>true</skipProvidedScope>
|
||||||
|
<skipRuntimeScope>true</skipRuntimeScope>
|
||||||
|
<suppressionFiles>
|
||||||
|
<!--suppress UnresolvedMavenProperty -->
|
||||||
|
<suppressionFile>
|
||||||
|
${maven.multiModuleProjectDirectory}/config/dependency-check/project-suppression.xml
|
||||||
|
</suppressionFile>
|
||||||
|
</suppressionFiles>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>check</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>central</id>
|
||||||
|
<url>https://repo.maven.apache.org/maven2</url>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
<pluginRepositories>
|
||||||
|
<pluginRepository>
|
||||||
|
<id>central</id>
|
||||||
|
<url>https://repo.maven.apache.org/maven2</url>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
|
</pluginRepository>
|
||||||
|
</pluginRepositories>
|
||||||
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
docker login -u $DOCKER_USER -p $DOCKER_PASS
|
|
||||||
export REPO=webgoat/webgoat-8.0
|
|
||||||
|
|
||||||
cd webgoat-server
|
|
||||||
ls target/
|
|
||||||
|
|
||||||
if [ "${BRANCH}" == "master" ] && [ ! -z "${TRAVIS_TAG}" ]; then
|
|
||||||
# If we push a tag to master this will update the LATEST Docker image and tag with the version number
|
|
||||||
docker build --build-arg webgoat_version=${TRAVIS_TAG:1} -f Dockerfile -t $REPO:latest -t $REPO:${TRAVIS_TAG} .
|
|
||||||
docker push $REPO
|
|
||||||
elif [ ! -z "${TRAVIS_TAG}" ]; then
|
|
||||||
# Creating a tag build we push it to Docker with that tag
|
|
||||||
docker build --build-arg webgoat_version=${TRAVIS_TAG:1} -f Dockerfile -t $REPO:${TRAVIS_TAG} .
|
|
||||||
docker push $REPO
|
|
||||||
elif [ "${BRANCH}" == "develop" ]; then
|
|
||||||
docker build -f Dockerfile -t $REPO:snapshot .
|
|
||||||
docker push $REPO
|
|
||||||
else
|
|
||||||
echo "Skipping releasing to DockerHub because it is a build of branch ${BRANCH}"
|
|
||||||
fi
|
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Before Width: | Height: | Size: 16 KiB |
@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
<groupId>org.owasp.webgoat</groupId>
|
|
||||||
<name>webgoat-container</name>
|
<name>webgoat-container</name>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>webgoat-container</artifactId>
|
<artifactId>webgoat-container</artifactId>
|
||||||
@ -10,92 +9,19 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.owasp.webgoat</groupId>
|
<groupId>org.owasp.webgoat</groupId>
|
||||||
<artifactId>webgoat-parent</artifactId>
|
<artifactId>webgoat-parent</artifactId>
|
||||||
<version>8.0.0.M3</version>
|
<version>8.2.3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<profiles>
|
|
||||||
<profile>
|
|
||||||
<id>performance</id>
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
|
||||||
<groupId>io.gatling</groupId>
|
|
||||||
<artifactId>gatling-maven-plugin</artifactId>
|
|
||||||
<version>${gatling-plugin.version}</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>execute</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</profile>
|
|
||||||
|
|
||||||
</profiles>
|
|
||||||
|
|
||||||
<dependencyManagement>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>de.flapdoodle.embed</groupId>
|
|
||||||
<artifactId>de.flapdoodle.embed.mongo</artifactId>
|
|
||||||
<version>2.0.0</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</dependencyManagement>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<resources>
|
|
||||||
<resource>
|
|
||||||
<directory>src/main/java</directory>
|
|
||||||
</resource>
|
|
||||||
<resource>
|
|
||||||
<directory>src/main/resources</directory>
|
|
||||||
<filtering>true</filtering>
|
|
||||||
<includes>
|
|
||||||
<include>**/application.properties</include>
|
|
||||||
</includes>
|
|
||||||
</resource>
|
|
||||||
<resource>
|
|
||||||
<directory>src/main/resources</directory>
|
|
||||||
</resource>
|
|
||||||
</resources>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
|
||||||
<version>2.6</version>
|
|
||||||
<configuration>
|
|
||||||
<delimiters>
|
|
||||||
<delimiter>@</delimiter>
|
|
||||||
</delimiters>
|
|
||||||
<useDefaultDelimiters>false</useDefaultDelimiters>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<version>${maven-compiler-plugin.version}</version>
|
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
<encoding>ISO-8859-1</encoding>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<version>${maven-surefire-plugin.version}</version>
|
<version>${maven-surefire-plugin.version}</version>
|
||||||
<configuration>
|
|
||||||
<forkMode>never</forkMode>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
<version>3.0.2</version>
|
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<goals>
|
<goals>
|
||||||
@ -109,43 +35,39 @@
|
|||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
<artifactId>spring-boot-starter-undertow</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.flywaydb</groupId>
|
||||||
|
<artifactId>flyway-core</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.asciidoctor</groupId>
|
<groupId>org.asciidoctor</groupId>
|
||||||
<artifactId>asciidoctorj</artifactId>
|
<artifactId>asciidoctorj</artifactId>
|
||||||
<version>1.5.4</version>
|
<version>${asciidoctorj.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-data-mongodb</artifactId>
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>commons-lang3</artifactId>
|
<artifactId>commons-lang3</artifactId>
|
||||||
<version>${commons-lang3.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.google.guava</groupId>
|
|
||||||
<artifactId>guava</artifactId>
|
|
||||||
<version>${guava.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.gatling.highcharts</groupId>
|
|
||||||
<artifactId>gatling-charts-highcharts</artifactId>
|
|
||||||
<version>${gatling.version}</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
@ -157,34 +79,13 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.thymeleaf.extras</groupId>
|
<groupId>org.thymeleaf.extras</groupId>
|
||||||
<artifactId>thymeleaf-extras-springsecurity4</artifactId>
|
<artifactId>thymeleaf-extras-springsecurity5</artifactId>
|
||||||
<version>2.1.2.RELEASE</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax.activation</groupId>
|
|
||||||
<artifactId>activation</artifactId>
|
|
||||||
<version>${activation.version}</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hsqldb</groupId>
|
<groupId>org.hsqldb</groupId>
|
||||||
<artifactId>hsqldb</artifactId>
|
<artifactId>hsqldb</artifactId>
|
||||||
<version>${hsqldb.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax.transaction</groupId>
|
|
||||||
<artifactId>javax.transaction-api</artifactId>
|
|
||||||
<version>${javax.transaction-api.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.scala-lang</groupId>
|
|
||||||
<artifactId>scala-compiler</artifactId>
|
|
||||||
<version>${scala.version}</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<!-- ************* END spring MVC and related dependencies ************** -->
|
|
||||||
<!-- ************* START: Dependencies for Unit and Integration Testing ************** -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
@ -193,24 +94,8 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.security</groupId>
|
<groupId>org.springframework.security</groupId>
|
||||||
<artifactId>spring-security-test</artifactId>
|
<artifactId>spring-security-test</artifactId>
|
||||||
<version>4.1.3.RELEASE</version>
|
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<version>${junit.version}</version>
|
|
||||||
<type>jar</type>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.fakemongo</groupId>
|
|
||||||
<artifactId>fongo</artifactId>
|
|
||||||
<version>2.1.0</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<!-- ************* END: Dependencies for Unit and Integration Testing ************** -->
|
|
||||||
<!-- ************* END: <dependencies> ************** -->
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* This file is part of WebGoat, an Open Web Application Security Project
|
* This file is part of WebGoat, an Open Web Application Security Project
|
||||||
* utility. For details, please see http://www.owasp.org/
|
* utility. For details, please see http://www.owasp.org/
|
||||||
* <p>
|
* <p>
|
||||||
* Copyright (c) 2002 - 20014 Bruce Mayhew
|
* Copyright (c) 2002 - 2014 Bruce Mayhew
|
||||||
* <p>
|
* <p>
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
* the terms of the GNU General Public License as published by the Free Software
|
* the terms of the GNU General Public License as published by the Free Software
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* This file is part of WebGoat, an Open Web Application Security Project utility. For details,
|
* This file is part of WebGoat, an Open Web Application Security Project utility. For details,
|
||||||
* please see http://www.owasp.org/
|
* please see http://www.owasp.org/
|
||||||
* <p>
|
* <p>
|
||||||
* Copyright (c) 2002 - 20014 Bruce Mayhew
|
* Copyright (c) 2002 - 2014 Bruce Mayhew
|
||||||
* <p>
|
* <p>
|
||||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||||
* GNU General Public License as published by the Free Software Foundation; either version 2 of the
|
* GNU General Public License as published by the Free Software Foundation; either version 2 of the
|
||||||
@ -28,18 +28,26 @@
|
|||||||
* @version $Id: $Id
|
* @version $Id: $Id
|
||||||
* @since December 12, 2015
|
* @since December 12, 2015
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.owasp.webgoat;
|
package org.owasp.webgoat;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
import org.asciidoctor.Asciidoctor;
|
import org.asciidoctor.Asciidoctor;
|
||||||
|
import org.asciidoctor.extension.JavaExtensionRegistry;
|
||||||
|
import org.owasp.webgoat.asciidoc.*;
|
||||||
import org.owasp.webgoat.i18n.Language;
|
import org.owasp.webgoat.i18n.Language;
|
||||||
import org.thymeleaf.TemplateProcessingParameters;
|
import org.thymeleaf.IEngineConfiguration;
|
||||||
import org.thymeleaf.resourceresolver.IResourceResolver;
|
import org.thymeleaf.templateresolver.FileTemplateResolver;
|
||||||
import org.thymeleaf.templateresolver.TemplateResolver;
|
import org.thymeleaf.templateresource.ITemplateResource;
|
||||||
|
import org.thymeleaf.templateresource.StringTemplateResource;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.io.StringWriter;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import static org.asciidoctor.Asciidoctor.Factory.create;
|
import static org.asciidoctor.Asciidoctor.Factory.create;
|
||||||
|
|
||||||
@ -50,7 +58,8 @@ import static org.asciidoctor.Asciidoctor.Factory.create;
|
|||||||
* <div th:replace="doc:AccessControlMatrix_plan.adoc"></div>
|
* <div th:replace="doc:AccessControlMatrix_plan.adoc"></div>
|
||||||
* </code>
|
* </code>
|
||||||
*/
|
*/
|
||||||
public class AsciiDoctorTemplateResolver extends TemplateResolver {
|
@Slf4j
|
||||||
|
public class AsciiDoctorTemplateResolver extends FileTemplateResolver {
|
||||||
|
|
||||||
private static final Asciidoctor asciidoctor = create();
|
private static final Asciidoctor asciidoctor = create();
|
||||||
private static final String PREFIX = "doc:";
|
private static final String PREFIX = "doc:";
|
||||||
@ -58,29 +67,32 @@ public class AsciiDoctorTemplateResolver extends TemplateResolver {
|
|||||||
|
|
||||||
public AsciiDoctorTemplateResolver(Language language) {
|
public AsciiDoctorTemplateResolver(Language language) {
|
||||||
this.language = language;
|
this.language = language;
|
||||||
|
setResolvablePatterns(Set.of(PREFIX + "*"));
|
||||||
setResourceResolver(new AdocResourceResolver());
|
|
||||||
setResolvablePatterns(Sets.newHashSet(PREFIX + "*"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String computeResourceName(TemplateProcessingParameters params) {
|
protected ITemplateResource computeTemplateResource(IEngineConfiguration configuration, String ownerTemplate, String template, String resourceName, String characterEncoding, Map<String, Object> templateResolutionAttributes) {
|
||||||
String templateName = params.getTemplateName();
|
var templateName = resourceName.substring(PREFIX.length());
|
||||||
return templateName.substring(PREFIX.length());
|
try (InputStream is = readInputStreamOrFallbackToEnglish(templateName, language)) {
|
||||||
}
|
if (is == null) {
|
||||||
|
log.warn("Resource name: {} not found, did you add the adoc file?", templateName);
|
||||||
|
return new StringTemplateResource("");
|
||||||
|
} else {
|
||||||
|
JavaExtensionRegistry extensionRegistry = asciidoctor.javaExtensionRegistry();
|
||||||
|
extensionRegistry.inlineMacro("webWolfLink", WebWolfMacro.class);
|
||||||
|
extensionRegistry.inlineMacro("webWolfRootLink", WebWolfRootMacro.class);
|
||||||
|
extensionRegistry.inlineMacro("webGoatVersion", WebGoatVersionMacro.class);
|
||||||
|
extensionRegistry.inlineMacro("webGoatTempDir", WebGoatTmpDirMacro.class);
|
||||||
|
extensionRegistry.inlineMacro("operatingSystem", OperatingSystemMacro.class);
|
||||||
|
extensionRegistry.inlineMacro("username", UsernameMacro.class);
|
||||||
|
|
||||||
private class AdocResourceResolver implements IResourceResolver {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public InputStream getResourceAsStream(TemplateProcessingParameters params, String resourceName) {
|
|
||||||
InputStream is = readInputStreamOrFallbackToEnglish(resourceName, language);
|
|
||||||
try {
|
|
||||||
StringWriter writer = new StringWriter();
|
StringWriter writer = new StringWriter();
|
||||||
asciidoctor.convert(new InputStreamReader(is), writer, createAttributes());
|
asciidoctor.convert(new InputStreamReader(is), writer, createAttributes());
|
||||||
return new ByteArrayInputStream(writer.getBuffer().toString().getBytes());
|
return new StringTemplateResource(writer.getBuffer().toString());
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
//no html yet
|
//no html yet
|
||||||
return new ByteArrayInputStream(new byte[0]);
|
return new StringTemplateResource("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,20 +113,14 @@ public class AsciiDoctorTemplateResolver extends TemplateResolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Map<String, Object> createAttributes() {
|
private Map<String, Object> createAttributes() {
|
||||||
Map<String, Object> attributes = Maps.newHashMap();
|
Map<String, Object> attributes = new HashMap<>();
|
||||||
attributes.put("source-highlighter", "coderay");
|
attributes.put("source-highlighter", "coderay");
|
||||||
attributes.put("backend", "xhtml");
|
attributes.put("backend", "xhtml");
|
||||||
|
attributes.put("icons", org.asciidoctor.Attributes.FONT_ICONS);
|
||||||
|
|
||||||
Map<String, Object> options = Maps.newHashMap();
|
Map<String, Object> options = new HashMap<>();
|
||||||
options.put("attributes", attributes);
|
options.put("attributes", attributes);
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName() {
|
|
||||||
return "adocResourceResolver";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
package org.owasp.webgoat;
|
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.util.FileSystemUtils;
|
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author nbaars
|
|
||||||
* @since 4/15/17.
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Configuration
|
|
||||||
@ConditionalOnExpression("'${webgoat.clean}' == 'true'")
|
|
||||||
public class CleanupLocalProgressFiles {
|
|
||||||
|
|
||||||
@Value("${webgoat.server.directory}")
|
|
||||||
private String webgoatHome;
|
|
||||||
|
|
||||||
@PostConstruct
|
|
||||||
public void clean() {
|
|
||||||
File dir = new File(webgoatHome);
|
|
||||||
//do it safe, check whether the subdir mongodb is available as subdirectory
|
|
||||||
File[] mongoDir = dir.listFiles(f -> f.isDirectory() && f.getName().contains("mongodb"));
|
|
||||||
if (mongoDir != null && mongoDir.length == 1) {
|
|
||||||
FileSystemUtils.deleteRecursively(dir);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,56 @@
|
|||||||
|
package org.owasp.webgoat;
|
||||||
|
|
||||||
|
import org.flywaydb.core.Flyway;
|
||||||
|
import org.flywaydb.core.api.configuration.FluentConfiguration;
|
||||||
|
import org.owasp.webgoat.service.RestartLessonService;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class DatabaseConfiguration {
|
||||||
|
|
||||||
|
private String driverClassName;
|
||||||
|
|
||||||
|
public DatabaseConfiguration(@Value("${spring.datasource.driver-class-name}") String driverClassName) {
|
||||||
|
this.driverClassName = driverClassName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define 2 Flyway instances, 1 for WebGoat itself which it uses for internal storage like users and 1 for lesson
|
||||||
|
* specific tables we use. This way we clean the data in the lesson database quite easily see {@link RestartLessonService#restartLesson()}
|
||||||
|
* for how we clean the lesson related tables.
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Bean(initMethod = "migrate")
|
||||||
|
public Flyway flyWayContainer(DataSource dataSource) {
|
||||||
|
return Flyway
|
||||||
|
.configure()
|
||||||
|
.configuration(Map.of("driver", driverClassName))
|
||||||
|
.dataSource(dataSource)
|
||||||
|
.schemas("container")
|
||||||
|
.locations("db/container")
|
||||||
|
.load();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Function<String, Flyway> flywayLessons(LessonDataSource lessonDataSource) {
|
||||||
|
return schema -> Flyway
|
||||||
|
.configure()
|
||||||
|
.configuration(Map.of("driver", driverClassName))
|
||||||
|
.schemas(schema)
|
||||||
|
.dataSource(lessonDataSource)
|
||||||
|
.load();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public LessonDataSource lessonDataSource(DataSource dataSource) {
|
||||||
|
return new LessonDataSource(dataSource);
|
||||||
|
}
|
||||||
|
}
|
@ -18,7 +18,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
* This file is part of WebGoat, an Open Web Application Security Project
|
* This file is part of WebGoat, an Open Web Application Security Project
|
||||||
* utility. For details, please see http://www.owasp.org/
|
* utility. For details, please see http://www.owasp.org/
|
||||||
* <p>
|
* <p>
|
||||||
* Copyright (c) 2002 - 20014 Bruce Mayhew
|
* Copyright (c) 2002 - 2014 Bruce Mayhew
|
||||||
* <p>
|
* <p>
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
* the terms of the GNU General Public License as published by the Free Software
|
* the terms of the GNU General Public License as published by the Free Software
|
||||||
|
@ -0,0 +1,70 @@
|
|||||||
|
package org.owasp.webgoat;
|
||||||
|
|
||||||
|
import org.owasp.webgoat.lessons.LessonConnectionInvocationHandler;
|
||||||
|
import org.springframework.jdbc.datasource.ConnectionProxy;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
import java.lang.reflect.Proxy;
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.sql.SQLFeatureNotSupportedException;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
public class LessonDataSource implements DataSource {
|
||||||
|
|
||||||
|
private final DataSource originalDataSource;
|
||||||
|
|
||||||
|
public LessonDataSource(DataSource dataSource) {
|
||||||
|
this.originalDataSource = dataSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Connection getConnection() throws SQLException {
|
||||||
|
var targetConnection = originalDataSource.getConnection();
|
||||||
|
return (Connection) Proxy.newProxyInstance(
|
||||||
|
ConnectionProxy.class.getClassLoader(),
|
||||||
|
new Class[]{ConnectionProxy.class},
|
||||||
|
new LessonConnectionInvocationHandler(targetConnection));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Connection getConnection(String username, String password) throws SQLException {
|
||||||
|
return originalDataSource.getConnection(username, password);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PrintWriter getLogWriter() throws SQLException {
|
||||||
|
return originalDataSource.getLogWriter();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setLogWriter(PrintWriter out) throws SQLException {
|
||||||
|
originalDataSource.setLogWriter(out);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setLoginTimeout(int seconds) throws SQLException {
|
||||||
|
originalDataSource.setLoginTimeout(seconds);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getLoginTimeout() throws SQLException {
|
||||||
|
return originalDataSource.getLoginTimeout();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Logger getParentLogger() throws SQLFeatureNotSupportedException {
|
||||||
|
return originalDataSource.getParentLogger();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> T unwrap(Class<T> clazz) throws SQLException {
|
||||||
|
return originalDataSource.unwrap(clazz);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isWrapperFor(Class<?> clazz) throws SQLException {
|
||||||
|
return originalDataSource.isWrapperFor(clazz);
|
||||||
|
}
|
||||||
|
}
|
@ -1,48 +1,47 @@
|
|||||||
/**
|
/**
|
||||||
* ************************************************************************************************
|
* ************************************************************************************************
|
||||||
*
|
* <p>
|
||||||
*
|
* <p>
|
||||||
* This file is part of WebGoat, an Open Web Application Security Project utility. For details,
|
* This file is part of WebGoat, an Open Web Application Security Project utility. For details,
|
||||||
* please see http://www.owasp.org/
|
* please see http://www.owasp.org/
|
||||||
*
|
* <p>
|
||||||
* Copyright (c) 2002 - 20014 Bruce Mayhew
|
* Copyright (c) 2002 - 2014 Bruce Mayhew
|
||||||
*
|
* <p>
|
||||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||||
* GNU General Public License as published by the Free Software Foundation; either version 2 of the
|
* GNU General Public License as published by the Free Software Foundation; either version 2 of the
|
||||||
* License, or (at your option) any later version.
|
* License, or (at your option) any later version.
|
||||||
*
|
* <p>
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
||||||
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* General Public License for more details.
|
* General Public License for more details.
|
||||||
*
|
* <p>
|
||||||
* You should have received a copy of the GNU General Public License along with this program; if
|
* You should have received a copy of the GNU General Public License along with this program; if
|
||||||
* not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
* not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||||
* 02111-1307, USA.
|
* 02111-1307, USA.
|
||||||
*
|
* <p>
|
||||||
* Getting Source ==============
|
* Getting Source ==============
|
||||||
*
|
* <p>
|
||||||
* Source for this application is maintained at https://github.com/WebGoat/WebGoat, a repository for free software
|
* Source for this application is maintained at https://github.com/WebGoat/WebGoat, a repository for free software
|
||||||
* projects.
|
* projects.
|
||||||
*
|
*
|
||||||
* @author WebGoat
|
* @author WebGoat
|
||||||
* @since October 28, 2003
|
|
||||||
* @version $Id: $Id
|
* @version $Id: $Id
|
||||||
|
* @since October 28, 2003
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.owasp.webgoat;
|
package org.owasp.webgoat;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
import com.google.common.io.ByteStreams;
|
|
||||||
import lombok.SneakyThrows;
|
|
||||||
import org.springframework.core.io.ResourceLoader;
|
import org.springframework.core.io.ResourceLoader;
|
||||||
import org.thymeleaf.TemplateProcessingParameters;
|
import org.thymeleaf.IEngineConfiguration;
|
||||||
import org.thymeleaf.resourceresolver.IResourceResolver;
|
import org.thymeleaf.templateresolver.FileTemplateResolver;
|
||||||
import org.thymeleaf.templateresolver.TemplateResolver;
|
import org.thymeleaf.templateresource.ITemplateResource;
|
||||||
|
import org.thymeleaf.templateresource.StringTemplateResource;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.IOException;
|
||||||
import java.io.File;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.io.InputStream;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dynamically resolve a lesson. In the html file this can be invoked as:
|
* Dynamically resolve a lesson. In the html file this can be invoked as:
|
||||||
@ -53,42 +52,29 @@ import java.util.Map;
|
|||||||
*
|
*
|
||||||
* Thymeleaf will invoke this resolver based on the prefix and this implementation will resolve the html in the plugins directory
|
* Thymeleaf will invoke this resolver based on the prefix and this implementation will resolve the html in the plugins directory
|
||||||
*/
|
*/
|
||||||
public class LessonTemplateResolver extends TemplateResolver {
|
public class LessonTemplateResolver extends FileTemplateResolver {
|
||||||
|
|
||||||
private final static String PREFIX = "lesson:";
|
private static final String PREFIX = "lesson:";
|
||||||
private final File pluginTargetDirectory;
|
|
||||||
private ResourceLoader resourceLoader;
|
private ResourceLoader resourceLoader;
|
||||||
private Map<String, byte[]> resources = Maps.newHashMap();
|
private Map<String, byte[]> resources = new HashMap<>();
|
||||||
|
|
||||||
public LessonTemplateResolver(File pluginTargetDirectory, ResourceLoader resourceLoader) {
|
public LessonTemplateResolver(ResourceLoader resourceLoader) {
|
||||||
this.pluginTargetDirectory = pluginTargetDirectory;
|
|
||||||
this.resourceLoader = resourceLoader;
|
this.resourceLoader = resourceLoader;
|
||||||
setResourceResolver(new LessonResourceResolver());
|
setResolvablePatterns(Set.of(PREFIX + "*"));
|
||||||
setResolvablePatterns(Sets.newHashSet(PREFIX + "*"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String computeResourceName(TemplateProcessingParameters params) {
|
protected ITemplateResource computeTemplateResource(IEngineConfiguration configuration, String ownerTemplate, String template, String resourceName, String characterEncoding, Map<String, Object> templateResolutionAttributes) {
|
||||||
String templateName = params.getTemplateName();
|
var templateName = resourceName.substring(PREFIX.length());;
|
||||||
return templateName.substring(PREFIX.length());
|
byte[] resource = resources.get(templateName);
|
||||||
}
|
|
||||||
|
|
||||||
private class LessonResourceResolver implements IResourceResolver {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SneakyThrows
|
|
||||||
public InputStream getResourceAsStream(TemplateProcessingParameters params, String resourceName) {
|
|
||||||
byte[] resource = resources.get(resourceName);
|
|
||||||
if (resource == null) {
|
if (resource == null) {
|
||||||
resource = ByteStreams.toByteArray(resourceLoader.getResource("classpath:/html/" + resourceName + ".html").getInputStream());
|
try {
|
||||||
|
resource = resourceLoader.getResource("classpath:/html/" + templateName + ".html").getInputStream().readAllBytes();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
resources.put(resourceName, resource);
|
resources.put(resourceName, resource);
|
||||||
}
|
}
|
||||||
return new ByteArrayInputStream(resource);
|
return new StringTemplateResource(new String(resource, StandardCharsets.UTF_8));
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName() {
|
|
||||||
return "lessonResourceResolver";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,7 +5,7 @@
|
|||||||
* This file is part of WebGoat, an Open Web Application Security Project utility. For details,
|
* This file is part of WebGoat, an Open Web Application Security Project utility. For details,
|
||||||
* please see http://www.owasp.org/
|
* please see http://www.owasp.org/
|
||||||
* <p>
|
* <p>
|
||||||
* Copyright (c) 2002 - 20014 Bruce Mayhew
|
* Copyright (c) 2002 - 2014 Bruce Mayhew
|
||||||
* <p>
|
* <p>
|
||||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||||
* GNU General Public License as published by the Free Software Foundation; either version 2 of the
|
* GNU General Public License as published by the Free Software Foundation; either version 2 of the
|
||||||
@ -28,41 +28,40 @@
|
|||||||
* @version $Id: $Id
|
* @version $Id: $Id
|
||||||
* @since October 28, 2003
|
* @since October 28, 2003
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.owasp.webgoat;
|
package org.owasp.webgoat;
|
||||||
|
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
import org.owasp.webgoat.i18n.Language;
|
import org.owasp.webgoat.i18n.Language;
|
||||||
import org.owasp.webgoat.i18n.Messages;
|
import org.owasp.webgoat.i18n.Messages;
|
||||||
import org.owasp.webgoat.i18n.PluginMessages;
|
import org.owasp.webgoat.i18n.PluginMessages;
|
||||||
import org.owasp.webgoat.session.Course;
|
|
||||||
import org.owasp.webgoat.session.LabelDebugger;
|
import org.owasp.webgoat.session.LabelDebugger;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.core.io.ResourceLoader;
|
import org.springframework.core.io.ResourceLoader;
|
||||||
import org.springframework.web.servlet.LocaleResolver;
|
import org.springframework.web.servlet.LocaleResolver;
|
||||||
|
import org.springframework.web.servlet.ViewResolver;
|
||||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||||
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
|
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
import org.springframework.web.servlet.i18n.SessionLocaleResolver;
|
import org.springframework.web.servlet.i18n.SessionLocaleResolver;
|
||||||
import org.thymeleaf.extras.springsecurity4.dialect.SpringSecurityDialect;
|
import org.thymeleaf.TemplateEngine;
|
||||||
import org.thymeleaf.spring4.SpringTemplateEngine;
|
import org.thymeleaf.extras.springsecurity5.dialect.SpringSecurityDialect;
|
||||||
import org.thymeleaf.spring4.templateresolver.SpringResourceTemplateResolver;
|
import org.thymeleaf.spring5.SpringTemplateEngine;
|
||||||
import org.thymeleaf.templateresolver.TemplateResolver;
|
import org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver;
|
||||||
|
import org.thymeleaf.spring5.view.ThymeleafViewResolver;
|
||||||
|
import org.thymeleaf.templatemode.TemplateMode;
|
||||||
|
import org.thymeleaf.templateresolver.ITemplateResolver;
|
||||||
|
|
||||||
import java.io.File;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuration for Spring MVC
|
* Configuration for Spring MVC
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
public class MvcConfiguration extends WebMvcConfigurerAdapter {
|
public class MvcConfiguration implements WebMvcConfigurer {
|
||||||
|
|
||||||
@Autowired
|
private static final String UTF8 = "UTF-8";
|
||||||
@Qualifier("pluginTargetDirectory")
|
|
||||||
private File pluginTargetDirectory;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addViewControllers(ViewControllerRegistry registry) {
|
public void addViewControllers(ViewControllerRegistry registry) {
|
||||||
@ -73,23 +72,33 @@ public class MvcConfiguration extends WebMvcConfigurerAdapter {
|
|||||||
//registry.addViewController("/list_users").setViewName("list_users");
|
//registry.addViewController("/list_users").setViewName("list_users");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public ViewResolver viewResolver(SpringTemplateEngine thymeleafTemplateEngine) {
|
||||||
|
ThymeleafViewResolver resolver = new ThymeleafViewResolver();
|
||||||
|
resolver.setTemplateEngine(thymeleafTemplateEngine);
|
||||||
|
resolver.setCharacterEncoding("UTF-8");
|
||||||
|
return resolver;
|
||||||
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public TemplateResolver springThymeleafTemplateResolver(ApplicationContext applicationContext) {
|
public ITemplateResolver springThymeleafTemplateResolver(ApplicationContext applicationContext) {
|
||||||
SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver();
|
SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver();
|
||||||
resolver.setPrefix("classpath:/templates/");
|
resolver.setPrefix("classpath:/templates/");
|
||||||
resolver.setSuffix(".html");
|
resolver.setSuffix(".html");
|
||||||
resolver.setOrder(1);
|
resolver.setTemplateMode(TemplateMode.HTML);
|
||||||
|
resolver.setOrder(2);
|
||||||
resolver.setCacheable(false);
|
resolver.setCacheable(false);
|
||||||
|
resolver.setCharacterEncoding(UTF8);
|
||||||
resolver.setApplicationContext(applicationContext);
|
resolver.setApplicationContext(applicationContext);
|
||||||
return resolver;
|
return resolver;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public LessonTemplateResolver lessonTemplateResolver(ResourceLoader resourceLoader) {
|
public LessonTemplateResolver lessonTemplateResolver(ResourceLoader resourceLoader) {
|
||||||
LessonTemplateResolver resolver = new LessonTemplateResolver(pluginTargetDirectory, resourceLoader);
|
LessonTemplateResolver resolver = new LessonTemplateResolver(resourceLoader);
|
||||||
resolver.setOrder(2);
|
resolver.setOrder(0);
|
||||||
resolver.setCacheable(false);
|
resolver.setCacheable(false);
|
||||||
|
resolver.setCharacterEncoding(UTF8);
|
||||||
return resolver;
|
return resolver;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,40 +106,37 @@ public class MvcConfiguration extends WebMvcConfigurerAdapter {
|
|||||||
public AsciiDoctorTemplateResolver asciiDoctorTemplateResolver(Language language) {
|
public AsciiDoctorTemplateResolver asciiDoctorTemplateResolver(Language language) {
|
||||||
AsciiDoctorTemplateResolver resolver = new AsciiDoctorTemplateResolver(language);
|
AsciiDoctorTemplateResolver resolver = new AsciiDoctorTemplateResolver(language);
|
||||||
resolver.setCacheable(false);
|
resolver.setCacheable(false);
|
||||||
resolver.setOrder(3);
|
resolver.setOrder(1);
|
||||||
|
resolver.setCharacterEncoding(UTF8);
|
||||||
return resolver;
|
return resolver;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public SpringTemplateEngine thymeleafTemplateEngine(TemplateResolver springThymeleafTemplateResolver,
|
public SpringTemplateEngine thymeleafTemplateEngine(ITemplateResolver springThymeleafTemplateResolver,
|
||||||
LessonTemplateResolver lessonTemplateResolver,
|
LessonTemplateResolver lessonTemplateResolver,
|
||||||
AsciiDoctorTemplateResolver asciiDoctorTemplateResolver) {
|
AsciiDoctorTemplateResolver asciiDoctorTemplateResolver) {
|
||||||
SpringTemplateEngine engine = new SpringTemplateEngine();
|
SpringTemplateEngine engine = new SpringTemplateEngine();
|
||||||
|
engine.setEnableSpringELCompiler(true);
|
||||||
engine.addDialect(new SpringSecurityDialect());
|
engine.addDialect(new SpringSecurityDialect());
|
||||||
engine.setTemplateResolvers(
|
engine.setTemplateResolvers(
|
||||||
Sets.newHashSet(springThymeleafTemplateResolver, lessonTemplateResolver, asciiDoctorTemplateResolver));
|
Set.of(lessonTemplateResolver, asciiDoctorTemplateResolver, springThymeleafTemplateResolver));
|
||||||
return engine;
|
return engine;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* This way we expose the plugins target directory as a resource within the web application.
|
|
||||||
*
|
|
||||||
* @param registry
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||||
registry.addResourceHandler("/plugin_lessons/**").addResourceLocations("file:///" + pluginTargetDirectory.toString() + "/");
|
|
||||||
registry.addResourceHandler("/images/**").addResourceLocations("classpath:/images/");
|
registry.addResourceHandler("/images/**").addResourceLocations("classpath:/images/");
|
||||||
registry.addResourceHandler("/lesson_js/**").addResourceLocations("classpath:/js/");
|
registry.addResourceHandler("/lesson_js/**").addResourceLocations("classpath:/js/");
|
||||||
registry.addResourceHandler("/lesson_css/**").addResourceLocations("classpath:/css/");
|
registry.addResourceHandler("/lesson_css/**").addResourceLocations("classpath:/css/");
|
||||||
registry.addResourceHandler("/video/**").addResourceLocations("classpath:/video/");
|
registry.addResourceHandler("/video/**").addResourceLocations("classpath:/video/");
|
||||||
super.addResourceHandlers(registry);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public PluginMessages pluginMessages(Messages messages, Language language) {
|
public PluginMessages pluginMessages(Messages messages, Language language) {
|
||||||
PluginMessages pluginMessages = new PluginMessages(messages, language);
|
PluginMessages pluginMessages = new PluginMessages(messages, language);
|
||||||
|
pluginMessages.setDefaultEncoding("UTF-8");
|
||||||
pluginMessages.setBasenames("i18n/WebGoatLabels");
|
pluginMessages.setBasenames("i18n/WebGoatLabels");
|
||||||
|
pluginMessages.setFallbackToSystemLocale(false);
|
||||||
return pluginMessages;
|
return pluginMessages;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,7 +148,9 @@ public class MvcConfiguration extends WebMvcConfigurerAdapter {
|
|||||||
@Bean
|
@Bean
|
||||||
public Messages messageSource(Language language) {
|
public Messages messageSource(Language language) {
|
||||||
Messages messages = new Messages(language);
|
Messages messages = new Messages(language);
|
||||||
|
messages.setDefaultEncoding("UTF-8");
|
||||||
messages.setBasename("classpath:i18n/messages");
|
messages.setBasename("classpath:i18n/messages");
|
||||||
|
messages.setFallbackToSystemLocale(false);
|
||||||
return messages;
|
return messages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* This file is part of WebGoat, an Open Web Application Security Project utility. For details,
|
* This file is part of WebGoat, an Open Web Application Security Project utility. For details,
|
||||||
* please see http://www.owasp.org/
|
* please see http://www.owasp.org/
|
||||||
* <p>
|
* <p>
|
||||||
* Copyright (c) 2002 - 20014 Bruce Mayhew
|
* Copyright (c) 2002 - 2014 Bruce Mayhew
|
||||||
* <p>
|
* <p>
|
||||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||||
* GNU General Public License as published by the Free Software Foundation; either version 2 of the
|
* GNU General Public License as published by the Free Software Foundation; either version 2 of the
|
||||||
@ -28,45 +28,22 @@
|
|||||||
* @version $Id: $Id
|
* @version $Id: $Id
|
||||||
* @since October 28, 2003
|
* @since October 28, 2003
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.owasp.webgoat;
|
package org.owasp.webgoat;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.apache.catalina.Context;
|
|
||||||
import org.owasp.webgoat.plugins.PluginEndpointPublisher;
|
|
||||||
import org.owasp.webgoat.plugins.PluginsLoader;
|
|
||||||
import org.owasp.webgoat.session.Course;
|
|
||||||
import org.owasp.webgoat.session.UserSessionData;
|
import org.owasp.webgoat.session.UserSessionData;
|
||||||
import org.owasp.webgoat.session.WebSession;
|
import org.owasp.webgoat.session.WebSession;
|
||||||
import org.owasp.webgoat.session.WebgoatContext;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.boot.SpringApplication;
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
||||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
|
||||||
import org.springframework.boot.context.embedded.EmbeddedServletContainerFactory;
|
|
||||||
import org.springframework.boot.context.embedded.tomcat.TomcatContextCustomizer;
|
|
||||||
import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory;
|
|
||||||
import org.springframework.boot.web.support.SpringBootServletInitializer;
|
|
||||||
import org.springframework.context.ApplicationContext;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
import org.springframework.context.annotation.ScopedProxyMode;
|
import org.springframework.context.annotation.ScopedProxyMode;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
@SpringBootApplication
|
@Configuration
|
||||||
@Slf4j
|
public class WebGoat {
|
||||||
public class WebGoat extends SpringBootServletInitializer {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
|
||||||
return application.sources(WebGoat.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
|
||||||
SpringApplication.run(WebGoat.class, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean(name = "pluginTargetDirectory")
|
@Bean(name = "pluginTargetDirectory")
|
||||||
public File pluginTargetDirectory(@Value("${webgoat.user.directory}") final String webgoatHome) {
|
public File pluginTargetDirectory(@Value("${webgoat.user.directory}") final String webgoatHome) {
|
||||||
@ -75,8 +52,8 @@ public class WebGoat extends SpringBootServletInitializer {
|
|||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
|
@Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
|
||||||
public WebSession webSession(WebgoatContext webgoatContext) {
|
public WebSession webSession() {
|
||||||
return new WebSession(webgoatContext);
|
return new WebSession();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@ -85,34 +62,8 @@ public class WebGoat extends SpringBootServletInitializer {
|
|||||||
return new UserSessionData("test", "data");
|
return new UserSessionData("test", "data");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
|
||||||
public PluginEndpointPublisher pluginEndpointPublisher(ApplicationContext applicationContext) {
|
|
||||||
return new PluginEndpointPublisher(applicationContext);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public Course course(PluginEndpointPublisher pluginEndpointPublisher) {
|
|
||||||
return new PluginsLoader(pluginEndpointPublisher).loadPlugins();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public RestTemplate restTemplate() {
|
public RestTemplate restTemplate() {
|
||||||
return new RestTemplate();
|
return new RestTemplate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
|
||||||
public EmbeddedServletContainerFactory servletContainer() {
|
|
||||||
TomcatEmbeddedServletContainerFactory factory = new TomcatEmbeddedServletContainerFactory();
|
|
||||||
factory.setTomcatContextCustomizers(Arrays.asList(new CustomCustomizer()));
|
|
||||||
return factory;
|
|
||||||
}
|
|
||||||
|
|
||||||
static class CustomCustomizer implements TomcatContextCustomizer {
|
|
||||||
@Override
|
|
||||||
public void customize(Context context) {
|
|
||||||
context.setUseHttpOnly(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* ************************************************************************************************
|
* ************************************************************************************************
|
||||||
* This file is part of WebGoat, an Open Web Application Security Project utility. For details,
|
* This file is part of WebGoat, an Open Web Application Security Project utility. For details,
|
||||||
* please see http://www.owasp.org/
|
* please see http://www.owasp.org/
|
||||||
* <p>
|
* <p>
|
||||||
* Copyright (c) 2002 - 20014 Bruce Mayhew
|
* Copyright (c) 2002 - 2014 Bruce Mayhew
|
||||||
* <p>
|
* <p>
|
||||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||||
* GNU General Public License as published by the Free Software Foundation; either version 2 of the
|
* GNU General Public License as published by the Free Software Foundation; either version 2 of the
|
||||||
@ -28,6 +27,7 @@
|
|||||||
* @version $Id: $Id
|
* @version $Id: $Id
|
||||||
* @since December 12, 2015
|
* @since December 12, 2015
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.owasp.webgoat;
|
package org.owasp.webgoat;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@ -35,13 +35,14 @@ import org.owasp.webgoat.users.UserService;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.security.authentication.AuthenticationManager;
|
||||||
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
|
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
|
||||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
import org.springframework.security.config.annotation.web.builders.WebSecurity;
|
|
||||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
||||||
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
|
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
|
||||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||||
|
import org.springframework.security.crypto.password.NoOpPasswordEncoder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Security configuration for WebGoat.
|
* Security configuration for WebGoat.
|
||||||
@ -57,9 +58,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
protected void configure(HttpSecurity http) throws Exception {
|
protected void configure(HttpSecurity http) throws Exception {
|
||||||
ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry security = http
|
ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry security = http
|
||||||
.authorizeRequests()
|
.authorizeRequests()
|
||||||
.antMatchers("/css/**", "/images/**", "/js/**", "fonts/**", "/plugins/**", "/registration", "/register.mvc").permitAll()
|
.antMatchers("/css/**", "/images/**", "/js/**", "fonts/**", "/plugins/**", "/registration", "/register.mvc", "/actuator/**").permitAll()
|
||||||
.antMatchers("/servlet/AdminServlet/**").hasAnyRole("WEBGOAT_ADMIN", "SERVER_ADMIN") //
|
|
||||||
.antMatchers("/JavaSource/**").hasRole("SERVER_ADMIN") //
|
|
||||||
.anyRequest().authenticated();
|
.anyRequest().authenticated();
|
||||||
security.and()
|
security.and()
|
||||||
.formLogin()
|
.formLogin()
|
||||||
@ -76,12 +75,6 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
http.exceptionHandling().authenticationEntryPoint(new AjaxAuthenticationEntryPoint("/login"));
|
http.exceptionHandling().authenticationEntryPoint(new AjaxAuthenticationEntryPoint("/login"));
|
||||||
}
|
}
|
||||||
|
|
||||||
//// TODO: 11/18/2016 make this a little bit more configurabe last part at least
|
|
||||||
@Override
|
|
||||||
public void configure(WebSecurity web) throws Exception {
|
|
||||||
web.ignoring().antMatchers("/plugin_lessons/**", "/XXE/**");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
|
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
|
||||||
auth.userDetailsService(userDetailsService); //.passwordEncoder(bCryptPasswordEncoder());
|
auth.userDetailsService(userDetailsService); //.passwordEncoder(bCryptPasswordEncoder());
|
||||||
@ -92,4 +85,16 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
public UserDetailsService userDetailsServiceBean() throws Exception {
|
public UserDetailsService userDetailsServiceBean() throws Exception {
|
||||||
return userDetailsService;
|
return userDetailsService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Bean
|
||||||
|
protected AuthenticationManager authenticationManager() throws Exception {
|
||||||
|
return super.authenticationManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
@Bean
|
||||||
|
public NoOpPasswordEncoder passwordEncoder() {
|
||||||
|
return (NoOpPasswordEncoder) NoOpPasswordEncoder.getInstance();
|
||||||
|
}
|
||||||
}
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package org.owasp.webgoat.asciidoc;
|
||||||
|
|
||||||
|
import org.springframework.beans.BeansException;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
import org.springframework.context.ApplicationContextAware;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make environment available in the asciidoc code (which you cannot inject because it is handled by the framework)
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class EnvironmentExposure implements ApplicationContextAware {
|
||||||
|
|
||||||
|
private static ApplicationContext context;
|
||||||
|
|
||||||
|
public static Environment getEnv() {
|
||||||
|
return context.getEnvironment();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||||
|
context = applicationContext;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package org.owasp.webgoat.asciidoc;
|
||||||
|
|
||||||
|
import org.asciidoctor.ast.ContentNode;
|
||||||
|
import org.asciidoctor.extension.InlineMacroProcessor;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class OperatingSystemMacro extends InlineMacroProcessor {
|
||||||
|
|
||||||
|
public OperatingSystemMacro(String macroName) {
|
||||||
|
super(macroName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public OperatingSystemMacro(String macroName, Map<String, Object> config) {
|
||||||
|
super(macroName, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object process(ContentNode contentNode, String target, Map<String, Object> attributes) {
|
||||||
|
var osName = System.getProperty("os.name");
|
||||||
|
|
||||||
|
//see https://discuss.asciidoctor.org/How-to-create-inline-macro-producing-HTML-In-AsciidoctorJ-td8313.html for why quoted is used
|
||||||
|
return createPhraseNode(contentNode, "quoted", osName);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package org.owasp.webgoat.asciidoc;
|
||||||
|
|
||||||
|
import org.asciidoctor.ast.ContentNode;
|
||||||
|
import org.asciidoctor.extension.InlineMacroProcessor;
|
||||||
|
import org.owasp.webgoat.users.WebGoatUser;
|
||||||
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class UsernameMacro extends InlineMacroProcessor {
|
||||||
|
|
||||||
|
public UsernameMacro(String macroName) {
|
||||||
|
super(macroName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public UsernameMacro(String macroName, Map<String, Object> config) {
|
||||||
|
super(macroName, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object process(ContentNode contentNode, String target, Map<String, Object> attributes) {
|
||||||
|
var auth = SecurityContextHolder.getContext().getAuthentication();
|
||||||
|
var username = "unknown";
|
||||||
|
if (auth.getPrincipal() instanceof WebGoatUser) {
|
||||||
|
username = ((WebGoatUser) auth.getPrincipal()).getUsername();
|
||||||
|
}
|
||||||
|
|
||||||
|
//see https://discuss.asciidoctor.org/How-to-create-inline-macro-producing-HTML-In-AsciidoctorJ-td8313.html for why quoted is used
|
||||||
|
return createPhraseNode(contentNode, "quoted", username);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package org.owasp.webgoat.asciidoc;
|
||||||
|
|
||||||
|
import org.asciidoctor.ast.ContentNode;
|
||||||
|
import org.asciidoctor.extension.InlineMacroProcessor;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class WebGoatTmpDirMacro extends InlineMacroProcessor {
|
||||||
|
|
||||||
|
public WebGoatTmpDirMacro(String macroName) {
|
||||||
|
super(macroName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public WebGoatTmpDirMacro(String macroName, Map<String, Object> config) {
|
||||||
|
super(macroName, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object process(ContentNode contentNode, String target, Map<String, Object> attributes) {
|
||||||
|
var env = EnvironmentExposure.getEnv().getProperty("webgoat.server.directory");
|
||||||
|
|
||||||
|
//see https://discuss.asciidoctor.org/How-to-create-inline-macro-producing-HTML-In-AsciidoctorJ-td8313.html for why quoted is used
|
||||||
|
return createPhraseNode(contentNode, "quoted", env);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package org.owasp.webgoat.asciidoc;
|
||||||
|
|
||||||
|
import org.asciidoctor.ast.ContentNode;
|
||||||
|
import org.asciidoctor.extension.InlineMacroProcessor;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class WebGoatVersionMacro extends InlineMacroProcessor {
|
||||||
|
|
||||||
|
public WebGoatVersionMacro(String macroName) {
|
||||||
|
super(macroName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public WebGoatVersionMacro(String macroName, Map<String, Object> config) {
|
||||||
|
super(macroName, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object process(ContentNode contentNode, String target, Map<String, Object> attributes) {
|
||||||
|
var webgoatVersion = EnvironmentExposure.getEnv().getProperty("webgoat.build.version");
|
||||||
|
|
||||||
|
//see https://discuss.asciidoctor.org/How-to-create-inline-macro-producing-HTML-In-AsciidoctorJ-td8313.html for why quoted is used
|
||||||
|
return createPhraseNode(contentNode, "quoted", webgoatVersion);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,73 @@
|
|||||||
|
package org.owasp.webgoat.asciidoc;
|
||||||
|
|
||||||
|
import org.asciidoctor.ast.ContentNode;
|
||||||
|
import org.asciidoctor.extension.InlineMacroProcessor;
|
||||||
|
import org.springframework.web.context.request.RequestContextHolder;
|
||||||
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Usage in asciidoc:
|
||||||
|
* <p>
|
||||||
|
* webWolfLink:here[] will display a href with here as text
|
||||||
|
*/
|
||||||
|
public class WebWolfMacro extends InlineMacroProcessor {
|
||||||
|
|
||||||
|
public WebWolfMacro(String macroName) {
|
||||||
|
super(macroName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public WebWolfMacro(String macroName, Map<String, Object> config) {
|
||||||
|
super(macroName, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object process(ContentNode contentNode, String linkText, Map<String, Object> attributes) {
|
||||||
|
var env = EnvironmentExposure.getEnv();
|
||||||
|
var hostname = determineHost(env.getProperty("webwolf.host"), env.getProperty("webwolf.port"));
|
||||||
|
var target = (String) attributes.getOrDefault("target", "home");
|
||||||
|
var href = hostname + "/" + target;
|
||||||
|
|
||||||
|
//are we using noLink in webWolfLink:landing[noLink]? Then display link with full href
|
||||||
|
if (displayCompleteLinkNoFormatting(attributes)) {
|
||||||
|
linkText = href;
|
||||||
|
}
|
||||||
|
|
||||||
|
var options = new HashMap<String, Object>();
|
||||||
|
options.put("type", ":link");
|
||||||
|
options.put("target", href);
|
||||||
|
attributes.put("window", "_blank");
|
||||||
|
return createPhraseNode(contentNode, "anchor", linkText, attributes, options).convert();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean displayCompleteLinkNoFormatting(Map<String, Object> attributes) {
|
||||||
|
return attributes.values().stream().filter(a -> a.equals("noLink")).findFirst().isPresent();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine the host from the hostname and ports that were used.
|
||||||
|
* The purpose is to make it possible to use the application behind a reverse proxy. For instance in the docker
|
||||||
|
* compose/stack version with webgoat webwolf and nginx proxy.
|
||||||
|
* You do not have to use the indicated hostname, but if you do, you should define two hosts aliases
|
||||||
|
* 127.0.0.1 www.webgoat.local www.webwolf.local
|
||||||
|
*/
|
||||||
|
private String determineHost(String host, String port) {
|
||||||
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest();
|
||||||
|
host = request.getHeader("Host");
|
||||||
|
int semicolonIndex = host.indexOf(":");
|
||||||
|
if (semicolonIndex == -1 || host.endsWith(":80")) {
|
||||||
|
host = host.replace(":80", "").replace("www.webgoat.local", "www.webwolf.local");
|
||||||
|
} else {
|
||||||
|
host = host.substring(0, semicolonIndex);
|
||||||
|
host = host.concat(":").concat(port);
|
||||||
|
}
|
||||||
|
return "http://" + host + (includeWebWolfContext() ? "/WebWolf" : "");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean includeWebWolfContext() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package org.owasp.webgoat.asciidoc;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Usage in asciidoc:
|
||||||
|
* <p>
|
||||||
|
* webWolfLink:here[] will display a href with here as text
|
||||||
|
* webWolfLink:landing[noLink] will display the complete url, for example: http://WW_HOST:WW_PORT/landing
|
||||||
|
*/
|
||||||
|
public class WebWolfRootMacro extends WebWolfMacro {
|
||||||
|
|
||||||
|
public WebWolfRootMacro(String macroName) {
|
||||||
|
super(macroName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public WebWolfRootMacro(String macroName, Map<String, Object> config) {
|
||||||
|
super(macroName, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean includeWebWolfContext() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -22,29 +22,18 @@
|
|||||||
* projects.
|
* projects.
|
||||||
* <p>
|
* <p>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.owasp.webgoat.assignments;
|
package org.owasp.webgoat.assignments;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.owasp.webgoat.i18n.PluginMessages;
|
import org.owasp.webgoat.i18n.PluginMessages;
|
||||||
import org.owasp.webgoat.session.UserSessionData;
|
import org.owasp.webgoat.session.UserSessionData;
|
||||||
import org.owasp.webgoat.users.UserTracker;
|
|
||||||
import org.owasp.webgoat.users.UserTrackerRepository;
|
|
||||||
import org.owasp.webgoat.session.WebSession;
|
import org.owasp.webgoat.session.WebSession;
|
||||||
|
import org.owasp.webgoat.users.UserTrackerRepository;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
/**
|
public abstract class AssignmentEndpoint {
|
||||||
* Each lesson can define an endpoint which can support the lesson. So for example if you create a lesson which uses JavaScript and
|
|
||||||
* needs to call out to the server to fetch data you can define an endpoint in that lesson. WebGoat will pick up this endpoint and
|
|
||||||
* Spring will publish it.
|
|
||||||
* </p>
|
|
||||||
* Extend this class and implement the met
|
|
||||||
* </p>
|
|
||||||
* Note: each subclass should declare this annotation otherwise the WebGoat framework cannot find your endpoint.
|
|
||||||
*/
|
|
||||||
public abstract class AssignmentEndpoint extends Endpoint {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private UserTrackerRepository userTrackerRepository;
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private WebSession webSession;
|
private WebSession webSession;
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -53,21 +42,6 @@ public abstract class AssignmentEndpoint extends Endpoint {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private PluginMessages messages;
|
private PluginMessages messages;
|
||||||
|
|
||||||
//// TODO: 11/13/2016 events better fit?
|
|
||||||
protected AttackResult trackProgress(AttackResult attackResult) {
|
|
||||||
UserTracker userTracker = userTrackerRepository.findOne(webSession.getUserName());
|
|
||||||
if (userTracker == null) {
|
|
||||||
userTracker = new UserTracker(webSession.getUserName());
|
|
||||||
}
|
|
||||||
if (attackResult.assignmentSolved()) {
|
|
||||||
userTracker.assignmentSolved(webSession.getCurrentLesson(), this.getClass().getSimpleName());
|
|
||||||
} else {
|
|
||||||
userTracker.assignmentFailed(webSession.getCurrentLesson());
|
|
||||||
}
|
|
||||||
userTrackerRepository.save(userTracker);
|
|
||||||
return attackResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected WebSession getWebSession() {
|
protected WebSession getWebSession() {
|
||||||
return webSession;
|
return webSession;
|
||||||
}
|
}
|
||||||
@ -76,40 +50,37 @@ public abstract class AssignmentEndpoint extends Endpoint {
|
|||||||
return userSessionData;
|
return userSessionData;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public final String getPath() {
|
|
||||||
return this.getClass().getAnnotationsByType(AssignmentPath.class)[0].value();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenience method for create a successful result:
|
* Convenience method for create a successful result:
|
||||||
*
|
* <p>
|
||||||
* - Assignment is set to solved
|
* - Assignment is set to solved
|
||||||
* - Feedback message is set to 'assignment.solved'
|
* - Feedback message is set to 'assignment.solved'
|
||||||
*
|
* <p>
|
||||||
* Of course you can overwrite these values in a specific lesson
|
* Of course you can overwrite these values in a specific lesson
|
||||||
*
|
*
|
||||||
* @return a builder for creating a result from a lesson
|
* @return a builder for creating a result from a lesson
|
||||||
|
* @param assignment
|
||||||
*/
|
*/
|
||||||
protected AttackResult.AttackResultBuilder success() {
|
protected AttackResult.AttackResultBuilder success(AssignmentEndpoint assignment) {
|
||||||
return AttackResult.builder(messages).lessonCompleted(true).feedback("assignment.solved");
|
return AttackResult.builder(messages).lessonCompleted(true).attemptWasMade().feedback("assignment.solved").assignment(assignment);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenience method for create a failed result:
|
* Convenience method for create a failed result:
|
||||||
*
|
* <p>
|
||||||
* - Assignment is set to not solved
|
* - Assignment is set to not solved
|
||||||
* - Feedback message is set to 'assignment.not.solved'
|
* - Feedback message is set to 'assignment.not.solved'
|
||||||
*
|
* <p>
|
||||||
* Of course you can overwrite these values in a specific lesson
|
* Of course you can overwrite these values in a specific lesson
|
||||||
*
|
*
|
||||||
* @return a builder for creating a result from a lesson
|
* @return a builder for creating a result from a lesson
|
||||||
|
* @param assignment
|
||||||
*/
|
*/
|
||||||
protected AttackResult.AttackResultBuilder failed() {
|
protected AttackResult.AttackResultBuilder failed(AssignmentEndpoint assignment) {
|
||||||
return AttackResult.builder(messages).lessonCompleted(false).feedback("assignment.not.solved");
|
return AttackResult.builder(messages).lessonCompleted(false).attemptWasMade().feedback("assignment.not.solved").assignment(assignment);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected AttackResult.AttackResultBuilder informationMessage() {
|
protected AttackResult.AttackResultBuilder informationMessage(AssignmentEndpoint assignment) {
|
||||||
return AttackResult.builder(messages).lessonCompleted(false);
|
return AttackResult.builder(messages).lessonCompleted(false).assignment(assignment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package org.owasp.webgoat.assignments;
|
package org.owasp.webgoat.assignments;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
@ -12,5 +14,9 @@ import java.lang.annotation.Target;
|
|||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
public @interface AssignmentPath {
|
public @interface AssignmentPath {
|
||||||
|
|
||||||
String value();
|
String[] path() default {};
|
||||||
|
|
||||||
|
RequestMethod[] method() default {};
|
||||||
|
|
||||||
|
String value() default "";
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ import org.owasp.webgoat.i18n.PluginMessages;
|
|||||||
|
|
||||||
public class AttackResult {
|
public class AttackResult {
|
||||||
|
|
||||||
|
|
||||||
public static class AttackResultBuilder {
|
public static class AttackResultBuilder {
|
||||||
|
|
||||||
private boolean lessonCompleted;
|
private boolean lessonCompleted;
|
||||||
@ -39,6 +40,8 @@ public class AttackResult {
|
|||||||
private String feedbackResourceBundleKey;
|
private String feedbackResourceBundleKey;
|
||||||
private String output;
|
private String output;
|
||||||
private Object[] outputArgs;
|
private Object[] outputArgs;
|
||||||
|
private AssignmentEndpoint assignment;
|
||||||
|
private boolean attemptWasMade = false;
|
||||||
|
|
||||||
public AttackResultBuilder(PluginMessages messages) {
|
public AttackResultBuilder(PluginMessages messages) {
|
||||||
this.messages = messages;
|
this.messages = messages;
|
||||||
@ -76,8 +79,18 @@ public class AttackResult {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AttackResultBuilder attemptWasMade() {
|
||||||
|
this.attemptWasMade = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public AttackResult build() {
|
public AttackResult build() {
|
||||||
return new AttackResult(lessonCompleted, messages.getMessage(feedbackResourceBundleKey, feedbackArgs), messages.getMessage(output, output, outputArgs));
|
return new AttackResult(lessonCompleted, messages.getMessage(feedbackResourceBundleKey, feedbackArgs), messages.getMessage(output, output, outputArgs), assignment.getClass().getSimpleName(), attemptWasMade);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AttackResultBuilder assignment(AssignmentEndpoint assignment) {
|
||||||
|
this.assignment = assignment;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,11 +100,17 @@ public class AttackResult {
|
|||||||
private String feedback;
|
private String feedback;
|
||||||
@Getter
|
@Getter
|
||||||
private String output;
|
private String output;
|
||||||
|
@Getter
|
||||||
|
private final String assignment;
|
||||||
|
@Getter
|
||||||
|
private boolean attemptWasMade;
|
||||||
|
|
||||||
public AttackResult(boolean lessonCompleted, String feedback, String output) {
|
public AttackResult(boolean lessonCompleted, String feedback, String output, String assignment, boolean attemptWasMade) {
|
||||||
this.lessonCompleted = lessonCompleted;
|
this.lessonCompleted = lessonCompleted;
|
||||||
this.feedback = StringEscapeUtils.escapeJson(feedback);
|
this.feedback = StringEscapeUtils.escapeJson(feedback);
|
||||||
this.output = StringEscapeUtils.escapeJson(output);
|
this.output = StringEscapeUtils.escapeJson(output);
|
||||||
|
this.assignment = assignment;
|
||||||
|
this.attemptWasMade = attemptWasMade;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AttackResultBuilder builder(PluginMessages messages) {
|
public static AttackResultBuilder builder(PluginMessages messages) {
|
||||||
|
@ -0,0 +1,74 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of WebGoat, an Open Web Application Security Project utility. For details, please see http://www.owasp.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2002 - 2019 Bruce Mayhew
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||||
|
* GNU General Public License as published by the Free Software Foundation; either version 2 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
||||||
|
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with this program; if
|
||||||
|
* not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||||
|
* 02111-1307, USA.
|
||||||
|
*
|
||||||
|
* Getting Source ==============
|
||||||
|
*
|
||||||
|
* Source for this application is maintained at https://github.com/WebGoat/WebGoat, a repository for free software projects.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.owasp.webgoat.assignments;
|
||||||
|
|
||||||
|
import org.owasp.webgoat.session.WebSession;
|
||||||
|
import org.owasp.webgoat.users.UserTracker;
|
||||||
|
import org.owasp.webgoat.users.UserTrackerRepository;
|
||||||
|
import org.springframework.core.MethodParameter;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.http.converter.HttpMessageConverter;
|
||||||
|
import org.springframework.http.server.ServerHttpRequest;
|
||||||
|
import org.springframework.http.server.ServerHttpResponse;
|
||||||
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||||
|
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
|
||||||
|
|
||||||
|
@RestControllerAdvice
|
||||||
|
public class LessonTrackerInterceptor implements ResponseBodyAdvice<Object> {
|
||||||
|
|
||||||
|
private UserTrackerRepository userTrackerRepository;
|
||||||
|
private WebSession webSession;
|
||||||
|
|
||||||
|
public LessonTrackerInterceptor(UserTrackerRepository userTrackerRepository, WebSession webSession) {
|
||||||
|
this.userTrackerRepository = userTrackerRepository;
|
||||||
|
this.webSession = webSession;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean supports(MethodParameter methodParameter, Class<? extends HttpMessageConverter<?>> clazz) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object beforeBodyWrite(Object o, MethodParameter methodParameter, MediaType mediaType, Class<? extends HttpMessageConverter<?>> aClass, ServerHttpRequest serverHttpRequest, ServerHttpResponse serverHttpResponse) {
|
||||||
|
if (o != null && o instanceof AttackResult) {
|
||||||
|
trackProgress((AttackResult) o);
|
||||||
|
}
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected AttackResult trackProgress(AttackResult attackResult) {
|
||||||
|
UserTracker userTracker = userTrackerRepository.findByUser(webSession.getUserName());
|
||||||
|
if (userTracker == null) {
|
||||||
|
userTracker = new UserTracker(webSession.getUserName());
|
||||||
|
}
|
||||||
|
if (attackResult.assignmentSolved()) {
|
||||||
|
userTracker.assignmentSolved(webSession.getCurrentLesson(), attackResult.getAssignment());
|
||||||
|
} else {
|
||||||
|
userTracker.assignmentFailed(webSession.getCurrentLesson());
|
||||||
|
}
|
||||||
|
userTrackerRepository.saveAndFlush(userTracker);
|
||||||
|
return attackResult;
|
||||||
|
}
|
||||||
|
}
|
@ -5,7 +5,7 @@
|
|||||||
* This file is part of WebGoat, an Open Web Application Security Project utility. For details,
|
* This file is part of WebGoat, an Open Web Application Security Project utility. For details,
|
||||||
* please see http://www.owasp.org/
|
* please see http://www.owasp.org/
|
||||||
* <p>
|
* <p>
|
||||||
* Copyright (c) 2002 - 20014 Bruce Mayhew
|
* Copyright (c) 2002 - 2014 Bruce Mayhew
|
||||||
* <p>
|
* <p>
|
||||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||||
* GNU General Public License as published by the Free Software Foundation; either version 2 of the
|
* GNU General Public License as published by the Free Software Foundation; either version 2 of the
|
||||||
@ -28,9 +28,10 @@
|
|||||||
* @version $Id: $Id
|
* @version $Id: $Id
|
||||||
* @since October 28, 2003
|
* @since October 28, 2003
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.owasp.webgoat.controller;
|
package org.owasp.webgoat.controller;
|
||||||
|
|
||||||
import org.owasp.webgoat.lessons.AbstractLesson;
|
import org.owasp.webgoat.lessons.Lesson;
|
||||||
import org.owasp.webgoat.session.Course;
|
import org.owasp.webgoat.session.Course;
|
||||||
import org.owasp.webgoat.session.WebSession;
|
import org.owasp.webgoat.session.WebSession;
|
||||||
import org.springframework.security.core.context.SecurityContext;
|
import org.springframework.security.core.context.SecurityContext;
|
||||||
@ -79,8 +80,8 @@ public class StartLesson {
|
|||||||
//GrantedAuthority authority = context.getAuthentication().getAuthorities().iterator().next();
|
//GrantedAuthority authority = context.getAuthentication().getAuthorities().iterator().next();
|
||||||
String path = request.getRequestURL().toString(); // we now got /a/b/c/AccessControlMatrix.lesson
|
String path = request.getRequestURL().toString(); // we now got /a/b/c/AccessControlMatrix.lesson
|
||||||
String lessonName = path.substring(path.lastIndexOf('/') + 1, path.indexOf(".lesson"));
|
String lessonName = path.substring(path.lastIndexOf('/') + 1, path.indexOf(".lesson"));
|
||||||
List<AbstractLesson> lessons = course.getLessons();
|
List<? extends Lesson> lessons = course.getLessons();
|
||||||
Optional<AbstractLesson> lesson = lessons.stream()
|
Optional<? extends Lesson> lesson = lessons.stream()
|
||||||
.filter(l -> l.getId().equals(lessonName))
|
.filter(l -> l.getId().equals(lessonName))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
ws.setCurrentLesson(lesson.get());
|
ws.setCurrentLesson(lesson.get());
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* This file is part of WebGoat, an Open Web Application Security Project utility. For details,
|
* This file is part of WebGoat, an Open Web Application Security Project utility. For details,
|
||||||
* please see http://www.owasp.org/
|
* please see http://www.owasp.org/
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002 - 20014 Bruce Mayhew
|
* Copyright (c) 2002 - 2014 Bruce Mayhew
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||||
* GNU General Public License as published by the Free Software Foundation; either version 2 of the
|
* GNU General Public License as published by the Free Software Foundation; either version 2 of the
|
||||||
@ -28,6 +28,7 @@
|
|||||||
* @since October 28, 2003
|
* @since October 28, 2003
|
||||||
* @version $Id: $Id
|
* @version $Id: $Id
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.owasp.webgoat.controller;
|
package org.owasp.webgoat.controller;
|
||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
* projects.
|
* projects.
|
||||||
* <p>
|
* <p>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.owasp.webgoat.i18n;
|
package org.owasp.webgoat.i18n;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
@ -25,9 +25,10 @@
|
|||||||
|
|
||||||
package org.owasp.webgoat.i18n;
|
package org.owasp.webgoat.i18n;
|
||||||
|
|
||||||
import lombok.SneakyThrows;
|
|
||||||
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
|
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
@ -50,18 +51,23 @@ public class PluginMessages extends ReloadableResourceBundleMessageSource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SneakyThrows
|
|
||||||
protected PropertiesHolder refreshProperties(String filename, PropertiesHolder propHolder) {
|
protected PropertiesHolder refreshProperties(String filename, PropertiesHolder propHolder) {
|
||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
long lastModified = System.currentTimeMillis();
|
long lastModified = System.currentTimeMillis();
|
||||||
|
|
||||||
Enumeration<URL> resources = Thread.currentThread().getContextClassLoader().getResources(filename + PROPERTIES_SUFFIX);
|
Enumeration<URL> resources = null;
|
||||||
|
try {
|
||||||
|
resources = Thread.currentThread().getContextClassLoader().getResources(filename + PROPERTIES_SUFFIX);
|
||||||
while (resources.hasMoreElements()) {
|
while (resources.hasMoreElements()) {
|
||||||
URL resource = resources.nextElement();
|
URL resource = resources.nextElement();
|
||||||
String sourcePath = resource.toURI().toString().replace(PROPERTIES_SUFFIX, "");
|
String sourcePath = resource.toURI().toString().replace(PROPERTIES_SUFFIX, "");
|
||||||
PropertiesHolder holder = super.refreshProperties(sourcePath, propHolder);
|
PropertiesHolder holder = super.refreshProperties(sourcePath, propHolder);
|
||||||
properties.putAll(holder.getProperties());
|
properties.putAll(holder.getProperties());
|
||||||
}
|
}
|
||||||
|
} catch (IOException | URISyntaxException e) {
|
||||||
|
logger.error("Unable to read plugin message", e);
|
||||||
|
}
|
||||||
|
|
||||||
return new PropertiesHolder(properties, lastModified);
|
return new PropertiesHolder(properties, lastModified);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,8 @@ package org.owasp.webgoat.lessons;
|
|||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -9,7 +11,7 @@ import java.util.List;
|
|||||||
* This file is part of WebGoat, an Open Web Application Security Project utility. For details,
|
* This file is part of WebGoat, an Open Web Application Security Project utility. For details,
|
||||||
* please see http://www.owasp.org/
|
* please see http://www.owasp.org/
|
||||||
* <p>
|
* <p>
|
||||||
* Copyright (c) 2002 - 20014 Bruce Mayhew
|
* Copyright (c) 2002 - 2014 Bruce Mayhew
|
||||||
* <p>
|
* <p>
|
||||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||||
* GNU General Public License as published by the Free Software Foundation; either version 2 of the
|
* GNU General Public License as published by the Free Software Foundation; either version 2 of the
|
||||||
@ -33,16 +35,45 @@ import java.util.List;
|
|||||||
* @version $Id: $Id
|
* @version $Id: $Id
|
||||||
* @since November 25, 2016
|
* @since November 25, 2016
|
||||||
*/
|
*/
|
||||||
@AllArgsConstructor
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@Getter
|
@Getter
|
||||||
@EqualsAndHashCode
|
@EqualsAndHashCode
|
||||||
|
@Entity
|
||||||
public class Assignment {
|
public class Assignment {
|
||||||
@NonNull
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
private Long id;
|
||||||
private String name;
|
private String name;
|
||||||
@NonNull
|
|
||||||
private String path;
|
private String path;
|
||||||
|
|
||||||
|
@Transient
|
||||||
private List<String> hints;
|
private List<String> hints;
|
||||||
|
|
||||||
|
private Assignment() {
|
||||||
|
//Hibernate
|
||||||
|
}
|
||||||
|
|
||||||
|
public Assignment(String name) {
|
||||||
|
this(name, name, new ArrayList<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Assignment(String name, String path, List<String> hints) {
|
||||||
|
if (path.equals("") || path.equals("/") || path.equals("/WebGoat/")) {
|
||||||
|
throw new IllegalStateException("The path of assignment '" + name + "' overrides WebGoat endpoints, please choose a path within the scope of the lesson");
|
||||||
|
}
|
||||||
|
this.name = name;
|
||||||
|
this.path = path;
|
||||||
|
this.hints = hints;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set path is here to overwrite stored paths.
|
||||||
|
* Since a stored path can no longer be used in a lesson while
|
||||||
|
* the lesson (name) itself is still part of the lesson.
|
||||||
|
*
|
||||||
|
* @param pathName the path
|
||||||
|
*/
|
||||||
|
public void setPath(String pathName) {
|
||||||
|
this.path = pathName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ import lombok.Getter;
|
|||||||
* This file is part of WebGoat, an Open Web Application Security Project
|
* This file is part of WebGoat, an Open Web Application Security Project
|
||||||
* utility. For details, please see http://www.owasp.org/
|
* utility. For details, please see http://www.owasp.org/
|
||||||
* <p>
|
* <p>
|
||||||
* Copyright (c) 2002 - 20014 Bruce Mayhew
|
* Copyright (c) 2002 - 2014 Bruce Mayhew
|
||||||
* <p>
|
* <p>
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
* the terms of the GNU General Public License as published by the Free Software
|
* the terms of the GNU General Public License as published by the Free Software
|
||||||
@ -36,30 +36,40 @@ import lombok.Getter;
|
|||||||
*/
|
*/
|
||||||
public enum Category {
|
public enum Category {
|
||||||
|
|
||||||
INTRODUCTION("Introduction", new Integer(5)),
|
INTRODUCTION("Introduction", 5),
|
||||||
GENERAL("General", new Integer(100)),
|
GENERAL("General", 100),
|
||||||
INJECTION("Injection Flaws", new Integer(200)),
|
|
||||||
AUTHENTICATION("Authentication Flaws", new Integer(300)),
|
INJECTION("(A1) Injection", 300),
|
||||||
XSS("Cross-Site Scripting (XSS)", new Integer(400)),
|
AUTHENTICATION("(A2) Broken Authentication", 302),
|
||||||
REQ_FORGERIES("Request Forgeries", new Integer(450)),
|
INSECURE_COMMUNICATION("(A3) Sensitive Data Exposure", 303),
|
||||||
ACCESS_CONTROL("Access Control Flaws", new Integer(500)),
|
XXE("(A4) XML External Entities (XXE)", 304),
|
||||||
INSECURE_CONFIGURATION("Insecure Configuration", new Integer(600)),
|
ACCESS_CONTROL("(A5) Broken Access Control", 305),
|
||||||
INSECURE_COMMUNICATION("Insecure Communication", new Integer(700)),
|
|
||||||
INSECURE_STORAGE("Insecure Storage", new Integer(800)),
|
XSS("(A7) Cross-Site Scripting (XSS)", 307),
|
||||||
REQUEST_FORGERIES("Request Forgeries", new Integer(900)),
|
INSECURE_DESERIALIZATION("(A8) Insecure Deserialization", 308),
|
||||||
VULNERABLE_COMPONENTS("Vulnerable Components - A9", new Integer(950)),
|
VULNERABLE_COMPONENTS("(A9) Vulnerable Components", 309),
|
||||||
AJAX_SECURITY("AJAX Security", new Integer(1000)),
|
SESSION_MANAGEMENT("(A10) Session Management Flaws", 310),
|
||||||
BUFFER_OVERFLOW("Buffer Overflows", new Integer(1100)),
|
|
||||||
CODE_QUALITY("Code Quality", new Integer(1200)),
|
REQUEST_FORGERIES("(A8:2013) Request Forgeries", 318),
|
||||||
CONCURRENCY("Concurrency", new Integer(1300)),
|
|
||||||
ERROR_HANDLING("Improper Error Handling", new Integer(1400)),
|
|
||||||
DOS("Denial of Service", new Integer(1500)),
|
REQ_FORGERIES("Request Forgeries", 450),
|
||||||
MALICIOUS_EXECUTION("Malicious Execution", new Integer(1600)),
|
|
||||||
CLIENT_SIDE("Client side", new Integer(1700)),
|
INSECURE_CONFIGURATION("Insecure Configuration", 600),
|
||||||
SESSION_MANAGEMENT("Session Management Flaws", new Integer(1800)),
|
INSECURE_STORAGE("Insecure Storage", 800),
|
||||||
WEB_SERVICES("Web Services", new Integer(1900)),
|
|
||||||
ADMIN_FUNCTIONS("Admin Functions", new Integer(2000)),
|
|
||||||
CHALLENGE("Challenges", new Integer(3000));
|
AJAX_SECURITY("AJAX Security", 1000),
|
||||||
|
BUFFER_OVERFLOW("Buffer Overflows", 1100),
|
||||||
|
CODE_QUALITY("Code Quality", 1200),
|
||||||
|
CONCURRENCY("Concurrency", 1300),
|
||||||
|
ERROR_HANDLING("Improper Error Handling", 1400),
|
||||||
|
DOS("Denial of Service", 1500),
|
||||||
|
MALICIOUS_EXECUTION("Malicious Execution", 1600),
|
||||||
|
CLIENT_SIDE("Client side", 1700),
|
||||||
|
WEB_SERVICES("Web Services", 1900),
|
||||||
|
ADMIN_FUNCTIONS("Admin Functions", 2000),
|
||||||
|
CHALLENGE("Challenges", 3000);
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private String name;
|
private String name;
|
||||||
|
@ -0,0 +1,124 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of WebGoat, an Open Web Application Security Project utility. For details, please see http://www.owasp.org/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2002 - 2019 Bruce Mayhew
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||||
|
* GNU General Public License as published by the Free Software Foundation; either version 2 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
||||||
|
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with this program; if
|
||||||
|
* not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||||
|
* 02111-1307, USA.
|
||||||
|
*
|
||||||
|
* Getting Source ==============
|
||||||
|
*
|
||||||
|
* Source for this application is maintained at https://github.com/WebGoat/WebGoat, a repository for free software projects.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.owasp.webgoat.lessons;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
import org.owasp.webgoat.assignments.AssignmentEndpoint;
|
||||||
|
import org.owasp.webgoat.assignments.AssignmentHints;
|
||||||
|
import org.owasp.webgoat.assignments.AttackResult;
|
||||||
|
import org.owasp.webgoat.session.Course;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.lang.reflect.ParameterizedType;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import static java.util.stream.Collectors.groupingBy;
|
||||||
|
import static java.util.stream.Collectors.toList;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Configuration
|
||||||
|
public class CourseConfiguration {
|
||||||
|
|
||||||
|
private final List<Lesson> lessons;
|
||||||
|
private final List<AssignmentEndpoint> assignments;
|
||||||
|
private final Map<String, List<AssignmentEndpoint>> assignmentsByPackage;
|
||||||
|
|
||||||
|
public CourseConfiguration(List<Lesson> lessons, List<AssignmentEndpoint> assignments) {
|
||||||
|
this.lessons = lessons;
|
||||||
|
this.assignments = assignments;
|
||||||
|
assignmentsByPackage = this.assignments.stream().collect(groupingBy(a -> a.getClass().getPackageName()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Course course() {
|
||||||
|
lessons.stream().forEach(l -> l.setAssignments(createAssignment(l)));
|
||||||
|
return new Course(lessons);
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Assignment> createAssignment(Lesson lesson) {
|
||||||
|
var endpoints = assignmentsByPackage.get(lesson.getClass().getPackageName());
|
||||||
|
if (CollectionUtils.isEmpty(endpoints)) {
|
||||||
|
log.warn("Lesson: {} has no endpoints, is this intentionally?", lesson.getTitle());
|
||||||
|
return new ArrayList();
|
||||||
|
}
|
||||||
|
return endpoints.stream().map(e -> new Assignment(e.getClass().getSimpleName(), getPath(e.getClass()), getHints(e.getClass()))).collect(toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getPath(Class<? extends AssignmentEndpoint> e) {
|
||||||
|
for (Method m : e.getMethods()) {
|
||||||
|
if (methodReturnTypeIsOfTypeAttackResult(m)) {
|
||||||
|
var mapping = getMapping(m);
|
||||||
|
if (mapping != null) {
|
||||||
|
return mapping;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new IllegalStateException("Assignment endpoint: " + e + " has no mapping like @GetMapping/@PostMapping etc," +
|
||||||
|
"with return type 'AttackResult' or 'ResponseEntity<AttackResult>' please consider adding one");
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean methodReturnTypeIsOfTypeAttackResult(Method m) {
|
||||||
|
if (m.getReturnType() == AttackResult.class) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
var genericType = m.getGenericReturnType();
|
||||||
|
if (genericType instanceof ParameterizedType) {
|
||||||
|
return ((ParameterizedType) m.getGenericReturnType()).getActualTypeArguments()[0] == AttackResult.class;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getMapping(Method m) {
|
||||||
|
String[] paths = null;
|
||||||
|
//Find the path, either it is @GetMapping("/attack") of GetMapping(path = "/attack") both are valid, we need to consider both
|
||||||
|
if (m.getAnnotation(RequestMapping.class) != null) {
|
||||||
|
paths = ArrayUtils.addAll(m.getAnnotation(RequestMapping.class).value(), m.getAnnotation(RequestMapping.class).path());
|
||||||
|
} else if (m.getAnnotation(PostMapping.class) != null) {
|
||||||
|
paths = ArrayUtils.addAll(m.getAnnotation(PostMapping.class).value(), m.getAnnotation(PostMapping.class).path());
|
||||||
|
} else if (m.getAnnotation(GetMapping.class) != null) {
|
||||||
|
paths = ArrayUtils.addAll(m.getAnnotation(GetMapping.class).value(), m.getAnnotation(GetMapping.class).path());
|
||||||
|
} else if (m.getAnnotation(PutMapping.class) != null) {
|
||||||
|
paths = ArrayUtils.addAll(m.getAnnotation(PutMapping.class).value(), m.getAnnotation(PutMapping.class).path());
|
||||||
|
}
|
||||||
|
if (paths == null) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
return Arrays.stream(paths).filter(path -> !"".equals(path)).findFirst().orElse("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<String> getHints(Class<? extends AssignmentEndpoint> e) {
|
||||||
|
if (e.isAnnotationPresent(AssignmentHints.class)) {
|
||||||
|
return List.of(e.getAnnotationsByType(AssignmentHints.class)[0].value());
|
||||||
|
}
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
}
|
@ -4,7 +4,7 @@
|
|||||||
* This file is part of WebGoat, an Open Web Application Security Project utility. For details,
|
* This file is part of WebGoat, an Open Web Application Security Project utility. For details,
|
||||||
* please see http://www.owasp.org/
|
* please see http://www.owasp.org/
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002 - 20014 Bruce Mayhew
|
* Copyright (c) 2002 - 2014 Bruce Mayhew
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||||
* GNU General Public License as published by the Free Software Foundation; either version 2 of the
|
* GNU General Public License as published by the Free Software Foundation; either version 2 of the
|
||||||
@ -24,10 +24,10 @@
|
|||||||
* projects.
|
* projects.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.owasp.webgoat.lessons;
|
package org.owasp.webgoat.lessons;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Value;
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Hint class.</p>
|
* <p>Hint class.</p>
|
||||||
@ -35,12 +35,9 @@ import lombok.Setter;
|
|||||||
* @author rlawson
|
* @author rlawson
|
||||||
* @version $Id: $Id
|
* @version $Id: $Id
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Value
|
||||||
@Setter
|
|
||||||
public class Hint {
|
public class Hint {
|
||||||
|
|
||||||
private String hint;
|
private String hint;
|
||||||
private String lesson;
|
|
||||||
private String assignmentPath;
|
private String assignmentPath;
|
||||||
private int number;
|
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user