This repository has been archived by the owner on Oct 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* autofix initialized * add new setfields function * Fix the object creation * add ErrorMissingDefaultDenyIngressAndEgressNetworkPolicy * add tests for functionality check * add tests for ingress and egress * Delete profile.out * fix the root manifest bug * Merge branch 'autofixnetworkPolicy' of github.com:Shopify/kubeaudit into autofixnetworkPolicy * refactor code according to suggestions * refactir code again and removed redundant write function * add test for both fixed and extra Resources * add beta2 test for autofix * get rid of dead code
- Loading branch information
Showing
22 changed files
with
451 additions
and
25 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package cmd | ||
|
||
func fixNetworkPolicy(resource Resource, occurrence Occurrence) Resource { | ||
var obj Resource | ||
nsName := getNamespaceName(resource) | ||
if occurrence.id == ErrorMissingDefaultDenyIngressNetworkPolicy { | ||
obj = setNetworkPolicyFields(nsName, []string{"Ingress"}) | ||
} | ||
if occurrence.id == ErrorMissingDefaultDenyEgressNetworkPolicy { | ||
obj = setNetworkPolicyFields(nsName, []string{"Egress"}) | ||
} | ||
if occurrence.id == ErrorMissingDefaultDenyIngressAndEgressNetworkPolicy { | ||
obj = setNetworkPolicyFields(nsName, []string{"Ingress", "Egress"}) | ||
} | ||
return obj | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.