Git Product home page Git Product logo

ministryofjustice / modernisation-platform Goto Github PK

View Code? Open in Web Editor NEW
679.0 142.0 290.0 18.85 MB

A place for the core work of the Modernisation Platform • This repository is defined and managed in Terraform

Home Page: https://user-guide.modernisation-platform.service.justice.gov.uk

License: MIT License

HCL 67.66% JavaScript 0.01% Shell 4.66% Makefile 0.02% HTML 24.13% SCSS 0.01% Go 1.22% Open Policy Agent 1.50% Python 0.79%
modernisation-platform documentation civil-service architecture-decisions aws

modernisation-platform's Introduction

Ministry of Justice Modernisation Platform

Standards Icon Format Code Icon Scorecards Icon SCA Icon Terraform SCA Icon

About this repository

This is the Ministry of Justice Modernisation Platform team's repository for core work on the Modernisation Platform. The Modernisation Platform team is a platform engineering product team which provides a hosting platform for Ministry of Justice applications which cannot be hosted on the Cloud Platform.

For more information on the Modernisation Platform please see the user guidance.

Contents

This repository currently holds the Modernisation Platform's:

Other useful repositories

Core repositories

Name Description
Modernisation Platform (this one) Our repository for core work, including our ADR and infrastructure as code
Modernisation Platform Environments The repository for user application infrastructure as code and deployment workflows
modernisation-platform-ami-builds Repository for creating pipelines to build AMIs for use on the platform
modernisation-platform-configuration-management Repository for configuration management code used on the platform
modernisation-platform-terraform-module-template Template repository used for creating other Terraform module repositories

Terraform modules - for member account use

Modernisation Platform users can use these modules in their infrastructure. They are designed to comply with best practices and to work with the platform, to make creating infrastructure quicker, easier and more secure.

Name Description
modernisation-platform-terraform-bastion-linux Module for creating Linux bastion servers in member AWS accounts
modernisation-platform-terraform-ecs-cluster Module for creating ECS cluster
modernisation-platform-terraform-s3-bucket Module for creating S3 buckets with sensible defaults e.g. replication, encryption
modernisation-platform-terraform-aws-vm-import Module that creates s3 and roles needed to import virtual machine (VM) images from your virtualization environment to Amazon EC2 as Amazon Machine Images (AMI)
modernisation-platform-terraform-pagerduty-integration Module associating an SNS topic with a PagerDuty service
modernisation-platform-terraform-loadbalancer Module that creates application load balancer in AWS with logging enabled, s3 to store logs and Athena DB to query logs
modernisation-platform-terraform-ssm-patching Module that automates the patching of ec2 instances via ssm. It creates an s3 bucket for log storage, as well as maintenance windows, tasks, resource groups, and patch baselines.
modernisation-platform-terraform-ec2-instance Module for creating an EC2 instance
modernisation-platform-terraform-ec2-autoscaling-group Module for creating an EC2 autoscaling group
modernisation-platform-terraform-lambda-function Module for creating a Lambda Function

Terraform modules - used by the core platform

These modules are used by the Modernisation Platform's core infrastructure

Name Description
modernisation-platform-terraform-baselines Module for enabling and configuring common baseline services such as SecurityHub
modernisation-platform-terraform-cross-account-access Module for creating an IAM role that can be assumed from another account
modernisation-platform-terraform-environments Module for creating organizational units and accounts within AWS Organizations from JSON files
modernisation-platform-terraform-iam-superadmins Module for creating defined IAM users as superadmins
modernisation-platform-terraform-member-vpc Module for member VPC accounts
modernisation-platform-github-oidc-provider Module for creating OIDC providers to use in GitHub Actions

Tools

Name Description
modernisation-platform-instance-scheduler A Go lambda function for stopping and starting instance, rds resources and autoscaling groups. The lambda is used by the core platform and can be reused outside of the platform with minimal changes
modernisation-platform-cp-network-test Container bundled with utilities for network testing

modernisation-platform's People

Contributors

adeweetman-al avatar andrewmooreio avatar astrobinson avatar davidkelliott avatar dependabot[bot] avatar dms1981 avatar donmasters avatar drobinson-moj avatar ep-93 avatar ewastempel avatar georgepstaylor avatar gfou-al avatar github-actions[bot] avatar harichintala1 avatar jacobwoffenden avatar jakemulley avatar julialawrence avatar kcbotsh avatar khatraf avatar markgov avatar mikereiddigital avatar modernisation-platform-ci avatar pete-j-g avatar philhorrocks avatar richgreen-moj avatar robertsweetman avatar stevelinden avatar sukeshreddyg avatar vc13837 avatar zuriguardiola avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

modernisation-platform's Issues

How do we manage access to platform

Look at access management this week and how we can make that either self-service and/or federated/and or any other ideas so we can get some basic blockers out the way - under the ethos of ‘if you can’t access infrastructure, how are you going to do anything else?’

