Thursday, January 9, 2025

Fannie Mae’s process for developing policy as code with Terr…

Share


The Federal National Mortgage Association (FNMA), commonly known as Fannie Mae, is the largest company in the United States and the fifth largest company in the world, by assets. As a government-sponsored enterprise, they are subject to a large number of IT security and compliance regulations.

Rather than getting bogged down in an ever-evolving regulatory landscape, Fannie Mae is accelerating operations with IT infrastructure lifecycle management products like Terraform Enterprise. Specifically, they’re automating large-scale cloud infrastructure provisioning while also mitigating security and compliance risks with policy as code, which is supported by Terraform’s Sentinel framework.

This post is based off of the HashiConf session, Sentinel policy as code in a highly regulated financial industry by Maksim Frenkel, to serve as a guide for your organization to learn from Fannie Mae’s policy as code journey and build your own policy development strategy for risk reduction.

»Terraform and Sentinel at Fannie Mae

Terraform Enterprise has become an integral part of Fannie Mae’s digital transformation journey. Their IT environment includes:

  • 700+ active Terraform workspaces
  • 80+ AWS services
  • 450+ Sentinel policies

At Fannie Mae, Sentinel policies serve as guardrails, ensuring that AWS services are consumed securely in a regulated environment. Fannie Mae derives its cloud security standards from various compliance and data protection frameworks, such as:

  • NIST 800-53 and RMF
  • CIS benchmarks
  • FIPS 140-2 data protection
  • Department of Defense zero trust

The integration of these standards into Sentinel policies ensures that development environments meet all compliance requirements before infrastructure is provisioned.

So what benefits does Fannie Mae see in using Sentinel for policy as code?

»

This proactive approach minimizes the risk of non-compliance in production environments, allowing development teams to address compliance issues early in the dev environment testing process, before they promote that infrastructure to production.

It also shifts more responsibility for compliance left toward the developer. Instead of manual compliance or security reviews, developers have guardrails embedded in their Terraform workflows that give immediate feedback if there’s a policy violation.

»

Terraform Registry. A good example is the CIS benchmarks Sentinel policies.

»

»

Terraform provider documentation in the Terraform Registry for the infrastructure component they want to build a policy for. The screenshot below shows what things you would want to research in the documentation. In this example, the team wants to make a policy for Amazon DynamoDB provisioning.

Terraform registry research

Use this documentation to create a granular Sentinel policy specification. Fannie Mae includes five sections in each specification: Resource type, attributes, allowed values, and enforcement level. Your own specifications could add more custom areas but the example specification below uses just Fannie Mae’s five sections (filled in with content for a DynamoDB policy):

»

»

»

SSM parameter value.
//standard/kms_key_arn
(This ensures the KMS key is set to an allowed value. In this example, it has to come from an approved SSM parameter that holds the KMS key)

»

Sentinel’s three levels of enforcement. Hard mandatory means that provisioning is blocked until all requirements in the policy are met.)

You’ll want the stakeholders and subject matter experts to review and provide feedback on the policy requirements specification before moving on to the next stage.

»

»

Sentinel policy tests to validate those test cases.

There are two utilities in Sentinel that help with test generation:

  • Sentinel mocks: Exported data from a Terraform plan to mimic real-world conditions
  • Sentinel CLI: A utility to evaluate Sentinel policies against mock data

Video starts at the “Testing” section of the talk.

Having a test suite built for your policies becomes even more important as time goes on because policies become harder to maintain if you don’t have ways of validating that they still result in secure, compliant provisioning even after you modify them.

»

»

»

Terraform Enterprise, Fannie Mae pointed out several key areas for other adopters to focus on:

»

»

»

»

»

Source link

Read more

Local News