Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Features/vuln search #100 #134

Merged
merged 7 commits into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend_app/requirements.macos.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ uritemplate==3.0.1
urllib3==1.26.5
vine==1.3.0
yarl==1.4.2
zipp==0.6.0
zipp==0.6.0
2 changes: 1 addition & 1 deletion frontend/src/components/pages/AdvancedSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export default {
{ name: 'CVSSv3', attribute: 'cvss3', criteria: 'numeric'},
{ name: 'CVSSv3 Vector', attribute: 'cvss3_vector', criteria: 'text'},
// { name: 'Exploit count', attribute: 'exploit_count', criteria: 'numeric'},
{ name: 'Is monitored ?', attribute: 'monitored', criteria: 'bool'},
// { name: 'Is monitored ?', attribute: 'monitored', criteria: 'bool'},
{ name: 'Is exploitable ?', attribute: 'is_exploitable', criteria: 'bool'},
{ name: 'Is confirmed ?', attribute: 'is_confirmed', criteria: 'bool'},
{ name: 'Is in the News ?', attribute: 'is_in_the_news', criteria: 'bool'},
Expand Down
30 changes: 24 additions & 6 deletions frontend/src/components/pages/Vulns.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
<v-row>
<v-col class="pa-2" md="auto" >
Vulnerabilities<br/>
<!-- </v-col>
<v-col class="pa-2"> -->
<v-chip
small label outlined :color="getBoolColor(this.show_all)"
@click="toggleShowAll()">All</v-chip>&nbsp;
Expand All @@ -17,9 +15,12 @@
@click="toggleShowLastDay()">Last 24h</v-chip>&nbsp;
<v-chip
small label outlined :color="getBoolColor(this.show_last_week)"
@click="toggleShowLastWeek()">Last Week</v-chip>
@click="toggleShowLastWeek()">Last Week</v-chip>&nbsp;
<v-chip
small label outlined :color="this.show_monitored?'deep-orange':'grey'"
@click="toggleMonitored()">Monitored</v-chip>
</v-col>
<v-col class="pa-2" md="6">
<v-col class="pa-2" md="4">
<v-text-field
class="pt-0"
v-model="search"
Expand All @@ -29,7 +30,7 @@
hide-details
></v-text-field>
</v-col>
<v-col class="pa-2" md="2">
<v-col class="pa-2" md="3">
<v-slider
v-model="search_slider_min"
label="Min Score"
Expand Down Expand Up @@ -227,6 +228,7 @@ export default {
show_all: true,
show_last_day: false,
show_last_week: false,
show_monitored: false,
options: {},
headers: [
{ text: 'Score', value: 'score', align: 'center', width: "10%" },
Expand Down Expand Up @@ -277,6 +279,12 @@ export default {
},
deep: true
},
show_monitored: {
handler() {
this.getDataFromApi();
},
deep: true
}
},
methods: {
getDataFromApi(extra_filters, page_id) {
Expand Down Expand Up @@ -308,6 +316,7 @@ export default {
},
updateAdvancedSearchFilters(filters){
this.getDataFromApi(filters, 1);
console.log(filters)
},
getVulns(page, itemsPerPage, sortBy, sortDesc, extra_filters) {
let sorted_by = '';
Expand All @@ -330,7 +339,13 @@ export default {
extra_filters = "&score__gte="+this.search_slider_min+"&score__lte="+this.search_slider_max
}

this.$api.get('/api/vulns/?limit='+itemsPerPage+'&page='+page+'&search='+this.search+'&'+sorted_by+filter_by_date+extra_filters).then(res => {
let url = '/api/vulns/?limit='+itemsPerPage+'&page='+page+'&search='+this.search+'&'+sorted_by+filter_by_date+extra_filters

if (this.show_monitored === true) {
url = url + "&monitored=true"
}

this.$api.get(url).then(res => {
this.vulns = res.data;
this.loading = false;
return this.vulns;
Expand Down Expand Up @@ -394,6 +409,9 @@ export default {
this.show_last_day = false;
}
},
toggleMonitored() {
this.show_monitored = !this.show_monitored;
},
showManageMetadataButtons(){
let p = JSON.parse(this.getUserProfile());
if (p != null && 'manage_metadata' in p){
Expand Down