Skip to content

Commit

Permalink
Merge pull request #2903 from raft-tech/2839-nginx-dns
Browse files Browse the repository at this point in the history
Nginx DNS Issue: Kibana and ClamAV
  • Loading branch information
elipe17 authored Apr 18, 2024
2 parents c2e57c6 + 4f725d9 commit 53f6f3f
Show file tree
Hide file tree
Showing 12 changed files with 77 additions and 391 deletions.
4 changes: 2 additions & 2 deletions .circleci/build-and-test/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
steps:
- checkout
- docker-compose-check
- docker-compose-up-with-elastic-backend
- docker-compose-up-backend
- run:
name: Run Unit Tests And Create Code Coverage Report
command: |
Expand Down Expand Up @@ -46,7 +46,7 @@
steps:
- checkout
- docker-compose-check
- docker-compose-up-with-elastic-backend
- docker-compose-up-backend
- docker-compose-up-frontend
- install-nodejs-machine
- disable-npm-audit
Expand Down
6 changes: 0 additions & 6 deletions .circleci/util/commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
name: Build and spin-up Django API service
command: cd tdrs-backend; docker network create external-net; docker-compose up -d --build

docker-compose-up-with-elastic-backend:
steps:
- run:
name: Build and spin-up Django API service
command: cd tdrs-backend; docker network create external-net; docker-compose --profile elastic_setup up -d --build

cf-check:
steps:
- run:
Expand Down
36 changes: 28 additions & 8 deletions tdrs-backend/clamav-router/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,43 @@ events {
worker_connections 1024;
}
# This opens a route to clamav prod
http{
resolver {{nameservers}} valid=10s;
http{
charset utf-8;
log_format cloudfoundry 'NginxLog "$request" $status $body_bytes_sent';
access_log /dev/stdout cloudfoundry;

resolver {{nameservers}} valid=5s;

log_format compression '$remote_addr - $remote_user [$time_local] '
'"proxy_host and upstream_addr": $proxy_host $upstream_addr, '
' "request": $request, '
'"body_bytes_sent" : $body_bytes_sent, '
'"request_body": $request_body, '
'"http_x_forwarded_for": $http_x_forwarded_for, '
'"host": $host, '
' "status": $status, '
'"proxy_add_x_forwarded_for": $proxy_add_x_forwarded_for, '
'"http_referer": $http_referer, '
'"http_user_agent": $http_user_agent, '
'"cookies=$http_cookie;" "server=$server_name" "http_host=$http_host"'
' Proxy: "$proxy_host" "$upstream_addr"';

server {
client_max_body_size 100m;
listen {{port}};
client_max_body_size 100m;
location /scan {
proxy_pass http://tanf-prod-clamav-rest.apps.internal:9000/scan;
location ~* ^/scan(.*)$ {
set $clamav http://tanf-prod-clamav-rest.apps.internal:9000/scan;
proxy_pass $clamav$1$is_args$args;
proxy_pass_request_headers on;
}
}

server {
client_max_body_size 100m;
listen 9000;
client_max_body_size 100m;
location /scan {
proxy_pass http://tanf-prod-clamav-rest.apps.internal:9000/scan;
location ~* ^/scan(.*)$ {
set $clamav http://tanf-prod-clamav-rest.apps.internal:9000/scan;
proxy_pass $clamav$1$is_args$args;
proxy_pass_request_headers on;
}
}
Expand Down
5 changes: 2 additions & 3 deletions tdrs-backend/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ services:
- ../scripts/localstack-setup.sh:/docker-entrypoint-initaws.d/localstack-setup.sh

kibana:
image: docker.elastic.co/kibana/kibana-oss:7.4.2
image: docker.elastic.co/kibana/kibana-oss:7.10.2
ports:
- 5601:5601
environment:
Expand All @@ -59,11 +59,10 @@ services:
- elastic

elastic:
image: elasticsearch:7.17.6
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
environment:
- discovery.type=single-node
- logger.discovery.level=debug
- xpack.security.enabled=false
ports:
- 9200:9200
- 9300:9300
Expand Down
10 changes: 0 additions & 10 deletions tdrs-backend/elastic_setup/Dockerfile

This file was deleted.

110 changes: 0 additions & 110 deletions tdrs-backend/elastic_setup/entrypoint.sh

This file was deleted.

Loading

0 comments on commit 53f6f3f

Please sign in to comment.