MMMMMMorty and GitHub
bc33f10d0a
feat: Add the debugging ability for scanning Helm chart ( #1215 )
...
* Fix issue 11552
Signed-off-by: MMMMMMorty <465346562@qq.com >
* Add helm chart mapping node for sarif printer
Signed-off-by: mmmmmmorty <mmmmmmorty@outlook.com >
* add MappingNodes to getWorkloadFromHelmChart
Signed-off-by: mmmmmmorty <mmmmmmorty@outlook.com >
* clear the code to mappingnode and parseFile
Signed-off-by: mmmmmmorty <mmmmmmorty@outlook.com >
* add input to fixPathsToString
Signed-off-by: mmmmmmorty <mmmmmmorty@outlook.com >
* add fixs for error message
Signed-off-by: mmmmmmorty <mmmmmmorty@outlook.com >
* Add solution for multiple files in one yaml helm chart file
Signed-off-by: mmmmmmorty <mmmmmmorty@outlook.com >
* Add parseFile tests
Signed-off-by: mmmmmmorty <mmmmmmorty@outlook.com >
---------
Signed-off-by: MMMMMMorty <465346562@qq.com >
Signed-off-by: mmmmmmorty <mmmmmmorty@outlook.com >
2024-03-01 14:31:51 +02:00
Matthias Bertschy
3e287db1f9
remove libgit files and dependencies
...
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com >
2024-01-20 10:24:21 +01:00
Amir Malka and GitHub
4b8786bcaa
checking for compatible policy rules before pulling k8s resources; failing to pull some k8s resource should not fail the entire scan ( #1578 )
...
Signed-off-by: Amir Malka <amirm@armosec.io >
2024-01-09 09:44:45 +02:00
David Wertenteil and GitHub
65a557db90
fixed test ( #1573 )
...
* fixed test
Signed-off-by: David Wertenteil <dwertent@armosec.io >
* update cosign-release version
Signed-off-by: David Wertenteil <dwertent@armosec.io >
* fixed filepath related tests
Signed-off-by: David Wertenteil <dwertent@armosec.io >
* failed windows tests
Signed-off-by: David Wertenteil <dwertent@armosec.io >
* fixed cosign version
Signed-off-by: David Wertenteil <dwertent@armosec.io >
* update go version
Signed-off-by: David Wertenteil <dwertent@armosec.io >
* fixed test
Signed-off-by: David Wertenteil <dwertent@armosec.io >
* change actor
Signed-off-by: David Wertenteil <dwertent@armosec.io >
* Cosign use secret
Signed-off-by: David Wertenteil <dwertent@armosec.io >
* update cosign
Signed-off-by: David Wertenteil <dwertent@armosec.io >
* update cosign
Signed-off-by: David Wertenteil <dwertent@armosec.io >
---------
Signed-off-by: David Wertenteil <dwertent@armosec.io >
2024-01-07 16:26:34 +02:00
VaibhavMalik4187
155889a479
Added missing tests for locationresolver
...
Wrote new tests to cover the unhandled statements in the
`NewFixPathLocationResolver` and `ResolveLocation` functions.
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com >
2023-12-23 17:23:07 +05:30
Matthias Bertschy
e29e6a5e8a
add wlid annotation to workloadconfigurationscans and summaries
...
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com >
2023-12-12 10:42:02 +01:00
Yuval Leibovich and GitHub
e4e795c6dc
Merge pull request #1548 from kubescape/remove-armoBuiltin
...
Removal of "armoBuiltin" attribute from JSON files
2023-11-27 16:17:35 +02:00
VaibhavMalik4187
d1b78856ca
Added tests for versioncheck and printer packages
...
Wrote new tests for the following files:
- junit.go
- pdf.go
- versioncheck.go
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com >
2023-11-27 18:25:34 +05:30
Yuval Leibovich and GitHub
69362ae415
Update MITRE.json
...
Signed-off-by: Yuval Leibovich <89763818+yuleib@users.noreply.github.com >
2023-11-27 12:01:14 +02:00
Yuval Leibovich and GitHub
bb17e1de78
Update NSA.json
...
Signed-off-by: Yuval Leibovich <89763818+yuleib@users.noreply.github.com >
2023-11-27 11:57:31 +02:00
Yuval Leibovich and GitHub
504891f519
Update C-0001.json
...
Signed-off-by: Yuval Leibovich <89763818+yuleib@users.noreply.github.com >
2023-11-27 11:51:09 +02:00
Daniel Grunberger
952beddcc3
add scan source
...
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io >
2023-11-27 11:24:25 +02:00
Mehdi Moussaif
70a010976e
Removed unused functions
...
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com >
2023-11-26 19:06:10 +01:00
sulemaanhamza
c84a8a7dea
Enhancements in strutils and added test-suite with edge-case test-cases
...
Signed-off-by: sulemaanhamza <sulemanhamza97@gmail.com >
2023-11-26 12:43:17 +05:00
Matthias Bertschy and GitHub
2adb72be8e
Merge pull request #1509 from mohaidoss/tests/cautils-jsonutils
...
Adding Unit Tests and Bug Fix for core/cautils
2023-11-25 10:47:36 +01:00
Matthias Bertschy and GitHub
43ba550f72
Merge pull request #1486 from cbrom/core_cautils_getter_json_tests
...
Adding Additional Test Cases for JSONDecoder in core/cautils/getter
2023-11-25 10:43:36 +01:00
Mehdi Moussaif
9611fb631b
Adding tests core/cautils/kustomizeddirectory
...
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com >
2023-11-24 23:43:10 +01:00
Mehdi Moussaif
44ddbc6ae5
Bug fix IsKustomizeDirectory returning parent dir
...
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com >
2023-11-24 23:42:17 +01:00
cbrom
f86fa99316
reverted core/cautils/getter/json.go file, as the json and init of json is necessary
...
Signed-off-by: cbrom <kb.cbrom@gmail.com >
2023-11-25 00:59:45 +03:00
cbrom
2603f04cfc
added tests for empty and invalid string inputs to JSONDecoder
...
Signed-off-by: cbrom <kb.cbrom@gmail.com >
changed test input to clearly show its not a valid
Signed-off-by: cbrom <kb.cbrom@gmail.com >
added tests for valid json input to JSONDecoder function
Signed-off-by: cbrom <kb.cbrom@gmail.com >
check for specific error message instead of just error return
Signed-off-by: cbrom <kb.cbrom@gmail.com >
check for specific error message instead of just error return
Signed-off-by: cbrom <kb.cbrom@gmail.com >
package imports added
Signed-off-by: cbrom <kb.cbrom@gmail.com >
removed unnecessary mock json file
Signed-off-by: cbrom <kb.cbrom@gmail.com >
min function moved to kscloudapi.go
Signed-off-by: cbrom <kb.cbrom@gmail.com >
added necessary functions to make a post api call
Signed-off-by: cbrom <kb.cbrom@gmail.com >
getLatestVersion now uses KSCloudAPI functions
Signed-off-by: cbrom <kb.cbrom@gmail.com >
reverted moved function min back
Signed-off-by: cbrom <kb.cbrom@gmail.com >
removed unncessary functions and simplified post method
Signed-off-by: cbrom <kb.cbrom@gmail.com >
modified call to APIPostRequest
Signed-off-by: cbrom <kb.cbrom@gmail.com >
renamed HTTPPost request function and added httpClient param (for testing purposes)
Signed-off-by: cbrom <kb.cbrom@gmail.com >
changed function name call
Signed-off-by: cbrom <kb.cbrom@gmail.com >
removed HTTPPost function test
Signed-off-by: cbrom <kb.cbrom@gmail.com >
net/http imported
Signed-off-by: cbrom <kb.cbrom@gmail.com >
bytes import removed
Signed-off-by: cbrom <kb.cbrom@gmail.com >
test added for HTTPPost function
Signed-off-by: cbrom <kb.cbrom@gmail.com >
removed json decoder as it is not necessary anymore
Signed-off-by: cbrom <kb.cbrom@gmail.com >
removed HttpPost function
Signed-off-by: cbrom <kb.cbrom@gmail.com >
2023-11-25 00:00:58 +03:00
Mehdi Moussaif
dfd13aea6f
Add tests for krewutils
...
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com >
2023-11-24 18:48:04 +01:00
Mehdi Moussaif
9fda098f70
Add tests for workloadmappingutils
...
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com >
2023-11-24 18:37:19 +01:00
Mehdi Moussaif
94f6261055
Add Test to PrettyJson
...
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com >
2023-11-24 17:42:43 +01:00
Mehdi Moussaif
1d7519c3b7
Added tests for core/cautils/versioncheck
...
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com >
2023-11-24 15:39:06 +01:00
Mehdi Moussaif
6cf03bd679
bug resetting the var LatestReleaseVersion
...
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com >
enhancement of update CMD
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com >
2023-11-24 15:38:09 +01:00
Matthias Bertschy and GitHub
5d795edd31
Merge pull request #1493 from mohaidoss/fix-download-artifacts
...
Fix for Kubescape Reading Policies from Local File
2023-11-23 12:56:54 +01:00
Mehdi Moussaif
fd390bbd37
Bug fix where kubescape fails to read from framework local paths
...
Fix typo in error description
Bug fix where kubescape get policies from file
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com >
Missing '.json' extension when getting Framework Paths
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com >
Appropriate test case for FrameworksPaths
Bug fix where kubescape fails to read from frameworks local paths
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com >
2023-11-23 12:46:44 +01:00
Cbrom and GitHub
5455855e65
Merge branch 'kubescape:master' into core_cautils_datastructuremethods_tests
2023-11-22 22:13:58 +03:00
cbrom
12056f4cad
fixed a test where it would run 1 test case twice
...
Signed-off-by: cbrom <kb.cbrom@gmail.com >
2023-11-22 19:28:30 +03:00
cbrom
d96ab483a4
code improvement on type assertion for useFromKubescapeVersion and useUntilKubescapeVersion
...
Signed-off-by: cbrom <kb.cbrom@gmail.com >
2023-11-22 19:27:52 +03:00
Matthias Bertschy and GitHub
dc6c379aa2
Merge pull request #1487 from cbrom/core_cautils_datastructuremethods_tests
...
Adding Tests and Refactoring for ruleWithKSOpaDependency Function in cautils
2023-11-22 17:21:17 +01:00
VaibhavMalik4187
beb6d9535c
Added tests for cautils
...
Wrote new tests for the following files:
- controllink.go
- display.go
- fileutils.go
- getter/getpoliciesutils.go
- getter/utils.go
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com >
2023-11-22 20:24:16 +05:30
cbrom
4ae45cd727
added tests for non string values of useUntilKubescapeVersion and useFromKubescapeVersion
...
Signed-off-by: cbrom <kb.cbrom@gmail.com >
2023-11-22 11:39:36 +03:00
cbrom
b0a376aa2b
safe check from and until strings before usage in isRuleKubescapeVersionCompatible function
...
Signed-off-by: cbrom <kb.cbrom@gmail.com >
2023-11-22 11:39:36 +03:00
cbrom
d45c97cef0
removed ruleWithKSOpaDependency function along with tests
...
Signed-off-by: cbrom <kb.cbrom@gmail.com >
2023-11-22 11:24:44 +03:00
cbrom
7eb97fcba0
added tests for ruleWithKSOpaDependency function
...
Signed-off-by: cbrom <kb.cbrom@gmail.com >
2023-11-22 02:07:36 +03:00
cbrom
73d1805ce6
added tests for ruleWithKSOpaDependency function
...
Signed-off-by: cbrom <kb.cbrom@gmail.com >
2023-11-22 02:07:19 +03:00
Amir Malka and GitHub
0191135b10
support a backend with service discovery v2 ( #1479 )
...
Signed-off-by: Amir Malka <amirm@armosec.io >
2023-11-21 11:40:33 +02:00
David Wertenteil
450df679cd
bump logger version
...
Signed-off-by: David Wertenteil <dwertent@armosec.io >
2023-10-31 18:22:03 +02:00
c9ccef90f3
Pretty up the pretty-printer. ( #1451 )
...
* Pretty up the pretty-printer.
Signed-off-by: Craig Box <craigb@armosec.io >
* add some text fixes for the Operator also
Signed-off-by: Craig Box <craigb@armosec.io >
* fix another verb
Signed-off-by: Craig Box <craigb@armosec.io >
* fixed unit tests
Signed-off-by: David Wertenteil <dwertent@armosec.io >
* fixed test
Signed-off-by: David Wertenteil <dwertent@armosec.io >
---------
Signed-off-by: Craig Box <craigb@armosec.io >
Signed-off-by: David Wertenteil <dwertent@armosec.io >
Co-authored-by: David Wertenteil <dwertent@armosec.io >
2023-10-31 18:07:43 +02:00
David Wertenteil and GitHub
3b2feca0dd
Update flags ( #1462 )
...
* add access key flag to the scan command
Signed-off-by: David Wertenteil <dwertent@armosec.io >
* support triggering ns
Signed-off-by: David Wertenteil <dwertent@armosec.io >
* Fixed json keys
Signed-off-by: David Wertenteil <dwertent@armosec.io >
* get k8s config
Signed-off-by: David Wertenteil <dwertent@armosec.io >
---------
Signed-off-by: David Wertenteil <dwertent@armosec.io >
2023-10-31 15:41:18 +02:00
David Wertenteil and GitHub
3e2314a269
Bump v3 ( #1449 )
...
* bump version
Signed-off-by: David Wertenteil <dwertent@armosec.io >
* change default view
Signed-off-by: David Wertenteil <dwertent@armosec.io >
* fixed tests
Signed-off-by: David Wertenteil <dwertent@armosec.io >
* fixed go mod
Signed-off-by: David Wertenteil <dwertent@armosec.io >
---------
Signed-off-by: David Wertenteil <dwertent@armosec.io >
2023-10-22 17:43:51 +03:00
David Wertenteil and GitHub
c143d10130
Cloud provider detection ( #1448 )
...
* set cloud provider using nodes
* use scan metadata for scanning scope
* code cleanup
Signed-off-by: David Wertenteil <dwertent@armosec.io >
* handle error
Signed-off-by: David Wertenteil <dwertent@armosec.io >
---------
Signed-off-by: David Wertenteil <dwertent@armosec.io >
2023-10-22 15:47:57 +03:00
David Wertenteil and GitHub
d5407466d5
Preparing Kubescape for v3 ( #1403 )
...
* wip: minor cli fixes
Signed-off-by: David Wertenteil <dwertent@armosec.io >
* wip: change default view
Signed-off-by: David Wertenteil <dwertent@armosec.io >
* wip: reduce default topWorkloadsNumber to 3
Signed-off-by: David Wertenteil <dwertent@armosec.io >
* update gif
Signed-off-by: David Wertenteil <dwertent@armosec.io >
* default view for controls and frameworks
---------
Signed-off-by: David Wertenteil <dwertent@armosec.io >
2023-10-22 15:39:58 +03:00
rcohencyberarmor and GitHub
052c042dac
Support backend access key ( #1404 )
...
Support backend access key
Signed-off-by: Amir Malka <amirm@armosec.io >
2023-10-22 15:10:08 +03:00
72b64127c7
Restructure img cmd ( #1398 )
...
* feat: add kubescape patch command
Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com >
* update patch command output format
Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com >
* fix patch command logic
Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com >
* update docs & minor changes
Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com >
* restructure cmd
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io >
* fix tests
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io >
* readme
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io >
* fix version code
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io >
* go mod
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io >
---------
Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com >
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io >
Co-authored-by: Anubhav Gupta <mail.anubhav06@gmail.com >
Co-authored-by: Daniel Grunberger <danielgrunberger@armosec.io >
2023-10-22 14:51:39 +03:00
Matthias Bertschy and GitHub
3efa40e808
use go-gitlog as an alternative to git2go ( #1393 )
...
* use go-gitlog as an alternative to git2go
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com >
* set RELEASE to something to avoid failing binary-build step
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com >
---------
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com >
2023-10-15 15:16:05 +03:00
884af50c0b
Support control cluster from cli ( #1391 )
...
* adding operator CLI to kubescape
Signed-off-by: rcohencyberarmor <rcohen@armosec.io >
* support http requet for trigger in cluster operator
Signed-off-by: rcohencyberarmor <rcohen@armosec.io >
* create interface for create request payload
Signed-off-by: rcohencyberarmor <rcohen@armosec.io >
* logs + go mod update
Signed-off-by: rcohencyberarmor <rcohen@armosec.io >
* docs
Signed-off-by: rcohencyberarmor <rcohen@armosec.io >
* add relevant system tests
Signed-off-by: rcohencyberarmor <rcohen@armosec.io >
* linter corrections
Signed-off-by: rcohencyberarmor <rcohen@armosec.io >
* code review corrections
Signed-off-by: rcohencyberarmor <rcohen@armosec.io >
* remove non relevant system tests - after code review corrections
Signed-off-by: rcohencyberarmor <rcohen@armosec.io >
* PR corrections
Signed-off-by: rcohencyberarmor <rcohen@armosec.io >
* PR corrections
Signed-off-by: rcohencyberarmor <rcohen@armosec.io >
* change log
Signed-off-by: rcohencyberarmor <rcohen@armosec.io >
* remove from examples
Signed-off-by: rcohencyberarmor <rcohen@armosec.io >
* change log
Signed-off-by: rcohencyberarmor <rcohen@armosec.io >
* test correction
Signed-off-by: rcohencyberarmor <rcohen@armosec.io >
---------
Signed-off-by: rcohencyberarmor <rcohen@armosec.io >
Co-authored-by: rcohencyberarmor <rcohen@armosec.io >
2023-09-27 16:31:04 +03:00
Amir Malka and GitHub
8257e31232
Save scan results in storage and support scanning a deleted resource ( #1376 )
...
* store scan results in storage
Signed-off-by: Amir Malka <amirm@armosec.io >
* store scan results in storage
Signed-off-by: Amir Malka <amirm@armosec.io >
* save resources in their namespaces, load namespace from env var, extend the config obj
Signed-off-by: Amir Malka <amirm@armosec.io >
* setting context name
Signed-off-by: Amir Malka <amirm@armosec.io >
* updated k8s-interface
Signed-off-by: Amir Malka <amirm@armosec.io >
* scanning a deleted resource
Signed-off-by: Amir Malka <amirm@armosec.io >
* cr changes
Signed-off-by: Amir Malka <amirm@armosec.io >
* cr changes
Signed-off-by: Amir Malka <amirm@armosec.io >
* fix
Signed-off-by: Amir Malka <amirm@armosec.io >
* remove unused constants
Signed-off-by: Amir Malka <amirm@armosec.io >
* use t.Setenv
Signed-off-by: Amir Malka <amirm@armosec.io >
* added tests for rbac triplet slugs
Signed-off-by: Amir Malka <amirm@armosec.io >
* updated namespace logic
Signed-off-by: Amir Malka <amirm@armosec.io >
* fix test
Signed-off-by: Amir Malka <amirm@armosec.io >
---------
Signed-off-by: Amir Malka <amirm@armosec.io >
2023-09-14 10:03:36 +03:00
26c47d501c
move context flag to root ( #1367 )
...
* move context flag to root
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io >
* rm from httphandler
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io >
---------
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io >
Co-authored-by: Daniel Grunberger <danielgrunberger@armosec.io >
2023-09-03 10:39:15 +03:00