{"id":19260579,"url":"https://github.com/mitre/eks-cis-cluster-baseline","last_synced_at":"2025-06-26T08:32:37.646Z","repository":{"id":44572418,"uuid":"404858619","full_name":"mitre/eks-cis-cluster-baseline","owner":"mitre","description":"This profile implements the CIS Amazon Elastic Kubernetes Service (EKS) Benchmark version 1.0.1 (Cluster requirements).","archived":false,"fork":false,"pushed_at":"2024-01-25T19:26:34.000Z","size":158,"stargazers_count":7,"open_issues_count":10,"forks_count":2,"subscribers_count":20,"default_branch":"main","last_synced_at":"2025-04-21T16:42:34.910Z","etag":null,"topics":["aws","eks","eks-cluster","inspec","mitre-corporation","mitre-saf"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mitre.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-09T20:18:36.000Z","updated_at":"2024-07-28T17:44:20.000Z","dependencies_parsed_at":"2024-01-25T20:45:09.463Z","dependency_job_id":null,"html_url":"https://github.com/mitre/eks-cis-cluster-baseline","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mitre/eks-cis-cluster-baseline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitre%2Feks-cis-cluster-baseline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitre%2Feks-cis-cluster-baseline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitre%2Feks-cis-cluster-baseline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitre%2Feks-cis-cluster-baseline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitre","download_url":"https://codeload.github.com/mitre/eks-cis-cluster-baseline/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitre%2Feks-cis-cluster-baseline/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262029803,"owners_count":23247536,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","eks","eks-cluster","inspec","mitre-corporation","mitre-saf"],"created_at":"2024-11-09T19:21:48.733Z","updated_at":"2025-06-26T08:32:37.625Z","avatar_url":"https://github.com/mitre.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eks-cis-cluster-baseline\n\nInSpec profile to validate the secure configuration of AWS EKS, against Cluster requirements under [CIS](https://www.cisecurity.org/cis-benchmarks/)'s CIS Amazon Elastic Kubernetes Service (EKS) Benchmark version 1.0.1 and 1.3.0*.\n\n*for 4.2.x requirements\n\nThe baseline includes tests that must be executed against the Kubernetes API and tests that must be executed against the underlying nodes over SSH. This profile handles only the cluster tests, and is intended to be run alongside the [EKS CIS Node Baseline profile](https://github.com/mitre/eks-cis-node-baseline).\n\n## Getting Started\n\nThis profile should be executed from a runner host with network access to the EKS cluster under test. The runner host must have InSpec installed.\n\n**For the best security of the runner, always install on the runner the _latest version_ of InSpec and supporting Ruby language components.**\n\nLatest versions and installation options are available at the [InSpec](http://inspec.io/) site.\n\n## Dependencies\n\nThis profile is executed against an AWS EKS cluster via the Kubernetes API and the AWS CLI. The profile assumes that the runner is authenticated as an AWS role permitted to run the `kubectl` utility against the cluster and run queries using the `aws eks` CLI command.\n\n### Kubernetes API\n\nThe profile makes use of the `kubectl` utility to access the Kubernetes API. The runner host must have `kubectl` installed -- see the [Kubernetes documentation for tools](https://kubernetes.io/docs/tasks/tools/) for details.\n\nA host's connection to the Kubernetes API is established using credentials recorded in the `kubeconfig` file. For the profile to use the Kubernetes API, the runner host must either have a valid `kubeconfig` file either in the default location ($HOME/.kube/config) or have designated a file as the `kubeconfig` file using the `$KUBECONFIG` environment variable. See the [Kubernetes documentation for kubeconfig](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) for details.\n\nYou can test if the runner host has access to the Kubernetes API by running `kubectl` from the command line:\n\n```\nkubectl get nodes\n```\n\nIf the command returns a list of information on the EC2 nodes that comprise the cluster, then `kubectl` is able to support the profile.\n\n### AWS CLI\n\nSome controls in the profile require the use of the AWS CLI to investigate the EKS cluster. Ensure the runner host has the AWS CLI installed as per [Amazon's instructions](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).\n\nThe runner host must also have assumed a role with sufficient permissions to access the AWS components of the EKS cluster. If running AWS commands results in a permission error, work with your cloud administrator to ensure your role has the correct IAM privileges to access the cluster's components.\n\nTo ensure the AWS CLI is installed and configured correctly, use it to print information on the target cluster:\n\n```\naws eks describe-cluster --name \u003ccluster name\u003e --region \u003ccluster region\u003e\n```\n\n## Tailoring to Your Environment\n\nThe following inputs may be configured in an inputs \".yml\" file for the profile to run correctly for your specific environment. More information about InSpec inputs can be found in the [InSpec Profile Documentation](https://www.inspec.io/docs/reference/profiles/).\n\n```yaml\n# Used by the AWS CLI controls. Give the name of the cluster under test\n# as a string, ex. \"my-test-cluster\"\ncluster-name:\n\n# Used by the AWS CLI controls. Give the region of the cluster under test\n# as a string, ex. \"us-east-1\"\ncluster-region:\n\n# Used by 4.1.1. Give an array of roles which are permitted to hold the\n# cluster-admin role.\n# If not defined, default is: [\"system:admin\", \"system:masters\"]\nallowed_cluster_admin_principals:\n\n# Optional -- leave blank if no outside access should be allowed\n# IPs from within this array of CIDR blocks should be the only ones allowed to\n# access the cluster via k8s API from outside the VPC\n# Can be configured via AWS console\n# Ex. [\"0.0.0.0/0\"]\nallowlist_cidr_blocks:\n```\n\n## Running the Profile\n\nExecuting the profile by downloading it to the runner:\n\n```\ngit clone https://github.com/mitre/eks-cis-cluster-baseline.git\ncd eks-cis-cluster-baseline\ninspec exec . --input-file \u003cpath_to_your_input_file/name_of_your_input_file.yml\u003e --reporter cli json:node1results.json\n```\n\nExecuting the profile by executing it from this GitHub repository:\n\n```\ninspec exec https://github.com/mitre/eks-cis-cluster-baseline/archive/main.tar.gz --input-file \u003cpath_to_your_input_file/name_of_your_input_file.yml\u003e --reporter cli json:cluster-results.json\n```\n\n## Running This Baseline from a local Archive copy\n\nIf your runner is not always expected to have direct access to GitHub, use the following steps to create an archive bundle of this profile and all of its dependent tests:\n\n(Git is required to clone the InSpec profile using the instructions below. Git can be downloaded from the [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) site.)\n\n```\nmkdir profiles\ncd profiles\ngit clone https://github.com/mitre/eks-cis-cluster-baseline.git\ninspec archive eks-cis-cluster-baseline\nsudo inspec exec \u003carchive name\u003e --input-file \u003cpath_to_your_input_file/name_of_your_input_file.yml\u003e --reporter cli json:cluster-results.json\n```\n\nFor every successive run, follow these steps to always have the latest version of this baseline and dependent profiles:\n\n```\ncd eks-cis-cluster-baseline\ngit pull\ncd ..\ninspec archive eks-cis-cluster-baseline --overwrite\nsudo inspec exec \u003carchive name\u003e --input-file \u003cpath_to_your_input_file/name_of_your_input_file.yml\u003e --reporter cli json:cluster-results.json\n```\n\n## Using Heimdall for Viewing the JSON Results\n\n![Heimdall Lite 2.0 Demo GIF](https://github.com/mitre/heimdall2/blob/master/apps/frontend/public/heimdall-lite-2.0-demo-5fps.gif)\n\nThe JSON results output file can be loaded into **[heimdall-lite](https://heimdall-lite.mitre.org/)** for a user-interactive, graphical view of the InSpec results.\n\nThe JSON InSpec results file may also be loaded into a **[full heimdall server](https://github.com/mitre/heimdall)**, allowing for additional functionality such as to store and compare multiple profile runs.\n\n## Authors\n\n- Will Dower - [wdower](https://github.com/wdower)\n\n## Special Thanks\n\n- Rony Xavier - [rx294](https://github.com/rx294)\n\n## Contributing and Getting Help\n\nTo report a bug or feature request, please open an [issue](https://github.com/mitre/eks-cis-baseline/issues/new).\n\n### NOTICE\n\n© 2018-2021 The MITRE Corporation.\n\nApproved for Public Release; Distribution Unlimited. Case Number 18-3678.\n\n### NOTICE\n\nMITRE hereby grants express written permission to use, reproduce, distribute, modify, and otherwise leverage this software to the extent permitted by the licensed terms provided in the LICENSE.md file included with this project.\n\n### NOTICE\n\nThis software was produced for the U. S. Government under Contract Number HHSM-500-2012-00008I, and is subject to Federal Acquisition Regulation Clause 52.227-14, Rights in Data-General.\n\nNo other use other than that granted to the U. S. Government, or to those acting on behalf of the U. S. Government under that Clause is authorized without the express written permission of The MITRE Corporation.\n\nFor further information, please contact The MITRE Corporation, Contracts Management Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000.\n\n## NOTICE\n\nCIS Benchmarks are published by the Center for Internet Security (CIS), see: https://www.cisecurity.org/cis-benchmarks/.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitre%2Feks-cis-cluster-baseline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitre%2Feks-cis-cluster-baseline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitre%2Feks-cis-cluster-baseline/lists"}