Move clickops repository management into Terraform

As we're using GitHub as our version control, we should move the infrastructure definitions (repositories, teams, etc) from clickops to Terraform, so we can recreate if needed, but also to be able to configure repositories in the same way easily.

SPIKE: AWS Budgets

Add a single budget rule to see if this is useful. Can this be done by resource, by account?

What are the notification options? Let's go with the simplest, which is probably an email to our group gmail.

Do we want alerts to go to tenants as well? Should probably keep it to notifications to the platform team at first.

Adding budgets will allow us to be alerted to excessive or unusual usage

This is probably a duplicate of #1897

New feature to add external collaborators as IAM users

At MOJ we use a mix of external collaborators and GitHub organisation members to define access to repositories. With the current AWS SSO implementation, we import all organisation members and team affiliations. GitHub external collaborators aren't part of a team, but are part of repositories; so we need to explore options for importing external collaborators and a "team membership" to provide access to AWS accounts.

Deliver a Sonarqube code analyser

As part of the new platform requirements we have decided to use Sonarqube as the static code analyser.

Building this solution will require many other components to be decided and in place for this to be completed.

Spike: Investigate how we can centrally report on non-tagged resources

We should look at creating something similar to the Cloud Platform's Orphaned Resources but for non-tagged resources in AWS, so we can find their owner.

Evaluate our resources and member resources vs the guidance - list of non compliant resources. We can then look at the automation / process for reporting on this regularly as a next step.

Ask Craig
Is there something AWS native that will do the job for us?

Create ADR

We want to record our architecture decisions during the design and build of the Modernisation Platform.

Investigate Terraform workspaces

We should investigate Terraform workspaces to see if it would benefit us, namely for making it easier to only specify one set of Terraform providers for reuse across accounts rather than generating a provider file for each account.

@davidkelliott and I had a brief discussion about this and it'd be good to investigate this further.

Investigate SecurityHub policy that results in AccessDenied for config:GetComplianceDetailsByConfigRule

AWS SecurityHub is enabled via the modernisation-platform-terraform-baselines Terraform module. It uses the AWSServiceRoleForSecurityHub service-linked role. It integrates with AWS Config to configure a standard set of rules.

When SecurityHub assumes the service-linked role, and tries to perform config:GetComplianceDetailsByConfigRule on its own standard set of rules, the resource throws an AccessDenied error. This only happens on the SecurityHub-created rules, not any that are configured manually.

The error it throws is:
User: arn:aws:sts::${accountId}:assumed-role/AWSServiceRoleForSecurityHub/securityhub is not authorized to perform: config:GetComplianceDetailsByConfigRule on resource: securityhub-${rule-name}.

This full error stack is viewable in CloudWatch Logs if you search for AccessDenied.

Time box to 1 day.

Integrate CloudWatch Alarms with Slack

As part of modernisation-platform-terraform-baselines we create CloudWatch Alarms to comply with the CIS AWS Foundations Benchmark security standard.

We should integrate these with Slack channels so they're visible to everyone in the team rather than having to individually subscribe people. We should be able to specify a Slack channel to post these to, so we can reuse it for any accounts configured within the Modernisation Platform.

Automate terraform init, plan for GitHub resources

We should automate terraform init and terraform plan when a PR is opened that changes the GitHub resources as configured in terraform/github. We should add the output as a PR comment so we know what changes are pending if the PR is merged.

To run plan, we need to set a PAT that has the scope for organisation and repository management within the Ministry of Justice organisation on GitHub.

For this, we should use a dedicated GitHub user that is part of the organisation and has the right scope set, as the preset GITHUB_TOKEN in GitHub Actions only has the scope for the repository it is called in.

Use releases for self-created modules & pin them in versions.tf

As our team starts to grow, we should use GitHub releases for self-created modules that we've written, and pin them in versions.tf. This will allow us to work on modules collaboratively rather than currently where it uses the latest commit on the main branch.

It also means we can rearchitect modules and release new major versions if there are breaking changes.

Fix baseline module dependencies

The baseline module currently fails to provision CloudTrail logs because it doesn't wait for the log group to finish being created.

Write a Lambda function to refresh and report on AWS Trusted Advisor

We should utilise AWS Trusted Advisor to provide us with some monitoring for the following, across other AWS services:

  • Cost optimisation
  • Performance
  • Security
  • Fault tolerance
  • Service limits

Trusted Advisor allows you to refresh metrics via the console and Support API to get up-to-date information. We should look at sending this information to CloudWatch, Slack, etc.

Discuss tooling for CI/CD

We should define what tooling we'll be using for CI/CD and any applicable setup. We've previously talked and thought about:

  • GitHub Actions
  • CircleCI
  • Concourse
    ...and other CI/CD providers.

We also need to think if we're going for a self-hosted approach or not. We should record a decision in the ADR.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.