-
Notifications
You must be signed in to change notification settings - Fork 100
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
[SC-7] Restrict egress traffic from cloud.gov-hosted apps #3755
Comments
Can a user with permissions create the needed The command should be: |
All done... I also applied the |
All apps created with this gist. |
Ok, easy change. Thanks for letting me know. The sketch has |
I don't have permissions to remove the security group, but am at the point to test it. @hkdctol or @mogul, can you please do this for me? cf target -s development
cf unbind-running-security-group public_networks_egress and/or perhaps: cf target -s staging
cf unbind-running-security-group public_networks_egress Thank you! |
That's the administrator-facing command for setting up defaults on the whole platform. You want:
and
...both of which I've just done. The change applies at the next app restart. |
We believe the issue we're hitting in getting inventory/catalog to successfully start has to do with caddy's auto_http, which is set to off. @mogul, do you recall why that is? The error we get when trying to run caddy with anything other than
|
Auto-https is off because the platform already provisions a TLS certificate with the route name as one of its Subject Alternative Names (SANs), so we don't want Caddy to handle it. The start script watches for the platform to rotate that certificate and restarts Caddy if it needs to. See the code here: We could probably turn of TLS entirely for client connections to Caddy just by having it listen on port 61443; see the docs here: So I'm guessing something else is wrong. I can take a look at this with you Tuesday morning during your huddle time, I think. |
I mean technically this is correct, trying to listen on a privileged port like 80 is a no-no for non-privileged applications. The question is: Why would CF be passing Caddy port 80 in the PORT environment variable Caddy references here? It typically provides 8080. So you'll want to investigate if CF is really passing 80 or that env var value isn't actually getting used. |
Here is the output of Wall of text
It looks like |
I've been struggling with getting inventory on dev to work. I think now it's (at least in part) due to the stuff we did in huddle on Monday. @nickumia-reisys, can you help walk me through the kubectl stuff to clean up the old inventory instance in dev, please? |
Yes.. but it's going to be blocked by the other things going on (unfortunately), |
Next steps:
Inventory ticket may remain in blocked; we have hit GSA-TTS/cg-egress-proxy#5 with inventory using s3 buckets and the app fails to start up. We will treat these tickets as independent. Once all are resolved, then we can revisit locking down the whole space completely. |
Blocked by creating a support issue with AWS/Cloud.gov |
Updates:
|
One note that applies to this ticket as a whole:
|
General note... Seeing that the egress-proxy is fragile and requires more expertise in how it works than it should to make it work, there's some work percolating in the background to turn the egress-proxy into a brokerable service. |
Pending new bugs (such as #4053), all of our apps have been proven in some regard to work while filtering traffic through the Current status:
Script to see if egress proxy is enabled: cf t -s <space>
apps='catalog-web catalog-admin catalog-fetch catalog-gather inventory'
for app in $apps; do echo -n "$app: "; cf curl "v3/apps/$(cf app $app --guid)/environment_variables" | jq .var.https_proxy; done Doing the last AC of this ticket of disabling the security group References: |
On the staging issues: Try setting the value of (Props to @rahearn for first bringing this problem to my attention... Something to be documented for sure.) |
Here's the The one gotcha I've found with it is that .profile doesn't get run automatically when you |
(Technically you're supposed to run |
Yeah, but even after you run |
|
While there continues to be generall egress anomalies and upgrade work (not to mention that our deployment of this needs to be re-vamped) I believe the initial effort has been complete for a while now. Here's to a final cringe at this ticket 😣 🥂 |
User Story
In order to minimize the harm a compromised app can do, the data.gov team wants egress traffic from cloud.gov-hosted data.gov applications to be limited to just expected destinations.
Acceptance Criteria
[ACs should be clearly demoable/verifiable whenever possible. Try specifying them using BDD.]
AND I am targeting the
gsa-datagov
organizationcf space prod
AND I look at the line that starts with
running security groups:
THEN I do NOT see the security group
public_networks_egress
listed.cf space prod-egress
AND I look at the line that starts with
running security groups:
THEN I DO see the security group
public_networks_egress
listed.cf t -s prod-egress; cf apps
THEN I see a running instance of the
cg-egress-proxy
for each app with egress needs in theprod
space.cf t -s prod; cf network-policies
THEN I see a rules allowing traffic from each app with egress needs in the
prod
space to port 443 on the corresponding proxy app in theprod-egress
space.Background
SC-7 has traditionally been hard to implement for cloud.gov apps. However, the cloud.gov team has now made it possible to drop the ASG allowing public egress traffic for particular spaces. This enables us to run our production space in the "restricted" configuration, when egress traffic is only allowed for bound services (excluding S3). We then set up dedicated egress proxies in a space with external access. Doing this also enables apps in spaces without
public_egress
to access S3.cg-egress-proxy
was developed for a high-profile GSA project deployed on cloud.gov that had extremely high public visibility, and was required to meet NIST control SC-7 to ensure egress/lateral compromise was not possible. However, that app did not proceed to production despite getting an ATO. As a result, data.gov might be the first team to ship a working SC-7 egress solution for cloud.gov apps. This will set a new precedent for TTS' standard cloud.gov compliance practice, so be sure to make any fixes necessary upstream incg-egress-proxy
!Security Considerations (required)
This work will ensure egress traffic from cloud.gov-hosted data.gov apps is properly restricted by default, as required by NIST control SC-7.
Sketch
prod-egress
space based on .acl files, with network policies that allow each app to talk to the corresponding proxydashboard
,catalog-gather
, andcatalog-harvest
apps allowing them to reach the expected set of .gov/.mil/whatever domains that they crawl.The text was updated successfully, but these errors were encountered: