Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into feat-improve-performance-s…
Browse files Browse the repository at this point in the history
…can-multiline
  • Loading branch information
mpast committed Dec 26, 2022
2 parents 73a2954 + 963f914 commit 1e5a86e
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 13 deletions.
10 changes: 4 additions & 6 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# Ignore the logs
app/logs/
rabbitmq/logs/
# Ignore rabbitmq and nginx
rabbitmq
nginx

# Ignore apk directory
app/media/apk

# Ignoring git folders
.git

# Ignore certificates
nginx/ssl/nginx.crt
nginx/ssl/nginx.key
.git
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
*.DS_Store
.env
.vscode
app/logs/*
rabbitmq/logs/*
nginx/logs/*
app/media/*
*.sqlite3
*.sqlite
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ RUN apt-get update && \
apt-get clean

RUN apt-get update && \
apt-get install -y openjdk-11-jdk p11-kit wkhtmltopdf && \
apt-get install -y openjdk-11-jdk p11-kit wkhtmltopdf libqt5gui5 && \
apt-get install -y && \
apt-get clean && \
update-ca-certificates -f

# Get JADX Tool
ENV JADX_VERSION 1.2.0
ENV JADX_VERSION 1.4.5

RUN \
wget "https://github.com/skylot/jadx/releases/download/v$JADX_VERSION/jadx-$JADX_VERSION.zip" && \
Expand Down
1 change: 0 additions & 1 deletion app/config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
license=openapi.License(name="GNU v3"),
),
public=True,
url="http://localhost:8888/api/v1/"
)

# API router
Expand Down
6 changes: 4 additions & 2 deletions app/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def create_finding_on_dojo(finding):
'date': finding.created_on.strftime("%Y-%m-%d"),
#'product': product_id,
#'engagement': engagement_id,
'test': finding.scan.defectdojo_id,
'test': finding.scan.defectdojo_id if finding.scan.defectdojo_id else 1,
'impact': "N/A",
'active': True,
#'verified': verified,
Expand Down Expand Up @@ -223,8 +223,10 @@ def create_finding_on_dojo(finding):
response = requests.post(settings.DEFECTDOJO_API_URL + 'findings/', data = json_data, headers = headers, verify = False)
json_response = response.json()
logger.debug(json_response)
if (json_response['id']):
if ('id' in json_response and json_response['id']):
finding.defectdojo_id = json_response['id']
finding.save()
else:
logger.error(json_response)
except Exception as e:
logger.error(e)
4 changes: 2 additions & 2 deletions app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def home(request):
try:
scans_data[scan.id]['antivirus'] = VirusTotalScan.objects.filter(scan=scan.id).latest('created_on')
except Exception as e:
logger.error(e)
logger.debug(e)

return render(request, 'home.html', {
'apps': apps,
Expand Down Expand Up @@ -285,7 +285,7 @@ def findings(request, scan_id=''):
if (push_dojo and settings.DEFECTDOJO_ENABLED):
analysis.create_finding_on_dojo(f)
except Exception as e:
logger.error(e)
logger.debug(e)
if (edit and ok):
messages.success(request, 'Edited successfully')
else:
Expand Down
1 change: 1 addition & 0 deletions docker-compose.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ services:
- .:/app
- ./nginx/app_tls.conf:/etc/nginx/conf.d/app_tls.conf
- ./nginx/ssl:/etc/nginx/ssl
- ./nginx/logs:/var/log/nginx
depends_on:
- web
restart: on-failure
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ services:
volumes:
- .:/app
- ./nginx/app.conf:/etc/nginx/conf.d/app.conf
- ./nginx/logs:/var/log/nginx
depends_on:
- web
restart: on-failure
Expand Down
3 changes: 3 additions & 0 deletions nginx/app.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ upstream web {

server {

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

client_max_body_size 300M;
uwsgi_connect_timeout 500;
uwsgi_read_timeout 500;
Expand Down
3 changes: 3 additions & 0 deletions nginx/app_tls.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ upstream app {
}

server {
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

ssl_certificate /etc/nginx/ssl/nginx.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key;

Expand Down

0 comments on commit 1e5a86e

Please sign in to comment.