1
0
mirror of https://github.com/aquasecurity/kube-bench.git synced 2024-12-19 05:08:07 +00:00

removes federated (#431)

This commit is contained in:
Roberto Rojas 2019-10-12 19:00:26 -04:00 committed by GitHub
parent 91dfeb7577
commit c22f81610d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 4 additions and 68 deletions

View File

@ -5,7 +5,6 @@
## Uncomment to use different control file paths.
# masterControls: ./cfg/master.yaml
# nodeControls: ./cfg/node.yaml
# federatedControls: ./cfg/federated.yaml
master:
components:
@ -131,21 +130,4 @@ node:
svc:
- "/lib/systemd/system/kube-proxy.service"
defaultconf: /etc/kubernetes/addons/kube-proxy-daemonset.yaml
defaultkubeconfig: "/etc/kubernetes/proxy.conf"
federated:
components:
- fedapiserver
- fedcontrollermanager
fedapiserver:
bins:
- "hyperkube federation-apiserver"
- "kube-federation-apiserver"
- "federation-apiserver"
fedcontrollermanager:
bins:
- "hyperkube federation-controller-manager"
- "kube-federation-controller-manager"
- "federation-controller-manager"
defaultkubeconfig: "/etc/kubernetes/proxy.conf"

View File

@ -26,7 +26,7 @@ import (
"github.com/golang/glog"
)
// NodeType indicates the type of node (master, node, federated).
// NodeType indicates the type of node (master, node).
type NodeType string
// State is the state of a control check.
@ -46,8 +46,6 @@ const (
MASTER NodeType = "master"
// NODE a node
NODE NodeType = "node"
// FEDERATED a federated deployment.
FEDERATED NodeType = "federated"
)
func handleError(err error, context string) (errmsg string) {

View File

@ -207,8 +207,6 @@ func loadConfig(nodetype check.NodeType) string {
file = masterFile
case check.NODE:
file = nodeFile
case check.FEDERATED:
file = federatedFile
}
runningVersion := ""

View File

@ -1,41 +0,0 @@
// Copyright © 2017 Aqua Security Software Ltd. <info@aquasec.com>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package cmd
import (
"github.com/aquasecurity/kube-bench/check"
"github.com/spf13/cobra"
)
// nodeCmd represents the node command
var federatedCmd = &cobra.Command{
Use: "federated",
Short: "Run benchmark checks for a Kubernetes federated deployment.",
Long: `Run benchmark checks for a Kubernetes federated deployment.`,
Run: func(cmd *cobra.Command, args []string) {
runChecks(check.FEDERATED)
},
}
func init() {
federatedCmd.PersistentFlags().StringVarP(&federatedFile,
"file",
"f",
"/federated.yaml",
"Alternative YAML file for federated checks",
)
RootCmd.AddCommand(federatedCmd)
}

View File

@ -42,7 +42,6 @@ var (
pgSQL bool
masterFile = "master.yaml"
nodeFile = "node.yaml"
federatedFile string
noResults bool
noSummary bool
noRemediations bool
@ -134,12 +133,12 @@ func initConfig() {
// Precedence: Command line flags take precedence over environment variables.
viper.SetEnvPrefix(envVarsPrefix)
viper.AutomaticEnv()
if kubeVersion == "" {
if env := viper.Get("version"); env != nil {
kubeVersion = env.(string)
}
}
}
// If a config file is found, read it in.
if err := viper.ReadInConfig(); err != nil {