-
Notifications
You must be signed in to change notification settings - Fork 40
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
Added Vulnerability Module and Upgraded to Django 2.0 #21
Open
yannarak
wants to merge
47
commits into
aparsons:master
Choose a base branch
from
yannarak:pr_to_aparsons
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
89a5d8d
- Change from Alpine to Ubuntu
267ec9b
Ignore package-lock.json and bag-of-holding.iml
a7cdaf3
Add sample mercari application list
4cb19ea
Remove django data
982f251
- Display the data elements in the application overview page.
86c60b9
- Add the 'Data Elements' field to the filter for Application search
2c0409c
delete mercari_data
yannarak e61f801
- Added the rel="noopener noreferrer" attribute to all links with tar…
45c6d78
Add the following fields to Application Model:
67d4c56
Implement the forms for updating Dependencies and Repository
b556cfd
Initial implementation of the Vulnerability Model
dc3a259
Implement vulnerability re-open feature.
99f7220
Implement vulnerabilty search feature.
3952d16
Implement vulnerabilty search feature for application page.
3ce7b7c
add favicon
22809f3
Add the attribute enctype="multipart/form-data" to the <form> element
ce6407c
- Implement the file upload feature.
cb0337a
- Add the date picker control to the vulnerability add and edit pages.
de0c1a9
- Implemented the attachment delete feature.
3e136ff
- Implemented the attachment delete feature.
4b554f0
- Implemented the attachment delete feature.
aab0223
- Implement Google Authentication.
8b9e807
- Added configuration file template
902096c
Delete boh_config.template.sh
yannarak 5e0957e
- Add OS Environment variable configuration file
6eb5f1b
- Upgrade to Django 2 but need to fix the search functionalities.
8286530
- Fix the search functionality
e974cbe
- Add social-auth-app-django==2.1.0 to the requirements file
74ac78b
- added the default value for slack_id and email fields
4a2a846
- set the debug configuration to 'False' and MySQL port to 3306
982c6ca
- Added ALLOWED_HOSTS to the settings
42b8e32
- Added ALLOWED_HOSTS to the settings
2809bc1
- Added ALLOWED_HOSTS to the settings
a58bba5
- Added ALLOWED_HOSTS to the settings
05fd31e
- Only allowed Google Authentication with the users from mercari.com
ee9ce1c
- fix the bug in the search functionality
4415b20
- fix the bug in the search functionality
41fbb00
- Add the 'Potential Threats' field to the 'Application' model
d2f8ab1
- fix cosmetic bug when displaying potential threats.
0f47f32
- Add the 'Potential Threats' field to the 'Application' model
84ca858
- Add the field 'slack_id' to the Person Form.
63b9c72
- Add the 'Potential Threats' field to the 'Application' model
26d8d86
- Upgrade to Django 2.0.2
545c71a
added cwe_insert.sql
9416061
Merge pull request #1 from yannarak/insert-cwe-data
yannarak f9d4eb2
- Add 'Application Vulnerability Add' view so that the user does not …
7a1c180
Added Vulnerability Module and Upgraded to Django 2.0
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
* Adam Parsons <[email protected]> | ||
* Matt Tesauro <[email protected]> | ||
* Aaron Weaver <[email protected]> | ||
* Yannarak Wannasai <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
FROM alpine | ||
FROM ubuntu | ||
|
||
RUN apk --update add python3 && apk add bash | ||
RUN apt-get update | ||
RUN apt-get install -y python3 python3-pip sqlite3 | ||
RUN apt-get install -y libmysqlclient-dev | ||
|
||
ENV PYTHONUNBUFFERED 1 | ||
RUN mkdir /bag-of-holding | ||
WORKDIR /bag-of-holding | ||
ADD . /bag-of-holding/ | ||
RUN pip3 install -r requirements.txt | ||
RUN python3 /bag-of-holding/src/manage.py makemigrations | ||
RUN python3 /bag-of-holding/src/manage.py migrate | ||
RUN python3 /bag-of-holding/src/manage.py loaddata /bag-of-holding/src/sample_data.json | ||
RUN python3 /bag-of-holding/project/manage.py makemigrations | ||
RUN python3 /bag-of-holding/project/manage.py migrate | ||
RUN python3 /bag-of-holding/project/manage.py loaddata /bag-of-holding/project/mercari_data.json | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please rename to sample_data or something not brand-specific. |
||
|
||
CMD python3 /bag-of-holding/src/manage.py runserver 0.0.0.0:8000 | ||
CMD python3 /bag-of-holding/project/manage.py runserver 0.0.0.0:8000 | ||
|
||
# Instructions: | ||
# docker run -d -p 8000:8000 --name boh-server disenchant/bag-of-holding:latest | ||
# docker exec -it boh-server bash | ||
# python3 /bag-of-holding/src/manage.py createsuperuser | ||
# python3 /bag-of-holding/project/manage.py createsuperuser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,54 @@ | ||
import django_filters | ||
from .models import Organization, Application, Vulnerability, VulnerabilityClass, Person | ||
|
||
from django_filters import filters | ||
|
||
from .models import Organization, Application | ||
class ApplicationFilter(django_filters.FilterSet): | ||
name = django_filters.CharFilter(lookup_expr='icontains') | ||
organization = django_filters.ModelMultipleChoiceFilter(queryset=Organization.objects.all()) | ||
business_criticality = django_filters.MultipleChoiceFilter(choices=Application.BUSINESS_CRITICALITY_CHOICES) | ||
platform = django_filters.MultipleChoiceFilter(choices=Application.PLATFORM_CHOICES) | ||
lifecycle = django_filters.MultipleChoiceFilter(choices=Application.LIFECYCLE_CHOICES) | ||
origin = django_filters.MultipleChoiceFilter(choices=Application.ORIGIN_CHOICES) | ||
asvs_level = django_filters.MultipleChoiceFilter(choices=Application.ASVS_CHOICES) | ||
|
||
def count(self): | ||
count = 0 | ||
if self.queryset is not None: | ||
count = len(self.queryset) | ||
return count | ||
|
||
class ApplicationFilter(django_filters.FilterSet): | ||
name = filters.CharFilter(lookup_type='icontains') | ||
organization = filters.ModelMultipleChoiceFilter(queryset=Organization.objects.all()) | ||
business_criticality = filters.MultipleChoiceFilter(choices=Application.BUSINESS_CRITICALITY_CHOICES) | ||
platform = filters.MultipleChoiceFilter(choices=Application.PLATFORM_CHOICES) | ||
lifecycle = filters.MultipleChoiceFilter(choices=Application.LIFECYCLE_CHOICES) | ||
origin = filters.MultipleChoiceFilter(choices=Application.ORIGIN_CHOICES) | ||
asvs_level = filters.MultipleChoiceFilter(choices=Application.ASVS_CHOICES) | ||
def __getitem__(self, item): | ||
return self.queryset[item] | ||
|
||
class Meta: | ||
model = Application | ||
fields = [ | ||
'name', 'organization', 'business_criticality', 'platform', 'lifecycle', 'origin', 'external_audience', | ||
'internet_accessible', 'technologies', 'regulations', 'service_level_agreements', 'tags', 'asvs_level' | ||
'internet_accessible', 'technologies', 'regulations', 'service_level_agreements', 'tags', 'asvs_level', 'data_elements' | ||
] | ||
|
||
|
||
class VulnerabilityFilter(django_filters.FilterSet): | ||
name = django_filters.CharFilter(lookup_expr='icontains') | ||
affected_app = django_filters.ModelMultipleChoiceFilter(queryset=Application.objects.all()) | ||
severity = django_filters.MultipleChoiceFilter(choices=Vulnerability.SEVERITY_CHOICES) | ||
status = django_filters.MultipleChoiceFilter(choices=Vulnerability.STATUS_CHOICES) | ||
reporter = django_filters.ModelMultipleChoiceFilter(queryset=Person.objects.all()) | ||
detection_method = django_filters.MultipleChoiceFilter(choices=Vulnerability.DETECTION_METHOD_CHOICES) | ||
vulnerability_classes = django_filters.ModelMultipleChoiceFilter(queryset=VulnerabilityClass.objects.all()) | ||
|
||
def count(self): | ||
count = 0 | ||
if self.queryset is not None: | ||
count = len(self.queryset) | ||
return count | ||
|
||
def __getitem__(self, item): | ||
return self.queryset[item] | ||
|
||
class Meta: | ||
model = Vulnerability | ||
fields = [ | ||
'name', 'affected_app', 'severity', 'vulnerability_classes', 'status', 'reporter', 'tags', | ||
'detection_method' | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename to sample_data or something not brand-specific.