mirror of
https://github.com/kubescape/kubescape.git
synced 2026-04-15 06:58:11 +00:00
Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca49bc1ddd | ||
|
|
1229c73ddc | ||
|
|
7416202555 | ||
|
|
a0ba683eea | ||
|
|
89654eb26f | ||
|
|
9d1736a141 | ||
|
|
eaa4ed3da5 | ||
|
|
0db3f65312 | ||
|
|
1ea0a3ccc5 | ||
|
|
16cd30bea8 | ||
|
|
075ba4c603 | ||
|
|
2d898822df | ||
|
|
25b8ec82e8 | ||
|
|
44b74e2681 | ||
|
|
485e171008 | ||
|
|
c12eb83b4b | ||
|
|
84060e7823 | ||
|
|
d80d50b59d | ||
|
|
f11f054fea | ||
|
|
ccbc11408b |
10
README.md
10
README.md
@@ -78,6 +78,12 @@ Set-ExecutionPolicy RemoteSigned -scope CurrentUser
|
||||
kubescape scan framework nsa --exclude-namespaces kube-system,kube-public
|
||||
```
|
||||
|
||||
|
||||
* Scan a running Kubernetes cluster with [`mitre`](https://www.microsoft.com/security/blog/2020/04/02/attack-matrix-kubernetes/) framework
|
||||
```
|
||||
kubescape scan framework mitre --exclude-namespaces kube-system,kube-public
|
||||
```
|
||||
|
||||
* Scan local `yaml`/`json` files before deploying
|
||||
```
|
||||
kubescape scan framework nsa *.yaml
|
||||
@@ -115,7 +121,7 @@ for example:
|
||||
```
|
||||
helm template bitnami/mysql --generate-name --dry-run | kubescape scan framework nsa -
|
||||
```
|
||||
### Offline Support <img src="docs/new-feature.svg">
|
||||
### Offline Support
|
||||
|
||||
It is possible to run Kubescape offline!
|
||||
|
||||
@@ -140,7 +146,7 @@ Kubescape is an open source project, we welcome your feedback and ideas for impr
|
||||
Kubescpae can be built using:
|
||||
|
||||
``` sh
|
||||
python built.py
|
||||
python build.py
|
||||
```
|
||||
|
||||
Note: In order to built using the above script, one must set the environment
|
||||
|
||||
10
build.py
10
build.py
@@ -28,7 +28,7 @@ def getBuildDir():
|
||||
|
||||
def getPackageName():
|
||||
packageName = "kubescape"
|
||||
if platform.system() == "Windows": packageName += ".exe"
|
||||
# if platform.system() == "Windows": packageName += ".exe"
|
||||
|
||||
return packageName
|
||||
|
||||
@@ -56,10 +56,10 @@ def main():
|
||||
# Get dependencies
|
||||
try:
|
||||
status = subprocess.call(["go", "mod", "tidy"])
|
||||
checkStatus(status, "Faild to get dependancies")
|
||||
checkStatus(status, "Failed to get dependencies")
|
||||
|
||||
except OSError:
|
||||
print("An error occure: (Hint: check if go is installed)")
|
||||
print("An error occured: (Hint: check if go is installed)")
|
||||
raise
|
||||
|
||||
# Build kubescape
|
||||
@@ -67,7 +67,7 @@ def main():
|
||||
% (buildUrl, releaseVersion, BE_SERVER_CONST, ArmoBEServer,
|
||||
ER_SERVER_CONST, ArmoERServer, WEBSITE_CONST, ArmoWebsite)
|
||||
status = subprocess.call(["go", "build", "-o", "%s/%s" % (buildDir, packageName), "-ldflags" ,ldflags])
|
||||
checkStatus(status, "Faild to build kubescape")
|
||||
checkStatus(status, "Failed to build kubescape")
|
||||
|
||||
|
||||
sha1 = hashlib.sha1()
|
||||
@@ -76,7 +76,7 @@ def main():
|
||||
with open(buildDir + "/" + packageName + ".sha1", "w") as kube_sha:
|
||||
kube_sha.write(sha1.hexdigest())
|
||||
|
||||
print("Build Done.")
|
||||
print("Build Done")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -189,20 +189,20 @@ func (c *ClusterConfig) SetKeyValueInConfigmap(key string, value string) error {
|
||||
|
||||
func (c *ClusterConfig) SetCustomerGUID() error {
|
||||
|
||||
// get from file
|
||||
if existsConfigJson() {
|
||||
c.configObj, _ = loadConfigFromFile()
|
||||
} else if c.existsConfigMap() {
|
||||
// get from configMap
|
||||
if c.existsConfigMap() {
|
||||
c.configObj, _ = c.loadConfigFromConfigMap()
|
||||
} else if existsConfigJson() { // get from file
|
||||
c.configObj, _ = loadConfigFromFile()
|
||||
} else {
|
||||
c.createConfigMap()
|
||||
createConfigJson()
|
||||
}
|
||||
|
||||
customerGUID := c.GetCustomerGUID()
|
||||
|
||||
// get from armoBE
|
||||
tenantResponse, err := c.armoAPI.GetCustomerGUID(customerGUID)
|
||||
|
||||
if err == nil && tenantResponse != nil {
|
||||
if tenantResponse.AdminMail != "" { // this customer already belongs to some user
|
||||
if existsConfigJson() {
|
||||
@@ -222,7 +222,7 @@ func (c *ClusterConfig) SetCustomerGUID() error {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if err != nil && strings.Contains(err.Error(), "Invitation for tenant already exists") {
|
||||
if err != nil && strings.Contains(err.Error(), "already exists") {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
|
||||
@@ -98,7 +98,7 @@ func hasException(designator *armotypes.PortalDesignator, workload k8sinterface.
|
||||
return false // if designators are empty
|
||||
}
|
||||
|
||||
if cluster != "" && cautils.ClusterName != "" && regexCompare(cluster, cautils.ClusterName) { // TODO - where do we receive cluster name from?
|
||||
if cluster != "" && cautils.ClusterName != "" && !regexCompare(cluster, cautils.ClusterName) { // TODO - where do we receive cluster name from?
|
||||
return false // cluster name does not match
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user