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

pull-03 #3

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

pull-03 #3

wants to merge 5 commits into from

Conversation

sm6565
Copy link
Owner

@sm6565 sm6565 commented Oct 13, 2022

No description provided.

@sm6565
Copy link
Owner Author

sm6565 commented Oct 13, 2022

pull 03-1

Copy link

@prisma-cloud-devsecops prisma-cloud-devsecops bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prisma Cloud has found errors in this PR ⬇️

@@ -114,6 +113,7 @@ resource aws_subnet "eks_subnet2" {
})
}


resource aws_eks_cluster "eks_cluster" {
Copy link

@prisma-cloud-devsecops prisma-cloud-devsecops bot Oct 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
resource aws_eks_cluster "eks_cluster" {
resource aws_eks_cluster "eks_cluster" {
encryption_config {
resources = ["secrets"]
}
LOW   AWS EKS cluster does not have secrets encryption enabled
    Resource: aws_eks_cluster.eks_cluster | ID: BC_AWS_KUBERNETES_3

Description

Secrets in Kubernetes enables managing sensitive information such as passwords and API keys using Kubernetes-native APIs. When creating a secret resource the Kubernetes API server stores it in **etcd** in a base64 encoded form. For example, using kubectl create secret, EKS can encrypt etcd volumes at disk-level using AWS-managed encryption keys.

AWS encourages using envelope encryption to encrypt a key with another key. The motivation is security best practice. Applications store sensitive data as part of a defense in depth security strategy. A master key is stored in AWS KMS that is then utilized for data key generation in the Kubernetes API server. It is also used to encrypt/decrypt sensitive data stored in Kubernetes secrets.

Benchmarks

  • PCI-DSS V3.2 3

🎉   Fixed by commit 67a9cc7 - Prisma Cloud bot fix for terraform/aws/eks.tf

@@ -114,6 +113,7 @@ resource aws_subnet "eks_subnet2" {
})
}


resource aws_eks_cluster "eks_cluster" {
Copy link

@prisma-cloud-devsecops prisma-cloud-devsecops bot Oct 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM   AWS EKS cluster endpoint access publicly enabled
    Resource: aws_eks_cluster.eks_cluster | ID: BC_AWS_KUBERNETES_2

Description

Amazon EKS creates an endpoint for any managed Kubernetes API server to communicate with the cluster. This API server endpoint is public to the internet by default. Access to it should be regulated using AWS IAM and native Kubernetes RBAC.

We recommended that your Kubernetes API server remains private so that all communication between worker nodes and APIs stays within your VPC. If public access is needed, restrict the IP addresses that can access your API server from the internet to reduce the potential attack surface.

🎉   Fixed by commit 67a9cc7 - Prisma Cloud bot fix for terraform/aws/eks.tf

@@ -114,6 +113,7 @@ resource aws_subnet "eks_subnet2" {
})
}


resource aws_eks_cluster "eks_cluster" {
Copy link

@prisma-cloud-devsecops prisma-cloud-devsecops bot Oct 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HIGH   AWS EKS cluster security group is overly permissive to all traffic
    Resource: aws_eks_cluster.eks_cluster | ID: BC_AWS_KUBERNETES_1

Description

Amazon EKS creates an endpoint for any managed Kubernetes API server to communicate with the cluster. By default, this API server endpoint is public to the internet. Access to it should be regulated using AWS IAM and native Kubernetes RBAC.

We recommend that your Kubernetes API server remains private so that all communication between worker nodes and APIs stays within your VPC. If public access is needed, at a minimum, restrict the IP addresses that can access your API server from the internet to reduce the potential attack surface. Ensure your Amazon EKS public endpoint is not accessible to 0.0.0.0/0.

🎉   Fixed by commit 67a9cc7 - Prisma Cloud bot fix for terraform/aws/eks.tf

@@ -114,6 +113,7 @@ resource aws_subnet "eks_subnet2" {
})
}


resource aws_eks_cluster "eks_cluster" {
Copy link

@prisma-cloud-devsecops prisma-cloud-devsecops bot Oct 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOW   AWS EKS control plane logging disabled
    Resource: aws_eks_cluster.eks_cluster | ID: BC_AWS_KUBERNETES_4

How to Fix

resource "aws_eks_cluster" "pike" {   
  name_prefix= var.name
  role_arn = aws_iam_role.pike
  vpc_config {
    endpoint_public_access = false
    subnet_ids = var.subnet_ids
  }

  tags = {
    pike="permissions"
  }
  encryption_config {
    resources = ["secrets"]
  }
+  enabled_cluster_log_types = ["api", "audit", "authenticator","controllerManager","scheduler"]
}

Description

Amazon EKS control plane logging provides valuable diagnostic logs for all control plane related actions. Logging streams include cover for the following modules:
  1. Kubernetes API server component logs (api)‚ see kube-apiserver in the Kubernetes documentation.
  2. Audit (audit). Kubernetes audit logs provide a record of the individual users, administrators, or system components that have affected your cluster. For more information, see Auditing in the Kubernetes documentation.
  3. Authenticator (authenticator). For more information, see authorization in the Kubernetes documentation.
  4. Controller manager (controllerManager). For more information, see kube-controller-manager in the Kubernetes documentation.
  5. Scheduler (scheduler). For more information, see kube-scheduler in the Kubernetes documentation.

Amazon EKS control plane logging is used to detect anomalous configuration activity by your customer. It is used to track configuration changes conducted manually and programmatically, and trace back unapproved changes.

Benchmarks

  • HIPAA 164.312(B) Audit controls

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

Successfully merging this pull request may close these issues.

2 participants