项目作者: Mikej81

项目描述 :
Hardened (FIPS) Host for NGINX, Docker, Kubernets, etc
高级语言: HCL
项目地址: git://github.com/Mikej81/ubuntu-hardened-host.git
创建时间: 2021-03-26T15:28:44Z
项目社区:https://github.com/Mikej81/ubuntu-hardened-host

开源协议:Apache License 2.0

下载


ubuntu-hardened-host

Hardened (FIPS) Host for NGINX, Docker, Kubernetes, etc

  • This will deploy a single Ubuntu 18.04 (Bionic) Instance, apply security hardening configurations, install NGINX/NGINX+, Docker, and Kubernetes.
  • Then use certbot to install valid certificate.
  • Then download and scan with OpenScap and Inspec, saving the results to the default index and inspec.json.

OpenScap

  • Current configs are recieving A+ on SSL Labs.

SSL Labs

to do

Deployment

  • Change the variables to match your requirements, example:
  1. variable adminUserName { default = "xadmin" }
  2. variable adminPassword { default = "2018F5Networks!!" }
  3. variable adminPubKey { default = "~/.ssh/id_rsa.pub" }
  4. variable location { default = "usgovvirginia" }
  5. variable region { default = "USGov Virginia" }
  6. variable prefix { default = "mjc" }
  7. ...
  8. variable region_domain { default = "usgovvirginia.cloudapp.usgovcloudapi.net" }
  9. # https://www.open-scap.org/security-policies/choosing-policy/
  10. variable oscap_profile { default = "https://security-metadata.canonical.com/oval/com.ubuntu.$(lsb_release -cs).usn.oval.xml.bz2" }
  11. variable lsb_release { default = "bionic" }
  12. ...
  13. variable tags {
  14. default = {
  15. "purpose" = "public"
  16. "environment" = "env" #ex. dev/staging/prod
  17. "owner" = "email@domain" # will be passed to certbot
  18. "group" = "group"
  19. "costcenter" = "costcenter"
  20. "application" = "app"
  21. }
  22. }
  1. terraform init
  2. teraform plan
  3. terraform apply
  • Wait a few minutes for cloud-init to complete and a system reboot.
  • open https://[URL] from terraform outputs.
  1. Outputs:
  2. output secure_oscap_results { value = "https://${azurerm_public_ip.publicip.fqdn}" }
  3. output secure_inspec_results { value = "https://${azurerm_public_ip.publicip.fqdn}/inspec.json" }