kubectl-sgmap

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2024 License: MIT

README

kubectl-sgmap

kubectl-sgmap is a custom kubectl plugin that displays the mapping of ENIs (Elastic Network Interfaces) and security groups assigned to pods in an EKS (Elastic Kubernetes Service) environment with Security Groups for Pods enabled. This plugin helps in auditing and managing pod-to-network associations to ensure security and compliance in Kubernetes clusters.

Features

  • Lists ENIs and security groups assigned to each pod.
  • Works specifically in EKS environments with Security Groups for Pods enabled.
  • Provides an easy-to-read output for network security auditing.

Requirements

  • Kubernetes version: >= 1.30
  • EKS environment with Security Groups for Pods enabled
  • kubectl: >= 1.30
  • AWS CLI configured with necessary permissions

Installation

To install kubectl-sgmap, follow these steps:

git clone https://github.com/naka-gawa/kubectl-sgmap.git
cd kubectl-sgmap
make install

Usage

Once installed, you can use the plugin with the following command: This command will display a list of ENIs and security groups associated with each pod running in your EKS cluster.

kubectl sgmap pod -n [NameSpace]
Example Output
╰─ k sgmap pod -n test
POD NAME                                             IP ADDRESS       ENI ID                  SECURITY GROUP IDS
xxxxx-123455678-12345                                192.168.1.1      eni-123456789abcdefgh   [sg-0123456789abcdefg]
xxxxx-123455678-12346                                192.168.10.9     eni-123456789abcdefgh   [sg-0123456789abcdefg]
~snip~

Contributing

Contributions are welcome! Please open an issue or submit a pull request with any improvements, bug fixes, or new features.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Directories

Path Synopsis
cmd
kubectl-sgmap
Code generated by kubectl-plugin-builder.
Code generated by kubectl-plugin-builder.
internal
aws
cmd
MIT License * * Copyright (c) 2024 naka-gawa * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software.
MIT License * * Copyright (c) 2024 naka-gawa * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software.
cmd/sgmap
MIT License * * Copyright (c) 2024 naka-gawa * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software.
MIT License * * Copyright (c) 2024 naka-gawa * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software.
cmd/sgmap/pod
MIT License * * Copyright (c) 2024 naka-gawa * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software.
MIT License * * Copyright (c) 2024 naka-gawa * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software.
k8s
lib

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL