Skip to content
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

Ensure High/Critical vulnerabilities in Managed Node Groups are mitigated ASAP #3752

Closed
4 tasks done
mogul opened this issue Mar 22, 2022 · 12 comments
Closed
4 tasks done

Comments

@mogul
Copy link
Contributor

mogul commented Mar 22, 2022

User Story

In order to ensure that High or Critical findings on live EC2 instances are addressed, the data.gov team want to automatically install patched packages that address findings whenever they are available.

Acceptance Criteria

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

  • GIVEN I am logged into the AWS Console
    AND I am looking at AWS Inspector
    AND I see a CVE detected for which an updated package is available
    WHEN the next maintenance window passes
    THEN I see that the CVE is no longer detected

Background

Amazon periodically releases new AWS Linux 2 AMIs for EKS that incorporate updates. However, some updates may be available between AMI versions that address CVEs, etc. We want to make sure that these updates, if they address a High or Critical finding, are installed on running instances even between the AMI update schedule. AWS Systems Manager provides a subset of functionality called Patch Manager that does this. We just need to turn it on and make sure it's running the update task on all of our EC2 instances.

Out of scope:

  • Ensuring that our Managed Node Groups are restarted with the latest AMI for our EKS version as soon as a new one becomes available.
  • Ensuring that our EKS control plane is running the latest k8s version available.

Security Considerations (required)

This work will make our compliance with the SI family of controls much tighter. No real downside identified.

Sketch

@mogul
Copy link
Contributor Author

mogul commented Mar 22, 2022

A nice example module for doing this:
https://github.com/cloudposse/terraform-aws-ssm-patch-manager

@mogul mogul added the ATO label Mar 23, 2022
@nickumia-reisys nickumia-reisys self-assigned this Mar 23, 2022
@mogul
Copy link
Contributor Author

mogul commented Mar 24, 2022

If we do end up having to define a policy for the task, there's an example of what it needs to look like here;
https://github.com/osodevops/aws-terraform-module-ssm-automated-patching/blob/master/aws_patching_iam_policy_document.tf

@mogul
Copy link
Contributor Author

mogul commented Mar 24, 2022

Iterated a bit on an SSM-focused IAM policy in the AWS Console (GSA/datagov-ssb#133) and tag-based target selection (GSA-TTS/datagov-brokerpak-eks#85) until the branch that @nickumia-reisys pushed was working locally.

@mogul
Copy link
Contributor Author

mogul commented Mar 24, 2022

@hkdctol: This is the issue where we set up automatic remediation of Critical and High vulnerabilities detected in our managed nodes, in which EKS runs. (The initial scans turned up just one CVE, which has already been remediated.)

Since we never install custom code on these nodes, we expect that AWS' continuing release of patches and our ongoing adoption of new AMI baselines (which we will also automate) mean we may never have to touch them beyond this.

@mogul
Copy link
Contributor Author

mogul commented Mar 24, 2022

Confirmed working... We saw an OpenSSL CVE in the manually-deployed EKS. You can see the "41" here referring to how many hosts had the finding.
image

We triggered the update manually (it's automatically triggered during a maintenance window at 1pm ET), and we were able to watch the number go down gradually....
image

Inspector now reports they're all clean.
image

QED

@hkdctol
Copy link
Contributor

hkdctol commented Mar 28, 2022

@nickumia-reisys on Bret's points in the above comments -- do you have screenshots or something else to export that I can set to Ryan?

@mogul
Copy link
Contributor Author

mogul commented Mar 28, 2022

I made sure Ryan saw the posts and screenshots above. From DM with him:

image

@hkdctol
Copy link
Contributor

hkdctol commented Mar 28, 2022

@mogul does Ryan need anything else from us before we cut over catalog to cloud.gov version?

@mogul
Copy link
Contributor Author

mogul commented Mar 28, 2022

He wants to see us use the GSA CIS-hardened machine images for our clusters.

He's also asking about container-scanning, but AFAIK he grudgingly agrees that was not part of the original ATO conditions. I've copied you on those DMs privately.

@rpalmer-gsa
Copy link

@mogul I think you indicated that you were going to use the hardened images provided by ISE. Container scanning isn't part of original ATO conditions, but its not a sustainable gap long term.

@hkdctol
Copy link
Contributor

hkdctol commented Mar 31, 2022

@rpalmer-gsa we've done that at #3668 and will cut over to cloud.gov unless we hear otherwise. Thanks!

@nickumia-reisys
Copy link
Contributor

Note: a copy of the findings closed from this issue were exported via the process outlined here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants