Skip to content

Commit

Permalink
Validate Token for /backend/bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
sumeetpatil committed May 20, 2020
1 parent 7a648f8 commit 072e82c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docker/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ HAPROXY_STATS_PASSWORD=changeme
FRONTEND_BUGS_USER=vulas
FRONTEND_BUGS_PASSWORD=changeme

# Token for updating(PUT) or creating(POST) bugs
BACKEND_BUGS_TOKEN=FD262258-9E0E-494F-AB98-10352914D7A6

# *** OPTIONAL SETTINGS ***
# Jira (optional)
JIRA_USER=
Expand Down
6 changes: 6 additions & 0 deletions docker/haproxy/conf/haproxy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ frontend http-in
compression algo gzip

acl is_blue dst_port 8080

acl valid_token req.hdr(X-Vulas-Client-Token) -m str "${BACKEND_BUGS_TOKEN}"
acl valid_http_method method POST PUT
acl valid_path path -m sub /backend/bugs
http-request deny if valid_path valid_http_method !valid_token

acl is_backend path_beg -i /backend
acl is_cia path_beg -i /cia
acl is_bugs_admin path_beg -i /bugs
Expand Down

0 comments on commit 072e82c

Please sign in to comment.