forked from HHS/TANF-app
-
Notifications
You must be signed in to change notification settings - Fork 4
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
2429/single clamav #2718
Merged
Merged
2429/single clamav #2718
Changes from 38 commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
99531e7
removed clamav from being deployed unless in production. Pointed AV S…
43527f5
added network policy to connect to prod clamAV
58cf0d1
use prod clam av in cloudgov.py too
4a55e18
Merge branch 'develop' into 2429/single-clamav
8c98ce2
fixing 'f-string is missing placeholders' now that we are hardcoding …
dab98ab
removed quotes from add-network-policy command when interpolation not…
fd2d8a0
removed add-network-policy from deploy-backend.sh and added documenta…
9131789
add nginx router and manifest
raftmsohani 648e3a5
Merge branch 'develop' into 2429/single-clamav
f5afac6
Merge branch '2429/single-clamav' of github.com:raft-tech/TANF-app in…
a32ead7
cleaned up
b55aa57
Update README for CLAMAV
raftmsohani d7a9bee
Merge branch '2429/single-clamav' of https://github.com/raft-tech/TAN…
raftmsohani b005aa0
updated README file with deployment commands
raftmsohani 71d77d4
added network policy for backend to clamav router
raftmsohani 35048bb
updated boundry diagram
raftmsohani d31f037
updated boundry diagram
raftmsohani 8ea10f1
Removed AV_SCAN url from cloud.gov settings file
raftmsohani e14fd82
update setting environment variable
raftmsohani ca4c5f1
refactored circle ci for static clam av vars since only one server no…
73677dd
Merge branch '2429/single-clamav' of github.com:raft-tech/TANF-app in…
a2b5089
needs env_var_name, not string for login-cloud-dot-gov
38d8c0a
revert back to env_var_name type for downstream login_cloud_dot_gov c…
006d60d
added prod prefix back in
acf6814
Merge branch 'develop' into 2429/single-clamav
9b72df8
readd AV_SCAN_URL
ee6c265
changed the inline comment in common.py settings
raftmsohani d695c41
Merge branch '2429/single-clamav' of https://github.com/raft-tech/TAN…
raftmsohani 3c6467e
README file rewrite
raftmsohani 19ee517
added note
79c1f85
Merge branch '2429/single-clamav' of github.com:raft-tech/TANF-app in…
1f39173
Merge branch 'develop' into 2429/single-clamav
raftmsohani 714bbc8
Merge branch 'develop' into 2429/single-clamav
raftmsohani 16ab89f
readded clam av nginx router url to manifest and setting network poli…
9e2c437
updated for using backend to set ENV for ClamAV URL.
cc603c9
Merge branch 'develop' into 2429/single-clamav
raftmsohani 6415c92
getting rid of spaces on empty last line of manifest
a1fb14d
Merge branch '2429/single-clamav' of github.com:raft-tech/TANF-app in…
1638950
Remove AV_SCAN_URL from deploy-backend
raftmsohani 6193455
updated README for clarification for clam-av-nginx-router naming
92727a2
changed https to http for internal routing to clamav-nginx server
9c401ed
Merge branch 'develop' into 2429/single-clamav
3526604
moving setting vars for clamav server to above cf push
799affe
Merge branch 'develop' into 2429/single-clamav
andrew-jameson 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
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# CLAMAV | ||
|
||
In order to have one CLAMAV instance, existing in prod, the Nginx router is created | ||
for CLAMAV to forward the traffic from 'dev' and 'staging' spaces into | ||
prod space, where the CLAMAV service exists. | ||
|
||
## Deploy Nginx instance | ||
To route the clamav traffic to clamav in prod, each space needs to have one instance of _Nginx Router_ which routes traffic to clamav. | ||
|
||
In order to deploy the nginx router instance, change your directory to `tdrs-backend/clamav-router/` and run the following command while logged into the target space: | ||
|
||
|
||
>`cf push {nginx_instance_name} -f manifest.yml --no-route` | ||
|
||
, where _nginx_instance_name_ can be : _tdp-clamav-nginx_. | ||
|
||
The instance name then will be set as an environment variable to redirect each instance traffic. This will deploy the nginx instance to the target environment. | ||
|
||
## Further communication configurations | ||
|
||
### Setup Individual Instances | ||
|
||
First, set the environment variable __AV_SCAN_URL__ as follows: | ||
``` | ||
Environment variable name: AV_SCAN_URL | ||
Environment variable value: http://{nginx_instance}.apps.internal:9000/scan | ||
``` | ||
|
||
### Add network policy from _{tdp-clamav-nginx}_ to clamav in prod | ||
To enable traffic between the "__nginx instance__" and "__clamav instance in production__", we need to add the network policiy and route between the two: | ||
|
||
>`cf add-network-policy {nginx_instance} "clamav-rest" -s "tanf-prod" --protocol tcp --port 9000` | ||
e.g: `{nginx_instance_name} = tdp-clamav-nginx-dev` | ||
|
||
### Add network policy from _{backend_instance}_ to _tdp-clamav-nginx_ | ||
|
||
>`cf add-network-policy {backend_instance} {nginx_instance} --protocol tcp --port 9000` | ||
|
||
where e.g: `backend_instance = tdp-backend-develop` | ||
|
||
### Add route for _tdp-clamav-nginx_ | ||
|
||
Note: Make sure to delete (if existing) routes that are not being used. In some rare cases, a mal-assigned network policy can interfere with outgoing traffic. As an example, a policy like | ||
>`cf delete-route app.cloud.gov --hostname tdp-frontend-staging` | ||
|
||
Add route: | ||
|
||
>`cf map-route {nginx_instance} apps.internal --hostname {nginx_instance}` |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: 1 | ||
applications: | ||
- name: tdp-clamav-nginx | ||
buildpacks: | ||
- https://github.com/cloudfoundry/nginx-buildpack.git#v1.2.6 | ||
memory: 32M | ||
instances: 1 | ||
disk_quota: 64M | ||
timeout: 180 |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
events { worker_connections 1024; | ||
} | ||
|
||
# This opens a route to clamav prod | ||
http{ | ||
server { | ||
listen {{port}}; | ||
location /scan { | ||
proxy_pass http://tanf-prod-clamav-rest.apps.internal:9000/scan; | ||
proxy_pass_request_headers on; | ||
} | ||
} | ||
server { | ||
listen 9000; | ||
location /scan { | ||
proxy_pass http://tanf-prod-clamav-rest.apps.internal:9000/scan; | ||
proxy_pass_request_headers on; | ||
} | ||
} | ||
} |
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
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.
does this require a different nginx proxy in each environment?
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.
Yes, we basically have two nginx proxy, one for dev and one for staging
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.
are those deployed in ci or manually via the instructions included in the readme?