@@ -55,7 +55,9 @@ export interface PCITesting {
55
55
} )
56
56
export class DialogAddissueComponent implements OnInit {
57
57
customissueform = new UntypedFormControl ( ) ;
58
+ mobilecustomissueform = new UntypedFormControl ( ) ;
58
59
gridaction = new UntypedFormControl ( ) ;
60
+ mobilegridaction = new UntypedFormControl ( ) ;
59
61
cwecontrol = new UntypedFormControl ( ) ;
60
62
mycve = new UntypedFormControl ( ) ;
61
63
mymobilemitre = new UntypedFormControl ( ) ;
@@ -66,6 +68,7 @@ export class DialogAddissueComponent implements OnInit {
66
68
myOWASPTOP10CICD = new UntypedFormControl ( ) ;
67
69
myOWASPTOP10k8s = new UntypedFormControl ( ) ;
68
70
options : Vulns [ ] = [ ] ;
71
+ mobileoptions : Vulns [ ] = [ ] ;
69
72
optionsv = [ ] ;
70
73
cwe : Vulns [ ] = [ ] ;
71
74
mitremobile : Vulns [ ] = [ ] ;
@@ -76,6 +79,7 @@ export class DialogAddissueComponent implements OnInit {
76
79
OWASPTOP10CICD : Vulns [ ] = [ ] ;
77
80
OWASPTOP10k8s : Vulns [ ] = [ ] ;
78
81
filteredOptions : Observable < Vulns [ ] > ;
82
+ filteredOptionsmobile : Observable < Vulns [ ] > ;
79
83
filteredOptionsCWE : Observable < Vulns [ ] > ;
80
84
filteredOptionsmitremobile : Observable < Vulns [ ] > ;
81
85
filteredOptionsmitreenterprise : Observable < Vulns [ ] > ;
@@ -90,6 +94,7 @@ export class DialogAddissueComponent implements OnInit {
90
94
separatorKeysCodes : number [ ] = [ ENTER , COMMA ] ;
91
95
announcer = inject ( LiveAnnouncer ) ;
92
96
chipsissue : string [ ] = [ ] ;
97
+ mobilechipsissue : string [ ] = [ ] ;
93
98
reportTemplateList_int = [ ] ;
94
99
95
100
constructor ( public router : Router ,
@@ -104,7 +109,12 @@ export class DialogAddissueComponent implements OnInit {
104
109
map ( value => typeof value === 'string' ? value : value . title ) ,
105
110
map ( title => title ? this . _filter ( title ) : this . options . slice ( ) )
106
111
) ;
107
-
112
+ this . filteredOptionsmobile = this . mobilecustomissueform . valueChanges
113
+ . pipe (
114
+ startWith < string | Vulns > ( '' ) ,
115
+ map ( value => typeof value === 'string' ? value : value . title ) ,
116
+ map ( title => title ? this . _filtermobile ( title ) : this . mobileoptions . slice ( ) )
117
+ ) ;
108
118
this . filteredOptionsCWE = this . cwecontrol . valueChanges
109
119
. pipe (
110
120
startWith < string | Vulns > ( '' ) ,
@@ -165,6 +175,10 @@ export class DialogAddissueComponent implements OnInit {
165
175
const filterValue = name . toLowerCase ( ) ;
166
176
return this . options . filter ( option => option . title . toLowerCase ( ) . indexOf ( filterValue ) >= 0 ) ;
167
177
}
178
+ private _filtermobile ( name : string ) : Vulns [ ] {
179
+ const filterValue = name . toLowerCase ( ) ;
180
+ return this . mobileoptions . filter ( option => option . title . toLowerCase ( ) . indexOf ( filterValue ) >= 0 ) ;
181
+ }
168
182
private _filterCWE ( name : string ) : Vulns [ ] {
169
183
const filterValue = name . toLowerCase ( ) ;
170
184
return this . cwe . filter ( option => option . title . toLowerCase ( ) . indexOf ( filterValue ) >= 0 ) ;
@@ -228,6 +242,10 @@ export class DialogAddissueComponent implements OnInit {
228
242
}
229
243
} ) ;
230
244
245
+ this . http . get < any > ( '/assets/owasp_mobile_2024.json?v=' + + new Date ( ) ) . subscribe ( res => {
246
+ this . mobileoptions = res ;
247
+ } ) ;
248
+
231
249
this . http . get < any > ( '/assets/CWE_V.4.3.json?v=' + + new Date ( ) ) . subscribe ( res => {
232
250
this . cwe = res ;
233
251
} ) ;
@@ -852,6 +870,104 @@ export class DialogAddissueComponent implements OnInit {
852
870
}
853
871
854
872
873
+ addOWASP_mobile ( ) {
874
+
875
+ if ( this . mobilecustomissueform . value !== "" && this . mobilecustomissueform . value !== null ) {
876
+ this . mobilechipsissue . push ( this . mobilecustomissueform . value ) ;
877
+ }
878
+
879
+ let exitel = [ ] ;
880
+ if ( this . mobilechipsissue . length > 0 ) {
881
+ for ( var datael of this . mobilechipsissue ) {
882
+
883
+ const found = this . mobileoptions . find ( ( obj ) => {
884
+ return obj . title === datael ;
885
+ } ) ;
886
+
887
+ if ( found !== undefined ) {
888
+
889
+ if ( found . title === datael ) {
890
+ const def = {
891
+ title : found . title ,
892
+ poc : found . poc ,
893
+ files : [ ] ,
894
+ desc : found . desc ,
895
+ severity : found . severity ,
896
+ status : 1 ,
897
+ ref : found . ref ,
898
+ cvss : found . cvss ,
899
+ cvss_vector : found . cvss_vector ,
900
+ cve : found . cve ,
901
+ tags : found . tags ,
902
+ bounty : [ ] ,
903
+ date : this . getcurrentDate ( )
904
+ } ;
905
+ exitel . push ( def ) ;
906
+
907
+ }
908
+
909
+
910
+ } else {
911
+
912
+ const def = {
913
+ title : datael ,
914
+ poc : '' ,
915
+ files : [ ] ,
916
+ desc : '' ,
917
+ severity : 'High' ,
918
+ status : 1 ,
919
+ ref : '' ,
920
+ cvss : 7 ,
921
+ cvss_vector : '' ,
922
+ cve : '' ,
923
+ tags : [ ] ,
924
+ bounty : [ ] ,
925
+ date : this . getcurrentDate ( )
926
+ } ;
927
+ exitel . push ( def ) ;
928
+ }
929
+ }
930
+
931
+ this . dialogRef . close ( exitel ) ;
932
+
933
+
934
+ } else {
935
+ this . customissueform . setErrors ( { 'notempty' : true } ) ;
936
+ this . gridaction . setErrors ( { 'notempty' : true } ) ;
937
+ }
938
+
939
+ }
940
+
941
+ addmobile ( event : MatChipInputEvent ) : void {
942
+ const value = ( event . value || '' ) . trim ( ) ;
943
+
944
+ // Add our fruit
945
+ if ( value ) {
946
+ this . mobilechipsissue . push ( value ) ;
947
+ }
948
+
949
+ // Clear the input value
950
+ event . chipInput ! . clear ( ) ;
951
+
952
+ this . mobilecustomissueform . setValue ( '' ) ;
953
+ }
954
+
955
+ removemobile ( item : string ) : void {
956
+ const index = this . mobilechipsissue . indexOf ( item ) ;
957
+
958
+ if ( index >= 0 ) {
959
+ this . mobilechipsissue . splice ( index , 1 ) ;
960
+
961
+ this . announcer . announce ( `Removed ${ item } ` ) ;
962
+ }
963
+ }
964
+
965
+ mobileselected ( event : MatAutocompleteSelectedEvent ) : void {
966
+ this . mobilechipsissue . push ( event . option . viewValue ) ;
967
+ //this.fruitInput.nativeElement.value = '';
968
+ this . mobilecustomissueform . setValue ( '' ) ;
969
+ }
970
+
855
971
add ( event : MatChipInputEvent ) : void {
856
972
const value = ( event . value || '' ) . trim ( ) ;
857
973
@@ -876,6 +992,8 @@ export class DialogAddissueComponent implements OnInit {
876
992
}
877
993
}
878
994
995
+
996
+
879
997
selected ( event : MatAutocompleteSelectedEvent ) : void {
880
998
this . chipsissue . push ( event . option . viewValue ) ;
881
999
//this.fruitInput.nativeElement.value = '';
0 commit comments