data.gov icon indicating copy to clipboard operation
data.gov copied to clipboard

[SC-7] Restrict egress traffic from inventory

Open robert-bryson opened this issue 3 years ago • 3 comments

This is a copy of https://github.com/GSA/data.gov/issues/3755 pared down to just the inventory apps.

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 inventory applications to be limited to just expected destinations.

Acceptance Criteria

[ACs should be clearly demoable/verifiable whenever possible. Try specifying them using BDD.]

  • GIVEN I am logged into cloud.gov
    AND I am targeting the gsa-datagov organization
    • [ ] WHEN I run 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 the prod space.
    • [ ] WHEN I run 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 the prod-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 in cg-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

robert-bryson avatar Apr 19 '22 16:04 robert-bryson

Currently blocked by https://github.com/cloud-gov/product/issues/1775

jbrown-xentity avatar Jun 15 '22 20:06 jbrown-xentity

Moving to blocked for now pending cloud.gov ticket on S3 issue

hkdctol avatar Jun 16 '22 20:06 hkdctol

Latest update:

any update on the S3 gateway proxying blockers...? I saw that the Federalist and image repository issues seemed to be resolved...

Yes finally got an answer from AWS and need to test it out in staging. Will work on that this week.

mogul avatar Aug 08 '22 17:08 mogul

I took a quick look at this and it seems like a very similar issue as before: ERR botocore.exceptions.SSLError: SSL validation failed for https://s3-us-gov-west-1.amazonaws.com/cg-efc8a388-5300-46f2-97a7-62792fb14b53 [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1131) Will look more deeply, but don't feel optimistic.

robert-bryson avatar Oct 27 '22 19:10 robert-bryson

Is egress proxy working for catalog? Because if it is, there should be no platform reasons why it shouldn't work for inventory, right?

nickumia-reisys avatar Oct 27 '22 19:10 nickumia-reisys

We are on different version of python and probably have some other small change that could effect this.

nickumia-reisys avatar Oct 27 '22 19:10 nickumia-reisys

Egress proxy has been successfully deployed to inventory and has been live for more than a day. I feel like there should be important notes that we put here. But I can't think of anything, so hopefully the notes in the above PRs are enough.

nickumia-reisys avatar Nov 08 '22 12:11 nickumia-reisys